Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

#1008 User identity verification flow #1231

Merged
merged 19 commits into from
Sep 1, 2022
Merged
Show file tree
Hide file tree
Changes from 17 commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The types of changes are:
* Adds users and owners configuration for Hubspot connector [#1091](https://github.com/ethyca/fidesops/pull/1091)
* Foundations for a new email connector type [#1142](https://github.com/ethyca/fidesops/pull/1142)
* Adds endpoint for GET identity verification config [#1221](https://github.com/ethyca/fidesops/pull/1221)
* Add user identification flow to privacy center [#1231](https://github.com/ethyca/fidesops/pull/1231)
* Access support for Shopify [#1220](https://github.com/ethyca/fidesops/pull/1220)

## [1.7.1](https://github.com/ethyca/fidesops/compare/1.7.0...1.7.1)
Expand Down
5 changes: 5 additions & 0 deletions clients/ops/privacy-center/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.eslintrc.json
next.config.js
jest.config.js
26 changes: 23 additions & 3 deletions clients/ops/privacy-center/__tests__/RequestModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,43 @@ import { act } from "react-dom/test-utils";
import { rest } from "msw";
import { setupServer } from "msw/node";

import { RequestModal } from "../components/RequestModal";
import {
RequestModal,
RequestModalProps,
} from "../components/modals/RequestModal";
import IndexPage from "../pages/index";

import mockConfig from "../config/__mocks__/config.json";
import { ModalViews } from "../components/modals/types";

jest.mock("../config/config.json");

const server = setupServer();
const server = setupServer(
rest.get(
"http://localhost:8080/api/v1/id-verification/config",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use our ${hostUrl} const in tests too? Or is there a specific reason not to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can. There's no particular reason. I'll update it now.

(req, res, ctx) =>
res(
ctx.json({
identity_verification_required: false,
valid_email_config_exists: false,
})
)
)
);
beforeAll(() => server.listen());
afterEach(() => server.resetHandlers());
afterAll(() => server.close());

const defaultModalProperties = {
const defaultModalProperties: RequestModalProps = {
isOpen: true,
onClose: () => {},
openAction: mockConfig.actions[0].policy_key,
setAlert: () => {},
currentView: ModalViews.PrivacyRequest,
setCurrentView: () => {},
privacyRequestId: "",
setPrivacyRequestId: () => {},
isVerificationRequired: false,
};

describe("RequestModal", () => {
Expand Down
63 changes: 63 additions & 0 deletions clients/ops/privacy-center/components/PrivacyCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from "react";
import { Heading, Text, Stack, Box, Image, HStack } from "@fidesui/react";

type PrivacyCardProps = {
title: string;
policyKey: string;
iconPath: string;
description: string;
onOpen: (policyKey: string) => void;
};

const PrivacyCard: React.FC<PrivacyCardProps> = ({
title,
policyKey,
iconPath,
description,
onOpen,
}) => (
<Box
as="button"
key={title}
bg="white"
py={8}
px={6}
borderRadius={4}
boxShadow="base"
maxWidth={["100%", "100%", "100%", 304]}
transition="box-shadow 50ms"
cursor="pointer"
userSelect="none"
m={2}
_hover={{
boxShadow: "complimentary-2xl",
}}
_focus={{
outline: "none",
boxShadow: "complimentary-2xl",
}}
onClick={() => onOpen(policyKey)}
>
<Stack spacing={7}>
<HStack justifyContent="center">
<Image src={iconPath} alt={description} width="54px" height="54px" />
</HStack>

<Stack spacing={1} textAlign="center">
<Heading
fontSize="large"
fontWeight="semibold"
lineHeight="28px"
color="gray.600"
>
{title}
</Heading>
<Text fontSize="xs" color="gray.600">
{description}
</Text>
</Stack>
</Stack>
</Box>
);

export default PrivacyCard;
Loading