@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
|
@@ -6,11 +6,10 @@ import * as yup from "yup";
|
|
|
6
6
|
import { v4 } from "uuid";
|
|
7
7
|
import { Box } from "@mui/material";
|
|
8
8
|
import { testQuery } from "./expertFilterUtils.js";
|
|
9
|
-
import { EXPERT_FILTER_QUERY,
|
|
9
|
+
import { EXPERT_FILTER_QUERY, RULES, OPERATOR_OPTIONS, COMBINATOR_OPTIONS, EXPERT_FILTER_FIELDS, EXPERT_FILTER_EQUIPMENTS } from "./expertFilterConstants.js";
|
|
10
10
|
import { FieldConstants } from "../../../utils/constants/fieldConstants.js";
|
|
11
11
|
import { InputWithPopupConfirmation } from "../../inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
|
|
12
12
|
import { SelectInput } from "../../inputs/reactHookForm/selectInputs/SelectInput.js";
|
|
13
|
-
import { FilterType } from "../constants/FilterConstants.js";
|
|
14
13
|
import { CustomReactQueryBuilder } from "../../inputs/reactQueryBuilder/CustomReactQueryBuilder.js";
|
|
15
14
|
import { unscrollableDialogStyles } from "../../dialogs/customMuiDialog/CustomMuiDialog.js";
|
|
16
15
|
import "../../dialogs/descriptionModificationDialog/DescriptionModificationDialog.js";
|
|
@@ -39,22 +38,15 @@ yup.setLocale({
|
|
|
39
38
|
import '../../../assets/ExpertFilterForm.css';function isSupportedEquipmentType(equipmentType) {
|
|
40
39
|
return Object.values(EXPERT_FILTER_EQUIPMENTS).map((equipments) => equipments.id).includes(equipmentType);
|
|
41
40
|
}
|
|
42
|
-
const rqbQuerySchemaValidator = (schema) => schema.test(RULES.EMPTY_GROUP, RULES.EMPTY_GROUP, (query) => {
|
|
43
|
-
return testQuery(RULES.EMPTY_GROUP, query);
|
|
44
|
-
}).test(RULES.EMPTY_RULE, RULES.EMPTY_RULE, (query) => {
|
|
45
|
-
return testQuery(RULES.EMPTY_RULE, query);
|
|
46
|
-
}).test(RULES.INCORRECT_RULE, RULES.INCORRECT_RULE, (query) => {
|
|
47
|
-
return testQuery(RULES.INCORRECT_RULE, query);
|
|
48
|
-
}).test(RULES.BETWEEN_RULE, RULES.BETWEEN_RULE, (query) => {
|
|
49
|
-
return testQuery(RULES.BETWEEN_RULE, query);
|
|
50
|
-
});
|
|
51
41
|
const expertFilterSchema = {
|
|
52
|
-
[EXPERT_FILTER_QUERY]: yup.object().
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
42
|
+
[EXPERT_FILTER_QUERY]: yup.object().test(RULES.EMPTY_GROUP, RULES.EMPTY_GROUP, (query) => {
|
|
43
|
+
return testQuery(RULES.EMPTY_GROUP, query);
|
|
44
|
+
}).test(RULES.EMPTY_RULE, RULES.EMPTY_RULE, (query) => {
|
|
45
|
+
return testQuery(RULES.EMPTY_RULE, query);
|
|
46
|
+
}).test(RULES.INCORRECT_RULE, RULES.INCORRECT_RULE, (query) => {
|
|
47
|
+
return testQuery(RULES.INCORRECT_RULE, query);
|
|
48
|
+
}).test(RULES.BETWEEN_RULE, RULES.BETWEEN_RULE, (query) => {
|
|
49
|
+
return testQuery(RULES.BETWEEN_RULE, query);
|
|
58
50
|
})
|
|
59
51
|
};
|
|
60
52
|
const defaultQuery = {
|
|
@@ -86,8 +78,7 @@ function ExpertFilterForm() {
|
|
|
86
78
|
});
|
|
87
79
|
const formatLabelWithUnit = useFormatLabelWithUnit();
|
|
88
80
|
const translatedFields = useMemo(() => {
|
|
89
|
-
|
|
90
|
-
return (_a = EXPERT_FILTER_FIELDS[watchEquipmentType]) == null ? void 0 : _a.map((field) => {
|
|
81
|
+
return EXPERT_FILTER_FIELDS[watchEquipmentType]?.map((field) => {
|
|
91
82
|
return {
|
|
92
83
|
...field,
|
|
93
84
|
label: formatLabelWithUnit(field)
|
|
@@ -116,6 +107,5 @@ function ExpertFilterForm() {
|
|
|
116
107
|
export {
|
|
117
108
|
ExpertFilterForm,
|
|
118
109
|
expertFilterSchema,
|
|
119
|
-
getExpertFilterEmptyFormData
|
|
120
|
-
rqbQuerySchemaValidator
|
|
110
|
+
getExpertFilterEmptyFormData
|
|
121
111
|
};
|
|
@@ -12,10 +12,10 @@ const searchTree = (tree, key, value) => {
|
|
|
12
12
|
const stack = Object.values(tree);
|
|
13
13
|
while (stack.length) {
|
|
14
14
|
const node = stack.shift();
|
|
15
|
-
if (
|
|
15
|
+
if (node?.[key] === value) {
|
|
16
16
|
return node;
|
|
17
17
|
}
|
|
18
|
-
if (node
|
|
18
|
+
if (node?.children) {
|
|
19
19
|
stack.push(...Object.values(node.children));
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -32,11 +32,11 @@ const getDataType = (fieldName, operator) => {
|
|
|
32
32
|
return DataType.BOOLEAN;
|
|
33
33
|
}
|
|
34
34
|
const fieldData = getFieldData(fieldName);
|
|
35
|
-
return fieldData
|
|
35
|
+
return fieldData?.dataType;
|
|
36
36
|
};
|
|
37
37
|
const getOperators = (fieldName, intl) => {
|
|
38
38
|
const field = Object.values(FIELDS_OPTIONS).find((fieldOption) => fieldOption.name === fieldName);
|
|
39
|
-
switch (field
|
|
39
|
+
switch (field?.dataType) {
|
|
40
40
|
case DataType.STRING: {
|
|
41
41
|
let stringOperators = [
|
|
42
42
|
OPERATOR_OPTIONS.CONTAINS,
|
|
@@ -121,7 +121,6 @@ const getOperators = (fieldName, intl) => {
|
|
|
121
121
|
};
|
|
122
122
|
function exportExpertRules(query) {
|
|
123
123
|
function transformRule(rule) {
|
|
124
|
-
var _a;
|
|
125
124
|
const isValueAnArray = Array.isArray(rule.value);
|
|
126
125
|
const dataType = getDataType(rule.field, rule.operator);
|
|
127
126
|
if (dataType === DataType.COMBINATOR) {
|
|
@@ -130,7 +129,7 @@ function exportExpertRules(query) {
|
|
|
130
129
|
return {
|
|
131
130
|
id: rule.id,
|
|
132
131
|
field: rule.field,
|
|
133
|
-
operator: dataType !== DataType.PROPERTY ?
|
|
132
|
+
operator: dataType !== DataType.PROPERTY ? Object.values(OPERATOR_OPTIONS).find((operator) => operator.name === rule.operator)?.customName : rule.value.propertyOperator,
|
|
134
133
|
value: !isValueAnArray && rule.operator !== OPERATOR_OPTIONS.EXISTS.name && rule.operator !== OPERATOR_OPTIONS.NOT_EXISTS.name && dataType !== DataType.PROPERTY ? convertOutputValue(rule.field, rule.value) : void 0,
|
|
135
134
|
values: isValueAnArray && dataType !== DataType.PROPERTY ? convertOutputValue(rule.field, rule.value) : void 0,
|
|
136
135
|
dataType,
|
|
@@ -139,7 +138,6 @@ function exportExpertRules(query) {
|
|
|
139
138
|
};
|
|
140
139
|
}
|
|
141
140
|
function transformCompositeRule(compositeRule) {
|
|
142
|
-
var _a;
|
|
143
141
|
const compositeGroup = compositeRule.value;
|
|
144
142
|
const transformedRules = Object.entries(compositeGroup.rules).map(
|
|
145
143
|
([field, rule]) => transformRule({
|
|
@@ -155,7 +153,7 @@ function exportExpertRules(query) {
|
|
|
155
153
|
dataType: DataType.COMBINATOR,
|
|
156
154
|
rules: transformedRules,
|
|
157
155
|
// two additional attributes to distinct a composite rule from a normal rule group
|
|
158
|
-
operator:
|
|
156
|
+
operator: Object.values(OPERATOR_OPTIONS).find((operator) => operator.name === compositeRule.operator)?.customName,
|
|
159
157
|
field: compositeRule.field
|
|
160
158
|
};
|
|
161
159
|
}
|
|
@@ -194,16 +192,14 @@ function importExpertRules(query) {
|
|
|
194
192
|
return rule.value;
|
|
195
193
|
}
|
|
196
194
|
function transformRule(rule) {
|
|
197
|
-
var _a;
|
|
198
195
|
return {
|
|
199
196
|
id: rule.id,
|
|
200
197
|
field: rule.field,
|
|
201
|
-
operator: rule.dataType !== DataType.PROPERTY ?
|
|
198
|
+
operator: rule.dataType !== DataType.PROPERTY ? Object.values(OPERATOR_OPTIONS).find((operator) => operator.customName === rule.operator)?.name : OPERATOR_OPTIONS.IS.name,
|
|
202
199
|
value: parseValue(rule)
|
|
203
200
|
};
|
|
204
201
|
}
|
|
205
202
|
function transformCompositeGroup(group) {
|
|
206
|
-
var _a;
|
|
207
203
|
const transformedRules = group.rules.map((rule) => transformRule(rule)).reduce(
|
|
208
204
|
(obj, transformedRule) => ({
|
|
209
205
|
...obj,
|
|
@@ -217,7 +213,7 @@ function importExpertRules(query) {
|
|
|
217
213
|
return {
|
|
218
214
|
id: group.id,
|
|
219
215
|
field: group.field,
|
|
220
|
-
operator:
|
|
216
|
+
operator: Object.values(OPERATOR_OPTIONS).find((operator) => operator.customName === group.operator)?.name,
|
|
221
217
|
value: {
|
|
222
218
|
combinator: group.combinator,
|
|
223
219
|
rules: transformedRules
|
|
@@ -258,7 +254,6 @@ const queryValidator = (query) => {
|
|
|
258
254
|
return result;
|
|
259
255
|
}
|
|
260
256
|
const validateRule = (rule) => {
|
|
261
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
262
257
|
const isValueAnArray = Array.isArray(rule.value);
|
|
263
258
|
const dataType = getDataType(rule.field, rule.operator);
|
|
264
259
|
const isNumberInput = dataType === DataType.NUMBER && !isValueAnArray;
|
|
@@ -269,7 +264,7 @@ const queryValidator = (query) => {
|
|
|
269
264
|
reasons: void 0
|
|
270
265
|
};
|
|
271
266
|
} else if (rule.id && rule.operator === OPERATOR_OPTIONS.BETWEEN.name) {
|
|
272
|
-
if (!
|
|
267
|
+
if (!rule.value?.[0] || !rule.value?.[1]) {
|
|
273
268
|
result[rule.id] = {
|
|
274
269
|
valid: false,
|
|
275
270
|
reasons: [RULES.EMPTY_RULE]
|
|
@@ -285,7 +280,7 @@ const queryValidator = (query) => {
|
|
|
285
280
|
reasons: [RULES.BETWEEN_RULE]
|
|
286
281
|
};
|
|
287
282
|
}
|
|
288
|
-
} else if (rule.id && rule.operator === OPERATOR_OPTIONS.IN.name && !
|
|
283
|
+
} else if (rule.id && rule.operator === OPERATOR_OPTIONS.IN.name && !rule.value?.length) {
|
|
289
284
|
result[rule.id] = {
|
|
290
285
|
valid: false,
|
|
291
286
|
reasons: [RULES.EMPTY_RULE]
|
|
@@ -300,12 +295,12 @@ const queryValidator = (query) => {
|
|
|
300
295
|
valid: false,
|
|
301
296
|
reasons: [RULES.INCORRECT_RULE]
|
|
302
297
|
};
|
|
303
|
-
} else if (rule.id && dataType === DataType.FILTER_UUID && (!
|
|
298
|
+
} else if (rule.id && dataType === DataType.FILTER_UUID && (!rule.value?.length || !validate(rule.value[0]))) {
|
|
304
299
|
result[rule.id] = {
|
|
305
300
|
valid: false,
|
|
306
301
|
reasons: [RULES.EMPTY_RULE]
|
|
307
302
|
};
|
|
308
|
-
} else if (rule.id && dataType === DataType.PROPERTY && (isBlankOrEmpty(
|
|
303
|
+
} else if (rule.id && dataType === DataType.PROPERTY && (isBlankOrEmpty(rule.value?.propertyName) || isBlankOrEmpty(rule.value?.propertyOperator) || isBlankOrEmpty(rule.value?.propertyValues) || !rule.value?.propertyValues?.length)) {
|
|
309
304
|
result[rule.id] = {
|
|
310
305
|
valid: false,
|
|
311
306
|
reasons: [RULES.EMPTY_RULE]
|
|
@@ -314,12 +309,11 @@ const queryValidator = (query) => {
|
|
|
314
309
|
const childrenFields = Object.keys(getFieldData(rule.field).children ?? {});
|
|
315
310
|
const compositeGroup = rule.value;
|
|
316
311
|
childrenFields.forEach((field) => {
|
|
317
|
-
var _a2, _b2, _c2, _d2;
|
|
318
312
|
validateRule({
|
|
319
313
|
...rule,
|
|
320
314
|
field,
|
|
321
|
-
operator:
|
|
322
|
-
value:
|
|
315
|
+
operator: compositeGroup?.rules?.[field]?.operator,
|
|
316
|
+
value: compositeGroup?.rules?.[field]?.value
|
|
323
317
|
});
|
|
324
318
|
});
|
|
325
319
|
}
|
|
@@ -355,10 +349,9 @@ const testQuery = (check, query) => {
|
|
|
355
349
|
});
|
|
356
350
|
};
|
|
357
351
|
function getNumberOfSiblings(path, query) {
|
|
358
|
-
var _a;
|
|
359
352
|
const parentPath = getParentPath(path);
|
|
360
353
|
const parentGroup = findPath(parentPath, query);
|
|
361
|
-
return
|
|
354
|
+
return parentGroup?.rules?.length;
|
|
362
355
|
}
|
|
363
356
|
function recursiveRemove(query, path) {
|
|
364
357
|
if (getNumberOfSiblings(path, query) === 1 && path.toString() !== [0].toString()) {
|
|
@@ -367,11 +360,10 @@ function recursiveRemove(query, path) {
|
|
|
367
360
|
return remove(query, path);
|
|
368
361
|
}
|
|
369
362
|
function getFilterEquipmentTypeLabel(equipmentType) {
|
|
370
|
-
var _a;
|
|
371
363
|
if (!equipmentType) {
|
|
372
364
|
return "";
|
|
373
365
|
}
|
|
374
|
-
return
|
|
366
|
+
return ALL_EQUIPMENTS[equipmentType]?.label ?? "";
|
|
375
367
|
}
|
|
376
368
|
export {
|
|
377
369
|
countRules,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ExpertFilterEditionDialog } from "./ExpertFilterEditionDialog.js";
|
|
2
|
-
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData
|
|
2
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./ExpertFilterForm.js";
|
|
3
3
|
import { CombinatorType, DataType, OperatorType } from "./expertFilter.type.js";
|
|
4
4
|
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 "./expertFilterConstants.js";
|
|
5
5
|
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expertFilterUtils.js";
|
|
@@ -34,6 +34,5 @@ export {
|
|
|
34
34
|
importExpertRules,
|
|
35
35
|
queryValidator,
|
|
36
36
|
recursiveRemove,
|
|
37
|
-
rqbQuerySchemaValidator,
|
|
38
37
|
testQuery
|
|
39
38
|
};
|
|
@@ -34,7 +34,6 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
34
34
|
language,
|
|
35
35
|
description
|
|
36
36
|
}) {
|
|
37
|
-
var _a;
|
|
38
37
|
const { snackError } = useSnackMessage();
|
|
39
38
|
const [dataFetchStatus, setDataFetchStatus] = useState(FetchStatus.IDLE);
|
|
40
39
|
const formMethods = useForm({
|
|
@@ -45,18 +44,17 @@ function ExplicitNamingFilterEditionDialog({
|
|
|
45
44
|
formState: { errors }
|
|
46
45
|
} = formMethods;
|
|
47
46
|
const nameError = errors[FieldConstants.NAME];
|
|
48
|
-
const isValidating =
|
|
47
|
+
const isValidating = errors.root?.isValidating;
|
|
49
48
|
useEffect(() => {
|
|
50
49
|
if (id && open) {
|
|
51
50
|
setDataFetchStatus(FetchStatus.FETCHING);
|
|
52
51
|
getFilterById(id).then((response) => {
|
|
53
|
-
var _a2;
|
|
54
52
|
setDataFetchStatus(FetchStatus.FETCH_SUCCESS);
|
|
55
53
|
reset({
|
|
56
54
|
[FieldConstants.NAME]: name,
|
|
57
55
|
[FieldConstants.DESCRIPTION]: description,
|
|
58
56
|
[FieldConstants.EQUIPMENT_TYPE]: response[FieldConstants.EQUIPMENT_TYPE],
|
|
59
|
-
[FILTER_EQUIPMENTS_ATTRIBUTES]:
|
|
57
|
+
[FILTER_EQUIPMENTS_ATTRIBUTES]: response[FILTER_EQUIPMENTS_ATTRIBUTES]?.map((row) => ({
|
|
60
58
|
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
61
59
|
...row
|
|
62
60
|
}))
|
|
@@ -12,7 +12,7 @@ import { Generator, Load } from "../../../utils/types/equipmentTypes.js";
|
|
|
12
12
|
import { NumericEditor } from "../../inputs/reactHookForm/agGridTable/cellEditors/numericEditor.js";
|
|
13
13
|
import { InputWithPopupConfirmation } from "../../inputs/reactHookForm/selectInputs/InputWithPopupConfirmation.js";
|
|
14
14
|
import { toFloatOrNullValue } from "../../inputs/reactHookForm/utils/functions.js";
|
|
15
|
-
import { DISTRIBUTION_KEY
|
|
15
|
+
import { DISTRIBUTION_KEY } from "../constants/FilterConstants.js";
|
|
16
16
|
import { FILTER_EQUIPMENTS } from "../utils/filterFormUtils.js";
|
|
17
17
|
import { useSnackMessage } from "../../../hooks/useSnackMessage.js";
|
|
18
18
|
import { ElementType } from "../../../utils/types/elementType.js";
|
|
@@ -33,15 +33,12 @@ const explicitNamingFilterSchema = {
|
|
|
33
33
|
[FieldConstants.EQUIPMENT_ID]: yup.string().nullable(),
|
|
34
34
|
[DISTRIBUTION_KEY]: yup.number().nullable()
|
|
35
35
|
})
|
|
36
|
-
).compact((row) => !row[DISTRIBUTION_KEY] && !row[FieldConstants.EQUIPMENT_ID]).when([FieldConstants.
|
|
37
|
-
is:
|
|
38
|
-
then: (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}).test("ifOneKeyThenKeyEverywhere", "missingDistributionKeyError", (array) => {
|
|
43
|
-
return !(array.some((row) => row[DISTRIBUTION_KEY]) && array.some((row) => !row[DISTRIBUTION_KEY]));
|
|
44
|
-
})
|
|
36
|
+
).compact((row) => !row[DISTRIBUTION_KEY] && !row[FieldConstants.EQUIPMENT_ID]).min(1, "emptyFilterError").when([FieldConstants.EQUIPMENT_TYPE], {
|
|
37
|
+
is: (equipmentType) => isGeneratorOrLoad(equipmentType),
|
|
38
|
+
then: (innerSchema) => innerSchema.test("noKeyWithoutId", "distributionKeyWithMissingIdError", (array) => {
|
|
39
|
+
return !array.some((row) => !row[FieldConstants.EQUIPMENT_ID]);
|
|
40
|
+
}).test("ifOneKeyThenKeyEverywhere", "missingDistributionKeyError", (array) => {
|
|
41
|
+
return !(array.some((row) => row[DISTRIBUTION_KEY]) && array.some((row) => !row[DISTRIBUTION_KEY]));
|
|
45
42
|
})
|
|
46
43
|
})
|
|
47
44
|
};
|
|
@@ -91,10 +88,7 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
|
|
|
91
88
|
editable: true,
|
|
92
89
|
singleClickEdit: true,
|
|
93
90
|
flex: 1,
|
|
94
|
-
valueParser: (params) =>
|
|
95
|
-
var _a;
|
|
96
|
-
return ((_a = params.newValue) == null ? void 0 : _a.trim()) ?? null;
|
|
97
|
-
}
|
|
91
|
+
valueParser: (params) => params.newValue?.trim() ?? null
|
|
98
92
|
}
|
|
99
93
|
];
|
|
100
94
|
if (forGeneratorOrLoad) {
|
|
@@ -125,11 +119,10 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
|
|
|
125
119
|
const getDataFromCsvFile = useCallback((csvData) => {
|
|
126
120
|
if (csvData) {
|
|
127
121
|
return csvData.map((value) => {
|
|
128
|
-
var _a, _b;
|
|
129
122
|
return {
|
|
130
123
|
[FieldConstants.AG_GRID_ROW_UUID]: v4(),
|
|
131
|
-
[FieldConstants.EQUIPMENT_ID]:
|
|
132
|
-
[DISTRIBUTION_KEY]: toFloatOrNullValue(
|
|
124
|
+
[FieldConstants.EQUIPMENT_ID]: value[0]?.trim(),
|
|
125
|
+
[DISTRIBUTION_KEY]: toFloatOrNullValue(value[1]?.trim())
|
|
133
126
|
};
|
|
134
127
|
});
|
|
135
128
|
}
|
|
@@ -144,7 +137,7 @@ function ExplicitNamingFilterForm({ sourceFilterForExplicitNamingConversion }) {
|
|
|
144
137
|
setValue(FILTER_EQUIPMENTS_ATTRIBUTES, makeDefaultTableRows());
|
|
145
138
|
};
|
|
146
139
|
const onStudySelected = (studyUuid) => {
|
|
147
|
-
exportFilter(studyUuid, sourceFilterForExplicitNamingConversion
|
|
140
|
+
exportFilter(studyUuid, sourceFilterForExplicitNamingConversion?.id).then((matchingEquipments) => {
|
|
148
141
|
setValue(
|
|
149
142
|
FILTER_EQUIPMENTS_ATTRIBUTES,
|
|
150
143
|
matchingEquipments.length === 0 ? makeDefaultTableRows() : matchingEquipments.map((equipment) => ({
|
|
@@ -4,7 +4,7 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./cons
|
|
|
4
4
|
import { CriteriaBasedForm } from "../contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
5
5
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "../contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
6
6
|
import { ExpertFilterEditionDialog } from "./expert/ExpertFilterEditionDialog.js";
|
|
7
|
-
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData
|
|
7
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./expert/ExpertFilterForm.js";
|
|
8
8
|
import { CombinatorType, DataType, OperatorType } from "./expert/expertFilter.type.js";
|
|
9
9
|
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 "./expert/expertFilterConstants.js";
|
|
10
10
|
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./expert/expertFilterUtils.js";
|
|
@@ -59,7 +59,6 @@ export {
|
|
|
59
59
|
importExpertRules,
|
|
60
60
|
queryValidator,
|
|
61
61
|
recursiveRemove,
|
|
62
|
-
rqbQuerySchemaValidator,
|
|
63
62
|
saveExpertFilter,
|
|
64
63
|
saveExplicitNamingFilter,
|
|
65
64
|
testQuery
|
|
@@ -50,7 +50,7 @@ function extractDefault(paramDescription) {
|
|
|
50
50
|
return d ?? null;
|
|
51
51
|
}
|
|
52
52
|
function longestCommonPrefix(stringList) {
|
|
53
|
-
if (!
|
|
53
|
+
if (!stringList?.length) {
|
|
54
54
|
return "";
|
|
55
55
|
}
|
|
56
56
|
let prefix = stringList.reduce((acc, str) => str.length < acc.length ? str : acc);
|
|
@@ -169,7 +169,7 @@ function FlatParameters({
|
|
|
169
169
|
return extractDefault(param);
|
|
170
170
|
}
|
|
171
171
|
const outputTransformFloatString = (value) => {
|
|
172
|
-
return
|
|
172
|
+
return value?.replace(",", ".") || "";
|
|
173
173
|
};
|
|
174
174
|
const getStringListValue = (allValues, selectValues) => {
|
|
175
175
|
if (!selectValues || !selectValues.length) {
|
package/dist/components/index.js
CHANGED
|
@@ -42,7 +42,7 @@ import { DISTRIBUTION_KEY, FilterType, NO_ITEM_SELECTION_FOR_COPY } from "./filt
|
|
|
42
42
|
import { CriteriaBasedForm } from "./contingencyList/criteriaBased/CriteriaBasedForm.js";
|
|
43
43
|
import { getCriteriaBasedFormData, getCriteriaBasedSchema } from "./contingencyList/criteriaBased/criteriaBasedUtils.js";
|
|
44
44
|
import { ExpertFilterEditionDialog } from "./filter/expert/ExpertFilterEditionDialog.js";
|
|
45
|
-
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData
|
|
45
|
+
import { ExpertFilterForm, expertFilterSchema, getExpertFilterEmptyFormData } from "./filter/expert/ExpertFilterForm.js";
|
|
46
46
|
import { CombinatorType, DataType, OperatorType } from "./filter/expert/expertFilter.type.js";
|
|
47
47
|
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 "./filter/expert/expertFilterConstants.js";
|
|
48
48
|
import { countRules, exportExpertRules, getFilterEquipmentTypeLabel, getNumberOfSiblings, getOperators, importExpertRules, queryValidator, recursiveRemove, testQuery } from "./filter/expert/expertFilterUtils.js";
|
|
@@ -514,7 +514,6 @@ export {
|
|
|
514
514
|
logout,
|
|
515
515
|
queryValidator,
|
|
516
516
|
recursiveRemove,
|
|
517
|
-
rqbQuerySchemaValidator,
|
|
518
517
|
sanitizePercentageValue,
|
|
519
518
|
saveExpertFilter,
|
|
520
519
|
saveExplicitNamingFilter,
|
|
@@ -9,7 +9,7 @@ function SelectClearable(props) {
|
|
|
9
9
|
return value && options.find((option) => option.id === inputValue) || null;
|
|
10
10
|
};
|
|
11
11
|
const outputTransform = (option) => {
|
|
12
|
-
return
|
|
12
|
+
return option?.id ?? null;
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ jsx(
|
|
15
15
|
Autocomplete,
|
|
@@ -97,22 +97,22 @@ function DirectoryItemsInput({
|
|
|
97
97
|
if (!values) {
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
100
|
+
if (selected?.length > 0 && values?.length > 0) {
|
|
101
101
|
selected.forEach((chip) => {
|
|
102
102
|
remove(getValues(name).findIndex((item) => item.id === chip));
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
values.forEach((value) => {
|
|
106
106
|
const { icon, children, ...otherElementAttributes } = value;
|
|
107
|
-
if (getValues(name).find((v) =>
|
|
107
|
+
if (getValues(name).find((v) => v?.id === otherElementAttributes.id) !== void 0) {
|
|
108
108
|
snackError({
|
|
109
109
|
messageTxt: "",
|
|
110
110
|
headerId: "directory_items_input/ElementAlreadyUsed"
|
|
111
111
|
});
|
|
112
112
|
} else {
|
|
113
113
|
append(otherElementAttributes);
|
|
114
|
-
onRowChanged
|
|
115
|
-
onChange
|
|
114
|
+
onRowChanged?.(true);
|
|
115
|
+
onChange?.(getValues(name), ArrayAction.ADD, otherElementAttributes);
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
setDirectoryItemSelectorOpen(false);
|
|
@@ -124,16 +124,15 @@ function DirectoryItemsInput({
|
|
|
124
124
|
(index) => {
|
|
125
125
|
const currentValues = getValues(name);
|
|
126
126
|
remove(index);
|
|
127
|
-
onRowChanged
|
|
128
|
-
onChange
|
|
127
|
+
onRowChanged?.(true);
|
|
128
|
+
onChange?.(currentValues, ArrayAction.REMOVE, currentValues[index]);
|
|
129
129
|
},
|
|
130
130
|
[onRowChanged, remove, getValues, name, onChange]
|
|
131
131
|
);
|
|
132
132
|
const handleChipClick = useCallback(
|
|
133
133
|
(index) => {
|
|
134
|
-
var _a;
|
|
135
134
|
const chips = getValues(name);
|
|
136
|
-
const chip =
|
|
135
|
+
const chip = chips.at(index)?.id;
|
|
137
136
|
if (chip) {
|
|
138
137
|
fetchDirectoryElementPath(chip).then((response) => {
|
|
139
138
|
const path = response.filter((e) => e.elementUuid !== chip).map((e) => e.elementUuid);
|
|
@@ -147,7 +146,7 @@ function DirectoryItemsInput({
|
|
|
147
146
|
[getValues, name]
|
|
148
147
|
);
|
|
149
148
|
const shouldReplaceElement = useMemo(() => {
|
|
150
|
-
return allowMultiSelect === false &&
|
|
149
|
+
return allowMultiSelect === false && elements?.length === 1;
|
|
151
150
|
}, [allowMultiSelect, elements]);
|
|
152
151
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
153
152
|
/* @__PURE__ */ jsxs(
|
|
@@ -156,53 +155,50 @@ function DirectoryItemsInput({
|
|
|
156
155
|
sx: mergeSx(
|
|
157
156
|
styles.formDirectoryElements1,
|
|
158
157
|
// @ts-expect-error
|
|
159
|
-
|
|
158
|
+
error?.message && styles.formDirectoryElementsError
|
|
160
159
|
),
|
|
161
|
-
error: !!
|
|
160
|
+
error: !!error?.message,
|
|
162
161
|
children: [
|
|
163
|
-
|
|
162
|
+
elements?.length === 0 && label && /* @__PURE__ */ jsx(
|
|
164
163
|
FieldLabel,
|
|
165
164
|
{
|
|
166
165
|
label,
|
|
167
166
|
optional: labelRequiredFromContext && !isFieldRequired(name, validationSchema, getValues())
|
|
168
167
|
}
|
|
169
168
|
),
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
item.id
|
|
204
|
-
);
|
|
205
|
-
}) }),
|
|
169
|
+
elements?.length > 0 && /* @__PURE__ */ jsx(FormControl, { sx: styles.formDirectoryElements2, children: elements.map((item, index) => /* @__PURE__ */ jsxs(
|
|
170
|
+
Box,
|
|
171
|
+
{
|
|
172
|
+
sx: { display: "flex", alignItems: "center", flexDirection: "column", gap: 1 },
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsx(
|
|
175
|
+
Chip,
|
|
176
|
+
{
|
|
177
|
+
size: "small",
|
|
178
|
+
sx: {
|
|
179
|
+
backgroundColor: item?.specificMetadata?.equipmentType && equipmentColorsMap?.get(item?.specificMetadata?.equipmentType)
|
|
180
|
+
},
|
|
181
|
+
onDelete: () => removeElements(index),
|
|
182
|
+
onClick: () => handleChipClick(index),
|
|
183
|
+
label: /* @__PURE__ */ jsx(
|
|
184
|
+
OverflowableText,
|
|
185
|
+
{
|
|
186
|
+
text: getValues(`${name}.${index}.${NAME}`) ? /* @__PURE__ */ jsx(RawReadOnlyInput, { name: `${name}.${index}.${NAME}` }) : intl.formatMessage({ id: "elementNotFound" }),
|
|
187
|
+
sx: { width: "100%" }
|
|
188
|
+
}
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
equipmentColorsMap && /* @__PURE__ */ jsx(FormHelperText, { children: item?.specificMetadata?.equipmentType ? /* @__PURE__ */ jsx(
|
|
193
|
+
FormattedMessage,
|
|
194
|
+
{
|
|
195
|
+
id: getFilterEquipmentTypeLabel(item.specificMetadata.equipmentType)
|
|
196
|
+
}
|
|
197
|
+
) : "" })
|
|
198
|
+
]
|
|
199
|
+
},
|
|
200
|
+
item.id
|
|
201
|
+
)) }),
|
|
206
202
|
/* @__PURE__ */ jsx(Grid, { item: true, xs: true, children: /* @__PURE__ */ jsx(Grid, { container: true, direction: "row-reverse", children: /* @__PURE__ */ jsx(Tooltip, { title: intl.formatMessage({ id: titleId }), children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(
|
|
207
203
|
IconButton,
|
|
208
204
|
{
|
|
@@ -72,7 +72,6 @@ function CustomAgGridTable({
|
|
|
72
72
|
rowSelection,
|
|
73
73
|
...props
|
|
74
74
|
}) {
|
|
75
|
-
var _a, _b;
|
|
76
75
|
const theme = useTheme();
|
|
77
76
|
const [gridApi, setGridApi] = useState(null);
|
|
78
77
|
const [selectedRows, setSelectedRows] = useState([]);
|
|
@@ -86,10 +85,10 @@ function CustomAgGridTable({
|
|
|
86
85
|
const { append, remove, update, swap, move } = useFieldArrayOutput;
|
|
87
86
|
const rowData = watch(name);
|
|
88
87
|
const isFirstSelected = Boolean(
|
|
89
|
-
|
|
88
|
+
rowData?.length && gridApi?.api.getRowNode(rowData[0][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
|
|
90
89
|
);
|
|
91
90
|
const isLastSelected = Boolean(
|
|
92
|
-
|
|
91
|
+
rowData?.length && gridApi?.api.getRowNode(rowData[rowData.length - 1][FieldConstants.AG_GRID_ROW_UUID])?.isSelected()
|
|
93
92
|
);
|
|
94
93
|
const noRowSelected = selectedRows.length === 0;
|
|
95
94
|
const getIndex = useCallback(
|
|
@@ -136,7 +135,7 @@ function CustomAgGridTable({
|
|
|
136
135
|
};
|
|
137
136
|
const onRowDataUpdated = () => {
|
|
138
137
|
setNewRowAdded(false);
|
|
139
|
-
if (gridApi
|
|
138
|
+
if (gridApi?.api) {
|
|
140
139
|
const lastIndex = rowData.length - 1;
|
|
141
140
|
gridApi.api.paginationGoToLastPage();
|
|
142
141
|
gridApi.api.ensureIndexVisible(lastIndex, "bottom");
|
|
@@ -62,7 +62,7 @@ function CsvUploader({
|
|
|
62
62
|
if (row[0].startsWith("#")) {
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
|
-
return row.some((column) => !!
|
|
65
|
+
return row.some((column) => !!column?.trim());
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
const handleFileSubmit = (keepTableValues) => {
|
|
@@ -34,13 +34,13 @@ function AutocompleteInput({
|
|
|
34
34
|
} = useController({ name });
|
|
35
35
|
const handleChange = (newValue) => {
|
|
36
36
|
const currentValue = getValues(name);
|
|
37
|
-
if (
|
|
37
|
+
if (currentValue?.id === newValue) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
if (onCheckNewValue && !onCheckNewValue(newValue)) {
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
|
-
onChangeCallback
|
|
43
|
+
onChangeCallback?.();
|
|
44
44
|
if (!allowNewValue || typeof newValue !== "string") {
|
|
45
45
|
onChange(outputTransform(newValue));
|
|
46
46
|
return;
|
|
@@ -74,7 +74,7 @@ function AutocompleteInput({
|
|
|
74
74
|
...label && {
|
|
75
75
|
label: FieldLabel({
|
|
76
76
|
label,
|
|
77
|
-
optional: !isFieldRequired(name, validationSchema, getValues()) && !
|
|
77
|
+
optional: !isFieldRequired(name, validationSchema, getValues()) && !props?.disabled && !removeOptional
|
|
78
78
|
})
|
|
79
79
|
},
|
|
80
80
|
inputRef: ref,
|
|
@@ -87,7 +87,7 @@ function AutocompleteInput({
|
|
|
87
87
|
disabledTooltip: disabledTooltip || !isUpdate && isNodeBuilt
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
...genHelperError(error
|
|
90
|
+
...genHelperError(error?.message),
|
|
91
91
|
...formProps,
|
|
92
92
|
...rest
|
|
93
93
|
}
|