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

poc - test hook #2356

Open
wants to merge 1 commit 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
1,168 changes: 1,044 additions & 124 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@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 @@ -36,7 +37,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 Expand Up @@ -70,6 +70,7 @@
"@babel/preset-env": "^7.24.3",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@testing-library/react": "^16.0.1",
"@types/core-js": "^2.5.8",
"@types/dagre": "^0.7.52",
"@types/eslint": "^8.56.9",
Expand All @@ -90,6 +91,7 @@
"@types/react-resizable": "^3.0.7",
"@types/react-virtualized": "^9.21.29",
"@types/react-window": "^1.8.8",
"@types/redux-mock-store": "^1.0.6",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
Expand All @@ -110,6 +112,7 @@
"jest-environment-jsdom": "^29.7.0",
"license-checker": "^25.0.1",
"prettier": "^2.8.8",
"redux-mock-store": "^1.5.5",
"ts-node": "^10.9.2",
"type-fest": "^4.22.1",
"typescript": "5.1.6",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/app-wrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ import events_locale_fr from '../translations/dynamic/events-locale-fr';
import events_locale_en from '../translations/dynamic/events-locale-en';
import spreadsheet_locale_fr from '../translations/spreadsheet-fr';
import spreadsheet_locale_en from '../translations/spreadsheet-en';
import { store } from '../redux/store';
import { store } from '../appRedux/store';
import CssBaseline from '@mui/material/CssBaseline';
import {
PARAM_THEME,
Expand Down
2 changes: 1 addition & 1 deletion src/components/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import {
selectUseName,
setOptionalServices,
setParamsLoaded,
} from '../redux/actions';
} from '../appRedux/actions';

const noUserManager = { instance: null, error: null };

Expand Down
6 changes: 3 additions & 3 deletions src/components/computing-status/use-computing-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { UUID } from 'crypto';
import { RefObject, useCallback, useEffect, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { ComputingType } from './computing-type';
import { AppState, StudyUpdated } from 'redux/reducer';
import { AppState, StudyUpdated } from 'appRedux/reducer';
import { OptionalServicesStatus } from '../utils/optional-services';
import { setComputingStatus, setLastCompletedComputation } from '../../redux/actions';
import { AppDispatch } from '../../redux/store';
import { setComputingStatus, setLastCompletedComputation } from '../../appRedux/actions';
import { AppDispatch } from '../../appRedux/store';

interface UseComputingStatusProps {
(
Expand Down
4 changes: 2 additions & 2 deletions src/components/diagrams/diagram-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import { useCallback } from 'react';
import { useDispatch } from 'react-redux';
import { closeDiagram, closeDiagrams, minimizeDiagram, openDiagram, togglePinDiagram } from '../../redux/actions';
import { closeDiagram, closeDiagrams, minimizeDiagram, openDiagram, togglePinDiagram } from '../../appRedux/actions';
import { INVALID_LOADFLOW_OPACITY, NAD_INVALID_LOADFLOW_OPACITY } from '../../utils/colors';
import { FEEDER_TYPES, FeederTypes } from 'components/utils/feederType';
import { EQUIPMENT_TYPES } from 'components/utils/equipment-types';
import { Theme } from '@mui/material';
import { AppDispatch } from '../../redux/store';
import { AppDispatch } from '../../appRedux/store';
import { SLDMetadata } from '@powsybl/diagram-viewer';
import { UUID } from 'crypto';

Expand Down
4 changes: 2 additions & 2 deletions src/components/diagrams/diagram-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import MinimizeIcon from '@mui/icons-material/Minimize';
import PushPinIcon from '@mui/icons-material/PushPin';
import PushPinOutlinedIcon from '@mui/icons-material/PushPinOutlined';
import CloseIcon from '@mui/icons-material/Close';
import { stopDiagramBlink } from '../../redux/actions';
import { stopDiagramBlink } from '../../appRedux/actions';
import { mergeSx } from '../utils/functions';
import { Theme } from '@mui/material';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';

const BLINK_LENGTH_MS = 1800;

Expand Down
6 changes: 3 additions & 3 deletions src/components/diagrams/diagram-pane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ import { AutoSizer } from 'react-virtualized';
import Diagram from './diagram';
import { SLD_DISPLAY_MODE } from '../network/constants';
import { useNameOrId } from '../utils/equipmentInfosHandler';
import { syncDiagramStateWithSessionStorage } from '../../redux/session-storage/diagram-state';
import { syncDiagramStateWithSessionStorage } from '../../appRedux/session-storage/diagram-state';
import SingleLineDiagramContent from './singleLineDiagram/single-line-diagram-content';
import NetworkAreaDiagramContent from './networkAreaDiagram/network-area-diagram-content';
import { OverflowableText, useDebounce, useSnackMessage } from '@gridsuite/commons-ui';
import { setNetworkAreaDiagramNbVoltageLevels } from '../../redux/actions';
import { setNetworkAreaDiagramNbVoltageLevels } from '../../appRedux/actions';
import { useIntl } from 'react-intl';
import { getSubstationSingleLineDiagram, getVoltageLevelSingleLineDiagram } from '../../services/study/network';
import { fetchSvg, getNetworkAreaDiagramUrl } from '../../services/study';
import { mergeSx } from '../utils/functions';
import { Box } from '@mui/system';
import { useLocalizedCountries } from 'components/utils/localized-countries-hook';
import { UUID } from 'crypto';
import { AppState, CurrentTreeNode, DiagramState } from 'redux/reducer';
import { AppState, CurrentTreeNode, DiagramState } from 'appRedux/reducer';
import { SLDMetadata } from '@powsybl/diagram-viewer';

// Returns a callback that returns a promise
Expand Down
2 changes: 1 addition & 1 deletion src/components/diagrams/diagram-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { DiagramState } from '../../redux/reducer';
import { DiagramState } from '../../appRedux/reducer';
import { DiagramType } from './diagram-common';

/**
Expand Down
4 changes: 2 additions & 2 deletions src/components/diagrams/diagram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
incrementNetworkAreaDiagramDepth,
resetNetworkAreaDiagramDepth,
setFullScreenDiagram,
} from '../../redux/actions';
} from '../../appRedux/actions';
import { useIntl } from 'react-intl';
import {
DiagramType,
Expand All @@ -28,7 +28,7 @@ import DiagramHeader from './diagram-header';
import DiagramFooter from './diagram-footer';
import DiagramResizableBox from './diagram-resizable-box';
import AlertCustomMessageNode from '../utils/alert-custom-message-node';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';

interface DiagramProps {
align?: 'left' | 'right' | 'center';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import LinearProgress from '@mui/material/LinearProgress';
import Box from '@mui/material/Box';
import { mergeSx } from '../../utils/functions';
import ComputingType from '../../computing-status/computing-type';
import { AppState } from 'redux/reducer';
import { storeNetworkAreaDiagramNodeMovement } from '../../../redux/actions';
import { AppState } from 'appRedux/reducer';
import { storeNetworkAreaDiagramNodeMovement } from '../../../appRedux/actions';
import { PARAM_INIT_NAD_WITH_GEO_DATA } from '../../../utils/config-params.js';
import { getNadIdentifier } from '../diagram-utils.js';
import { UUID } from 'crypto';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { SLD_DISPLAY_MODE } from '../../network/constants';
import { DiagramType } from '../diagram-common';
import { getVoltageLevelSingleLineDiagram } from '../../../services/study/network';
import { FC } from 'react';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';
import { UUID } from 'crypto';

interface PositionDiagramPaneProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Paper } from '@mui/material';
import DiagramHeader from '../diagram-header';
import { fetchSvg } from '../../../services/study';
import { mergeSx } from '../../utils/functions';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';

interface PositionDiagramProps {
diagramTitle: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ import { fetchNetworkElementInfos } from '../../../services/study/network';
import { mergeSx } from '../../utils/functions';
import { useOneBusShortcircuitAnalysisLoader } from '../use-one-bus-shortcircuit-analysis-loader';
import { DynamicSimulationEventDialog } from '../../dialogs/dynamicsimulation/event/dynamic-simulation-event-dialog';
import { setComputationStarting, setComputingStatus } from '../../../redux/actions';
import { AppState } from 'redux/reducer';
import { setComputationStarting, setComputingStatus } from '../../../appRedux/actions';
import { AppState } from 'appRedux/reducer';
import { UUID } from 'crypto';

type EquipmentMenuState = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { UUID } from 'crypto';
import { ReactElement, useCallback, useEffect, useMemo } from 'react';
import { useIntl } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';
import { Chip, darken, lighten, Theme } from '@mui/material';
import { setOneBusShortcircuitAnalysisDiagram } from '../../redux/actions';
import { AppDispatch } from '../../redux/store';
import { setOneBusShortcircuitAnalysisDiagram } from '../../appRedux/actions';
import { AppDispatch } from '../../appRedux/store';

/**
* A hook that handles the logic behind the diagram one bus shortcircuit analysis loader
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ 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 { CurrentTreeNode } from '../../../appRedux/reducer';
import { UUID } from 'crypto';

interface BranchConnectivityFormProps {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/element-creation-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { yupResolver } from '@hookform/resolvers/yup';
import yup from '../utils/yup-config';
import { useSelector } from 'react-redux';
import ModificationDialog from './commons/modificationDialog';
import { AppState } from '../../redux/reducer';
import { AppState } from '../../appRedux/reducer';

interface FormData {
[NAME]: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/equipment-search-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { FC } from 'react';
import { useSearchMatchingEquipments } from '../top-bar-equipment-seach-dialog/use-search-matching-equipments';
import { UUID } from 'crypto';
import { useSelector } from 'react-redux';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';
import { TextField } from '@mui/material';
import { Search } from '@mui/icons-material';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Paper from '@mui/material/Paper';
import { LIGHT_THEME } from '@gridsuite/commons-ui';
import { AccordionIllustration } from './AccordionIllustration';
import { PARAM_THEME } from 'utils/config-params';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';

interface ReplacedText {
eltId: string;
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/import-modification-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ElementType, useSnackMessage, DirectoryItemSelector, TreeViewFinderNode
import { copyOrMoveModifications } from '../../services/study';
import { FunctionComponent } from 'react';
import { useSelector } from 'react-redux';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';
import { NetworkModificationCopyType } from 'components/graph/menus/network-modification-menu.type';

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
ReactivePowerAdornment,
VoltageAdornment,
} from '../../../dialogUtils';
import { CurrentTreeNode } from '../../../../../redux/reducer';
import { CurrentTreeNode } from '../../../../../appRedux/reducer';
import { UUID } from 'crypto';
import { ConnectivityForm } from '../../../connectivity/connectivity-form';
import Grid from '@mui/material/Grid';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import VscHvdcLinePane from '../hvdc-line-pane/vsc-hvdc-line-pane';
import ConverterStationPane from '../converter-station/converter-station-pane';
import { VSC_CREATION_TABS } from './vsc-creation-dialog';
import { UUID } from 'crypto';
import { CurrentTreeNode } from '../../../../../redux/reducer';
import { CurrentTreeNode } from '../../../../../appRedux/reducer';

interface VscCreationFormProps {
tabIndex: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import React, { FunctionComponent } from 'react';
import VscHvdcLinePane from '../hvdc-line-pane/vsc-hvdc-line-pane';
import ConverterStationPane from '../converter-station/converter-station-pane';
import { UUID } from 'crypto';
import { CurrentTreeNode } from '../../../../../redux/reducer';
import { CurrentTreeNode } from '../../../../../appRedux/reducer';
import { VscModificationInfo } from 'services/network-modification-types';
import { TextInput } from '@gridsuite/commons-ui';
import { Box, TextField } from '@mui/material';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { NotificationType, StudyUpdated } from '../../../../redux/reducer';
import { NotificationType, StudyUpdated } from '../../../../appRedux/reducer';
import { ComputingType, isValidComputingType } from '../../../computing-status/computing-type';

export const UPDATE_TYPE_HEADER = 'updateType';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
import ModificationDialog from 'components/dialogs/commons/modificationDialog';
import { createParameter } from 'services/explore';
import { UniqueNameInput } from 'components/dialogs/commons/unique-name-input';
import { AppState } from 'redux/reducer';
import { AppState } from 'appRedux/reducer';
import { UUID } from 'crypto';

interface FormData {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SingleLineDiagramParameters, useGetAvailableComponentLibraries } from '
import { NetworkAreaDiagramParameters } from './network-area-diagram-parameters';
import { MapParameters } from './map-parameters';
import { useSelector } from 'react-redux';
import { AppState } from '../../../../redux/reducer';
import { AppState } from '../../../../appRedux/reducer';

enum TabValue {
MAP = 'Map',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { VoltageInitParam } from './voltage-init-utils';
import { Dispatch, SetStateAction, useCallback, useEffect, useRef, useState } from 'react';
import { useSelector } from 'react-redux';
import { AppState } from '../../../../redux/reducer';
import { AppState } from '../../../../appRedux/reducer';
import { useSnackMessage } from '@gridsuite/commons-ui';
import { useOptionalServiceStatus } from '../../../../hooks/use-optional-service-status';
import { OptionalServicesNames, OptionalServicesStatus } from '../../../utils/optional-services';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
VoltageInitParametersForm,
voltageInitParametersFormSchema,
} from './voltage-init-parameters-form';
import { AppState } from '../../../../redux/reducer';
import { AppState } from '../../../../appRedux/reducer';
import { UUID } from 'crypto';
import { useGetVoltageInitParameters } from './use-get-voltage-init-parameters';

Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/restore-modification-dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { deleteModifications, restoreModifications } from 'services/study/networ
import { CustomDialog } from 'components/utils/custom-dialog';
import { useModificationLabelComputer } from '../graph/util/use-modification-label-computer.jsx';
import { useSelector } from 'react-redux';
import { AppState } from 'redux/reducer.js';
import { AppState } from 'appRedux/reducer.js';
import { NetworkModificationMetadata } from 'components/graph/menus/network-modification-menu.type.js';
import { toggleElementFromList } from 'components/utils/utils.js';

Expand Down
2 changes: 1 addition & 1 deletion src/components/graph/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import dagre from 'dagre';
import { nodeWidth, nodeHeight, rootNodeWidth, rootNodeHeight } from './util/model-constants';
import { Edge, Position } from '@xyflow/react';
import { CurrentTreeNode } from 'redux/reducer';
import { CurrentTreeNode } from 'appRedux/reducer';
import { NodeType } from './tree-node.type';

export function getLayoutedNodes(nodes: CurrentTreeNode[], edges: Edge[]) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/graph/menus/create-node-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NodeInsertModes } from '../nodes/node-insert-modes';
import { CustomDialog } from '../../utils/custom-dialog';
import { CustomNestedMenuItem } from '../../utils/custom-nested-menu';
import { BUILD_STATUS } from '../../network/constants';
import { AppState, CurrentTreeNode } from 'redux/reducer';
import { AppState, CurrentTreeNode } from 'appRedux/reducer';
import { UUID } from 'crypto';
import NetworkModificationTreeModel from '../network-modification-tree-model';
import { CopyType } from 'components/network-modification.type';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useParams } from 'react-router-dom';
import DeleteIcon from '@mui/icons-material/Delete';
import IconButton from '@mui/material/IconButton';
import { useIsAnyNodeBuilding } from '../../../utils/is-any-node-building-hook';
import { addNotification, removeNotificationByNode, setModificationsInProgress } from '../../../../redux/actions';
import { addNotification, removeNotificationByNode, setModificationsInProgress } from '../../../../appRedux/actions';
import { EVENT_CRUD_FINISHED, EventCrudType } from 'components/network/constants.type';
import { UUID } from 'crypto';
import { Event, EventType } from '../../../dialogs/dynamicsimulation/event/types/event.type';
Expand All @@ -24,8 +24,8 @@ import { getStartTime, getStartTimeUnit } from '../../../dialogs/dynamicsimulati
import { isChecked, isPartial, styles } from '../network-modification-node-editor';
import { EQUIPMENT_TYPE_LABEL_KEYS } from '../../util/model-constants';
import EditIcon from '@mui/icons-material/Edit';
import { AppState, StudyUpdated } from '../../../../redux/reducer';
import { AppDispatch } from '../../../../redux/store';
import { AppState, StudyUpdated } from '../../../../appRedux/reducer';
import { AppDispatch } from '../../../../appRedux/store';
import { EQUIPMENT_TYPES } from '../../../utils/equipment-types';

const EventModificationScenarioEditor = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { lighten, darken, Theme } from '@mui/material/styles';
import { EditableTitle } from '../editable-title';
import { useDispatch, useSelector } from 'react-redux';

import { setEventScenarioDrawerOpen } from '../../../../redux/actions';
import { setEventScenarioDrawerOpen } from '../../../../appRedux/actions';
import { useIntl } from 'react-intl';
import { AppState } from '../../../../redux/reducer';
import { AppState } from '../../../../appRedux/reducer';
import EventModificationScenarioEditor from './event-modification-scenario-editor';
import { Box } from '@mui/material';
import { AppDispatch } from '../../../../redux/store';
import { AppDispatch } from '../../../../appRedux/store';

const styles = {
paper: {
Expand Down
Loading