@hestia-earth/ui-components 0.0.28 → 0.0.29

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.
@@ -5307,7 +5307,7 @@
5307
5307
  return !!id && (values === null || values === void 0 ? void 0 : values.length)
5308
5308
  ? term.propertyValue((_a = values.find(function (_c) {
5309
5309
  var inputs = _c.inputs;
5310
- return inputs.some(function (input) { return input['@id'] === id; });
5310
+ return (inputs || []).some(function (input) { return input['@id'] === id; });
5311
5311
  })) === null || _a === void 0 ? void 0 : _a.value, id)
5312
5312
  : '';
5313
5313
  },
@@ -8046,7 +8046,8 @@
8046
8046
  var defaultProperties = _a.defaultProperties, node = __rest(_a, ["defaultProperties"]);
8047
8047
  return (Object.assign(Object.assign({}, node), ((defaultProperties === null || defaultProperties === void 0 ? void 0 : defaultProperties.length) ? { defaultProperties: defaultProperties.map(formatProperty) } : {})));
8048
8048
  };
8049
- var formatLinkNodesSuggestions = function (nodeMap, type) { return (nodeMap[type] || []).map(function (id) { return ({ type: type, id: id, name: "Link with " + type + ": " + id }); }); };
8049
+ var formatLinkNodesPrefix = 'Link with';
8050
+ var formatLinkNodesSuggestions = function (nodeMap, type) { return (nodeMap[type] || []).map(function (id) { return ({ type: type, id: id, name: formatLinkNodesPrefix + " " + type + ": " + id }); }); };
8050
8051
  var FilesFormComponent = /** @class */ (function () {
8051
8052
  function FilesFormComponent(ref, searchService, usersService) {
8052
8053
  var _c;
@@ -8331,6 +8332,7 @@
8331
8332
  return this.moveArrayGroupToPosition(array, index, index + 1);
8332
8333
  };
8333
8334
  FilesFormComponent.prototype.propertyChanged = function (value, property) {
8335
+ var _a;
8334
8336
  groupChanged(this.properties, property.fullKey, value);
8335
8337
  property.addPropertyEnabled = isAddPropertyEnabled(this.node, property.schemaType, property.schema, property.fullKey);
8336
8338
  if (value === null) {
@@ -8340,7 +8342,12 @@
8340
8342
  property.value = value;
8341
8343
  property.changed = true;
8342
8344
  }
8343
- this.nodeChange.emit({ key: property.fullKey, value: parseNewValue(property.schema, value) });
8345
+ var newValue = parseNewValue(property.schema, value);
8346
+ // patch error when link is not working correctly
8347
+ if ((_a = newValue === null || newValue === void 0 ? void 0 : newValue.id) === null || _a === void 0 ? void 0 : _a.startsWith(formatLinkNodesPrefix)) {
8348
+ newValue.id = newValue.id.split(':')[1].trim();
8349
+ }
8350
+ this.nodeChange.emit({ key: property.fullKey, value: newValue });
8344
8351
  };
8345
8352
  FilesFormComponent.prototype.addDefaultProperty = function (property, key, def) {
8346
8353
  var node = property.key ? get(this.node, property.fullKey) : this.node;