From 0896b12ba466ece8b4200aaef276fb30c421dcd0 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Tue, 23 Apr 2024 14:04:59 +0200 Subject: [PATCH 1/2] CB-5036 disables uploading files for readonly tables for cells --- .../DataGridContextMenuSaveContentService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts index 1e6756cc44..a87e6e2df3 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts @@ -65,7 +65,9 @@ export class DataGridContextMenuSaveContentService { }, isHidden: context => { const format = context.data.model.source.getAction(context.data.resultIndex, ResultSetFormatAction); - return !format.isBinary(context.data.key); + const isReadonlyTable = context.data.model.isReadonly(context.data.resultIndex); + + return !format.isBinary(context.data.key) || isReadonlyTable; }, isDisabled: context => { const content = context.data.model.source.getAction(context.data.resultIndex, ResultSetDataContentAction); From 2dcb03e497bdbf4281e823877cf13cd3e593ee23 Mon Sep 17 00:00:00 2001 From: sergeyteleshev Date: Wed, 24 Apr 2024 11:42:22 +0200 Subject: [PATCH 2/2] CB-5036 cleanup --- .../DataGridContextMenuSaveContentService.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts index a87e6e2df3..f0296277a1 100644 --- a/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts +++ b/webapp/packages/plugin-data-spreadsheet-new/src/DataGrid/DataGridContextMenu/DataGridContextMenuSaveContentService.ts @@ -65,9 +65,8 @@ export class DataGridContextMenuSaveContentService { }, isHidden: context => { const format = context.data.model.source.getAction(context.data.resultIndex, ResultSetFormatAction); - const isReadonlyTable = context.data.model.isReadonly(context.data.resultIndex); - return !format.isBinary(context.data.key) || isReadonlyTable; + return !format.isBinary(context.data.key) || context.data.model.isReadonly(context.data.resultIndex); }, isDisabled: context => { const content = context.data.model.source.getAction(context.data.resultIndex, ResultSetDataContentAction);