mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add tip for "Add New" button
Summary: Adds a new tip for the doc menu's Add New button. The tip is shown only when the current user is an editor or owner, and the site is non-empty. The presence of welcome videos or popups will also cause the tip to not be shown; it will instead be shown the next time the doc menu is visited. Test Plan: Browser tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3757
This commit is contained in:
@@ -77,6 +77,7 @@ export const BehavioralPrompt = StringUnion(
|
||||
'pageWidgetPicker',
|
||||
'pageWidgetPickerSelectBy',
|
||||
'editCardLayout',
|
||||
'addNew',
|
||||
);
|
||||
export type BehavioralPrompt = typeof BehavioralPrompt.type;
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ export function isOwner(resource: {access: Role}|null): resource is {access: Rol
|
||||
return resource?.access === OWNER;
|
||||
}
|
||||
|
||||
export function isOwnerOrEditor(resource: {access: Role}|null): resource is {access: Role} {
|
||||
return canEdit(resource?.access ?? null);
|
||||
}
|
||||
|
||||
export function canUpgradeOrg(org: Organization|null): org is Organization {
|
||||
// TODO: Need to consider billing managers and support user.
|
||||
return isOwner(org);
|
||||
|
||||
Reference in New Issue
Block a user