Skip to content

Commit

Permalink
Merge branch '2.x' into backport/backport-1207-to-2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
RamakrishnaChilaka authored Dec 16, 2024
2 parents 0a8197e + d8c01a4 commit 450a29a
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr
include_global_state: snapshot?.include_global_state,
rename_pattern: pattern,
rename_replacement: renameIndices === add_prefix ? `${prefix}$1` : renameReplacement,
include_aliases: snapshot?.restore_aliases ? snapshot.restore_aliases : true,
include_aliases: snapshot?.restore_aliases !== undefined ? snapshot.restore_aliases : true,
partial: snapshot?.partial || false,
};
let repoError = "";
Expand Down Expand Up @@ -289,13 +289,24 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr
};

onToggle = (e: ChangeEvent<HTMLInputElement>) => {
const { restore_specific_indices, restore_all_indices, customize_index_settings, ignore_index_settings } = RESTORE_OPTIONS;
const {
restore_specific_indices,
restore_all_indices,
customize_index_settings,
ignore_index_settings,
restore_aliases,
} = RESTORE_OPTIONS;

if (e.target.id === restore_specific_indices) {
this.setState({ restoreSpecific: true, snapshot: _.set(this.state.snapshot!, e.target.id, e.target.checked) });
return;
}

if (e.target.id === restore_aliases) {
this.setState({ snapshot: _.set(this.state.snapshot!, e.target.id, e.target.checked) });
return;
}

if (e.target.id === restore_all_indices) {
this.setState({
restoreSpecific: false,
Expand Down Expand Up @@ -482,7 +493,7 @@ export class RestoreSnapshotFlyout extends MDSEnabledComponent<RestoreSnapshotPr

<SnapshotRestoreAdvancedOptions
getIndexSettings={this.getIndexSettings}
restoreAliases={String(_.get(snapshot, restore_aliases, true)) == "true"}
restoreAliases={String(_.get(snapshot, restore_aliases, false)) == "true"}
onRestoreAliasesToggle={this.onToggle}
restoreClusterState={String(_.get(snapshot, include_global_state, false)) == "true"}
onRestoreClusterStateToggle={this.onToggle}
Expand Down

0 comments on commit 450a29a

Please sign in to comment.