Repository navigation
feat(LogicalControls): change to distinct and async computation #4257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dbraquart
wants to merge
17
commits into
main
Choose a base branch
from
dbraquart/add-logical-controls-as-distinct-async-computation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+807
−704
Open
Changes from 9 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
eb01f82
clean unused label
dbraquart 3b61750
wip run + status ok, todo results
dbraquart a1d63ff
wip results
dbraquart 08cbb32
copy table fron sync to async results
dbraquart 608fbee
rm resultAvailable
dbraquart e78ee7a
rm previous sync mode
dbraquart 076a758
Merge branch 'main' into dbraquart/add-logical-controls-as-distinct-a…
dbraquart c12a089
test csv download with tooltip
dbraquart f8bc831
use proper TableType
dbraquart dee0119
add cancel
dbraquart 74fd833
refactor results to work like estim
dbraquart faf9fee
rm unused hook (old computations counter)
dbraquart 6fc1cca
clean: compact code
dbraquart b9b1280
Merge branch 'main' into dbraquart/add-logical-controls-as-distinct-a…
dbraquart 2158f08
no need to change run button
dbraquart 2e1a89f
Merge remote-tracking branch 'origin/main' into dbraquart/add-logical…
dbraquart ed1648a
add sort & filter
dbraquart File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
58 changes: 58 additions & 0 deletions
58
src/components/results/logicalcontrols/logical-controls-result-tab.tsx
This file contains hidden or 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,58 @@ | ||
| /** | ||
| * Copyright (c) 2026, RTE (http://www.rte-france.com) | ||
| * This Source Code Form is subject to the terms of the Mozilla Public | ||
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
| */ | ||
|
|
||
| import { FunctionComponent, useMemo } from 'react'; | ||
| import type { UUID } from 'node:crypto'; | ||
| import { useSelector } from 'react-redux'; | ||
| import { ComputingType, RunningStatus } from '@gridsuite/commons-ui'; | ||
| import { AppState } from 'redux/reducer.type'; | ||
| import { useNodeData } from 'components/use-node-data'; | ||
| import { fetchLogicalControlsResult } from '../../../services/study/state-estimation'; | ||
| import { logicalControlsResultInvalidations } from '../../computing-status/use-all-computing-status'; | ||
| import { LogicalControlsResult } from './logical-controls-result'; | ||
|
|
||
| interface LogicalControlsResultTabProps { | ||
| studyUuid: UUID; | ||
| nodeUuid: UUID; | ||
| currentRootNetworkUuid: UUID; | ||
| } | ||
|
|
||
| export const LogicalControlsResultTab: FunctionComponent<LogicalControlsResultTabProps> = ({ | ||
| studyUuid, | ||
| nodeUuid, | ||
| currentRootNetworkUuid, | ||
| }) => { | ||
| const logicalControlsStatus = useSelector( | ||
| (state: AppState) => state.computingStatus[ComputingType.LOGICAL_CONTROLS] | ||
| ); | ||
|
|
||
| const { result: logicalControlsResult, isLoading: isLoadingResult } = useNodeData({ | ||
| studyUuid, | ||
| nodeUuid, | ||
| rootNetworkUuid: currentRootNetworkUuid, | ||
| fetcher: fetchLogicalControlsResult, | ||
| invalidations: logicalControlsResultInvalidations, | ||
| }); | ||
|
|
||
| const isComputationDone = | ||
| logicalControlsStatus === RunningStatus.SUCCEED || logicalControlsStatus === RunningStatus.FAILED; | ||
| const isRunning = | ||
| logicalControlsStatus === RunningStatus.RUNNING || logicalControlsStatus === RunningStatus.PRELOADING; | ||
|
|
||
| const result = useMemo( | ||
| () => (isComputationDone && logicalControlsResult ? logicalControlsResult : undefined), | ||
| [isComputationDone, logicalControlsResult] | ||
| ); | ||
|
|
||
| return ( | ||
| <LogicalControlsResult | ||
| result={result} | ||
| isLoadingResult={isRunning || isLoadingResult} | ||
| exportCsvResetKey={`${studyUuid}-${nodeUuid}-${currentRootNetworkUuid}`} | ||
| /> | ||
| ); | ||
| }; | ||
This file contains hidden or 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 hidden or 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
File renamed without changes.
File renamed without changes.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: gridsuite/gridstudy-app
Length of output: 6103
🏁 Script executed:
Repository: gridsuite/gridstudy-app
Length of output: 43837
🏁 Script executed:
Repository: gridsuite/gridstudy-app
Length of output: 13117
Do not present a previous result after a failed rerun.
LogicalControlsResultTabdisplays the cached result when the status isFAILED. The failed notification updates the computation status, butuseNodeDataonly refetches forLOGICAL_CONTROLS_RESULTand does not clear its result forLOGICAL_CONTROLS_FAILED. ExcludeFAILEDfrom the display condition, or clear the result when a new run starts.Suggested fix
🤖 Prompt for AI Agents