-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor refactoring and fix bugs/issues with atoms
Issues/bugs with atoms due to incorrect import/initialization in loadModule and registerModule
- Loading branch information
1 parent
9b94e94
commit 70fb156
Showing
14 changed files
with
119 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
frontend/src/modules/SimulationTimeSeriesSensitivity/loadModule.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 0 additions & 85 deletions
85
frontend/src/modules/SimulationTimeSeriesSensitivity/queryHooks.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...src/modules/SimulationTimeSeriesSensitivity/view/hooks/useMakeViewStatusWriterMessages.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { ViewStatusWriter } from "@framework/StatusWriter"; | ||
|
||
import { useAtomValue } from "jotai"; | ||
|
||
import { showHistoricalAtom, showStatisticsAtom } from "../atoms/baseAtoms"; | ||
import { | ||
historicalVectorDataQueryAtom, | ||
statisticalVectorSensitivityDataQueryAtom, | ||
vectorDataQueryAtom, | ||
} from "../atoms/queryAtoms"; | ||
|
||
export function useMakeViewStatusWriterMessages(statusWriter: ViewStatusWriter) { | ||
const vectorDataQuery = useAtomValue(vectorDataQueryAtom); | ||
const statisticalVectorSensitivityDataQuery = useAtomValue(statisticalVectorSensitivityDataQueryAtom); | ||
const historicalVectorDataQuery = useAtomValue(historicalVectorDataQueryAtom); | ||
const showStatistics = useAtomValue(showStatisticsAtom); | ||
const showHistorical = useAtomValue(showHistoricalAtom); | ||
|
||
const isAnyQueryFetching = | ||
vectorDataQuery.isFetching || | ||
statisticalVectorSensitivityDataQuery.isFetching || | ||
historicalVectorDataQuery.isFetching; | ||
statusWriter.setLoading(isAnyQueryFetching); | ||
|
||
if (vectorDataQuery.isError) { | ||
statusWriter.addError("Realization data query has error state."); | ||
} | ||
if (showStatistics && statisticalVectorSensitivityDataQuery.isError) { | ||
statusWriter.addError("Statistics data per sensitivity query has error state."); | ||
} | ||
if (showHistorical && historicalVectorDataQuery.isError) { | ||
statusWriter.addWarning("Historical data query has error state."); | ||
} | ||
} |
Oops, something went wrong.