Skip to content

Commit

Permalink
Implemented User Management: 1060
Browse files Browse the repository at this point in the history
- Implemented User management page in vue3

Signed-off-by: Nikhil Ashoka <[email protected]>
  • Loading branch information
Nikhil-Ashoka committed Feb 17, 2025
1 parent 88617fe commit e9774b1
Show file tree
Hide file tree
Showing 9 changed files with 977 additions and 907 deletions.
21 changes: 21 additions & 0 deletions src/components/Composables/useTableSelectableComposable.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,26 @@ const useTableSelectableComposable = () => {
}
};

const toggleSelectRowByUsername = (tableRef, rowIndex, rowSelected, row) => {
if (tableRef && rowIndex !== undefined) {
if (!rowSelected) {
// Find the index of the object to remove
const indexToRemove = selectedRowsList.value.findIndex(
(item) => item.username === row.username,
);

// Check if the object exists in the array
if (indexToRemove !== -1) {
tableRef.unselectRow(rowIndex);
// Remove the object from the array
selectedRowsList.value.splice(indexToRemove, 1);
}
} else {
tableRef.selectRow(rowIndex);
}
}
};

const toggleSelectRowByGroupName = (tableRef, rowIndex, rowSelected, row) => {
if (tableRef && rowIndex !== undefined) {
if (!rowSelected) {
Expand Down Expand Up @@ -117,6 +137,7 @@ const useTableSelectableComposable = () => {
toggleSelectRow,
toggleSelectRowById,
toggleSelectRowByGroupName,
toggleSelectRowByUsername,
onRowSelected,
onChangeHeaderCheckbox,
selectedRowsList,
Expand Down
1 change: 0 additions & 1 deletion src/components/Global/InfoTooltipPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<slot>
<icon-tooltip />
</slot>
<span class="sr-only">{{ $t('global.ariaLabel.tooltip') }}</span>
</b-button>
<b-tooltip target="tooltip-password" triggers="hover">
<p class="text-left">
Expand Down
9 changes: 9 additions & 0 deletions src/router/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import PcieTopology from '../views/HardwareStatus/PcieTopology/PcieTopology.vue'
import IBMiServiceFunctions from '@/views/Logs/IBMiServiceFunctions';
import Notices from '@/views/Notices/Notices.vue';
import Sessions from '@/views/SecurityAndAccess/Sessions';
import UserManagement from '@/views/SecurityAndAccess/UserManagement';
import Firmware from '@/views/Operations/Firmware';
import Certificates from '@/views/SecurityAndAccess/Certificates';
import Inventory from '../views/HardwareStatus/Inventory/Inventory.vue';
Expand Down Expand Up @@ -272,6 +273,14 @@ export const routes = [
title: i18n.global.t('appPageTitle.sessions'),
},
},
{
path: '/security-and-access/user-management',
name: 'local-users',
component: UserManagement,
meta: {
title: i18n.global.t('appPageTitle.userManagement'),
},
},
{
path: '/security-and-access/certificates',
name: 'certificates',
Expand Down
1 change: 0 additions & 1 deletion src/store/modules/GlobalStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ export const GlobalStore = defineStore('global', {
.catch((error) => console.log(error));
},
getCurrentUser(username = localStorage.getItem('storedUsername')) {
if (localStorage.getItem('storedCurrentUser')) return;
return api
.get(`/redfish/v1/AccountService/Accounts/${username}`)
.then(({ data }) => {
Expand Down
Loading

0 comments on commit e9774b1

Please sign in to comment.