Skip to content

Commit 66cc80a

Browse files
author
Sandeep Kumawat
committed
Bug Fixes in Snapshot Policy: Schedule Editing and Index Expression Display
Signed-off-by: Sandeep Kumawat <[email protected]>
1 parent 2d7c80b commit 66cc80a

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

public/pages/CreateSnapshotPolicy/components/CronSchedule/CronSchedule.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,20 @@ const CronSchedule = ({
8888

8989
function onDayOfWeekChange(dayOfWeek: string) {
9090
setWeek(dayOfWeek);
91-
// changeCron({ dayOfWeek });
91+
changeCron({ dayOfWeek });
9292
}
9393

9494
function onDayOfMonthChange(dayOfMonth: number) {
9595
setMonth(dayOfMonth);
96-
// changeCron({ dayOfMonth });
96+
changeCron({ dayOfMonth });
9797
}
9898

9999
function onStartTimeChange(date: moment.Moment) {
100100
const minute = date.minute();
101101
const hour = date.hour();
102102
setMinute(minute);
103103
setHour(hour);
104-
// changeCron({ minute, hour });
104+
changeCron({ minute, hour });
105105
}
106106

107107
function onTypeChange(e: ChangeEvent<HTMLSelectElement>) {

public/pages/CreateSnapshotPolicy/containers/CreateSnapshotPolicy/CreateSnapshotPolicy.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class CreateSnapshotPolicy extends MDSEnabledComponent<CreateSMPolicyProp
477477
const selectedIndexOptions = [...this.state.selectedIndexOptions, newOption];
478478
this.setState({
479479
selectedIndexOptions: selectedIndexOptions,
480-
policy: this.setPolicyHelper("snapshot_config.indices", selectedIndexOptions.toString()),
480+
policy: this.setPolicyHelper("snapshot_config.indices", selectedIndexOptions.map((option) => option.label).join(", ")),
481481
});
482482
};
483483

@@ -1002,6 +1002,10 @@ export class CreateSnapshotPolicy extends MDSEnabledComponent<CreateSMPolicyProp
10021002
this.setState({ policy: this.setPolicyHelper("snapshot_config.partial", e.target.checked) });
10031003
};
10041004

1005+
onIndicesToggle = (e: ChangeEvent<HTMLInputElement>) => {
1006+
this.setState({ policy: this.setPolicyHelper("snapshot_config.partial", e.target.checked) });
1007+
};
1008+
10051009
setPolicyHelper = (path: string, newValue: any) => {
10061010
return _.set(this.state.policy, path, newValue);
10071011
};

0 commit comments

Comments
 (0)