@gridsuite/commons-ui 0.164.0 → 0.165.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.
@@ -1,5 +1,4 @@
1
1
  import { PredefinedProperties } from '../../../../utils';
2
- import { default as yup } from '../../../../utils/yupConfig';
3
2
  import { FilledProperty, Properties, Property } from './properties.type';
4
3
  export type EquipmentWithProperties = {
5
4
  properties?: Record<string, string>;
@@ -14,7 +13,7 @@ export declare const copyEquipmentPropertiesForCreation: (equipmentInfos: Equipm
14
13
  export declare const mergeModificationAndEquipmentProperties: (modificationProperties: Property[], equipment: EquipmentWithProperties) => Property[];
15
14
  export declare function getConcatenatedProperties(equipment: EquipmentWithProperties, getValues: (name: string) => any, id?: string): any;
16
15
  export declare const toModificationProperties: (properties: Properties) => Property[] | null;
17
- export declare const creationPropertiesSchema: yup.ObjectSchema<{
16
+ export declare const creationPropertiesSchema: import('yup').ObjectSchema<{
18
17
  AdditionalProperties: {
19
18
  previousValue?: string | null | undefined;
20
19
  added: NonNullable<boolean | undefined>;
@@ -22,10 +21,10 @@ export declare const creationPropertiesSchema: yup.ObjectSchema<{
22
21
  name: string;
23
22
  value: string;
24
23
  }[] | undefined;
25
- }, yup.AnyObject, {
24
+ }, import('yup').AnyObject, {
26
25
  AdditionalProperties: "";
27
26
  }, "">;
28
- export declare const modificationPropertiesSchema: yup.ObjectSchema<{
27
+ export declare const modificationPropertiesSchema: import('yup').ObjectSchema<{
29
28
  AdditionalProperties: {
30
29
  previousValue?: string | null | undefined;
31
30
  value?: string | null | undefined;
@@ -33,7 +32,7 @@ export declare const modificationPropertiesSchema: yup.ObjectSchema<{
33
32
  deletionMark: NonNullable<boolean | undefined>;
34
33
  name: string;
35
34
  }[] | undefined;
36
- }, yup.AnyObject, {
35
+ }, import('yup').AnyObject, {
37
36
  AdditionalProperties: "";
38
37
  }, "">;
39
38
  export declare const getPropertyValue: (properties: Record<string, string> | undefined, keyName: string) => string | undefined;
@@ -1,11 +1,12 @@
1
+ import { object, array, boolean, string } from "yup";
1
2
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.js";
3
+ import { YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../../../utils/constants/translationKeys.js";
2
4
  import { isBlankOrEmpty } from "../../../../utils/conversionUtils.js";
3
5
  import "../../../../utils/types/equipmentType.js";
4
6
  import "react/jsx-runtime";
5
7
  import "@mui/icons-material";
6
8
  import "../../../../utils/yupConfig.js";
7
9
  import { fetchStudyMetadata } from "../../../../services/appsMetadata.js";
8
- import * as yup from "yup";
9
10
  const fetchPredefinedProperties = (networkElementType) => {
10
11
  return fetchStudyMetadata().then((studyMetadata) => {
11
12
  return studyMetadata.predefinedEquipmentProperties?.[networkElementType];
@@ -117,30 +118,30 @@ const checkUniquePropertyNames = (properties) => {
117
118
  const validValues = properties.filter((v) => v.name);
118
119
  return validValues.length === new Set(validValues.map((v) => v.name)).size;
119
120
  };
120
- const creationPropertiesSchema = yup.object({
121
- [FieldConstants.ADDITIONAL_PROPERTIES]: yup.array().of(
122
- yup.object().shape({
123
- [FieldConstants.NAME]: yup.string().required(),
124
- [FieldConstants.VALUE]: yup.string().required(),
125
- [FieldConstants.PREVIOUS_VALUE]: yup.string().nullable(),
126
- [FieldConstants.DELETION_MARK]: yup.boolean().required(),
127
- [FieldConstants.ADDED]: yup.boolean().required()
121
+ const creationPropertiesSchema = object({
122
+ [FieldConstants.ADDITIONAL_PROPERTIES]: array().of(
123
+ object().shape({
124
+ [FieldConstants.NAME]: string().required(YUP_REQUIRED),
125
+ [FieldConstants.VALUE]: string().required(YUP_REQUIRED),
126
+ [FieldConstants.PREVIOUS_VALUE]: string().nullable(),
127
+ [FieldConstants.DELETION_MARK]: boolean().required(YUP_REQUIRED),
128
+ [FieldConstants.ADDED]: boolean().required(YUP_REQUIRED)
128
129
  })
129
- ).test("checkUniqueProperties", "DuplicatedPropsError", (values) => checkUniquePropertyNames(values))
130
+ ).test("checkUniqueProperties", DUPLICATED_PROPS_ERROR, (values) => checkUniquePropertyNames(values))
130
131
  });
131
- const modificationPropertiesSchema = yup.object({
132
- [FieldConstants.ADDITIONAL_PROPERTIES]: yup.array().of(
133
- yup.object().shape({
134
- [FieldConstants.NAME]: yup.string().required(),
135
- [FieldConstants.VALUE]: yup.string().nullable().when([FieldConstants.ADDED], {
132
+ const modificationPropertiesSchema = object({
133
+ [FieldConstants.ADDITIONAL_PROPERTIES]: array().of(
134
+ object().shape({
135
+ [FieldConstants.NAME]: string().required(YUP_REQUIRED),
136
+ [FieldConstants.VALUE]: string().nullable().when([FieldConstants.ADDED], {
136
137
  is: (added) => added,
137
- then: (schema) => schema.required()
138
+ then: (schema) => schema.required(YUP_REQUIRED)
138
139
  }),
139
- [FieldConstants.PREVIOUS_VALUE]: yup.string().nullable(),
140
- [FieldConstants.DELETION_MARK]: yup.boolean().required(),
141
- [FieldConstants.ADDED]: yup.boolean().required()
140
+ [FieldConstants.PREVIOUS_VALUE]: string().nullable(),
141
+ [FieldConstants.DELETION_MARK]: boolean().required(YUP_REQUIRED),
142
+ [FieldConstants.ADDED]: boolean().required(YUP_REQUIRED)
142
143
  })
143
- ).test("checkUniqueProperties", "DuplicatedPropsError", (values) => checkUniquePropertyNames(values))
144
+ ).test("checkUniqueProperties", DUPLICATED_PROPS_ERROR, (values) => checkUniquePropertyNames(values))
144
145
  });
145
146
  const getPropertyValue = (properties, keyName) => properties?.[keyName];
146
147
  export {
@@ -1,8 +1,8 @@
1
- import { default as yup } from '../../../../utils/yupConfig';
1
+ import { InferType } from 'yup';
2
2
  import { SubstationCreationDto } from './substationCreation.types';
3
3
  export declare const substationCreationFormToDto: (substationForm: SubstationCreationFormData) => SubstationCreationDto;
4
4
  export declare const substationCreationDtoToForm: (substationDto: SubstationCreationDto) => SubstationCreationFormData;
5
- export declare const substationCreationFormSchema: yup.ObjectSchema<{
5
+ export declare const substationCreationFormSchema: import('yup').ObjectSchema<NonNullable<{
6
6
  equipmentID: string;
7
7
  equipmentName: string | null | undefined;
8
8
  country: string | null | undefined;
@@ -14,11 +14,11 @@ export declare const substationCreationFormSchema: yup.ObjectSchema<{
14
14
  name: string;
15
15
  value: string;
16
16
  }[] | undefined;
17
- }, yup.AnyObject, {
17
+ }>, import('yup').AnyObject, {
18
18
  equipmentID: undefined;
19
19
  equipmentName: undefined;
20
20
  country: undefined;
21
21
  AdditionalProperties: "";
22
22
  }, "">;
23
- export type SubstationCreationFormData = yup.InferType<typeof substationCreationFormSchema>;
23
+ export type SubstationCreationFormData = InferType<typeof substationCreationFormSchema>;
24
24
  export declare const substationCreationEmptyFormData: SubstationCreationFormData;
@@ -1,12 +1,13 @@
1
+ import { object, string } from "yup";
1
2
  import { creationPropertiesSchema, toModificationProperties, getFilledPropertiesFromModification } from "../../common/properties/propertyUtils.js";
2
- import "../../../../utils/yupConfig.js";
3
3
  import { FieldConstants } from "../../../../utils/constants/fieldConstants.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 "react/jsx-runtime";
7
8
  import "@mui/icons-material";
8
9
  import { sanitizeString } from "../../../../utils/ts-utils.js";
9
- import * as yup from "yup";
10
+ import "../../../../utils/yupConfig.js";
10
11
  const substationCreationFormToDto = (substationForm) => {
11
12
  return {
12
13
  type: "SUBSTATION_CREATION",
@@ -24,11 +25,11 @@ const substationCreationDtoToForm = (substationDto) => {
24
25
  AdditionalProperties: getFilledPropertiesFromModification(substationDto.properties)
25
26
  };
26
27
  };
27
- const substationCreationFormSchema = yup.object().shape({
28
- [FieldConstants.EQUIPMENT_ID]: yup.string().required(),
29
- [FieldConstants.EQUIPMENT_NAME]: yup.string().nullable(),
30
- [FieldConstants.COUNTRY]: yup.string().nullable()
31
- }).concat(creationPropertiesSchema);
28
+ const substationCreationFormSchema = object().shape({
29
+ [FieldConstants.EQUIPMENT_ID]: string().required(YUP_REQUIRED),
30
+ [FieldConstants.EQUIPMENT_NAME]: string().nullable(),
31
+ [FieldConstants.COUNTRY]: string().nullable()
32
+ }).concat(creationPropertiesSchema).required(YUP_REQUIRED);
32
33
  const substationCreationEmptyFormData = {
33
34
  equipmentID: "",
34
35
  equipmentName: "",
package/dist/index.js CHANGED
@@ -224,6 +224,7 @@ import { MAX_CHAR_DESCRIPTION } from "./utils/constants/uiConstants.js";
224
224
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./utils/constants/unitsConstants.js";
225
225
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./utils/constants/configConstants.js";
226
226
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./utils/constants/filterConstant.js";
227
+ import { DUPLICATED_PROPS_ERROR, YUP_REQUIRED } from "./utils/constants/translationKeys.js";
227
228
  import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToKiloUnit, unitToMicroUnit } from "./utils/conversionUtils.js";
228
229
  import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./utils/error.js";
229
230
  import { areArrayElementsUnique, arraysContainIdenticalStrings, isEmpty, isObjectEmpty, keyGenerator } from "./utils/functions.js";
@@ -392,6 +393,7 @@ export {
392
393
  DIAGONAL_LABEL,
393
394
  DISTRIBUTED_SLACK,
394
395
  DISTRIBUTION_KEY,
396
+ DUPLICATED_PROPS_ERROR,
395
397
  DanglingLine,
396
398
  DataType,
397
399
  DefaultCellRenderer,
@@ -720,6 +722,7 @@ export {
720
722
  VoltageInitTabValues,
721
723
  VoltageLevel,
722
724
  WRITE_SLACK_BUS,
725
+ YUP_REQUIRED,
723
726
  alertThresholdMarks,
724
727
  areArrayElementsUnique,
725
728
  arraysContainIdenticalStrings,
@@ -5,6 +5,8 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export declare const businessErrorsEn: {
8
+ 'case.noAvailableImporter': string;
9
+ 'case.illegalFileName': string;
8
10
  'directory.permissionDenied': string;
9
11
  'directory.elementNameBlank': string;
10
12
  'directory.notDirectory': string;
@@ -17,7 +19,6 @@ export declare const businessErrorsEn: {
17
19
  'directory.targetPermissionDenied': string;
18
20
  'explore.permissionDenied': string;
19
21
  'explore.maxElementsExceeded': string;
20
- 'explore.incorrectCaseFile': string;
21
22
  'study.notFound': string;
22
23
  'study.computationRunning': string;
23
24
  'study.loadflowError': string;
@@ -66,4 +67,11 @@ export declare const businessErrorsEn: {
66
67
  'dynamicSimulation.mappingNotLastRuleWithEmptyFilterError': string;
67
68
  'sensitivityAnalysis.tooManyFactors': string;
68
69
  'pccMin.missingFilter': string;
70
+ 'diagram.invalidEquipmentType': string;
71
+ 'diagram.invalidSubstationLayout': string;
72
+ 'diagram.invalidDisplayMode': string;
73
+ 'diagram.maxVoltageLevelDisplayed': string;
74
+ 'diagram.equipmentNotFound': string;
75
+ 'diagram.noConfiguredPosition': string;
76
+ 'diagram.noVoltageLevelFound': string;
69
77
  };
@@ -1,4 +1,6 @@
1
1
  const businessErrorsEn = {
2
+ "case.noAvailableImporter": "No available importer found for this file",
3
+ "case.illegalFileName": "The file name is not accepted.",
2
4
  "directory.permissionDenied": "You are not allowed to perform this action.",
3
5
  "directory.elementNameBlank": "Element name must not be blank.",
4
6
  "directory.notDirectory": "The selected element is not a directory.",
@@ -11,7 +13,6 @@ const businessErrorsEn = {
11
13
  "directory.targetPermissionDenied": "You don't have sufficient rights on target folder",
12
14
  "explore.permissionDenied": "You are not allowed to perform this action.",
13
15
  "explore.maxElementsExceeded": "You have reached your user quota for cases and studies ({limit} cases and studies).",
14
- "explore.incorrectCaseFile": "Invalid imported file name or format.",
15
16
  "study.notFound": "Study was not found.",
16
17
  "study.computationRunning": "The operation cannot be performed because a computation is running.",
17
18
  "study.loadflowError": "Loadflow error.",
@@ -59,7 +60,14 @@ const businessErrorsEn = {
59
60
  "dynamicSimulation.mappingNotProvided": "Dynamic simulation mapping not provided.",
60
61
  "dynamicSimulation.mappingNotLastRuleWithEmptyFilterError": "Only last rule can have empty filter: type {equipmentType}, rule index {index}.",
61
62
  "sensitivityAnalysis.tooManyFactors": "Too many factors to run sensitivity analysis: {resultCount} results (limit: {resultCountLimit}) and {variableCount} variables (limit: {variableCountLimit}).",
62
- "pccMin.missingFilter": "The configuration contains one filter that has been deleted."
63
+ "pccMin.missingFilter": "The configuration contains one filter that has been deleted.",
64
+ "diagram.invalidEquipmentType": "The equipment {id} of type {equipmentType} is not a substation or voltage level in given network",
65
+ "diagram.invalidSubstationLayout": "Given substation layout {substationLayout} doesn't exist",
66
+ "diagram.invalidDisplayMode": "Given sld display mode {sldDisplayMode} doesn't exist",
67
+ "diagram.maxVoltageLevelDisplayed": "You need to reduce the number of voltage levels to be displayed in the network area diagram (current {nbVoltageLevels}, maximum {maxVoltageLevels})",
68
+ "diagram.equipmentNotFound": "Voltage level or substation {id} not found",
69
+ "diagram.noConfiguredPosition": "No configured position found",
70
+ "diagram.noVoltageLevelFound": "No voltage level found for this network area diagram"
63
71
  };
64
72
  export {
65
73
  businessErrorsEn
@@ -1,9 +1,3 @@
1
- /**
2
- * Copyright (c) 2024, RTE (http://www.rte-france.com)
3
- * This Source Code Form is subject to the terms of the Mozilla Public
4
- * License, v. 2.0. If a copy of the MPL was not distributed with this
5
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
- */
7
1
  export declare const networkModificationsEn: {
8
2
  'network_modifications.modificationsCount': string;
9
3
  'network_modifications.EQUIPMENT_DELETION': string;
@@ -81,4 +75,5 @@ export declare const networkModificationsEn: {
81
75
  Name: string;
82
76
  Country: string;
83
77
  DuplicatedPropsError: string;
78
+ YupRequired: string;
84
79
  };
@@ -1,3 +1,9 @@
1
+ import { YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../utils/constants/translationKeys.js";
2
+ import "../../utils/conversionUtils.js";
3
+ import "../../utils/types/equipmentType.js";
4
+ import "react/jsx-runtime";
5
+ import "@mui/icons-material";
6
+ import "../../utils/yupConfig.js";
1
7
  const networkModificationsEn = {
2
8
  "network_modifications.modificationsCount": "{hide, select, false {{count, plural, =0 {no modification} =1 {{count} modification} other {{count} modifications}}} other {...}}",
3
9
  "network_modifications.EQUIPMENT_DELETION": "Deletion of {computedLabel}",
@@ -74,7 +80,8 @@ const networkModificationsEn = {
74
80
  PropertyValue: "Property value",
75
81
  Name: "Name",
76
82
  Country: "Country",
77
- DuplicatedPropsError: "Duplicated properties: each property must be unique"
83
+ [DUPLICATED_PROPS_ERROR]: "Duplicated properties: each property must be unique",
84
+ [YUP_REQUIRED]: "This field is required"
78
85
  };
79
86
  export {
80
87
  networkModificationsEn
@@ -5,6 +5,8 @@
5
5
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
  */
7
7
  export declare const businessErrorsFr: {
8
+ 'case.noAvailableImporter': string;
9
+ 'case.illegalFileName': string;
8
10
  'directory.permissionDenied': string;
9
11
  'directory.elementNameBlank': string;
10
12
  'directory.notDirectory': string;
@@ -17,7 +19,6 @@ export declare const businessErrorsFr: {
17
19
  'directory.targetPermissionDenied': string;
18
20
  'explore.permissionDenied': string;
19
21
  'explore.maxElementsExceeded': string;
20
- 'explore.incorrectCaseFile': string;
21
22
  'study.notFound': string;
22
23
  'study.computationRunning': string;
23
24
  'study.loadflowError': string;
@@ -66,4 +67,11 @@ export declare const businessErrorsFr: {
66
67
  'dynamicSimulation.mappingNotLastRuleWithEmptyFilterError': string;
67
68
  'sensitivityAnalysis.tooManyFactors': string;
68
69
  'pccMin.missingFilter': string;
70
+ 'diagram.invalidEquipmentType': string;
71
+ 'diagram.invalidSubstationLayout': string;
72
+ 'diagram.invalidDisplayMode': string;
73
+ 'diagram.maxVoltageLevelDisplayed': string;
74
+ 'diagram.equipmentNotFound': string;
75
+ 'diagram.noConfiguredPosition': string;
76
+ 'diagram.noVoltageLevelFound': string;
69
77
  };
@@ -1,4 +1,6 @@
1
1
  const businessErrorsFr = {
2
+ "case.noAvailableImporter": "Aucun importateur n'a été trouvé pour ce fichier.",
3
+ "case.illegalFileName": "Le nom de fichier n'est pas accepté.",
2
4
  "directory.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
3
5
  "directory.elementNameBlank": "Le nom de l'élément ne peut pas être vide.",
4
6
  "directory.notDirectory": "L'élément sélectionné n'est pas un dossier.",
@@ -11,7 +13,6 @@ const businessErrorsFr = {
11
13
  "directory.targetPermissionDenied": "Vous n'avez pas les droits d'accès suffisants sur le dossier cible",
12
14
  "explore.permissionDenied": "Vous n'êtes pas autorisé à effectuer cette action.",
13
15
  "explore.maxElementsExceeded": "Vous avez atteint votre quota utilisateur en termes de situations et d'études ({limit} situations et études).",
14
- "explore.incorrectCaseFile": "Format ou nom du fichier importé invalide.",
15
16
  "study.notFound": "Étude non trouvée.",
16
17
  "study.computationRunning": "L'opération ne peut être menée car un calcul est en cours.",
17
18
  "study.loadflowError": "Erreur de calcul de répartition.",
@@ -59,7 +60,14 @@ const businessErrorsFr = {
59
60
  "dynamicSimulation.mappingNotProvided": "Mapping pour la simulation dynamique non fourni.",
60
61
  "dynamicSimulation.mappingNotLastRuleWithEmptyFilterError": "Seule la dernière règle peut avoir un filtre vide : type {equipmentType}, indice de la règle : {index}.",
61
62
  "sensitivityAnalysis.tooManyFactors": "Trop de facteurs pour exécuter l’analyse de sensibilité : {resultCount} résultats (limite : {resultCountLimit}) et {variableCount} variables (limite : {variableCountLimit}).",
62
- "pccMin.missingFilter": "La configuration contient un filtre qui a été supprimé."
63
+ "pccMin.missingFilter": "La configuration contient un filtre qui a été supprimé.",
64
+ "diagram.invalidEquipmentType": "L'équipement {id} de type {equipmentType} n'est pas un site ou poste dans le réseau courant",
65
+ "diagram.invalidSubstationLayout": "Le mode d'affichage de site {substationLayout} n'existe pas",
66
+ "diagram.invalidDisplayMode": "Le mode d'affichage de schéma unifilaire {sldDisplayMode} n'existe pas",
67
+ "diagram.maxVoltageLevelDisplayed": "Vous devez réduire le nombre de postes à afficher dans l'image nodale de zone (nombre actuel {nbVoltageLevels}, nombre maximum {maxVoltageLevels})",
68
+ "diagram.equipmentNotFound": "Poste ou site {id} non trouvé",
69
+ "diagram.noConfiguredPosition": "Aucune position configurée trouvée",
70
+ "diagram.noVoltageLevelFound": "Aucun poste trouvé pour cette image nodale de zone"
63
71
  };
64
72
  export {
65
73
  businessErrorsFr
@@ -1,9 +1,3 @@
1
- /**
2
- * Copyright (c) 2024, RTE (http://www.rte-france.com)
3
- * This Source Code Form is subject to the terms of the Mozilla Public
4
- * License, v. 2.0. If a copy of the MPL was not distributed with this
5
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
- */
7
1
  export declare const networkModificationsFr: {
8
2
  'network_modifications.modificationsCount': string;
9
3
  'network_modifications.EQUIPMENT_DELETION': string;
@@ -81,4 +75,5 @@ export declare const networkModificationsFr: {
81
75
  Name: string;
82
76
  Country: string;
83
77
  DuplicatedPropsError: string;
78
+ YupRequired: string;
84
79
  };
@@ -1,3 +1,9 @@
1
+ import { YUP_REQUIRED, DUPLICATED_PROPS_ERROR } from "../../utils/constants/translationKeys.js";
2
+ import "../../utils/conversionUtils.js";
3
+ import "../../utils/types/equipmentType.js";
4
+ import "react/jsx-runtime";
5
+ import "@mui/icons-material";
6
+ import "../../utils/yupConfig.js";
1
7
  const networkModificationsFr = {
2
8
  "network_modifications.modificationsCount": "{hide, select, false {{count, plural, =0 {aucune modification} =1 {# modification} other {# modifications}}} other {...}}",
3
9
  "network_modifications.EQUIPMENT_DELETION": "Suppression de {computedLabel}",
@@ -74,7 +80,8 @@ const networkModificationsFr = {
74
80
  PropertyValue: "Valeur de la propriété",
75
81
  Name: "Nom",
76
82
  Country: "Pays",
77
- DuplicatedPropsError: "Propriétés dupliquées : chaque propriété doit être unique"
83
+ [DUPLICATED_PROPS_ERROR]: "Propriétés dupliquées : chaque propriété doit être unique",
84
+ [YUP_REQUIRED]: "Ce champ doit être renseigné"
78
85
  };
79
86
  export {
80
87
  networkModificationsFr
@@ -11,3 +11,4 @@ export * from './uiConstants';
11
11
  export * from './unitsConstants';
12
12
  export * from './configConstants';
13
13
  export * from './filterConstant';
14
+ export * from './translationKeys';
@@ -5,6 +5,7 @@ import { MAX_CHAR_DESCRIPTION } from "./uiConstants.js";
5
5
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./unitsConstants.js";
6
6
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./configConstants.js";
7
7
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./filterConstant.js";
8
+ import { DUPLICATED_PROPS_ERROR, YUP_REQUIRED } from "./translationKeys.js";
8
9
  export {
9
10
  AMPERE,
10
11
  ActivePowerAdornment,
@@ -12,6 +13,7 @@ export {
12
13
  COMMON_APP_NAME,
13
14
  COMMON_CONFIG_PARAMS_NAMES,
14
15
  DEGREE,
16
+ DUPLICATED_PROPS_ERROR,
15
17
  FILTERS,
16
18
  FILTER_ID,
17
19
  FILTER_NAME,
@@ -41,5 +43,6 @@ export {
41
43
  ReactivePowerAdornment,
42
44
  SIEMENS,
43
45
  SusceptanceAdornment,
44
- VoltageAdornment
46
+ VoltageAdornment,
47
+ YUP_REQUIRED
45
48
  };
@@ -0,0 +1,2 @@
1
+ export declare const YUP_REQUIRED = "YupRequired";
2
+ export declare const DUPLICATED_PROPS_ERROR = "DuplicatedPropsError";
@@ -0,0 +1,6 @@
1
+ const YUP_REQUIRED = "YupRequired";
2
+ const DUPLICATED_PROPS_ERROR = "DuplicatedPropsError";
3
+ export {
4
+ DUPLICATED_PROPS_ERROR,
5
+ YUP_REQUIRED
6
+ };
@@ -6,6 +6,7 @@ import { MAX_CHAR_DESCRIPTION } from "./constants/uiConstants.js";
6
6
  import { AMPERE, DEGREE, KILO_AMPERE, KILO_METER, KILO_VOLT, MEGA_VAR, MEGA_VOLT_AMPERE, MEGA_WATT, MICRO_SIEMENS, OHM, PERCENTAGE, SIEMENS } from "./constants/unitsConstants.js";
7
7
  import { COMMON_APP_NAME, COMMON_CONFIG_PARAMS_NAMES, LAST_SELECTED_DIRECTORY, PARAM_DEVELOPER_MODE, PARAM_LANGUAGE, PARAM_THEME } from "./constants/configConstants.js";
8
8
  import { FILTERS, FILTER_ID, FILTER_NAME, ID } from "./constants/filterConstant.js";
9
+ import { DUPLICATED_PROPS_ERROR, YUP_REQUIRED } from "./constants/translationKeys.js";
9
10
  import { GRIDSUITE_DEFAULT_PRECISION, convertInputValue, convertOutputValue, isBlankOrEmpty, kiloUnitToUnit, microUnitToUnit, roundToDefaultPrecision, roundToPrecision, unitToKiloUnit, unitToMicroUnit } from "./conversionUtils.js";
10
11
  import { catchErrorHandler, extractErrorMessageDescriptor, snackWithFallback } from "./error.js";
11
12
  import { areArrayElementsUnique, arraysContainIdenticalStrings, isEmpty, isObjectEmpty, keyGenerator } from "./functions.js";
@@ -47,6 +48,7 @@ export {
47
48
  CustomError,
48
49
  DARK_THEME,
49
50
  DEGREE,
51
+ DUPLICATED_PROPS_ERROR,
50
52
  DanglingLine,
51
53
  DistributionType,
52
54
  ElementType,
@@ -116,6 +118,7 @@ export {
116
118
  VSC,
117
119
  VoltageAdornment,
118
120
  VoltageLevel,
121
+ YUP_REQUIRED,
119
122
  areArrayElementsUnique,
120
123
  arraysContainIdenticalStrings,
121
124
  catchErrorHandler,
@@ -1,5 +1,5 @@
1
1
  import { UUID } from 'node:crypto';
2
- import { IntlShape } from 'react-intl';
2
+ import { MessageDescriptor, PrimitiveType } from 'react-intl';
3
3
  import { ElementType } from './elementType';
4
4
  export type Input = string | number;
5
5
  export type ElementAttributes = {
@@ -61,8 +61,8 @@ export declare enum ArrayAction {
61
61
  ADD = "ADD",
62
62
  REMOVE = "REMOVE"
63
63
  }
64
- export type FormatValues = Parameters<IntlShape['formatMessage']>[1];
64
+ export type FormatValues = Record<string, PrimitiveType>;
65
65
  export type ErrorMessageDescriptor = {
66
- descriptor: Parameters<IntlShape['formatMessage']>[0];
66
+ descriptor: MessageDescriptor;
67
67
  values?: FormatValues;
68
68
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.164.0",
3
+ "version": "0.165.1",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "author": "gridsuite team",
6
6
  "homepage": "https://github.com/gridsuite",