-
Notifications
You must be signed in to change notification settings - Fork 4
Paginate filter sort pccmin results #3419
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
souissimai
wants to merge
44
commits into
main
Choose a base branch
from
paginate_filter_sort_pccmin_results
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.
+791
−165
Open
Changes from 25 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
1694603
launch, stop pcc min N-1 computation
2898804
Merge branch 'main' into add_pcc_min_computation
souissimai ecc3433
Merge branch 'main' into add_pcc_min_computation
souissimai 93b0692
Merge branch 'main' into add_pcc_min_computation
souissimai f2f4c7a
Merge branch 'main' into add_pcc_min_computation
souissimai 20a9130
Merge branch 'main' into add_pcc_min_computation
souissimai eabcb27
Merge branch 'main' into add_pcc_min_computation
souissimai 514fff3
fix
b4cb57e
asjust
958e9a7
imports
30b00a1
add pcc min results and logs
bb7c0b6
Merge branch 'add_pcc_min_computation' into pcc_min_results_logs
souissimai faafade
add pcc min results and logs
c258809
paginates filtred sorted results
190f167
resolve conflicts
bc6b5bb
add download csv results
64a113e
refactoring
32f05c5
refactoring ..
bdd560f
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai eb65c75
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai dca1487
refactoring
55c7df0
increase duplication code
fc1b96e
fixes
c8a4a47
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai c0305c0
fix
dca5a30
fix filter for x and r
b4c53d5
adjust filterable equipment types
22805ba
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai 679da25
review changes
9b4b052
fix
e48ac68
fix
f8644e1
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai ca2c3c3
revert
5bb700e
prettiers
ed132f0
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai 63902d2
fix
7c25f45
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai 87288ec
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai 106cc50
refactoring
e9b4377
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai 2df67d9
Merge branch 'main' into paginate_filter_sort_pccmin_results
souissimai a1f36a0
refactor code
3eaef38
refactor code
e8cd4a3
duplicated code
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| /** | ||
| * Copyright (c) 2025, 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 { Box, LinearProgress, Tab, Tabs } from '@mui/material'; | ||
| import { FunctionComponent, useCallback, useEffect, useMemo, useState } from 'react'; | ||
| import { FormattedMessage } from 'react-intl'; | ||
| import { ComputationReportViewer } from '../common/computation-report-viewer'; | ||
|
|
||
| import { useSelector } from 'react-redux'; | ||
| import { AppState } from '../../../redux/reducer'; | ||
| import { ComputingType } from '@gridsuite/commons-ui'; | ||
| import { RunningStatus } from '../../utils/running-status'; | ||
| import { useOpenLoaderShortWait } from '../../dialogs/commons/handle-loader'; | ||
| import { RESULTS_LOADING_DELAY } from '../../network/constants'; | ||
| import GlobalFilterSelector from '../common/global-filter/global-filter-selector'; | ||
| import { EQUIPMENT_TYPES } from '../../utils/equipment-types'; | ||
| import useGlobalFilters, { isGlobalFilterParameter } from '../common/global-filter/use-global-filters'; | ||
| import { useGlobalFilterOptions } from '../common/global-filter/use-global-filter-options'; | ||
| import { PccMinResultTabProps } from './pcc-min-result.type'; | ||
| import { PccMinResult } from './pcc-min-result'; | ||
|
|
||
| export const PccMinResultTab: FunctionComponent<PccMinResultTabProps> = ({ | ||
| studyUuid, | ||
| nodeUuid, | ||
| currentRootNetworkUuid, | ||
| }) => { | ||
| const [resultOrLogIndex, setResultOrLogIndex] = useState(0); | ||
|
|
||
| const pccMinStatus = useSelector((state: AppState) => state.computingStatus[ComputingType.PCC_MIN]); | ||
|
|
||
| const RESULTS_TAB_INDEX = 0; | ||
| const LOGS_TAB_INDEX = 1; | ||
|
|
||
| const { globalFilters, handleGlobalFilterChange } = useGlobalFilters(); | ||
| const { countriesFilter, voltageLevelsFilter, propertiesFilter } = useGlobalFilterOptions(); | ||
|
|
||
| const handleSubTabChange = useCallback( | ||
| (event: React.SyntheticEvent, newIndex: number) => { | ||
| setResultOrLogIndex(newIndex); | ||
| }, | ||
| [setResultOrLogIndex] | ||
souissimai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ); | ||
|
|
||
| const openLoader = useOpenLoaderShortWait({ | ||
| isLoading: pccMinStatus === RunningStatus.RUNNING, | ||
| delay: RESULTS_LOADING_DELAY, | ||
| }); | ||
|
|
||
| const filterableEquipmentTypes: EQUIPMENT_TYPES[] = useMemo(() => { | ||
| return [EQUIPMENT_TYPES.VOLTAGE_LEVEL]; | ||
| }, []); | ||
|
|
||
| useEffect(() => { | ||
| // Clear the globalfilter when tab changes | ||
| handleGlobalFilterChange([]); | ||
| }, [handleGlobalFilterChange]); | ||
|
|
||
| const globalFilterOptions = useMemo( | ||
| () => [...voltageLevelsFilter, ...countriesFilter, ...propertiesFilter], | ||
| [voltageLevelsFilter, countriesFilter, propertiesFilter] | ||
| ); | ||
|
|
||
| return ( | ||
| <Box sx={{ display: 'flex', flexDirection: 'column', height: '100%' }}> | ||
| <Box sx={{ display: 'flex', alignItems: 'center', gap: 2, flexShrink: 0, mb: 1 }}> | ||
| <Tabs value={resultOrLogIndex} onChange={handleSubTabChange}> | ||
| <Tab label={<FormattedMessage id="Results" />} /> | ||
| <Tab label={<FormattedMessage id="ComputationResultsLogs" />} /> | ||
| </Tabs> | ||
| {resultOrLogIndex === RESULTS_TAB_INDEX && ( | ||
| <Box sx={{ flex: 1 }}> | ||
| <GlobalFilterSelector | ||
| onChange={handleGlobalFilterChange} | ||
| filters={globalFilterOptions} | ||
| filterableEquipmentTypes={filterableEquipmentTypes} | ||
| genericFiltersStrictMode | ||
| /> | ||
| </Box> | ||
| )} | ||
| </Box> | ||
|
|
||
| <Box sx={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0 }}> | ||
| {resultOrLogIndex === RESULTS_TAB_INDEX && ( | ||
| <Box sx={{ flex: 1, minHeight: 0 }}> | ||
| <PccMinResult | ||
| studyUuid={studyUuid} | ||
| nodeUuid={nodeUuid} | ||
| currentRootNetworkUuid={currentRootNetworkUuid} | ||
| globalFilters={isGlobalFilterParameter(globalFilters) ? globalFilters : undefined} | ||
| customTablePaginationProps={{ | ||
| labelRowsPerPageId: 'muiTablePaginationLabelRowsPerPage', | ||
| }} | ||
| /> | ||
| </Box> | ||
| )} | ||
|
|
||
| {resultOrLogIndex === LOGS_TAB_INDEX && ( | ||
| <> | ||
| {openLoader && <LinearProgress sx={{ height: 4, flexShrink: 0 }} />} | ||
| {(pccMinStatus === RunningStatus.SUCCEED || pccMinStatus === RunningStatus.FAILED) && ( | ||
| <Box sx={{ flex: 1, minHeight: 0 }}> | ||
| <ComputationReportViewer reportType={ComputingType.PCC_MIN} /> | ||
| </Box> | ||
| )} | ||
| </> | ||
| )} | ||
| </Box> | ||
| </Box> | ||
| ); | ||
| }; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.