mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
* `GRIST_ANON_PLAYGROUND`: When set to 'false' deny anonymous users access to the home page * `GRIST_FORCE_LOGIN`: Much like `GRIST_ANON_PLAYGROUND` but don't support anonymous access at all (features like sharing docs publicly requires authentication) --------- Co-authored-by: Florent FAYOLLE <florent.fayolle@beta.gouv.fr>
This commit is contained in:
@@ -30,16 +30,17 @@ export function createHomeLeftPane(leftPanelOpen: Observable<boolean>, home: Hom
|
||||
const creating = observable<boolean>(false);
|
||||
const renaming = observable<Workspace|null>(null);
|
||||
const isAnonymous = !home.app.currentValidUser;
|
||||
const canCreate = !isAnonymous || getGristConfig().enableAnonPlayground;
|
||||
|
||||
return cssContent(
|
||||
dom.autoDispose(creating),
|
||||
dom.autoDispose(renaming),
|
||||
addNewButton(leftPanelOpen,
|
||||
menu(() => addMenu(home, creating), {
|
||||
addNewButton({ isOpen: leftPanelOpen, isDisabled: !canCreate },
|
||||
canCreate ? menu(() => addMenu(home, creating), {
|
||||
placement: 'bottom-start',
|
||||
// "Add New" menu should have the same width as the "Add New" button that opens it.
|
||||
stretchToSelector: `.${cssAddNewButton.className}`
|
||||
}),
|
||||
}) : null,
|
||||
dom.cls('behavioral-prompt-add-new'),
|
||||
testId('dm-add-new'),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user