-
Notifications
You must be signed in to change notification settings - Fork 89
LJ-399 Add ability to read and post internal comments to a privacy request #6165
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
Merged
lucanovera
merged 34 commits into
main
from
LJ-399-FE-Add-a-main-activity-view-for-viewing-and-adding-comments
May 29, 2025
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
fe4d865
Initial implementation for comments ui
lucanovera 1003598
remove placeholder
lucanovera 5bc4b80
update types
lucanovera 8909068
Implement comments saving
lucanovera fba36b0
fix type
lucanovera 6b5fe12
Refactor activitytimelist list into more generic activitytimelineentr…
lucanovera 970bf81
adjust styling
lucanovera 15691d7
Add comments
lucanovera c108b3b
improve styling
lucanovera 0bd99e9
Add description
lucanovera 1ea75d8
Improve comments on timeline
lucanovera 2dd8875
activity timeline, sort by oldest first
lucanovera 4104200
Update clipbord icon to Carbon
lucanovera 3b6b7f7
Update clipboard button to be integrated with input
lucanovera 8adc799
Adjust style for error records
lucanovera bfb4a93
markup improvements
lucanovera db40106
add cypress tests
lucanovera 588749b
add comment registry
lucanovera 1b4329c
Fix comments cypress tests
lucanovera 822e441
add test
lucanovera e38cecd
Merge branch 'main' of github.com:ethyca/fides into LJ-399-FE-Add-a-m…
lucanovera 9018ea2
update changelog
lucanovera bce26e9
simplify skeleton code
lucanovera f001258
refactor activity timeline to simplify code
lucanovera 0e8a24a
Make date property be a Date to improve code
lucanovera f18462f
Fix hour format showing in 12hs to use 24hs format
lucanovera 4e3239a
Make date property be a Date to improve code
lucanovera eaab3be
remove unnecessary comments
lucanovera ab544da
fix eslint
lucanovera 46f51b4
add initial item to the activity timeline
lucanovera fa4531a
remove .only
lucanovera df0b1fe
update date format to show am or pm
lucanovera 27ce721
improve error handling
lucanovera b12768a
Merge branch 'main' of github.com:ethyca/fides into LJ-399-FE-Add-a-m…
lucanovera File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
clients/admin-ui/cypress/fixtures/privacy-requests/comments/comment-created.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "id": "comment_456", | ||
| "privacy_request_id": "pri_123", | ||
| "comment_text": "New comment from test", | ||
| "comment_type": "NOTE", | ||
| "created_at": "2023-01-02T12:00:00Z", | ||
| "user_id": "usr_123", | ||
| "username": "testuser", | ||
| "user_first_name": "Test", | ||
| "user_last_name": "User" | ||
| } |
18 changes: 18 additions & 0 deletions
18
clients/admin-ui/cypress/fixtures/privacy-requests/comments/comments-list.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| "items": [ | ||
| { | ||
| "id": "comment_123", | ||
| "privacy_request_id": "pri_123", | ||
| "comment_text": "This is a test comment", | ||
| "comment_type": "NOTE", | ||
| "created_at": "2023-01-01T12:00:00Z", | ||
| "user_id": "usr_123", | ||
| "username": "testuser", | ||
| "user_first_name": "Test", | ||
| "user_last_name": "User" | ||
| } | ||
| ], | ||
| "total": 1, | ||
| "page": 1, | ||
| "size": 10 | ||
| } |
6 changes: 6 additions & 0 deletions
6
clients/admin-ui/cypress/fixtures/privacy-requests/comments/empty-comments.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "items": [], | ||
| "total": 0, | ||
| "page": 1, | ||
| "size": 10 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
clients/admin-ui/src/features/privacy-requests/comments/privacy-request-comments.slice.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import { createSlice } from "@reduxjs/toolkit"; | ||
|
|
||
| import { baseApi } from "~/features/common/api.slice"; | ||
| import { CommentResponse } from "~/types/api/models/CommentResponse"; | ||
| import { CommentType } from "~/types/api/models/CommentType"; | ||
| import { Page_CommentResponse_ } from "~/types/api/models/Page_CommentResponse_"; | ||
|
|
||
| export interface State {} | ||
|
|
||
| const initialState: State = {}; | ||
|
|
||
| interface GetCommentsParams { | ||
| privacy_request_id: string; | ||
| page?: number; | ||
| size?: number; | ||
| } | ||
|
|
||
| interface CreateCommentParams { | ||
| privacy_request_id: string; | ||
| comment_text: string; | ||
| comment_type: CommentType; | ||
| } | ||
|
|
||
| const privacyRequestCommentsApi = baseApi.injectEndpoints({ | ||
| endpoints: (build) => ({ | ||
| getComments: build.query<Page_CommentResponse_, GetCommentsParams>({ | ||
| query: ({ privacy_request_id, page = 1, size }) => ({ | ||
| url: `plus/privacy-request/${privacy_request_id}/comment`, | ||
| method: "GET", | ||
| params: { | ||
| page, | ||
| size, | ||
| }, | ||
| }), | ||
| providesTags: ["Privacy Request Comments"], | ||
| }), | ||
| createComment: build.mutation<CommentResponse, CreateCommentParams>({ | ||
| query: ({ privacy_request_id, comment_text, comment_type }) => { | ||
| const formData = new FormData(); | ||
| formData.append("comment_text", comment_text); | ||
| formData.append("comment_type", comment_type); | ||
|
|
||
| return { | ||
| url: `plus/privacy-request/${privacy_request_id}/comment`, | ||
| method: "POST", | ||
| body: formData, | ||
| formData: true, | ||
| }; | ||
| }, | ||
| invalidatesTags: ["Privacy Request Comments", "Request"], | ||
| }), | ||
| getCommentDetails: build.query< | ||
| CommentResponse, | ||
| { privacy_request_id: string; comment_id: string } | ||
| >({ | ||
| query: ({ privacy_request_id, comment_id }) => ({ | ||
| url: `plus/privacy-request/${privacy_request_id}/comment/${comment_id}`, | ||
| method: "GET", | ||
| }), | ||
| }), | ||
| }), | ||
| }); | ||
|
|
||
| export const { | ||
| useGetCommentsQuery, | ||
| useCreateCommentMutation, | ||
| useGetCommentDetailsQuery, | ||
| useLazyGetCommentDetailsQuery, | ||
| } = privacyRequestCommentsApi; | ||
|
|
||
| export const privacyRequestCommentsSlice = createSlice({ | ||
| name: "privacyRequestComments", | ||
| initialState, | ||
| reducers: {}, | ||
| }); | ||
|
|
||
| export const { reducer } = privacyRequestCommentsSlice; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.