From 8be892778090446d2cb06a5373038dd524b6ae2c Mon Sep 17 00:00:00 2001 From: Faisal Nadeem Date: Wed, 18 Aug 2021 02:25:55 +0500 Subject: [PATCH 1/6] cmd+click and context menu --- .../BrowserCell/BrowserCell.react.js | 29 +++++++++++++++---- src/components/BrowserRow/BrowserRow.react.js | 5 ++-- src/components/Toolbar/Toolbar.react.js | 2 +- src/dashboard/Data/Browser/Browser.react.js | 11 +++++++ .../Data/Browser/BrowserTable.react.js | 5 +++- 5 files changed, 43 insertions(+), 9 deletions(-) diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index 1bff7f30f6..97ee711ad2 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -117,6 +117,16 @@ export default class BrowserCell extends Component { } }); + if ( this.props.type === 'Pointer' ) { + onEditSelectedRow && contextMenuOptions.push({ + text: 'Open pointer in new tab', + callback: () => { + let { value, onPointerCmdClick } = this.props; + onPointerCmdClick(value); + } + }); + } + return contextMenuOptions; } @@ -214,7 +224,7 @@ export default class BrowserCell extends Component { //#endregion render() { - let { type, value, hidden, width, current, onSelect, onEditChange, setCopyableValue, setRelation, onPointerClick, row, col, field, onEditSelectedRow, readonly, isRequired, markRequiredFieldRow } = this.props; + let { type, value, hidden, width, current, onSelect, onEditChange, setCopyableValue, setRelation, onPointerClick, onPointerCmdClick, row, col, field, onEditSelectedRow, readonly, isRequired, markRequiredFieldRow } = this.props; let content = value; let isNewRow = row < 0; this.copyableValue = content; @@ -343,7 +353,10 @@ export default class BrowserCell extends Component { ref={this.cellRef} className={classes.join(' ')} style={{ width }} - onClick={() => { + onClick={(e) => { + if ( e.metaKey === true ) { + console.log('cmd key pressed'); + } onSelect({ row, col }); setCopyableValue(hidden ? undefined : this.copyableValue); }} @@ -366,9 +379,15 @@ export default class BrowserCell extends Component { ref={this.cellRef} className={classes.join(' ')} style={{ width }} - onClick={() => { - onSelect({ row, col }); - setCopyableValue(hidden ? undefined : this.copyableValue); + onClick={(e) => { + if ( e.metaKey === true && type === 'Pointer' ) { + onPointerCmdClick(value); + setCopyableValue(hidden ? undefined : this.copyableValue); + } + else { + onSelect({ row, col }); + setCopyableValue(hidden ? undefined : this.copyableValue); + } }} onDoubleClick={() => { // Since objectId can't be edited, double click event opens edit row dialog diff --git a/src/components/BrowserRow/BrowserRow.react.js b/src/components/BrowserRow/BrowserRow.react.js index 367decb2ed..25924d651e 100644 --- a/src/components/BrowserRow/BrowserRow.react.js +++ b/src/components/BrowserRow/BrowserRow.react.js @@ -19,7 +19,7 @@ export default class BrowserRow extends Component { } render() { - const { className, columns, currentCol, isUnique, obj, onPointerClick, order, readOnlyFields, row, rowWidth, selection, selectRow, setCopyableValue, setCurrent, setEditing, setRelation, onEditSelectedRow, setContextMenu, onFilterChange, markRequiredFieldRow } = this.props; + const { className, columns, currentCol, isUnique, obj, onPointerClick, onPointerCmdClick, order, readOnlyFields, row, rowWidth, selection, selectRow, setCopyableValue, setCurrent, setEditing, setRelation, onEditSelectedRow, setContextMenu, onFilterChange, markRequiredFieldRow } = this.props; let attributes = obj.attributes; let requiredCols = []; Object.entries(columns).reduce((acc, cur) => { @@ -89,6 +89,7 @@ export default class BrowserRow extends Component { onSelect={setCurrent} onEditChange={setEditing} onPointerClick={onPointerClick} + onPointerCmdClick={onPointerCmdClick} onFilterChange={onFilterChange} setRelation={setRelation} objectId={obj.id} @@ -104,4 +105,4 @@ export default class BrowserRow extends Component { ); } -} \ No newline at end of file +} diff --git a/src/components/Toolbar/Toolbar.react.js b/src/components/Toolbar/Toolbar.react.js index 12f0275668..b73378ff86 100644 --- a/src/components/Toolbar/Toolbar.react.js +++ b/src/components/Toolbar/Toolbar.react.js @@ -15,7 +15,7 @@ const goBack = () => history.goBack(); let Toolbar = (props) => { let backButton; - if (props.relation || (props.filters && props.filters.size)) { + if ((props.relation || (props.filters && props.filters.size)) && history.action !== 'POP') { backButton = ( = -1 && this.props.editCloneRows) { //for data rows & new row when there are edit clone rows wrapTop += (2 * ROW_HEIGHT) * (this.props.editCloneRows.length); - } + } let wrapLeft = 30; for (let i = 0; i < this.props.current.col; i++) { const column = this.props.order[i]; From cbdd3638a1e9f315c97a530774d758255fe56d2e Mon Sep 17 00:00:00 2001 From: Faisal Nadeem Date: Wed, 18 Aug 2021 02:30:09 +0500 Subject: [PATCH 2/6] removed console.log --- src/components/BrowserCell/BrowserCell.react.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index 97ee711ad2..3143abe344 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -355,10 +355,11 @@ export default class BrowserCell extends Component { style={{ width }} onClick={(e) => { if ( e.metaKey === true ) { - console.log('cmd key pressed'); + onPointerCmdClick(value); + } else { + onSelect({ row, col }); + setCopyableValue(hidden ? undefined : this.copyableValue); } - onSelect({ row, col }); - setCopyableValue(hidden ? undefined : this.copyableValue); }} onDoubleClick={() => { if (field === 'objectId' && onEditSelectedRow) { @@ -382,7 +383,6 @@ export default class BrowserCell extends Component { onClick={(e) => { if ( e.metaKey === true && type === 'Pointer' ) { onPointerCmdClick(value); - setCopyableValue(hidden ? undefined : this.copyableValue); } else { onSelect({ row, col }); From a789991184260af6741db2357d9a34ca0fee6aae Mon Sep 17 00:00:00 2001 From: Faisal Nadeem Date: Wed, 18 Aug 2021 19:20:41 +0500 Subject: [PATCH 3/6] fixed pill icon click --- Parse-Dashboard/public/index.html | 40 +++++++++++++++++++ .../BrowserCell/BrowserCell.react.js | 4 +- src/components/Pill/Pill.react.js | 2 +- 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 Parse-Dashboard/public/index.html diff --git a/Parse-Dashboard/public/index.html b/Parse-Dashboard/public/index.html new file mode 100644 index 0000000000..6e684a3abf --- /dev/null +++ b/Parse-Dashboard/public/index.html @@ -0,0 +1,40 @@ + + + + + + + + +Parse Dashboard + +
+ + + + + + + + diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index 3143abe344..c76a901719 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -354,7 +354,7 @@ export default class BrowserCell extends Component { className={classes.join(' ')} style={{ width }} onClick={(e) => { - if ( e.metaKey === true ) { + if ( e.metaKey === true && ['Pointer', 'Relation'].includes(type)) { onPointerCmdClick(value); } else { onSelect({ row, col }); @@ -381,7 +381,7 @@ export default class BrowserCell extends Component { className={classes.join(' ')} style={{ width }} onClick={(e) => { - if ( e.metaKey === true && type === 'Pointer' ) { + if ( e.metaKey === true && ['Pointer', 'Relation'].includes(type) ) { onPointerCmdClick(value); } else { diff --git a/src/components/Pill/Pill.react.js b/src/components/Pill/Pill.react.js index 32b7cb1b43..c36b9bc9da 100644 --- a/src/components/Pill/Pill.react.js +++ b/src/components/Pill/Pill.react.js @@ -20,7 +20,7 @@ let Pill = ({ value, onClick, fileDownloadLink, followClick = false }) => ( > {value} {followClick && ( -
+ !e.metaKey && onClick}> )} From cc9065757748c832a8d0c34cfb7de469afb8e491 Mon Sep 17 00:00:00 2001 From: Faisal Nadeem Date: Wed, 18 Aug 2021 19:29:24 +0500 Subject: [PATCH 4/6] Pill click cleanup --- Parse-Dashboard/parse-dashboard-config.json | 14 ++++++++------ src/components/BrowserCell/BrowserCell.react.js | 4 ++-- src/components/Pill/Pill.react.js | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Parse-Dashboard/parse-dashboard-config.json b/Parse-Dashboard/parse-dashboard-config.json index e5c4decbf3..018d79904d 100644 --- a/Parse-Dashboard/parse-dashboard-config.json +++ b/Parse-Dashboard/parse-dashboard-config.json @@ -2,13 +2,15 @@ "apps": [ { "serverURL": "http://localhost:1338/parse", - "appId": "hello", - "masterKey": "world", - "appName": "", + "appId": "APPLICATION_ID", + "masterKey": "MASTER_KEY", + "appName": "Countries States and Cities", "iconName": "", "primaryBackgroundColor": "", - "secondaryBackgroundColor": "" + "secondaryBackgroundColor": "", + "custom": { + "isOwner": true + } } - ], - "iconsFolder": "icons" + ] } diff --git a/src/components/BrowserCell/BrowserCell.react.js b/src/components/BrowserCell/BrowserCell.react.js index c76a901719..29f399e3f8 100644 --- a/src/components/BrowserCell/BrowserCell.react.js +++ b/src/components/BrowserCell/BrowserCell.react.js @@ -354,7 +354,7 @@ export default class BrowserCell extends Component { className={classes.join(' ')} style={{ width }} onClick={(e) => { - if ( e.metaKey === true && ['Pointer', 'Relation'].includes(type)) { + if ( e.metaKey === true && type === 'Pointer') { onPointerCmdClick(value); } else { onSelect({ row, col }); @@ -381,7 +381,7 @@ export default class BrowserCell extends Component { className={classes.join(' ')} style={{ width }} onClick={(e) => { - if ( e.metaKey === true && ['Pointer', 'Relation'].includes(type) ) { + if ( e.metaKey === true && type === 'Pointer' ) { onPointerCmdClick(value); } else { diff --git a/src/components/Pill/Pill.react.js b/src/components/Pill/Pill.react.js index c36b9bc9da..45c6aa9d5a 100644 --- a/src/components/Pill/Pill.react.js +++ b/src/components/Pill/Pill.react.js @@ -20,7 +20,7 @@ let Pill = ({ value, onClick, fileDownloadLink, followClick = false }) => ( > {value} {followClick && ( - !e.metaKey && onClick}> + !e.metaKey && onClick()}> )} From 70d23a88612991a0b57e663ac4f972ea72a8093a Mon Sep 17 00:00:00 2001 From: Manuel <5673677+mtrezza@users.noreply.github.com> Date: Wed, 18 Aug 2021 16:41:28 +0200 Subject: [PATCH 5/6] Delete index.html --- Parse-Dashboard/public/index.html | 40 ------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 Parse-Dashboard/public/index.html diff --git a/Parse-Dashboard/public/index.html b/Parse-Dashboard/public/index.html deleted file mode 100644 index 6e684a3abf..0000000000 --- a/Parse-Dashboard/public/index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - -Parse Dashboard - -
- - - - - - - - From 0210a49c3bd34a58c909831d4d7237d65e57daf7 Mon Sep 17 00:00:00 2001 From: fn-faisal Date: Wed, 18 Aug 2021 20:12:44 +0500 Subject: [PATCH 6/6] Reverting config.json --- Parse-Dashboard/parse-dashboard-config.json | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Parse-Dashboard/parse-dashboard-config.json b/Parse-Dashboard/parse-dashboard-config.json index 018d79904d..e5c4decbf3 100644 --- a/Parse-Dashboard/parse-dashboard-config.json +++ b/Parse-Dashboard/parse-dashboard-config.json @@ -2,15 +2,13 @@ "apps": [ { "serverURL": "http://localhost:1338/parse", - "appId": "APPLICATION_ID", - "masterKey": "MASTER_KEY", - "appName": "Countries States and Cities", + "appId": "hello", + "masterKey": "world", + "appName": "", "iconName": "", "primaryBackgroundColor": "", - "secondaryBackgroundColor": "", - "custom": { - "isOwner": true - } + "secondaryBackgroundColor": "" } - ] + ], + "iconsFolder": "icons" }