-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix display of ParseFile in Config #666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix display of ParseFile in Config #666
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think?
@@ -72,6 +72,8 @@ class Config extends TableView { | |||
let value = data.value; | |||
let modalValue = value; | |||
let type = typeof value; | |||
let openModalWhenClinkingValue = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove that and handle in openModal
} else if (value instanceof Parse.File) { | ||
type = 'File'; | ||
value = <a target='_blank' href={value.url()}>Open in new window</a>; | ||
openModalWhenClinkingValue = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove that :)
return ( | ||
<tr key={data.param}> | ||
<td style={columnStyle} onClick={openModal}>{data.param}</td> | ||
<td style={columnStyle} onClick={openModal}>{type}</td> | ||
<td style={columnStyle} onClick={openModal}>{value}</td> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert that :)
@@ -105,11 +108,19 @@ class Config extends TableView { | |||
modalValue: modalValue | |||
}); | |||
let columnStyle = { width: '30%', cursor: 'pointer' }; | |||
|
|||
let valueColumn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove all that, and check in openModal
let openModal = () => this.setState({
modalOpen: true,
modalParam: data.param,
modalType: type,
modalValue: modalValue
});
// to:
let openModal = () => {
if (modalValue instanceof Parse.File) { return }
this.setState({
modalOpen: true,
modalParam: data.param,
modalType: type,
modalValue: modalValue
});
}
e642679
to
d94dda6
Compare
@natanrolnik updated the pull request - view changes |
@@ -40,7 +40,7 @@ export default class FileInput extends React.Component { | |||
render() { | |||
let inputProps = { | |||
type: 'file', | |||
value: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was generating a warning with files
@flovilmart thanks for your review! But I couldn't move the As a plus, I've also fixed the display of GeoPoints! |
This PR fixes the display of
Parse.File
s and GeoPoints in the Config section of the Dashboard.Now that @flovilmart fixed saving Files to Config in Parse Server (parse-community/parse-server#3457), this is the last bit to have it working in the dashboard.
Before:
After
@JeremyPlease @dvanwinkle @steven-supersolid if anyone of you could review, it would be great.