Skip to content

Commit 76509c5

Browse files
authored
check parser server version for create class with clp (#415)
* check parser server version for create class with clp * changed to clp supported parse version
1 parent 0929471 commit 76509c5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/dashboard/Data/Browser/Browser.react.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,9 @@ class Browser extends DashboardView {
606606

607607
createClass(className, isProtected) {
608608
let clp = isProtected ? protectedCLPs : defaultCLPS;
609+
if (semver.lte(this.context.currentApp.serverInfo.parseServerVersion, '3.1.1')) {
610+
clp = {};
611+
}
609612
this.props.schema.dispatch(ActionTypes.CREATE_CLASS, { className, clp }).then(() => {
610613
this.state.counts[className] = 0;
611614
history.push(this.context.generatePath('browser/' + className));
@@ -1672,11 +1675,13 @@ class Browser extends DashboardView {
16721675
);
16731676
}
16741677
if (this.state.showCreateClassDialog) {
1678+
const { currentApp = {} } = this.context;
16751679
extras = (
16761680
<CreateClassDialog
16771681
currentAppSlug={this.context.currentApp.slug}
16781682
onAddColumn={this.showAddColumn}
16791683
currentClasses={this.props.schema.data.get('classes').keySeq().toArray()}
1684+
parseServerVersion={currentApp.serverInfo && currentApp.serverInfo.parseServerVersion}
16801685
onCancel={() => this.setState({ showCreateClassDialog: false })}
16811686
onConfirm={this.createClass} />
16821687
);

src/dashboard/Data/Browser/CreateClassDialog.react.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Label from 'components/Label/Label.react';
1111
import Modal from 'components/Modal/Modal.react';
1212
import Option from 'components/Dropdown/Option.react';
1313
import React from 'react';
14+
import semver from 'semver/preload.js';
1415
import { SpecialClasses } from 'lib/Constants';
1516
import styles from './Browser.scss';
1617
import TextInput from 'components/TextInput/TextInput.react';
@@ -108,7 +109,7 @@ export default class CreateClassDialog extends React.Component {
108109
}
109110
input={typeDropdown} /> : null
110111
}
111-
{this.state.type === 'Custom' ?
112+
{this.state.type === 'Custom' && semver.gt(this.props.parseServerVersion, '3.1.1') ?
112113
(<>
113114
<Field
114115
label={<Label text='Add in Protected mode' description={'Your class\'s objects are protected by default. Client read/write access will only be granted when specified by your CLPs/ACLs security rules.'} />}

0 commit comments

Comments
 (0)