From 82ec05bcef89a72870cb8e0d4bb22241585adf81 Mon Sep 17 00:00:00 2001 From: Eduardo Medeiros Date: Wed, 11 Dec 2024 18:12:38 -0300 Subject: [PATCH 1/4] fix: wrong project name in dashboard and history --- src/App.vue | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.vue b/src/App.vue index 8723e3d8..6e24265a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,10 +23,17 @@ import { useDashboard } from './store/modules/dashboard'; import initHotjar from '@/plugins/Hotjar'; import { getProject } from '@/utils/config'; +import { setProject as setProjectLocalStorage } from '@/utils/config'; + import moment from 'moment'; export default { name: 'App', + setup() { + const projectUuid = window.location.href.split('projectUuid=')[1]; + if (projectUuid) setProjectLocalStorage(projectUuid); + }, + data() { return { ws: null, @@ -136,6 +143,7 @@ export default { async getProject() { const { data: project } = await Project.getInfo(); + console.log(project); this.setProject({ ...project, uuid: this.appProject || getProject(), From 3bfbd435d364500d02c14d92b6422aa7ebf81fde Mon Sep 17 00:00:00 2001 From: Eduardo Medeiros Date: Wed, 11 Dec 2024 18:13:27 -0300 Subject: [PATCH 2/4] wip: remove console log --- src/App.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 6e24265a..0072639a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -143,7 +143,6 @@ export default { async getProject() { const { data: project } = await Project.getInfo(); - console.log(project); this.setProject({ ...project, uuid: this.appProject || getProject(), From 3302c59ef43a736fe727618a1403900473f7e4d8 Mon Sep 17 00:00:00 2001 From: Eduardo Medeiros Date: Fri, 13 Dec 2024 08:31:53 -0300 Subject: [PATCH 3/4] refact: improvement in project uuid definition logic --- src/App.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index 0072639a..5b5ed3b4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,7 +30,12 @@ export default { name: 'App', setup() { - const projectUuid = window.location.href.split('projectUuid=')[1]; + const queryString = window.location.href.split('?')[1]; + + const { projectUuid } = Object.fromEntries( + new URLSearchParams(queryString).entries(), + ); + if (projectUuid) setProjectLocalStorage(projectUuid); }, From 1631ac372d0ae697e64e3dd9604973a1fa93e692 Mon Sep 17 00:00:00 2001 From: Eduardo Medeiros Date: Fri, 13 Dec 2024 10:38:32 -0300 Subject: [PATCH 4/4] refact: config utils imports --- src/App.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 5b5ed3b4..2cf9ffd1 100644 --- a/src/App.vue +++ b/src/App.vue @@ -21,9 +21,10 @@ import { useRooms } from './store/modules/chats/rooms'; import { useDashboard } from './store/modules/dashboard'; import initHotjar from '@/plugins/Hotjar'; -import { getProject } from '@/utils/config'; - -import { setProject as setProjectLocalStorage } from '@/utils/config'; +import { + getProject, + setProject as setProjectLocalStorage, +} from '@/utils/config'; import moment from 'moment'; export default {