feat(fluxWizard): reset asceding tag selectors when loading keys

pull/5852/head
Pavel Zavora 2022-02-01 10:12:09 +01:00
parent 28e09c792c
commit 19c5831123
1 changed files with 18 additions and 3 deletions

View File

@ -95,9 +95,24 @@ const aggregationReducer = (
}))
}
case 'FQB_TAG_KEY_STATUS': {
return changeTagSelector(state, action.payload.tagIndex, () => ({
keysStatus: action.payload.status,
}))
const {tagIndex, status} = action.payload
if (state[tagIndex] === undefined) {
return state
}
state[tagIndex] = {
...state[tagIndex],
keysStatus: status,
}
if (status === RemoteDataState.Loading) {
state[tagIndex].valuesStatus = RemoteDataState.NotStarted
for (let i = tagIndex + 1; i < state.length; i++) {
state[i] = {
...state[i],
keysStatus: RemoteDataState.NotStarted,
}
}
}
return [...state]
}
case 'FQB_TAG_VALUES_STATUS': {
return changeTagSelector(state, action.payload.tagIndex, () => ({