This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Subject request details page #563
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
1e01899
Get initial page setup and fix some eslints
TheAndrewJackson 95ef064
Finish majority of UI styling
TheAndrewJackson fffb485
Finished clipboard button
TheAndrewJackson f74291a
refactor page component
TheAndrewJackson fb5ec3e
Add prettier to project
TheAndrewJackson c41d754
Format project with prettier
TheAndrewJackson b6360ee
Add format command
TheAndrewJackson 8bf7fc2
rename files
TheAndrewJackson 3a65ddf
Add icons and lines
TheAndrewJackson 3890481
WIP event details table
TheAndrewJackson 93ecda6
Merge branch 'main' into subject_request_details_page
TheAndrewJackson 2783dd9
Merge branch 'main' into subject_request_details_page
TheAndrewJackson bcab1a2
Run prettier on codbase 😭
TheAndrewJackson de2fa43
Add finishing touches for latest mock ups
TheAndrewJackson 5cc2a0a
Fix frontend lint error
TheAndrewJackson 7b4701c
Merge branch 'main' into subject_request_details_page
TheAndrewJackson 19bf78b
Update Request type to use rule action types
TheAndrewJackson c1f515f
Fix typing issue
TheAndrewJackson a682c4e
Fix lint issues
TheAndrewJackson bc75308
Fix last lint issue 🤞
TheAndrewJackson 0daae44
Update changelog
TheAndrewJackson 7397e37
Run prettier formatter
TheAndrewJackson 7c57053
Remove unused clipboard icon
TheAndrewJackson a212f4b
Remove comment
TheAndrewJackson 51ace17
Remove ts-ignore
TheAndrewJackson 94bb790
Merge branch 'main' into subject_request_details_page
TheAndrewJackson 765575f
Fix changelog file
TheAndrewJackson 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 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 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,3 @@ | ||
.idea/ | ||
.next/ | ||
node_modules/ |
This file contains 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,7 @@ | ||
{ | ||
"trailingComma": "es5", | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true, | ||
"jsxSingleQuote": true | ||
} |
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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,90 @@ | ||
import { Icon, Tooltip, useClipboard } from '@fidesui/react'; | ||
import React, { useState } from 'react'; | ||
|
||
enum TooltipText { | ||
COPY = 'Copy', | ||
COPIED = 'Copied', | ||
} | ||
|
||
const useClipboardButton = (requestId: string) => { | ||
const { onCopy } = useClipboard(requestId); | ||
|
||
const [highlighted, setHighlighted] = useState(false); | ||
const [tooltipText, setTooltipText] = useState(TooltipText.COPY); | ||
|
||
const handleMouseDown = () => { | ||
setTooltipText(TooltipText.COPIED); | ||
onCopy(); | ||
}; | ||
const handleMouseUp = () => { | ||
setHighlighted(false); | ||
}; | ||
|
||
const handleMouseEnter = () => { | ||
setHighlighted(true); | ||
}; | ||
const handleMouseLeave = () => { | ||
setHighlighted(false); | ||
}; | ||
|
||
return { | ||
tooltipText, | ||
highlighted, | ||
handleMouseDown, | ||
handleMouseUp, | ||
handleMouseEnter, | ||
handleMouseLeave, | ||
setTooltipText, | ||
}; | ||
}; | ||
|
||
type ClipboardButtonProps = { | ||
requestId: string; | ||
}; | ||
|
||
const ClipboardButton = ({ requestId }: ClipboardButtonProps) => { | ||
const { | ||
tooltipText, | ||
highlighted, | ||
handleMouseDown, | ||
handleMouseUp, | ||
handleMouseEnter, | ||
handleMouseLeave, | ||
setTooltipText, | ||
} = useClipboardButton(requestId); | ||
|
||
const iconColor = !highlighted ? 'gray.600' : 'complimentary.500'; | ||
|
||
return ( | ||
<Tooltip | ||
label={tooltipText} | ||
placement='top' | ||
closeDelay={500} | ||
onOpen={() => { | ||
setTooltipText(TooltipText.COPY); | ||
}} | ||
onClose={() => { | ||
setTooltipText(TooltipText.COPY); | ||
}} | ||
> | ||
<Icon | ||
cursor='pointer' | ||
width={18} | ||
height={18} | ||
viewBox='0 0 18 18' | ||
color={iconColor} | ||
onClick={handleMouseDown} | ||
onMouseUp={handleMouseUp} | ||
onMouseEnter={handleMouseEnter} | ||
onMouseLeave={handleMouseLeave} | ||
> | ||
<path | ||
fill='currentColor' | ||
d='M13.7045 2.25H11.8677C11.417 0.942187 10.217 0 8.79545 0C7.37386 0 6.17386 0.942187 5.72386 2.25H3.88636C2.98295 2.25 2.25 3.00516 2.25 3.9375V16.3125C2.25 17.2441 2.98295 18 3.88636 18H13.7045C14.608 18 15.3409 17.2448 15.3409 16.3125V3.9375C15.3409 3.00516 14.608 2.25 13.7045 2.25ZM8.79545 2.25C9.39784 2.25 9.88636 2.75379 9.88636 3.375C9.88636 3.99621 9.39784 4.5 8.79545 4.5C8.19307 4.5 7.70455 3.99727 7.70455 3.375C7.70455 2.75379 8.19205 2.25 8.79545 2.25ZM11.5227 7.875H6.06818C5.76818 7.875 5.52273 7.62188 5.52273 7.3125C5.52273 7.00312 5.76818 6.75 6.06818 6.75H11.5227C11.8227 6.75 12.0682 7.00312 12.0682 7.3125C12.0682 7.62188 11.8227 7.875 11.5227 7.875' | ||
/> | ||
</Icon> | ||
</Tooltip> | ||
); | ||
}; | ||
|
||
export default ClipboardButton; |
This file contains 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
16 changes: 16 additions & 0 deletions
16
clients/admin-ui/src/features/common/Icon/GreenCheckCircle.tsx
This file contains 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,16 @@ | ||
import { createIcon } from '@chakra-ui/react'; | ||
|
||
export default createIcon({ | ||
displayName: 'GreenCheckCircle', | ||
viewBox: '0 0 16 16', | ||
defaultProps: { | ||
width: '16px', | ||
height: '16px', | ||
}, | ||
path: ( | ||
<path | ||
fill='#38A169' | ||
d='M7.00065 13.6663C3.31865 13.6663 0.333984 10.6817 0.333984 6.99967C0.333984 3.31767 3.31865 0.333008 7.00065 0.333008C10.6827 0.333008 13.6673 3.31767 13.6673 6.99967C13.6673 10.6817 10.6827 13.6663 7.00065 13.6663ZM6.33598 9.66634L11.0493 4.95234L10.1067 4.00967L6.33598 7.78101L4.44998 5.89501L3.50732 6.83767L6.33598 9.66634Z' | ||
/> | ||
), | ||
}); |
This file contains 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 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 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,9 @@ | ||
import React from 'react'; | ||
|
||
import { useObscuredPII } from '../privacy-requests/helpers'; | ||
|
||
const PII: React.FC<{ data: string }> = ({ data }) => ( | ||
<>{useObscuredPII(data)}</> | ||
); | ||
|
||
export default PII; |
This file contains 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 |
---|---|---|
|
@@ -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'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 PIIToggle: React.FC = () => { | ||
const dispatch = useDispatch(); | ||
const handleToggle = (event: ChangeEvent<HTMLInputElement>) => | ||
dispatch(setRevealPII(event.target.checked)); | ||
return <Switch colorScheme="secondary" onChange={handleToggle} />; | ||
return <Switch colorScheme='secondary' onChange={handleToggle} />; | ||
}; | ||
|
||
export default PIIToggle; |
This file contains 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
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.
There was a problem hiding this comment.
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.