HMS-3796: Add snapshot date selection to wizard

This commit is contained in:
Andrew Dewar 2024-04-17 15:32:29 -06:00 committed by Lucas Garfield
parent a97b4d082d
commit 3231b324f0
42 changed files with 1958 additions and 257 deletions

View file

@ -77,6 +77,10 @@ export type wizardState = {
partitions: Partition[];
isNextButtonTouched: boolean;
};
snapshotting: {
useLatest: boolean;
snapshotDate: string;
};
repositories: {
customRepositories: CustomRepository[];
payloadRepositories: Repository[];
@ -136,6 +140,10 @@ const initialState: wizardState = {
partitions: [],
isNextButtonTouched: true,
},
snapshotting: {
useLatest: true,
snapshotDate: '',
},
repositories: {
customRepositories: [],
payloadRepositories: [],
@ -241,6 +249,13 @@ export const selectPartitions = (state: RootState) => {
return state.wizard.fileSystem.partitions;
};
export const selectUseLatest = (state: RootState) => {
return state.wizard.snapshotting.useLatest;
};
export const selectSnapshotDate = (state: RootState) => {
return state.wizard.snapshotting.snapshotDate;
};
export const selectCustomRepositories = (state: RootState) => {
return state.wizard.repositories.customRepositories;
};
@ -505,6 +520,12 @@ export const wizardSlice = createSlice({
state.fileSystem.partitions[partitionIndex].min_size = min_size;
}
},
changeUseLatest: (state, action: PayloadAction<boolean>) => {
state.snapshotting.useLatest = action.payload;
},
changeSnapshotDate: (state, action: PayloadAction<string>) => {
state.snapshotting.snapshotDate = action.payload;
},
changeCustomRepositories: (
state,
action: PayloadAction<CustomRepository[]>
@ -624,6 +645,8 @@ export const {
changePartitionUnit,
changePartitionMinSize,
changePartitionOrder,
changeUseLatest,
changeSnapshotDate,
changeCustomRepositories,
changePayloadRepositories,
addRecommendedRepository,