Skip to content

Commit

Permalink
[ui] Tweak dialog padding, conditionally pluralize “report events” in…
Browse files Browse the repository at this point in the history
… Materialize dropdown (#17217)

## Summary & Motivation

- Conditionally pluralize “report events” in Materialize dropdown

- Update some Materialize / Report Event dialog elements that were using
24px horizontal padding -- the dialog header / footer / body only use
20px padding.

Before (some elements are inset from the guide lines):
<img width="786" alt="Screen Shot 2023-10-14 at 4 34 39 PM"
src="https://github.com/dagster-io/dagster/assets/1037212/2e7b6186-7c72-44e2-8ea0-4986b2370f1e">

After:
<img width="793" alt="Screen Shot 2023-10-14 at 4 31 22 PM"
src="https://github.com/dagster-io/dagster/assets/1037212/687ac1f1-7185-4a4b-af3d-129571aa95aa">


## How I Tested These Changes

Checked partitioned / unpartitioned assets

Co-authored-by: bengotow <[email protected]>
  • Loading branch information
bengotow and bengotow authored Oct 16, 2023
1 parent 134ab86 commit 82d5184
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
}
>
<Box
padding={{vertical: 12, horizontal: 24}}
padding={{vertical: 12, horizontal: 20}}
data-testid={testId('pure-all-partitions-only')}
>
<Alert
Expand All @@ -482,7 +482,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
{target.type === 'pureWithAnchorAsset' && (
<Box
flex={{alignItems: 'center', gap: 8}}
padding={{top: 12, horizontal: 24}}
padding={{top: 12, horizontal: 20}}
data-testid={testId('anchor-asset-label')}
>
<Icon name="asset" />
Expand All @@ -493,7 +493,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
<Box
key={range.dimension.name}
border="bottom"
padding={{vertical: 12, horizontal: 24}}
padding={{vertical: 12, horizontal: 20}}
>
<Box as={Subheading} flex={{alignItems: 'center', gap: 8}}>
<Icon name="partition" />
Expand Down Expand Up @@ -552,7 +552,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
}
isInitiallyOpen={false}
>
<Box padding={{vertical: 16, horizontal: 24}} flex={{direction: 'column', gap: 12}}>
<Box padding={{vertical: 16, horizontal: 20}} flex={{direction: 'column', gap: 12}}>
<TagEditor
tagsFromSession={tags}
onChange={setTags}
Expand Down Expand Up @@ -586,7 +586,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
isInitiallyOpen={true}
>
{target.type === 'job' && (
<Box padding={{vertical: 16, horizontal: 24}} flex={{direction: 'column', gap: 12}}>
<Box padding={{vertical: 16, horizontal: 20}} flex={{direction: 'column', gap: 12}}>
<Checkbox
data-testid={testId('missing-only-checkbox')}
label="Backfill only failed and missing partitions within selection"
Expand Down Expand Up @@ -634,7 +634,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC<Props> = ({
)}
</ToggleableSection>

<Box padding={{horizontal: 24}}>
<Box padding={{horizontal: 20}}>
{previewCount > 0 && (
<Box
margin={{top: 16}}
Expand Down Expand Up @@ -864,7 +864,7 @@ const Warnings: React.FC<{
</Box>
}
>
<Box flex={{direction: 'column', gap: 16}} padding={{vertical: 12, horizontal: 24}}>
<Box flex={{direction: 'column', gap: 16}} padding={{vertical: 12, horizontal: 20}}>
{alerts}
</Box>
</ToggleableSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ export function useReportEventsModal(asset: Asset | null, onEventReported: () =>
const dropdownOptions = React.useMemo(
() => [
{
label: 'Report materialization event',
label: asset?.isPartitioned
? 'Report materialization events'
: 'Report materialization event',
icon: <Icon name="asset_non_sda" />,
onClick: () => setIsOpen(true),
},
],
[],
[asset?.isPartitioned],
);

const element = asset ? (
Expand Down Expand Up @@ -196,7 +198,7 @@ const ReportEventDialogBody: React.FC<{
<Box
key={range.dimension.name}
border="bottom"
padding={{vertical: 12, horizontal: 24}}
padding={{vertical: 12, horizontal: 20}}
>
<Box as={Subheading} flex={{alignItems: 'center', gap: 8}}>
<Icon name="partition" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ToggleableSection = ({
background={background ?? Colors.Gray50}
border="bottom"
flex={{alignItems: 'center', direction: 'row'}}
padding={{vertical: 12, horizontal: 24}}
padding={{vertical: 12, right: 20, left: 16}}
style={{cursor: 'pointer'}}
>
<Rotateable $rotate={!isOpen}>
Expand Down

1 comment on commit 82d5184

@github-actions
Copy link

Choose a reason for hiding this comment

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

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-infzsnprk-elementl.vercel.app

Built with commit 82d5184.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.