-
-
Notifications
You must be signed in to change notification settings - Fork 589
feat(share): point the app at a self-hosted share/collab server at runtime #1687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c1bf0dd
52049fb
8a879a4
6b2b465
0e4b1f1
2153097
2e8ecb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -119,6 +119,7 @@ import { NewProjectDialog } from "./NewProjectDialog"; | |
| import { ManagePluginsDialog } from "./ManagePluginsDialog"; | ||
| import { ProjectGalleryDialog } from "./ProjectGalleryDialog"; | ||
| import { ShareProjectDialog } from "./ShareProjectDialog"; | ||
| import { resolveShareHost } from "../../lib/share-geolibre"; | ||
| import type { CollaborationApi } from "../../hooks/useCollaboration"; | ||
| import { SettingsDialog } from "./SettingsDialog"; | ||
| import { SetViewDialog } from "./SetViewDialog"; | ||
|
|
@@ -1070,6 +1071,11 @@ export function TopToolbar({ | |
| const [managePluginsOpen, setManagePluginsOpen] = useState(false); | ||
| const [shareDialogOpen, setShareDialogOpen] = useState(false); | ||
| const [galleryDialogOpen, setGalleryDialogOpen] = useState(false); | ||
| // Whether this deployment has a usable share host. Read once per render (the | ||
| // deployment env does not change while the app is running) and passed down so | ||
| // the menu, the command palette, and the dialogs agree. | ||
| const shareHost = resolveShareHost(); | ||
| const shareAvailable = shareHost.baseUrl != null; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor UX inconsistency: when
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not fixing this one — leaving the thread open for a maintainer call. The gap is real, but the The menu keeps the discoverable version (visible reason + |
||
| const [aboutOpen, setAboutOpen] = useState(false); | ||
| const [printLayoutOpen, setPrintLayoutOpen] = useState(false); | ||
| const [fieldCollectionOpen, setFieldCollectionOpen] = useState(false); | ||
|
|
@@ -1196,13 +1202,19 @@ export function TopToolbar({ | |
| shortcut: { key: "s", mod: true, shift: true }, | ||
| run: () => void projectFiles.handleSaveAs(), | ||
| }, | ||
| { | ||
| id: "project.share", | ||
| title: t("toolbar.command.projectShare"), | ||
| group: t("toolbar.commandGroup.project"), | ||
| icon: Share2, | ||
| run: () => setShareDialogOpen(true), | ||
| }, | ||
| // Only when the deployment has a usable share host; a command that always | ||
| // failed would be worse than an absent one. | ||
| ...(shareAvailable | ||
| ? [ | ||
| { | ||
| id: "project.share", | ||
| title: t("toolbar.command.projectShare"), | ||
| group: t("toolbar.commandGroup.project"), | ||
| icon: Share2, | ||
| run: () => setShareDialogOpen(true), | ||
| }, | ||
| ] | ||
| : []), | ||
| // Only surfaced when live collaboration is configured (env flag). | ||
| ...(collaboration.enabled | ||
| ? [ | ||
|
|
@@ -1771,6 +1783,7 @@ export function TopToolbar({ | |
| <ProjectMenu | ||
| chrome={chrome} | ||
| collaborationEnabled={collaboration.enabled} | ||
| shareHostStatus={shareHost.status} | ||
| onNewProject={() => setNewProjectDialogOpen(true)} | ||
| onOpenFromFile={() => void projectFiles.handleOpenFromFile()} | ||
| onOpenFromUrl={() => projectFiles.setProjectUrlDialogOpen(true)} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.