Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classify data category dropdown #1110

Merged
merged 17 commits into from
Oct 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions clients/ctl/admin-ui/src/features/dataset/DataCategoryInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { Box, FormLabel, Grid, Stack } from "@fidesui/react";

import { DataCategory } from "~/types/api";

import { useFeatures } from "../common/features.slice";
import QuestionTooltip from "../common/QuestionTooltip";
import TaxonomyEntityTag from "../taxonomy/TaxonomyEntityTag";
import ClassifiedDataCategoryDropdown from "./ClassifiedDataCategoryDropdown";
import DataCategoryDropdown from "./DataCategoryDropdown";

export interface Props {
Expand All @@ -19,6 +21,7 @@ const DataCategoryInput = ({
onChecked,
tooltip,
}: Props) => {
const features = useFeatures();
const handleRemoveDataCategory = (dataCategoryName: string) => {
onChecked(checked.filter((dc) => dc !== dataCategoryName));
};
Expand All @@ -33,11 +36,23 @@ const DataCategoryInput = ({
<Stack>
<Box display="flex" alignItems="center">
<Box mr="2" width="100%">
<DataCategoryDropdown
dataCategories={dataCategories}
checked={checked}
onChecked={onChecked}
/>
{features.plus ? (
<ClassifiedDataCategoryDropdown
dataCategories={dataCategories}
// TODO: make this real
mostLikelyCategories={dataCategories
.slice(0, 5)
.map((d) => ({ ...d, confidence: 97 }))}
checked={checked}
onChecked={onChecked}
/>
) : (
<DataCategoryDropdown
dataCategories={dataCategories}
checked={checked}
onChecked={onChecked}
/>
)}
ssangervasi marked this conversation as resolved.
Show resolved Hide resolved
</Box>
<QuestionTooltip label={tooltip} />
</Box>
Expand Down