@contrail/document-generation 2.1.15 → 2.1.16

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.
@@ -134,7 +134,7 @@ class BoardDocumentGenerator {
134
134
  static findDeepestSubgroups(group, subgroups, totalDepth, currentDepth, stopAtSecondary) {
135
135
  if (currentDepth === totalDepth && group.subGroups.length > 0) {
136
136
  if (!group.isSecondaryGroup &&
137
- group.subGroups.filter(subgroup => subgroup.name === group.subGroups[0].name).length > 1) {
137
+ group.subGroups.filter((subgroup) => subgroup.name === group.subGroups[0].name).length > 1) {
138
138
  subgroups.push(group.subGroups[0]);
139
139
  }
140
140
  else {
@@ -27,16 +27,15 @@ class DocumentDynamicTextElementUtil {
27
27
  }
28
28
  if (propertyLevel && propertyLevel === types_1.PropertyLevel.FAMILY) {
29
29
  componentModels = JSON.parse(JSON.stringify(dataGroup.data));
30
- componentModels.forEach(d => {
30
+ componentModels.forEach(componentModel => {
31
31
  var _a;
32
- const entity = d[entityType];
33
- if (entity && ['item', 'project-item'].includes(entity.entityType) && ((_a = entity.roles) === null || _a === void 0 ? void 0 : _a.includes('option'))) {
34
- if (entity.itemFamily) {
35
- d[entityType] = entity.itemFamily;
36
- }
37
- else if (entity.familyProjectItem) {
38
- d[entityType] = entity.familyProjectItem;
39
- }
32
+ const entity = componentModel[entityType];
33
+ const isOption = (_a = entity === null || entity === void 0 ? void 0 : entity.roles) === null || _a === void 0 ? void 0 : _a.includes('option');
34
+ if (isOption && entityType === 'item' && entity.itemFamily) {
35
+ componentModel[entityType] = entity.itemFamily;
36
+ }
37
+ if (isOption && entityType === 'project-item' && entity.familyProjectItem) {
38
+ componentModel[entityType] = entity.familyProjectItem;
40
39
  }
41
40
  });
42
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/document-generation",
3
- "version": "2.1.15",
3
+ "version": "2.1.16",
4
4
  "description": "Utilities for automatic generation of documents.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
File without changes
File without changes