Skip to content

Commit

Permalink
disable update button if mml not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
alvarezmelissa87 committed Jul 6, 2020
1 parent ffedb7c commit 9ac1b43
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ export const EditAnalyticsFlyout: FC<EditAnalyticsJobFlyoutProps> = ({ closeFlyo
const { id: jobId, config } = item;
const { state } = item.stats;

// Disable if all fields are empty or mml is not valid
const updateButtonDisabled =
allowLazyStart === '' && description === '' && modelMemoryLimit === '';
(allowLazyStart === '' && description === '' && modelMemoryLimit === '') ||
mmlValidationError !== undefined;

useEffect(() => {
if (mmLValidator === undefined) {
Expand Down Expand Up @@ -176,7 +178,9 @@ export const EditAnalyticsFlyout: FC<EditAnalyticsJobFlyoutProps> = ({ closeFlyo
]}
value={allowLazyStart}
hasNoInitialSelection={true}
onChange={(e: any) => setAllowLazyStart(e.target.value)}
onChange={(e: React.ChangeEvent<HTMLSelectElement>) =>
setAllowLazyStart(e.target.value)
}
/>
</EuiFormRow>
<EuiFormRow
Expand Down

0 comments on commit 9ac1b43

Please sign in to comment.