refactor: update team nomenclature (#3880)
Co-authored-by: jamesgeorge007 <jamesgeorge998001@gmail.com>
This commit is contained in:
@@ -15,6 +15,8 @@ import { computed } from "vue"
|
||||
import { useI18n } from "~/composables/i18n"
|
||||
import { useService } from "dioc/vue"
|
||||
import { WorkspaceService } from "~/services/workspace.service"
|
||||
import { useReadonlyStream } from "~/composables/stream"
|
||||
import { platform } from "~/platform"
|
||||
|
||||
const props = defineProps<{
|
||||
section?: string
|
||||
@@ -26,14 +28,23 @@ const t = useI18n()
|
||||
const workspaceService = useService(WorkspaceService)
|
||||
const workspace = workspaceService.currentWorkspace
|
||||
|
||||
const currentUser = useReadonlyStream(
|
||||
platform.auth.getProbableUserStream(),
|
||||
platform.auth.getProbableUser()
|
||||
)
|
||||
|
||||
const currentWorkspace = computed(() => {
|
||||
const personalWorkspaceName = currentUser.value?.displayName
|
||||
? t("workspace.personal_workspace", { name: currentUser.value.displayName })
|
||||
: t("workspace.personal")
|
||||
|
||||
if (props.isOnlyPersonal) {
|
||||
return `${t("workspace.personal")}`
|
||||
return personalWorkspaceName
|
||||
}
|
||||
if (workspace.value.type === "team") {
|
||||
return teamWorkspaceName.value
|
||||
}
|
||||
return `${t("workspace.personal")}`
|
||||
return personalWorkspaceName
|
||||
})
|
||||
|
||||
const teamWorkspaceName = computed(() => {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="flex flex-col">
|
||||
<div class="flex flex-col">
|
||||
<HoppSmartItem
|
||||
label="My Workspace"
|
||||
:label="personalWorkspaceName"
|
||||
:icon="IconUser"
|
||||
:info-icon="workspace.type === 'personal' ? IconDone : undefined"
|
||||
:active-info-icon="workspace.type === 'personal'"
|
||||
@@ -36,7 +36,7 @@
|
||||
class="sticky top-0 z-10 mb-2 flex items-center justify-between bg-popover py-2 pl-2"
|
||||
>
|
||||
<div class="flex items-center px-2 font-semibold text-secondaryLight">
|
||||
{{ t("team.title") }}
|
||||
{{ t("workspace.other_workspaces") }}
|
||||
</div>
|
||||
<HoppButtonSecondary
|
||||
v-tippy="{ theme: 'tooltip' }"
|
||||
@@ -96,6 +96,12 @@ const currentUser = useReadonlyStream(
|
||||
platform.auth.getProbableUser()
|
||||
)
|
||||
|
||||
const personalWorkspaceName = computed(() =>
|
||||
currentUser.value?.displayName
|
||||
? t("workspace.personal_workspace", { name: currentUser.value.displayName })
|
||||
: t("workspace.personal")
|
||||
)
|
||||
|
||||
const workspaceService = useService(WorkspaceService)
|
||||
const teamListadapter = workspaceService.acquireTeamListAdapter(null)
|
||||
const myTeams = useReadonlyStream(teamListadapter.teamList$, [])
|
||||
|
||||
Reference in New Issue
Block a user