Skip to content

Commit

Permalink
Merge branch 'alpha' into merge-alpha
Browse files Browse the repository at this point in the history
* alpha:
  chore(release): 3.2.1-alpha.1 [skip ci]
  fix: enabling context menu for read-only cells (parse-community#1844)
  docs: add info about --dev parameter (parse-community#1842)
  docs: fix release changelog filename
  docs: reword changelog quote
  docs: fix changelog branch names (parse-community#1837)
  refactor: simplify reading dashboard config from a json file (parse-community#1828)
  • Loading branch information
mtrezza committed Oct 8, 2021
2 parents 12f8099 + ea1cae2 commit 3761778
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 17 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ parse-dashboard --dev --appId yourAppId --masterKey yourMasterKey --serverURL "h

You may set the host, port and mount path by supplying the `--host`, `--port` and `--mountPath` options to parse-dashboard. You can use anything you want as the app name, or leave it out in which case the app ID will be used.

NB: the `--dev` parameter is disabling production-ready security features, do not use this parameter when starting the dashboard in production. This parameter is useful if you are running on docker.
The `--dev` parameter disables production-ready security features. This parameter is useful when running Parse Dashboard on Docker. Using this parameter will:

- allow insecure http connections from anywhere, bypassing the option `allowInsecureHTTP`
- allow the Parse Server `masterKey` to be transmitted in cleartext without encryption
- allow dashboard access without user authentication

> ⚠️ Do not use this parameter when deploying Parse Dashboard in a production environment.
After starting the dashboard, you can visit http://localhost:4040 in your browser:

Expand Down
6 changes: 6 additions & 0 deletions changelogs/CHANGELOG_alpha.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## [3.2.1-alpha.1](https://github.com/ParsePlatform/parse-dashboard/compare/3.2.0...3.2.1-alpha.1) (2021-10-08)


### Bug Fixes

* enabling context menu for read-only cells ([#1844](https://github.com/ParsePlatform/parse-dashboard/issues/1844)) ([a38a885](https://github.com/ParsePlatform/parse-dashboard/commit/a38a885db23e3a76c1e24f880e061dc882e1d37f))
2 changes: 1 addition & 1 deletion 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": "3.2.0",
"version": "3.2.1-alpha.1",
"repository": {
"type": "git",
"url": "https://github.com/ParsePlatform/parse-dashboard"
Expand Down
33 changes: 19 additions & 14 deletions src/components/BrowserCell/BrowserCell.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class BrowserCell extends Component {
this.state = {
showTooltip: false
}
this.onContextMenu = this.onContextMenu.bind(this);

}

Expand Down Expand Up @@ -97,7 +98,7 @@ export default class BrowserCell extends Component {
}

getContextMenuOptions(constraints) {
let { onEditSelectedRow } = this.props;
let { onEditSelectedRow, readonly } = this.props;
const contextMenuOptions = [];

const setFilterContextMenuOption = this.getSetFilterContextMenuOption(constraints);
Expand All @@ -109,15 +110,15 @@ export default class BrowserCell extends Component {
const relatedObjectsContextMenuOption = this.getRelatedObjectsContextMenuOption();
relatedObjectsContextMenuOption && contextMenuOptions.push(relatedObjectsContextMenuOption);

onEditSelectedRow && contextMenuOptions.push({
!readonly && onEditSelectedRow && contextMenuOptions.push({
text: 'Edit row',
callback: () => {
let { objectId, onEditSelectedRow } = this.props;
onEditSelectedRow(true, objectId);
}
});

if ( this.props.type === 'Pointer' ) {
if (this.props.type === 'Pointer') {
onEditSelectedRow && contextMenuOptions.push({
text: 'Open pointer in new tab',
callback: () => {
Expand All @@ -135,7 +136,10 @@ export default class BrowserCell extends Component {
return {
text: 'Set filter...', items: constraints.map(constraint => {
const definition = Filters.Constraints[constraint];
const text = `${this.props.field} ${definition.name}${definition.comparable ? (' ' + this.copyableValue) : ''}`;
// Smart ellipsis for value - if it's long trim it in the middle: Lorem ipsum dolor si... aliqua
const value = this.copyableValue.length < 30 ? this.copyableValue :
`${this.copyableValue.substr(0, 20)}...${this.copyableValue.substr(this.copyableValue.length - 7)}`;
const text = `${this.props.field} ${definition.name}${definition.comparable ? (' ' + value) : ''}`;
return {
text,
callback: this.pickFilter.bind(this, constraint)
Expand Down Expand Up @@ -264,10 +268,10 @@ export default class BrowserCell extends Component {
this.copyableValue = value.id;
}
else if (type === 'Array') {
if ( value[0] && typeof value[0] === 'object' && value[0].__type === 'Pointer' ) {
if (value[0] && typeof value[0] === 'object' && value[0].__type === 'Pointer') {
const array = [];
value.map( (v, i) => {
if ( typeof v !== 'object' || v.__type !== 'Pointer' ) {
value.map((v, i) => {
if (typeof v !== 'object' || v.__type !== 'Pointer') {
throw new Error('Invalid type found in pointer array');
}
const object = new Parse.Object(v.className);
Expand All @@ -282,10 +286,10 @@ export default class BrowserCell extends Component {
);
});
content = <ul className={styles.hasMore}>
{array.map( a => <li>{a}</li>)}
{array.map(a => <li>{a}</li>)}
</ul>
this.copyableValue = JSON.stringify(value);
if ( array.length > 1 ) {
if (array.length > 1) {
classes.push(styles.removePadding);
}
}
Expand Down Expand Up @@ -339,8 +343,8 @@ export default class BrowserCell extends Component {
<Pill onClick={() => setRelation(value)} value='View relation' followClick={true} />
</div>
) : (
'Relation'
);
'Relation'
);
this.copyableValue = undefined;
}

Expand All @@ -359,7 +363,7 @@ export default class BrowserCell extends Component {
className={classes.join(' ')}
style={{ width }}
onClick={(e) => {
if ( e.metaKey === true && type === 'Pointer') {
if (e.metaKey === true && type === 'Pointer') {
onPointerCmdClick(value);
} else {
onSelect({ row, col });
Expand All @@ -376,6 +380,7 @@ export default class BrowserCell extends Component {
}, 2000);
}
}}
onContextMenu={this.onContextMenu}
>
{isNewRow ? '(auto)' : content}
</span>
Expand All @@ -386,7 +391,7 @@ export default class BrowserCell extends Component {
className={classes.join(' ')}
style={{ width }}
onClick={(e) => {
if ( e.metaKey === true && type === 'Pointer' ) {
if (e.metaKey === true && type === 'Pointer') {
onPointerCmdClick(value);
}
else {
Expand All @@ -411,7 +416,7 @@ export default class BrowserCell extends Component {
onEditChange(true);
}
}}
onContextMenu={this.onContextMenu.bind(this)}
onContextMenu={this.onContextMenu}
>
{content}
</span>
Expand Down

0 comments on commit 3761778

Please sign in to comment.