(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
pull/21/head
Cyprien P 3 years ago
parent 8056bb0069
commit 9a6369a4ff

@ -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;
`);

Loading…
Cancel
Save