-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Action center: Categories of consent cell (#5737)
- Loading branch information
Showing
7 changed files
with
63 additions
and
14 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
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
29 changes: 29 additions & 0 deletions
29
...s/data-discovery-and-detection/action-center/tables/cells/DiscoveredSystemDataUseCell.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,29 @@ | ||
import useTaxonomies from "~/features/common/hooks/useTaxonomies"; | ||
import { BadgeCellExpandable } from "~/features/common/table/v2/cells"; | ||
import { MonitorSystemAggregate } from "~/features/data-discovery-and-detection/action-center/types"; | ||
import isConsentCategory from "~/features/data-discovery-and-detection/action-center/utils/isConsentCategory"; | ||
|
||
const DiscoveredSystemDataUseCell = ({ | ||
system, | ||
}: { | ||
system: MonitorSystemAggregate; | ||
}) => { | ||
const { getDataUseDisplayName } = useTaxonomies(); | ||
const consentCategories = | ||
system.data_uses?.filter((use) => isConsentCategory(use)) ?? []; | ||
const cellValues = consentCategories.map((use) => ({ | ||
label: getDataUseDisplayName(use), | ||
key: use, | ||
})); | ||
|
||
return ( | ||
<BadgeCellExpandable | ||
values={cellValues} | ||
bgColor="white" | ||
borderWidth="1px" | ||
borderColor="gray.200" | ||
/> | ||
); | ||
}; | ||
|
||
export default DiscoveredSystemDataUseCell; |
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
14 changes: 14 additions & 0 deletions
14
...min-ui/src/features/data-discovery-and-detection/action-center/utils/isConsentCategory.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const CONSENT_CATEGORIES = [ | ||
"essential", | ||
"functional.service.improve", | ||
"personalize", | ||
"analytics", | ||
"marketing.advertising.first_party.targeted", | ||
"marketing.advertising.third_party.targeted", | ||
]; | ||
|
||
const isConsentCategory = (category: string): boolean => { | ||
return CONSENT_CATEGORIES.includes(category); | ||
}; | ||
|
||
export default isConsentCategory; |