@contrail/documents 1.1.17 → 1.1.19
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.
|
@@ -59,14 +59,23 @@ class DynamicTextUtil {
|
|
|
59
59
|
const displayFunction = ((_c = dynamicTextElement.propertyBindingsMetaData) === null || _c === void 0 ? void 0 : _c.displayFunction) || DynamicTextDisplayFunction.VALUE;
|
|
60
60
|
const displayLabel = (_d = dynamicTextElement.propertyBindingsMetaData) === null || _d === void 0 ? void 0 : _d.displayLabel;
|
|
61
61
|
const bindingProperty = dynamicTextElement.propertyBindings.text;
|
|
62
|
+
if (['projectItem.project.name', 'specificationProjectItem.project.name'].includes(bindingProperty)) {
|
|
63
|
+
property = {
|
|
64
|
+
slug: 'name',
|
|
65
|
+
label: 'Project name',
|
|
66
|
+
propertyType: types_1.PropertyType.String,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
62
69
|
const [entityType, propertySlug] = bindingProperty === null || bindingProperty === void 0 ? void 0 : bindingProperty.split('.');
|
|
63
70
|
let text = '';
|
|
64
|
-
if (['showcase', 'board', 'project'].includes(entityType)) {
|
|
71
|
+
if (['showcase', 'board', 'project'].includes(entityType) || isSpecRelated) {
|
|
65
72
|
if (!ownerReferenceModel) {
|
|
66
73
|
return '';
|
|
67
74
|
}
|
|
68
75
|
text = util_1.ObjectUtil.getByPath(ownerReferenceModel, bindingProperty);
|
|
69
|
-
text =
|
|
76
|
+
text = property
|
|
77
|
+
? formatter.formatValueForProperty(text, property)
|
|
78
|
+
: formatter.formatValue(text, types_1.PropertyType.String);
|
|
70
79
|
}
|
|
71
80
|
else {
|
|
72
81
|
if (!frame && !isSpecRelated) {
|
|
@@ -88,13 +97,6 @@ class DynamicTextUtil {
|
|
|
88
97
|
if (frameProperties.includes(bindingProperty)) {
|
|
89
98
|
property = null;
|
|
90
99
|
}
|
|
91
|
-
else if (['projectItem.project.name', 'specificationProjectItem.project.name'].includes(bindingProperty)) {
|
|
92
|
-
property = {
|
|
93
|
-
slug: 'name',
|
|
94
|
-
label: 'Project name',
|
|
95
|
-
propertyType: types_1.PropertyType.String,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
100
|
const frameMemberValues = [];
|
|
99
101
|
componentModels.forEach((elementModel) => {
|
|
100
102
|
frameMemberValues.push(util_1.ObjectUtil.getByPath(elementModel, bindingProperty));
|
|
@@ -106,7 +108,7 @@ class DynamicTextUtil {
|
|
|
106
108
|
}
|
|
107
109
|
}
|
|
108
110
|
if (displayFunction === DynamicTextDisplayFunction.LABEL) {
|
|
109
|
-
if (['showcase', 'board', 'project', 'frame'].includes(entityType)) {
|
|
111
|
+
if (['showcase', 'board', 'project', 'frame'].includes(entityType) || isSpecRelated) {
|
|
110
112
|
text = exports.HARD_CODED_TEXT[bindingProperty] || (property === null || property === void 0 ? void 0 : property.label);
|
|
111
113
|
}
|
|
112
114
|
else if (!frame) {
|