Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions web-console/src/components/auto-form/auto-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface Field<M> {
| 'json'
| 'interval';
defaultValue?: any;
emptyValue?: any;
suggestions?: Functor<M, Suggestion[]>;
placeholder?: string;
min?: number;
Expand Down Expand Up @@ -99,10 +100,16 @@ export class AutoForm<T extends Record<string, any>> extends React.PureComponent
const { model } = this.props;
if (!model) return;

const newModel =
typeof newValue === 'undefined'
? deepDelete(model, field.name)
: deepSet(model, field.name, newValue);
let newModel: T;
if (typeof newValue === 'undefined') {
if (typeof field.emptyValue === 'undefined') {
newModel = deepDelete(model, field.name);
} else {
newModel = deepSet(model, field.name, field.emptyValue);
}
} else {
newModel = deepSet(model, field.name, newValue);
}

this.modelChange(newModel);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export class CoordinatorDynamicConfigDialog extends React.PureComponent<
{
name: 'killDataSourceWhitelist',
type: 'string-array',
emptyValue: [],
info: (
<>
List of dataSources for which kill tasks are sent if property{' '}
Expand All @@ -191,6 +192,7 @@ export class CoordinatorDynamicConfigDialog extends React.PureComponent<
{
name: 'killPendingSegmentsSkipList',
type: 'string-array',
emptyValue: [],
info: (
<>
List of dataSources for which pendingSegments are NOT cleaned up if property{' '}
Expand Down Expand Up @@ -259,6 +261,7 @@ export class CoordinatorDynamicConfigDialog extends React.PureComponent<
{
name: 'decommissioningNodes',
type: 'string-array',
emptyValue: [],
info: (
<>
List of historical services to 'decommission'. Coordinator will not assign new
Expand Down