Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented User Management: 1060 #331

Open
wants to merge 1 commit into
base: 1060-vue3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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