@gridsuite/commons-ui 0.221.0 → 0.221.1

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.
@@ -11,6 +11,7 @@ import "react-dom";
11
11
  import "@hello-pangea/dnd";
12
12
  import { DndColumnType } from "../../../../components/composite/dnd-table-v2/dnd-table.type.js";
13
13
  import "../../../../components/ui/overflowableText/OverflowableText.js";
14
+ import { YUP_REQUIRED } from "../../../../utils/constants/translationKeys.js";
14
15
  import "../../../../utils/conversionUtils.js";
15
16
  import { ElementType } from "../../../../utils/types/elementType.js";
16
17
  import "../../../../utils/types/equipmentType.js";
@@ -73,7 +74,7 @@ const getContingencyListsInfosFormSchema = () => {
73
74
  [ID]: yup.string().required(),
74
75
  [NAME]: yup.string().required()
75
76
  })
76
- ).required().min(1, "ContingencyListInputMinError"),
77
+ ).required().min(1, YUP_REQUIRED),
77
78
  [DESCRIPTION]: yup.string(),
78
79
  [ACTIVATED]: yup.boolean().required()
79
80
  })
@@ -5,6 +5,7 @@ import { Grid } from "@mui/material";
5
5
  import * as yup from "yup";
6
6
  import { LOADS_VARIATIONS, ACTIVE, VARIATION, LOAD_FILTERS, LOAD_MODELS_RULE, ACCURACY, CALCULATION_TYPE } from "./constants.js";
7
7
  import { ID } from "../../../utils/constants/filterConstant.js";
8
+ import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
8
9
  import "../../../utils/conversionUtils.js";
9
10
  import { ElementType } from "../../../utils/types/elementType.js";
10
11
  import { EquipmentType } from "../../../utils/types/equipmentType.js";
@@ -50,7 +51,7 @@ const formSchema = yup.object().shape({
50
51
  [ID]: yup.string().required(),
51
52
  [NAME]: yup.string().nullable().notRequired()
52
53
  })
53
- ).min(1, "FilterInputMinError"),
54
+ ).min(1, YUP_REQUIRED),
54
55
  [VARIATION]: yup.number().min(0, "mustBeGreaterOrEqualToZero").required(),
55
56
  [ACTIVE]: yup.boolean().nullable().notRequired()
56
57
  })
@@ -1,6 +1,7 @@
1
1
  import * as yup from "yup";
2
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, PARAMETER_SENSI_HVDC, HVDC_LINES, PARAMETER_SENSI_INJECTION, INJECTIONS, PARAMETER_SENSI_INJECTIONS_SET, DISTRIBUTION_TYPE, SENSITIVITY_TYPE, MONITORED_BRANCHES, CONTAINER_NAME, CONTAINER_ID } from "./constants.js";
3
3
  import { ID } from "../../../utils/constants/filterConstant.js";
4
+ import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
4
5
  import "../../../utils/conversionUtils.js";
5
6
  import "../../../utils/types/equipmentType.js";
6
7
  import { DistributionType, SensitivityType } from "../../../utils/types/sensitivity-analysis.type.js";
@@ -50,7 +51,7 @@ const getMonitoredBranchesSchema = () => {
50
51
  })
51
52
  ).required().when([ACTIVATED], {
52
53
  is: (activated) => activated,
53
- then: (schema) => schema.min(1, "FilterInputMinError")
54
+ then: (schema) => schema.min(1, YUP_REQUIRED)
54
55
  })
55
56
  };
56
57
  };
@@ -85,7 +86,7 @@ const getSensiHVDCsFormSchema = () => ({
85
86
  })
86
87
  ).required().when([ACTIVATED], {
87
88
  is: (activated) => activated,
88
- then: (schema) => schema.min(1, "FilterInputMinError")
89
+ then: (schema) => schema.min(1, YUP_REQUIRED)
89
90
  }),
90
91
  ...getContingenciesSchema()
91
92
  })
@@ -130,7 +131,7 @@ const getSensiInjectionsFormSchema = () => ({
130
131
  })
131
132
  ).required().when([ACTIVATED], {
132
133
  is: (activated) => activated,
133
- then: (schema) => schema.min(1, "FilterInputMinError")
134
+ then: (schema) => schema.min(1, YUP_REQUIRED)
134
135
  }),
135
136
  ...getContingenciesSchema()
136
137
  })
@@ -174,7 +175,7 @@ const getSensiInjectionsSetFormSchema = () => ({
174
175
  })
175
176
  ).required().when([ACTIVATED], {
176
177
  is: (activated) => activated,
177
- then: (schema) => schema.min(1, "FilterInputMinError")
178
+ then: (schema) => schema.min(1, YUP_REQUIRED)
178
179
  }),
179
180
  [DISTRIBUTION_TYPE]: yup.mixed().oneOf(Object.values(DistributionType)).when([ACTIVATED], {
180
181
  is: (activated) => activated,
@@ -231,7 +232,7 @@ const getSensiNodesFormSchema = () => ({
231
232
  })
232
233
  ).when([ACTIVATED], {
233
234
  is: (activated) => activated,
234
- then: (schema) => schema.min(1, "FilterInputMinError")
235
+ then: (schema) => schema.min(1, YUP_REQUIRED)
235
236
  }),
236
237
  [EQUIPMENTS_IN_VOLTAGE_REGULATION]: yup.array().of(
237
238
  yup.object().shape({
@@ -240,7 +241,7 @@ const getSensiNodesFormSchema = () => ({
240
241
  })
241
242
  ).when([ACTIVATED], {
242
243
  is: (activated) => activated,
243
- then: (schema) => schema.min(1, "FilterInputMinError")
244
+ then: (schema) => schema.min(1, YUP_REQUIRED)
244
245
  }),
245
246
  ...getContingenciesSchema()
246
247
  })
@@ -287,7 +288,7 @@ const getSensiPSTsFormSchema = () => ({
287
288
  })
288
289
  ).required().when([ACTIVATED], {
289
290
  is: (activated) => activated,
290
- then: (schema) => schema.min(1, "FilterInputMinError")
291
+ then: (schema) => schema.min(1, YUP_REQUIRED)
291
292
  }),
292
293
  ...getContingenciesSchema()
293
294
  })
@@ -6,6 +6,7 @@ import "@mui/material";
6
6
  import "react-intl";
7
7
  import "react";
8
8
  import { ID } from "../../../utils/constants/filterConstant.js";
9
+ import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
9
10
  import "../../../utils/conversionUtils.js";
10
11
  import { snackWithFallback } from "../../../utils/error.js";
11
12
  import "../../../utils/types/equipmentType.js";
@@ -103,7 +104,7 @@ const getSpecificShortCircuitParametersFormSchema = (specificParametersDescripti
103
104
  })
104
105
  ).nullable().when("active", {
105
106
  is: true,
106
- then: (s) => s.required().min(1, "FilterInputMinError"),
107
+ then: (s) => s.required().min(1, YUP_REQUIRED),
107
108
  otherwise: (s) => s.notRequired().nullable()
108
109
  }),
109
110
  type: requiredWhenActive(yup.string().oneOf(["GENERATOR", "HVDC"]).nullable())
@@ -8,6 +8,7 @@ import "@mui/icons-material";
8
8
  import "react-intl";
9
9
  import "../../../components/ui/overflowableText/OverflowableText.js";
10
10
  import { ID, FILTERS } from "../../../utils/constants/filterConstant.js";
11
+ import { YUP_REQUIRED } from "../../../utils/constants/translationKeys.js";
11
12
  import { isBlankOrEmpty } from "../../../utils/conversionUtils.js";
12
13
  import { snackWithFallback } from "../../../utils/error.js";
13
14
  import { ElementType } from "../../../utils/types/elementType.js";
@@ -71,7 +72,7 @@ const useVoltageInitParametersForm = ({
71
72
  [ID]: yup.string().required(),
72
73
  [NAME]: yup.string().required()
73
74
  })
74
- ).min(1, "FilterInputMinError"),
75
+ ).min(1, YUP_REQUIRED),
75
76
  [LOW_VOLTAGE_LIMIT]: yup.number().nullable(),
76
77
  [HIGH_VOLTAGE_LIMIT]: yup.number().nullable()
77
78
  })
@@ -84,7 +85,7 @@ const useVoltageInitParametersForm = ({
84
85
  [ID]: yup.string().required(),
85
86
  [NAME]: yup.string().required()
86
87
  })
87
- ).min(1, "FilterInputMinError"),
88
+ ).min(1, YUP_REQUIRED),
88
89
  [LOW_VOLTAGE_LIMIT]: yup.number().min(0, "mustBeGreaterOrEqualToZero").nullable().test((value, context) => {
89
90
  return !isBlankOrEmpty(value) || !isBlankOrEmpty(context.parent[HIGH_VOLTAGE_LIMIT]);
90
91
  }),
@@ -168,8 +168,6 @@ export declare const parametersEn: {
168
168
  LowVoltageLimitAdjustment: string;
169
169
  HighVoltageLimitAdjustment: string;
170
170
  VoltageLevelFilterTooltip: string;
171
- FilterInputMinError: string;
172
- ContingencyListInputMinError: string;
173
171
  EquipmentSelection: string;
174
172
  ReactiveSlacksThreshold: string;
175
173
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: string;
@@ -162,8 +162,6 @@ const parametersEn = {
162
162
  LowVoltageLimitAdjustment: "Low voltage limit adjustment",
163
163
  HighVoltageLimitAdjustment: "High voltage limit adjustment",
164
164
  VoltageLevelFilterTooltip: "User entries are applied one after another starting at the top of the list. If a voltage level is included in more than one filter, an entry can therefore be replaced by a subsequent entry",
165
- FilterInputMinError: "You must pick at least one filter",
166
- ContingencyListInputMinError: "You must pick at least one contingency list",
167
165
  EquipmentSelection: "Equipment selection",
168
166
  ReactiveSlacksThreshold: "Alert threshold on reactive slacks",
169
167
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "The threshold must be greater or equal to 0",
@@ -168,8 +168,6 @@ export declare const parametersFr: {
168
168
  LowVoltageLimitAdjustment: string;
169
169
  HighVoltageLimitAdjustment: string;
170
170
  VoltageLevelFilterTooltip: string;
171
- FilterInputMinError: string;
172
- ContingencyListInputMinError: string;
173
171
  EquipmentSelection: string;
174
172
  ReactiveSlacksThreshold: string;
175
173
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: string;
@@ -162,8 +162,6 @@ const parametersFr = {
162
162
  LowVoltageLimitAdjustment: "Modification limite basse",
163
163
  HighVoltageLimitAdjustment: "Modification limite haute",
164
164
  VoltageLevelFilterTooltip: "Les saisies sont appliquées dans l'ordre de la liste (en remplaçant éventuellement des saisies au fur et à mesure si un poste est inclus dans plusieurs filtres)",
165
- FilterInputMinError: "Vous devez sélectionner au moins un filtre",
166
- ContingencyListInputMinError: "Vous devez sélectionner au moins une liste d'aléas",
167
165
  EquipmentSelection: "Sélection des ouvrages",
168
166
  ReactiveSlacksThreshold: "Seuil d'alerte sur les investissements réactifs",
169
167
  ReactiveSlacksThresholdMustBeGreaterOrEqualToZero: "Le seuil doit être supérieur ou égal à 0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.221.0",
3
+ "version": "0.221.1",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",