diff --git a/src/assets/icon-large-exclamation.svg b/src/assets/icon-large-exclamation.svg new file mode 100644 index 0000000..7872a75 --- /dev/null +++ b/src/assets/icon-large-exclamation.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/constants/constants.js b/src/constants/constants.js index a70bb72..c37b1dd 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -1,8 +1,13 @@ export const PRIME_VUE_TICKS_LIMIT = 6; +export const ONCE_RENDER_NUM_OF_DATA = 6; + export const GRID_COLOR = '#64748b'; + export const MODAL_CREATE_NEW = 'MODAL_CREATE_NEW'; export const MODAL_ACCT_EDIT = 'MODAL_ACCT_EDIT'; export const MODAL_ACCT_INFO = 'MODAL_ACCT_INFO'; +export const MODAL_DELETE = 'MODAL_DELETE'; + export const knownLayoutChartOption = { padding: { top: 16, diff --git a/src/i18n/en.json b/src/i18n/en.json index 4d27cd2..9dd109b 100644 --- a/src/i18n/en.json +++ b/src/i18n/en.json @@ -1,4 +1,7 @@ { + "No": "No", + "Yes": "Yes", + "The": "The", "Global": { "Login": "Login", "Logout": "Logout", @@ -13,6 +16,7 @@ "acctMgmt": "Account management", "mangUrAcct": "Manage your account", "Logout": "Log out", + "CreateNew": "Create New", "Search": "Search", "Account": "Account", "FullName": "Full Name", @@ -27,7 +31,10 @@ "ConfirmPassword": "Confirm Password", "PwdNotMatch": "Confirm Password does not match.", "SetAsAdmin": "Set as admin.", - "ActivateNow": "Activate now." + "ActivateNow": "Activate now.", + "DelteQuestion": "Are you sure to delete ?", + "DeleteFirstClause": "deletion is irreversible !", + "DeleteSecondClause": "You will delete all data and content on this account." }, "Compare": { "timeUsage": "Time Usage", diff --git a/src/stores/acctMgmt.js b/src/stores/acctMgmt.js index 5a530f0..68ec17a 100644 --- a/src/stores/acctMgmt.js +++ b/src/stores/acctMgmt.js @@ -1,6 +1,5 @@ import { defineStore } from "pinia"; import apiError from '@/module/apiError.js'; -import iconDeleteGray from '@/assets/icon-delete-gray.svg'; export default defineStore('acctMgmtStore', { state: () => ({ @@ -34,6 +33,17 @@ export default defineStore('acctMgmtStore', { const userFind = this.allUserAccoutList.find(user => user.username === username); this.currentViewingUser = userFind ? userFind : {}; }, + /** + * We have this method because we want to handle create new modal case. + */ + clearCurrentViewingUser() { + this.currentViewingUser = { + username: '', + name: '', + is_admin: false, + is_sso: false, + }; + }, /** * Get all user accounts */ @@ -81,16 +91,27 @@ export default defineStore('acctMgmtStore', { userToChange.isRowHovered = isRowHovered; } }, - /** + /** * According to mouseover or mouseleave status, change the bool value. * @param {string} username * @param {boolean} isEditHovered */ - changeIsEditHoveredByUser(username, isEditHovered) { - const userToChange = this.allUserAccoutList.find(user => user.username === username); - if (userToChange) { - userToChange.isEditHovered = isEditHovered; - } - }, + changeIsEditHoveredByUser(username, isEditHovered) { + const userToChange = this.allUserAccoutList.find(user => user.username === username); + if (userToChange) { + userToChange.isEditHovered = isEditHovered; + } + }, + /** + * According to mouseover or mouseleave status, change the bool value. + * @param {string} username + * @param {boolean} isEditHovered + */ + changeIsDetailHoveredByUser(username, isDetailHovered) { + const userToChange = this.allUserAccoutList.find(user => user.username === username); + if (userToChange) { + userToChange.isDetailHovered = isDetailHovered; + } + }, }, }) \ No newline at end of file diff --git a/src/views/AccountManagement/AccountAdmin/index.vue b/src/views/AccountManagement/AccountAdmin/index.vue index 02e378e..eb8448b 100644 --- a/src/views/AccountManagement/AccountAdmin/index.vue +++ b/src/views/AccountManagement/AccountAdmin/index.vue @@ -1,7 +1,11 @@