Skip to content

Commit

Permalink
Merge branch 'alpha' into workspace-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza authored May 3, 2024
2 parents 1ec18bb + 6e0881c commit 4c2b2cc
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release-automated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@v2
with:
node-version: 14
node-version: 18
registry-url: https://registry.npmjs.org/
- name: Cache Node.js modules
uses: actions/cache@v2
Expand Down
14 changes: 14 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# [6.0.0-alpha.3](https://github.com/ParsePlatform/parse-dashboard/compare/6.0.0-alpha.2...6.0.0-alpha.3) (2024-04-30)


### Features

* Select rows in data browser by clicking and dragging mouse cursor over checkboxes ([#2548](https://github.com/ParsePlatform/parse-dashboard/issues/2548)) ([792ba9e](https://github.com/ParsePlatform/parse-dashboard/commit/792ba9e619224c6101ed21cd36add9fe83c3e348))

# [6.0.0-alpha.2](https://github.com/ParsePlatform/parse-dashboard/compare/6.0.0-alpha.1...6.0.0-alpha.2) (2024-04-30)


### Bug Fixes

* Class Level Permissions dialog throws error `TypeError: ce.current is null` for newly created class ([#2549](https://github.com/ParsePlatform/parse-dashboard/issues/2549)) ([27ed692](https://github.com/ParsePlatform/parse-dashboard/commit/27ed6920d38bfe6476aaf2cebd4124dc30389959))

# [6.0.0-alpha.1](https://github.com/ParsePlatform/parse-dashboard/compare/5.4.0-alpha.8...6.0.0-alpha.1) (2024-03-05)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "parse-dashboard",
"version": "6.0.0-alpha.1",
"version": "6.0.0-alpha.3",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-dashboard"
Expand Down
10 changes: 9 additions & 1 deletion src/components/BrowserRow/BrowserRow.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export default class BrowserRow extends Component {
setContextMenu,
onFilterChange,
markRequiredFieldRow,
onMouseDownRowCheckBox,
onMouseUpRowCheckBox,
onMouseOverRowCheckBox,
} = this.props;
const attributes = obj.attributes;
let requiredCols = [];
Expand All @@ -62,11 +65,16 @@ export default class BrowserRow extends Component {
}
return (
<div className={styles.tableRow} style={{ minWidth: rowWidth }}>
<span className={styles.checkCell}>
<span
className={styles.checkCell}
onMouseUp={onMouseUpRowCheckBox}
onMouseOver={() => onMouseOverRowCheckBox(obj.id)}
>
<input
type="checkbox"
checked={selection['*'] || selection[obj.id]}
onChange={e => selectRow(obj.id, e.target.checked)}
onMouseDown={(e) => onMouseDownRowCheckBox(e.target.checked)}
/>
</span>
{order.map(({ name, width, visible }, j) => {
Expand Down
33 changes: 33 additions & 0 deletions src/dashboard/Data/Browser/Browser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ class Browser extends DashboardView {
currentUser: Parse.User.current(),

processedScripts: 0,

rowCheckboxDragging: false,
draggedRowSelection: false,
};

this.addLocation = this.addLocation.bind(this);
Expand Down Expand Up @@ -163,6 +166,9 @@ class Browser extends DashboardView {
this.abortEditCloneRow = this.abortEditCloneRow.bind(this);
this.cancelPendingEditRows = this.cancelPendingEditRows.bind(this);
this.redirectToFirstClass = this.redirectToFirstClass.bind(this);
this.onMouseDownRowCheckBox = this.onMouseDownRowCheckBox.bind(this);
this.onMouseUpRowCheckBox = this.onMouseUpRowCheckBox.bind(this);
this.onMouseOverRowCheckBox = this.onMouseOverRowCheckBox.bind(this);

this.dataBrowserRef = React.createRef();

Expand All @@ -189,10 +195,12 @@ class Browser extends DashboardView {

componentDidMount() {
this.addLocation(this.props.params.appId);
window.addEventListener('mouseup', this.onMouseUpRowCheckBox);
}

componentWillUnmount() {
this.removeLocation();
window.removeEventListener('mouseup', this.onMouseUpRowCheckBox);
}

componentWillReceiveProps(nextProps, nextContext) {
Expand Down Expand Up @@ -368,6 +376,7 @@ class Browser extends DashboardView {
this.props.schema
.dispatch(ActionTypes.CREATE_CLASS, { className })
.then(() => {
this.state.clp[className] = this.props.schema.data.get('CLPs').toJS()[className];
this.state.counts[className] = 0;
this.props.navigate(generatePath(this.context, 'browser/' + className));
})
Expand All @@ -380,6 +389,7 @@ class Browser extends DashboardView {
this.props.schema.dispatch(ActionTypes.DROP_CLASS, { className }).then(
() => {
this.setState({ showDropClassDialog: false });
delete this.state.clp[className];
delete this.state.counts[className];
this.props.navigate(generatePath(this.context, 'browser'));
},
Expand Down Expand Up @@ -1788,6 +1798,26 @@ class Browser extends DashboardView {
this.setState({ showPointerKeyDialog: false });
}

onMouseDownRowCheckBox(checked) {
this.setState({
rowCheckboxDragging: true,
draggedRowSelection: !checked,
});
}

onMouseUpRowCheckBox() {
this.setState({
rowCheckboxDragging: false,
draggedRowSelection: false,
});
}

onMouseOverRowCheckBox(id) {
if (this.state.rowCheckboxDragging) {
this.selectRow(id, this.state.draggedRowSelection);
}
}

renderContent() {
let browser = null;
let className = this.props.params.className;
Expand Down Expand Up @@ -1907,6 +1937,9 @@ class Browser extends DashboardView {
onAddRowWithModal={this.addRowWithModal}
onAddClass={this.showCreateClass}
showNote={this.showNote}
onMouseDownRowCheckBox={this.onMouseDownRowCheckBox}
onMouseUpRowCheckBox={this.onMouseUpRowCheckBox}
onMouseOverRowCheckBox={this.onMouseOverRowCheckBox}
/>
);
}
Expand Down
9 changes: 9 additions & 0 deletions src/dashboard/Data/Browser/BrowserTable.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ export default class BrowserTable extends React.Component {
scripts={this.context.scripts}
selectedCells={this.props.selectedCells}
handleCellClick={this.props.handleCellClick}
onMouseDownRowCheckBox={this.props.onMouseDownRowCheckBox}
onMouseUpRowCheckBox={this.props.onMouseUpRowCheckBox}
onMouseOverRowCheckBox={this.props.onMouseOverRowCheckBox}
/>
<Button
value="Clone"
Expand Down Expand Up @@ -240,6 +243,9 @@ export default class BrowserTable extends React.Component {
scripts={this.context.scripts}
selectedCells={this.props.selectedCells}
handleCellClick={this.props.handleCellClick}
onMouseDownRowCheckBox={this.props.onMouseDownRowCheckBox}
onMouseUpRowCheckBox={this.props.onMouseUpRowCheckBox}
onMouseOverRowCheckBox={this.props.onMouseOverRowCheckBox}
/>
<Button
value="Add"
Expand Down Expand Up @@ -318,6 +324,9 @@ export default class BrowserTable extends React.Component {
scripts={this.context.scripts}
selectedCells={this.props.selectedCells}
handleCellClick={this.props.handleCellClick}
onMouseDownRowCheckBox={this.props.onMouseDownRowCheckBox}
onMouseUpRowCheckBox={this.props.onMouseUpRowCheckBox}
onMouseOverRowCheckBox={this.props.onMouseOverRowCheckBox}
/>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dashboard/Data/Browser/BrowserToolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ const BrowserToolbar = ({
disabled={isPendingEditCloneRows}
/>
{onAddRow && <div className={styles.toolbarSeparator} />}
{perms && enableSecurityDialog ? (
{enableSecurityDialog ? (
<SecurityDialog
ref={clpDialogRef}
disabled={!!relation || !!isUnique}
Expand Down

0 comments on commit 4c2b2cc

Please sign in to comment.