From 56096a01dee6177a2f07f9f6c99ca5053e14b37b Mon Sep 17 00:00:00 2001 From: Cindy Chang Date: Tue, 27 Aug 2024 14:25:20 +0800 Subject: [PATCH] WIP My Account. --- src/components/AccountMenu/AcctMenu.vue | 2 + src/components/Discover/Map/SidebarState.vue | 11 ++--- src/stores/acctMgmt.ts | 4 +- src/views/AccountManagement/MyAccount.vue | 51 ++++++++++++++++---- 4 files changed, 49 insertions(+), 19 deletions(-) diff --git a/src/components/AccountMenu/AcctMenu.vue b/src/components/AccountMenu/AcctMenu.vue index d640837..1dc36ec 100644 --- a/src/components/AccountMenu/AcctMenu.vue +++ b/src/components/AccountMenu/AcctMenu.vue @@ -66,6 +66,8 @@ export default { const onBtnMyAccountClick = async() => { acctMgmtStore.closeAcctMenu(); + await acctMgmtStore.getAllUserAccounts(); // in case we haven't fetched yet + await acctMgmtStore.setCurrentViewingUser(loginUserData.value.username); await router.push('/my-account'); } diff --git a/src/components/Discover/Map/SidebarState.vue b/src/components/Discover/Map/SidebarState.vue index 6aab902..386bba6 100644 --- a/src/components/Discover/Map/SidebarState.vue +++ b/src/components/Discover/Map/SidebarState.vue @@ -191,6 +191,7 @@ +

No data

@@ -250,7 +251,7 @@ import i18next from '@/i18n/i18n'; import { INSIGHTS_FIELDS_AND_LABELS } from '@/constants/constants'; // 刪除第一個和第二個元素 -const fieldNamesAndLabelNames = [...INSIGHTS_FIELDS_AND_LABELS].splice(0, 2); +const fieldNamesAndLabelNames = [...INSIGHTS_FIELDS_AND_LABELS].slice(2); export default { props:{ sidebarState: { @@ -266,7 +267,7 @@ export default { required: false, } }, - setup(){ + setup(props){ const pageAdmin = PageAdmin(); const mapPathStore = MapPathStore(); @@ -276,18 +277,12 @@ export default { const isBPMNOn = computed(() => mapPathStore.isBPMNOn); const onActiveTraceClick = (clickedActiveTraceIndex) => { - if(isBPMNOn.value) { - return; - } mapPathStore.clearAllHighlight(); activeTrace.value = clickedActiveTraceIndex; mapPathStore.highlightClickedPath(clickedActiveTraceIndex, clickedPathListIndex.value); } const onPathOptionClick = (clickedPath) => { - if(isBPMNOn.value) { - return; - } clickedPathListIndex.value = clickedPath; mapPathStore.highlightClickedPath(activeTrace.value, clickedPathListIndex.value); }; diff --git a/src/stores/acctMgmt.ts b/src/stores/acctMgmt.ts index 6c0979e..f042423 100644 --- a/src/stores/acctMgmt.ts +++ b/src/stores/acctMgmt.ts @@ -61,8 +61,8 @@ export default defineStore('acctMgmtStore', { * @param {string} username */ setCurrentViewingUser(username: string) { - const userFind: User | undefined = this.allUserAccoutList.find(user => user.username === username); - this.currentViewingUser = userFind || { username: '', detail: {} }; + const userFind = this.allUserAccoutList.find(user => user.username === username); + this.currentViewingUser = userFind; }, /** * We have this method because we want to handle create new modal case. diff --git a/src/views/AccountManagement/MyAccount.vue b/src/views/AccountManagement/MyAccount.vue index a818cc3..b5b0e3d 100644 --- a/src/views/AccountManagement/MyAccount.vue +++ b/src/views/AccountManagement/MyAccount.vue @@ -1,26 +1,59 @@ \ No newline at end of file