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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into publish-to-pypi
- Loading branch information
Showing
28 changed files
with
1,116 additions
and
236 deletions.
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
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
Oops, something went wrong.