-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
2,684 additions
and
344 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
22 changes: 22 additions & 0 deletions
22
clients/admin-ui/src/features/common/ResultStatusBadge.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,22 @@ | ||
import { Badge, BadgeProps } from "fidesui"; | ||
import React from "react"; | ||
|
||
const ResultStatusBadge = React.forwardRef<HTMLSpanElement, BadgeProps>( | ||
(props, ref) => { | ||
return ( | ||
<Badge | ||
fontSize="xs" | ||
fontWeight="normal" | ||
textTransform="none" | ||
ref={ref} | ||
{...props} | ||
> | ||
{props.children} | ||
</Badge> | ||
); | ||
}, | ||
); | ||
|
||
ResultStatusBadge.displayName = "ResultStatusBadge"; | ||
|
||
export default ResultStatusBadge; |
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
43 changes: 43 additions & 0 deletions
43
clients/admin-ui/src/features/common/dropdown/DataCategorySelect.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,43 @@ | ||
import { | ||
TaxonomySelect, | ||
TaxonomySelectOption, | ||
TaxonomySelectProps, | ||
} from "~/features/common/dropdown/TaxonomySelect"; | ||
import useTaxonomies from "~/features/common/hooks/useTaxonomies"; | ||
|
||
import styles from "./TaxonomySelect.module.scss"; | ||
|
||
const DataCategorySelect = ({ | ||
selectedTaxonomies, | ||
showDisabled = false, | ||
...props | ||
}: TaxonomySelectProps) => { | ||
const { getDataCategoryDisplayNameProps, getDataCategories } = | ||
useTaxonomies(); | ||
|
||
const getActiveDataCategories = () => | ||
getDataCategories().filter((c) => c.active); | ||
|
||
const dataCategories = showDisabled | ||
? getDataCategories() | ||
: getActiveDataCategories(); | ||
|
||
const options: TaxonomySelectOption[] = dataCategories | ||
.filter((category) => !selectedTaxonomies.includes(category.fides_key)) | ||
.map((category) => { | ||
const { name, primaryName } = getDataCategoryDisplayNameProps( | ||
category.fides_key, | ||
); | ||
return { | ||
value: category.fides_key, | ||
name, | ||
primaryName, | ||
description: category.description || "", | ||
className: styles.option, | ||
}; | ||
}); | ||
|
||
return <TaxonomySelect options={options} {...props} />; | ||
}; | ||
|
||
export default DataCategorySelect; |
39 changes: 39 additions & 0 deletions
39
clients/admin-ui/src/features/common/dropdown/DataUseSelect.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,39 @@ | ||
import { | ||
TaxonomySelect, | ||
TaxonomySelectOption, | ||
TaxonomySelectProps, | ||
} from "~/features/common/dropdown/TaxonomySelect"; | ||
import useTaxonomies from "~/features/common/hooks/useTaxonomies"; | ||
|
||
import styles from "./TaxonomySelect.module.scss"; | ||
|
||
const DataUseSelect = ({ | ||
selectedTaxonomies, | ||
showDisabled = false, | ||
...props | ||
}: TaxonomySelectProps) => { | ||
const { getDataUseDisplayNameProps, getDataUses } = useTaxonomies(); | ||
|
||
const getActiveDataUses = () => getDataUses().filter((du) => du.active); | ||
|
||
const dataUses = showDisabled ? getDataUses() : getActiveDataUses(); | ||
|
||
const options: TaxonomySelectOption[] = dataUses | ||
.filter((dataUse) => !selectedTaxonomies.includes(dataUse.fides_key)) | ||
.map((dataUse) => { | ||
const { name, primaryName } = getDataUseDisplayNameProps( | ||
dataUse.fides_key, | ||
); | ||
return { | ||
value: dataUse.fides_key, | ||
name, | ||
primaryName, | ||
description: dataUse.description || "", | ||
className: styles.option, | ||
}; | ||
}); | ||
|
||
return <TaxonomySelect options={options} {...props} />; | ||
}; | ||
|
||
export default DataUseSelect; |
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
27 changes: 27 additions & 0 deletions
27
clients/admin-ui/src/features/common/form/AdvancedSettings.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,27 @@ | ||
import { ChevronDownIcon, Collapse, Flex, Text, useDisclosure } from "fidesui"; | ||
import { ReactNode } from "react"; | ||
|
||
const AdvancedSettings = ({ children }: { children: ReactNode }) => { | ||
const { isOpen, onToggle } = useDisclosure(); | ||
return ( | ||
<Flex | ||
p={4} | ||
gap={6} | ||
direction="column" | ||
border="1px solid" | ||
borderColor="gray.200" | ||
> | ||
<Flex justifyContent="space-between" cursor="pointer" onClick={onToggle}> | ||
<Text fontSize="xs">Advanced settings</Text> | ||
<ChevronDownIcon className={isOpen ? "rotate-180" : undefined} /> | ||
</Flex> | ||
<Collapse in={isOpen}> | ||
<Flex direction="column" gap={4}> | ||
{children} | ||
</Flex> | ||
</Collapse> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default AdvancedSettings; |
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
Oops, something went wrong.