refactor: renomme rawSituationSelector on completeSituationSelector

pull/3115/head
Jalil Arfaoui 2024-06-26 17:59:47 +02:00
parent d24a6ff856
commit 490d52a79a
3 changed files with 7 additions and 7 deletions

View File

@ -12,9 +12,9 @@ import { useDispatch, useSelector } from 'react-redux'
import { deleteFromSituation } from '@/store/actions/actions'
import {
companySituationSelector,
completeSituationSelector,
configObjectifsSelector,
configSituationSelector,
rawSituationSelector,
situationSelector,
} from '@/store/selectors/simulationSelectors'
import { omit } from '@/utils'
@ -80,7 +80,7 @@ export function useEngine() {
return useContext(EngineContext) as Engine<DottedName>
}
export const useRawSituation = () => useSelector(rawSituationSelector)
export const useRawSituation = () => useSelector(completeSituationSelector)
/**
* Try to set situation and delete all rules with syntax/evaluation error

View File

@ -17,7 +17,7 @@ import {
} from '@/store/reducers/rootReducer'
import { Simulation } from '@/store/reducers/simulation.reducer'
import {
rawSituationSelector,
completeSituationSelector,
rawSituationsSelonContextesSelector,
} from '@/store/selectors/simulationSelectors'
import { complement } from '@/utils/complement'
@ -38,7 +38,7 @@ export const prendLaProchaineQuestionMiddleware =
const simulation = newState.simulation
const config = simulation?.config
const situation = rawSituationSelector(newState)
const situation = completeSituationSelector(newState)
const questionsRépondues = simulation?.answeredQuestions
const questionsSuivantesActuelles = simulation?.questionsSuivantes || []

View File

@ -1,9 +1,9 @@
import { NonEmptyArray } from 'effect/Array'
import { createSelector } from 'reselect'
import { isComparateurConfig } from '@/domaine/ComparateurConfig'
import { RootState, Situation } from '@/store/reducers/rootReducer'
import { configSelector } from '@/store/selectors/config.selector'
import { NonEmptyArray } from 'effect/Array'
export const configObjectifsSelector = createSelector(
[
@ -32,7 +32,7 @@ export const configContextesSelector = createSelector(
export const companySituationSelector = (state: RootState) =>
state.companySituation
export const rawSituationSelector = createSelector(
export const completeSituationSelector = createSelector(
[situationSelector, configSituationSelector, companySituationSelector],
(simulatorSituation, configSituation, companySituation) => ({
...companySituation,
@ -42,7 +42,7 @@ export const rawSituationSelector = createSelector(
)
export const rawSituationsSelonContextesSelector = createSelector(
[rawSituationSelector, configContextesSelector],
[completeSituationSelector, configContextesSelector],
(rawSituation, contextes) =>
(contextes
? contextes.map((contexte) => ({