-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PROD-2599 Update PC to support hierarchical consent notices + Update …
…all types (#5291) Co-authored-by: Lucano Vera <[email protected]>
- Loading branch information
1 parent
41094b7
commit ff63603
Showing
484 changed files
with
9,532 additions
and
622 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
2 changes: 1 addition & 1 deletion
2
clients/privacy-center/__tests__/features/consent/helpers.test.ts
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
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
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 |
---|---|---|
|
@@ -23,6 +23,7 @@ const PrivacyPolicyLink = ({ | |
if (!label || !url) { | ||
return null; | ||
} | ||
|
||
return ( | ||
<Link | ||
href={url} | ||
|
31 changes: 31 additions & 0 deletions
31
clients/privacy-center/components/consent/notice-driven/ConsentChildItem.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,31 @@ | ||
import { Flex, Text } from "fidesui"; | ||
|
||
import Toggle from "../Toggle"; | ||
|
||
interface ConsentChildItemProps { | ||
id: string; | ||
title: string; | ||
value: boolean; | ||
onChange: (value: boolean) => void; | ||
isDisabled?: boolean; | ||
} | ||
const ConsentChildItem = ({ | ||
id, | ||
title, | ||
value, | ||
onChange, | ||
isDisabled, | ||
}: ConsentChildItemProps) => ( | ||
<Flex justifyContent="space-between" alignItems="center" pl={0} py={1}> | ||
<Text fontSize={16}>{title}</Text> | ||
<Toggle | ||
label={title} | ||
name={id} | ||
id={id} | ||
disabled={isDisabled} | ||
checked={value} | ||
onChange={() => onChange(!value)} | ||
/> | ||
</Flex> | ||
); | ||
export default ConsentChildItem; |
102 changes: 102 additions & 0 deletions
102
clients/privacy-center/components/consent/notice-driven/ConsentItemAccordion.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,102 @@ | ||
import { GpcStatus } from "fides-js"; | ||
import { | ||
AccordionButton, | ||
AccordionIcon, | ||
AccordionItem, | ||
AccordionPanel, | ||
Box, | ||
Flex, | ||
Text, | ||
} from "fidesui"; | ||
import React from "react"; | ||
|
||
import { GpcBadge, GpcInfo } from "~/features/consent/GpcMessages"; | ||
|
||
import Toggle from "../Toggle"; | ||
|
||
export type ConsentItemAccordionProps = { | ||
id: string; | ||
title: string; | ||
description: string; | ||
value: boolean; | ||
gpcStatus: GpcStatus; | ||
onChange: (value: boolean) => void; | ||
disabled?: boolean; | ||
children?: React.ReactNode; | ||
}; | ||
|
||
const ConsentItemAccordion = ({ | ||
id, | ||
title, | ||
description, | ||
value, | ||
gpcStatus, | ||
onChange, | ||
disabled, | ||
children, | ||
}: ConsentItemAccordionProps) => ( | ||
<AccordionItem | ||
data-testid={`consent-item-${id}`} | ||
width="full" | ||
_hover={{ bgColor: "gray.100" }} | ||
> | ||
<AccordionButton pl={2} py={2.5} _hover={{ bgColor: "gray.100" }}> | ||
<Flex justifyContent="space-between" alignItems="center" width="full"> | ||
<Flex alignItems="center"> | ||
<AccordionIcon fontSize={26} /> | ||
<Text | ||
fontSize="lg" | ||
fontWeight="medium" | ||
color="gray.600" | ||
ml={1} | ||
mb="4px" | ||
> | ||
{title} | ||
</Text> | ||
</Flex> | ||
<Flex alignItems="center"> | ||
<Box display={{ base: "none", sm: "block" }}> | ||
<GpcBadge status={gpcStatus} /> | ||
</Box> | ||
<Flex ml={2} onClick={(e) => e.stopPropagation()}> | ||
<Toggle | ||
label={title} | ||
name={id} | ||
id={id} | ||
disabled={disabled} | ||
checked={value} | ||
onChange={() => onChange(!value)} | ||
/> | ||
</Flex> | ||
</Flex> | ||
</Flex> | ||
</AccordionButton> | ||
<AccordionPanel> | ||
<Box> | ||
<Flex | ||
justifyContent="flex-start" | ||
mb={2} | ||
display={{ base: "block", sm: "none" }} | ||
> | ||
<GpcBadge status={gpcStatus} /> | ||
</Flex> | ||
|
||
<GpcInfo status={gpcStatus} /> | ||
<Text | ||
fontSize="sm" | ||
fontWeight="medium" | ||
color="gray.600" | ||
mb="2px" | ||
pr={[0, 8]} | ||
pl={6} | ||
> | ||
{description} | ||
</Text> | ||
|
||
<Box pl={6}>{children}</Box> | ||
</Box> | ||
</AccordionPanel> | ||
</AccordionItem> | ||
); | ||
|
||
export default ConsentItemAccordion; |
Oops, something went wrong.