Skip to content

Commit

Permalink
Web console: Fix concurrent tasks (#15649)
Browse files Browse the repository at this point in the history
* Improve handling of concurrent tasks option

* Update snapshots
  • Loading branch information
vogievetsky authored Jan 10, 2024
1 parent 747d973 commit 85b8cf9
Show file tree
Hide file tree
Showing 6 changed files with 1,356 additions and 1,382 deletions.
10 changes: 2 additions & 8 deletions web-console/src/components/auto-form/auto-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ export interface Field<M> {
hide?: Functor<M, boolean>;
hideInMore?: Functor<M, boolean>;
valueAdjustment?: (value: any) => any;
/**
* An optional callback to transform the value before it is set on the input
*/
adjustValue?: (value: any) => any;
adjustment?: (model: Partial<M>, oldModel: Partial<M>) => Partial<M>;
issueWithValue?: (value: any) => string | undefined;

Expand Down Expand Up @@ -382,14 +378,12 @@ export class AutoForm<T extends Record<string, any>> extends React.PureComponent
const disabled = AutoForm.evaluateFunctor(field.disabled, model, false);
const intent = required && modelValue == null ? AutoForm.REQUIRED_INTENT : undefined;

const adjustedValue = field.adjustValue ? field.adjustValue(shownValue) : shownValue;

return (
<ButtonGroup large={large}>
<Button
intent={intent}
disabled={disabled}
active={adjustedValue === false}
active={shownValue === false}
onClick={() => {
this.fieldChange(field, false);
if (onFinalize) onFinalize();
Expand All @@ -400,7 +394,7 @@ export class AutoForm<T extends Record<string, any>> extends React.PureComponent
<Button
intent={intent}
disabled={disabled}
active={adjustedValue === true}
active={shownValue === true}
onClick={() => {
this.fieldChange(field, true);
if (onFinalize) onFinalize();
Expand Down
Loading

0 comments on commit 85b8cf9

Please sign in to comment.