Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browse as Parse.User (Continuation) #1750

Merged
merged 90 commits into from
Aug 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
5a81bbe
Test ACL with parse user login
NinoZX Mar 31, 2020
ac4f5ab
Login dialog upgrades;
NinoZX Apr 3, 2020
e694aa7
fix: eslint fixes
NinoZX Apr 11, 2020
fe90477
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
28a709c
fix: eslint fixes
NinoZX May 27, 2020
e545ca6
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
db7e711
Removed quickfix for next PR
NinoZX Aug 31, 2020
452237e
Removed quickfix for next PR
NinoZX Aug 31, 2020
17b3c1b
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
e3ddda3
Reposition Browse as User menu item
NinoZX Sep 1, 2020
f04fbda
Test ACL with parse user login
NinoZX Mar 31, 2020
328f9de
Login dialog upgrades;
NinoZX Apr 3, 2020
8279afe
fix: don't update Array, Object or Polygon field on EditRowDialog wh…
NinoZX Apr 11, 2020
2e450f6
fix: eslint fixes
NinoZX Apr 11, 2020
88c43cf
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
be9f096
fix: eslint fixes
NinoZX May 27, 2020
c687fde
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
3b08a5b
Removed quickfix for next PR
NinoZX Aug 31, 2020
0133c66
Removed quickfix for next PR
NinoZX Aug 31, 2020
934fdfa
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
431a0c2
Reposition Browse as User menu item
NinoZX Sep 1, 2020
86323e5
Test ACL with parse user login
NinoZX Mar 31, 2020
7eded11
Login dialog upgrades;
NinoZX Apr 3, 2020
f831933
fix: eslint fixes
NinoZX Apr 11, 2020
c7944fd
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
c29ce84
fix: eslint fixes
NinoZX May 27, 2020
0d18d7b
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
b1fa8ef
Reposition Browse as User menu item
NinoZX Sep 1, 2020
d7817ff
Test ACL with parse user login
NinoZX Mar 31, 2020
d936aa2
Login dialog upgrades;
NinoZX Apr 3, 2020
1a48d0a
fix: don't update Array, Object or Polygon field on EditRowDialog wh…
NinoZX Apr 11, 2020
d650908
fix: eslint fixes
NinoZX Apr 11, 2020
6454d8a
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
499da99
fix: eslint fixes
NinoZX May 27, 2020
13096b9
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
e0bfcf8
Removed quickfix for next PR
NinoZX Aug 31, 2020
660d11d
Removed quickfix for next PR
NinoZX Aug 31, 2020
9292f2a
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
0d20120
Reposition Browse as User menu item
NinoZX Sep 1, 2020
c8d372e
Used object shorthand on useMasterKey
NinoZX Jan 12, 2021
217540f
Clear user & pass from LoginDialog on handleClose
NinoZX Jan 13, 2021
b8def53
Test ACL with parse user login
NinoZX Mar 31, 2020
bd3a382
Login dialog upgrades;
NinoZX Apr 3, 2020
2572c7b
fix: eslint fixes
NinoZX Apr 11, 2020
247d1f2
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
6ec48d9
fix: eslint fixes
NinoZX May 27, 2020
191ee1a
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
7531d9d
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
af421c8
Reposition Browse as User menu item
NinoZX Sep 1, 2020
a132516
Test ACL with parse user login
NinoZX Mar 31, 2020
ad458b7
Login dialog upgrades;
NinoZX Apr 3, 2020
fae8110
fix: don't update Array, Object or Polygon field on EditRowDialog wh…
NinoZX Apr 11, 2020
0e88229
fix: eslint fixes
NinoZX Apr 11, 2020
64ad71b
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
4669bd1
fix: eslint fixes
NinoZX May 27, 2020
6dd1a4b
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
2873b0c
Removed quickfix for next PR
NinoZX Aug 31, 2020
6629775
Removed quickfix for next PR
NinoZX Aug 31, 2020
efb9199
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
53eb5c1
Reposition Browse as User menu item
NinoZX Sep 1, 2020
4a9b486
Test ACL with parse user login
NinoZX Mar 31, 2020
dd6bd71
Login dialog upgrades;
NinoZX Apr 3, 2020
8ac7dd5
fix: eslint fixes
NinoZX Apr 11, 2020
0df792b
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
41541f0
fix: eslint fixes
NinoZX May 27, 2020
749797a
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
26f173e
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
d1a534e
Reposition Browse as User menu item
NinoZX Sep 1, 2020
09a3a33
Test ACL with parse user login
NinoZX Mar 31, 2020
f82c60a
Login dialog upgrades;
NinoZX Apr 3, 2020
bde7e58
fix: don't update Array, Object or Polygon field on EditRowDialog wh…
NinoZX Apr 11, 2020
69da6a3
fix: eslint fixes
NinoZX Apr 11, 2020
df1a229
UX changes in main nav bar for browse as user;
NinoZX May 26, 2020
11570a9
fix: eslint fixes
NinoZX May 27, 2020
bd63cf4
Use master key state property on editRowDialog and ObjectPickerDialog;
NinoZX May 27, 2020
2e89bff
Removed quickfix for next PR
NinoZX Aug 31, 2020
4708336
Removed quickfix for next PR
NinoZX Aug 31, 2020
6609d9b
Removed EditRowDialog fixes for next PR
NinoZX Aug 31, 2020
25ceb7e
Reposition Browse as User menu item
NinoZX Sep 1, 2020
1036db4
setCurrent to null on BrowserMenu open
NinoZX Jan 25, 2021
5b81fc5
fix rebase GeoPointEditor.react.js
mtrezza Jul 31, 2021
631f74f
fix rebase TextInput.react.js
mtrezza Jul 31, 2021
8c89d2a
Update Browser.react.js
mtrezza Jul 31, 2021
3ecbb60
Update EditRowDialog.react.js
mtrezza Jul 31, 2021
24983cd
Update EditRowDialog.react.js
mtrezza Jul 31, 2021
8f49fa8
Update EditRowDialog.react.js
mtrezza Jul 31, 2021
55c3929
Update ObjectPickerDialog.react.js
mtrezza Jul 31, 2021
b2f24cd
Update README.md
mtrezza Jul 31, 2021
cbc6bc3
Update README.md
mtrezza Jul 31, 2021
41ba928
added missing dynamic useMasterKey
mtrezza Jul 31, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 40 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Parse Dashboard
# Parse Dashboard <!-- omit in toc -->

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

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

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

# Getting Started

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

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.

# Features
*(The following is not a complete list of features but a work in progress to build a comprehensive feature list.)*

## Browse as User
davimacedo marked this conversation as resolved.
Show resolved Hide resolved

▶️ *Core > Browser > Browse*

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.

> ⚠️ 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.

# Contributing

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).
Expand Down
10 changes: 9 additions & 1 deletion src/components/BrowserMenu/BrowserMenu.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ export default class BrowserMenu extends React.Component {
let menu = null;
if (this.state.open) {
let position = Position.inDocument(this.node);
let titleStyle = [styles.title];
if (this.props.active) {
titleStyle.push(styles.active);
}
menu = (
<Popover fixed={true} position={position} onExternalClick={() => this.setState({ open: false })}>
<div className={styles.menu}>
<div className={styles.title} onClick={() => this.setState({ open: false })}>
<div className={titleStyle.join(' ')} onClick={() => this.setState({ open: false })}>
<Icon name={this.props.icon} width={14} height={14} />
<span>{this.props.title}</span>
</div>
Expand All @@ -48,13 +52,17 @@ export default class BrowserMenu extends React.Component {
);
}
const classes = [styles.entry];
if (this.props.active) {
classes.push(styles.active);
}
if (this.props.disabled) {
classes.push(styles.disabled);
}
let onClick = null;
if (!this.props.disabled) {
onClick = () => {
this.setState({ open: true });
this.props.setCurrent(null);
};
}
return (
Expand Down
24 changes: 20 additions & 4 deletions src/components/BrowserMenu/BrowserMenu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
}

.entry {
height: 22px;
padding: 8px 8px 0 8px;
height: 30px;
padding: 8px;

svg {
fill: #66637A;
Expand All @@ -33,6 +33,15 @@
fill: #66637A;
}
}

&.active {
background: $orange;
border-radius: 5px;

svg {
fill: white;
}
}
}

.title {
Expand All @@ -43,21 +52,28 @@
svg {
fill: white;
}

&.active {
background: $orange;
border-radius: 5px;
}
}

.entry, .title {
@include NotoSansFont;
position: relative;
bottom: -4px;
font-size: 14px;
color: #ffffff;
cursor: pointer;

svg {
vertical-align: middle;
vertical-align: top;
margin-right: 4px;
}

span {
vertical-align: middle;
vertical-align: top;
height: 14px;
line-height: 14px;
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/BrowserMenu/MenuItem.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
import React from 'react';
import styles from 'components/BrowserMenu/BrowserMenu.scss';

let MenuItem = ({ text, disabled, onClick }) => {
let MenuItem = ({ text, disabled, active, greenActive, onClick }) => {
let classes = [styles.item];
if (disabled) {
classes.push(styles.disabled);
}
if (active) {
classes.push(styles.active);
}
if (greenActive) {
classes.push(styles.greenActive);
}
return <div className={classes.join(' ')} onClick={disabled ? undefined : onClick}>{text}</div>;
};

Expand Down
13 changes: 10 additions & 3 deletions src/components/Toggle/Toggle.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ export default class Toggle extends React.Component {
left = this.props.value === this.props.optionLeft;
colored = this.props.colored;
break;
case Toggle.Types.HIDE_LABELS:
colored = true;
left = !this.props.value;
break;
default:
labelLeft = 'No';
labelRight = 'Yes';
Expand All @@ -90,7 +94,10 @@ export default class Toggle extends React.Component {

let switchClasses = [styles.switch];
if (colored) {
switchClasses.push(styles.colored)
switchClasses.push(styles.colored);
}
if (this.props.switchNoMargin) {
switchClasses.push(styles.switchNoMargin);
}
let toggleClasses = [styles.toggle, unselectable, input];
if (left) {
Expand All @@ -101,9 +108,9 @@ export default class Toggle extends React.Component {
}
return (
<div className={toggleClasses.join(' ')} style={this.props.additionalStyles || {}}>
<span className={styles.label} onClick={this.toLeft.bind(this)}>{labelLeft}</span>
{labelLeft && <span className={styles.label} onClick={this.toLeft.bind(this)}>{labelLeft}</span>}
<span className={switchClasses.join(' ')} onClick={this.toggle.bind(this)}></span>
<span className={styles.label} onClick={this.toRight.bind(this)}>{labelRight}</span>
{labelRight && <span className={styles.label} onClick={this.toRight.bind(this)}>{labelRight}</span>}
</div>
);
}
Expand Down
4 changes: 4 additions & 0 deletions src/components/Toggle/Toggle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
transition: background-position 0.15s ease-out;
}

.switchNoMargin {
margin: 0;
}

.left {
.label {
&:first-of-type {
Expand Down
Loading