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:
@@ -75,6 +75,8 @@ export interface HomeModel {
|
||||
// user isn't allowed to create a doc.
|
||||
newDocWorkspace: Observable<Workspace|null|"unsaved">;
|
||||
|
||||
shouldShowAddNewTip: Observable<boolean>;
|
||||
|
||||
createWorkspace(name: string): Promise<void>;
|
||||
renameWorkspace(id: number, name: string): Promise<void>;
|
||||
deleteWorkspace(id: number, forever: boolean): Promise<void>;
|
||||
@@ -154,6 +156,9 @@ export class HomeModelImpl extends Disposable implements HomeModel, ViewSettings
|
||||
public readonly showIntro = Computed.create(this, this.workspaces, (use, wss) => (
|
||||
wss.every((ws) => ws.isSupportWorkspace || ws.docs.length === 0)));
|
||||
|
||||
public readonly shouldShowAddNewTip = Observable.create(this,
|
||||
!this._app.behavioralPromptsManager.hasSeenTip('addNew'));
|
||||
|
||||
private _userOrgPrefs = Observable.create<UserOrgPrefs|undefined>(this, this._app.currentOrg?.userOrgPrefs);
|
||||
|
||||
constructor(private _app: AppModel, clientScope: ClientScope) {
|
||||
|
||||
Reference in New Issue
Block a user