From 9a6369a4ff2ebe9f0ad477cd43b90fb2b8341b36 Mon Sep 17 00:00:00 2001 From: Cyprien P Date: Wed, 5 May 2021 17:15:15 +0200 Subject: [PATCH] (core) remove the sort&filter save button on readonly mode Summary: Saving sort or filter is not permitted in readonly mode. Hence we remove the button. The diff adds a new unit to Test Plan: Adds test for behaviour to `nbrowser/ReadOnlyMode`. Also adds tests for other Save buttons related to sort & filter that should be disabled. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2804 --- app/client/ui/ViewSectionMenu.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/client/ui/ViewSectionMenu.ts b/app/client/ui/ViewSectionMenu.ts index 4080274d..68ba7ca9 100644 --- a/app/client/ui/ViewSectionMenu.ts +++ b/app/client/ui/ViewSectionMenu.ts @@ -86,6 +86,7 @@ export function viewSectionMenu(owner: IDisposableOwner, docModel: DocModel, vie dom.on('click', save), hoverTooltip(() => 'Save', {key: 'sortFilterButton', openDelay: TOOLTIP_DELAY_OPEN}), testId('small-btn-save'), + dom.hide(isReadonly), ), cssSmallIconWrapper( cssIcon('CrossSmall'), cssSmallIconWrapper.cls('-gray'), @@ -346,6 +347,8 @@ const cssSmallIconWrapper = styled('div', ` width: 16px; height: 16px; border-radius: 8px; + margin: 0 5px 0 5px; + &-green { background-color: ${colors.lightGreen}; } @@ -359,8 +362,7 @@ const cssSmallIconWrapper = styled('div', ` const cssSaveIconsWrapper = styled('div', ` - padding: 0 6px 0 6px; + padding: 0 1px 0 1px; display: flex; justify-content: space-between; - width: 54px; `);