Skip to content

Commit

Permalink
Merge pull request #5114 from systeminit/fix(web)-Navigate-to-the-vie…
Browse files Browse the repository at this point in the history
…w-a-user-is-on

fix(web): Navigate to the view a user is on
  • Loading branch information
stack72 authored Dec 12, 2024
2 parents 14a4f93 + 62c6ea3 commit 5375786
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/web/src/components/layout/navbar/Collaborators.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -116,6 +118,7 @@ export type UserInfo = {
status?: string | null;
changeSet?: string;
pictureUrl?: string | null;
view?: string;
};
const moreUsersPopoverRef = ref();
Expand All @@ -140,6 +143,7 @@ const users = computed<UserInfo[]>(() => {
status: user.idle ? "idle" : "active",
changeSet: user.changeSetId,
pictureUrl: user.pictureUrl,
view: user.viewId,
});
}
Expand Down Expand Up @@ -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: {
Expand Down

0 comments on commit 5375786

Please sign in to comment.