support remove fields for mongo

This commit is contained in:
Jan Prochazka
2024-08-26 13:25:51 +02:00
parent 8e17516d54
commit 32ebd86171
6 changed files with 63 additions and 9 deletions

View File

@@ -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' },