-
Notifications
You must be signed in to change notification settings - Fork 74
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
PROD-2481 Update manage datasets pages #5191
Merged
Merged
Changes from 27 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
d48482b
PROD-2481 Dataset table: add edit column
968258b
PROD-2481 Add edit drawer to dataset page
76b3fb8
PROD-2481 Adjust dataset drawer styling. Remove data categories input.
ffa9ab6
PROD-2481 Adjust dataset drawer styling.
2c9be2c
PROD-2481 Update add dataset buttons styling
bd86904
PROD-2481 WIP
d15b840
PROD-2481 WIP
a2a9675
PROD-2481 WIP
bc6530f
Merge branch 'main' of github.com:ethyca/fides into PROD-2481-Update-…
d55bb93
PROD-2481 WIP
1a9890b
PROD-2481 WIP
21a5b57
PROD-2481 Add dataset breadcrumbs and icons
8538347
PROD-2481 Dataset Header styling
9f014ce
PROD_2481 Client side search
6cb04f4
PROD-2481 Fix bug with closing tray
c0df9d4
PROD-2481 Remove unused files after refactor
92832e8
Merge branch 'main' of github.com:ethyca/fides into PROD-2481-Update-…
d081341
PROD-2481 Fix lint issues
32b67cf
PROD-2481 Update changelog
0b21ec2
PROD-2481 fix build issuer
6e8301e
PROD-2481 Update tests
4937471
PROD-2481 Fix not being able to add data categories after removing al…
3e16c05
Merge branch 'main' of github.com:ethyca/fides into PROD-2481-Update-…
99bbd6c
Fixed datset breadcrumb icons size
54fb01f
Merge branch 'main' of github.com:ethyca/fides into PROD-2481-Update-…
de1e130
PROD-2481 Adjust D&D title and breadcrumbs for consistency. Remove du…
0551240
fix findResourceType
jpople 6c08541
Eslint fix
752ed61
PROD-2481 Update tests
0ad2e9b
PROD-2481 Update tests
fbaa7ab
PROD-2481 Fix build
77e461b
PROD-2481 Fix build
88e1f39
PROD-2481 Delete test for Dataset classification that were skipped al…
48aea5d
Fix tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,26 @@ | ||
import { Breadcrumb, BreadcrumbItem, BreadcrumbLink } from "fidesui"; | ||
import { | ||
Box, | ||
Breadcrumb, | ||
BreadcrumbItem, | ||
BreadcrumbLink, | ||
BreadcrumbProps as ChakraBreadcrumbProps, | ||
HTMLChakraProps, | ||
} from "fidesui"; | ||
import { Url } from "next/dist/shared/lib/router/router"; | ||
import NextLink from "next/link"; | ||
|
||
export interface BreadcrumbsProps { | ||
export interface BreadcrumbsProps extends ChakraBreadcrumbProps { | ||
breadcrumbs: { | ||
title: string; | ||
link?: string; | ||
link?: Url; // Next.js link url. It can be a string or an URL object (accepts query params) | ||
onClick?: () => void; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't know this existed, neat. |
||
isOpaque?: boolean; | ||
icon?: React.ReactNode; | ||
}[]; | ||
fontSize?: string; | ||
fontWeight?: string; | ||
separator?: string; | ||
lastItemStyles?: HTMLChakraProps<"li">; | ||
normalItemStyles?: HTMLChakraProps<"li">; | ||
} | ||
|
||
/** | ||
|
@@ -16,27 +29,42 @@ export interface BreadcrumbsProps { | |
* @param breadcrumbs - array of breadcrumbs | ||
* @param breadcrumbs.title - title of the breadcrumb | ||
* @param breadcrumbs.link - (optional) link to the page | ||
* @param breadcrumbs.onClick - (optional) function to call when the breadcrumb is clicked | ||
* @param breadcrumbs.isOpaque - (optional) if true, the breadcrumb will be black, otherwise gray | ||
* @param breadcrumbs.icon - (optional) icon to show before the title | ||
*/ | ||
const Breadcrumbs = ({ breadcrumbs }: BreadcrumbsProps) => ( | ||
const Breadcrumbs = ({ | ||
breadcrumbs, | ||
fontSize = "2xl", | ||
fontWeight = "semibold", | ||
separator = "->", | ||
lastItemStyles = { | ||
color: "black", | ||
}, | ||
normalItemStyles = { | ||
color: "gray.500", | ||
}, | ||
...otherChakraBreadcrumbProps | ||
}: BreadcrumbsProps) => ( | ||
<Breadcrumb | ||
separator="->" | ||
fontSize="2xl" | ||
fontWeight="semibold" | ||
separator={separator} | ||
fontSize={fontSize} | ||
fontWeight={fontWeight} | ||
data-testid="breadcrumbs" | ||
{...otherChakraBreadcrumbProps} | ||
> | ||
{breadcrumbs.map((breadcumbItem, index) => { | ||
const isLast = index + 1 === breadcrumbs.length; | ||
const hasLink = !!breadcumbItem.link || !!breadcumbItem.onClick; | ||
|
||
return ( | ||
<BreadcrumbItem | ||
color={isLast || breadcumbItem.isOpaque ? "black" : "gray.500"} | ||
{...normalItemStyles} | ||
{...(isLast ? lastItemStyles : {})} | ||
key={breadcumbItem.title} | ||
> | ||
{hasLink ? ( | ||
{breadcumbItem?.icon && <Box mr={2}>{breadcumbItem.icon}</Box>} | ||
{breadcumbItem.link ? ( | ||
<BreadcrumbLink | ||
as={NextLink} | ||
// @ts-ignore - href for chakra expects string, but can also pass a URL Object because we're using as={NextLink}. | ||
href={breadcumbItem.link} | ||
isCurrentPage={isLast} | ||
> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated edit drawer component with some new styling. |
||
Box, | ||
Button, | ||
CloseSolidIcon, | ||
CloseIcon, | ||
Drawer, | ||
DrawerBody, | ||
DrawerContent, | ||
|
@@ -10,10 +10,11 @@ import { | |
DrawerOverlay, | ||
IconButton, | ||
Text, | ||
TrashCanSolidIcon, | ||
} from "fidesui"; | ||
import { ReactNode } from "react"; | ||
|
||
import { TrashCanOutlineIcon } from "~/features/common/Icon/TrashCanOutlineIcon"; | ||
|
||
interface Props { | ||
header?: ReactNode; | ||
description?: string; | ||
|
@@ -30,13 +31,16 @@ export const EditDrawerHeader = ({ | |
title: string; | ||
onDelete?: () => void; | ||
}) => ( | ||
<DrawerHeader py={2} display="flex" alignItems="center"> | ||
<Text mr="2">{title}</Text> | ||
<DrawerHeader py={0} display="flex" alignItems="flex-start"> | ||
<Text mr="2" color="gray.700" fontSize="lg" lineHeight={1.8}> | ||
{title} | ||
</Text> | ||
{onDelete ? ( | ||
<IconButton | ||
variant="outline" | ||
aria-label="delete" | ||
icon={<TrashCanSolidIcon />} | ||
size="xs" | ||
icon={<TrashCanOutlineIcon fontSize="small" />} | ||
size="sm" | ||
onClick={onDelete} | ||
data-testid="delete-btn" | ||
/> | ||
|
@@ -56,7 +60,7 @@ export const EditDrawerFooter = ({ | |
formId?: string; | ||
isSaving?: boolean; | ||
} & Pick<Props, "onClose">) => ( | ||
<DrawerFooter justifyContent="flex-start"> | ||
<DrawerFooter justifyContent="space-between"> | ||
<Button onClick={onClose} mr={2} size="sm" variant="outline"> | ||
Cancel | ||
</Button> | ||
|
@@ -81,22 +85,35 @@ const EditDrawer = ({ | |
children, | ||
footer, | ||
}: Props) => ( | ||
<Drawer placement="right" isOpen={isOpen} onClose={onClose} size="lg"> | ||
<Drawer placement="right" isOpen={isOpen} onClose={onClose} size="md"> | ||
<DrawerOverlay /> | ||
<DrawerContent data-testid="edit-drawer-content" py={2}> | ||
<Box display="flex" justifyContent="flex-end" mr={2}> | ||
<Button | ||
variant="ghost" | ||
onClick={onClose} | ||
data-testid="close-drawer-btn" | ||
> | ||
<CloseSolidIcon width="17px" /> | ||
</Button> | ||
<Box | ||
display="flex" | ||
justifyContent="space-between" | ||
alignItems="top" | ||
mr={2} | ||
py={2} | ||
gap={2} | ||
> | ||
<Box flex={1} minH={8}> | ||
{header} | ||
</Box> | ||
<Box display="flex" justifyContent="flex-end" mr={2}> | ||
<IconButton | ||
aria-label="Close editor" | ||
variant="outline" | ||
onClick={onClose} | ||
data-testid="close-drawer-btn" | ||
size="sm" | ||
icon={<CloseIcon fontSize="smaller" />} | ||
/> | ||
</Box> | ||
</Box> | ||
{header} | ||
<DrawerBody> | ||
|
||
<DrawerBody pt={1}> | ||
{description ? ( | ||
<Text fontSize="sm" mb={4}> | ||
<Text fontSize="sm" mb={4} color="gray.600"> | ||
{description} | ||
</Text> | ||
) : null} | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the breadcrumbs component. Added support for icons, expanded Link to be able to receive query params, added prop optionally be able to override some styles. Remove isOpaque props since it was too specific and it won't be used anymore. Removed onClick since it wasn't working nor being used.