|
43 | 43 | @click="invokeAction('modals.support.toggle')"
|
44 | 44 | />
|
45 | 45 | </div>
|
46 |
| - <div class="flex"> |
| 46 | + <div |
| 47 | + class="flex" |
| 48 | + :class="{ |
| 49 | + 'flex-row-reverse gap-2': |
| 50 | + workspaceSelectorFlagEnabled && !currentUser, |
| 51 | + }" |
| 52 | + > |
47 | 53 | <div
|
48 | 54 | v-if="currentUser === null"
|
49 | 55 | class="inline-flex items-center space-x-2"
|
50 | 56 | >
|
51 | 57 | <HoppButtonSecondary
|
| 58 | + v-if="!workspaceSelectorFlagEnabled" |
52 | 59 | :icon="IconUploadCloud"
|
53 | 60 | :label="t('header.save_workspace')"
|
54 | 61 | class="!focus-visible:text-emerald-600 !hover:text-emerald-600 hidden h-8 border border-emerald-600/25 bg-emerald-500/10 !text-emerald-500 hover:border-emerald-600/20 hover:bg-emerald-600/20 focus-visible:border-emerald-600/20 focus-visible:bg-emerald-600/20 md:flex"
|
|
60 | 67 | @click="invokeAction('modals.login.toggle')"
|
61 | 68 | />
|
62 | 69 | </div>
|
63 |
| - <div v-else class="inline-flex items-center space-x-2"> |
64 |
| - <TeamsMemberStack |
65 |
| - v-if=" |
66 |
| - workspace.type === 'team' && |
67 |
| - selectedTeam && |
68 |
| - selectedTeam.teamMembers.length > 1 |
69 |
| - " |
70 |
| - :team-members="selectedTeam.teamMembers" |
71 |
| - show-count |
72 |
| - class="mx-2" |
73 |
| - @handle-click="handleTeamEdit()" |
74 |
| - /> |
| 70 | + <TeamsMemberStack |
| 71 | + v-else-if=" |
| 72 | + currentUser !== null && |
| 73 | + workspace.type === 'team' && |
| 74 | + selectedTeam && |
| 75 | + selectedTeam.teamMembers.length > 1 |
| 76 | + " |
| 77 | + :team-members="selectedTeam.teamMembers" |
| 78 | + show-count |
| 79 | + class="mx-2" |
| 80 | + @handle-click="handleTeamEdit()" |
| 81 | + /> |
| 82 | + <div |
| 83 | + v-if="workspaceSelectorFlagEnabled || currentUser" |
| 84 | + class="inline-flex items-center space-x-2" |
| 85 | + > |
75 | 86 | <div
|
76 | 87 | class="flex h-8 divide-x divide-emerald-600/25 rounded border border-emerald-600/25 bg-emerald-500/10 focus-within:divide-emerald-600/20 focus-within:border-emerald-600/20 focus-within:bg-emerald-600/20 hover:divide-emerald-600/20 hover:border-emerald-600/20 hover:bg-emerald-600/20"
|
77 | 88 | >
|
|
84 | 95 | />
|
85 | 96 | <HoppButtonSecondary
|
86 | 97 | v-if="
|
| 98 | + currentUser && |
87 | 99 | workspace.type === 'team' &&
|
88 | 100 | selectedTeam &&
|
89 | 101 | selectedTeam?.myRole === 'OWNER'
|
|
124 | 136 | </div>
|
125 | 137 | </template>
|
126 | 138 | </tippy>
|
127 |
| - <span class="px-2"> |
| 139 | + <span v-if="currentUser" class="px-2"> |
128 | 140 | <tippy
|
129 | 141 | interactive
|
130 | 142 | trigger="click"
|
@@ -259,6 +271,13 @@ import {
|
259 | 271 | const t = useI18n()
|
260 | 272 | const toast = useToast()
|
261 | 273 |
|
| 274 | +/** |
| 275 | + * Feature flag to enable the workspace selector login conversion |
| 276 | + */ |
| 277 | +const workspaceSelectorFlagEnabled = computed( |
| 278 | + () => !!platform.platformFeatureFlags.workspaceSwitcherLogin?.value |
| 279 | +) |
| 280 | +
|
262 | 281 | /**
|
263 | 282 | * Once the PWA code is initialized, this holds a method
|
264 | 283 | * that can be called to show the user the installation
|
@@ -380,6 +399,8 @@ const inviteTeam = (team: { name: string }, teamID: string) => {
|
380 | 399 |
|
381 | 400 | // Show the workspace selected team invite modal if the user is an owner of the team else show the default invite modal
|
382 | 401 | const handleInvite = () => {
|
| 402 | + if (!currentUser.value) return invokeAction("modals.login.toggle") |
| 403 | +
|
383 | 404 | if (
|
384 | 405 | workspace.value.type === "team" &&
|
385 | 406 | workspace.value.teamID &&
|
|
0 commit comments