Skip to content
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

Upgrade to powsybl-network-viewer 1.2.0 #2414

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@
"@mui/lab": "5.0.0-alpha.169",
"@mui/material": "^5.15.14",
"@mui/x-tree-view": "^6.17.0",
"@powsybl/network-viewer": "1.1.1",
"@powsybl/network-viewer": "file:../../../~powsybl/powsybl-diagram-viewer/powsybl-network-viewer-1.2.0.tgz",
"@reduxjs/toolkit": "^2.2.3",
"@svgdotjs/svg.js": "^3.2.0",
"@svgdotjs/svg.panzoom.js": "^2.1.2",
"@xyflow/react": "^12.3.2",
"ag-grid-community": "^31.0.0",
"ag-grid-react": "^31.2.0",
"cheap-ruler": "^3.0.2",
Expand All @@ -35,7 +36,6 @@
"react-beautiful-dnd": "^13.1.1",
"react-csv-downloader": "^3.1.0",
"react-dom": "^18.2.0",
"@xyflow/react": "^12.3.2",
"react-grid-layout": "^1.4.4",
"react-hook-form": "^7.51.2",
"react-intl": "^6.6.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function SingleLineDiagramContent(props: SingleLineDiagramContentProps) {
handleOpenModificationDialog={handleOpenModificationDialog}
onOpenDynamicSimulationEventDialog={handleOpenDynamicSimulationEventDialog}
currentNode={currentNode}
studyUuid={studyUuid as UUID}
studyUuid={studyUuid}
modificationInProgress={modificationInProgress}
setModificationInProgress={setModificationInProgress}
/>
Expand All @@ -430,11 +430,7 @@ function SingleLineDiagramContent(props: SingleLineDiagramContentProps) {
equipmentMenu.equipmentId &&
equipmentMenu.equipmentType === equipmentType && (
<Menu
equipment={
{
id: equipmentMenu.equipmentId,
} as MapEquipment
}
equipment={{ id: equipmentMenu.equipmentId } as MapEquipment}
equipmentType={convertToEquipmentType(equipmentMenu.equipmentType)}
position={equipmentMenu.position}
handleClose={closeEquipmentMenu}
Expand Down
2 changes: 0 additions & 2 deletions src/components/map-viewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ const MapViewer = ({
tableEquipment,
onTableEquipementChanged,
onChangeTab,
setErrorMessage,
}) => {
const networkMapref = useRef(null); // hold the reference to the network map (from powsybl-network-viewer)
const dispatch = useDispatch();
Expand Down Expand Up @@ -323,7 +322,6 @@ const MapViewer = ({
currentNode={currentNode}
onChangeTab={onChangeTab}
showInSpreadsheet={showInSpreadsheet}
setErrorMessage={setErrorMessage}
onDrawPolygonModeActive={onDrawingModeEnter}
onPolygonChanged={() => {}}
onDrawEvent={onDrawEvent}
Expand Down
2 changes: 1 addition & 1 deletion src/components/menus/base-equipment-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const ItemViewInForm = ({
);
};

// Temporary type definition for VoltageLevel Equipment, pending a more comprehensive Equipment typing in diagramViewer
// TODO: Temporary type definition for VoltageLevel Equipment, pending a more comprehensive Equipment typing in diagramViewer
export type MapEquipment = Equipment & {
substationId: string;
substationName: string;
Expand Down
16 changes: 6 additions & 10 deletions src/components/network/gs-map-equipments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,21 @@
*/

import { UUID } from 'crypto';
import { RefObject } from 'react';
import { IntlShape } from 'react-intl';
import { Dispatch } from 'redux';
import { UseSnackMessageReturn } from '@gridsuite/commons-ui';
import { mapEquipmentsCreated, setMapEquipementsInitialized } from '../../redux/actions';
import { MapEquipments } from '@powsybl/network-viewer';
import type { AppDispatch } from '../../redux/store';
import {
fetchHvdcLinesMapInfos,
fetchLinesMapInfos,
fetchSubstationsMapInfos,
fetchTieLinesMapInfos,
} from '../../services/study/network';
import { MapEquipments } from '@powsybl/network-viewer';
} from '../../services/study/network-ts';

export default class GSMapEquipments extends MapEquipments {
dispatch: Dispatch;
dispatch: AppDispatch;
errHandler?: UseSnackMessageReturn['snackError'];
intlRef: RefObject<IntlShape>;

initEquipments(studyUuid: UUID, currentNodeUuid: UUID) {
const fetchSubstationsMapInfosPromise = fetchSubstationsMapInfos(studyUuid, currentNodeUuid, undefined, false);
Expand Down Expand Up @@ -102,17 +100,15 @@ export default class GSMapEquipments extends MapEquipments {
studyUuid: UUID,
currentNodeUuid: UUID,
errHandler: UseSnackMessageReturn['snackError'],
dispatch: Dispatch,
intlRef: RefObject<IntlShape>
dispatch: Dispatch
) {
super();
this.dispatch = dispatch;
this.errHandler = errHandler;
this.intlRef = intlRef;
this.initEquipments(studyUuid, currentNodeUuid);
}

reloadImpactedSubstationsEquipments(studyUuid: UUID, currentNode: any, substationsIds: string[] | null) {
reloadImpactedSubstationsEquipments(studyUuid: UUID, currentNode: any, substationsIds: string[] | undefined) {
const updatedSubstations = fetchSubstationsMapInfos(studyUuid, currentNode?.id, substationsIds, true);
const updatedLines = fetchLinesMapInfos(studyUuid, currentNode?.id, substationsIds, true);
const updatedTieLines = fetchTieLinesMapInfos(studyUuid, currentNode?.id, substationsIds, true);
Expand Down
Loading
Loading