From 9ca10c7bd7a5e963711aef0490ac0355976cd399 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien?= Date: Fri, 13 Oct 2023 11:33:39 -0400 Subject: [PATCH] Added concurrent compaction switches (#15114) * Added concurrent compaction switches --- .../src/components/auto-form/auto-form.tsx | 10 ++++- .../compaction-config-dialog.spec.tsx.snap | 44 +++++++++++++++++++ .../compaction-config/compaction-config.tsx | 9 ++++ .../ingestion-spec/ingestion-spec.tsx | 6 +++ .../views/load-data-view/load-data-view.tsx | 13 ++++++ 5 files changed, 80 insertions(+), 2 deletions(-) diff --git a/web-console/src/components/auto-form/auto-form.tsx b/web-console/src/components/auto-form/auto-form.tsx index 357046876af..c63f7a7bc50 100644 --- a/web-console/src/components/auto-form/auto-form.tsx +++ b/web-console/src/components/auto-form/auto-form.tsx @@ -72,6 +72,10 @@ export interface Field { hide?: Functor; hideInMore?: Functor; 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, oldModel: Partial) => Partial; issueWithValue?: (value: any) => string | undefined; @@ -378,12 +382,14 @@ export class AutoForm> 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 (