Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Subject request details page #563

Merged
merged 27 commits into from
Jun 6, 2022
Merged

Conversation

TheAndrewJackson
Copy link
Contributor

@TheAndrewJackson TheAndrewJackson commented May 26, 2022

Purpose

Add a dedicated page to look at details for subject requests.

Changes

  • Add details page
  • Add menu item to navigate to details page
  • Add prettier formatter to project to help reduce PR noise (at the cost of a little noise in this one)

Checklist

  • Update CHANGELOG.md file
    • Merge in main so the most recent CHANGELOG.md file is being appended to
    • Add description within the Unreleased section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.
    • Add a link to this PR at the end of the description with the PR number as the text. example: #1
  • Applicable documentation updated (guides, quickstart, postman collections, tutorial, fidesdemo, database diagram.
  • If docs updated (select one):
    • documentation complete, or draft/outline provided (tag docs-team to complete/review on this branch)
    • documentation issue created (tag docs-team to complete issue separately)
  • Good unit test/integration test coverage
  • This PR contains a DB migration. If checked, the reviewer should confirm with the author that the down_revision correctly references the previous migration before merging
  • The Run Unsafe PR Checks label has been applied, and checks have passed, if this PR touches any external services

Ticket

Fixes #493, #494

import { useObscuredPII } from '../privacy-requests/helpers';

const PII: React.FC<{ data: string }> = ({ data }) => (
<>{useObscuredPII(data)}</>
Copy link
Contributor Author

@TheAndrewJackson TheAndrewJackson May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I refactored using the useObscuredPII hook into a component because it's starting to become a common pattern.

@@ -2,13 +2,13 @@ import { Switch } from '@fidesui/react';
import React, { ChangeEvent } from 'react';
import { useDispatch } from 'react-redux';

import { setRevealPII } from './privacy-requests.slice';
import { setRevealPII } from '../privacy-requests/privacy-requests.slice';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved a few components into the common directory because they're being used on multiple pages.

const actions = Array.from(
new Set(
rules
.filter((d) => Object.values(ActionType).includes(d.action_type))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to display the request type using the action type on rules now. This component handles de-duping the rules just in case there are multiple rules that are the same type.

status,
id,
from,
to,
page,
size,
}: Partial<PrivacyRequestParams>) => {
verbose,
}: Partial<PrivacyRequestParams>): any {
Copy link
Contributor Author

@TheAndrewJackson TheAndrewJackson May 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Typescript compiler was struggling to resolve the return type on this function so I updated it to this to make the linter happy.

@@ -35,13 +36,14 @@ export const mapFiltersToSearchParams = ({
return {
include_identities: 'true',
...(status ? { status } : {}),
...(id ? { id } : {}),
...(id ? { request_id: id } : {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend looks for request_id when filtering

subjectRequest: PrivacyRequest;
};

const EventsAndLogs = ({ subjectRequest }: EventsAndLogsProps) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component is mostly finished. It's waiting on some mockups to be finished. I talked with @seanpreston and we decided to leave it in the repo without being used because the work was already done here.

Copy link
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good, just 2 comments. Was unable to functionally test, so still working on getting my local env up. running into alembic errors

Copy link
Contributor

@elliotbonneville elliotbonneville left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great to me! Just a few small notes, and then I think we'll be good to merge! I think this should be merged before #577, since it'll be easier for me to rebase that work.

@eastandwestwind eastandwestwind dismissed elliotbonneville’s stale review June 6, 2022 19:31

requested changes have been addressed

@eastandwestwind eastandwestwind merged commit 4a1e183 into main Jun 6, 2022
@eastandwestwind eastandwestwind deleted the subject_request_details_page branch June 6, 2022 19:31
sanders41 pushed a commit that referenced this pull request Sep 22, 2022
* Get initial page setup and fix some eslints

* Finish majority of UI styling

* Finished clipboard button

* refactor page component

* Add prettier to project

* Format project with prettier

* Add format command

* rename files

* Add icons and lines

* WIP event details table

* Run prettier on codbase 😭

* Add finishing touches for latest mock ups

* Fix frontend lint error

* Update Request type to use rule action types

* Fix typing issue

* Fix lint issues

* Fix last lint issue 🤞

* Update changelog

* Run prettier formatter

* Remove unused clipboard icon

* Remove comment

* Remove ts-ignore

* Fix changelog file
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Admin UI] Subject Request Detail Information
3 participants