@sapui5/sap.fe.templates 1.101.0 → 1.103.0
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.
- package/package.json +1 -1
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +2 -2
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.ts +1 -1
- package/src/sap/fe/templates/Feedback.js +18 -18
- package/src/sap/fe/templates/Feedback.ts +12 -12
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +15 -15
- package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +19 -16
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +107 -58
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +180 -70
- package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +191 -88
- package/src/sap/fe/templates/ListReport/ListReportTemplating.js +45 -0
- package/src/sap/fe/templates/ListReport/ListReportTemplating.ts +30 -0
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +2 -2
- package/src/sap/fe/templates/ListReport/overrides/Share.js +9 -7
- package/src/sap/fe/templates/ListReport/overrides/Share.ts +10 -10
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +13 -6
- package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +17 -11
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +1 -1
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +12 -16
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +17 -20
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +167 -20
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +195 -206
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +187 -229
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +861 -0
- package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +822 -0
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -3
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +4 -4
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/handler/DraftHandler.js +103 -0
- package/src/sap/fe/templates/ObjectPage/handler/DraftHandler.ts +97 -0
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +5 -5
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +17 -17
- package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +19 -30
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +4 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +15 -11
- package/src/sap/fe/templates/ObjectPage/view/fragments/CollaborationDraft.fragment.xml +1 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +25 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +28 -24
- package/src/sap/fe/templates/ObjectPage/view/fragments/FormActionButtons.fragment.xml +15 -16
- package/src/sap/fe/templates/ObjectPage/view/fragments/FormActions.fragment.xml +1 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPoint.fragment.xml +1 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +1 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +3 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +16 -17
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +4 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderAddress.fragment.xml +7 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderContact.fragment.xml +26 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +4 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/RelatedApps.fragment.xml +7 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +74 -6
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +118 -94
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +127 -107
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +2 -2
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +102 -57
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +96 -61
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +3 -4
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +4 -5
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +140 -52
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +108 -54
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +3 -3
- package/src/sap/fe/templates/TableScroller.js +3 -3
- package/src/sap/fe/templates/TableScroller.ts +2 -2
- package/src/sap/fe/templates/controls/MacroChart.fragment.xml +1 -0
- package/src/sap/fe/templates/controls/Table.fragment.xml +4 -4
- package/src/sap/fe/templates/library.js +5 -2
- package/src/sap/fe/templates/library.ts +3 -0
- package/src/sap/fe/templates/messagebundle.properties +6 -18
- package/src/sap/fe/templates/messagebundle_ar.properties +10 -6
- package/src/sap/fe/templates/messagebundle_bg.properties +6 -2
- package/src/sap/fe/templates/messagebundle_ca.properties +10 -6
- package/src/sap/fe/templates/messagebundle_cs.properties +6 -2
- package/src/sap/fe/templates/messagebundle_cy.properties +10 -6
- package/src/sap/fe/templates/messagebundle_da.properties +10 -6
- package/src/sap/fe/templates/messagebundle_de.properties +10 -6
- package/src/sap/fe/templates/messagebundle_el.properties +10 -6
- package/src/sap/fe/templates/messagebundle_en.properties +6 -2
- package/src/sap/fe/templates/messagebundle_en_GB.properties +8 -4
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +13 -5
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
- package/src/sap/fe/templates/messagebundle_es.properties +6 -2
- package/src/sap/fe/templates/messagebundle_es_MX.properties +10 -6
- package/src/sap/fe/templates/messagebundle_et.properties +6 -2
- package/src/sap/fe/templates/messagebundle_fi.properties +10 -6
- package/src/sap/fe/templates/messagebundle_fr.properties +6 -2
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +10 -6
- package/src/sap/fe/templates/messagebundle_hi.properties +10 -6
- package/src/sap/fe/templates/messagebundle_hr.properties +10 -6
- package/src/sap/fe/templates/messagebundle_hu.properties +6 -2
- package/src/sap/fe/templates/messagebundle_id.properties +6 -2
- package/src/sap/fe/templates/messagebundle_it.properties +10 -6
- package/src/sap/fe/templates/messagebundle_iw.properties +10 -6
- package/src/sap/fe/templates/messagebundle_ja.properties +6 -2
- package/src/sap/fe/templates/messagebundle_kk.properties +10 -6
- package/src/sap/fe/templates/messagebundle_ko.properties +6 -2
- package/src/sap/fe/templates/messagebundle_lt.properties +6 -2
- package/src/sap/fe/templates/messagebundle_lv.properties +6 -2
- package/src/sap/fe/templates/messagebundle_ms.properties +10 -6
- package/src/sap/fe/templates/messagebundle_nl.properties +6 -2
- package/src/sap/fe/templates/messagebundle_no.properties +10 -6
- package/src/sap/fe/templates/messagebundle_pl.properties +10 -6
- package/src/sap/fe/templates/messagebundle_pt.properties +6 -2
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +6 -2
- package/src/sap/fe/templates/messagebundle_ro.properties +10 -6
- package/src/sap/fe/templates/messagebundle_ru.properties +10 -6
- package/src/sap/fe/templates/messagebundle_sh.properties +6 -2
- package/src/sap/fe/templates/messagebundle_sk.properties +6 -2
- package/src/sap/fe/templates/messagebundle_sl.properties +10 -6
- package/src/sap/fe/templates/messagebundle_sv.properties +6 -2
- package/src/sap/fe/templates/messagebundle_th.properties +10 -6
- package/src/sap/fe/templates/messagebundle_tr.properties +6 -2
- package/src/sap/fe/templates/messagebundle_uk.properties +6 -2
- package/src/sap/fe/templates/messagebundle_vi.properties +10 -6
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +10 -6
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +10 -6
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +0 -482
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.ts +0 -511
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +0 -120
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +0 -138
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
import CommonHelper from "sap/fe/macros/CommonHelper";
|
|
2
|
-
import ManagedObject from "sap/ui/base/ManagedObject";
|
|
3
|
-
import ODataModelAnnotationHelper from "sap/ui/model/odata/v4/AnnotationHelper";
|
|
4
|
-
import Context from "sap/ui/model/odata/v4/Context";
|
|
5
|
-
/*
|
|
6
|
-
This class contains annotation helpers that might be used from several templates or controls
|
|
7
|
-
*/
|
|
8
|
-
const AnnotationHelper = {
|
|
9
|
-
getElementBinding: function (sPath: any) {
|
|
10
|
-
const sNavigationPath = ODataModelAnnotationHelper.getNavigationPath(sPath);
|
|
11
|
-
if (sNavigationPath) {
|
|
12
|
-
return "{path:'" + sNavigationPath + "'}";
|
|
13
|
-
} else {
|
|
14
|
-
//no navigation property needs empty object
|
|
15
|
-
return "{path: ''}";
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Function to check if draft pattern is supported.
|
|
21
|
-
*
|
|
22
|
-
* @param {object} oAnnotations Annotations of the current entity set.
|
|
23
|
-
* @returns {string} Returns the Boolean value based on draft state
|
|
24
|
-
*/
|
|
25
|
-
checkDraftState: function (oAnnotations: any) {
|
|
26
|
-
if (
|
|
27
|
-
oAnnotations["@com.sap.vocabularies.Common.v1.DraftRoot"] &&
|
|
28
|
-
oAnnotations["@com.sap.vocabularies.Common.v1.DraftRoot"]["EditAction"]
|
|
29
|
-
) {
|
|
30
|
-
return true;
|
|
31
|
-
} else {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Function to get the visibility for the SwitchToActive button in the object page or subobject page.
|
|
38
|
-
*
|
|
39
|
-
* @param {object} oAnnotations Annotations of the current entity set.
|
|
40
|
-
* @returns {string} Returns expression binding or Boolean value based on the draft state
|
|
41
|
-
*/
|
|
42
|
-
getSwitchToActiveVisibility: function (oAnnotations: any): any {
|
|
43
|
-
if (this.checkDraftState(oAnnotations)) {
|
|
44
|
-
return "{= (%{DraftAdministrativeData/DraftIsCreatedByMe}) ? ( ${ui>/isEditable} && !${ui>createMode} && %{DraftAdministrativeData/DraftIsCreatedByMe} ) : false }";
|
|
45
|
-
} else {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Function to get the visibility for the SwitchToDraft button in the object page or subobject page.
|
|
52
|
-
*
|
|
53
|
-
* @param {object} oAnnotations Annotations of the current entity set.
|
|
54
|
-
* @returns {string} Returns expression binding or Boolean value based on the draft state
|
|
55
|
-
*/
|
|
56
|
-
getSwitchToDraftVisibility: function (oAnnotations: any): any {
|
|
57
|
-
if (this.checkDraftState(oAnnotations)) {
|
|
58
|
-
return "{= (%{DraftAdministrativeData/DraftIsCreatedByMe}) ? ( !(${ui>/isEditable}) && !${ui>createMode} && ${HasDraftEntity} && %{DraftAdministrativeData/DraftIsCreatedByMe} ) : false }";
|
|
59
|
-
} else {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Function to get the visibility for the SwitchDraftAndActive button in the object page or subobject page.
|
|
66
|
-
*
|
|
67
|
-
* @param {object} oAnnotations Annotations of the current entity set.
|
|
68
|
-
* @returns {string} Returns expression binding or Boolean value based on the draft state
|
|
69
|
-
*/
|
|
70
|
-
getSwitchDraftAndActiveVisibility: function (oAnnotations: any): any {
|
|
71
|
-
if (this.checkDraftState(oAnnotations)) {
|
|
72
|
-
return "{= (%{DraftAdministrativeData/DraftIsCreatedByMe}) ? ( !${ui>createMode} && %{DraftAdministrativeData/DraftIsCreatedByMe} ) : false }";
|
|
73
|
-
} else {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Function to find an action from the array of header actions in the converter context.
|
|
80
|
-
*
|
|
81
|
-
* @param {object[]} aConverterContextHeaderActions Array of 'header' actions on the object page.
|
|
82
|
-
* @param {string} sActionType The action type
|
|
83
|
-
* @returns {object | undefined} The action with the matching action type
|
|
84
|
-
* @private
|
|
85
|
-
*/
|
|
86
|
-
_findAction: function (aConverterContextHeaderActions: any[], sActionType: string) {
|
|
87
|
-
let oAction;
|
|
88
|
-
if (aConverterContextHeaderActions && aConverterContextHeaderActions.length) {
|
|
89
|
-
oAction = aConverterContextHeaderActions.find(function (oHeaderAction: any) {
|
|
90
|
-
return oHeaderAction.type === sActionType;
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return oAction;
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Function to format the 'enabled' property for the Delete button on the object page or subobject page in case of a Command Execution.
|
|
98
|
-
*
|
|
99
|
-
* @param {Array} aConverterContextHeaderActions Array of header actions on the object page
|
|
100
|
-
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
101
|
-
*/
|
|
102
|
-
getDeleteCommandExecutionEnabled: function (aConverterContextHeaderActions: any[]) {
|
|
103
|
-
const oDeleteAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Secondary");
|
|
104
|
-
return oDeleteAction ? oDeleteAction.enabled : "true";
|
|
105
|
-
},
|
|
106
|
-
/**
|
|
107
|
-
* Function to format the 'visible' property for the Delete button on the object page or subobject page in case of a Command Execution.
|
|
108
|
-
*
|
|
109
|
-
* @param {Array} aConverterContextHeaderActions Array of header actions on the object page
|
|
110
|
-
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
111
|
-
*/
|
|
112
|
-
getDeleteCommandExecutionVisible: function (aConverterContextHeaderActions: any[]) {
|
|
113
|
-
const oDeleteAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Secondary");
|
|
114
|
-
return oDeleteAction ? oDeleteAction.visible : "true";
|
|
115
|
-
},
|
|
116
|
-
/**
|
|
117
|
-
* Function to format the 'visible' property for the Edit button on the object page or subobject page in case of a Command Execution.
|
|
118
|
-
*
|
|
119
|
-
* @param {Array} aConverterContextHeaderActions Array of header actions on the object page
|
|
120
|
-
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
121
|
-
*/
|
|
122
|
-
getEditCommandExecutionVisible: function (aConverterContextHeaderActions: any[]) {
|
|
123
|
-
const oEditAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Primary");
|
|
124
|
-
return oEditAction ? oEditAction.visible : "true";
|
|
125
|
-
},
|
|
126
|
-
/**
|
|
127
|
-
* Function to format the 'enabled' property for the Edit button on the object page or subobject page in case of a Command Execution.
|
|
128
|
-
*
|
|
129
|
-
* @param {Array} aConverterContextHeaderActions Array of header actions on the object page
|
|
130
|
-
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
131
|
-
*/
|
|
132
|
-
getEditCommandExecutionEnabled: function (aConverterContextHeaderActions: any[]) {
|
|
133
|
-
const oEditAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Primary");
|
|
134
|
-
return oEditAction ? oEditAction.enabled : "true";
|
|
135
|
-
},
|
|
136
|
-
/**
|
|
137
|
-
* Function to get the EditAction from the Entityset based on Draft or sticky based application.
|
|
138
|
-
*
|
|
139
|
-
* @param {object} [oEntitySet] The value from the expression.
|
|
140
|
-
* @returns {string} Returns expression binding or boolean value based on vRawValue & oDraftNode
|
|
141
|
-
*/
|
|
142
|
-
getEditAction: function (oEntitySet: Context) {
|
|
143
|
-
const sPath = oEntitySet.getPath(),
|
|
144
|
-
oAnnotations = oEntitySet.getObject(sPath + "@");
|
|
145
|
-
const bDraftRoot = oAnnotations.hasOwnProperty("@com.sap.vocabularies.Common.v1.DraftRoot");
|
|
146
|
-
const bStickySession = oAnnotations.hasOwnProperty("@com.sap.vocabularies.Session.v1.StickySessionSupported");
|
|
147
|
-
let sActionName;
|
|
148
|
-
if (bDraftRoot) {
|
|
149
|
-
sActionName = oEntitySet.getObject(sPath + "@com.sap.vocabularies.Common.v1.DraftRoot/EditAction");
|
|
150
|
-
} else if (bStickySession) {
|
|
151
|
-
sActionName = oEntitySet.getObject(sPath + "@com.sap.vocabularies.Session.v1.StickySessionSupported/EditAction");
|
|
152
|
-
}
|
|
153
|
-
return !sActionName ? sActionName : sPath + "/" + sActionName;
|
|
154
|
-
},
|
|
155
|
-
isReadOnlyFromStaticAnnotations: function (oAnnotations: any, oFieldControl: any) {
|
|
156
|
-
let bComputed, bImmutable, bReadOnly;
|
|
157
|
-
if (oAnnotations["@Org.OData.Core.V1.Computed"]) {
|
|
158
|
-
bComputed = oAnnotations["@Org.OData.Core.V1.Computed"].Bool
|
|
159
|
-
? oAnnotations["@Org.OData.Core.V1.Computed"].Bool == "true"
|
|
160
|
-
: true;
|
|
161
|
-
}
|
|
162
|
-
if (oAnnotations["@Org.OData.Core.V1.Immutable"]) {
|
|
163
|
-
bImmutable = oAnnotations["@Org.OData.Core.V1.Immutable"].Bool
|
|
164
|
-
? oAnnotations["@Org.OData.Core.V1.Immutable"].Bool == "true"
|
|
165
|
-
: true;
|
|
166
|
-
}
|
|
167
|
-
bReadOnly = bComputed || bImmutable;
|
|
168
|
-
|
|
169
|
-
if (oFieldControl) {
|
|
170
|
-
bReadOnly = bReadOnly || oFieldControl == "com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly";
|
|
171
|
-
}
|
|
172
|
-
if (bReadOnly) {
|
|
173
|
-
return true;
|
|
174
|
-
} else {
|
|
175
|
-
return false;
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
readOnlyExpressionFromDynamicAnnotations: function (oFieldControl: any) {
|
|
179
|
-
let sIsFieldControlPathReadOnly;
|
|
180
|
-
if (oFieldControl) {
|
|
181
|
-
if ((ManagedObject as any).bindingParser(oFieldControl)) {
|
|
182
|
-
sIsFieldControlPathReadOnly = "%" + oFieldControl + " === 1 ";
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
if (sIsFieldControlPathReadOnly) {
|
|
186
|
-
return "{= " + sIsFieldControlPathReadOnly + "? false : true }";
|
|
187
|
-
} else {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
},
|
|
191
|
-
/*
|
|
192
|
-
* Function to get the expression for chart Title Press
|
|
193
|
-
*
|
|
194
|
-
* @function
|
|
195
|
-
* @param {oConfiguration} [oConfigurations] control configuration from manifest
|
|
196
|
-
* @param {oManifest} [oManifest] Outbounds from manifest
|
|
197
|
-
* returns {String} [sCollectionName] Collection Name of the Micro Chart
|
|
198
|
-
*
|
|
199
|
-
* returns {String} [Expression] Handler Expression for the title press
|
|
200
|
-
*
|
|
201
|
-
*/
|
|
202
|
-
getExpressionForMicroChartTitlePress: function (oConfiguration: any, oManifestOutbound: any, sCollectionName: any) {
|
|
203
|
-
if (oConfiguration) {
|
|
204
|
-
if (
|
|
205
|
-
(oConfiguration["targetOutbound"] && oConfiguration["targetOutbound"]["outbound"]) ||
|
|
206
|
-
(oConfiguration["targetOutbound"] && oConfiguration["targetOutbound"]["outbound"] && oConfiguration["targetSections"])
|
|
207
|
-
) {
|
|
208
|
-
return (
|
|
209
|
-
".handlers.onDataPointTitlePressed($controller, ${$source>/},'" +
|
|
210
|
-
JSON.stringify(oManifestOutbound) +
|
|
211
|
-
"','" +
|
|
212
|
-
oConfiguration["targetOutbound"]["outbound"] +
|
|
213
|
-
"','" +
|
|
214
|
-
sCollectionName +
|
|
215
|
-
"' )"
|
|
216
|
-
);
|
|
217
|
-
} else if (oConfiguration["targetSections"]) {
|
|
218
|
-
return ".handlers.navigateToSubSection($controller, '" + JSON.stringify(oConfiguration["targetSections"]) + "')";
|
|
219
|
-
} else {
|
|
220
|
-
return undefined;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
/*
|
|
225
|
-
* Function to render Chart Title as Link
|
|
226
|
-
*
|
|
227
|
-
* @function
|
|
228
|
-
* @param {oControlConfiguration} [oConfigurations] control configuration from manifest
|
|
229
|
-
* returns {String} [sKey] For the TargetOutbound and TargetSection
|
|
230
|
-
*
|
|
231
|
-
*/
|
|
232
|
-
getMicroChartTitleAsLink: function (oControlConfiguration: any) {
|
|
233
|
-
if (
|
|
234
|
-
oControlConfiguration &&
|
|
235
|
-
(oControlConfiguration["targetOutbound"] ||
|
|
236
|
-
(oControlConfiguration["targetOutbound"] && oControlConfiguration["targetSections"]))
|
|
237
|
-
) {
|
|
238
|
-
return "External";
|
|
239
|
-
} else if (oControlConfiguration && oControlConfiguration["targetSections"]) {
|
|
240
|
-
return "InPage";
|
|
241
|
-
} else {
|
|
242
|
-
return "None";
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
|
|
246
|
-
/* Get groupId from control configuration
|
|
247
|
-
*
|
|
248
|
-
* @function
|
|
249
|
-
* @param {Object} [oConfigurations] control configuration from manifest
|
|
250
|
-
* @param {String} [sAnnotationPath] Annotation Path for the configuration
|
|
251
|
-
* @description Used to get the groupId for DataPoints and MicroCharts in the Header.
|
|
252
|
-
*
|
|
253
|
-
*/
|
|
254
|
-
getGroupIdFromConfig: function (oConfigurations: any, sAnnotationPath: any, sDefaultGroupId?: any) {
|
|
255
|
-
const oConfiguration = oConfigurations[sAnnotationPath],
|
|
256
|
-
aAutoPatterns = ["Heroes", "Decoration", "Workers", "LongRunners"];
|
|
257
|
-
let sGroupId = sDefaultGroupId;
|
|
258
|
-
if (
|
|
259
|
-
oConfiguration &&
|
|
260
|
-
oConfiguration.requestGroupId &&
|
|
261
|
-
aAutoPatterns.some(function (autoPattern: string) {
|
|
262
|
-
return autoPattern === oConfiguration.requestGroupId;
|
|
263
|
-
})
|
|
264
|
-
) {
|
|
265
|
-
sGroupId = "$auto." + oConfiguration.requestGroupId;
|
|
266
|
-
}
|
|
267
|
-
return sGroupId;
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
/*
|
|
271
|
-
* Get Context Binding with groupId from control configuration
|
|
272
|
-
*
|
|
273
|
-
* @function
|
|
274
|
-
* @param {Object} [oConfigurations] control configuration from manifest
|
|
275
|
-
* @param {String} [sKey] Annotation Path for of the configuration
|
|
276
|
-
* @description Used to get the binding for DataPoints in the Header.
|
|
277
|
-
*
|
|
278
|
-
*/
|
|
279
|
-
getBindingWithGroupIdFromConfig: function (oConfigurations: any, sKey: any) {
|
|
280
|
-
const sGroupId = AnnotationHelper.getGroupIdFromConfig(oConfigurations, sKey);
|
|
281
|
-
let sBinding;
|
|
282
|
-
if (sGroupId) {
|
|
283
|
-
sBinding = "{ path : '', parameters : { $$groupId : '" + sGroupId + "' } }";
|
|
284
|
-
}
|
|
285
|
-
return sBinding;
|
|
286
|
-
},
|
|
287
|
-
/**
|
|
288
|
-
* Method to check whether a FieldGroup consists of only 1 DataField with MultiLine Text annotation.
|
|
289
|
-
*
|
|
290
|
-
* @param {DataFieldAbstractTypes[]} aFormElements A collection of form elements used in the current field group
|
|
291
|
-
* @returns {boolean} Returns true if only 1 data field with Multiline Text annotation exists.
|
|
292
|
-
*/
|
|
293
|
-
doesFieldGroupContainOnlyOneMultiLineDataField: function (aFormElements: any[]) {
|
|
294
|
-
return aFormElements && aFormElements.length === 1 && !!aFormElements[0].isValueMultilineText;
|
|
295
|
-
},
|
|
296
|
-
/*
|
|
297
|
-
* Get Visiblity of breadcrumbs.
|
|
298
|
-
*
|
|
299
|
-
* @function
|
|
300
|
-
* @param {Object} [oViewData] ViewData model
|
|
301
|
-
* returns {*} Expression or boolean
|
|
302
|
-
*/
|
|
303
|
-
getVisibleExpressionForBreadcrumbs: function (oViewData: any) {
|
|
304
|
-
return oViewData.showBreadCrumbs && oViewData.fclEnabled !== undefined
|
|
305
|
-
? "{fclhelper>/breadCrumbIsVisible}"
|
|
306
|
-
: oViewData.showBreadCrumbs;
|
|
307
|
-
},
|
|
308
|
-
getShareButtonVisibility: function (viewData: any) {
|
|
309
|
-
let sShareButtonVisibilityExp = "!${ui>createMode}";
|
|
310
|
-
if (viewData.fclEnabled) {
|
|
311
|
-
sShareButtonVisibilityExp = "${fclhelper>/showShareIcon} && " + sShareButtonVisibilityExp;
|
|
312
|
-
}
|
|
313
|
-
return "{= " + sShareButtonVisibilityExp + " }";
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
/*
|
|
317
|
-
* Get visiblity for editable header facet.
|
|
318
|
-
*
|
|
319
|
-
* If either the title or description field from the header annotations are editable, then the
|
|
320
|
-
* editable header facet is visible.
|
|
321
|
-
*
|
|
322
|
-
* @function
|
|
323
|
-
* @param {object} [oAnnotations] Annotations object for given entity set
|
|
324
|
-
* @param {object} [oFieldControl] field control
|
|
325
|
-
* returns {*} binding expression or boolean value resolved form funcitons isReadOnlyFromStaticAnnotations and isReadOnlyFromDynamicAnnotations
|
|
326
|
-
*/
|
|
327
|
-
getVisiblityOfHeaderFacet: function (
|
|
328
|
-
oTitleAnnotations: any,
|
|
329
|
-
oDescriptionAnnotations: any,
|
|
330
|
-
oFieldTitleFieldControl: any,
|
|
331
|
-
oFieldDescriptionFieldControl: any
|
|
332
|
-
) {
|
|
333
|
-
// Check Annotations for Title Field
|
|
334
|
-
const bIsTitleReadOnly = AnnotationHelper.isReadOnlyFromStaticAnnotations(oTitleAnnotations, oFieldTitleFieldControl);
|
|
335
|
-
const titleExpression = AnnotationHelper.readOnlyExpressionFromDynamicAnnotations(oFieldTitleFieldControl);
|
|
336
|
-
// There is no expression and the title is not ready only, this is sufficient for an editable header
|
|
337
|
-
if (!bIsTitleReadOnly && !titleExpression) {
|
|
338
|
-
return true;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
// Check Annotations for Description Field
|
|
342
|
-
const bIsDescriptionReadOnly = AnnotationHelper.isReadOnlyFromStaticAnnotations(
|
|
343
|
-
oDescriptionAnnotations,
|
|
344
|
-
oFieldDescriptionFieldControl
|
|
345
|
-
);
|
|
346
|
-
const descriptionExpression = AnnotationHelper.readOnlyExpressionFromDynamicAnnotations(oFieldDescriptionFieldControl);
|
|
347
|
-
// There is no expression and the description is not ready only, this is sufficient for an editable header
|
|
348
|
-
if (!bIsDescriptionReadOnly && !descriptionExpression) {
|
|
349
|
-
return true;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
// Both title and description are not editable and there are no dynamic annotations
|
|
353
|
-
if (bIsTitleReadOnly && bIsDescriptionReadOnly && !titleExpression && !descriptionExpression) {
|
|
354
|
-
return false;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
// Now combine expressions
|
|
358
|
-
if (titleExpression && !descriptionExpression) {
|
|
359
|
-
return titleExpression;
|
|
360
|
-
} else if (!titleExpression && descriptionExpression) {
|
|
361
|
-
return descriptionExpression;
|
|
362
|
-
} else {
|
|
363
|
-
return AnnotationHelper.combineTitleAndDescriptionExpression(oFieldTitleFieldControl, oFieldDescriptionFieldControl);
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
combineTitleAndDescriptionExpression: function (oTitleFieldControl: any, oDescriptionFieldControl: any) {
|
|
367
|
-
// If both header and title field are based on dynmaic field control, the editable header
|
|
368
|
-
// is visible if at least one of these is not ready only
|
|
369
|
-
return "{= %" + oTitleFieldControl + " === 1 ? ( %" + oDescriptionFieldControl + " === 1 ? false : true ) : true }";
|
|
370
|
-
},
|
|
371
|
-
/*
|
|
372
|
-
* Get Expression of press event of delete button.
|
|
373
|
-
*
|
|
374
|
-
* @function
|
|
375
|
-
* @param {string} [sEntitySetName] Entity set name
|
|
376
|
-
* returns {string} binding expression / function string generated from commanhelper's function generateFunction
|
|
377
|
-
*/
|
|
378
|
-
getPressExpressionForDelete: function (sEntitySetName: any) {
|
|
379
|
-
const sDeletableContexts = "${$view>/getBindingContext}",
|
|
380
|
-
sTitle = "${$view>/#fe::ObjectPage/getHeaderTitle/getExpandedHeading/getItems/1/getText}",
|
|
381
|
-
sDescription = "${$view>/#fe::ObjectPage/getHeaderTitle/getExpandedContent/0/getItems/0/getText}";
|
|
382
|
-
const oParams = {
|
|
383
|
-
title: sTitle,
|
|
384
|
-
entitySetName: CommonHelper.addSingleQuotes(sEntitySetName),
|
|
385
|
-
description: sDescription
|
|
386
|
-
};
|
|
387
|
-
return CommonHelper.generateFunction(".editFlow.deleteDocument", sDeletableContexts, CommonHelper.objectToString(oParams));
|
|
388
|
-
},
|
|
389
|
-
/*
|
|
390
|
-
* Get Expression of press event of Edit button.
|
|
391
|
-
*
|
|
392
|
-
* @function
|
|
393
|
-
* @param {object} [oDataField] Data field object
|
|
394
|
-
* @param {string} [sEntitySetName] Entity set name
|
|
395
|
-
* @param {object} [oHeaderAction] Header action object
|
|
396
|
-
* returns {string} binding expression / function string generated from commanhelper's function generateFunction
|
|
397
|
-
*/
|
|
398
|
-
getPressExpressionForEdit: function (oDataField: any, sEntitySetName: any, oHeaderAction: any) {
|
|
399
|
-
const sEditableContexts = CommonHelper.addSingleQuotes(oDataField && oDataField.Action),
|
|
400
|
-
sDataFieldEnumMember = oDataField && oDataField.InvocationGrouping && oDataField.InvocationGrouping["$EnumMember"],
|
|
401
|
-
sInvocationGroup =
|
|
402
|
-
sDataFieldEnumMember === "com.sap.vocabularies.UI.v1.OperationGroupingType/ChangeSet" ? "ChangeSet" : "Isolated";
|
|
403
|
-
const oParams = {
|
|
404
|
-
contexts: "${$view>/getBindingContext}",
|
|
405
|
-
entitySetName: CommonHelper.addSingleQuotes(sEntitySetName),
|
|
406
|
-
invocationGrouping: CommonHelper.addSingleQuotes(sInvocationGroup),
|
|
407
|
-
model: "${$source>/}.getModel()",
|
|
408
|
-
label: CommonHelper.addSingleQuotes(oDataField && oDataField.Label, true),
|
|
409
|
-
isNavigable: oHeaderAction && oHeaderAction.isNavigable,
|
|
410
|
-
defaultValuesExtensionFunction:
|
|
411
|
-
oHeaderAction && oHeaderAction.defaultValuesExtensionFunction
|
|
412
|
-
? "'" + oHeaderAction.defaultValuesExtensionFunction + "'"
|
|
413
|
-
: undefined
|
|
414
|
-
};
|
|
415
|
-
return CommonHelper.generateFunction(
|
|
416
|
-
".handlers.onCallAction",
|
|
417
|
-
"${$view>/}",
|
|
418
|
-
sEditableContexts,
|
|
419
|
-
CommonHelper.objectToString(oParams)
|
|
420
|
-
);
|
|
421
|
-
},
|
|
422
|
-
/*
|
|
423
|
-
* Method to get the expression for the 'press' event for footer annotation actions
|
|
424
|
-
*
|
|
425
|
-
* @function
|
|
426
|
-
* @param {object} [oDataField] Data field object
|
|
427
|
-
* @param {string} [sEntitySetName] Entity set name
|
|
428
|
-
* @param {object} [oHeaderAction] Header action object
|
|
429
|
-
* returns {string} Binding expression or function string that is generated from the Commonhelper's function generateFunction
|
|
430
|
-
*/
|
|
431
|
-
getPressExpressionForFooterAnnotationAction: function (oDataField: any, sEntitySetName: any, oHeaderAction: any) {
|
|
432
|
-
const sActionContexts = CommonHelper.addSingleQuotes(oDataField && oDataField.Action),
|
|
433
|
-
sDataFieldEnumMember = oDataField && oDataField.InvocationGrouping && oDataField.InvocationGrouping["$EnumMember"],
|
|
434
|
-
sInvocationGroup =
|
|
435
|
-
sDataFieldEnumMember === "com.sap.vocabularies.UI.v1.OperationGroupingType/ChangeSet" ? "ChangeSet" : "Isolated";
|
|
436
|
-
const oParams = {
|
|
437
|
-
contexts: "${$view>/#fe::ObjectPage/}.getBindingContext()",
|
|
438
|
-
entitySetName: CommonHelper.addSingleQuotes(sEntitySetName),
|
|
439
|
-
invocationGrouping: CommonHelper.addSingleQuotes(sInvocationGroup),
|
|
440
|
-
model: "${$source>/}.getModel()",
|
|
441
|
-
label: CommonHelper.addSingleQuotes(oDataField && oDataField.Label, true),
|
|
442
|
-
isNavigable: oHeaderAction && oHeaderAction.isNavigable,
|
|
443
|
-
defaultValuesExtensionFunction:
|
|
444
|
-
oHeaderAction && oHeaderAction.defaultValuesExtensionFunction
|
|
445
|
-
? "'" + oHeaderAction.defaultValuesExtensionFunction + "'"
|
|
446
|
-
: undefined
|
|
447
|
-
};
|
|
448
|
-
return CommonHelper.generateFunction(".handlers.onCallAction", "${$view>/}", sActionContexts, CommonHelper.objectToString(oParams));
|
|
449
|
-
},
|
|
450
|
-
/*
|
|
451
|
-
* Gets the binding of the container HBox for the header facet.
|
|
452
|
-
*
|
|
453
|
-
* @function
|
|
454
|
-
* @param {object} [oControlConfiguration] The control configuration form of the viewData model
|
|
455
|
-
* @param {object} [oHeaderFacet] The object of the header facet
|
|
456
|
-
* returns {*} The binding expression from function getBindingWithGroupIdFromConfig or undefined.
|
|
457
|
-
*/
|
|
458
|
-
getStashableHBoxBinding: function (oControlConfiguration: any, oHeaderFacet: any) {
|
|
459
|
-
if (oHeaderFacet && oHeaderFacet.Facet && oHeaderFacet.Facet.targetAnnotationType === "DataPoint") {
|
|
460
|
-
return AnnotationHelper.getBindingWithGroupIdFromConfig(oControlConfiguration, oHeaderFacet.Facet.targetAnnotationValue);
|
|
461
|
-
}
|
|
462
|
-
},
|
|
463
|
-
|
|
464
|
-
/*
|
|
465
|
-
* Gets the 'Press' event expression for the external and internal data point link.
|
|
466
|
-
*
|
|
467
|
-
* @function
|
|
468
|
-
* @param {object} [oConfiguration] Control configuration from manifest
|
|
469
|
-
* @param {object} [oManifestOutbound] Outbounds from manifest
|
|
470
|
-
* returns {string} The runtime binding of the 'Press' event
|
|
471
|
-
*/
|
|
472
|
-
getPressExpressionForLink: function (oConfiguration: any, oManifestOutbound: any) {
|
|
473
|
-
if (oConfiguration) {
|
|
474
|
-
if (oConfiguration["targetOutbound"] && oConfiguration["targetOutbound"]["outbound"]) {
|
|
475
|
-
return (
|
|
476
|
-
".handlers.onDataPointTitlePressed($controller, ${$source>}, " +
|
|
477
|
-
JSON.stringify(oManifestOutbound) +
|
|
478
|
-
"," +
|
|
479
|
-
JSON.stringify(oConfiguration["targetOutbound"]["outbound"]) +
|
|
480
|
-
")"
|
|
481
|
-
);
|
|
482
|
-
} else if (oConfiguration["targetSections"]) {
|
|
483
|
-
return ".handlers.navigateToSubSection($controller, '" + JSON.stringify(oConfiguration["targetSections"]) + "')";
|
|
484
|
-
} else {
|
|
485
|
-
return undefined;
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
},
|
|
489
|
-
isSubSectionTitleVisible: function (sSubSectionvisible: any, sSubSectiontitle: any, sSubSectionshowTitle: any) {
|
|
490
|
-
if (sSubSectionvisible.indexOf("{=") === 0) {
|
|
491
|
-
// Dynamic expression
|
|
492
|
-
const sExpressionResult = sSubSectionvisible.substring(
|
|
493
|
-
sSubSectionvisible.indexOf("{=") + 2,
|
|
494
|
-
sSubSectionvisible.lastIndexOf("}")
|
|
495
|
-
);
|
|
496
|
-
return (
|
|
497
|
-
"{= (" +
|
|
498
|
-
sExpressionResult +
|
|
499
|
-
") && ('" +
|
|
500
|
-
sSubSectiontitle +
|
|
501
|
-
"' !=='undefined') && (" +
|
|
502
|
-
sSubSectionshowTitle +
|
|
503
|
-
" ? true : false) }"
|
|
504
|
-
);
|
|
505
|
-
} else {
|
|
506
|
-
return sSubSectionvisible && sSubSectiontitle !== "undefined" && (sSubSectionshowTitle ? "true" : "false");
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
};
|
|
510
|
-
|
|
511
|
-
export default AnnotationHelper;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
-
* (c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
-
*/
|
|
5
|
-
sap.ui.define(["sap/fe/core/helpers/BindingExpression", "sap/fe/core/converters/helpers/BindingHelper", "sap/fe/core/CommonUtils", "sap/fe/macros/field/FieldTemplating", "sap/fe/core/templating/EntitySetHelper"], function (BindingExpression, BindingHelper, CommonUtils, FieldTemplating, EntitySetHelper) {
|
|
6
|
-
"use strict";
|
|
7
|
-
|
|
8
|
-
var _exports = {};
|
|
9
|
-
var isStickySessionSupported = EntitySetHelper.isStickySessionSupported;
|
|
10
|
-
var formatValueRecursively = FieldTemplating.formatValueRecursively;
|
|
11
|
-
var addTextArrangementToBindingExpression = FieldTemplating.addTextArrangementToBindingExpression;
|
|
12
|
-
var Entity = BindingHelper.Entity;
|
|
13
|
-
var Draft = BindingHelper.Draft;
|
|
14
|
-
var UI = BindingHelper.UI;
|
|
15
|
-
var compileBinding = BindingExpression.compileBinding;
|
|
16
|
-
var annotationExpression = BindingExpression.annotationExpression;
|
|
17
|
-
var concat = BindingExpression.concat;
|
|
18
|
-
var isEmpty = BindingExpression.isEmpty;
|
|
19
|
-
var ifElse = BindingExpression.ifElse;
|
|
20
|
-
var and = BindingExpression.and;
|
|
21
|
-
|
|
22
|
-
//```mermaid
|
|
23
|
-
// graph TD
|
|
24
|
-
// A[Object Page Title] -->|Get DataField Value| C{Evaluate Create Mode}
|
|
25
|
-
// C -->|In Create Mode| D{Is DataField Value empty}
|
|
26
|
-
// D -->|Yes| F{Is there a TypeName}
|
|
27
|
-
// F -->|Yes| G[Is there an custom title]
|
|
28
|
-
// G -->|Yes| G1[Show the custom title + 'TypeName']
|
|
29
|
-
// G -->|No| G2[Display the default title 'New + TypeName']
|
|
30
|
-
// F -->|No| H[Is there a custom title]
|
|
31
|
-
// H -->|Yes| I[Show the custom title]
|
|
32
|
-
// H -->|No| J[Show the default 'Unamned Object']
|
|
33
|
-
// D -->|No| E
|
|
34
|
-
// C -->|Not in create mode| E[Show DataField Value]
|
|
35
|
-
// ```
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Compute the title for the object page.
|
|
39
|
-
* @param oHeaderInfo The @UI.HeaderInfo annotation content
|
|
40
|
-
* @param oViewData The view data object we're currently on
|
|
41
|
-
* @param fullContextPath The full context path used to reach that object page
|
|
42
|
-
* @param oDraftRoot
|
|
43
|
-
* @returns The binding expression for the object page title
|
|
44
|
-
*/
|
|
45
|
-
var getExpressionForTitle = function (oHeaderInfo, oViewData, fullContextPath, oDraftRoot) {
|
|
46
|
-
var _oHeaderInfo$Title, _oHeaderInfo$Title2, _oHeaderInfo$Title3, _oHeaderInfo$Title3$V, _oHeaderInfo$Title3$V2, _oHeaderInfo$Title3$V3, _oHeaderInfo$Title3$V4, _oHeaderInfo$Title3$V5, _oHeaderInfo$Title3$V6, _oHeaderInfo$Title3$V7;
|
|
47
|
-
|
|
48
|
-
var titleNoHeaderInfo = CommonUtils.getTranslatedText("T_NEW_OBJECT", oViewData.resourceBundle, undefined, oViewData.entitySet);
|
|
49
|
-
var titleWithHeaderInfo = CommonUtils.getTranslatedText("T_ANNOTATION_HELPER_DEFAULT_OBJECT_PAGE_HEADER_TITLE", oViewData.resourceBundle, undefined, oViewData.entitySet);
|
|
50
|
-
var oEmptyHeaderInfoTitle = (oHeaderInfo === null || oHeaderInfo === void 0 ? void 0 : oHeaderInfo.Title) === undefined || (oHeaderInfo === null || oHeaderInfo === void 0 ? void 0 : oHeaderInfo.Title) === "" || (oHeaderInfo === null || oHeaderInfo === void 0 ? void 0 : (_oHeaderInfo$Title = oHeaderInfo.Title) === null || _oHeaderInfo$Title === void 0 ? void 0 : _oHeaderInfo$Title.Value) === "";
|
|
51
|
-
var titleForActiveHeaderNoHeaderInfo = !oEmptyHeaderInfoTitle ? CommonUtils.getTranslatedText("T_ANNOTATION_HELPER_DEFAULT_OBJECT_PAGE_HEADER_TITLE_NO_HEADER_INFO", oViewData.resourceBundle) : "";
|
|
52
|
-
var titleValueExpression = annotationExpression(oHeaderInfo === null || oHeaderInfo === void 0 ? void 0 : (_oHeaderInfo$Title2 = oHeaderInfo.Title) === null || _oHeaderInfo$Title2 === void 0 ? void 0 : _oHeaderInfo$Title2.Value);
|
|
53
|
-
|
|
54
|
-
if (oHeaderInfo !== null && oHeaderInfo !== void 0 && (_oHeaderInfo$Title3 = oHeaderInfo.Title) !== null && _oHeaderInfo$Title3 !== void 0 && (_oHeaderInfo$Title3$V = _oHeaderInfo$Title3.Value) !== null && _oHeaderInfo$Title3$V !== void 0 && (_oHeaderInfo$Title3$V2 = _oHeaderInfo$Title3$V.$target) !== null && _oHeaderInfo$Title3$V2 !== void 0 && (_oHeaderInfo$Title3$V3 = _oHeaderInfo$Title3$V2.annotations) !== null && _oHeaderInfo$Title3$V3 !== void 0 && (_oHeaderInfo$Title3$V4 = _oHeaderInfo$Title3$V3.Common) !== null && _oHeaderInfo$Title3$V4 !== void 0 && (_oHeaderInfo$Title3$V5 = _oHeaderInfo$Title3$V4.Text) !== null && _oHeaderInfo$Title3$V5 !== void 0 && (_oHeaderInfo$Title3$V6 = _oHeaderInfo$Title3$V5.annotations) !== null && _oHeaderInfo$Title3$V6 !== void 0 && (_oHeaderInfo$Title3$V7 = _oHeaderInfo$Title3$V6.UI) !== null && _oHeaderInfo$Title3$V7 !== void 0 && _oHeaderInfo$Title3$V7.TextArrangement) {
|
|
55
|
-
// In case an explicit text arrangement was set we make use of it in the description as well
|
|
56
|
-
titleValueExpression = addTextArrangementToBindingExpression(titleValueExpression, fullContextPath);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
titleValueExpression = formatValueRecursively(titleValueExpression, fullContextPath); // If there is a TypeName defined, show the default title 'New + TypeName', otherwise show the custom title or the default 'New object'
|
|
60
|
-
|
|
61
|
-
var createModeTitle = oHeaderInfo !== null && oHeaderInfo !== void 0 && oHeaderInfo.TypeName ? concat(titleWithHeaderInfo, ": ", annotationExpression(oHeaderInfo.TypeName.toString())) : titleNoHeaderInfo;
|
|
62
|
-
var activeExpression = oDraftRoot ? Entity.IsActive : true;
|
|
63
|
-
return compileBinding(ifElse( // If Create Mode && Empty expression
|
|
64
|
-
and(UI.IsCreateMode, titleValueExpression && isEmpty(titleValueExpression)), createModeTitle, // Otherwise show the default expression
|
|
65
|
-
ifElse(and(activeExpression, titleValueExpression && isEmpty(titleValueExpression)), titleForActiveHeaderNoHeaderInfo, titleValueExpression)));
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* Retrieves the expression for the description of an object page.
|
|
69
|
-
*
|
|
70
|
-
* @param oHeaderInfo The @UI.HeaderInfo annotation content
|
|
71
|
-
* @param fullContextPath The full context path used to reach that object page
|
|
72
|
-
* @returns The binding expression for the object page description
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
_exports.getExpressionForTitle = getExpressionForTitle;
|
|
77
|
-
|
|
78
|
-
var getExpressionForDescription = function (oHeaderInfo, fullContextPath) {
|
|
79
|
-
var _oHeaderInfo$Descript, _oHeaderInfo$Descript2, _oHeaderInfo$Descript3, _oHeaderInfo$Descript4, _oHeaderInfo$Descript5, _oHeaderInfo$Descript6, _oHeaderInfo$Descript7, _oHeaderInfo$Descript8, _oHeaderInfo$Descript9;
|
|
80
|
-
|
|
81
|
-
var bindingExpression = annotationExpression(oHeaderInfo === null || oHeaderInfo === void 0 ? void 0 : (_oHeaderInfo$Descript = oHeaderInfo.Description) === null || _oHeaderInfo$Descript === void 0 ? void 0 : _oHeaderInfo$Descript.Value);
|
|
82
|
-
|
|
83
|
-
if (oHeaderInfo !== null && oHeaderInfo !== void 0 && (_oHeaderInfo$Descript2 = oHeaderInfo.Description) !== null && _oHeaderInfo$Descript2 !== void 0 && (_oHeaderInfo$Descript3 = _oHeaderInfo$Descript2.Value) !== null && _oHeaderInfo$Descript3 !== void 0 && (_oHeaderInfo$Descript4 = _oHeaderInfo$Descript3.$target) !== null && _oHeaderInfo$Descript4 !== void 0 && (_oHeaderInfo$Descript5 = _oHeaderInfo$Descript4.annotations) !== null && _oHeaderInfo$Descript5 !== void 0 && (_oHeaderInfo$Descript6 = _oHeaderInfo$Descript5.Common) !== null && _oHeaderInfo$Descript6 !== void 0 && (_oHeaderInfo$Descript7 = _oHeaderInfo$Descript6.Text) !== null && _oHeaderInfo$Descript7 !== void 0 && (_oHeaderInfo$Descript8 = _oHeaderInfo$Descript7.annotations) !== null && _oHeaderInfo$Descript8 !== void 0 && (_oHeaderInfo$Descript9 = _oHeaderInfo$Descript8.UI) !== null && _oHeaderInfo$Descript9 !== void 0 && _oHeaderInfo$Descript9.TextArrangement) {
|
|
84
|
-
// In case an explicit text arrangement was set we make use of it in the description as well
|
|
85
|
-
bindingExpression = addTextArrangementToBindingExpression(bindingExpression, fullContextPath);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return compileBinding(formatValueRecursively(bindingExpression, fullContextPath));
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Return the expression for the save button.
|
|
92
|
-
*
|
|
93
|
-
* @param oViewData The current view data
|
|
94
|
-
* @param fullContextPath The path used up until here
|
|
95
|
-
* @returns The binding expression that shows the right save button text
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
_exports.getExpressionForDescription = getExpressionForDescription;
|
|
100
|
-
|
|
101
|
-
var getExpressionForSaveButton = function (oViewData, fullContextPath) {
|
|
102
|
-
var saveButtonText = CommonUtils.getTranslatedText("T_OP_OBJECT_PAGE_SAVE", oViewData.resourceBundle);
|
|
103
|
-
var createButtonText = CommonUtils.getTranslatedText("T_OP_OBJECT_PAGE_CREATE", oViewData.resourceBundle);
|
|
104
|
-
var saveExpression;
|
|
105
|
-
|
|
106
|
-
if (isStickySessionSupported(fullContextPath.startingEntitySet)) {
|
|
107
|
-
// If we're in sticky mode AND the ui is in create mode, show Create, else show Save
|
|
108
|
-
saveExpression = ifElse(UI.IsCreateModeSticky, createButtonText, saveButtonText);
|
|
109
|
-
} else {
|
|
110
|
-
// If we're in draft AND the draft is a new object (!IsActiveEntity && !HasActiveEntity), show create, else show save
|
|
111
|
-
saveExpression = ifElse(Draft.IsNewObject, createButtonText, saveButtonText);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return compileBinding(saveExpression);
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
_exports.getExpressionForSaveButton = getExpressionForSaveButton;
|
|
118
|
-
return _exports;
|
|
119
|
-
}, false);
|
|
120
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk9iamVjdFBhZ2VUZW1wbGF0aW5nLnRzIl0sIm5hbWVzIjpbImdldEV4cHJlc3Npb25Gb3JUaXRsZSIsIm9IZWFkZXJJbmZvIiwib1ZpZXdEYXRhIiwiZnVsbENvbnRleHRQYXRoIiwib0RyYWZ0Um9vdCIsInRpdGxlTm9IZWFkZXJJbmZvIiwiQ29tbW9uVXRpbHMiLC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