Skip to content

Commit

Permalink
Merge branch 'main' into 4123-fix-connection-model-slowness
Browse files Browse the repository at this point in the history
  • Loading branch information
galvana committed Sep 27, 2023
2 parents e330e87 + 92e0580 commit 91adc0f
Show file tree
Hide file tree
Showing 42 changed files with 22,486 additions and 5,497 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The types of changes are:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fides/compare/2.20.1...main)
## [Unreleased](https://github.com/ethyca/fides/compare/2.20.2...main)

### Added
- "Add a vendor" flow to configuring consent page [#4107](https://github.com/ethyca/fides/pull/4107)
Expand All @@ -27,18 +27,27 @@ The types of changes are:
- Fides-js can now display preliminary TCF data [#3879](https://github.com/ethyca/fides/pull/3879)
- Fides-js can persist TCF preferences to the backend [#3887](https://github.com/ethyca/fides/pull/3887)
- TCF modal now supports setting legitimate interest fields [#4037](https://github.com/ethyca/fides/pull/4037)
- Embed the GVL in the GET Experiences response [#4143](https://github.com/ethyca/fides/pull/4143)
- Button to view how many vendors and to open the vendor tab in the TCF modal [#4144](https://github.com/ethyca/fides/pull/4144)

### Changed
- Added further config options to customize the privacy center [#4090](https://github.com/ethyca/fides/pull/4090)
- CORS configuration page [#4073](https://github.com/ethyca/fides/pull/4073)
- Refactored `fides.js` components so that they can take data structures that are not necessarily privacy notices [#3870](https://github.com/ethyca/fides/pull/3870)
- Use hosted GVL.json from the backend [#4159](https://github.com/ethyca/fides/pull/4159)
- Features and Special Purposes in the TCF modal do not render toggles [#4139](https://github.com/ethyca/fides/pull/4139)
- Moved the initial TCF layer to the banner [#4142](https://github.com/ethyca/fides/pull/4142)
- Misc copy changes for the system history table and modal [#4146](https://github.com/ethyca/fides/pull/4146)

### Fixed
- Allows CDN to cache empty experience responses from fides.js API [#4113](https://github.com/ethyca/fides/pull/4113)

## [2.20.2](https://github.com/ethyca/fides/compare/2.20.1...2.20.2)

### Fixed
- added version_added, version_deprecated, and replaced_by to data use, data subject, and data category APIs [#4135](https://github.com/ethyca/fides/pull/4135)
- Update fides.js to not fetch experience client-side if pre-fetched experience is empty [#4149](https://github.com/ethyca/fides/pull/4149)
- Erasure privacy requests now pause for input if there are any manual process integrations [#4115](https://github.com/ethyca/fides/pull/4115)
- Caching the values of authorization_required and user_guide on the connector templates to improve performance [#4128](https://github.com/ethyca/fides/pull/4128)

## [2.20.1](https://github.com/ethyca/fides/compare/2.20.0...2.20.1)
Expand Down
36 changes: 22 additions & 14 deletions clients/admin-ui/src/features/common/RequestType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,33 @@ type RequestTypeProps = {
rules: Rule[];
};

const RequestType = ({ rules }: RequestTypeProps) => {
const actions = Array.from(
/**
* Extracts and returns the unique action types from the rules.
* @param rules Array of Rule objects.
*/
export const getActionTypes = (rules: Rule[]): ActionType[] =>
Array.from(
new Set(
rules
.filter((d) => Object.values(ActionType).includes(d.action_type))
.map((d) => capitalize(d.action_type))
.map((d) => d.action_type)
)
);
const tags = actions.map((action_type) => (
<Tag
key={action_type}
color="white"
bg="primary.400"
fontWeight="medium"
fontSize="sm"
>
{action_type}
</Tag>
));

const RequestType = ({ rules }: RequestTypeProps) => {
const tags = getActionTypes(rules)
.map((action) => capitalize(action))
.map((action_type) => (
<Tag
key={action_type}
color="white"
bg="primary.400"
fontWeight="medium"
fontSize="sm"
>
{action_type}
</Tag>
));

return <Box>{tags}</Box>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,16 @@ import * as Yup from "yup";

import { ManualInputData } from "./types";

type ManualProcessingDetailProps = {
type ManualAccessProcessingDetailProps = {
connectorName: string;
data: ManualInputData;
isSubmitting: boolean;
onSaveClick: (params: PatchUploadManualWebhookDataRequest) => void;
};

const ManualProcessingDetail: React.FC<ManualProcessingDetailProps> = ({
connectorName,
data,
isSubmitting = false,
onSaveClick,
}) => {
const ManualAccessProcessingDetail: React.FC<
ManualAccessProcessingDetailProps
> = ({ connectorName, data, isSubmitting = false, onSaveClick }) => {
const { isOpen, onOpen, onClose } = useDisclosure();
const firstField = useRef(null);

Expand Down Expand Up @@ -101,12 +98,12 @@ const ManualProcessingDetail: React.FC<ManualProcessingDetailProps> = ({
<DrawerContent>
<DrawerCloseButton />
<DrawerHeader color="gray.900">
<Text fontSize="xl" mb={4}>
<Text fontSize="xl" mb={8}>
{connectorName}
</Text>
<Divider />
<Text fontSize="md" mt="8">
PII Requirements
<Text fontSize="md" mt="4">
Manual access
</Text>
<Box mt="8px">
<Text color="gray.700" fontSize="sm" fontWeight="normal">
Expand All @@ -115,7 +112,7 @@ const ManualProcessingDetail: React.FC<ManualProcessingDetailProps> = ({
</Text>
</Box>
</DrawerHeader>
<DrawerBody mt="24px">
<DrawerBody>
<Form id="manual-detail-form" noValidate>
<VStack align="stretch" gap="16px">
{Object.entries(data.fields).map(([key], index) => (
Expand Down Expand Up @@ -180,4 +177,4 @@ const ManualProcessingDetail: React.FC<ManualProcessingDetailProps> = ({
);
};

export default ManualProcessingDetail;
export default ManualAccessProcessingDetail;
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import {
Box,
Button,
ButtonGroup,
Checkbox,
Divider,
Drawer,
DrawerBody,
DrawerCloseButton,
DrawerContent,
DrawerFooter,
DrawerHeader,
DrawerOverlay,
FormControl,
FormLabel,
HStack,
Text,
useDisclosure,
VStack,
} from "@fidesui/react";
import { Field, FieldInputProps, Form, Formik } from "formik";
import { PatchUploadManualWebhookDataRequest } from "privacy-requests/types";
import React, { useRef } from "react";
import * as Yup from "yup";

import { ManualInputData } from "./types";

type ManualAccessProcessingDetailProps = {
connectorName: string;
data: ManualInputData;
isSubmitting: boolean;
onSaveClick: (params: PatchUploadManualWebhookDataRequest) => void;
};

const ManualErasureProcessingDetail: React.FC<
ManualAccessProcessingDetailProps
> = ({ connectorName, data, isSubmitting = false, onSaveClick }) => {
const { isOpen, onOpen, onClose } = useDisclosure();
const firstField = useRef(null);

const handleSubmit = async (values: any, _actions: any) => {
const params: PatchUploadManualWebhookDataRequest = {
connection_key: data.connection_key,
privacy_request_id: data.privacy_request_id,
body: { ...values } as object,
};
onSaveClick(params);
onClose();
};

return (
<>
{data?.checked && (
<Button
color="gray.700"
fontSize="xs"
h="24px"
onClick={onOpen}
variant="outline"
w="58px"
>
Review
</Button>
)}
{!data?.checked && (
<Button
color="white"
bg="primary.800"
fontSize="xs"
h="24px"
onClick={onOpen}
w="127px"
_hover={{ bg: "primary.400" }}
_active={{ bg: "primary.500" }}
>
Begin manual input
</Button>
)}
<Formik
enableReinitialize
initialValues={{ ...data.fields }}
onSubmit={handleSubmit}
validateOnBlur={false}
validateOnChange={false}
validationSchema={Yup.object().shape({})}
>
{/* @ts-ignore */}
{(_props: FormikProps<Values>) => (
<Drawer
isOpen={isOpen}
placement="right"
initialFocusRef={firstField}
onClose={onClose}
size="lg"
>
<DrawerOverlay />
<DrawerContent>
<DrawerCloseButton />
<DrawerHeader color="gray.900">
<Text fontSize="xl" mb={8}>
{connectorName}
</Text>
<Divider />
<Text fontSize="md" mt="4">
Manual erasure
</Text>
<Box mt="8px">
<Text color="gray.700" fontSize="sm" fontWeight="normal">
Please delete the following PII fields associated with the
selected subject if they are available. Once deleted, check
the box to confirm the deletion.
</Text>
</Box>
</DrawerHeader>
<DrawerBody>
<Form id="manual-detail-form" noValidate>
<VStack align="stretch" gap="16px">
{Object.entries(data.fields).map(([key]) => (
<HStack key={key}>
<Field id={key} name={key}>
{({ field }: { field: FieldInputProps<string> }) => (
<FormControl
alignItems="baseline"
display="inline-flex"
>
<FormLabel
color="gray.900"
fontSize="14px"
fontWeight="semibold"
htmlFor={key}
w="50%"
>
{key}
</FormLabel>
<Checkbox
{...field}
isChecked={!!field.value}
onChange={field.onChange}
name={key}
id={key}
/>
</FormControl>
)}
</Field>
</HStack>
))}
</VStack>
</Form>
</DrawerBody>
<DrawerFooter justifyContent="flex-start">
<ButtonGroup size="sm" spacing="8px" variant="outline">
<Button onClick={onClose} variant="outline">
Cancel
</Button>
<Button
bg="primary.800"
color="white"
form="manual-detail-form"
isLoading={isSubmitting}
loadingText="Submitting"
size="sm"
variant="solid"
type="submit"
_active={{ bg: "primary.500" }}
_hover={{ bg: "primary.400" }}
>
Save
</Button>
</ButtonGroup>
</DrawerFooter>
</DrawerContent>
</Drawer>
)}
</Formik>
</>
);
};

export default ManualErasureProcessingDetail;
Loading

0 comments on commit 91adc0f

Please sign in to comment.