Add JSDoc documentation and file headers to all source files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,6 +30,16 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// The Lucia project.
|
||||
// Copyright 2024-2026 DSP, inc. All rights reserved.
|
||||
// Authors:
|
||||
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
|
||||
// imacat.yang@dsp.im (imacat), 2023/9/23
|
||||
/**
|
||||
* @module components/AccountMenu/AcctMenu Dropdown account menu
|
||||
* with links to account management, my account, and logout.
|
||||
*/
|
||||
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import i18next from '@/i18n/i18n';
|
||||
@@ -58,6 +68,7 @@ const loginUserData = ref(null);
|
||||
const currentViewingUserDetail = computed(() => acctMgmtStore.currentViewingUser.detail);
|
||||
const isAdmin = ref(false);
|
||||
|
||||
/** Fetches user data and determines if the current user is an admin. */
|
||||
const getIsAdminValue = async () => {
|
||||
await loginStore.getUserData();
|
||||
loginUserData.value = loginStore.userData;
|
||||
@@ -65,6 +76,7 @@ const getIsAdminValue = async () => {
|
||||
isAdmin.value = acctMgmtStore.currentViewingUser.is_admin;
|
||||
};
|
||||
|
||||
/** Navigates to the My Account page. */
|
||||
const onBtnMyAccountClick = async () => {
|
||||
acctMgmtStore.closeAcctMenu();
|
||||
await acctMgmtStore.getAllUserAccounts(); // in case we haven't fetched yet
|
||||
@@ -72,6 +84,7 @@ const onBtnMyAccountClick = async () => {
|
||||
await router.push('/my-account');
|
||||
};
|
||||
|
||||
/** Registers a click listener to close the menu when clicking outside. */
|
||||
const clickOtherPlacesThenCloseMenu = () => {
|
||||
const acctMgmtButton = document.getElementById('acct_mgmt_button');
|
||||
const acctMgmtMenu = document.getElementById('account_menu');
|
||||
@@ -83,11 +96,13 @@ const clickOtherPlacesThenCloseMenu = () => {
|
||||
});
|
||||
};
|
||||
|
||||
/** Navigates to the Account Admin page. */
|
||||
const onBtnAcctMgmtClick = () => {
|
||||
router.push({name: 'AcctAdmin'});
|
||||
acctMgmtStore.closeAcctMenu();
|
||||
};
|
||||
|
||||
/** Handles logout with unsaved-changes confirmation for Map and Conformance pages. */
|
||||
const onLogoutBtnClick = () => {
|
||||
if ((route.name === 'Map' || route.name === 'CheckMap') && tempFilterId.value) {
|
||||
// 傳給 Map,通知 Sidebar 要關閉。
|
||||
|
||||
Reference in New Issue
Block a user