Skip to content

Commit 69bf041

Browse files
mtrezzaNinoZX
andauthored
Browse as Parse.User (Continuation) (#1750)
* Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed quickfix for next PR * Removed quickfix for next PR * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: don't update Array, Object or Polygon field on EditRowDialog when no changes * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed quickfix for next PR * Removed quickfix for next PR * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Reposition Browse as User menu item * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: don't update Array, Object or Polygon field on EditRowDialog when no changes * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed quickfix for next PR * Removed quickfix for next PR * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * Used object shorthand on useMasterKey * Clear user & pass from LoginDialog on handleClose * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: don't update Array, Object or Polygon field on EditRowDialog when no changes * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed quickfix for next PR * Removed quickfix for next PR * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * Test ACL with parse user login * Login dialog upgrades; Expand / Collapse TextArea fields on EditRowDialog; Fix for live reload data on EditRowDialog when data is updated on server * fix: don't update Array, Object or Polygon field on EditRowDialog when no changes * fix: eslint fixes * UX changes in main nav bar for browse as user; Toggle new type added - HIDE_LABELS; * fix: eslint fixes * Use master key state property on editRowDialog and ObjectPickerDialog; Enabled using useMasteKey property for save actions and other actions * Removed quickfix for next PR * Removed quickfix for next PR * Removed EditRowDialog fixes for next PR * Reposition Browse as User menu item * setCurrent to null on BrowserMenu open * fix rebase GeoPointEditor.react.js * fix rebase TextInput.react.js * Update Browser.react.js * Update EditRowDialog.react.js * Update EditRowDialog.react.js * Update EditRowDialog.react.js * Update ObjectPickerDialog.react.js * Update README.md * Update README.md * added missing dynamic useMasterKey Co-authored-by: Nino Crljenec <[email protected]>
1 parent dd0a460 commit 69bf041

11 files changed

+307
-63
lines changed

README.md

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Parse Dashboard
1+
# Parse Dashboard <!-- omit in toc -->
22

33
[![Greenkeeper badge](https://badges.greenkeeper.io/parse-community/parse-dashboard.svg)](https://greenkeeper.io/)
44
[![Build Status](https://img.shields.io/travis/parse-community/parse-dashboard/master.svg?style=flat)](https://travis-ci.org/parse-community/parse-dashboard)
@@ -11,32 +11,34 @@
1111

1212
Parse Dashboard is a standalone dashboard for managing your [Parse Server](https://github.com/ParsePlatform/parse-server) apps.
1313

14-
* [Getting Started](#getting-started)
15-
* [Local Installation](#local-installation)
16-
* [Configuring Parse Dashboard](#configuring-parse-dashboard)
17-
* [File](#file)
18-
* [Environment variables](#environment-variables)
19-
* [Multiple apps](#multiple-apps)
20-
* [Single app](#single-app)
21-
* [Managing Multiple Apps](#managing-multiple-apps)
22-
* [GraphQL Playground](#graphql-playground)
23-
* [App Icon Configuration](#app-icon-configuration)
24-
* [App Background Color Configuration](#app-background-color-configuration)
25-
* [Other Configuration Options](#other-configuration-options)
26-
* [Prevent columns sorting](#prevent-columns-sorting)
27-
* [Running as Express Middleware](#running-as-express-middleware)
28-
* [Deploying Parse Dashboard](#deploying-parse-dashboard)
29-
* [Preparing for Deployment](#preparing-for-deployment)
30-
* [Security Considerations](#security-considerations)
31-
* [Configuring Basic Authentication](#configuring-basic-authentication)
32-
* [Separating App Access Based on User Identity](#separating-app-access-based-on-user-identity)
33-
* [Use Read-Only masterKey](#use-read-only-masterKey)
34-
* [Making an app read-only for all users](#making-an-app-read-only-for-all-users)
35-
* [Makings users read-only](#makings-users-read-only)
36-
* [Making user's apps readOnly](#making-users-apps-readonly)
37-
* [Configuring Localized Push Notifications](#configuring-localized-push-notifications)
38-
* [Run with Docker](#run-with-docker)
39-
* [Contributing](#contributing)
14+
- [Getting Started](#getting-started)
15+
- [Local Installation](#local-installation)
16+
- [Configuring Parse Dashboard](#configuring-parse-dashboard)
17+
- [File](#file)
18+
- [Environment variables](#environment-variables)
19+
- [Multiple apps](#multiple-apps)
20+
- [Single app](#single-app)
21+
- [Managing Multiple Apps](#managing-multiple-apps)
22+
- [GraphQL Playground](#graphql-playground)
23+
- [App Icon Configuration](#app-icon-configuration)
24+
- [App Background Color Configuration](#app-background-color-configuration)
25+
- [Other Configuration Options](#other-configuration-options)
26+
- [Prevent columns sorting](#prevent-columns-sorting)
27+
- [Running as Express Middleware](#running-as-express-middleware)
28+
- [Deploying Parse Dashboard](#deploying-parse-dashboard)
29+
- [Preparing for Deployment](#preparing-for-deployment)
30+
- [Security Considerations](#security-considerations)
31+
- [Configuring Basic Authentication](#configuring-basic-authentication)
32+
- [Separating App Access Based on User Identity](#separating-app-access-based-on-user-identity)
33+
- [Use Read-Only masterKey](#use-read-only-masterkey)
34+
- [Making an app read-only for all users](#making-an-app-read-only-for-all-users)
35+
- [Makings users read-only](#makings-users-read-only)
36+
- [Making user's apps readOnly](#making-users-apps-readonly)
37+
- [Configuring Localized Push Notifications](#configuring-localized-push-notifications)
38+
- [Run with Docker](#run-with-docker)
39+
- [Features](#features)
40+
- [Browse as User](#browse-as-user)
41+
- [Contributing](#contributing)
4042

4143
# Getting Started
4244

@@ -557,6 +559,17 @@ docker run -d -p 80:8080 -v host/path/to/config.json:/src/Parse-Dashboard/parse-
557559

558560
If you are not familiar with Docker, ``--port 8080`` will be passed in as argument to the entrypoint to form the full command ``npm start -- --port 8080``. The application will start at port 8080 inside the container and port ``8080`` will be mounted to port ``80`` on your host machine.
559561

562+
# Features
563+
*(The following is not a complete list of features but a work in progress to build a comprehensive feature list.)*
564+
565+
## Browse as User
566+
567+
▶️ *Core > Browser > Browse*
568+
569+
This feature allows you to use the data browser as another user, respecting that user's data permissions. For example, you will only see records and fields the user has permission to see.
570+
571+
> ⚠️ Logging in as another user will trigger the same Cloud Triggers as if the user logged in themselves using any other login method. Logging in as another user requires to enter that user's password.
572+
560573
# Contributing
561574

562575
We really want Parse to be yours, to see it grow and thrive in the open source community. Please see the [Contributing to Parse Dashboard guide](CONTRIBUTING.md).

src/components/BrowserMenu/BrowserMenu.react.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,14 @@ export default class BrowserMenu extends React.Component {
2828
let menu = null;
2929
if (this.state.open) {
3030
let position = Position.inDocument(this.node);
31+
let titleStyle = [styles.title];
32+
if (this.props.active) {
33+
titleStyle.push(styles.active);
34+
}
3135
menu = (
3236
<Popover fixed={true} position={position} onExternalClick={() => this.setState({ open: false })}>
3337
<div className={styles.menu}>
34-
<div className={styles.title} onClick={() => this.setState({ open: false })}>
38+
<div className={titleStyle.join(' ')} onClick={() => this.setState({ open: false })}>
3539
<Icon name={this.props.icon} width={14} height={14} />
3640
<span>{this.props.title}</span>
3741
</div>
@@ -48,13 +52,17 @@ export default class BrowserMenu extends React.Component {
4852
);
4953
}
5054
const classes = [styles.entry];
55+
if (this.props.active) {
56+
classes.push(styles.active);
57+
}
5158
if (this.props.disabled) {
5259
classes.push(styles.disabled);
5360
}
5461
let onClick = null;
5562
if (!this.props.disabled) {
5663
onClick = () => {
5764
this.setState({ open: true });
65+
this.props.setCurrent(null);
5866
};
5967
}
6068
return (

src/components/BrowserMenu/BrowserMenu.scss

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
}
1313

1414
.entry {
15-
height: 22px;
16-
padding: 8px 8px 0 8px;
15+
height: 30px;
16+
padding: 8px;
1717

1818
svg {
1919
fill: #66637A;
@@ -33,6 +33,15 @@
3333
fill: #66637A;
3434
}
3535
}
36+
37+
&.active {
38+
background: $orange;
39+
border-radius: 5px;
40+
41+
svg {
42+
fill: white;
43+
}
44+
}
3645
}
3746

3847
.title {
@@ -43,21 +52,28 @@
4352
svg {
4453
fill: white;
4554
}
55+
56+
&.active {
57+
background: $orange;
58+
border-radius: 5px;
59+
}
4660
}
4761

4862
.entry, .title {
4963
@include NotoSansFont;
64+
position: relative;
65+
bottom: -4px;
5066
font-size: 14px;
5167
color: #ffffff;
5268
cursor: pointer;
5369

5470
svg {
55-
vertical-align: middle;
71+
vertical-align: top;
5672
margin-right: 4px;
5773
}
5874

5975
span {
60-
vertical-align: middle;
76+
vertical-align: top;
6177
height: 14px;
6278
line-height: 14px;
6379
}

src/components/BrowserMenu/MenuItem.react.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@
88
import React from 'react';
99
import styles from 'components/BrowserMenu/BrowserMenu.scss';
1010

11-
let MenuItem = ({ text, disabled, onClick }) => {
11+
let MenuItem = ({ text, disabled, active, greenActive, onClick }) => {
1212
let classes = [styles.item];
1313
if (disabled) {
1414
classes.push(styles.disabled);
1515
}
16+
if (active) {
17+
classes.push(styles.active);
18+
}
19+
if (greenActive) {
20+
classes.push(styles.greenActive);
21+
}
1622
return <div className={classes.join(' ')} onClick={disabled ? undefined : onClick}>{text}</div>;
1723
};
1824

src/components/Toggle/Toggle.react.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ export default class Toggle extends React.Component {
8080
left = this.props.value === this.props.optionLeft;
8181
colored = this.props.colored;
8282
break;
83+
case Toggle.Types.HIDE_LABELS:
84+
colored = true;
85+
left = !this.props.value;
86+
break;
8387
default:
8488
labelLeft = 'No';
8589
labelRight = 'Yes';
@@ -90,7 +94,10 @@ export default class Toggle extends React.Component {
9094

9195
let switchClasses = [styles.switch];
9296
if (colored) {
93-
switchClasses.push(styles.colored)
97+
switchClasses.push(styles.colored);
98+
}
99+
if (this.props.switchNoMargin) {
100+
switchClasses.push(styles.switchNoMargin);
94101
}
95102
let toggleClasses = [styles.toggle, unselectable, input];
96103
if (left) {
@@ -101,9 +108,9 @@ export default class Toggle extends React.Component {
101108
}
102109
return (
103110
<div className={toggleClasses.join(' ')} style={this.props.additionalStyles || {}}>
104-
<span className={styles.label} onClick={this.toLeft.bind(this)}>{labelLeft}</span>
111+
{labelLeft && <span className={styles.label} onClick={this.toLeft.bind(this)}>{labelLeft}</span>}
105112
<span className={switchClasses.join(' ')} onClick={this.toggle.bind(this)}></span>
106-
<span className={styles.label} onClick={this.toRight.bind(this)}>{labelRight}</span>
113+
{labelRight && <span className={styles.label} onClick={this.toRight.bind(this)}>{labelRight}</span>}
107114
</div>
108115
);
109116
}

src/components/Toggle/Toggle.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@
6060
transition: background-position 0.15s ease-out;
6161
}
6262

63+
.switchNoMargin {
64+
margin: 0;
65+
}
66+
6367
.left {
6468
.label {
6569
&:first-of-type {

0 commit comments

Comments
 (0)