Skip to content

Commit 785978e

Browse files
authored
fix: various UI bugs (e.g. filter data browser, switch app, upload file) (#2014)
1 parent 98cf0ee commit 785978e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/FileEditor/FileEditor.react.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default class FileEditor extends React.Component {
7878
render() {
7979
const file = this.props.value;
8080
return (
81-
<div ref={this.inputRef.current} style={{ minWidth: this.props.width, display: 'none' }} className={styles.editor}>
81+
<div ref={this.inputRef} style={{ minWidth: this.props.width, display: 'none' }} className={styles.editor}>
8282
<a className={styles.upload}>
8383
<input ref={this.fileInputRef} id='fileInput' type='file' onChange={this.handleChange.bind(this)} />
8484
<span>{file ? 'Replace file' : 'Upload file'}</span>

src/dashboard/Data/Browser/Browser.react.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class Browser extends DashboardView {
167167
}
168168

169169
componentWillReceiveProps(nextProps, nextContext) {
170-
if (this.props.params.className !== nextProps.params.className) {
170+
if (this.props.params.appId !== nextProps.params.appId || this.props.params.className !== nextProps.params.className || this.props.location.search !== nextProps.location.search) {
171171
if (this.props.params.appId !== nextProps.params.appId || !this.props.params.className) {
172172
this.setState({ counts: {} });
173173
Parse.Object._clearAllState();
@@ -177,7 +177,7 @@ class Browser extends DashboardView {
177177
.then(() => this.handleFetchedSchema());
178178
}
179179
if (!nextProps.params.className && nextProps.schema.data.get('classes')) {
180-
this.redirectToFirstClass(nextProps.schema.data.get('classes'));
180+
this.redirectToFirstClass(nextProps.schema.data.get('classes'), nextContext);
181181
}
182182
}
183183

@@ -225,7 +225,7 @@ class Browser extends DashboardView {
225225
return filters;
226226
}
227227

228-
redirectToFirstClass(classList) {
228+
redirectToFirstClass(classList, context) {
229229
if (!classList.isEmpty()) {
230230
let classes = Object.keys(classList.toObject());
231231
classes.sort((a, b) => {
@@ -237,7 +237,7 @@ class Browser extends DashboardView {
237237
}
238238
return a.toUpperCase() < b.toUpperCase() ? -1 : 1;
239239
});
240-
history.replace(generatePath(this.context, 'browser/' + classes[0]));
240+
history.replace(generatePath(context || this.context, 'browser/' + classes[0]));
241241
}
242242
}
243243

0 commit comments

Comments
 (0)