Skip to content

Commit 3761778

Browse files
committed
Merge branch 'alpha' into merge-alpha
* 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)
2 parents 12f8099 + ea1cae2 commit 3761778

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ parse-dashboard --dev --appId yourAppId --masterKey yourMasterKey --serverURL "h
6363

6464
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.
6565

66-
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.
66+
The `--dev` parameter disables production-ready security features. This parameter is useful when running Parse Dashboard on Docker. Using this parameter will:
67+
68+
- allow insecure http connections from anywhere, bypassing the option `allowInsecureHTTP`
69+
- allow the Parse Server `masterKey` to be transmitted in cleartext without encryption
70+
- allow dashboard access without user authentication
71+
72+
> ⚠️ Do not use this parameter when deploying Parse Dashboard in a production environment.
6773
6874
After starting the dashboard, you can visit http://localhost:4040 in your browser:
6975

changelogs/CHANGELOG_alpha.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## [3.2.1-alpha.1](https://github.com/ParsePlatform/parse-dashboard/compare/3.2.0...3.2.1-alpha.1) (2021-10-08)
2+
3+
4+
### Bug Fixes
5+
6+
* 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))

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-dashboard",
3-
"version": "3.2.0",
3+
"version": "3.2.1-alpha.1",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/ParsePlatform/parse-dashboard"

src/components/BrowserCell/BrowserCell.react.js

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class BrowserCell extends Component {
2525
this.state = {
2626
showTooltip: false
2727
}
28+
this.onContextMenu = this.onContextMenu.bind(this);
2829

2930
}
3031

@@ -97,7 +98,7 @@ export default class BrowserCell extends Component {
9798
}
9899

99100
getContextMenuOptions(constraints) {
100-
let { onEditSelectedRow } = this.props;
101+
let { onEditSelectedRow, readonly } = this.props;
101102
const contextMenuOptions = [];
102103

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

112-
onEditSelectedRow && contextMenuOptions.push({
113+
!readonly && onEditSelectedRow && contextMenuOptions.push({
113114
text: 'Edit row',
114115
callback: () => {
115116
let { objectId, onEditSelectedRow } = this.props;
116117
onEditSelectedRow(true, objectId);
117118
}
118119
});
119120

120-
if ( this.props.type === 'Pointer' ) {
121+
if (this.props.type === 'Pointer') {
121122
onEditSelectedRow && contextMenuOptions.push({
122123
text: 'Open pointer in new tab',
123124
callback: () => {
@@ -135,7 +136,10 @@ export default class BrowserCell extends Component {
135136
return {
136137
text: 'Set filter...', items: constraints.map(constraint => {
137138
const definition = Filters.Constraints[constraint];
138-
const text = `${this.props.field} ${definition.name}${definition.comparable ? (' ' + this.copyableValue) : ''}`;
139+
// Smart ellipsis for value - if it's long trim it in the middle: Lorem ipsum dolor si... aliqua
140+
const value = this.copyableValue.length < 30 ? this.copyableValue :
141+
`${this.copyableValue.substr(0, 20)}...${this.copyableValue.substr(this.copyableValue.length - 7)}`;
142+
const text = `${this.props.field} ${definition.name}${definition.comparable ? (' ' + value) : ''}`;
139143
return {
140144
text,
141145
callback: this.pickFilter.bind(this, constraint)
@@ -264,10 +268,10 @@ export default class BrowserCell extends Component {
264268
this.copyableValue = value.id;
265269
}
266270
else if (type === 'Array') {
267-
if ( value[0] && typeof value[0] === 'object' && value[0].__type === 'Pointer' ) {
271+
if (value[0] && typeof value[0] === 'object' && value[0].__type === 'Pointer') {
268272
const array = [];
269-
value.map( (v, i) => {
270-
if ( typeof v !== 'object' || v.__type !== 'Pointer' ) {
273+
value.map((v, i) => {
274+
if (typeof v !== 'object' || v.__type !== 'Pointer') {
271275
throw new Error('Invalid type found in pointer array');
272276
}
273277
const object = new Parse.Object(v.className);
@@ -282,10 +286,10 @@ export default class BrowserCell extends Component {
282286
);
283287
});
284288
content = <ul className={styles.hasMore}>
285-
{array.map( a => <li>{a}</li>)}
289+
{array.map(a => <li>{a}</li>)}
286290
</ul>
287291
this.copyableValue = JSON.stringify(value);
288-
if ( array.length > 1 ) {
292+
if (array.length > 1) {
289293
classes.push(styles.removePadding);
290294
}
291295
}
@@ -339,8 +343,8 @@ export default class BrowserCell extends Component {
339343
<Pill onClick={() => setRelation(value)} value='View relation' followClick={true} />
340344
</div>
341345
) : (
342-
'Relation'
343-
);
346+
'Relation'
347+
);
344348
this.copyableValue = undefined;
345349
}
346350

@@ -359,7 +363,7 @@ export default class BrowserCell extends Component {
359363
className={classes.join(' ')}
360364
style={{ width }}
361365
onClick={(e) => {
362-
if ( e.metaKey === true && type === 'Pointer') {
366+
if (e.metaKey === true && type === 'Pointer') {
363367
onPointerCmdClick(value);
364368
} else {
365369
onSelect({ row, col });
@@ -376,6 +380,7 @@ export default class BrowserCell extends Component {
376380
}, 2000);
377381
}
378382
}}
383+
onContextMenu={this.onContextMenu}
379384
>
380385
{isNewRow ? '(auto)' : content}
381386
</span>
@@ -386,7 +391,7 @@ export default class BrowserCell extends Component {
386391
className={classes.join(' ')}
387392
style={{ width }}
388393
onClick={(e) => {
389-
if ( e.metaKey === true && type === 'Pointer' ) {
394+
if (e.metaKey === true && type === 'Pointer') {
390395
onPointerCmdClick(value);
391396
}
392397
else {
@@ -411,7 +416,7 @@ export default class BrowserCell extends Component {
411416
onEditChange(true);
412417
}
413418
}}
414-
onContextMenu={this.onContextMenu.bind(this)}
419+
onContextMenu={this.onContextMenu}
415420
>
416421
{content}
417422
</span>

0 commit comments

Comments
 (0)