@builttocreate/engine-utils 2.10.1-beta.v593.21 → 2.10.1-beta.v593.23

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.
@@ -121,6 +121,7 @@ function generateReadableId(parts, type) {
121
121
  // if (views && views.length > 1) count += getViewsFieldPositionsCount(views, type);
122
122
 
123
123
  var readableId = "".concat(type).concat(splitterId).concat(count + 1);
124
+ count++;
124
125
 
125
126
  /**
126
127
  * If the user drags one text field and renames it to text 2, we need to ensure
@@ -163,6 +164,7 @@ function generateReadableTableColumnId(tableId, tableColumns, columnId) {
163
164
  var type = (col.type || 'unknown').toLowerCase();
164
165
  counts[type] = (counts[type] || 0) + 1;
165
166
  var readableId = "".concat(type).concat(counts[type]);
167
+ counts[type]++;
166
168
  if (col._id === columnId) {
167
169
  /**
168
170
  * If the generatedReadableId is already present in the tableColumns,
@@ -100,6 +100,7 @@ var getDefaultJoyDoc = exports.getDefaultJoyDoc = function getDefaultJoyDoc() {
100
100
  */
101
101
  var getFieldId = function getFieldId(existingId, type, doc) {
102
102
  // If existing ID is a valid ObjectId or readableId, maintain it
103
+ //Note: readableId validation is already done when it's being generated
103
104
 
104
105
  if (existingId && (0, _validateObjectId["default"])(existingId)) {
105
106
  return existingId;
@@ -168,7 +168,7 @@ var _default = exports["default"] = function _default(readableId, fields, tableC
168
168
  if ((targetField === null || targetField === void 0 ? void 0 : targetField.type) === _FieldTypes["default"].collection) {
169
169
  var flattenedSchema = (0, _fieldHelper.flattenSchemaTree)(targetField.schema);
170
170
  var readableIdExists = flattenedSchema.some(function (schema) {
171
- return schema._id === readableId;
171
+ return schema.id === readableId;
172
172
  });
173
173
  if (readableIdExists) {
174
174
  console.warn("validateReadableId: \"".concat(readableId, "\" is invalid - it already exists in fields"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builttocreate/engine-utils",
3
- "version": "2.10.1-beta.v593.21",
3
+ "version": "2.10.1-beta.v593.23",
4
4
  "description": "Utility library for common logic shared across web and mobile",
5
5
  "main": "dist/index.js",
6
6
  "files": [