From 82d51840d41b3ea9456abfb9ac0299461e2d596d Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 16 Oct 2023 18:21:40 -0500 Subject: [PATCH] =?UTF-8?q?[ui]=20Tweak=20dialog=20padding,=20conditionall?= =?UTF-8?q?y=20pluralize=20=E2=80=9Creport=20events=E2=80=9D=20in=20Materi?= =?UTF-8?q?alize=20dropdown=20(#17217)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 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): Screen Shot 2023-10-14 at 4 34 39 PM After: Screen Shot 2023-10-14 at 4 31 22 PM ## How I Tested These Changes Checked partitioned / unpartitioned assets Co-authored-by: bengotow --- .../assets/LaunchAssetChoosePartitionsDialog.tsx | 14 +++++++------- .../ui-core/src/assets/useReportEventsModal.tsx | 8 +++++--- .../packages/ui-core/src/ui/ToggleableSection.tsx | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/LaunchAssetChoosePartitionsDialog.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/LaunchAssetChoosePartitionsDialog.tsx index e33a4f3174b77..cf6cade712b62 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/LaunchAssetChoosePartitionsDialog.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/LaunchAssetChoosePartitionsDialog.tsx @@ -455,7 +455,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC = ({ } > = ({ {target.type === 'pureWithAnchorAsset' && ( @@ -493,7 +493,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC = ({ @@ -552,7 +552,7 @@ const LaunchAssetChoosePartitionsDialogBody: React.FC = ({ } isInitiallyOpen={false} > - + = ({ isInitiallyOpen={true} > {target.type === 'job' && ( - + = ({ )} - + {previewCount > 0 && ( } > - + {alerts} diff --git a/js_modules/dagster-ui/packages/ui-core/src/assets/useReportEventsModal.tsx b/js_modules/dagster-ui/packages/ui-core/src/assets/useReportEventsModal.tsx index a20e052298e31..919ff9d24cc03 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/assets/useReportEventsModal.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/assets/useReportEventsModal.tsx @@ -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: , onClick: () => setIsOpen(true), }, ], - [], + [asset?.isPartitioned], ); const element = asset ? ( @@ -196,7 +198,7 @@ const ReportEventDialogBody: React.FC<{ diff --git a/js_modules/dagster-ui/packages/ui-core/src/ui/ToggleableSection.tsx b/js_modules/dagster-ui/packages/ui-core/src/ui/ToggleableSection.tsx index 874377d6c917d..d83df157cace4 100644 --- a/js_modules/dagster-ui/packages/ui-core/src/ui/ToggleableSection.tsx +++ b/js_modules/dagster-ui/packages/ui-core/src/ui/ToggleableSection.tsx @@ -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'}} >