Skip to content

Commit

Permalink
clean up unnecessary styles, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
gilluminate committed Feb 12, 2025
1 parent 28c5e67 commit c3564ef
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 32 deletions.
2 changes: 1 addition & 1 deletion clients/admin-ui/src/features/common/PickerCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const PickerCheckboxList = <T extends { id: string; name: string }>({
{toggle ?? null}
</Flex>
{numSelected > 0 ? (
<Tag style={{ width: "fit-content" }} data-testid="num-selected-badge">
<Tag className="w-fit" data-testid="num-selected-badge">
{numSelected} selected
</Tag>
) : null}
Expand Down
13 changes: 7 additions & 6 deletions clients/admin-ui/src/features/common/table/v2/cells.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
AntSwitch as Switch,
AntSwitchProps as SwitchProps,
AntTag as Tag,
AntTagProps as TagProps,
Box,
Checkbox,
CheckboxProps,
Expand All @@ -19,7 +20,7 @@ import {
WarningIcon,
} from "fidesui";
import { useField, useFormikContext } from "formik";
import { ComponentProps, ReactNode, useEffect, useMemo, useState } from "react";
import { ReactNode, useEffect, useMemo, useState } from "react";

import { getErrorMessage, isErrorResult } from "~/features/common/helpers";
import ConfirmationModal from "~/features/common/modals/ConfirmationModal";
Expand Down Expand Up @@ -56,7 +57,7 @@ export const DefaultCell = <T,>({
);
};

const FidesTag = ({ children, ...props }: ComponentProps<typeof Tag>) => (
const FidesTag = ({ children, ...props }: TagProps) => (
<Tag {...props}>{children}</Tag>
);

Expand Down Expand Up @@ -105,7 +106,7 @@ export const BadgeCell = ({
}: {
value: string | number;
suffix?: string;
} & ComponentProps<typeof Tag>) => (
} & TagProps) => (
<BadgeCellContainer>
<FidesTag {...tagProps}>
{value}
Expand All @@ -123,7 +124,7 @@ export const BadgeCellCount = ({
count: number;
singSuffix?: string;
plSuffix?: string;
} & ComponentProps<typeof Tag>) => {
} & TagProps) => {
let tag = null;
if (count === 1) {
tag = (
Expand Down Expand Up @@ -151,7 +152,7 @@ export const BadgeCellExpandable = <T,>({
}: {
values: BadgeCellExpandableValues | undefined;
cellProps?: Omit<FidesCellProps<T>, "onRowClick">;
} & ComponentProps<typeof Tag>) => {
} & TagProps) => {
const { isExpanded, isWrapped, version } = cellProps?.cellState || {};
const displayThreshold = 2; // Number of badges to display when collapsed
const [isCollapsed, setIsCollapsed] = useState<boolean>(!isExpanded);
Expand Down Expand Up @@ -230,7 +231,7 @@ export const GroupCountBadgeCell = ({
suffix?: string;
cellState?: FidesCellState;
ignoreZero?: boolean;
tagProps?: ComponentProps<typeof Tag>;
tagProps?: TagProps;
}) => {
let tags = null;
if (!value) {
Expand Down
4 changes: 1 addition & 3 deletions clients/admin-ui/src/features/config-wizard/ScannerError.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ const ScannerError = ({
}) => (
<Stack data-testid="scanner-error" spacing="4">
<HStack>
<Tag color="error" className="py-2">
Error
</Tag>
<Tag color="error">Error</Tag>
<Heading color="red.500" size="lg">
Failed to Scan
</Heading>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ const FrameworkStatus = ({
<Text>
{name} status{" "}
{enabled ? (
<Tag color="success" className="font-semibold">
Enabled
</Tag>
<Tag color="success">Enabled</Tag>
) : (
<Tag color="error" className="font-semibold">
Disabled
</Tag>
<Tag color="error">Disabled</Tag>
)}
</Text>
<Text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ interface ResultStatusBadgeProps extends Omit<TagProps, "color"> {
}

const ResultStatusBadge = ({ children, ...props }: ResultStatusBadgeProps) => {
return (
<Tag className="text-xs font-normal normal-case" {...props}>
{children}
</Tag>
);
return <Tag {...props}>{children}</Tag>;
};

interface DiscoveryStatusBadgeCellProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AntTag as Tag, Flex } from "fidesui";

const FieldDataTypeCell = ({ type }: { type?: string | null }) => (
<Flex align="center" h="full">
{!!type && <Tag className="text-xs font-normal">{type}</Tag>}
{!!type && <Tag>{type}</Tag>}
</Flex>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ import { ResourceChangeType } from "~/features/data-discovery-and-detection/type
import findResourceChangeType from "~/features/data-discovery-and-detection/utils/findResourceChangeType";
import { StagedResource } from "~/types/api";

interface ResultStatusBadgeProps extends Omit<TagProps, "color"> {
color: "success" | "marble" | "info" | "warning";
}

const ResultStatusBadge = ({ children, ...props }: ResultStatusBadgeProps) => {
return (
<Tag className="text-xs font-normal normal-case" {...props}>
{children}
</Tag>
);
const ResultStatusBadge = ({ children, ...props }: TagProps) => {
return <Tag {...props}>{children}</Tag>;
};

const ResultStatusBadgeCell = ({
Expand Down

0 comments on commit c3564ef

Please sign in to comment.