@hestia-earth/ui-components 0.32.66 → 0.32.68
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.
|
@@ -9071,7 +9071,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
|
|
|
9071
9071
|
/* eslint-disable complexity */
|
|
9072
9072
|
/* eslint-disable max-len */
|
|
9073
9073
|
/* eslint-disable no-useless-escape */
|
|
9074
|
-
const guidePageId = (nodeType, errorMessage) => [`guide-data-validation${toDashCase(nodeType)}`, validationsByMessage?.[errorMessage]?.[0]]
|
|
9074
|
+
const guidePageId = (nodeType, errorMessage) => [`guide-data-validation${toDashCase(nodeType)}`, validationsByMessage?.[errorMessage]?.[0]?.function]
|
|
9075
|
+
.filter(Boolean)
|
|
9076
|
+
.join('#');
|
|
9075
9077
|
const mapErrorMessage = 'does not contain latitude and longitude';
|
|
9076
9078
|
const parseDataPath = (dataPath = '') => {
|
|
9077
9079
|
const [_, ...paths] = dataPath
|
|
@@ -9641,7 +9643,9 @@ const customErrorMessage = {
|
|
|
9641
9643
|
'should add missing inputs': ({ params: { expected } }) => `Should add missing inputs: ${expected.map(code).join(', ')}`,
|
|
9642
9644
|
'the property value type is incorrect': ({ params: { expected } }) => `The value must be a ${expected}.`,
|
|
9643
9645
|
'the node value type is incorrect': ({ params: { expected } }) => `The value must be a ${expected}.`,
|
|
9644
|
-
'can not be linked to the same type': ({ params: { current } }) => `Cannot be linked to the same ${current}
|
|
9646
|
+
'can not be linked to the same type': ({ params: { current } }) => `Cannot be linked to the same ${current}.`,
|
|
9647
|
+
'must be above the minimum': ({ params: { min } }) => `Must be above ${min}.`,
|
|
9648
|
+
'must be below the maximum': ({ params: { max } }) => `Must be below ${max}.`
|
|
9645
9649
|
};
|
|
9646
9650
|
const requiredPropertyError = (message, error) => {
|
|
9647
9651
|
const field = message.split("'")[1].replace("'", '');
|
|
@@ -10019,7 +10023,7 @@ const missingPropertyErrors = (node, errors, parent = '') => {
|
|
|
10019
10023
|
};
|
|
10020
10024
|
});
|
|
10021
10025
|
};
|
|
10022
|
-
const propertyFromNode = (schemas, errors, nodeSchema, deepEditable, parent = '', node) => (key) => {
|
|
10026
|
+
const propertyFromNode = (schemas, errors, nodeSchema, deepEditable, parent = '', node, parentNode) => (key) => {
|
|
10023
10027
|
const value = node[key];
|
|
10024
10028
|
const expandable = isExpandable(value);
|
|
10025
10029
|
const collapsible = isCollapsible(value);
|
|
@@ -10027,6 +10031,7 @@ const propertyFromNode = (schemas, errors, nodeSchema, deepEditable, parent = ''
|
|
|
10027
10031
|
const nonExpandableArray = isArray && !expandable;
|
|
10028
10032
|
const fullKey = Array.isArray(node) ? `${parent}[${key}]` : [parent, key].filter(Boolean).join('.');
|
|
10029
10033
|
const nodeType = node.type || node['@type'];
|
|
10034
|
+
const parentNodeType = parentNode?.type || parentNode?.['@type'];
|
|
10030
10035
|
const schemaType = expandable
|
|
10031
10036
|
? isArray && value.length
|
|
10032
10037
|
? value[0].type || value[0]['@type']
|
|
@@ -10045,7 +10050,9 @@ const propertyFromNode = (schemas, errors, nodeSchema, deepEditable, parent = ''
|
|
|
10045
10050
|
? schema
|
|
10046
10051
|
: nodeSchema
|
|
10047
10052
|
: nodeSchema;
|
|
10048
|
-
const properties = expandable || isIri
|
|
10053
|
+
const properties = expandable || isIri
|
|
10054
|
+
? recursiveProperties(schemas, errors, parentSchema, deepEditable, fullKey)(value, parentNode)
|
|
10055
|
+
: [];
|
|
10049
10056
|
const inError = errorHasError(error) || hasError(properties);
|
|
10050
10057
|
const inWarning = errorHasWarning(error) || hasWarning(properties);
|
|
10051
10058
|
const editable = isTypeNode(node['@type']) || (expandable && isTypeNode(value['@type']))
|
|
@@ -10071,7 +10078,7 @@ const propertyFromNode = (schemas, errors, nodeSchema, deepEditable, parent = ''
|
|
|
10071
10078
|
newProperty: {},
|
|
10072
10079
|
newError: { level: 'warning' },
|
|
10073
10080
|
error: formatError(error),
|
|
10074
|
-
errorGuidePageId: guidePageId(nodeType, error?.message),
|
|
10081
|
+
errorGuidePageId: guidePageId(parentNodeType || nodeType, error?.message),
|
|
10075
10082
|
isHidden: parent && isKeyHidden(key),
|
|
10076
10083
|
closedVisible: isKeyClosedVisible(key),
|
|
10077
10084
|
hasError: inError,
|
|
@@ -10096,11 +10103,11 @@ const singleProperty = (schemas, errors, node, fullKey) => {
|
|
|
10096
10103
|
const parentNode = parent.length ? get(node, parent) : node;
|
|
10097
10104
|
const schemaType = typeToSchemaType(parentNode.type || parentNode['@type']);
|
|
10098
10105
|
const parentSchema = schemas[schemaType];
|
|
10099
|
-
return propertyFromNode(schemas, errors, parentSchema, true, parent, parentNode)(key);
|
|
10106
|
+
return propertyFromNode(schemas, errors, parentSchema, true, parent, parentNode, parentNode)(key);
|
|
10100
10107
|
};
|
|
10101
|
-
const recursiveProperties = (schemas, errors, nodeSchema, deepEditable, parent = '') => (node) => Object.keys(node)
|
|
10108
|
+
const recursiveProperties = (schemas, errors, nodeSchema, deepEditable, parent = '') => (node, parentNode) => Object.keys(node)
|
|
10102
10109
|
.filter(key => !ignoreKeys.includes(key))
|
|
10103
|
-
.map(propertyFromNode(schemas, errors, nodeSchema, deepEditable, parent, node))
|
|
10110
|
+
.map(propertyFromNode(schemas, errors, nodeSchema, deepEditable, parent, node, parentNode || node))
|
|
10104
10111
|
.concat(...missingPropertyErrors(node, errors, parent))
|
|
10105
10112
|
.sort(sortProperties);
|
|
10106
10113
|
const fullKeyParts = (fullKey) => fullKey.split('.').flatMap(val => {
|