forked from ethyca/fidesops
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ethyca#396] Frontend for Privacy Request denial flow (ethyca#480)
- Loading branch information
1 parent
5e4367b
commit a11b367
Showing
4 changed files
with
171 additions
and
40 deletions.
There are no files selected for viewing
90 changes: 90 additions & 0 deletions
90
clients/admin-ui/src/features/privacy-requests/DenyPrivacyRequestModal.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,90 @@ | ||
import { | ||
Modal, | ||
ModalOverlay, | ||
ModalContent, | ||
ModalHeader, | ||
ModalFooter, | ||
ModalBody, | ||
Textarea, | ||
Button, | ||
} from '@fidesui/react'; | ||
import React from 'react'; | ||
|
||
type DenyModalProps = { | ||
isOpen: boolean; | ||
isLoading: boolean; | ||
handleMenuClose: () => void; | ||
handleDenyRequest: (reason: string) => Promise<any>; | ||
denialReason: string; | ||
onChange: (e: any) => void; | ||
}; | ||
|
||
const closeModal = ( | ||
handleMenuClose: () => void, | ||
handleDenyRequest: (reason: string) => Promise<any>, | ||
denialReason: string | ||
) => { | ||
handleDenyRequest(denialReason).then(() => { | ||
handleMenuClose(); | ||
}); | ||
}; | ||
|
||
const DenyPrivacyRequestModal = ({ | ||
isOpen, | ||
isLoading, | ||
handleMenuClose, | ||
denialReason, | ||
onChange, | ||
handleDenyRequest, | ||
}: DenyModalProps) => ( | ||
<Modal | ||
isOpen={isOpen} | ||
onClose={handleMenuClose} | ||
isCentered | ||
returnFocusOnClose={false} | ||
> | ||
<ModalOverlay /> | ||
<ModalContent width='100%' maxWidth='456px'> | ||
<ModalHeader>Data subject request denial</ModalHeader> | ||
<ModalBody color='gray.500' fontSize='14px'> | ||
Please enter a reason for denying this data subject request | ||
</ModalBody> | ||
<ModalBody> | ||
<Textarea | ||
focusBorderColor='primary.600' | ||
value={denialReason} | ||
onChange={onChange} | ||
disabled={isLoading} | ||
/> | ||
</ModalBody> | ||
<ModalFooter> | ||
<Button | ||
size='sm' | ||
width='100%' | ||
maxWidth='198px' | ||
colorScheme='gray.200' | ||
mr={3} | ||
disabled={isLoading} | ||
onClick={handleMenuClose} | ||
> | ||
Close | ||
</Button> | ||
<Button | ||
size='sm' | ||
width='100%' | ||
maxWidth='198px' | ||
colorScheme='primary' | ||
variant='solid' | ||
isLoading={isLoading} | ||
onClick={() => { | ||
closeModal(handleMenuClose, handleDenyRequest, denialReason); | ||
}} | ||
> | ||
Confirm | ||
</Button> | ||
</ModalFooter> | ||
</ModalContent> | ||
</Modal> | ||
); | ||
|
||
export default DenyPrivacyRequestModal; |
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