@gridsuite/commons-ui 0.133.0 → 0.135.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/README.md +10 -0
- package/dist/components/authentication/utils/authService.js +6 -9
- package/dist/components/checkBoxList/CheckBoxList.js +1 -1
- package/dist/components/checkBoxList/CheckBoxListItem.js +3 -3
- package/dist/components/checkBoxList/CheckBoxListItemContent.js +3 -3
- package/dist/components/checkBoxList/CheckBoxListItems.js +4 -4
- package/dist/components/checkBoxList/DraggableCheckBoxListItem.js +5 -5
- package/dist/components/checkBoxList/DraggableCheckBoxListItemContent.js +1 -1
- package/dist/components/contingencyList/criteriaBased/criteriaBasedUtils.js +7 -7
- package/dist/components/csvDownloader/use-csv-export.js +1 -4
- package/dist/components/customAGGrid/customAggrid.js +2 -2
- package/dist/components/dialogs/customMuiDialog/CustomMuiDialog.js +2 -2
- package/dist/components/dialogs/descriptionModificationDialog/DescriptionModificationDialog.js +1 -2
- package/dist/components/dialogs/elementSaveDialog/ElementSaveDialog.js +6 -6
- package/dist/components/dialogs/elementSaveDialog/utils.js +1 -1
- package/dist/components/dialogs/modifyElementSelection/ModifyElementSelection.js +1 -1
- package/dist/components/directoryItemSelector/DirectoryItemSelector.js +3 -4
- package/dist/components/dnd-table/dnd-table-bottom-right-buttons.js +2 -3
- package/dist/components/dnd-table/dnd-table.js +7 -7
- package/dist/components/elementSearch/elementItem/EquipmentItem.js +6 -7
- package/dist/components/elementSearch/elementSearchDialog/ElementSearchDialog.js +1 -1
- package/dist/components/elementSearch/tagRenderer/TagRenderer.js +3 -4
- package/dist/components/filter/FilterCreationDialog.js +10 -10
- package/dist/components/filter/FilterForm.js +2 -2
- package/dist/components/filter/expert/ExpertFilterEditionDialog.js +1 -2
- package/dist/components/filter/expert/ExpertFilterForm.d.ts +0 -1
- package/dist/components/filter/expert/ExpertFilterForm.js +11 -21
- package/dist/components/filter/expert/expertFilterUtils.js +16 -24
- package/dist/components/filter/expert/index.js +1 -2
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterEditionDialog.js +2 -4
- package/dist/components/filter/explicitNaming/ExplicitNamingFilterForm.js +11 -18
- package/dist/components/filter/index.js +1 -2
- package/dist/components/flatParameters/FlatParameters.js +2 -2
- package/dist/components/index.js +1 -2
- package/dist/components/inputs/SelectClearable.js +1 -1
- package/dist/components/inputs/reactHookForm/DirectoryItemsInput.js +44 -48
- package/dist/components/inputs/reactHookForm/agGridTable/CustomAgGridTable.js +3 -4
- package/dist/components/inputs/reactHookForm/agGridTable/csvUploader/CsvUploader.js +1 -1
- package/dist/components/inputs/reactHookForm/autocompleteInputs/AutocompleteInput.js +4 -4
- package/dist/components/inputs/reactHookForm/chip-items-input.js +3 -3
- package/dist/components/inputs/reactHookForm/errorManagement/ErrorInput.js +1 -2
- package/dist/components/inputs/reactHookForm/numbers/FloatInput.js +1 -1
- package/dist/components/inputs/reactHookForm/numbers/SliderInput.js +1 -1
- package/dist/components/inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js +2 -2
- package/dist/components/inputs/reactHookForm/selectInputs/SelectInput.js +3 -3
- package/dist/components/inputs/reactHookForm/tableInputs/table-numerical-input.js +4 -4
- package/dist/components/inputs/reactHookForm/tableInputs/table-text-input.js +3 -3
- package/dist/components/inputs/reactHookForm/text/ExpandingTextField.js +2 -2
- package/dist/components/inputs/reactHookForm/text/TextInput.js +5 -5
- package/dist/components/inputs/reactHookForm/text/UniqueNameInput.js +2 -2
- package/dist/components/inputs/reactHookForm/utils/SubmitButton.js +1 -1
- package/dist/components/inputs/reactHookForm/utils/functions.js +2 -3
- package/dist/components/inputs/reactQueryBuilder/OperatorSelector.js +2 -2
- package/dist/components/inputs/reactQueryBuilder/PropertyValueEditor.js +8 -9
- package/dist/components/inputs/reactQueryBuilder/TextValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/TranslatedValueEditor.js +1 -1
- package/dist/components/inputs/reactQueryBuilder/ValueEditor.js +2 -3
- package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/GroupValueEditor.js +12 -15
- package/dist/components/inputs/reactQueryBuilder/compositeRuleEditor/RuleValueEditor.js +3 -4
- package/dist/components/notifications/hooks/useListenerManager.js +2 -4
- package/dist/components/overflowableText/OverflowableText.js +4 -5
- package/dist/components/parameters/common/computing-type.d.ts +2 -1
- package/dist/components/parameters/common/computing-type.js +3 -0
- package/dist/components/parameters/common/limitreductions/columns-definitions.js +1 -1
- package/dist/components/parameters/common/limitreductions/limit-reductions-form-util.js +1 -1
- package/dist/components/parameters/common/widget/parameter-line-slider.js +5 -4
- package/dist/components/parameters/loadflow/load-flow-general-parameters.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-content.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-form.js +1 -1
- package/dist/components/parameters/loadflow/load-flow-parameters-utils.js +4 -3
- package/dist/components/parameters/loadflow/use-load-flow-parameters-form.js +34 -20
- package/dist/components/parameters/network-visualizations/map-parameters.js +13 -17
- package/dist/components/parameters/network-visualizations/network-area-diagram-parameters.js +1 -2
- package/dist/components/parameters/network-visualizations/network-visualizations-form.js +2 -2
- package/dist/components/parameters/network-visualizations/single-line-diagram-parameters.js +2 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-form.js +2 -3
- package/dist/components/parameters/security-analysis/security-analysis-parameters-selector.js +3 -3
- package/dist/components/parameters/security-analysis/security-analysis-violations-hiding.js +1 -1
- package/dist/components/parameters/security-analysis/use-security-analysis-parameters-form.js +5 -5
- package/dist/components/parameters/sensi/sensitivity-analysis-parameters-form.js +1 -1
- package/dist/components/parameters/sensi/sensitivity-table.js +2 -3
- package/dist/components/parameters/sensi/use-sensitivity-analysis-parameters.js +42 -54
- package/dist/components/parameters/sensi/utils.js +16 -27
- package/dist/components/parameters/short-circuit/short-circuit-parameters-form.js +2 -2
- package/dist/components/parameters/short-circuit/short-circuit-parameters-inline.js +1 -1
- package/dist/components/parameters/voltage-init/use-voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-form-utils.js +47 -56
- package/dist/components/parameters/voltage-init/voltage-init-parameters-form.js +1 -1
- package/dist/components/parameters/voltage-init/voltage-init-parameters-inline.js +1 -1
- package/dist/components/snackbarProvider/SnackbarProvider.js +1 -4
- package/dist/components/topBar/TopBar.js +33 -36
- package/dist/components/topBar/UserInformationDialog.js +7 -8
- package/dist/components/topBar/UserSettingsDialog.js +1 -1
- package/dist/components/treeViewFinder/TreeViewFinder.js +13 -13
- package/dist/hooks/use-parameters-backend.js +5 -5
- package/dist/hooks/use-unique-name-validation.js +2 -3
- package/dist/hooks/useConfidentialityWarning.js +1 -1
- package/dist/hooks/usePredefinedProperties.js +1 -2
- package/dist/index.js +1 -2
- package/dist/redux/commonStore.js +1 -2
- package/dist/services/utils.js +3 -3
- package/dist/utils/types/equipmentType.js +9 -13
- package/package.json +19 -17
|
@@ -73,11 +73,11 @@ function TreeViewFinderComponant(props) {
|
|
|
73
73
|
return onlyLeaves ? isLeaf(node) : true;
|
|
74
74
|
};
|
|
75
75
|
const isValidationDisabled = () => {
|
|
76
|
-
return
|
|
76
|
+
return selected?.length === 0 || selected?.length === selectedProp?.length && selected?.every((itemId) => selectedProp?.includes(itemId));
|
|
77
77
|
};
|
|
78
78
|
const computeMapPrintedNodes = useCallback((nodes) => {
|
|
79
79
|
const newMapPrintedNodes = {};
|
|
80
|
-
nodes
|
|
80
|
+
nodes?.forEach((node) => {
|
|
81
81
|
newMapPrintedNodes[node.id] = node;
|
|
82
82
|
if (!isLeaf(node)) {
|
|
83
83
|
Object.assign(newMapPrintedNodes, computeMapPrintedNodes(node.children));
|
|
@@ -125,8 +125,8 @@ function TreeViewFinderComponant(props) {
|
|
|
125
125
|
};
|
|
126
126
|
const handleNodeToggle = (_e, itemIds) => {
|
|
127
127
|
itemIds.every((itemId) => {
|
|
128
|
-
if (!
|
|
129
|
-
onTreeBrowse
|
|
128
|
+
if (!expanded?.includes(itemId)) {
|
|
129
|
+
onTreeBrowse?.(itemId);
|
|
130
130
|
return false;
|
|
131
131
|
}
|
|
132
132
|
return true;
|
|
@@ -158,7 +158,7 @@ function TreeViewFinderComponant(props) {
|
|
|
158
158
|
if (!hasSelected && !hasExpanded || !autoScrollAllowed) {
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
|
-
const isNodeExpanded = expandedProp
|
|
161
|
+
const isNodeExpanded = expandedProp?.every((itemId) => expanded?.includes(itemId));
|
|
162
162
|
const lastScrollRef = scrollRef.current[scrollRef.current.length - 1];
|
|
163
163
|
if (isNodeExpanded && lastScrollRef) {
|
|
164
164
|
lastScrollRef.scrollIntoView({
|
|
@@ -173,7 +173,7 @@ function TreeViewFinderComponant(props) {
|
|
|
173
173
|
if (multiSelect && Array.isArray(values)) {
|
|
174
174
|
setSelected(values.filter((itemId) => isSelectable(mapPrintedNodes[itemId])));
|
|
175
175
|
} else if (typeof values === "string") {
|
|
176
|
-
if (selected
|
|
176
|
+
if (selected?.includes(values)) {
|
|
177
177
|
setSelected([]);
|
|
178
178
|
} else {
|
|
179
179
|
setSelected(isSelectable(mapPrintedNodes[values]) ? [values] : []);
|
|
@@ -186,14 +186,14 @@ function TreeViewFinderComponant(props) {
|
|
|
186
186
|
}
|
|
187
187
|
let buttonLabelId = "";
|
|
188
188
|
if (Array.isArray(selectedProp)) {
|
|
189
|
-
buttonLabelId =
|
|
189
|
+
buttonLabelId = selectedProp?.length > 0 ? "treeview_finder/replaceElementsValidation" : "treeview_finder/addElementsValidation";
|
|
190
190
|
} else {
|
|
191
191
|
buttonLabelId = selectedProp ? "treeview_finder/replaceElementsValidation" : "treeview_finder/addElementsValidation";
|
|
192
192
|
}
|
|
193
193
|
return intl.formatMessage(
|
|
194
194
|
{ id: buttonLabelId },
|
|
195
195
|
{
|
|
196
|
-
nbElements: selected
|
|
196
|
+
nbElements: selected?.length
|
|
197
197
|
}
|
|
198
198
|
);
|
|
199
199
|
};
|
|
@@ -201,7 +201,7 @@ function TreeViewFinderComponant(props) {
|
|
|
201
201
|
if (!node) {
|
|
202
202
|
return null;
|
|
203
203
|
}
|
|
204
|
-
if (isSelectable(node) &&
|
|
204
|
+
if (isSelectable(node) && selected?.find((itemId) => itemId === node.id)) {
|
|
205
205
|
return /* @__PURE__ */ jsx(Check, { className: composeClasses(classes, cssLabelIcon) });
|
|
206
206
|
}
|
|
207
207
|
if (node.icon) {
|
|
@@ -247,7 +247,7 @@ function TreeViewFinderComponant(props) {
|
|
|
247
247
|
}
|
|
248
248
|
},
|
|
249
249
|
ref: (element) => {
|
|
250
|
-
const shouldAddToScrollRef = selectedProp && selectedProp.length > 0 ? selectedProp.includes(node.id) :
|
|
250
|
+
const shouldAddToScrollRef = selectedProp && selectedProp.length > 0 ? selectedProp.includes(node.id) : expandedProp?.includes(node.id) ?? false;
|
|
251
251
|
if (shouldAddToScrollRef) {
|
|
252
252
|
scrollRef.current.push(element);
|
|
253
253
|
}
|
|
@@ -278,7 +278,7 @@ function TreeViewFinderComponant(props) {
|
|
|
278
278
|
return;
|
|
279
279
|
}
|
|
280
280
|
if (r === "escapeKeyDown") {
|
|
281
|
-
onClose
|
|
281
|
+
onClose?.([]);
|
|
282
282
|
setSelected([]);
|
|
283
283
|
}
|
|
284
284
|
},
|
|
@@ -307,7 +307,7 @@ function TreeViewFinderComponant(props) {
|
|
|
307
307
|
{
|
|
308
308
|
style: { float: "left", margin: "5px" },
|
|
309
309
|
onClick: () => {
|
|
310
|
-
onClose
|
|
310
|
+
onClose?.([]);
|
|
311
311
|
setSelected([]);
|
|
312
312
|
setAutoScrollAllowed(true);
|
|
313
313
|
},
|
|
@@ -320,7 +320,7 @@ function TreeViewFinderComponant(props) {
|
|
|
320
320
|
variant: "outlined",
|
|
321
321
|
style: { float: "left", margin: "5px" },
|
|
322
322
|
onClick: () => {
|
|
323
|
-
onClose
|
|
323
|
+
onClose?.(computeSelectedNodes());
|
|
324
324
|
setSelected([]);
|
|
325
325
|
setAutoScrollAllowed(true);
|
|
326
326
|
},
|
|
@@ -33,7 +33,7 @@ const useParametersBackend = (user, studyUuid, type, optionalServiceStatus, back
|
|
|
33
33
|
}
|
|
34
34
|
const oldProvider = providerRef.current;
|
|
35
35
|
setProvider(newProvider);
|
|
36
|
-
backendUpdateProvider
|
|
36
|
+
backendUpdateProvider?.(studyUuid, newProvider).catch((error) => {
|
|
37
37
|
setProvider(oldProvider);
|
|
38
38
|
snackError({
|
|
39
39
|
messageTxt: error.message,
|
|
@@ -77,7 +77,7 @@ const useParametersBackend = (user, studyUuid, type, optionalServiceStatus, back
|
|
|
77
77
|
}, [backendFetchProviders, snackError, type]);
|
|
78
78
|
const fetchProvider = useCallback(
|
|
79
79
|
(_studyUuid) => {
|
|
80
|
-
backendFetchProvider
|
|
80
|
+
backendFetchProvider?.(_studyUuid).then((newProvider) => {
|
|
81
81
|
if (newProvider in providersRef.current) {
|
|
82
82
|
setProvider(newProvider);
|
|
83
83
|
} else {
|
|
@@ -98,7 +98,7 @@ const useParametersBackend = (user, studyUuid, type, optionalServiceStatus, back
|
|
|
98
98
|
}
|
|
99
99
|
}, [fetchAvailableProviders, fetchProvider, optionalServiceStatus, studyUuid, user]);
|
|
100
100
|
const fetchSpecificParametersDescription = useCallback(() => {
|
|
101
|
-
backendFetchSpecificParametersDescription
|
|
101
|
+
backendFetchSpecificParametersDescription?.().then((specificParams) => {
|
|
102
102
|
setSpecificParamsDescription(specificParams);
|
|
103
103
|
}).catch((error) => {
|
|
104
104
|
snackError({
|
|
@@ -113,7 +113,7 @@ const useParametersBackend = (user, studyUuid, type, optionalServiceStatus, back
|
|
|
113
113
|
}
|
|
114
114
|
}, [optionalServiceStatus, studyUuid, fetchSpecificParametersDescription]);
|
|
115
115
|
const fetchDefaultLimitReductions = useCallback(() => {
|
|
116
|
-
backendFetchDefaultLimitReductions
|
|
116
|
+
backendFetchDefaultLimitReductions?.().then((defaultLimits) => {
|
|
117
117
|
setDefaultLimitReductions(defaultLimits);
|
|
118
118
|
}).catch((error) => {
|
|
119
119
|
snackError({
|
|
@@ -129,7 +129,7 @@ const useParametersBackend = (user, studyUuid, type, optionalServiceStatus, back
|
|
|
129
129
|
}, [optionalServiceStatus, fetchDefaultLimitReductions]);
|
|
130
130
|
const backendUpdateParametersCb = useCallback(
|
|
131
131
|
(_studyUuid, newParams, oldParams) => {
|
|
132
|
-
backendUpdateParameters
|
|
132
|
+
backendUpdateParameters?.(_studyUuid, newParams).catch((error) => {
|
|
133
133
|
setParams(oldParams);
|
|
134
134
|
if (oldParams && "provider" in oldParams) {
|
|
135
135
|
setProvider(oldParams.provider);
|
|
@@ -16,7 +16,6 @@ function useUniqueNameValidation({
|
|
|
16
16
|
elementExists = elementAlreadyExists,
|
|
17
17
|
isPrefilled = false
|
|
18
18
|
}) {
|
|
19
|
-
var _a;
|
|
20
19
|
const {
|
|
21
20
|
setError,
|
|
22
21
|
clearErrors,
|
|
@@ -32,9 +31,9 @@ function useUniqueNameValidation({
|
|
|
32
31
|
} = useController({
|
|
33
32
|
name: FieldConstants.DIRECTORY
|
|
34
33
|
});
|
|
35
|
-
const defaultFieldValue = defaultValues
|
|
34
|
+
const defaultFieldValue = defaultValues?.[name];
|
|
36
35
|
const directory = selectedDirectory || activeDirectory;
|
|
37
|
-
const isValidating =
|
|
36
|
+
const isValidating = errors.root?.isValidating;
|
|
38
37
|
const handleCheckName = useCallback(
|
|
39
38
|
(nameValue) => {
|
|
40
39
|
if (nameValue !== currentName && directory) {
|
|
@@ -9,7 +9,7 @@ const useConfidentialityWarning = () => {
|
|
|
9
9
|
const [confidentialityWarningKey, setConfidentialityWarningKey] = useState();
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
fetchEnv().then((res) => {
|
|
12
|
-
setConfidentialityWarningKey(res
|
|
12
|
+
setConfidentialityWarningKey(res?.confidentialityMessageKey);
|
|
13
13
|
});
|
|
14
14
|
}, []);
|
|
15
15
|
return confidentialityWarningKey;
|
|
@@ -8,13 +8,12 @@ import "@mui/icons-material";
|
|
|
8
8
|
import "../utils/types/equipmentType.js";
|
|
9
9
|
import "../utils/yupConfig.js";
|
|
10
10
|
const fetchPredefinedProperties = async (equipmentType) => {
|
|
11
|
-
var _a;
|
|
12
11
|
const networkEquipmentType = equipmentTypesForPredefinedPropertiesMapper(equipmentType);
|
|
13
12
|
if (networkEquipmentType === void 0) {
|
|
14
13
|
return Promise.resolve(void 0);
|
|
15
14
|
}
|
|
16
15
|
const studyMetadata = await fetchStudyMetadata();
|
|
17
|
-
return
|
|
16
|
+
return studyMetadata.predefinedEquipmentProperties?.[networkEquipmentType];
|
|
18
17
|
};
|
|
19
18
|
const usePredefinedProperties = (type) => {
|
|
20
19
|
const [equipmentPredefinedProps, setEquipmentPredefinedProps] = useState({});
|
package/dist/index.js
CHANGED
|
@@ -43,7 +43,7 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./comp
|
|
|
43
43
|
import { CriteriaBasedForm } from "./components/contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
44
44
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./components/contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
45
45
|
import { ExpertFilterEditionDialog } from "./components/filter/expert/ExpertFilterEditionDialog.js";
|
|
46
|
-
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData
|
|
46
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./components/filter/expert/ExpertFilterForm.js";
|
|
47
47
|
import { CombinatorType, DataType, OperatorType } from "./components/filter/expert/expertFilter.type.js";
|
|
48
48
|
import { COMBINATOR_OPTIONS, CONVERTERS_MODE_OPTIONS, ENERGY_SOURCE_OPTIONS, EXPERT_FILTER_EQUIPMENTS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_QUERY, FIELDS_OPTIONS, LOAD_TYPE_OPTIONS, OPERATOR_OPTIONS, PHASE_REGULATION_MODE_OPTIONS, RATIO_REGULATION_MODE_OPTIONS, REGULATION_TYPE_OPTIONS, RULES, SHUNT_COMPENSATOR_TYPE_OPTIONS, SVAR_REGULATION_MODE_OPTIONS } from "./components/filter/expert/expertFilterConstants.js";
|
|
49
49
|
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./components/filter/expert/expertFilterUtils.js";
|
|
@@ -809,7 +809,6 @@ export {
|
|
|
809
809
|
resetAuthenticationRouterError,
|
|
810
810
|
roundToDefaultPrecision,
|
|
811
811
|
roundToPrecision,
|
|
812
|
-
rqbQuerySchemaValidator,
|
|
813
812
|
safeEncodeURIComponent,
|
|
814
813
|
sanitizePercentageValue,
|
|
815
814
|
saveExpertFilter,
|
|
@@ -3,8 +3,7 @@ function setCommonStore(store) {
|
|
|
3
3
|
commonStore = store;
|
|
4
4
|
}
|
|
5
5
|
function getUserToken() {
|
|
6
|
-
|
|
7
|
-
return (_a = commonStore == null ? void 0 : commonStore.getState().user) == null ? void 0 : _a.id_token;
|
|
6
|
+
return commonStore?.getState().user?.id_token;
|
|
8
7
|
}
|
|
9
8
|
export {
|
|
10
9
|
getUserToken,
|
package/dist/services/utils.js
CHANGED
|
@@ -15,8 +15,8 @@ const parseError = (text) => {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
const ensureSignal = (init) => {
|
|
18
|
-
if (init
|
|
19
|
-
const timeoutMs = typeof
|
|
18
|
+
if (init?.signal) return init;
|
|
19
|
+
const timeoutMs = typeof init?.timeoutMs === "number" ? init.timeoutMs : DEFAULT_TIMEOUT_MS;
|
|
20
20
|
return {
|
|
21
21
|
...init,
|
|
22
22
|
signal: AbortSignal.timeout(timeoutMs)
|
|
@@ -37,7 +37,7 @@ const handleError = (response) => {
|
|
|
37
37
|
const errorName = "HttpResponseError : ";
|
|
38
38
|
const errorJson = parseError(text);
|
|
39
39
|
let customError;
|
|
40
|
-
if (
|
|
40
|
+
if (errorJson?.businessErrorCode != null) {
|
|
41
41
|
throw new CustomError(errorJson.message, errorJson.status, errorJson.businessErrorCode);
|
|
42
42
|
}
|
|
43
43
|
if (errorJson && errorJson.status && errorJson.error && errorJson.message) {
|
|
@@ -10,16 +10,13 @@ const equipmentStyles = {
|
|
|
10
10
|
alignItems: "center",
|
|
11
11
|
justifyContent: "space-between"
|
|
12
12
|
},
|
|
13
|
-
equipmentTag: (theme) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color: ((_a = theme == null ? void 0 : theme.palette) == null ? void 0 : _a.mode) === "light" ? "inherit" : "black"
|
|
21
|
-
};
|
|
22
|
-
},
|
|
13
|
+
equipmentTag: (theme) => ({
|
|
14
|
+
borderRadius: "10px",
|
|
15
|
+
padding: "4px",
|
|
16
|
+
fontSize: "x-small",
|
|
17
|
+
textAlign: "center",
|
|
18
|
+
color: theme?.palette?.mode === "light" ? "inherit" : "black"
|
|
19
|
+
}),
|
|
23
20
|
equipmentTypeTag: {
|
|
24
21
|
minWidth: TYPE_TAG_MAX_SIZE,
|
|
25
22
|
maxWidth: TYPE_TAG_MAX_SIZE,
|
|
@@ -417,7 +414,6 @@ var OperatingStatus = /* @__PURE__ */ ((OperatingStatus2) => {
|
|
|
417
414
|
})(OperatingStatus || {});
|
|
418
415
|
function getEquipmentsInfosForSearchBar(equipmentsInfos, getNameOrId) {
|
|
419
416
|
return equipmentsInfos.flatMap((e) => {
|
|
420
|
-
var _a;
|
|
421
417
|
const label = getNameOrId(e);
|
|
422
418
|
return e.type === "SUBSTATION" ? [
|
|
423
419
|
{
|
|
@@ -426,14 +422,14 @@ function getEquipmentsInfosForSearchBar(equipmentsInfos, getNameOrId) {
|
|
|
426
422
|
key: e.id,
|
|
427
423
|
type: e.type
|
|
428
424
|
}
|
|
429
|
-
] :
|
|
425
|
+
] : e.voltageLevels?.map((vli) => ({
|
|
430
426
|
label,
|
|
431
427
|
id: e.id,
|
|
432
428
|
key: `${e.id}_${vli.id}`,
|
|
433
429
|
type: e.type,
|
|
434
430
|
voltageLevelLabel: getNameOrId(vli),
|
|
435
431
|
voltageLevelId: vli.id
|
|
436
|
-
}))
|
|
432
|
+
})) ?? [];
|
|
437
433
|
});
|
|
438
434
|
}
|
|
439
435
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gridsuite/commons-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.0",
|
|
4
4
|
"description": "common react components for gridsuite applications",
|
|
5
5
|
"author": "gridsuite team",
|
|
6
6
|
"homepage": "https://github.com/gridsuite",
|
|
@@ -23,13 +23,16 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"start": "vite demo/ --config vite.config.ts",
|
|
25
25
|
"start:open": "vite demo/ --config vite.config.ts --open",
|
|
26
|
-
"build": "
|
|
26
|
+
"build": "vite build",
|
|
27
27
|
"build:pack": "tsc && vite build && npm pack",
|
|
28
28
|
"prepublishOnly": "npm run build",
|
|
29
29
|
"test": "jest",
|
|
30
30
|
"test:coverage": "jest --coverage",
|
|
31
31
|
"test:watch": "jest --watch",
|
|
32
|
-
"
|
|
32
|
+
"type-check": "tsc",
|
|
33
|
+
"prebuild": "npm run lint && npm run type-check",
|
|
34
|
+
"lint": "eslint . --max-warnings 0",
|
|
35
|
+
"lint:fix": "eslint . --fix",
|
|
33
36
|
"lint:format": "prettier --check --cache .",
|
|
34
37
|
"licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
|
|
35
38
|
},
|
|
@@ -80,17 +83,19 @@
|
|
|
80
83
|
"@babel/preset-typescript": "^7.27.1",
|
|
81
84
|
"@emotion/react": "^11.14.0",
|
|
82
85
|
"@emotion/styled": "^11.14.1",
|
|
86
|
+
"@eslint/compat": "^1.4.1",
|
|
87
|
+
"@eslint/js": "^9.38.0",
|
|
83
88
|
"@hookform/resolvers": "^4.1.3",
|
|
84
89
|
"@jest/globals": "^30.1.2",
|
|
85
90
|
"@mui/icons-material": "^5.18.0",
|
|
86
91
|
"@mui/lab": "5.0.0-alpha.175",
|
|
87
92
|
"@mui/material": "^5.18.0",
|
|
88
93
|
"@react-hook/window-size": "^3.1.1",
|
|
94
|
+
"@stylistic/eslint-plugin": "^3.1.0",
|
|
89
95
|
"@testing-library/jest-dom": "^6.8.0",
|
|
90
96
|
"@testing-library/react": "^16.3.0",
|
|
91
97
|
"@testing-library/user-event": "^14.6.1",
|
|
92
98
|
"@types/autosuggest-highlight": "^3.2.3",
|
|
93
|
-
"@types/eslint": "^8.56.12",
|
|
94
99
|
"@types/eslint-config-prettier": "^6.11.3",
|
|
95
100
|
"@types/jest": "^30.0.0",
|
|
96
101
|
"@types/json-logic-js": "^2.0.8",
|
|
@@ -101,25 +106,21 @@
|
|
|
101
106
|
"@types/react": "^18.3.24",
|
|
102
107
|
"@types/react-dom": "^18.3.7",
|
|
103
108
|
"@types/react-resizable": "^3.0.8",
|
|
104
|
-
"@
|
|
105
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
106
|
-
"@vitejs/plugin-react": "^4.7.0",
|
|
109
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
107
110
|
"ag-grid-community": "^33.1.0",
|
|
108
111
|
"ag-grid-react": "^33.3.2",
|
|
109
112
|
"babel-eslint": "^10.1.0",
|
|
110
113
|
"babel-preset-airbnb": "^5.0.0",
|
|
111
114
|
"babel-preset-vite": "^1.1.3",
|
|
112
|
-
"eslint": "^
|
|
113
|
-
"eslint-config-airbnb": "^
|
|
114
|
-
"eslint-config-airbnb-typescript": "^18.0.0",
|
|
115
|
+
"eslint": "^9.38.0",
|
|
116
|
+
"eslint-config-airbnb-extended": "^2.3.2",
|
|
115
117
|
"eslint-config-prettier": "^10.1.8",
|
|
116
|
-
"eslint-
|
|
117
|
-
"eslint-plugin-
|
|
118
|
-
"eslint-plugin-import": "^2.32.0",
|
|
118
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
119
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
119
120
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
120
121
|
"eslint-plugin-prettier": "^5.5.4",
|
|
121
122
|
"eslint-plugin-react": "^7.37.5",
|
|
122
|
-
"eslint-plugin-react-hooks": "^
|
|
123
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
123
124
|
"glob": "^11.0.3",
|
|
124
125
|
"identity-obj-proxy": "^3.0.0",
|
|
125
126
|
"jest": "^30.1.3",
|
|
@@ -136,10 +137,11 @@
|
|
|
136
137
|
"react-resizable": "^3.0.5",
|
|
137
138
|
"react-router": "^7.8.2",
|
|
138
139
|
"ts-node": "^10.9.2",
|
|
139
|
-
"typescript": "~5.
|
|
140
|
-
"
|
|
140
|
+
"typescript": "~5.9.3",
|
|
141
|
+
"typescript-eslint": "^8.46.2",
|
|
142
|
+
"vite": "^7.1.12",
|
|
143
|
+
"vite-plugin-checker": "^0.8.0",
|
|
141
144
|
"vite-plugin-dts": "^4.5.4",
|
|
142
|
-
"vite-plugin-eslint": "^1.8.1",
|
|
143
145
|
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
144
146
|
"vite-plugin-svgr": "^4.5.0",
|
|
145
147
|
"yup": "^1.7.0"
|