-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,101 additions
and
455 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,5 +22,6 @@ header: | |
- '**/*.svg' | ||
- '**/*.css' | ||
- '**/*.conf' | ||
- '**/*.properties' | ||
|
||
comment: on-failure |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"sonarCloudOrganization": "gridsuite", | ||
"projectKey": "gridsuite_gridstudy-app" | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sonar.projectKey=gridsuite_gridstudy-app | ||
sonar.organization=gridsuite | ||
sonar.projectBaseDir=src | ||
sonar.javascript.lcov.reportPaths=./coverage/lcov.info |
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
78 changes: 78 additions & 0 deletions
78
src/components/dialogs/connectivity/branch-connectivity-form.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* Copyright (c) 2024, 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 { Grid } from '@mui/material'; | ||
import { gridItem, GridSection } from '../dialogUtils'; | ||
import { ConnectivityForm } from './connectivity-form'; | ||
import { CONNECTIVITY, CONNECTIVITY_1, CONNECTIVITY_2 } from 'components/utils/field-constants'; | ||
import React, { FunctionComponent } from 'react'; | ||
import useVoltageLevelsListInfos from '../../../hooks/use-voltage-levels-list-infos'; | ||
import { CurrentTreeNode } from '../../../redux/reducer'; | ||
import { UUID } from 'crypto'; | ||
|
||
interface BranchConnectivityFormProps { | ||
currentNode: CurrentTreeNode; | ||
studyUuid: UUID; | ||
isModification?: boolean; | ||
previousValues?: any; | ||
} | ||
|
||
const BranchConnectivityForm: FunctionComponent<BranchConnectivityFormProps> = ({ | ||
currentNode, | ||
studyUuid, | ||
isModification = false, | ||
previousValues, | ||
}) => { | ||
const voltageLevelOptions = useVoltageLevelsListInfos(studyUuid, currentNode.id); | ||
const id1 = `${CONNECTIVITY}.${CONNECTIVITY_1}`; | ||
const id2 = `${CONNECTIVITY}.${CONNECTIVITY_2}`; | ||
|
||
const connectivity1Field = ( | ||
<ConnectivityForm | ||
id={id1} | ||
studyUuid={studyUuid} | ||
currentNode={currentNode} | ||
voltageLevelOptions={voltageLevelOptions} | ||
withPosition={true} | ||
isEquipmentModification={isModification} | ||
previousValues={{ | ||
connectablePosition: previousValues?.connectablePosition1, | ||
terminalConnected: previousValues?.terminal1Connected, | ||
}} | ||
/> | ||
); | ||
|
||
const connectivity2Field = ( | ||
<ConnectivityForm | ||
id={id2} | ||
studyUuid={studyUuid} | ||
currentNode={currentNode} | ||
voltageLevelOptions={voltageLevelOptions} | ||
withPosition={true} | ||
isEquipmentModification={isModification} | ||
previousValues={{ | ||
connectablePosition: previousValues?.connectablePosition2, | ||
terminalConnected: previousValues?.terminal2Connected, | ||
}} | ||
/> | ||
); | ||
|
||
return ( | ||
<> | ||
<GridSection title="Side1" heading="4" /> | ||
<Grid container spacing={2}> | ||
{gridItem(connectivity1Field, 12)} | ||
</Grid> | ||
<GridSection title="Side2" heading="4" /> | ||
<Grid container spacing={2}> | ||
{gridItem(connectivity2Field, 12)} | ||
</Grid> | ||
</> | ||
); | ||
}; | ||
|
||
export default BranchConnectivityForm; |
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
Oops, something went wrong.