Skip to content

Commit 26f7d37

Browse files
authored
Reverse Chakra/Ant import prefixes in FidesUI design system (#7173)
1 parent 863d9f1 commit 26f7d37

File tree

704 files changed

+3376
-3229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

704 files changed

+3376
-3229
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Changes can also be flagged with a GitHub label for tracking purposes. The URL o
4646
- Renamed staged resource diff status from 'approved' to 'reviewed' in database migration [#7159](https://github.com/ethyca/fides/pull/7159) https://github.com/ethyca/fides/labels/db-migration
4747

4848
### Developer Experience
49+
- Deprecated Chakra UI exports with `Chakra` prefix, removed `Ant` prefix from Ant Design exports [#7173](https://github.com/ethyca/fides/pull/7173)
4950
- Migrated consent settings tables to Ant Design [#7084](https://github.com/ethyca/fides/pull/7084)
5051
- Migrated privacy notices table to Ant Design [#7087](https://github.com/ethyca/fides/pull/7087)
5152
- Update Ant modal hook usage [#7086](https://github.com/ethyca/fides/pull/7086)

clients/.cursor/rules/frontend.mdc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ While working in this `clients` directory, you are a Senior Front-End Developer
1515
- The `clients/fidesui` directory is a design system which exports both Chakra and Ant Design components, however we are migrating to Ant from Chakra so Ant components are always preferred if possible. Only Admin UI and Privacy center use this design system, never try to use it in fides-js code.
1616
- The `clients/cypress-e2e` directory is a specific set of tests and can mostly be ignored while working in the 3 main apps
1717
- The `clients/sample-app` directory is a demo app and can mostly be ignored while working in the 3 main apps.
18-
- The rest of the codebase is considered the "backend" of fides.
18+
- The rest of the codebase is considered the "backend" of fides which also gets wrapped by another repository called `fidesplus` which manages other backend code not found in this repo but is definitely utilized by the fides frontend.
1919
- The `clients/fides-js/docs` directory gets auto-generated from the jsdocs in `clients/fides-js/src/docs` and should never be updated manually. Always add to the `clients/fides-js/src/docs` instead. The types specified in `clients/fides-js/src/docs` do get imported and used in the codebase.
20-
- The Type definitions in the `clients/admin-ui/src/types/api` directory files get auto-generated from the backend endpoints and should not be updated manually.
20+
- The Type definitions in the `clients/admin-ui/src/types/api` directory files get auto-generated from the fidesplus backend endpoints and should not be updated manually.
2121
- Lazy loading scripts is not an option in FidesJS since this gets deployed on 3rd party sites as a single package and as an exported module.
2222

2323

@@ -30,7 +30,7 @@ Follow these rules when you write code:
3030
- Never omit curly braces around blocks.
3131
- Only use tailwindcss for layout and animation classes, no colors, fonts, borders, etc.
3232
- FidesDebugger is a global that never needs to be imported; It should never be used for error handling.
33-
- Any time we import an Ant component with prefix "Ant" we should import "as" the suffix: For example "AntSelect as Select".
33+
- Any time we import a Chakra component with prefix "Chakra" it has been imported "as" the suffix: For example `ChakraBox as Box`. However, as previously stated, we should not be adding Chakra components to new code. We keep those clearly marked for deprecation.
3434
- Titles, heading text, and buttons in the HTML/JSX should be sentence-cased, not title-cased.
3535
- When adding a property as a spread operator, favor the name `...props` over the name `...rest`
3636
- Prefer using nullish coalescing operator (`??`) instead of a logical or (`||`), as it is a safer operator (`||` where `""` is possible, favor `??` elsewhere)

clients/admin-ui/__tests__/features/hooks/tables/useAntTable.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import { beforeEach, describe, expect, it, jest } from "@jest/globals";
22
import { act, renderHook } from "@testing-library/react";
3-
import {
4-
AntTablePaginationConfig as TablePaginationConfig,
5-
AntTableProps as TableProps,
6-
} from "fidesui";
3+
import { TablePaginationConfig, TableProps } from "fidesui";
74

85
// Mock nuqs using shared mock implementation to prevent ESM issues
96
// eslint-disable-next-line global-require
@@ -21,7 +18,7 @@ type SortKey = "name" | "createdAt";
2118
const isPaginationConfig = (
2219
pagination: TableProps<any>["pagination"],
2320
): pagination is TablePaginationConfig => {
24-
return pagination !== false && pagination != null;
21+
return pagination !== false && pagination !== null;
2522
};
2623

2724
describe("useAntTable", () => {

clients/admin-ui/__tests__/fidesui-components/custom-list/CustomList.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { fireEvent, render } from "@testing-library/react";
2-
import { AntList as List } from "fidesui";
2+
import { List } from "fidesui";
33

44
import type { ListDataItem } from "~/features/poc/mockListData";
55
import { MOCK_LIST_DATA } from "~/features/poc/mockListData";

clients/admin-ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"format": "prettier --write .",
2323
"format:ci": "prettier --check .",
2424
"lint": "next lint && eslint ./cypress/e2e/**/*.ts ./cypress/support/**/*.ts",
25-
"lint:fix": "next lint --fix && eslint --fix ./cypress/e2e/**/*.ts ./cypress/support/**/*.ts",
25+
"lint:fix": "eslint --fix . && eslint --fix ./cypress/e2e/**/*.ts ./cypress/support/**/*.ts",
2626
"lint-staged:fix": "lint-staged --diff=main",
2727
"openapi:generate": "openapi --input http://localhost:8080/openapi.json --output ./src/types/api --exportCore false --exportServices false --indent 2 && prettier --write .",
2828
"openapi:generate-dictionary": "openapi --input http://localhost:8081/openapi.json --output ./src/types/dictionary-api --exportCore false --exportServices false --indent 2",

clients/admin-ui/src/app/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { isRejectedWithValue, Middleware } from "@reduxjs/toolkit";
2-
import { createStandaloneToast } from "fidesui";
2+
import { createChakraStandaloneToast as createStandaloneToast } from "fidesui";
33

44
import { DEFAULT_TOAST_PARAMS } from "~/features/common/toast";
55
import { selectApplicationConfig } from "~/features/config-settings/config-settings.slice";

clients/admin-ui/src/features/common/AccordionTree.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import {
2-
Accordion,
3-
AccordionButton,
4-
AccordionIcon,
5-
AccordionItem,
6-
AccordionPanel,
7-
Box,
8-
BoxProps,
9-
Text,
2+
ChakraAccordion as Accordion,
3+
ChakraAccordionButton as AccordionButton,
4+
ChakraAccordionIcon as AccordionIcon,
5+
ChakraAccordionItem as AccordionItem,
6+
ChakraAccordionPanel as AccordionPanel,
7+
ChakraBox as Box,
8+
ChakraBoxProps as BoxProps,
9+
ChakraText as Text,
1010
} from "fidesui";
1111
import { Fragment, ReactNode, useState } from "react";
1212

clients/admin-ui/src/features/common/AutosuggestSuffix.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AntTypography as Typography, GetProps } from "fidesui";
1+
import { GetProps, Typography } from "fidesui";
22

33
const { Text } = Typography;
44

clients/admin-ui/src/features/common/BorderGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Box, SimpleGrid } from "fidesui";
1+
import { ChakraBox as Box, ChakraSimpleGrid as SimpleGrid } from "fidesui";
22
import { chunk } from "lodash";
33
import { ReactNode } from "react";
44

clients/admin-ui/src/features/common/Breadcrumbs.tsx

Lines changed: 0 additions & 89 deletions
This file was deleted.

0 commit comments

Comments
 (0)