@luomus/laji-form 15.1.115 → 15.1.117
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.
|
@@ -61,7 +61,7 @@ function EnumRangeArrayField(props) {
|
|
|
61
61
|
}, [propsOnChange]);
|
|
62
62
|
const getEnumOptionsAsync = (0, react_1.useCallback)(() => __awaiter(this, void 0, void 0, function* () {
|
|
63
63
|
const enums = (yield props.formContext.apiClient.get("/metadata/alts/{alt}", { path: { alt: range } })).results;
|
|
64
|
-
return enums.map(({ value }) => ({ value, label: value }));
|
|
64
|
+
return enums.map(({ value }) => ({ value, label: value !== null && value !== void 0 ? value : "" }));
|
|
65
65
|
}), [props.formContext.apiClient, range]);
|
|
66
66
|
const { Label } = props.formContext;
|
|
67
67
|
return React.createElement(React.Fragment, null,
|
|
@@ -82,7 +82,16 @@ class ErrorListTemplate extends React.Component {
|
|
|
82
82
|
const clickHandler = formContext.services.focus.focus;
|
|
83
83
|
function walkErrors(path, id, errorSchema, uiSchema, defaultTitle) {
|
|
84
84
|
const { __errors } = errorSchema, properties = __rest(errorSchema, ["__errors"]);
|
|
85
|
-
|
|
85
|
+
try {
|
|
86
|
+
(0, utils_1.parseJSONPointer)(schema, path);
|
|
87
|
+
}
|
|
88
|
+
catch (e) {
|
|
89
|
+
console.warn("If you see this warning, tell Olli about with repro steps please");
|
|
90
|
+
}
|
|
91
|
+
// TODO shouldn't really default to {} here. If the errors do not follow the schema, there's another bug somewhere
|
|
92
|
+
// and this is a mere symptom. This was added because I absolutely could not repro the bug.
|
|
93
|
+
// https://luomus-ict.slack.com/archives/CQUQRRATU/p1779693889123989
|
|
94
|
+
const _schema = (0, utils_1.parseJSONPointer)(schema, path) || {};
|
|
86
95
|
const title = _schema.title || defaultTitle;
|
|
87
96
|
let { externalErrors, errors, warnings } = (__errors || []).reduce(({ externalErrors, errors, warnings }, _error) => {
|
|
88
97
|
const error = {
|