Skip to content
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

Asset checks UI revamp #19934

Merged
Show file tree
Hide file tree
Changes from 8 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React from 'react';

import {Box} from './Box';
import {Icon} from './Icon';

export const CollapsibleSection = ({
header,
headerWrapperProps,
children,
isInitiallyCollapsed = false,
}: {
header: React.ReactNode;
headerWrapperProps?: React.ComponentProps<typeof Box>;
children: React.ReactNode;
isInitiallyCollapsed?: boolean;
}) => {
const [isCollapsed, setIsCollapsed] = React.useState(isInitiallyCollapsed);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm does this one look like the new Asset Overview one? (the "Description" header here: https://www.figma.com/file/wQHGZ2cjfpna2P2OaM4aTs/aset-catalog-ui?type=design&node-id=208-45868&mode=design&t=IUz5OJkO0QRbYlOv-0)

Maybe we can merge this one and that together. I'd left it in the AssetNodeOverview.tsx file because there weren't any other collapsing sections like that in the product, but maybe there are now!

return (
<Box flex={{direction: 'column'}}>
<Box
{...headerWrapperProps}
flex={{direction: 'row', alignItems: 'center', gap: 6, ...(headerWrapperProps?.flex || {})}}
onClick={() => {
setIsCollapsed(!isCollapsed);
headerWrapperProps?.onClick?.();
}}
>
<Icon
name="arrow_drop_down"
style={{transform: isCollapsed ? 'rotate(-90deg)' : 'rotate(0deg)'}}
/>
<div>{header}</div>
</Box>
{isCollapsed ? null : children}
</Box>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const Inner = styled.div.attrs<InnerProps>(({$totalHeight}) => ({
width: 100%;
`;

type RowProps = {$height: number; $start: number};
export type RowProps = {$height: number; $start: number};

export const Row = styled.div.attrs<RowProps>(({$height, $start}) => ({
style: {
Expand Down
1 change: 1 addition & 0 deletions js_modules/dagster-ui/packages/ui-components/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export * from './components/Button';
export * from './components/ButtonGroup';
export * from './components/ButtonLink';
export * from './components/Checkbox';
export * from './components/CollapsibleSection';
export * from './components/ConfigEditorDialog';
export * from './components/ConfigEditorWithSchema';
export * from './components/ConfigTypeSchema';
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export type AssetViewFeatureInput = {
type AssetFeatureContextType = {
tabBuilder: (input: AssetTabConfigInput) => AssetTabConfig[];
renderFeatureView: (input: AssetViewFeatureInput) => React.ReactNode;
AssetChecksBanner: React.ComponentType<Record<string, never>>;
AssetChecksBanner: React.ComponentType<{onClose: () => void}>;
};

export const AssetFeatureContext = React.createContext<AssetFeatureContextType>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export const buildAssetTabMap = (input: AssetTabConfigInput): Record<string, Ass
id: 'checks',
title: 'Checks',
to: buildAssetViewParams({...params, view: 'checks'}),
hidden: !definition?.hasAssetChecks,
},
events: {
id: 'events',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,6 @@ export const ASSET_VIEW_DEFINITION_QUERY = gql`
name
}
}
hasAssetChecks

...AssetNodeInstigatorsFragment
...AssetNodeDefinitionFragment
Expand Down
Loading
Loading