mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) Allow creating docs from the templates page
Summary: Enables the options in the Add New menu when on the templates page (p/templates). Test Plan: Browser test. Reviewers: paulfitz, alexmojaki Reviewed By: paulfitz, alexmojaki Subscribers: paulfitz, jarek, alexmojaki Differential Revision: https://phab.getgrist.com/D2971
This commit is contained in:
parent
ffeab944cc
commit
ba1e919d39
@ -126,8 +126,8 @@ export class HomeModelImpl extends Disposable implements HomeModel, ViewSettings
|
||||
public readonly newDocWorkspace = Computed.create(this, this.currentPage, this.currentWS, (use, page, ws) => {
|
||||
// Anonymous user can create docs, but in unsaved mode.
|
||||
if (!this.app.currentValidUser) { return "unsaved"; }
|
||||
if (['templates', 'trash'].includes(page)) { return null; }
|
||||
const destWS = (page === 'all') ? (use(this.workspaces)[0] || null) : ws;
|
||||
if (page === 'trash') { return null; }
|
||||
const destWS = (['all', 'templates'].includes(page)) ? (use(this.workspaces)[0] || null) : ws;
|
||||
return destWS && roles.canEdit(destWS.access) ? destWS : null;
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user