diff --git a/packages/frontend-2/components/common/ConfirmDialog.vue b/packages/frontend-2/components/common/ConfirmDialog.vue new file mode 100644 index 000000000..8011670ee --- /dev/null +++ b/packages/frontend-2/components/common/ConfirmDialog.vue @@ -0,0 +1,37 @@ + + + Discard changes? + {{ text }} + You have unsaved changes. Are you sure you want to leave? + + + diff --git a/packages/frontend-2/components/dashboard/Sidebar.vue b/packages/frontend-2/components/dashboard/Sidebar.vue index df3cc5423..1864b3e45 100644 --- a/packages/frontend-2/components/dashboard/Sidebar.vue +++ b/packages/frontend-2/components/dashboard/Sidebar.vue @@ -58,16 +58,10 @@ v-if="isWorkspacesEnabled" collapsible title="Workspaces" - :plus-click=" - isNotGuest - ? () => { - openWorkspaceCreateDialog() - } - : undefined - " + :plus-click="isNotGuest ? handlePlusClick : undefined" plus-text="Create workspace" > - + : [] ) -const openWorkspaceCreateDialog = () => { - showWorkspaceCreateDialog.value = true - mixpanel.track('Create Workspace Button Clicked', { - source: 'sidebar' - }) -} - onWorkspaceResult((result) => { if (result.data?.activeUser) { const workspaceIds = result.data.activeUser.workspaces.items.map( @@ -273,4 +261,29 @@ const openFeedbackDialog = () => { showFeedbackDialog.value = true isOpenMobile.value = false } + +const openWorkspaceCreateDialog = () => { + showWorkspaceCreateDialog.value = true + mixpanel.track('Create Workspace Button Clicked', { + source: 'sidebar' + }) +} + +const handlePlusClick = () => { + if (route.path === workspacesRoute) { + openWorkspaceCreateDialog() + } else { + mixpanel.track('Clicked Link to Workspace Explainer', { + source: 'sidebar' + }) + router.push(workspacesRoute) + } +} + +const handleIntroducingWorkspacesClick = () => { + isOpenMobile.value = false + mixpanel.track('Clicked Link to Workspace Explainer', { + source: 'sidebar' + }) +} diff --git a/packages/frontend-2/components/projects/AddDialog.vue b/packages/frontend-2/components/projects/AddDialog.vue index 935dfe4d0..50df3bb00 100644 --- a/packages/frontend-2/components/projects/AddDialog.vue +++ b/packages/frontend-2/components/projects/AddDialog.vue @@ -1,5 +1,11 @@ - + Create a new project @@ -28,7 +34,7 @@ - + Workspace @@ -39,31 +45,31 @@ disabled-item-tooltip="You dont have rights to create projects in this workspace" class="flex-1" /> - + + + - + New workspace - Workspace offers better project management and higher data security. + Workspaces offer better project management and higher data security. - +
{{ text }}
You have unsaved changes. Are you sure you want to leave?
Workspace
- Workspace offers better project management and higher data security. + Workspaces offer better project management and higher data security.