Skip to content

Commit

Permalink
Adds support to do
Browse files Browse the repository at this point in the history
serverInfo.features.schemas.addField=false;
serverInfo.features.schemas.removeField=false;
serverInfo.features.schemas.addClass=false;
serverInfo.features.schemas.removeClass=false;
  • Loading branch information
Arul- committed Mar 27, 2021
1 parent 8335682 commit f507f76
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dashboard/Data/Browser/BrowserToolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ let BrowserToolbar = ({

enableColumnManipulation,
enableClassManipulation,
enableClassAddition,
enableClassDeletion,
enableColumnAddition,
enableColumnDeletion,
}) => {
let selectionLength = Object.keys(selection).length;
let details = [];
Expand Down Expand Up @@ -107,8 +110,8 @@ let BrowserToolbar = ({
<BrowserMenu title='Edit' icon='edit-solid' disabled={isUnique}>
<MenuItem text='Add a row' onClick={onAddRow} />
<MenuItem text='Add a row with modal' onClick={onAddRowWithModal} />
{enableColumnManipulation ? <MenuItem text='Add a column' onClick={onAddColumn} /> : <noscript />}
{enableClassManipulation ? <MenuItem text='Add a class' onClick={onAddClass} /> : <noscript />}
{enableColumnAddition && enableColumnManipulation ? <MenuItem text='Add a column' onClick={onAddColumn} /> : <noscript />}
{enableClassAddition && enableClassManipulation ? <MenuItem text='Add a class' onClick={onAddClass} /> : <noscript />}
<Separator />
<MenuItem
disabled={selectionLength !== 1}
Expand All @@ -132,7 +135,7 @@ let BrowserToolbar = ({
disabled={selectionLength === 0}
text={selectionLength === 1 && !selection['*'] ? 'Delete this row' : 'Delete these rows'}
onClick={() => onDeleteRows(selection)} />
{enableColumnManipulation ? <MenuItem text='Delete a column' onClick={onRemoveColumn} /> : <noscript />}
{enableColumnDeletion && enableColumnManipulation ? <MenuItem text='Delete a column' onClick={onRemoveColumn} /> : <noscript />}
{enableDeleteAllRows ? <MenuItem text='Delete all rows' onClick={() => onDeleteRows({ '*': true })} /> : <noscript />}
{enableClassDeletion && enableClassManipulation ? <MenuItem text='Delete this class' onClick={onDropClass} /> : <noscript />}
{enableExportClass ? <Separator /> : <noscript />}
Expand Down
3 changes: 3 additions & 0 deletions src/dashboard/Data/Browser/DataBrowser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,10 @@ export default class DataBrowser extends React.Component {
className={SpecialClasses[className] || className}
classNameForEditors={className}
setCurrent={this.setCurrent}
enableClassAddition={this.context.currentApp.serverInfo.features.schemas.addClass}
enableClassDeletion={this.context.currentApp.serverInfo.features.schemas.removeClass}
enableColumnAddition={this.context.currentApp.serverInfo.features.schemas.addField}
enableColumnDeletion={this.context.currentApp.serverInfo.features.schemas.removeField}
enableDeleteAllRows={this.context.currentApp.serverInfo.features.schemas.clearAllDataFromClass && !preventSchemaEdits}
enableExportClass={this.context.currentApp.serverInfo.features.schemas.exportClass && !preventSchemaEdits}
enableSecurityDialog={this.context.currentApp.serverInfo.features.schemas.editClassLevelPermissions && !disableSecurityDialog && !preventSchemaEdits}
Expand Down

0 comments on commit f507f76

Please sign in to comment.