From 62c6ea3ecbe2576d4b502b870a5023e118771b44 Mon Sep 17 00:00:00 2001 From: stack72 Date: Thu, 12 Dec 2024 18:58:34 +0100 Subject: [PATCH] fix(web): Navigate to the view a user is on --- .../components/layout/navbar/Collaborators.vue | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/web/src/components/layout/navbar/Collaborators.vue b/app/web/src/components/layout/navbar/Collaborators.vue index 146d19cd91..49526747c8 100644 --- a/app/web/src/components/layout/navbar/Collaborators.vue +++ b/app/web/src/components/layout/navbar/Collaborators.vue @@ -102,11 +102,13 @@ import { useRoute, useRouter } from "vue-router"; import Popover from "@/components/Popover.vue"; import { usePresenceStore } from "@/store/presence.store"; import { useChangeSetsStore } from "@/store/change_sets.store"; +import { useViewsStore } from "@/store/views.store"; import UserIcon from "./UserIcon.vue"; import UserCard from "./UserCard.vue"; const presenceStore = usePresenceStore(); const changeSetsStore = useChangeSetsStore(); +const viewsStore = useViewsStore(); const router = useRouter(); const route = useRoute(); @@ -116,6 +118,7 @@ export type UserInfo = { status?: string | null; changeSet?: string; pictureUrl?: string | null; + view?: string; }; const moreUsersPopoverRef = ref(); @@ -140,6 +143,7 @@ const users = computed(() => { status: user.idle ? "idle" : "active", changeSet: user.changeSetId, pictureUrl: user.pictureUrl, + view: user.viewId, }); } @@ -279,6 +283,20 @@ const filteredUsers = computed(() => { function goToUserChangeSet(user: UserInfo) { if (!user || !user.changeSet) return; + if (user.view) { + const viewId = viewsStore.viewsById[user.view]?.id; + if (viewId) { + router.push({ + name: "workspace-compose-view", + params: { + ...route.params, + viewId, + }, + query: route.query, + }); + } + } + router.push({ name: "change-set-home", params: {