Skip to content

Commit

Permalink
Remove detach from the frontend (codalab#2427)
Browse files Browse the repository at this point in the history
* clear force delete bit

* remove detach from frontend

* remove constant
  • Loading branch information
yipenghe committed Jun 19, 2020
1 parent abd8cf1 commit 2e8a72a
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 49 deletions.
10 changes: 0 additions & 10 deletions frontend/src/components/worksheets/BundleBulkActionMenu.js
Expand Up @@ -37,16 +37,6 @@ class BundleBulkActionMenu extends React.Component {
<DeleteForeverIcon fontSize='small' />
<Typography variant='inherit'>Delete</Typography>
</Button>
<Button
size='small'
color='inherit'
aria-label='Detach'
disabled={!this.props.editPermission}
onClick={this.props.toggleCmdDialog('detach')}
>
<ExitToAppIcon fontSize='small' />
<Typography variant='inherit'>Detach</Typography>
</Button>
<Button
size='small'
color='inherit'
Expand Down
16 changes: 0 additions & 16 deletions frontend/src/components/worksheets/Worksheet/Worksheet.js
Expand Up @@ -354,8 +354,6 @@ class Worksheet extends React.Component {
}
if (cmd_type === 'rm') {
this.setState({ openedDialog: DIALOG_TYPES.OPEN_DELETE_BUNDLE });
} else if (cmd_type === 'detach') {
this.setState({ openedDialog: DIALOG_TYPES.OPEN_DETACH });
} else if (cmd_type === 'kill') {
this.setState({ openedDialog: DIALOG_TYPES.OPEN_KILL });
} else if (cmd_type === 'copy' || cmd_type === 'cut') {
Expand Down Expand Up @@ -432,8 +430,6 @@ class Worksheet extends React.Component {
return true;
} else if (this.state.openedDialog === DIALOG_TYPES.OPEN_DELETE_BUNDLE) {
this.executeBundleCommandNoEvent('rm');
} else if (this.state.openedDialog === DIALOG_TYPES.OPEN_DETACH) {
this.executeBundleCommandNoEvent('detach');
} else if (this.state.openedDialog === DIALOG_TYPES.OPEN_KILL) {
this.executeBundleCommandNoEvent('kill');
}
Expand Down Expand Up @@ -938,16 +934,6 @@ class Worksheet extends React.Component {
}
this.toggleCmdDialogNoEvent('rm');
});
// Consider deprecating detach from the frontend
Mousetrap.bind(['a D'], () => {
if (
this.state.openedDialog &&
this.state.openedDialog !== DIALOG_TYPES.OPEN_DETACH
) {
return;
}
this.toggleCmdDialogNoEvent('detach');
});
Mousetrap.bind(['a k'], () => {
if (
this.state.openedDialog &&
Expand All @@ -973,8 +959,6 @@ class Worksheet extends React.Component {
this.executeBundleCommandNoEvent('rm');
} else if (this.state.openedDialog === DIALOG_TYPES.OPEN_KILL) {
this.executeBundleCommandNoEvent('kill');
} else if (this.state.openedDialog === DIALOG_TYPES.OPEN_DETACH) {
this.executeBundleCommandNoEvent('detach');
}
}.bind(this),
);
Expand Down
22 changes: 0 additions & 22 deletions frontend/src/components/worksheets/WorksheetDialogs.js
Expand Up @@ -77,28 +77,6 @@ class WorksheetDialogs extends React.Component {
</Button>
</DialogActions>
</Dialog>
<Dialog
open={this.props.openedDialog === DIALOG_TYPES.OPEN_DETACH}
onClose={this.props.closeDialog}
aria-labelledby='detach-confirmation-title'
aria-describedby='detach-confirmation-description'
>
<DialogTitle id='detach-confirmation-title'>
{'Detach selected bundles from this worksheet?'}
</DialogTitle>
<DialogActions>
<Button color='primary' onClick={this.props.closeDialog}>
CANCEL
</Button>
<Button
color='primary'
variant='contained'
onClick={this.props.executeBundleCommand('detach')}
>
DETACH
</Button>
</DialogActions>
</Dialog>
<Dialog
open={this.props.openedDialog === DIALOG_TYPES.OPEN_KILL}
onClose={this.props.closeDialog}
Expand Down
1 change: 0 additions & 1 deletion frontend/src/constants.js
Expand Up @@ -13,7 +13,6 @@ export const LOCAL_STORAGE_WORKSHEET_WIDTH = 'worksheetWidth';
// Dialog constants
export const DIALOG_TYPES = {
OPEN_DELETE_BUNDLE: 'delete_bundle',
OPEN_DETACH: 'detach_bundle',
OPEN_KILL: 'kill_bundle',
OPEN_DELETE_MARKDOWN: 'delete_markdown_block',
OPEN_DELETE_WORKSHEET: 'delete_whole_worksheet',
Expand Down

0 comments on commit 2e8a72a

Please sign in to comment.