mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add a button and a tooltip to Access Rules page item, in View-As mode.
Summary: - When in View-As mode, clicking the Access Rules page now shows a tooltip with a link to return to normal mode and open the Access Rules page. - A "revert" button is shown next to the item with the same behavior. - Implemented hoverTooltip() with various options. (It will have other uses.) - Simplify creation of links based on UrlState: - Allow merging with previous urlState using a function - Add a helper function to merge in aclAsUser parameter. - Add setHref() method to UrlState Test Plan: Added test cases: - for tooltips generally in test/projects - for updating UrlState using a callback - for Access Rules tooltip and button behavior Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2749
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import {ITooltipControl, showTooltip} from 'app/client/ui/tooltips';
|
||||
import {ITooltipControl, showTooltip, tooltipCloseButton} from 'app/client/ui/tooltips';
|
||||
import {colors, testId} from 'app/client/ui2018/cssVars';
|
||||
import {icon} from 'app/client/ui2018/icons';
|
||||
import {cssLink} from 'app/client/ui2018/links';
|
||||
@@ -11,7 +11,7 @@ export function showTooltipToCreateFormula(editorDom: HTMLElement, convert: () =
|
||||
dom.on('mousedown', (ev) => { ev.preventDefault(); convert(); }),
|
||||
testId('editor-tooltip-convert'),
|
||||
),
|
||||
cssCloseButton(icon('CrossSmall'), dom.on('click', ctl.close)),
|
||||
tooltipCloseButton(ctl),
|
||||
);
|
||||
}
|
||||
const offerCtl = showTooltip(editorDom, buildTooltip, {key: 'col-to-formula'});
|
||||
@@ -32,20 +32,3 @@ const cssConvertTooltip = styled('div', `
|
||||
margin-left: 8px;
|
||||
}
|
||||
`);
|
||||
|
||||
const cssCloseButton = styled('div', `
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
line-height: 16px;
|
||||
text-align: center;
|
||||
margin: -4px -4px -4px 8px;
|
||||
--icon-color: white;
|
||||
border-radius: 16px;
|
||||
|
||||
&:hover {
|
||||
background-color: white;
|
||||
--icon-color: black;
|
||||
}
|
||||
`);
|
||||
|
||||
Reference in New Issue
Block a user