From 5581b4f8729b827e9c3de6c4dcae834aa2b1d0f8 Mon Sep 17 00:00:00 2001 From: Junyi Date: Tue, 15 Aug 2023 21:10:46 +0700 Subject: [PATCH] fix(plugin-workflow): fix schedule config component witdh (#2461) --- .../src/client/triggers/schedule/RepeatField.tsx | 13 +++++++++++-- .../src/client/triggers/schedule/ScheduleConfig.tsx | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/plugins/workflow/src/client/triggers/schedule/RepeatField.tsx b/packages/plugins/workflow/src/client/triggers/schedule/RepeatField.tsx index b96b409d8..fabcbee5b 100644 --- a/packages/plugins/workflow/src/client/triggers/schedule/RepeatField.tsx +++ b/packages/plugins/workflow/src/client/triggers/schedule/RepeatField.tsx @@ -25,9 +25,10 @@ function getNumberOption(v) { } function getRepeatTypeValue(v) { + let option; switch (typeof v) { case 'number': - const option = getNumberOption(v); + option = getNumberOption(v); return option ? option.value : 'none'; case 'string': return 'cron'; @@ -48,6 +49,7 @@ function CommonRepeatField({ value, onChange }) { min={1} addonBefore={t('Every')} addonAfter={t(option.unitText)} + className="auto-width" /> ); } @@ -78,6 +80,7 @@ export function RepeatField({ value = null, onChange }) { gap: 0.5em; .react-js-cron { + width: 100%; padding: 0.5em 0.5em 0 0.5em; border: 1px dashed #ccc; @@ -92,10 +95,16 @@ export function RepeatField({ value = null, onChange }) { margin: 0 0.5em 0 0; } } + + .react-js-cron-week-days { + > span { + min-width: 2em; + } + } } `} > - {RepeatOptions.map((item) => ( {t(item.text)} diff --git a/packages/plugins/workflow/src/client/triggers/schedule/ScheduleConfig.tsx b/packages/plugins/workflow/src/client/triggers/schedule/ScheduleConfig.tsx index 5603c19af..6a81facbe 100644 --- a/packages/plugins/workflow/src/client/triggers/schedule/ScheduleConfig.tsx +++ b/packages/plugins/workflow/src/client/triggers/schedule/ScheduleConfig.tsx @@ -203,7 +203,8 @@ export const ScheduleConfig = () => { 'x-component-props': { className: css` .ant-input-number { - width: 4em; + width: auto; + min-width: 6em; } .ant-picker {