Skip to content

Remove gatekeeper #22

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

Merged
merged 2 commits into from
Feb 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
19 changes: 9 additions & 10 deletions components/ExplorerQueryComposer/ExplorerQueryComposer.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import base from 'stylesheets/base.scss';
import Button from 'components/Button/Button.react';
import check_gatekeeper from 'lib/check_gatekeeper';
import ChromeDropdown from 'components/ChromeDropdown/ChromeDropdown.react';
import DateTimeEntry from 'components/DateTimeEntry/DateTimeEntry.react';
import base from 'stylesheets/base.scss';
import Button from 'components/Button/Button.react';
import ChromeDropdown from 'components/ChromeDropdown/ChromeDropdown.react';
import DateTimeEntry from 'components/DateTimeEntry/DateTimeEntry.react';
import {
Constraints,
FieldConstraints
} from 'components/ExplorerQueryComposer/ExplorerFilter';
import PropTypes from 'lib/PropTypes';
import React from 'react';
import ReactDOM from 'react-dom';
import styles from 'components/ExplorerQueryComposer/ExplorerQueryComposer.scss';
import PropTypes from 'lib/PropTypes';
import React from 'react';
import ReactDOM from 'react-dom';
import styles from 'components/ExplorerQueryComposer/ExplorerQueryComposer.scss';

const TABLE_SOURCES_LABEL = ['API Event', 'Custom Event'];

Expand Down Expand Up @@ -67,7 +66,7 @@ const FIELD_TYPE = {
'Request Type' : 'String',
'Class' : 'String',
'Event Name' : 'String',
'Dimensions' : check_gatekeeper('explorer_json_scalar') ? 'JSON' : 'String',
'Dimensions' : false ? 'JSON' : 'String', //In progress features. Change false to true to work on this feature.
'Installation ID' : 'String',
'Parse User ID' : 'String',
'Parse SDK' : 'String',
Expand Down
3 changes: 1 addition & 2 deletions dashboard/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import AppData from './AppData.react';
import AppsIndex from './Apps/AppsIndex.react';
import AppsManager from 'lib/AppsManager';
import Browser from './Data/Browser/Browser.react';
import check_gatekeeper from 'lib/check_gatekeeper';
import CloudCode from './Data/CloudCode/CloudCode.react';
import Config from './Data/Config/Config.react';
import Explorer from './Analytics/Explorer/Explorer.react';
Expand Down Expand Up @@ -215,7 +214,7 @@ class Dashboard extends React.Component {
<Route path='apps/:appId' component={AppData}>
<Route path='getting_started' component={Empty} />

<Route path='browser' component={check_gatekeeper('schema_overview') ? SchemaOverview : Browser} />
<Route path='browser' component={false ? SchemaOverview : Browser} /> //In progress features. Change false to true to work on this feature.
<Route path='browser/:className' component={Browser} />

<Route path='cloud_code' component={CloudCode} />
Expand Down
11 changes: 5 additions & 6 deletions dashboard/DashboardView.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import check_gatekeeper from 'lib/check_gatekeeper';
import ParseApp from 'lib/ParseApp';
import React from 'react';
import Sidebar from 'components/Sidebar/Sidebar.react';
import SidebarToggle from 'components/Sidebar/SidebarToggle.react';
import styles from 'dashboard/Dashboard.scss';
import ParseApp from 'lib/ParseApp';
import React from 'react';
import Sidebar from 'components/Sidebar/Sidebar.react';
import SidebarToggle from 'components/Sidebar/SidebarToggle.react';
import styles from 'dashboard/Dashboard.scss';

export default class DashboardView extends React.Component {

Expand Down
4 changes: 0 additions & 4 deletions dashboard/Data/Migration/Migration.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
import base from 'stylesheets/base.scss';
import Button from 'components/Button/Button.react';
import check_gatekeeper from 'lib/check_gatekeeper';
import DashboardView from 'dashboard/DashboardView.react';
import FormNote from 'components/FormNote/FormNote.react';
import Icon from 'components/Icon/Icon.react';
Expand Down Expand Up @@ -126,9 +125,6 @@ export default class Migration extends DashboardView {
}

renderContent() {
if (!check_gatekeeper('opendb_migration_page')) {
return null;
}
return <div>
<LiveReload
ref={'reloaderView'}
Expand Down
113 changes: 55 additions & 58 deletions dashboard/Settings/GeneralSettings.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
import AccountManager from 'lib/AccountManager';
import AppsManager from 'lib/AppsManager';
import check_gatekeeper from 'lib/check_gatekeeper';
import Collaborators from 'dashboard/Settings/Collaborators.react';
import DashboardView from 'dashboard/DashboardView.react';
import Dropdown from 'components/Dropdown/Dropdown.react';
Expand Down Expand Up @@ -209,63 +208,61 @@ let ManageAppFields = ({
deleteApp,
}) => {
let migrateAppField = null;
if (check_gatekeeper('opendb_migration_page')) {
if (!mongoURL && !hasInProgressMigration) {
migrateAppField = <Field
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Migrate to external database'
description='Move your data and queries to your own database.' />
}
input={<FormButton
color='red'
onClick={startMigration}
value='Migrate' />
} />;
} else if (hasInProgressMigration) {
migrateAppField = <Field
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Migrate to external database'
description='View your migration progress.' />}
input={<FormButton
color='blue'
onClick={() => history.pushState(null, '/apps/' + appSlug + '/migration')}
value='View progress' />} />
} else {
migrateAppField = [<Field
key='show'
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Migration complete'
description='Your database has been migrated to an external database.'
/>}
//TODO: KeyField bascially does what we want, but is maybe too specialized. Maybe at some point we should have a component dedicated to semi-secret stuff that we want to prevent shoulder surfers from seeing, and emphasizing that stuff something should be secret.
input={<KeyField
hidden={true}
whenHiddenText='Show connection string'
>
<TextInput
value={mongoURL}
onChange={() => {}} //Make propTypes happy
disabled={true}
monospace={true}
/>
</KeyField>}
/>,
<Field
key='new'
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Change connection string'
description='Upgrate or change your database.'/>}
input={<FormButton
additionalStyles={{fontSize: '13px'}}
color='red'
onClick={changeConnectionString}
value='Change connection string' />} />
];
}
if (!mongoURL && !hasInProgressMigration) {
migrateAppField = <Field
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Migrate to external database'
description='Move your data and queries to your own database.' />
}
input={<FormButton
color='red'
onClick={startMigration}
value='Migrate' />
} />;
} else if (hasInProgressMigration) {
migrateAppField = <Field
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Migrate to external database'
description='View your migration progress.' />}
input={<FormButton
color='blue'
onClick={() => history.pushState(null, '/apps/' + appSlug + '/migration')}
value='View progress' />} />
} else {
migrateAppField = [<Field
key='show'
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Migration complete'
description='Your database has been migrated to an external database.'
/>}
//TODO: KeyField bascially does what we want, but is maybe too specialized. Maybe at some point we should have a component dedicated to semi-secret stuff that we want to prevent shoulder surfers from seeing, and emphasizing that stuff something should be secret.
input={<KeyField
hidden={true}
whenHiddenText='Show connection string'
>
<TextInput
value={mongoURL}
onChange={() => {}} //Make propTypes happy
disabled={true}
monospace={true}
/>
</KeyField>}
/>,
<Field
key='new'
labelWidth={DEFAULT_SETTINGS_LABEL_WIDTH}
label={<Label
text='Change connection string'
description='Upgrate or change your database.'/>}
input={<FormButton
additionalStyles={{fontSize: '13px'}}
color='red'
onClick={changeConnectionString}
value='Change connection string' />} />
];
}
return (
<Fieldset
Expand Down
40 changes: 19 additions & 21 deletions dashboard/Settings/SecuritySettings.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,22 @@
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import AccountManager from 'lib/AccountManager';
import check_gatekeeper from 'lib/check_gatekeeper';
import DashboardView from 'dashboard/DashboardView.react';
import Field from 'components/Field/Field.react';
import Fieldset from 'components/Fieldset/Fieldset.react';
import FlowView from 'components/FlowView/FlowView.react';
import FormButton from 'components/FormButton/FormButton.react';
import FormModal from 'components/FormModal/FormModal.react';
import FormNote from 'components/FormNote/FormNote.react';
import KeyField from 'components/KeyField/KeyField.react';
import Label from 'components/Label/Label.react';
import Modal from 'components/Modal/Modal.react';
import React from 'react';
import styles from 'dashboard/Settings/Settings.scss';
import TextInput from 'components/TextInput/TextInput.react';
import Toggle from 'components/Toggle/Toggle.react';
import Toolbar from 'components/Toolbar/Toolbar.react';
import AccountManager from 'lib/AccountManager';
import DashboardView from 'dashboard/DashboardView.react';
import Field from 'components/Field/Field.react';
import Fieldset from 'components/Fieldset/Fieldset.react';
import FlowView from 'components/FlowView/FlowView.react';
import FormButton from 'components/FormButton/FormButton.react';
import FormModal from 'components/FormModal/FormModal.react';
import FormNote from 'components/FormNote/FormNote.react';
import KeyField from 'components/KeyField/KeyField.react';
import Label from 'components/Label/Label.react';
import Modal from 'components/Modal/Modal.react';
import React from 'react';
import styles from 'dashboard/Settings/Settings.scss';
import TextInput from 'components/TextInput/TextInput.react';
import Toggle from 'components/Toggle/Toggle.react';
import Toolbar from 'components/Toolbar/Toolbar.react';

export default class SecuritySettings extends DashboardView {
constructor() {
Expand Down Expand Up @@ -79,9 +78,6 @@ export default class SecuritySettings extends DashboardView {
onChange={(allow) => setField('client_class_creation_enabled', allow)}/>
} />
</Fieldset> : null;
let fileKeyField = check_gatekeeper('show_file_key') ? <Field
label={<Label text='File key' description='Use this key when migrating to your own Parse Server to ensure your new server has access to existing files.' />}
input={<KeyField name='File' hidden={true}>{currentApp.fileKey}</KeyField>} /> : null;
return (
<div className={styles.settings_page}>
<Fieldset legend='App Keys' description='These are the unique identifiers used to access this app.'>
Expand All @@ -103,7 +99,9 @@ export default class SecuritySettings extends DashboardView {
<Field
label={<Label text='Webhook key' description='Use this when implementing a Cloud Code Webhook. Keep it secret!' />}
input={<KeyField name='Webhook' hidden={true}>{currentApp.webhookKey}</KeyField>} />
{fileKeyField}
<Field
label={<Label text='File key' description='Use this key when migrating to your own Parse Server to ensure your new server has access to existing files.' />}
input={<KeyField name='File' hidden={true}>{currentApp.fileKey}</KeyField>} />
<Field
label={<Label text='Master key' description='Using this key overrides all permissions. Not usable on client SDKs. Keep it secret!' />}
input={<KeyField name='Master' hidden={true}>{currentApp.masterKey}</KeyField>} />
Expand Down
1 change: 0 additions & 1 deletion dashboard/Settings/UsersSettings.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import renderFlowFooterChanges from 'lib/renderFlowFooterChanges';
import style from 'dashboard/Settings/Settings.scss';
import TextInput from 'components/TextInput/TextInput.react';
import Toggle from 'components/Toggle/Toggle.react';
import check_gatekeeper from 'lib/check_gatekeeper';
import Toolbar from 'components/Toolbar/Toolbar.react';
import unique from 'lib/unique';
import { Promise } from 'parse';
Expand Down
7 changes: 3 additions & 4 deletions dashboard/SidebarBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import check_gatekeeper from 'lib/check_gatekeeper';
import React from 'react';
import Sidebar from 'components/Sidebar/Sidebar.react';
import SidebarSubItem from 'components/Sidebar/SidebarSubItem.react';
import React from 'react';
import Sidebar from 'components/Sidebar/Sidebar.react';
import SidebarSubItem from 'components/Sidebar/SidebarSubItem.react';

let accountSidebarSections = [
{
Expand Down
10 changes: 0 additions & 10 deletions lib/check_gatekeeper.js

This file was deleted.