Skip to content

Commit

Permalink
update access request table & view actioned requests
Browse files Browse the repository at this point in the history
  • Loading branch information
mauberti-bc committed Aug 23, 2024
1 parent 1162ce1 commit 5f9e9fa
Show file tree
Hide file tree
Showing 25 changed files with 727 additions and 456 deletions.
10 changes: 10 additions & 0 deletions api/src/paths/administrative-activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ GET.apiDoc = {
create_date: {
type: 'string',
description: 'ISO 8601 date string'
},
updated_by: {
type: 'string',
description: 'Display name of the user who last updated the record',
nullable: true
},
update_date: {
type: 'string',
description: 'Date when the record was last updated',
nullable: true
}
}
}
Expand Down
16 changes: 13 additions & 3 deletions api/src/repositories/administrative-activity-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export const IAdministrativeActivity = z.object({
description: z.string().nullable(),
data: shallowJsonSchema,
notes: z.string().nullable(),
create_date: z.string()
create_date: z.string(),
updated_by: z.string().nullable(),
update_date: z.string().nullable()
});

export type IAdministrativeActivity = z.infer<typeof IAdministrativeActivity>;
Expand Down Expand Up @@ -66,7 +68,9 @@ export class AdministrativeActivityRepository extends BaseRepository {
aa.description,
aa.data,
aa.notes,
aa.create_date
aa.create_date,
su.display_name as updated_by,
aa.update_date
FROM
administrative_activity aa
LEFT OUTER JOIN
Expand All @@ -77,6 +81,10 @@ export class AdministrativeActivityRepository extends BaseRepository {
administrative_activity_type aat
ON
aa.administrative_activity_type_id = aat.administrative_activity_type_id
LEFT OUTER JOIN
system_user su
ON
su.system_user_id = aa.update_user
WHERE
1 = 1
`;
Expand Down Expand Up @@ -115,7 +123,9 @@ export class AdministrativeActivityRepository extends BaseRepository {
sqlStatement.append(SQL`)`);
}

sqlStatement.append(`;`);
sqlStatement.append(`
ORDER BY create_date DESC;
`);

const response = await this.connection.sql(sqlStatement, IAdministrativeActivity);
return response.rows;
Expand Down
16 changes: 16 additions & 0 deletions app/src/constants/colours.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ const NRM_REGION_COLOUR_MAP = {
'Skeena Natural Resource Region': { colour: red }
};

/**
* Colour map for access request chips.
*
*/
const ACCESS_REQUEST_COLOUR_MAP = {
Pending: { colour: purple },
Actioned: { colour: green },
Rejected: { colour: red }
};

/**
* ColourMap key types
*
Expand All @@ -85,6 +95,12 @@ const generateColourMapGetter = <T extends ColourMap>(colourMap: T, fallbackColo
return (lookup: keyof T) => colourMap[lookup]?.colour ?? fallbackColour;
};

/**
* Get survey progress colour mapping.
*
*/
export const getAccessRequestColour = generateColourMapGetter(ACCESS_REQUEST_COLOUR_MAP);

/**
* Get survey progress colour mapping.
*
Expand Down
2 changes: 1 addition & 1 deletion app/src/features/admin/AdminUsersRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Redirect, Route, Switch } from 'react-router';
import RouteWithTitle from 'utils/RouteWithTitle';
import { getTitle } from 'utils/Utils';
import ManageUsersPage from './users/ManageUsersPage';
import UsersDetailPage from './users/UsersDetailPage';
import UsersDetailPage from './users/projects/UsersDetailPage';

/**
* Router for all `/admin/users/*` pages.
Expand Down
291 changes: 0 additions & 291 deletions app/src/features/admin/users/AccessRequestList.test.tsx

This file was deleted.

Loading

0 comments on commit 5f9e9fa

Please sign in to comment.