Skip to content

Commit

Permalink
Adds enableClassDeletion to control class deletion using features.sch…
Browse files Browse the repository at this point in the history
…emas.removeClass
  • Loading branch information
Arul- committed Mar 27, 2021
1 parent fd81262 commit 8335682
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dashboard/Data/Browser/BrowserToolbar.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ let BrowserToolbar = ({

enableColumnManipulation,
enableClassManipulation,
enableClassDeletion,
}) => {
let selectionLength = Object.keys(selection).length;
let details = [];
Expand Down Expand Up @@ -133,7 +134,7 @@ let BrowserToolbar = ({
onClick={() => onDeleteRows(selection)} />
{enableColumnManipulation ? <MenuItem text='Delete a column' onClick={onRemoveColumn} /> : <noscript />}
{enableDeleteAllRows ? <MenuItem text='Delete all rows' onClick={() => onDeleteRows({ '*': true })} /> : <noscript />}
{enableClassManipulation ? <MenuItem text='Delete this class' onClick={onDropClass} /> : <noscript />}
{enableClassDeletion && enableClassManipulation ? <MenuItem text='Delete this class' onClick={onDropClass} /> : <noscript />}
{enableExportClass ? <Separator /> : <noscript />}
{enableExportClass ? <MenuItem text='Export this data' onClick={onExport} /> : <noscript />}
</BrowserMenu>
Expand Down
1 change: 1 addition & 0 deletions src/dashboard/Data/Browser/DataBrowser.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export default class DataBrowser extends React.Component {
className={SpecialClasses[className] || className}
classNameForEditors={className}
setCurrent={this.setCurrent}
enableClassDeletion={this.context.currentApp.serverInfo.features.schemas.removeClass}
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 8335682

Please sign in to comment.