mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 05:26:00 +00:00
support remove fields for mongo
This commit is contained in:
@@ -48,10 +48,19 @@
|
||||
category: 'Data form',
|
||||
name: 'Set NULL',
|
||||
keyText: 'CtrlOrCommand+0',
|
||||
testEnabled: () => getCurrentDataForm() != null,
|
||||
testEnabled: () => getCurrentDataForm() != null && !getCurrentDataForm()?.getEditorTypes()?.supportFieldRemoval,
|
||||
onClick: () => getCurrentDataForm().setFixedValue(null),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'dataForm.removeField',
|
||||
category: 'Data form',
|
||||
name: 'Remove field',
|
||||
keyText: 'CtrlOrCommand+0',
|
||||
testEnabled: () => getCurrentDataForm() != null && getCurrentDataForm()?.getEditorTypes()?.supportFieldRemoval,
|
||||
onClick: () => getCurrentDataForm().setFixedValue(undefined),
|
||||
});
|
||||
|
||||
registerCommand({
|
||||
id: 'dataForm.undo',
|
||||
category: 'Data form',
|
||||
@@ -321,6 +330,10 @@
|
||||
|
||||
export const activator = createActivator('FormView', false);
|
||||
|
||||
export function getEditorTypes() {
|
||||
return display?.driver?.dataEditorTypesBehaviour;
|
||||
}
|
||||
|
||||
const handleTableMouseDown = event => {
|
||||
if (event.target.closest('.buttonLike')) return;
|
||||
if (event.target.closest('.resizeHandleControl')) return;
|
||||
@@ -411,10 +424,11 @@
|
||||
{ divider: true },
|
||||
{ placeTag: 'save' },
|
||||
{ command: 'dataForm.revertRowChanges' },
|
||||
{ command: 'dataForm.setNull' },
|
||||
{ command: 'dataForm.setNull', hideDisabled: true },
|
||||
{ command: 'dataForm.removeField', hideDisabled: true },
|
||||
{ divider: true },
|
||||
{ command: 'dataForm.undo' },
|
||||
{ command: 'dataForm.redo' },
|
||||
{ command: 'dataForm.undo', hideDisabled: true },
|
||||
{ command: 'dataForm.redo', hideDisabled: true },
|
||||
{ divider: true },
|
||||
{ command: 'dataForm.goToFirst' },
|
||||
{ command: 'dataForm.goToPrevious' },
|
||||
|
||||
Reference in New Issue
Block a user