@gridsuite/commons-ui 0.112.0 → 0.113.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.
- package/dist/components/dnd-table/dnd-table.js +2 -2
- package/dist/components/index.js +27 -6
- package/dist/components/inputs/reactHookForm/provider/CustomFormProvider.js +0 -4
- package/dist/components/inputs/reactHookForm/text/DescriptionField.js +0 -3
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +1 -0
- package/dist/components/parameters/common/index.js +0 -2
- package/dist/components/parameters/common/limitreductions/columns-definitions.d.ts +7 -2
- package/dist/components/parameters/common/limitreductions/columns-definitions.js +16 -3
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.d.ts +3 -3
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-cell.js +4 -1
- package/dist/components/parameters/common/limitreductions/limit-reduction-table-row.d.ts +2 -2
- package/dist/components/parameters/common/name-element-editor/name-element-editor-form.js +5 -28
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.d.ts +2 -2
- package/dist/components/parameters/common/name-element-editor/name-element-editor-utils.js +2 -2
- package/dist/components/parameters/common/parameters-edition-dialog-props.d.ts +0 -4
- package/dist/components/parameters/common/parameters-edition-dialog-props.js +1 -14
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-cell.d.ts +2 -2
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table-row.d.ts +2 -2
- package/dist/components/parameters/common/voltage-level-table/custom-voltage-level-table.d.ts +2 -2
- package/dist/components/parameters/index.d.ts +1 -1
- package/dist/components/parameters/index.js +27 -6
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-dialog.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +1 -1
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +0 -2
- package/dist/components/parameters/network-visualizations/map-parameters.js +1 -1
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +1 -1
- package/dist/components/parameters/parameters-style.d.ts +0 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-dialog.js +8 -2
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -1
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +1 -1
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +1 -1
- package/dist/components/parameters/sensi/columns-definitions.d.ts +222 -0
- package/dist/components/parameters/sensi/columns-definitions.js +305 -0
- package/dist/components/parameters/sensi/constants.d.ts +29 -0
- package/dist/components/parameters/sensi/constants.js +48 -0
- package/dist/components/parameters/sensi/index.d.ts +10 -0
- package/dist/components/parameters/sensi/index.js +29 -0
- package/dist/components/parameters/sensi/sensitivity-Flow-parameters.d.ts +7 -0
- package/dist/components/parameters/sensi/sensitivity-Flow-parameters.js +72 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.d.ts +2 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-dialog.js +113 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.d.ts +8 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +129 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.d.ts +13 -0
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-inline.js +185 -0
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.d.ts +16 -0
- package/dist/components/parameters/sensi/sensitivity-parameters-selector.js +274 -0
- package/dist/components/parameters/sensi/sensitivity-table.d.ts +15 -0
- package/dist/components/parameters/sensi/sensitivity-table.js +134 -0
- package/dist/components/parameters/sensi/table-cell.d.ts +8 -0
- package/dist/components/parameters/sensi/table-cell.js +86 -0
- package/dist/components/parameters/sensi/table-row.d.ts +11 -0
- package/dist/components/parameters/sensi/table-row.js +42 -0
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.d.ts +49 -0
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +413 -0
- package/dist/components/parameters/sensi/utils.d.ts +419 -0
- package/dist/components/parameters/sensi/utils.js +357 -0
- package/dist/components/parameters/voltage-init/general-parameters.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/use-create-row-data-sensi.d.ts +4 -0
- package/dist/hooks/use-create-row-data-sensi.js +20 -0
- package/dist/index.js +29 -6
- package/dist/services/sensitivity-analysis.d.ts +12 -0
- package/dist/services/sensitivity-analysis.js +87 -0
- package/dist/translations/en/parameters.d.ts +64 -0
- package/dist/translations/en/parameters.js +70 -1
- package/dist/translations/fr/parameters.d.ts +64 -0
- package/dist/translations/fr/parameters.js +70 -1
- package/package.json +1 -1
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import "../../../utils/yupConfig.js";
|
|
2
|
+
import { FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD, ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD, FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD, PARAMETER_SENSI_NODES, EQUIPMENTS_IN_VOLTAGE_REGULATION, SUPERVISED_VOLTAGE_LEVELS, PARAMETER_SENSI_PST, PSTS, ACTIVATED, PARAMETER_SENSI_HVDC, HVDC_LINES, PARAMETER_SENSI_INJECTION, INJECTIONS, PARAMETER_SENSI_INJECTIONS_SET, DISTRIBUTION_TYPE, COUNT, CONTINGENCIES, SENSITIVITY_TYPE, MONITORED_BRANCHES, CONTAINER_NAME, CONTAINER_ID } from "./constants.js";
|
|
3
|
+
import "../../../utils/conversionUtils.js";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import "@mui/icons-material";
|
|
6
|
+
import "../../../utils/types/equipmentType.js";
|
|
7
|
+
import { DistributionType, SensitivityType } from "../../../utils/types/sensitivity-analysis.type.js";
|
|
8
|
+
import { PROVIDER } from "../common/constant.js";
|
|
9
|
+
import "@mui/material";
|
|
10
|
+
import "react-intl";
|
|
11
|
+
import "react";
|
|
12
|
+
import "localized-countries";
|
|
13
|
+
import "localized-countries/data/fr";
|
|
14
|
+
import "localized-countries/data/en";
|
|
15
|
+
import "notistack";
|
|
16
|
+
import "react-hook-form";
|
|
17
|
+
import "../../inputs/reactHookForm/provider/CustomFormProvider.js";
|
|
18
|
+
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
19
|
+
import "../../dialogs/elementSaveDialog/ElementSaveDialog.js";
|
|
20
|
+
import "../../treeViewFinder/TreeViewFinder.js";
|
|
21
|
+
import * as yup from "yup";
|
|
22
|
+
import "../../overflowableText/OverflowableText.js";
|
|
23
|
+
import { NAME } from "../../inputs/reactHookForm/constants.js";
|
|
24
|
+
import "../../inputs/reactHookForm/agGridTable/BottomRightButtons.js";
|
|
25
|
+
import "../../customAGGrid/customAggrid.js";
|
|
26
|
+
import "ag-grid-community";
|
|
27
|
+
import "react-papaparse";
|
|
28
|
+
import "react-csv-downloader";
|
|
29
|
+
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
30
|
+
import "@react-querybuilder/material";
|
|
31
|
+
import "../../filter/expert/expertFilterConstants.js";
|
|
32
|
+
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
33
|
+
import "uuid";
|
|
34
|
+
import "../../inputs/reactQueryBuilder/PropertyValueEditor.js";
|
|
35
|
+
import "react-querybuilder";
|
|
36
|
+
import "../common/widget/parameter-line-slider.js";
|
|
37
|
+
import "../common/limitreductions/columns-definitions.js";
|
|
38
|
+
import "../../filter/HeaderFilterForm.js";
|
|
39
|
+
import { getNameElementEditorSchema } from "../common/name-element-editor/name-element-editor-utils.js";
|
|
40
|
+
import { ID } from "../voltage-init/constants.js";
|
|
41
|
+
import "@hookform/resolvers/yup";
|
|
42
|
+
import "@hello-pangea/dnd";
|
|
43
|
+
const getMonitoredBranchesSchema = () => {
|
|
44
|
+
return {
|
|
45
|
+
[MONITORED_BRANCHES]: yup.array().of(
|
|
46
|
+
yup.object().shape({
|
|
47
|
+
[ID]: yup.string().required(),
|
|
48
|
+
[NAME]: yup.string().required()
|
|
49
|
+
})
|
|
50
|
+
).required().when([ACTIVATED], {
|
|
51
|
+
is: (activated) => activated,
|
|
52
|
+
then: (schema) => schema.min(1, "FieldIsRequired")
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const getSensitivityTypeSchema = () => {
|
|
57
|
+
return {
|
|
58
|
+
[SENSITIVITY_TYPE]: yup.mixed().oneOf(Object.values(SensitivityType)).when([ACTIVATED], {
|
|
59
|
+
is: (activated) => activated,
|
|
60
|
+
then: (schema) => schema.required()
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
const getContingenciesSchema = () => {
|
|
65
|
+
return {
|
|
66
|
+
[CONTINGENCIES]: yup.array().of(
|
|
67
|
+
yup.object().shape({
|
|
68
|
+
[ID]: yup.string().required(),
|
|
69
|
+
[NAME]: yup.string().required()
|
|
70
|
+
})
|
|
71
|
+
),
|
|
72
|
+
[ACTIVATED]: yup.boolean().required(),
|
|
73
|
+
[COUNT]: yup.number().nullable()
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
const getSensiHVDCsFormSchema = () => ({
|
|
77
|
+
[PARAMETER_SENSI_HVDC]: yup.array().of(
|
|
78
|
+
yup.object().shape({
|
|
79
|
+
...getMonitoredBranchesSchema(),
|
|
80
|
+
...getSensitivityTypeSchema(),
|
|
81
|
+
[HVDC_LINES]: yup.array().of(
|
|
82
|
+
yup.object().shape({
|
|
83
|
+
[ID]: yup.string().required(),
|
|
84
|
+
[NAME]: yup.string().required()
|
|
85
|
+
})
|
|
86
|
+
).required().when([ACTIVATED], {
|
|
87
|
+
is: (activated) => activated,
|
|
88
|
+
then: (schema) => schema.min(1, "FieldIsRequired")
|
|
89
|
+
}),
|
|
90
|
+
...getContingenciesSchema()
|
|
91
|
+
})
|
|
92
|
+
)
|
|
93
|
+
});
|
|
94
|
+
const getSensiHvdcformatNewParams = (newParams) => {
|
|
95
|
+
var _a;
|
|
96
|
+
return {
|
|
97
|
+
[PARAMETER_SENSI_HVDC]: (_a = newParams.sensitivityHVDC) == null ? void 0 : _a.map((sensitivityHVDCs) => {
|
|
98
|
+
var _a2;
|
|
99
|
+
return {
|
|
100
|
+
[MONITORED_BRANCHES]: sensitivityHVDCs[MONITORED_BRANCHES].map((container) => {
|
|
101
|
+
return {
|
|
102
|
+
[CONTAINER_ID]: container[ID],
|
|
103
|
+
[CONTAINER_NAME]: container[NAME]
|
|
104
|
+
};
|
|
105
|
+
}),
|
|
106
|
+
[HVDC_LINES]: sensitivityHVDCs[HVDC_LINES].map((container) => {
|
|
107
|
+
return {
|
|
108
|
+
[CONTAINER_ID]: container[ID],
|
|
109
|
+
[CONTAINER_NAME]: container[NAME]
|
|
110
|
+
};
|
|
111
|
+
}),
|
|
112
|
+
[SENSITIVITY_TYPE]: sensitivityHVDCs[SENSITIVITY_TYPE],
|
|
113
|
+
[CONTINGENCIES]: (_a2 = sensitivityHVDCs[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
|
|
114
|
+
return {
|
|
115
|
+
[CONTAINER_ID]: container[ID],
|
|
116
|
+
[CONTAINER_NAME]: container[NAME]
|
|
117
|
+
};
|
|
118
|
+
}),
|
|
119
|
+
[ACTIVATED]: sensitivityHVDCs[ACTIVATED]
|
|
120
|
+
};
|
|
121
|
+
})
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
const getSensiInjectionsFormSchema = () => ({
|
|
125
|
+
[PARAMETER_SENSI_INJECTION]: yup.array().of(
|
|
126
|
+
yup.object().shape({
|
|
127
|
+
...getMonitoredBranchesSchema(),
|
|
128
|
+
[INJECTIONS]: yup.array().of(
|
|
129
|
+
yup.object().shape({
|
|
130
|
+
[ID]: yup.string().required(),
|
|
131
|
+
[NAME]: yup.string().required()
|
|
132
|
+
})
|
|
133
|
+
).required().when([ACTIVATED], {
|
|
134
|
+
is: (activated) => activated,
|
|
135
|
+
then: (schema) => schema.min(1, "FieldIsRequired")
|
|
136
|
+
}),
|
|
137
|
+
...getContingenciesSchema()
|
|
138
|
+
})
|
|
139
|
+
)
|
|
140
|
+
});
|
|
141
|
+
const getSensiInjectionsformatNewParams = (newParams) => {
|
|
142
|
+
var _a;
|
|
143
|
+
return {
|
|
144
|
+
[PARAMETER_SENSI_INJECTION]: (_a = newParams.sensitivityInjection) == null ? void 0 : _a.map((sensitivityInjections) => {
|
|
145
|
+
var _a2;
|
|
146
|
+
return {
|
|
147
|
+
[MONITORED_BRANCHES]: sensitivityInjections[MONITORED_BRANCHES].map((container) => {
|
|
148
|
+
return {
|
|
149
|
+
[CONTAINER_ID]: container[ID],
|
|
150
|
+
[CONTAINER_NAME]: container[NAME]
|
|
151
|
+
};
|
|
152
|
+
}),
|
|
153
|
+
[INJECTIONS]: sensitivityInjections[INJECTIONS].map((container) => {
|
|
154
|
+
return {
|
|
155
|
+
[CONTAINER_ID]: container[ID],
|
|
156
|
+
[CONTAINER_NAME]: container[NAME]
|
|
157
|
+
};
|
|
158
|
+
}),
|
|
159
|
+
[CONTINGENCIES]: (_a2 = sensitivityInjections[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
|
|
160
|
+
return {
|
|
161
|
+
[CONTAINER_ID]: container[ID],
|
|
162
|
+
[CONTAINER_NAME]: container[NAME]
|
|
163
|
+
};
|
|
164
|
+
}),
|
|
165
|
+
[ACTIVATED]: sensitivityInjections[ACTIVATED]
|
|
166
|
+
};
|
|
167
|
+
})
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
const getSensiInjectionsSetFormSchema = () => ({
|
|
171
|
+
[PARAMETER_SENSI_INJECTIONS_SET]: yup.array().of(
|
|
172
|
+
yup.object().shape({
|
|
173
|
+
...getMonitoredBranchesSchema(),
|
|
174
|
+
[INJECTIONS]: yup.array().of(
|
|
175
|
+
yup.object().shape({
|
|
176
|
+
[ID]: yup.string().required(),
|
|
177
|
+
[NAME]: yup.string().required()
|
|
178
|
+
})
|
|
179
|
+
).required().when([ACTIVATED], {
|
|
180
|
+
is: (activated) => activated,
|
|
181
|
+
then: (schema) => schema.min(1, "FieldIsRequired")
|
|
182
|
+
}),
|
|
183
|
+
[DISTRIBUTION_TYPE]: yup.mixed().oneOf(Object.values(DistributionType)).when([ACTIVATED], {
|
|
184
|
+
is: (activated) => activated,
|
|
185
|
+
then: (schema) => schema.required()
|
|
186
|
+
}),
|
|
187
|
+
...getContingenciesSchema()
|
|
188
|
+
})
|
|
189
|
+
)
|
|
190
|
+
});
|
|
191
|
+
const getGenericRowNewParams = (newRowParams) => {
|
|
192
|
+
var _a, _b, _c, _d;
|
|
193
|
+
return {
|
|
194
|
+
[MONITORED_BRANCHES]: newRowParams[MONITORED_BRANCHES].map((container) => container[ID]),
|
|
195
|
+
[INJECTIONS]: (_a = newRowParams[INJECTIONS]) == null ? void 0 : _a.map((container) => container[ID]),
|
|
196
|
+
[HVDC_LINES]: (_b = newRowParams[HVDC_LINES]) == null ? void 0 : _b.map((container) => container[ID]),
|
|
197
|
+
[PSTS]: (_c = newRowParams[PSTS]) == null ? void 0 : _c.map((container) => container[ID]),
|
|
198
|
+
[CONTINGENCIES]: (_d = newRowParams[CONTINGENCIES]) == null ? void 0 : _d.map((container) => container[ID])
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
const getSensiInjectionsSetformatNewParams = (newParams) => {
|
|
202
|
+
var _a;
|
|
203
|
+
return {
|
|
204
|
+
[PARAMETER_SENSI_INJECTIONS_SET]: (_a = newParams.sensitivityInjectionsSet) == null ? void 0 : _a.map((sensitivityInjectionSet) => {
|
|
205
|
+
var _a2;
|
|
206
|
+
return {
|
|
207
|
+
[MONITORED_BRANCHES]: sensitivityInjectionSet[MONITORED_BRANCHES].map((container) => {
|
|
208
|
+
return {
|
|
209
|
+
[CONTAINER_ID]: container[ID],
|
|
210
|
+
[CONTAINER_NAME]: container[NAME]
|
|
211
|
+
};
|
|
212
|
+
}),
|
|
213
|
+
[INJECTIONS]: sensitivityInjectionSet[INJECTIONS].map((container) => {
|
|
214
|
+
return {
|
|
215
|
+
[CONTAINER_ID]: container[ID],
|
|
216
|
+
[CONTAINER_NAME]: container[NAME]
|
|
217
|
+
};
|
|
218
|
+
}),
|
|
219
|
+
[DISTRIBUTION_TYPE]: sensitivityInjectionSet[DISTRIBUTION_TYPE],
|
|
220
|
+
[CONTINGENCIES]: (_a2 = sensitivityInjectionSet[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
|
|
221
|
+
return {
|
|
222
|
+
[CONTAINER_ID]: container[ID],
|
|
223
|
+
[CONTAINER_NAME]: container[NAME]
|
|
224
|
+
};
|
|
225
|
+
}),
|
|
226
|
+
[ACTIVATED]: sensitivityInjectionSet[ACTIVATED]
|
|
227
|
+
};
|
|
228
|
+
})
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
const getSensiNodesFormSchema = () => ({
|
|
232
|
+
[PARAMETER_SENSI_NODES]: yup.array().of(
|
|
233
|
+
yup.object().shape({
|
|
234
|
+
[SUPERVISED_VOLTAGE_LEVELS]: yup.array().of(
|
|
235
|
+
yup.object().shape({
|
|
236
|
+
[ID]: yup.string().required(),
|
|
237
|
+
[NAME]: yup.string().required()
|
|
238
|
+
})
|
|
239
|
+
),
|
|
240
|
+
[EQUIPMENTS_IN_VOLTAGE_REGULATION]: yup.array().of(
|
|
241
|
+
yup.object().shape({
|
|
242
|
+
[ID]: yup.string().required(),
|
|
243
|
+
[NAME]: yup.string().required()
|
|
244
|
+
})
|
|
245
|
+
),
|
|
246
|
+
...getContingenciesSchema()
|
|
247
|
+
})
|
|
248
|
+
)
|
|
249
|
+
});
|
|
250
|
+
const getSensiNodesformatNewParams = (newParams) => {
|
|
251
|
+
var _a;
|
|
252
|
+
return {
|
|
253
|
+
[PARAMETER_SENSI_NODES]: (_a = newParams.sensitivityNodes) == null ? void 0 : _a.map((sensitivityNode) => {
|
|
254
|
+
var _a2, _b, _c;
|
|
255
|
+
return {
|
|
256
|
+
[SUPERVISED_VOLTAGE_LEVELS]: (_a2 = sensitivityNode[SUPERVISED_VOLTAGE_LEVELS]) == null ? void 0 : _a2.map((container) => {
|
|
257
|
+
return {
|
|
258
|
+
[CONTAINER_ID]: container[ID],
|
|
259
|
+
[CONTAINER_NAME]: container[NAME]
|
|
260
|
+
};
|
|
261
|
+
}),
|
|
262
|
+
[EQUIPMENTS_IN_VOLTAGE_REGULATION]: (_b = sensitivityNode[EQUIPMENTS_IN_VOLTAGE_REGULATION]) == null ? void 0 : _b.map(
|
|
263
|
+
(container) => {
|
|
264
|
+
return {
|
|
265
|
+
[CONTAINER_ID]: container[ID],
|
|
266
|
+
[CONTAINER_NAME]: container[NAME]
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
),
|
|
270
|
+
[CONTINGENCIES]: (_c = sensitivityNode[CONTINGENCIES]) == null ? void 0 : _c.map((container) => {
|
|
271
|
+
return {
|
|
272
|
+
[CONTAINER_ID]: container[ID],
|
|
273
|
+
[CONTAINER_NAME]: container[NAME]
|
|
274
|
+
};
|
|
275
|
+
}),
|
|
276
|
+
[ACTIVATED]: sensitivityNode[ACTIVATED]
|
|
277
|
+
};
|
|
278
|
+
})
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
const getSensiPSTsFormSchema = () => ({
|
|
282
|
+
[PARAMETER_SENSI_PST]: yup.array().of(
|
|
283
|
+
yup.object().shape({
|
|
284
|
+
...getMonitoredBranchesSchema(),
|
|
285
|
+
...getSensitivityTypeSchema(),
|
|
286
|
+
[PSTS]: yup.array().of(
|
|
287
|
+
yup.object().shape({
|
|
288
|
+
[ID]: yup.string().required(),
|
|
289
|
+
[NAME]: yup.string().required()
|
|
290
|
+
})
|
|
291
|
+
).required().when([ACTIVATED], {
|
|
292
|
+
is: (activated) => activated,
|
|
293
|
+
then: (schema) => schema.min(1, "FieldIsRequired")
|
|
294
|
+
}),
|
|
295
|
+
...getContingenciesSchema()
|
|
296
|
+
})
|
|
297
|
+
)
|
|
298
|
+
});
|
|
299
|
+
const getSensiPstformatNewParams = (newParams) => {
|
|
300
|
+
var _a;
|
|
301
|
+
return {
|
|
302
|
+
[PARAMETER_SENSI_PST]: (_a = newParams.sensitivityPST) == null ? void 0 : _a.map((sensitivityPSTs) => {
|
|
303
|
+
var _a2;
|
|
304
|
+
return {
|
|
305
|
+
[MONITORED_BRANCHES]: sensitivityPSTs[MONITORED_BRANCHES].map((container) => {
|
|
306
|
+
return {
|
|
307
|
+
[CONTAINER_ID]: container[ID],
|
|
308
|
+
[CONTAINER_NAME]: container[NAME]
|
|
309
|
+
};
|
|
310
|
+
}),
|
|
311
|
+
[PSTS]: sensitivityPSTs[PSTS].map((container) => {
|
|
312
|
+
return {
|
|
313
|
+
[CONTAINER_ID]: container[ID],
|
|
314
|
+
[CONTAINER_NAME]: container[NAME]
|
|
315
|
+
};
|
|
316
|
+
}),
|
|
317
|
+
[SENSITIVITY_TYPE]: sensitivityPSTs[SENSITIVITY_TYPE],
|
|
318
|
+
[CONTINGENCIES]: (_a2 = sensitivityPSTs[CONTINGENCIES]) == null ? void 0 : _a2.map((container) => {
|
|
319
|
+
return {
|
|
320
|
+
[CONTAINER_ID]: container[ID],
|
|
321
|
+
[CONTAINER_NAME]: container[NAME]
|
|
322
|
+
};
|
|
323
|
+
}),
|
|
324
|
+
[ACTIVATED]: sensitivityPSTs[ACTIVATED]
|
|
325
|
+
};
|
|
326
|
+
})
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
const formSchema = yup.object().shape({
|
|
330
|
+
[PROVIDER]: yup.string().required(),
|
|
331
|
+
[FLOW_FLOW_SENSITIVITY_VALUE_THRESHOLD]: yup.number().required(),
|
|
332
|
+
[ANGLE_FLOW_SENSITIVITY_VALUE_THRESHOLD]: yup.number().required(),
|
|
333
|
+
[FLOW_VOLTAGE_SENSITIVITY_VALUE_THRESHOLD]: yup.number().required(),
|
|
334
|
+
...getSensiInjectionsSetFormSchema(),
|
|
335
|
+
...getSensiInjectionsFormSchema(),
|
|
336
|
+
...getSensiHVDCsFormSchema(),
|
|
337
|
+
...getSensiPSTsFormSchema(),
|
|
338
|
+
...getSensiNodesFormSchema()
|
|
339
|
+
}).required();
|
|
340
|
+
const getFormSchema = (name) => {
|
|
341
|
+
return formSchema.concat(getNameElementEditorSchema(name));
|
|
342
|
+
};
|
|
343
|
+
export {
|
|
344
|
+
formSchema,
|
|
345
|
+
getFormSchema,
|
|
346
|
+
getGenericRowNewParams,
|
|
347
|
+
getSensiHVDCsFormSchema,
|
|
348
|
+
getSensiHvdcformatNewParams,
|
|
349
|
+
getSensiInjectionsFormSchema,
|
|
350
|
+
getSensiInjectionsSetFormSchema,
|
|
351
|
+
getSensiInjectionsSetformatNewParams,
|
|
352
|
+
getSensiInjectionsformatNewParams,
|
|
353
|
+
getSensiNodesFormSchema,
|
|
354
|
+
getSensiNodesformatNewParams,
|
|
355
|
+
getSensiPSTsFormSchema,
|
|
356
|
+
getSensiPstformatNewParams
|
|
357
|
+
};
|
|
@@ -5,7 +5,6 @@ import { FormattedMessage } from "react-intl";
|
|
|
5
5
|
import { Grid, Alert, Box } from "@mui/material";
|
|
6
6
|
import { GENERAL, GENERAL_APPLY_MODIFICATIONS, UPDATE_BUS_VOLTAGE, REACTIVE_SLACKS_THRESHOLD, SHUNT_COMPENSATOR_ACTIVATION_THRESHOLD } from "./constants.js";
|
|
7
7
|
import { ReactivePowerAdornment } from "../common/constant.js";
|
|
8
|
-
import "../../../utils/yupConfig.js";
|
|
9
8
|
import { LineSeparator } from "../common/line-separator.js";
|
|
10
9
|
import { parametersStyles } from "../parameters-style.js";
|
|
11
10
|
import "../../../utils/types/equipmentType.js";
|
|
@@ -27,6 +26,7 @@ import "react-papaparse";
|
|
|
27
26
|
import "react-csv-downloader";
|
|
28
27
|
import "../../inputs/reactHookForm/numbers/RangeInput.js";
|
|
29
28
|
import "../../../utils/conversionUtils.js";
|
|
29
|
+
import "../../../utils/yupConfig.js";
|
|
30
30
|
import "@react-querybuilder/material";
|
|
31
31
|
import "../../filter/expert/expertFilterConstants.js";
|
|
32
32
|
import "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
package/dist/hooks/index.d.ts
CHANGED
package/dist/hooks/index.js
CHANGED
|
@@ -11,11 +11,13 @@ import { useSnackMessage } from "./useSnackMessage.js";
|
|
|
11
11
|
import { useFormatLabelWithUnit } from "./useFormatLabelWithUnit.js";
|
|
12
12
|
import { useSelectAppearance } from "./useSelectAppearance.js";
|
|
13
13
|
import { OptionalServicesStatus, useParametersBackend } from "./use-parameters-backend.js";
|
|
14
|
+
import { useCreateRowDataSensi } from "./use-create-row-data-sensi.js";
|
|
14
15
|
export {
|
|
15
16
|
OptionalServicesStatus,
|
|
16
17
|
getComputedLanguage,
|
|
17
18
|
getSystemLanguage,
|
|
18
19
|
useConfidentialityWarning,
|
|
20
|
+
useCreateRowDataSensi,
|
|
19
21
|
useDebounce,
|
|
20
22
|
useFormatLabelWithUnit,
|
|
21
23
|
useIntlRef,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ISensiParameters } from '../components/parameters/sensi/columns-definitions';
|
|
2
|
+
export declare function useCreateRowDataSensi(sensiParam: ISensiParameters): readonly [() => {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}[], import('react-hook-form').UseFieldArrayReturn<import('react-hook-form').FieldValues, string, "id">];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useFieldArray } from "react-hook-form";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { COUNT } from "../components/parameters/sensi/constants.js";
|
|
4
|
+
function useCreateRowDataSensi(sensiParam) {
|
|
5
|
+
const useFieldArrayOutput = useFieldArray({
|
|
6
|
+
name: sensiParam.name || ""
|
|
7
|
+
});
|
|
8
|
+
const newRowData = useMemo(() => {
|
|
9
|
+
const rowData = { [COUNT]: 0 };
|
|
10
|
+
sensiParam.columnsDef.forEach((column) => {
|
|
11
|
+
rowData[column.dataKey] = column.initialValue;
|
|
12
|
+
});
|
|
13
|
+
return rowData;
|
|
14
|
+
}, [sensiParam.columnsDef]);
|
|
15
|
+
const createNewRowData = () => [newRowData];
|
|
16
|
+
return [createNewRowData, useFieldArrayOutput];
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
useCreateRowDataSensi
|
|
20
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -130,7 +130,6 @@ import { LeftPanelCloseIcon } from "./components/icons/LeftPanelCloseIcon.js";
|
|
|
130
130
|
import { DeviceHubIcon } from "./components/icons/DeviceHubIcon.js";
|
|
131
131
|
import { ComputingType, formatComputingTypeLabel, isValidComputingType } from "./components/parameters/common/computing-type.js";
|
|
132
132
|
import { PARAM_SA_FLOW_PROPORTIONAL_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_HIGH_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_LOW_VOLTAGE_ABSOLUTE_THRESHOLD, PARAM_SA_LOW_VOLTAGE_PROPORTIONAL_THRESHOLD, PARAM_SA_PROVIDER, PROVIDER, ReactivePowerAdornment, VOLTAGE_LEVEL, VoltageAdornment } from "./components/parameters/common/constant.js";
|
|
133
|
-
import { getDialogParametersFormSchema } from "./components/parameters/common/parameters-edition-dialog-props.js";
|
|
134
133
|
import { LineSeparator } from "./components/parameters/common/line-separator.js";
|
|
135
134
|
import { LabelledButton, SwitchWithLabel, TabPanel } from "./components/parameters/common/parameters.js";
|
|
136
135
|
import { CreateParameterDialog } from "./components/parameters/common/parameters-creation-dialog.js";
|
|
@@ -152,7 +151,6 @@ import { CENTER_LABEL, COMPONENT_LIBRARY, DIAGONAL_LABEL, INIT_NAD_WITH_GEO_DATA
|
|
|
152
151
|
import { MAP_BASEMAP_CARTO, MAP_BASEMAP_CARTO_NOLABEL, MAP_BASEMAP_ETALAB, MAP_BASEMAP_MAPBOX, SubstationLayout } from "./components/parameters/network-visualizations/network-visualizations.types.js";
|
|
153
152
|
import { NetworkVisualizationParametersInline } from "./components/parameters/network-visualizations/network-visualizations-parameters-inline.js";
|
|
154
153
|
import { NetworkVisualizationsParametersEditionDialog } from "./components/parameters/network-visualizations/network-visualizations-parameters-dialog.js";
|
|
155
|
-
import { getTabIndicatorStyle, getTabStyle, parametersStyles } from "./components/parameters/parameters-style.js";
|
|
156
154
|
import { BALANCE_TYPE, COMMON_PARAMETERS, CONNECTED_COMPONENT_MODE, COUNTRIES_TO_BALANCE, DC, DC_POWER_FACTOR, DC_USE_TRANSFORMER_RATIO, DEFAULT_LIMIT_REDUCTION_VALUE, DISTRIBUTED_SLACK, HVDC_AC_EMULATION, MAX_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION, PARAM_LIMIT_REDUCTION, PARAM_PROVIDER_OPENLOADFLOW, PHASE_SHIFTER_REGULATION_ON, READ_SLACK_BUS, SHUNT_COMPENSATOR_VOLTAGE_CONTROL_ON, SPECIFIC_PARAMETERS, TWT_SPLIT_SHUNT_ADMITTANCE, USE_REACTIVE_LIMITS, VOLTAGE_INIT_MODE, WRITE_SLACK_BUS, alertThresholdMarks } from "./components/parameters/loadflow/constants.js";
|
|
157
155
|
import { LoadFlowParametersInline } from "./components/parameters/loadflow/load-flow-parameters-inline.js";
|
|
158
156
|
import { LoadFlowParametersEditionDialog } from "./components/parameters/loadflow/load-flow-parameters-dialog.js";
|
|
@@ -165,6 +163,10 @@ import { VoltageInitParametersEditionDialog } from "./components/parameters/volt
|
|
|
165
163
|
import { VoltageInitParametersInLine } from "./components/parameters/voltage-init/voltage-init-parameters-inline.js";
|
|
166
164
|
import { SecurityAnalysisParametersInline } from "./components/parameters/security-analysis/security-analysis-parameters-inline.js";
|
|
167
165
|
import { SecurityAnalysisParametersDialog } from "./components/parameters/security-analysis/security-analysis-parameters-dialog.js";
|
|
166
|
+
import { SensitivityAnalysisParametersInline } from "./components/parameters/sensi/sensitivity-analysis-parameters-inline.js";
|
|
167
|
+
import { SensitivityAnalysisParametersDialog } from "./components/parameters/sensi/sensitivity-analysis-parameters-dialog.js";
|
|
168
|
+
import { COLUMNS_DEFINITIONS_HVDCS, COLUMNS_DEFINITIONS_INJECTIONS, COLUMNS_DEFINITIONS_INJECTIONS_SET, COLUMNS_DEFINITIONS_NODES, COLUMNS_DEFINITIONS_PSTS, EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES, HVDC_EQUIPMENT_TYPES, INJECTIONS_EQUIPMENT_TYPES, INJECTION_DISTRIBUTION_TYPES, MONITORED_BRANCHES_EQUIPMENT_TYPES, MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES, PSTS_EQUIPMENT_TYPES, SENSITIVITY_TYPES, SensiBranchesTabValues, SensiHvdcs, SensiInjection, SensiInjectionsSet, SensiNodes, SensiPsts, SensiTabValues } from "./components/parameters/sensi/columns-definitions.js";
|
|
169
|
+
import { SensitivityTable } from "./components/parameters/sensi/sensitivity-table.js";
|
|
168
170
|
import { CustomMenuItem, CustomNestedMenuItem } from "./components/menus/custom-nested-menu.js";
|
|
169
171
|
import { useStateBoolean } from "./hooks/customStates/useStateBoolean.js";
|
|
170
172
|
import { useStateNumber } from "./hooks/customStates/useStateNumber.js";
|
|
@@ -179,6 +181,7 @@ import { useSnackMessage } from "./hooks/useSnackMessage.js";
|
|
|
179
181
|
import { useFormatLabelWithUnit } from "./hooks/useFormatLabelWithUnit.js";
|
|
180
182
|
import { useSelectAppearance } from "./hooks/useSelectAppearance.js";
|
|
181
183
|
import { OptionalServicesStatus, useParametersBackend } from "./hooks/use-parameters-backend.js";
|
|
184
|
+
import { useCreateRowDataSensi } from "./hooks/use-create-row-data-sensi.js";
|
|
182
185
|
import { LOGOUT_ERROR, RESET_AUTHENTICATION_ROUTER_ERROR, SHOW_AUTH_INFO_LOGIN, SIGNIN_CALLBACK_ERROR, UNAUTHORIZED_USER_INFO, USER, USER_VALIDATION_ERROR, resetAuthenticationRouterError, setLoggedUser, setLogoutError, setShowAuthenticationRouterLogin, setSignInCallbackError, setUnauthorizedUserInfo, setUserValidationError } from "./redux/actions/authActions.js";
|
|
183
186
|
import { getUserToken, setCommonStore } from "./redux/commonStore.js";
|
|
184
187
|
import { backendFetch, backendFetchJson, backendFetchText, catchErrorHandler, getRequestParamFromList } from "./services/utils.js";
|
|
@@ -283,7 +286,12 @@ export {
|
|
|
283
286
|
BottomRightButtons,
|
|
284
287
|
BusBar,
|
|
285
288
|
CENTER_LABEL,
|
|
289
|
+
COLUMNS_DEFINITIONS_HVDCS,
|
|
290
|
+
COLUMNS_DEFINITIONS_INJECTIONS,
|
|
291
|
+
COLUMNS_DEFINITIONS_INJECTIONS_SET,
|
|
286
292
|
COLUMNS_DEFINITIONS_LIMIT_REDUCTIONS,
|
|
293
|
+
COLUMNS_DEFINITIONS_NODES,
|
|
294
|
+
COLUMNS_DEFINITIONS_PSTS,
|
|
287
295
|
COMBINATOR_OPTIONS,
|
|
288
296
|
COMMON_PARAMETERS,
|
|
289
297
|
COMPONENT_LIBRARY,
|
|
@@ -347,6 +355,7 @@ export {
|
|
|
347
355
|
DndTableBottomLeftButtons,
|
|
348
356
|
DndTableBottomRightButtons,
|
|
349
357
|
ENERGY_SOURCE_OPTIONS,
|
|
358
|
+
EQUIPMENTS_IN_VOLTAGE_REGULATION_TYPES,
|
|
350
359
|
EQUIPMENT_TYPE,
|
|
351
360
|
EXPERT_FILTER_EQUIPMENTS,
|
|
352
361
|
EXPERT_FILTER_FIELDS,
|
|
@@ -395,11 +404,14 @@ export {
|
|
|
395
404
|
GroupValueEditor,
|
|
396
405
|
HIGH_VOLTAGE_LIMIT,
|
|
397
406
|
HVDC_AC_EMULATION,
|
|
407
|
+
HVDC_EQUIPMENT_TYPES,
|
|
398
408
|
HelperPreviousValue,
|
|
399
409
|
Hvdc,
|
|
400
410
|
HvdcType,
|
|
401
411
|
ID,
|
|
402
412
|
INIT_NAD_WITH_GEO_DATA,
|
|
413
|
+
INJECTIONS_EQUIPMENT_TYPES,
|
|
414
|
+
INJECTION_DISTRIBUTION_TYPES,
|
|
403
415
|
INTL_LINE_FLOW_MODE_OPTIONS,
|
|
404
416
|
INTL_MAP_BASE_MAP_OPTIONS,
|
|
405
417
|
INTL_SUBSTATION_LAYOUT_OPTIONS,
|
|
@@ -452,6 +464,8 @@ export {
|
|
|
452
464
|
MICRO_SIEMENS,
|
|
453
465
|
MIN_VALUE_ALLOWED_FOR_LIMIT_REDUCTION,
|
|
454
466
|
MODIFICATION_TYPES,
|
|
467
|
+
MONITORED_BRANCHES_EQUIPMENT_TYPES,
|
|
468
|
+
MONITORED_VOLTAGE_LEVELS_EQUIPMENT_TYPES,
|
|
455
469
|
MidFormError,
|
|
456
470
|
ModificationType,
|
|
457
471
|
ModifyElementSelection,
|
|
@@ -500,6 +514,7 @@ export {
|
|
|
500
514
|
PREFIX_STUDY_QUERIES,
|
|
501
515
|
PRIORITY,
|
|
502
516
|
PROVIDER,
|
|
517
|
+
PSTS_EQUIPMENT_TYPES,
|
|
503
518
|
ParameterFloat,
|
|
504
519
|
ParameterGroup,
|
|
505
520
|
ParameterLineDirectoryItemsInput,
|
|
@@ -528,6 +543,7 @@ export {
|
|
|
528
543
|
SEARCH_EQUIPMENTS,
|
|
529
544
|
SELECTED,
|
|
530
545
|
SELECTION_TYPE,
|
|
546
|
+
SENSITIVITY_TYPES,
|
|
531
547
|
SHORT_CIRCUIT_INITIAL_VOLTAGE_PROFILE_MODE,
|
|
532
548
|
SHORT_CIRCUIT_PREDEFINED_PARAMS,
|
|
533
549
|
SHORT_CIRCUIT_WITH_FEEDER_RESULT,
|
|
@@ -550,6 +566,16 @@ export {
|
|
|
550
566
|
SecurityAnalysisParametersInline,
|
|
551
567
|
SelectClearable,
|
|
552
568
|
SelectInput,
|
|
569
|
+
SensiBranchesTabValues,
|
|
570
|
+
SensiHvdcs,
|
|
571
|
+
SensiInjection,
|
|
572
|
+
SensiInjectionsSet,
|
|
573
|
+
SensiNodes,
|
|
574
|
+
SensiPsts,
|
|
575
|
+
SensiTabValues,
|
|
576
|
+
SensitivityAnalysisParametersDialog,
|
|
577
|
+
SensitivityAnalysisParametersInline,
|
|
578
|
+
SensitivityTable,
|
|
553
579
|
SensitivityType,
|
|
554
580
|
ShortCircuitParametersEditionDialog,
|
|
555
581
|
ShortCircuitParametersInLine,
|
|
@@ -679,7 +705,6 @@ export {
|
|
|
679
705
|
getCriteriaBasedFormData,
|
|
680
706
|
getCriteriaBasedSchema,
|
|
681
707
|
getDefaultLoadFlowProvider,
|
|
682
|
-
getDialogParametersFormSchema,
|
|
683
708
|
getEquipmentsInfosForSearchBar,
|
|
684
709
|
getExpertFilterEmptyFormData,
|
|
685
710
|
getExplicitNamingFilterEmptyFormData,
|
|
@@ -702,8 +727,6 @@ export {
|
|
|
702
727
|
getStudyShortCircuitParameters,
|
|
703
728
|
getStudyUrl,
|
|
704
729
|
getSystemLanguage,
|
|
705
|
-
getTabIndicatorStyle,
|
|
706
|
-
getTabStyle,
|
|
707
730
|
getUserToken,
|
|
708
731
|
getVoltageInitParameters,
|
|
709
732
|
getVoltageInitUrl,
|
|
@@ -743,7 +766,6 @@ export {
|
|
|
743
766
|
networkModificationsFr,
|
|
744
767
|
parametersEn,
|
|
745
768
|
parametersFr,
|
|
746
|
-
parametersStyles,
|
|
747
769
|
queryValidator,
|
|
748
770
|
recursiveRemove,
|
|
749
771
|
reportViewerEn,
|
|
@@ -791,6 +813,7 @@ export {
|
|
|
791
813
|
updateVoltageInitParameters,
|
|
792
814
|
useConfidentialityWarning,
|
|
793
815
|
useConvertValue,
|
|
816
|
+
useCreateRowDataSensi,
|
|
794
817
|
useCsvExport,
|
|
795
818
|
useCustomFormContext,
|
|
796
819
|
useDebounce,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UUID } from 'crypto';
|
|
2
|
+
import { SensitivityAnalysisFactorsCountParameters, SensitivityAnalysisParametersInfos } from '../utils';
|
|
3
|
+
export declare const getStudyUrl: (studyUuid: UUID | null) => string;
|
|
4
|
+
export declare const getStudyUrlWithNodeUuidAndRootNetworkUuid: (studyUuid: string | null | undefined, nodeUuid: string | undefined, rootNetworkUuid: string | undefined | null) => string;
|
|
5
|
+
export declare function getSensiUrl(): string;
|
|
6
|
+
export declare function fetchSensitivityAnalysisProviders(): Promise<string[]>;
|
|
7
|
+
export declare function getSensitivityAnalysisParameters(studyUuid: UUID): Promise<any>;
|
|
8
|
+
export declare function fetchSensitivityAnalysisParameters(parameterUuid: string): Promise<any>;
|
|
9
|
+
export declare function setSensitivityAnalysisParameters(studyUuid: UUID | null, newParams: SensitivityAnalysisParametersInfos | null): Promise<Response>;
|
|
10
|
+
export declare function getSensitivityAnalysisFactorsCount(studyUuid: UUID | null, currentNodeUuid: UUID, currentRootNetworkUuid: UUID, isInjectionsSet: boolean, newParams: SensitivityAnalysisFactorsCountParameters): Promise<Response>;
|
|
11
|
+
export declare function fetchDefaultSensitivityAnalysisProvider(): Promise<string>;
|
|
12
|
+
export declare function updateSensitivityAnalysisParameters(parameterUuid: UUID, newParams: any): Promise<Response>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { backendFetchJson, backendFetch, backendFetchText } from "./utils.js";
|
|
2
|
+
import { safeEncodeURIComponent } from "./security-analysis.js";
|
|
3
|
+
import { PREFIX_STUDY_QUERIES } from "./loadflow.js";
|
|
4
|
+
const GET_PARAMETERS_PREFIX = `${"api/gateway"}/sensitivity-analysis/v1/parameters`;
|
|
5
|
+
const PREFIX_SENSITIVITY_ANALYSIS_SERVER_QUERIES = `${"api/gateway"}/sensitivity-analysis`;
|
|
6
|
+
const getStudyUrl = (studyUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}`;
|
|
7
|
+
const getStudyUrlWithNodeUuidAndRootNetworkUuid = (studyUuid, nodeUuid, rootNetworkUuid) => `${PREFIX_STUDY_QUERIES}/v1/studies/${safeEncodeURIComponent(studyUuid)}/root-networks/${safeEncodeURIComponent(
|
|
8
|
+
rootNetworkUuid
|
|
9
|
+
)}/nodes/${safeEncodeURIComponent(nodeUuid)}`;
|
|
10
|
+
function getSensiUrl() {
|
|
11
|
+
return `${PREFIX_SENSITIVITY_ANALYSIS_SERVER_QUERIES}/v1/`;
|
|
12
|
+
}
|
|
13
|
+
function fetchSensitivityAnalysisProviders() {
|
|
14
|
+
console.info("fetch sensitivity analysis providers");
|
|
15
|
+
const url = `${getSensiUrl()}providers`;
|
|
16
|
+
console.debug(url);
|
|
17
|
+
return backendFetchJson(url);
|
|
18
|
+
}
|
|
19
|
+
function getSensitivityAnalysisParameters(studyUuid) {
|
|
20
|
+
console.info("get sensitivity analysis parameters");
|
|
21
|
+
const url = `${getStudyUrl(studyUuid)}/sensitivity-analysis/parameters`;
|
|
22
|
+
console.debug(url);
|
|
23
|
+
return backendFetchJson(url);
|
|
24
|
+
}
|
|
25
|
+
function fetchSensitivityAnalysisParameters(parameterUuid) {
|
|
26
|
+
console.info("get sensitivity analysis parameters");
|
|
27
|
+
const url = `${GET_PARAMETERS_PREFIX}/${parameterUuid}`;
|
|
28
|
+
console.debug(url);
|
|
29
|
+
return backendFetchJson(url);
|
|
30
|
+
}
|
|
31
|
+
function setSensitivityAnalysisParameters(studyUuid, newParams) {
|
|
32
|
+
console.info("set sensitivity analysis parameters");
|
|
33
|
+
const url = `${getStudyUrl(studyUuid)}/sensitivity-analysis/parameters`;
|
|
34
|
+
console.debug(url);
|
|
35
|
+
return backendFetch(url, {
|
|
36
|
+
method: "POST",
|
|
37
|
+
headers: {
|
|
38
|
+
Accept: "application/json",
|
|
39
|
+
"Content-Type": "application/json"
|
|
40
|
+
},
|
|
41
|
+
body: newParams ? JSON.stringify(newParams) : null
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function getSensitivityAnalysisFactorsCount(studyUuid, currentNodeUuid, currentRootNetworkUuid, isInjectionsSet, newParams) {
|
|
45
|
+
console.info("get sensitivity analysis parameters computing count");
|
|
46
|
+
const urlSearchParams = new URLSearchParams();
|
|
47
|
+
const jsoned = JSON.stringify(isInjectionsSet);
|
|
48
|
+
urlSearchParams.append("isInjectionsSet", jsoned);
|
|
49
|
+
Object.keys(newParams).filter((key) => newParams[key]).forEach((key) => urlSearchParams.append(`ids[${key}]`, newParams[key]));
|
|
50
|
+
const url = `${getStudyUrlWithNodeUuidAndRootNetworkUuid(studyUuid, currentNodeUuid, currentRootNetworkUuid)}
|
|
51
|
+
/sensitivity-analysis/factors-count?${urlSearchParams}`;
|
|
52
|
+
console.debug(url);
|
|
53
|
+
return backendFetch(url, {
|
|
54
|
+
method: "GET"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function fetchDefaultSensitivityAnalysisProvider() {
|
|
58
|
+
console.info("fetch default sensitivity analysis provider");
|
|
59
|
+
const url = `${PREFIX_STUDY_QUERIES}/v1/sensitivity-analysis-default-provider`;
|
|
60
|
+
console.debug(url);
|
|
61
|
+
return backendFetchText(url);
|
|
62
|
+
}
|
|
63
|
+
function updateSensitivityAnalysisParameters(parameterUuid, newParams) {
|
|
64
|
+
console.info("set security analysis parameters");
|
|
65
|
+
const setSecurityAnalysisParametersUrl = `${getSensiUrl()}parameters/${parameterUuid}`;
|
|
66
|
+
console.debug(setSecurityAnalysisParametersUrl);
|
|
67
|
+
return backendFetch(setSecurityAnalysisParametersUrl, {
|
|
68
|
+
method: "PUT",
|
|
69
|
+
headers: {
|
|
70
|
+
Accept: "application/json",
|
|
71
|
+
"Content-Type": "application/json"
|
|
72
|
+
},
|
|
73
|
+
body: newParams ? JSON.stringify(newParams) : null
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
fetchDefaultSensitivityAnalysisProvider,
|
|
78
|
+
fetchSensitivityAnalysisParameters,
|
|
79
|
+
fetchSensitivityAnalysisProviders,
|
|
80
|
+
getSensiUrl,
|
|
81
|
+
getSensitivityAnalysisFactorsCount,
|
|
82
|
+
getSensitivityAnalysisParameters,
|
|
83
|
+
getStudyUrl,
|
|
84
|
+
getStudyUrlWithNodeUuidAndRootNetworkUuid,
|
|
85
|
+
setSensitivityAnalysisParameters,
|
|
86
|
+
updateSensitivityAnalysisParameters
|
|
87
|
+
};
|