Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
93f2fc1
* chore(package): update lockfile package-lock.json
MutterPedro Dec 5, 2019
f5e156a
added id tho the code editor props
Dec 13, 2019
76a6f82
Merge branch 'master' of github.com:parse-community/parse-dashboard i…
MutterPedro Dec 24, 2019
6108838
Merge branch 'playground' of github.com:MutterPedro/parse-dashboard i…
MutterPedro Dec 24, 2019
ea1bd42
added playground to dashboard
MutterPedro Dec 24, 2019
105ac0c
added react-json dependency to show playground results
MutterPedro Jan 11, 2020
bc6413a
added saving code feature and fixed multiline run feature
MutterPedro Feb 1, 2020
473a1f0
update changelog
MutterPedro Feb 1, 2020
04e767b
Merge branch 'master' into playground
MutterPedro Feb 3, 2020
c2e405e
Merge branch 'master' into playground
MutterPedro Feb 6, 2020
772c15f
fix playground button CSS spacing and update risky dependencies
Feb 7, 2020
3fd2e9d
Merge branch 'master' into playground
Feb 7, 2020
767afb2
Merge branch 'master' into playground
davimacedo Feb 8, 2020
892528e
fix(React life-cycle): fixes requested on PR #1464 review
Feb 10, 2020
de395c3
Merge branch 'master' of github.com:parse-community/parse-dashboard i…
Feb 10, 2020
9594f6e
Merge branch 'playground' of github.com:MutterPedro/parse-dashboard i…
Feb 10, 2020
c2c4e59
feat(Playground): update CodeEditor component and show result just in…
Feb 15, 2020
ca7a6d7
feat(Playground): update CodeEditor component and show result just in…
Feb 15, 2020
6a2ba91
fix(Playground): fix conflicts
Feb 15, 2020
0262c9f
fix(Playground): fix erron in test of CodeEditor component
Feb 15, 2020
078454b
Update parse-dashboard-config.json
MutterPedro Feb 16, 2020
d9c7fb6
fix(Playground): implemented requested changes and put Playground int…
Feb 17, 2020
00be77f
Merge branch 'master' into playground
MutterPedro Feb 17, 2020
457337f
fix(Playground): fix double quotes and change JS Console playground
Feb 18, 2020
adde42b
fix(Playground): fix merge conflicts
Feb 18, 2020
e7cd71a
fix(Playground): fix merge conflicts
Feb 18, 2020
cd71380
fix(Playground): fix merge conflicts
Feb 18, 2020
c954d73
Merge branch 'playground' of github.com:MutterPedro/parse-dashboard i…
Feb 18, 2020
1a60ed7
fix(Playground): fix missing dependency
Feb 18, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
### master
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/2.0.4...master)

* _Contributing to this repo? Add info about your change here to be included in next release_
* Feature: added playground feature to run custom queries
* Feature: added save button on playground feature to save the custom query on the local storage
### 2.0.5
[Full Changelog](https://github.com/parse-community/parse-dashboard/compare/2.0.4...2.0.5)
* Fix: delete and regenerate package-lock to fix broken build
Expand Down
12 changes: 0 additions & 12 deletions Parse-Dashboard/parse-dashboard-config.json

This file was deleted.

1,593 changes: 1,076 additions & 517 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@
"react-dnd-html5-backend": "10.0.2",
"react-dom": "16.12.0",
"react-helmet": "5.2.1",
"react-json-view": "^1.19.1",
"react-redux": "5.1.1",
"react-router": "5.1.2",
"react-router-dom": "5.1.2",
"react-simple-code-editor": "^0.10.0",
"regenerator-runtime": "0.13.3",
"semver": "7.1.2"
},
Expand All @@ -90,7 +92,7 @@
"http-server": "0.12.0",
"jest": "24.8.0",
"marked": "0.8.0",
"node-sass": "4.13.0",
"node-sass": "^4.13.1",
"null-loader": "^3.0.0",
"parse-server": "github:parseplatform/parse-server#master",
"path-to-regexp": "3.2.0",
Expand Down
2 changes: 1 addition & 1 deletion src/components/BrowserFilter/BrowserFilter.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class BrowserFilter extends React.Component {
this.node = ReactDOM.findDOMNode(this);
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
if (props.className !== this.props.className) {
this.setState({ open: false });
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Calendar/Calendar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class Calendar extends React.Component {
};
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
if (props.value) {
this.setState({
currentMonth: new Date(props.value[getDateMethod(props.local, 'getFullYear')](), props.value[getDateMethod(props.local, 'getMonth')](), 1)
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChromeDropdown/ChromeDropdown.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class ChromeDropdown extends React.Component {
};
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.keyValueMap = {};
nextProps.options.forEach((value) => {
if (value instanceof Object) {
Expand All @@ -34,7 +34,7 @@ export default class ChromeDropdown extends React.Component {
}
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.styles = this.props.styles || styles;
}

Expand Down
20 changes: 20 additions & 0 deletions src/components/CodeEditor/CodeEditor.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Copyright (c) 2016-present, Parse, LLC
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import React from 'react';
import CodeEditor from 'components/CodeEditor/CodeEditor.react';

export const component = CodeEditor;

export const demos = [
{
name: 'Simple code editor (only JS support)',
render: () => (
<CodeEditor placeHolder={'//I am editable, try change me!'} id='example1'/>
)
}
];
61 changes: 61 additions & 0 deletions src/components/CodeEditor/CodeEditor.react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2016-present, Parse, LLC
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import React from 'react';
import Editor from 'react-simple-code-editor';
import PropTypes from 'lib/PropTypes';
import {highlight, languages} from 'prismjs/components/prism-core';

import 'prismjs/components/prism-clike';
import 'prismjs/components/prism-javascript';
import './CodeEditor.scss';

export default class CodeEditor extends React.Component {
constructor(props) {
super(props);

this.state = {code: ''};
this.id = `EDITOR-${Math.floor(Math.random() * 1000)}`
}

get value() {
return document.querySelector(`#${this.id}`).value;
}

set value(code) {
this.setState({code});
}

render() {
const {className, placeHolder, id = this.id} = this.props;

return (
<pre style={{margin: 0}} className={`${className} line-numbers language-javascript`}>
<Editor
placeholder={placeHolder || ''}
value={this.state.code}
onValueChange={code => this.setState({code})}
highlight={code => highlight(code, languages.js)}
padding={10}
textareaId={id}
style={{
fontFamily: '"Fira code", "Fira Mono", monospace',
fontSize: 12,
minHeight: 550,
height: '100%'
}}
/>
</pre>
)
}
}

CodeEditor.propTypes = {
id: PropTypes.string.describe('Text area element id to be queried afterwards'),
className: PropTypes.string.describe('CSS classes'),
placeHolder: PropTypes.string.describe('Code place holder')
};
3 changes: 3 additions & 0 deletions src/components/CodeEditor/CodeEditor.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pre > div > textarea:focus {
outline: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class ColumnsConfiguration extends React.Component {
this.node = ReactDOM.findDOMNode(this);
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
if (props.schema !== this.props.schema) {
this.setState({
open: false
Expand Down
2 changes: 1 addition & 1 deletion src/components/DateTimeEditor/DateTimeEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default class DateTimeEditor extends React.Component {
this.handleKey = this.handleKey.bind(this);
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
this.setState({ value: props.value, text: props.value.toISOString() });
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/DateTimeEntry/DateTimeEntry.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class DateTimeEntry extends React.Component {
}
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
this.setState({
value: props.value.toISOString ? props.value.toISOString() : props.value
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/DateTimePicker/DateTimePicker.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class DateTimePicker extends React.Component {
}
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
let timeRef = props.value || hoursFrom(new Date(), 1);
this.setState({
hours: String(timeRef[getDateMethod(props.local, 'getHours')]()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default class ExplorerQueryComposer extends React.Component {
return options;
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
let initialState = this.getInitialStateFromProps(nextProps);
this.setState({ ...initialState });
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/FlowView/FlowView.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class FlowView extends React.Component {
};
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
let newChanges = {...this.state.changes};
for (let k in props.initialFields) {
if (this.state.changes[k] === props.initialFields[k]) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/FourOhFour/FourOhFour.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class FourOhFour extends React.Component {
this.updateEmoji = this.updateEmoji.bind(this);
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.timeout = setTimeout(this.updateEmoji, 3000);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/LiveReload/LiveReload.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class LiveReload extends React.Component {
return promise;
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.shouldContinueReloading = true;
if (!this.state.currentData) {
this.fetchNewData();
Expand Down
2 changes: 1 addition & 1 deletion src/components/MultiSelect/MultiSelect.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class MultiSelect extends React.Component {
this.node = ReactDOM.findDOMNode(this);
}

componentWillReceiveProps() {
UNSAFE_componentWillReceiveProps() {
//Necessary for when the size of the field changes.
this.setState({}, this.setPosition.bind(this));
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Popover/Popover.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class Popover extends React.Component {
super();
this._checkExternalClick = this._checkExternalClick.bind(this);
}
componentWillMount() {
UNSAFE_componentWillMount() {
let wrapperStyle = this.props.fixed ?
styles.fixed_wrapper :
styles.popover_wrapper;
Expand Down Expand Up @@ -60,7 +60,7 @@ export default class Popover extends React.Component {
this._popoverWrapper.appendChild(this._popoverLayer);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.position) {
this._popoverLayer.style.left = this.props.position.x + 'px';
this._popoverLayer.style.top = this.props.position.y + 'px';
Expand All @@ -78,7 +78,7 @@ export default class Popover extends React.Component {
this._popoverWrapper.removeChild(this._popoverLayer);
}

componentWillUpdate(nextProps) {
UNSAFE_componentWillUpdate(nextProps) {
ReactDOM.render(<ContextProxy cx={this.context}>{React.Children.only(nextProps.children)}</ContextProxy>, this._popoverLayer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default class PushAudienceDialog extends React.Component {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
let stateSettings = {};
let audienceInfo = this.props.audienceInfo;
//this case is only for 'New Segment' to prepopulate existing audience
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ export default class PushAudiencesBaseRow extends React.Component {
}, () => {});
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.fetchPushSubscriberCount.call(this,this.context);
if (this.props.id == NEW_SEGMENT_ID) {
this.setState({ isNewSegment: true });
}
}

componentWillReceiveProps(props, context) {
UNSAFE_componentWillReceiveProps(props, context) {
if (this.context !== context) {
this.fetchPushSubscriberCount.call(this, context);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default class PushAudiencesOption extends PushAudiencesBaseRow {
}

// pass count information to PushNew flow
componentWillUpdate(nextProps, nextState) {
UNSAFE_componentWillUpdate(nextProps, nextState) {
if ((nextState.count !== this.state.count || JSON.stringify(nextProps.query) !== JSON.stringify(this.props.query))
&& this.props.isChecked) {
nextProps.onChange.call(undefined, nextState.count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default class PushExperimentDropdown extends React.Component {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.styles = this.props.styles || styles;
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Sidebar/SidebarHeader.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default class SidebarHeader extends React.Component {
super();
this.state = { };
}
componentWillMount() {
UNSAFE_componentWillMount() {
let mountPath = window.PARSE_DASHBOARD_PATH;
fetch(mountPath).then(response => {
this.setState({ dashboardUser: response.headers.get('username') });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class SlowQueriesFilter extends React.Component {
this.node = ReactDOM.findDOMNode(this);
}

componentWillReceiveProps(props) {
UNSAFE_componentWillReceiveProps(props) {
if (props.schema !== this.props.schema) {
this.setState({ open: false });
}
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Analytics/Overview/Overview.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ export default class Overview extends DashboardView {
}
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.fetchOverview(this.context.currentApp);
}

componentWillReceiveProps(nextProps, nextContext) {
UNSAFE_componentWillReceiveProps(nextProps, nextContext) {
if (this.context !== nextContext) {
this.fetchOverview(nextContext.currentApp);
}
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Analytics/Performance/Performance.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ export default class Performance extends DashboardView {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.handleRunQuery(this.context.currentApp);
}

componentWillUnmount() {
this.xhrHandles.forEach(xhr => xhr.abort());
}

componentWillReceiveProps(nextProps, nextContext) {
UNSAFE_componentWillReceiveProps(nextProps, nextContext) {
if (this.context !== nextContext) {
this.handleRunQuery(nextContext.currentApp);
}
Expand Down
4 changes: 2 additions & 2 deletions src/dashboard/Analytics/Retention/Retention.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ export default class Retention extends DashboardView {
};
}

componentWillMount() {
UNSAFE_componentWillMount() {
this.fetchRetention(this.context.currentApp);
}

componentWillUnmount() {
this.xhrHandles.forEach((xhr) => xhr.abort());
}

componentWillReceiveProps(nextProps, nextContext) {
UNSAFE_componentWillReceiveProps(nextProps, nextContext) {
if (this.context !== nextContext) {
this.fetchRetention(nextContext.currentApp);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Apps/AppsIndex.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class AppsIndex extends React.Component {
this.focusField = this.focusField.bind(this);
}

componentWillMount() {
UNSAFE_componentWillMount() {
if (AppsManager.apps().length === 1) {
const [app] = AppsManager.apps();
history.push(`/apps/${app.slug}/browser`);
Expand Down
Loading