Skip to content

Commit

Permalink
feat: #1619 add user history icon to d amin action column (#1622)
Browse files Browse the repository at this point in the history
  • Loading branch information
craigyu authored Oct 7, 2024
1 parent 1b6e102 commit e167740
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const headers = ['Date', 'Activity', 'Details', 'Performed by'];

<!-- Table with values -->
<DataTable class="user-permission-table" :value="auditHistoryQuery.data.value" :striped-rows="true" v-else>
<template #empty> No User History found.</template>
<template #empty> No User Permissions History found.</template>
<Column field="create_date" :header="headers[0]">
<template #body="slotProps">
<DateCol :utc-date="slotProps.data.create_date" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {
import DataTableHeader from '@/components/managePermissions/table/DataTableHeader.vue';
import { IconSize } from '@/enum/IconEnum';
import type { FamAccessControlPrivilegeGetResponse } from 'fam-admin-mgmt-api/model';
import { navigateToUserDetails } from '@/components/managePermissions/table/utils';
import Icon from '@/components/common/Icon.vue'
type emit = (
e: 'deleteDelegatedAdminAssignment',
Expand Down Expand Up @@ -191,6 +193,11 @@ const highlightNewDelegatedAdminAccessRow = (rowData: any) => {
</Column>
<Column header="Action">
<template #body="{ data }">
<button title="User permission history" class="btn btn-icon"
@click="navigateToUserDetails(data.user_id)">
<Icon icon="history" :size="IconSize.small" />
</button>

<button
class="btn btn-icon"
title="Delete delegated admin"
Expand Down
26 changes: 8 additions & 18 deletions frontend/src/components/managePermissions/table/UserDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import ProgressSpinner from 'primevue/progressspinner';
import { useConfirm } from 'primevue/useconfirm';
import { computed, reactive, ref, type PropType } from 'vue';
import NewUserTag from '@/components/common/NewUserTag.vue';
import ConfirmDialogtext from '@/components/managePermissions/ConfirmDialogText.vue';
import DataTableHeader from '@/components/managePermissions/table/DataTableHeader.vue';
import { IconSize } from '@/enum/IconEnum';
import { hashRouter } from '@/router';
import { routeItems } from '@/router/routeItem';
import { isNewAccess } from '@/services/utils';
import { selectedApplicationId } from '@/store/ApplicationState';
import {
NEW_ACCESS_STYLE_IN_TABLE,
TABLE_CURRENT_PAGE_REPORT_TEMPLATE,
TABLE_PAGINATOR_TEMPLATE,
TABLE_ROWS_PER_PAGE,
} from '@/store/Constants';
import type { FamApplicationUserRoleAssignmentGetSchema } from 'fam-app-acsctl-api';
import { routeItems } from '@/router/routeItem';
import { IconSize } from '@/enum/IconEnum';
import { isNewAccess } from '@/services/utils';
import NewUserTag from '@/components/common/NewUserTag.vue';
import ConfirmDialogtext from '@/components/managePermissions/ConfirmDialogText.vue';
import DataTableHeader from '@/components/managePermissions/table/DataTableHeader.vue';
import { navigateToUserDetails } from '@/components/managePermissions/table/utils';
type emit = (
Expand Down Expand Up @@ -80,16 +80,6 @@ function deleteAssignment(assignment: FamApplicationUserRoleAssignmentGetSchema)
});
}
const navigateToUserDetails = (userId: string) => {
hashRouter.push({
name: routeItems.userDetails.name,
params: {
applicationId: selectedApplicationId.value,
userId,
}
});
}
const highlightNewUserAccessRow = (rowData: any) => {
if (isNewAccess(newUserAccessIds.value, rowData.user_role_xref_id)) {
return NEW_ACCESS_STYLE_IN_TABLE;
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/managePermissions/table/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { hashRouter } from "@/router";
import { routeItems } from "@/router/routeItem";
import { selectedApplicationId } from "@/store/ApplicationState";

export const navigateToUserDetails = (userId: string) => {
hashRouter.push({
name: routeItems.userDetails.name,
params: {
applicationId: selectedApplicationId.value,
userId,
}
});
}
2 changes: 1 addition & 1 deletion frontend/src/views/UserDetails/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const crumbs: BreadCrumbType[] = [
<template>
<div class="user-detail-page-container">
<BreadCrumbs :crumbs="crumbs" />
<PageTitle class="user-detail-page-title" title="User History" />
<PageTitle class="user-detail-page-title" title="User Permissions History" />
<UserSummaryCard :user-id="userId!" :application-id="applicationId!" />
<div class="gray-container">
<UserPermissionHistoryTable :user-id="userId!" :application-id="applicationId!" />
Expand Down

0 comments on commit e167740

Please sign in to comment.