@gridsuite/commons-ui 0.262.0 → 0.264.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/features/network-modifications/battery/creation/batteryCreation.types.d.ts +1 -1
  2. package/dist/features/network-modifications/battery/creation/batteryCreation.utils.d.ts +1 -1
  3. package/dist/features/network-modifications/battery/creation/batteryCreation.utils.js +4 -2
  4. package/dist/features/parameters/common/contingency-table/contingency-table.js +30 -11
  5. package/dist/features/parameters/common/contingency-table/not-found-elements-table.d.ts +5 -0
  6. package/dist/features/parameters/common/contingency-table/not-found-elements-table.js +23 -0
  7. package/dist/features/parameters/common/contingency-table/utils.d.ts +6 -0
  8. package/dist/features/parameters/common/contingency-table/utils.js +14 -1
  9. package/dist/index.js +3 -3
  10. package/dist/services/dynamic-margin-calculation.js +2 -2
  11. package/dist/services/dynamic-security-analysis.js +3 -4
  12. package/dist/services/dynamic-simulation.js +2 -2
  13. package/dist/services/index.js +3 -3
  14. package/dist/services/loadflow.d.ts +0 -1
  15. package/dist/services/loadflow.js +2 -4
  16. package/dist/services/networkModification.js +6 -7
  17. package/dist/services/pcc-min.js +2 -2
  18. package/dist/services/security-analysis.js +3 -4
  19. package/dist/services/sensitivity-analysis.js +5 -6
  20. package/dist/services/short-circuit-analysis.js +2 -2
  21. package/dist/services/study.d.ts +1 -0
  22. package/dist/services/study.js +4 -3
  23. package/dist/services/voltage-init.js +2 -1
  24. package/dist/translations/en/parameters.d.ts +1 -1
  25. package/dist/translations/en/parameters.js +1 -1
  26. package/dist/translations/fr/parameters.d.ts +1 -1
  27. package/dist/translations/fr/parameters.js +1 -1
  28. package/package.json +1 -1
@@ -8,7 +8,7 @@ export interface BatteryCreationDto {
8
8
  maxP: number;
9
9
  reactiveCapabilityCurve?: boolean | null;
10
10
  targetP: number | null;
11
- targetQ: number | null;
11
+ targetQ: number;
12
12
  targetV: number | null;
13
13
  voltageRegulationOn: boolean | null;
14
14
  regulatingTerminalId: string | null;
@@ -22,7 +22,7 @@ export declare const batteryCreationFormSchema: import('yup').ObjectSchema<NonNu
22
22
  name?: string | null | undefined;
23
23
  type?: string | undefined;
24
24
  } | null;
25
- reactivePowerSetpoint: number | null | undefined;
25
+ reactivePowerSetpoint: number;
26
26
  activePowerSetpoint: number | undefined;
27
27
  equipmentID: string;
28
28
  equipmentName: string | null | undefined;
@@ -62,7 +62,7 @@ import "../../../../components/composite/report/report-viewer/log-table/log-tabl
62
62
  import "react-window";
63
63
  import "../../../../components/composite/report/report-treeview/treeview-item.js";
64
64
  import "../../../../components/composite/report/report-viewer/context/report-viewer-context.js";
65
- import { getSetPointsSchema, getSetPointsEmptyFormData } from "../../common/setpoints/setPoints.utils.js";
65
+ import { getActivePowerSetPointSchema, getSetPointsEmptyFormData } from "../../common/setpoints/setPoints.utils.js";
66
66
  import { getActivePowerControlSchema, getActivePowerControlEmptyFormData } from "../../common/activePowerControl/activePowerControlForm.utils.js";
67
67
  import { getShortCircuitFormSchema, getShortCircuitEmptyFormData, getShortCircuitFormData } from "../../common/shortCircuit/shortCircuitForm.utils.js";
68
68
  import { getReactiveLimitsValidationSchema, getReactiveLimitsEmptyFormDataProps, getReactiveLimitsFormDataProps } from "../../common/reactiveLimits/reactiveLimits.utils.js";
@@ -91,7 +91,9 @@ const batteryCreationFormSchema = object().shape({
91
91
  }),
92
92
  [FieldConstants.CONNECTIVITY]: getConnectivityWithPositionSchema(false),
93
93
  [FieldConstants.REACTIVE_LIMITS]: getReactiveLimitsValidationSchema(),
94
- ...getSetPointsSchema(),
94
+ ...getActivePowerSetPointSchema(),
95
+ // override for batteries
96
+ [FieldConstants.REACTIVE_POWER_SET_POINT]: number().nullable().required(),
95
97
  ...getVoltageRegulationSchema(),
96
98
  ...getActivePowerControlSchema(),
97
99
  ...getShortCircuitFormSchema()
@@ -1,15 +1,15 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { Alert, CircularProgress } from "@mui/material";
2
+ import { Alert, CircularProgress, Box, IconButton, Collapse } from "@mui/material";
3
3
  import { forwardRef, useState, useImperativeHandle, useCallback, useEffect, useMemo } from "react";
4
4
  import { useIntl, FormattedMessage } from "react-intl";
5
5
  import { useFormContext } from "react-hook-form";
6
+ import { ExpandLess, ExpandMore } from "@mui/icons-material";
6
7
  import { ACTIVATED, ID } from "../parameter-table-field/constants.js";
7
8
  import { ParameterTableField } from "../parameter-table-field/parameter-table-field.js";
8
9
  import { COLUMNS_DEFINITIONS_CONTINGENCY_LISTS_INFOS, isValidContingencyRow } from "./columns-definitions.js";
9
10
  import "../../../../utils/conversionUtils.js";
10
11
  import { snackWithFallback } from "../../../../utils/error.js";
11
12
  import "../../../../utils/types/equipmentType.js";
12
- import "@mui/icons-material";
13
13
  import { DEFAULT_TIMEOUT_MS, IGNORE_SIGNAL } from "../../../../services/utils.js";
14
14
  import "localized-countries";
15
15
  import "localized-countries/data/fr";
@@ -17,6 +17,7 @@ import "localized-countries/data/en";
17
17
  import { useSnackMessage } from "../../../../hooks/useSnackMessage.js";
18
18
  import { CONTINGENCY_LISTS } from "../constants.js";
19
19
  import { mapSimulatedContingencyList } from "./utils.js";
20
+ import NotFoundElementsTable from "./not-found-elements-table.js";
20
21
  const styles = {
21
22
  alert: { color: "text.primary", paddingTop: 0, paddingBottom: 0 },
22
23
  error: { color: "error.main", paddingTop: 0, paddingBottom: 0 }
@@ -30,6 +31,7 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
30
31
  null
31
32
  );
32
33
  const [contingencyCountRefreshTrigger, setContingencyCountRefreshTrigger] = useState(0);
34
+ const [expanded, setExpanded] = useState(false);
33
35
  useImperativeHandle(
34
36
  apiRef,
35
37
  () => ({
@@ -95,6 +97,11 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
95
97
  name,
96
98
  contingencyCountRefreshTrigger
97
99
  ]);
100
+ useEffect(() => {
101
+ if (simulatedContingencyCount === null || simulatedContingencyCount.success && simulatedContingencyCount.notFoundElements === 0) {
102
+ setExpanded(false);
103
+ }
104
+ }, [simulatedContingencyCount]);
98
105
  const renderContingencyCount = () => {
99
106
  if (!isBuiltCurrentNode) {
100
107
  return /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "warning", sx: styles.alert, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "contingencyCountImpossibleOnUnbuiltNode" }) });
@@ -105,16 +112,28 @@ function ContingencyTableWithApiRef({ name, showContingencyCount = false, fetchC
105
112
  if (simulatedContingencyCount === null || simulatedContingencyCount.success && simulatedContingencyCount.nbContingencies === 0) {
106
113
  return /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "error", sx: styles.alert, children: /* @__PURE__ */ jsx(FormattedMessage, { id: "noContingency" }) });
107
114
  }
108
- return simulatedContingencyCount.success ? /* @__PURE__ */ jsx(Alert, { variant: "standard", icon: false, severity: "info", sx: styles.alert, children: /* @__PURE__ */ jsx(
109
- FormattedMessage,
110
- {
111
- id: "xContingenciesWillBeSimulatedAndYNotFound",
112
- values: {
113
- x: simulatedContingencyCount?.nbContingencies ?? "...",
114
- y: simulatedContingencyCount?.notFoundElements ?? "..."
115
+ return simulatedContingencyCount.success ? /* @__PURE__ */ jsxs(Box, { children: [
116
+ /* @__PURE__ */ jsx(
117
+ Alert,
118
+ {
119
+ variant: "standard",
120
+ severity: "info",
121
+ sx: styles.alert,
122
+ action: simulatedContingencyCount?.notFoundElements > 0 && /* @__PURE__ */ jsx(IconButton, { "aria-label": "expand", size: "small", onClick: () => setExpanded(!expanded), children: expanded ? /* @__PURE__ */ jsx(ExpandLess, {}) : /* @__PURE__ */ jsx(ExpandMore, {}) }),
123
+ children: /* @__PURE__ */ jsx(
124
+ FormattedMessage,
125
+ {
126
+ id: "xContingenciesWillBeSimulatedAndYNotFound",
127
+ values: {
128
+ x: simulatedContingencyCount?.nbContingencies ?? "...",
129
+ y: simulatedContingencyCount?.notFoundElements ?? "..."
130
+ }
131
+ }
132
+ )
115
133
  }
116
- }
117
- ) }) : /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "error", sx: styles.error, children: /* @__PURE__ */ jsx(
134
+ ),
135
+ /* @__PURE__ */ jsx(Collapse, { in: expanded, sx: { padding: 1 }, children: /* @__PURE__ */ jsx(NotFoundElementsTable, { data: simulatedContingencyCount?.NotFoundElementsData }) })
136
+ ] }) : /* @__PURE__ */ jsx(Alert, { variant: "standard", severity: "error", sx: styles.error, children: /* @__PURE__ */ jsx(
118
137
  FormattedMessage,
119
138
  {
120
139
  id: "contingenciesWillNotBeSimulated",
@@ -0,0 +1,5 @@
1
+ import { NotFoundElementsData } from './utils';
2
+ export type NotFoundElementsTableProps = {
3
+ data: NotFoundElementsData[];
4
+ };
5
+ export default function NotFoundElementsTable({ data }: Readonly<NotFoundElementsTableProps>): import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from "@mui/material";
3
+ import { useIntl } from "react-intl";
4
+ function NotFoundElementsTable({ data }) {
5
+ const intl = useIntl();
6
+ return /* @__PURE__ */ jsx(TableContainer, { sx: { maxHeight: 370, overflow: "auto" }, children: /* @__PURE__ */ jsxs(Table, { stickyHeader: true, size: "small", children: [
7
+ /* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
8
+ /* @__PURE__ */ jsx(TableCell, { children: intl.formatMessage({ id: "ContingenciesList" }) }, "list"),
9
+ /* @__PURE__ */ jsx(TableCell, { children: intl.formatMessage({ id: "Contingencies" }) }, "contingency"),
10
+ /* @__PURE__ */ jsx(TableCell, { children: intl.formatMessage({ id: "Equipment" }) }, "element")
11
+ ] }) }),
12
+ /* @__PURE__ */ jsx(TableBody, { children: data.map((row) => {
13
+ return /* @__PURE__ */ jsxs(TableRow, { hover: true, tabIndex: -1, children: [
14
+ /* @__PURE__ */ jsx(TableCell, { children: row.list }),
15
+ /* @__PURE__ */ jsx(TableCell, { children: row.contingency }),
16
+ /* @__PURE__ */ jsx(TableCell, { children: row.element })
17
+ ] }, `${row.list}-${row.contingency}-${row.element}`);
18
+ }) })
19
+ ] }) });
20
+ }
21
+ export {
22
+ NotFoundElementsTable as default
23
+ };
@@ -4,10 +4,16 @@ export type SuccessCountType = {
4
4
  success: true;
5
5
  nbContingencies: number;
6
6
  notFoundElements: number;
7
+ NotFoundElementsData: NotFoundElementsData[];
7
8
  };
8
9
  export type FailureCountType = {
9
10
  success: false;
10
11
  invalidContingencyErrorMessage: string;
11
12
  };
12
13
  export type SimulatedContingencyCountType = SuccessCountType | FailureCountType;
14
+ export type NotFoundElementsData = {
15
+ list: string;
16
+ contingency: string;
17
+ element: string;
18
+ };
13
19
  export declare function mapSimulatedContingencyList(contingencyCount: ContingencyCount, contingencyListsInfos: ContingencyListsInfosEnriched[]): SimulatedContingencyCountType;
@@ -7,6 +7,7 @@ function mapSimulatedContingencyList(contingencyCount, contingencyListsInfos) {
7
7
  });
8
8
  let total = 0;
9
9
  let totalNotFound = 0;
10
+ const rows = [];
10
11
  for (const [uuid, countByList] of Object.entries(contingencyCount.countByContingencyList)) {
11
12
  total += countByList.nbContingencies;
12
13
  const listName = namesById[uuid] ?? uuid;
@@ -19,11 +20,23 @@ function mapSimulatedContingencyList(contingencyCount, contingencyListsInfos) {
19
20
  if (countByList.notFoundElements !== null) {
20
21
  totalNotFound += Object.entries(countByList.notFoundElements).length;
21
22
  }
23
+ if (countByList.notFoundElements && Object.keys(countByList.notFoundElements).length > 0) {
24
+ Object.entries(countByList.notFoundElements).forEach(([contingency, elements]) => {
25
+ elements.forEach((element) => {
26
+ rows.push({
27
+ list: listName,
28
+ contingency,
29
+ element
30
+ });
31
+ });
32
+ });
33
+ }
22
34
  }
23
35
  return {
24
36
  success: true,
25
37
  nbContingencies: total,
26
- notFoundElements: totalNotFound
38
+ notFoundElements: totalNotFound,
39
+ NotFoundElementsData: rows
27
40
  };
28
41
  }
29
42
  export {
package/dist/index.js CHANGED
@@ -334,11 +334,11 @@ import { fetchAppsMetadata, fetchBaseVoltages, fetchDefaultCountry, fetchEnv, fe
334
334
  import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./services/config.js";
335
335
  import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchElementNames, fetchRootFolders, hasElementPermission } from "./services/directory.js";
336
336
  import { createFilter, createParameter, fetchElementsInfos, saveFilter, updateParameter } from "./services/explore.js";
337
- import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./services/loadflow.js";
337
+ import { fetchLoadFlowParameters, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./services/loadflow.js";
338
338
  import { enrichPccMinParameters, fetchPccMinParameters, getPccMinStudyParameters, updatePccMinParameters } from "./services/pcc-min.js";
339
339
  import { enrichSecurityAnalysisParameters, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, setSecurityAnalysisParameters, updateSecurityAnalysisParameters } from "./services/security-analysis.js";
340
340
  import { enrichSensitivityAnalysisParameters, fetchSensitivityAnalysisParameters, fetchSensitivityAnalysisProviders, getSensiUrl, getSensitivityAnalysisFactorsCount, getSensitivityAnalysisParameters, getStudyUrlWithNodeUuidAndRootNetworkUuid, setSensitivityAnalysisParameters, updateSensitivityAnalysisParameters } from "./services/sensitivity-analysis.js";
341
- import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./services/study.js";
341
+ import { PREFIX_STUDY_SERVER_QUERIES, exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./services/study.js";
342
342
  import { getNetworkVisualizationsParameters } from "./services/study-config.js";
343
343
  import { fetchCurrentAnnouncement, fetchUserDetails } from "./services/userAdmin.js";
344
344
  import { DEFAULT_TIMEOUT_MS, IGNORE_SIGNAL, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList, handleNotOkResponse, parseError, safeEncodeURIComponent } from "./services/utils.js";
@@ -981,7 +981,7 @@ export {
981
981
  PREFIX_DIRECTORY_NOTIFICATION_WS,
982
982
  PREFIX_MONITOR_NOTIFICATION_WS,
983
983
  PREFIX_STUDY_NOTIFICATION_WS,
984
- PREFIX_STUDY_QUERIES,
984
+ PREFIX_STUDY_SERVER_QUERIES,
985
985
  PRIORITY,
986
986
  PROVIDER,
987
987
  PSTS_EQUIPMENT_TYPES,
@@ -1,7 +1,7 @@
1
1
  import { backendFetchJson, backendFetch } from "./utils.js";
2
- const PREFIX_DYNAMIC_MARGIN_CALCULATION_SERVER_QUERIES = `${"api/gateway"}/dynamic-margin-calculation`;
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
3
3
  function getDynamicMarginCalculationUrl() {
4
- return `${PREFIX_DYNAMIC_MARGIN_CALCULATION_SERVER_QUERIES}/v1/`;
4
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/dynamic-margin-calculation/`;
5
5
  }
6
6
  function fetchDynamicMarginCalculationProviders() {
7
7
  console.info("fetch dynamic margin calculation providers");
@@ -1,6 +1,5 @@
1
1
  import { getRequestParamFromList, backendFetchJson } from "./utils.js";
2
- const PREFIX_DYNAMIC_SECURITY_ANALYSIS_SERVER_QUERIES = `${"api/gateway"}/dynamic-security-analysis`;
3
- const PREFIX_DIRECTORY_SERVER_QUERIES = `${"api/gateway"}/directory`;
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
4
3
  function fetchContingencyAndFiltersLists(listIds) {
5
4
  console.info("Fetching contingency and filters lists");
6
5
  const idsParams = getRequestParamFromList(
@@ -10,12 +9,12 @@ function fetchContingencyAndFiltersLists(listIds) {
10
9
  );
11
10
  const urlSearchParams = new URLSearchParams(idsParams);
12
11
  urlSearchParams.append("strictMode", "false");
13
- const url = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/elements?${urlSearchParams}`;
12
+ const url = `${PREFIX_STUDY_SERVER_QUERIES}/v1/directory/elements?${urlSearchParams}`;
14
13
  console.debug(url);
15
14
  return backendFetchJson(url);
16
15
  }
17
16
  function getDynamicSecurityAnalysisUrl() {
18
- return `${PREFIX_DYNAMIC_SECURITY_ANALYSIS_SERVER_QUERIES}/v1/`;
17
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/dynamic-security-analysis/`;
19
18
  }
20
19
  function fetchDynamicSecurityAnalysisProviders() {
21
20
  console.info("fetch dynamic security analysis providers");
@@ -1,7 +1,7 @@
1
1
  import { backendFetchJson, backendFetch } from "./utils.js";
2
- const PREFIX_DYNAMIC_SIMULATION_SERVER_QUERIES = `${"api/gateway"}/dynamic-simulation`;
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
3
3
  function getDynamicSimulationUrl() {
4
- return `${PREFIX_DYNAMIC_SIMULATION_SERVER_QUERIES}/v1/`;
4
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/dynamic-simulation/`;
5
5
  }
6
6
  function fetchDynamicSimulationProviders() {
7
7
  console.info("fetch dynamic simulation providers");
@@ -2,11 +2,11 @@ import { fetchAppsMetadata, fetchBaseVoltages, fetchDefaultCountry, fetchEnv, fe
2
2
  import { fetchConfigParameter, fetchConfigParameters, getAppName, updateConfigParameter } from "./config.js";
3
3
  import { PermissionType, elementAlreadyExists, fetchDirectoryContent, fetchDirectoryElementPath, fetchElementNames, fetchRootFolders, hasElementPermission } from "./directory.js";
4
4
  import { createFilter, createParameter, fetchElementsInfos, saveFilter, updateParameter } from "./explore.js";
5
- import { PREFIX_STUDY_QUERIES, fetchLoadFlowParameters, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./loadflow.js";
5
+ import { fetchLoadFlowParameters, getLoadFlowDefaultLimitReductions, getLoadFlowProviders, getLoadFlowSpecificParametersDescription, getLoadFlowUrl, setLoadFlowParameters } from "./loadflow.js";
6
6
  import { enrichPccMinParameters, fetchPccMinParameters, getPccMinStudyParameters, updatePccMinParameters } from "./pcc-min.js";
7
7
  import { enrichSecurityAnalysisParameters, fetchSecurityAnalysisParameters, fetchSecurityAnalysisProviders, getSecurityAnalysisDefaultLimitReductions, getSecurityAnalysisParameters, getStudyUrl, setSecurityAnalysisParameters, updateSecurityAnalysisParameters } from "./security-analysis.js";
8
8
  import { enrichSensitivityAnalysisParameters, fetchSensitivityAnalysisParameters, fetchSensitivityAnalysisProviders, getSensiUrl, getSensitivityAnalysisFactorsCount, getSensitivityAnalysisParameters, getStudyUrlWithNodeUuidAndRootNetworkUuid, setSensitivityAnalysisParameters, updateSensitivityAnalysisParameters } from "./sensitivity-analysis.js";
9
- import { exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./study.js";
9
+ import { PREFIX_STUDY_SERVER_QUERIES, exportFilter, getAvailableComponentLibraries, getStudyNetworkVisualizationsParameters, getStudyShortCircuitParameters, setStudyNetworkVisualizationParameters, updateVoltageInitParameters } from "./study.js";
10
10
  import { getNetworkVisualizationsParameters } from "./study-config.js";
11
11
  import { fetchCurrentAnnouncement, fetchUserDetails } from "./userAdmin.js";
12
12
  import { DEFAULT_TIMEOUT_MS, IGNORE_SIGNAL, backendFetch, backendFetchFile, backendFetchJson, backendFetchText, getRequestParamFromList, handleNotOkResponse, parseError, safeEncodeURIComponent } from "./utils.js";
@@ -21,7 +21,7 @@ export {
21
21
  DEFAULT_TIMEOUT_MS,
22
22
  IGNORE_SIGNAL,
23
23
  ModificationContainerType,
24
- PREFIX_STUDY_QUERIES,
24
+ PREFIX_STUDY_SERVER_QUERIES,
25
25
  PermissionType,
26
26
  backendFetch,
27
27
  backendFetchFile,
@@ -1,5 +1,4 @@
1
1
  import { UUID } from 'node:crypto';
2
- export declare const PREFIX_STUDY_QUERIES: string;
3
2
  export declare function getLoadFlowUrl(): string;
4
3
  export declare function getLoadFlowProviders(): Promise<any>;
5
4
  export declare function getLoadFlowSpecificParametersDescription(): Promise<any>;
@@ -1,8 +1,7 @@
1
1
  import { backendFetchJson, backendFetch } from "./utils.js";
2
- const PREFIX_LOADFLOW_SERVER_QUERIES = `${"api/gateway"}/loadflow`;
3
- const PREFIX_STUDY_QUERIES = `${"api/gateway"}/study`;
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
4
3
  function getLoadFlowUrl() {
5
- return `${PREFIX_LOADFLOW_SERVER_QUERIES}/v1/`;
4
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/loadflow/`;
6
5
  }
7
6
  function getLoadFlowProviders() {
8
7
  console.info("get load flow providers");
@@ -42,7 +41,6 @@ function setLoadFlowParameters(parameterUuid, newParams) {
42
41
  });
43
42
  }
44
43
  export {
45
- PREFIX_STUDY_QUERIES,
46
44
  fetchLoadFlowParameters,
47
45
  getLoadFlowDefaultLimitReductions,
48
46
  getLoadFlowProviders,
@@ -1,10 +1,9 @@
1
1
  import { backendFetchJson, backendFetch, safeEncodeURIComponent, backendFetchText } from "./utils.js";
2
- import { PREFIX_STUDY_QUERIES } from "./loadflow.js";
3
- const PREFIX_NETWORK_MODIFICATION_QUERIES = `${"api/gateway"}/network-modification`;
4
- const getBaseNetworkModificationUrl = () => `${PREFIX_NETWORK_MODIFICATION_QUERIES}/v1`;
5
- const getStudyUrlWithNodeUuid = (studyUuid, nodeUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/nodes/${safeEncodeURIComponent(nodeUuid)}`;
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
3
+ const getBaseNetworkModificationUrl = () => `${PREFIX_STUDY_SERVER_QUERIES}/v1/network-modification`;
4
+ const getStudyUrlWithNodeUuid = (studyUuid, nodeUuid) => `${PREFIX_STUDY_SERVER_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/nodes/${safeEncodeURIComponent(nodeUuid)}`;
6
5
  function getUrl() {
7
- return `${PREFIX_NETWORK_MODIFICATION_QUERIES}/v1/network-modifications`;
6
+ return `${getBaseNetworkModificationUrl()}/network-modifications`;
8
7
  }
9
8
  var ModificationContainerType = /* @__PURE__ */ ((ModificationContainerType2) => {
10
9
  ModificationContainerType2["GROUP"] = "GROUP";
@@ -25,7 +24,7 @@ function fetchBusBarSectionsForNewCoupler(voltageLevelId, busBarCount, sectionCo
25
24
  switchKindList.forEach((kind) => {
26
25
  urlSearchParams.append("switchKindList", kind);
27
26
  });
28
- const url = `${PREFIX_NETWORK_MODIFICATION_QUERIES}/v1/network-modifications/busbar-sections-for-new-coupler?${urlSearchParams.toString()}`;
27
+ const url = `${getBaseNetworkModificationUrl()}/network-modifications/busbar-sections-for-new-coupler?${urlSearchParams.toString()}`;
29
28
  console.debug(url);
30
29
  return backendFetchJson(url);
31
30
  }
@@ -73,7 +72,7 @@ function moveModification(studyUuid, nodeUuid, modificationUuid, sourceContainer
73
72
  body: JSON.stringify({ source: sourceContainer, target: targetContainer, beforeUuid })
74
73
  });
75
74
  }
76
- const getStudyUrlWithNodeUuidAndRootNetworkUuid = (studyUuid, nodeUuid, rootNetworkUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/root-networks/${safeEncodeURIComponent(
75
+ const getStudyUrlWithNodeUuidAndRootNetworkUuid = (studyUuid, nodeUuid, rootNetworkUuid) => `${PREFIX_STUDY_SERVER_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/root-networks/${safeEncodeURIComponent(
77
76
  rootNetworkUuid
78
77
  )}/nodes/${safeEncodeURIComponent(nodeUuid)}`;
79
78
  function setModificationMetadata(studyUuid, nodeUuid, modificationUuid, metadata) {
@@ -7,9 +7,9 @@ import { mapPccMinParameters } from "../utils/types/pcc-min.type.js";
7
7
  import "react/jsx-runtime";
8
8
  import "@mui/icons-material";
9
9
  import { fetchElementNames } from "./directory.js";
10
- const PREFIX_PCC_MIN_SERVER_QUERIES = `${"api/gateway"}/pcc-min`;
10
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
11
11
  function getPccMinUrl() {
12
- return `${PREFIX_PCC_MIN_SERVER_QUERIES}/v1/`;
12
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/pcc-min/`;
13
13
  }
14
14
  function collectAllElementIds(params) {
15
15
  return new Set(params[FILTERS]);
@@ -1,15 +1,14 @@
1
1
  import { backendFetchJson, safeEncodeURIComponent, backendFetch } from "./utils.js";
2
- import { PREFIX_STUDY_QUERIES } from "./loadflow.js";
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
3
3
  import "../utils/conversionUtils.js";
4
4
  import "../utils/types/equipmentType.js";
5
5
  import { mapSecurityAnalysisParameters } from "../utils/types/security-analysis.type.js";
6
6
  import "react/jsx-runtime";
7
7
  import "@mui/icons-material";
8
8
  import { fetchElementNames } from "./directory.js";
9
- const PREFIX_SECURITY_ANALYSIS_SERVER_QUERIES = `${"api/gateway"}/security-analysis`;
10
- const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
9
+ const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_SERVER_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
11
10
  function getSecurityAnalysisUrl() {
12
- return `${PREFIX_SECURITY_ANALYSIS_SERVER_QUERIES}/v1/`;
11
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/security-analysis/`;
13
12
  }
14
13
  function fetchSecurityAnalysisProviders() {
15
14
  console.info("fetch security analysis providers");
@@ -4,16 +4,15 @@ import "../utils/types/equipmentType.js";
4
4
  import { mapSensitivityAnalysisParameters } from "../utils/types/sensitivity-analysis.type.js";
5
5
  import "react/jsx-runtime";
6
6
  import "@mui/icons-material";
7
- import { PREFIX_STUDY_QUERIES } from "./loadflow.js";
7
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
8
8
  import { fetchElementNames } from "./directory.js";
9
- const GET_PARAMETERS_PREFIX = `${"api/gateway"}/sensitivity-analysis/v1/parameters`;
10
- const PREFIX_SENSITIVITY_ANALYSIS_SERVER_QUERIES = `${"api/gateway"}/sensitivity-analysis`;
11
- const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
12
- const getStudyUrlWithNodeUuidAndRootNetworkUuid = (studyUuid, nodeUuid, rootNetworkUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/root-networks/${safeEncodeURIComponent(
9
+ const GET_PARAMETERS_PREFIX = `${PREFIX_STUDY_SERVER_QUERIES}/v1/sensitivity-analysis/parameters`;
10
+ const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_SERVER_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
11
+ const getStudyUrlWithNodeUuidAndRootNetworkUuid = (studyUuid, nodeUuid, rootNetworkUuid) => `${PREFIX_STUDY_SERVER_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/root-networks/${safeEncodeURIComponent(
13
12
  rootNetworkUuid
14
13
  )}/nodes/${safeEncodeURIComponent(nodeUuid)}`;
15
14
  function getSensiUrl() {
16
- return `${PREFIX_SENSITIVITY_ANALYSIS_SERVER_QUERIES}/v1/`;
15
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/sensitivity-analysis/`;
17
16
  }
18
17
  function fetchSensitivityAnalysisProviders() {
19
18
  console.info("fetch sensitivity analysis providers");
@@ -1,7 +1,7 @@
1
1
  import { backendFetchJson, backendFetch } from "./utils.js";
2
- const PREFIX_SHORT_CIRCUIT_SERVER_QUERIES = `${"api/gateway"}/shortcircuit`;
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
3
3
  function getShortCircuitUrl() {
4
- return `${PREFIX_SHORT_CIRCUIT_SERVER_QUERIES}/v1/`;
4
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/shortcircuit/`;
5
5
  }
6
6
  function getShortCircuitSpecificParametersDescription() {
7
7
  console.info("get short circuit specific parameters description");
@@ -2,6 +2,7 @@ import { UUID } from 'node:crypto';
2
2
  import { NetworkVisualizationParameters } from '../features/parameters/network-visualizations/network-visualizations.types';
3
3
  import { ShortCircuitParametersInfos } from '../features/parameters/short-circuit/short-circuit-parameters.type';
4
4
  import { VoltageInitStudyParameters } from '../features/parameters/voltage-init/voltage-init.type';
5
+ export declare const PREFIX_STUDY_SERVER_QUERIES: string;
5
6
  export declare function exportFilter(studyUuid: UUID, filterUuid?: UUID, token?: string): Promise<any>;
6
7
  export declare function getAvailableComponentLibraries(): Promise<string[]>;
7
8
  export declare function getStudyNetworkVisualizationsParameters(studyUuid: UUID): Promise<NetworkVisualizationParameters>;
@@ -1,6 +1,6 @@
1
1
  import { backendFetchJson, backendFetch, safeEncodeURIComponent } from "./utils.js";
2
- const PREFIX_STUDY_QUERIES = `${"api/gateway"}/study`;
3
- const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
2
+ const PREFIX_STUDY_SERVER_QUERIES = `${"api/gateway"}/study`;
3
+ const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_SERVER_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
4
4
  function exportFilter(studyUuid, filterUuid, token) {
5
5
  console.info("get filter export on study root node");
6
6
  return backendFetchJson(
@@ -14,7 +14,7 @@ function exportFilter(studyUuid, filterUuid, token) {
14
14
  }
15
15
  function getAvailableComponentLibraries() {
16
16
  console.info("get available component libraries for diagrams");
17
- return backendFetchJson(`${PREFIX_STUDY_QUERIES}/v1/svg-component-libraries`);
17
+ return backendFetchJson(`${PREFIX_STUDY_SERVER_QUERIES}/v1/svg-component-libraries`);
18
18
  }
19
19
  function getStudyNetworkVisualizationsParameters(studyUuid) {
20
20
  console.info("get study network visualization parameters");
@@ -49,6 +49,7 @@ function updateVoltageInitParameters(studyUuid, newParams) {
49
49
  });
50
50
  }
51
51
  export {
52
+ PREFIX_STUDY_SERVER_QUERIES,
52
53
  exportFilter,
53
54
  getAvailableComponentLibraries,
54
55
  getStudyNetworkVisualizationsParameters,
@@ -1,6 +1,7 @@
1
1
  import { backendFetchJson } from "./utils.js";
2
+ import { PREFIX_STUDY_SERVER_QUERIES } from "./study.js";
2
3
  function getVoltageInitUrl() {
3
- return `${"api/gateway"}/voltage-init/v1/`;
4
+ return `${PREFIX_STUDY_SERVER_QUERIES}/v1/voltage-init/`;
4
5
  }
5
6
  function getVoltageInitParameters(parameterUuid) {
6
7
  console.info("get voltage init parameters");
@@ -202,7 +202,7 @@ export declare const parametersEn: {
202
202
  angleFlowSensitivityValueThreshold: string;
203
203
  flowVoltageSensitivityValueThreshold: string;
204
204
  ContingencyListsSelection: string;
205
- contingencyLists: string;
205
+ ContingenciesList: string;
206
206
  Execute: string;
207
207
  AddContingencyList: string;
208
208
  DeleteContingencyList: string;
@@ -196,7 +196,7 @@ const parametersEn = {
196
196
  angleFlowSensitivityValueThreshold: "ΔMW ou ΔA / Δ°",
197
197
  flowVoltageSensitivityValueThreshold: "ΔkV / kV",
198
198
  ContingencyListsSelection: "Contingency lists selection",
199
- contingencyLists: "Contingency lists",
199
+ ContingenciesList: "Contingencies list",
200
200
  Execute: "Execute",
201
201
  AddContingencyList: "Add",
202
202
  DeleteContingencyList: "Delete",
@@ -203,7 +203,7 @@ export declare const parametersFr: {
203
203
  angleFlowSensitivityValueThreshold: string;
204
204
  flowVoltageSensitivityValueThreshold: string;
205
205
  ContingencyListsSelection: string;
206
- contingencyLists: string;
206
+ ContingenciesList: string;
207
207
  Execute: string;
208
208
  AddContingencyList: string;
209
209
  DeleteContingencyList: string;
@@ -197,7 +197,7 @@ const parametersFr = {
197
197
  angleFlowSensitivityValueThreshold: "ΔMW ou ΔA / Δ°",
198
198
  flowVoltageSensitivityValueThreshold: "ΔkV / kV",
199
199
  ContingencyListsSelection: "Sélection des listes d'aléas",
200
- contingencyLists: "Listes d'aléas",
200
+ ContingenciesList: "Liste d'aléas",
201
201
  Execute: "Exécuter",
202
202
  AddContingencyList: "Ajouter",
203
203
  DeleteContingencyList: "Supprimer",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.262.0",
3
+ "version": "0.264.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",