@sapui5/sap.fe.templates 1.92.0 → 1.93.3

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.
Files changed (24) hide show
  1. package/package.json +2 -3
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/ListReport/Component.js +7 -0
  4. package/src/sap/fe/templates/ListReport/ListReport.view.xml +71 -25
  5. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +50 -23
  6. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +6 -2
  7. package/src/sap/fe/templates/ListReport/overrides/Share.js +47 -37
  8. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +74 -160
  9. package/src/sap/fe/templates/ObjectPage/Component.js +0 -4
  10. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +6 -4
  11. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +34 -49
  12. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +95 -66
  13. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +3 -0
  14. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +21 -6
  15. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +21 -17
  16. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +4 -4
  17. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +55 -49
  18. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
  19. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +2 -2
  20. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +0 -1
  21. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacetCustomContainer.fragment.xml +14 -26
  22. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +2 -2
  23. package/src/sap/fe/templates/library.js +1 -1
  24. package/src/sap/fe/templates/messagebundle.properties +3 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.fe.templates",
3
- "version": "1.92.0",
3
+ "version": "1.93.3",
4
4
  "description": "SAPUI5 Library sap.fe.templates",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -16,7 +16,6 @@
16
16
  ],
17
17
  "devDependencies": {
18
18
  "@babel/cli": "7.8.4",
19
- "@ui5/cli": "^2.10.0",
20
- "yarn": "1.22.10"
19
+ "@ui5/cli": "^2.10.0"
21
20
  }
22
21
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>SAP UI development toolkit for HTML5 (SAPUI5)
7
7
  (c) Copyright 2009-2021 SAP SE. All rights reserved
8
8
  </copyright>
9
- <version>1.92.0</version>
9
+ <version>1.93.3</version>
10
10
 
11
11
  <documentation>UI5 library: sap.fe.templates</documentation>
12
12
 
@@ -22,6 +22,13 @@ sap.ui.define(
22
22
  */
23
23
  views: {
24
24
  type: "object"
25
+ },
26
+
27
+ /**
28
+ * KPIs to display
29
+ */
30
+ keyPerformanceIndicators: {
31
+ type: "object"
25
32
  }
26
33
  },
27
34
  library: "sap.fe.templates",
@@ -6,6 +6,7 @@
6
6
  xmlns:macro="sap.fe.macros"
7
7
  xmlns:control="sap.fe.core.controls"
8
8
  xmlns:core="sap.ui.core"
9
+ xmlns:l="sap.ui.layout"
9
10
  xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
10
11
  xmlns:unittest="http://schemas.sap.com/sapui5/preprocessorextension/sap.fe.unittesting/1"
11
12
  xmlns:customData="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"
@@ -32,6 +33,7 @@
32
33
  customData:isMultiEntitySets="{converterContext>isMultiEntitySets}"
33
34
  customData:hasMultiVisualizations="{converterContext>hasMultiVisualizations}"
34
35
  customData:ListReportSubtitle="{= ${manifest>/sap.app/appSubTitle} || '' }"
36
+ customData:KPIData="{= COMMON.stringifyCustomData(${converterContext>kpiDefinitions})}"
35
37
  showFooter="false"
36
38
  busy="{ui>/busy}"
37
39
  busyIndicatorDelay="0"
@@ -40,35 +42,79 @@
40
42
  <f:title>
41
43
  <f:DynamicPageTitle>
42
44
  <f:heading>
43
- <template:if test="{= ${viewData>/variantManagement} === 'Page'}">
45
+ <template:with path="converterContext>kpiDefinitions" var="definitions">
46
+ <template:if test="{definitions>length}">
44
47
  <template:then>
45
- <v:VariantManagement
46
- id="fe::PageVariantManagement"
47
- unittest:id="listReportVMPageTest"
48
- for="{converterContext>variantManagement/targetControlIds}"
49
- showSetAsDefault="true"
50
- select=".handlers.onVariantSelected"
51
- save=".handlers.onVariantSaved"
52
- displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
53
- executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled'}"
54
- />
48
+ <l:HorizontalLayout class="sapUiContentPadding">
49
+ <template:if test="{= ${viewData>/variantManagement} === 'Page'}">
50
+ <template:then>
51
+ <v:VariantManagement
52
+ id="fe::PageVariantManagement"
53
+ unittest:id="listReportVMPageTest"
54
+ for="{converterContext>variantManagement/targetControlIds}"
55
+ showSetAsDefault="true"
56
+ select=".handlers.onVariantSelected"
57
+ save=".handlers.onVariantSaved"
58
+ displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
59
+ executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled'}"
60
+ />
61
+ </template:then>
62
+ <template:elseif test="{= ${viewData>/variantManagement} === 'Control'}">
63
+ <v:VariantManagement
64
+ id="{= ID.generate([ ${converterContext>filterBarId}, 'VariantManagement']) }"
65
+ unittest:id="listReportVMControlTest"
66
+ for="{converterContext>filterBarId}"
67
+ showSetAsDefault="true"
68
+ select=".handlers.onVariantSelected"
69
+ save=".handlers.onVariantSaved"
70
+ displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
71
+ executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled'}"
72
+ />
73
+ </template:elseif>
74
+ <template:else>
75
+ <Title unittest:id="listReportTitleTest" text="{= ${manifest>/sap.app/subTitle} || ${manifest>/sap.app/title} }" />
76
+ </template:else>
77
+ </template:if>
78
+ <template:repeat list="{converterContext>kpiDefinitions}" var="kpi">
79
+ <template:with path="kpi>datapoint" var="datapoint">
80
+ <macro:KPITag id="{kpi>id}" metaPath="{datapoint>annotationPath}" hasUnit="{= ${datapoint>unit} !== undefined}" />
81
+ </template:with>
82
+ </template:repeat>
83
+ </l:HorizontalLayout>
55
84
  </template:then>
56
- <template:elseif test="{= ${viewData>/variantManagement} === 'Control'}">
57
- <v:VariantManagement
58
- id="{= ID.generate([ ${converterContext>filterBarId}, 'VariantManagement']) }"
59
- unittest:id="listReportVMControlTest"
60
- for="{converterContext>filterBarId}"
61
- showSetAsDefault="true"
62
- select=".handlers.onVariantSelected"
63
- save=".handlers.onVariantSaved"
64
- displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
65
- executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled'}"
66
- />
67
- </template:elseif>
68
85
  <template:else>
69
- <Title unittest:id="listReportTitleTest" text="{= ${manifest>/sap.app/subTitle} || ${manifest>/sap.app/title} }" />
86
+ <template:if test="{= ${viewData>/variantManagement} === 'Page'}">
87
+ <template:then>
88
+ <v:VariantManagement
89
+ id="fe::PageVariantManagement"
90
+ unittest:id="listReportVMPageTest"
91
+ for="{converterContext>variantManagement/targetControlIds}"
92
+ showSetAsDefault="true"
93
+ select=".handlers.onVariantSelected"
94
+ save=".handlers.onVariantSaved"
95
+ displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
96
+ executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled'}"
97
+ />
98
+ </template:then>
99
+ <template:elseif test="{= ${viewData>/variantManagement} === 'Control'}">
100
+ <v:VariantManagement
101
+ id="{= ID.generate([ ${converterContext>filterBarId}, 'VariantManagement']) }"
102
+ unittest:id="listReportVMControlTest"
103
+ for="{converterContext>filterBarId}"
104
+ showSetAsDefault="true"
105
+ select=".handlers.onVariantSelected"
106
+ save=".handlers.onVariantSaved"
107
+ displayTextForExecuteOnSelectionForStandardVariant="{= ${viewData>/initialLoad} === 'Auto' ? ${sap.fe.i18n>T_LR_VARIANT_APPLY_AUTOMATICALLY_WHEN_FILTER_SET} : undefined }"
108
+ executeOnSelectionForStandardDefault="{= ${viewData>/initialLoad} === 'Enabled'}"
109
+ />
110
+ </template:elseif>
111
+ <template:else>
112
+ <Title unittest:id="listReportTitleTest" text="{= ${manifest>/sap.app/subTitle} || ${manifest>/sap.app/title} }" />
113
+ </template:else>
114
+ </template:if>
70
115
  </template:else>
71
- </template:if>
116
+ </template:if>
117
+ </template:with>
72
118
  </f:heading>
73
119
  <f:snappedContent>
74
120
  <Text text="{internal>appliedFilters}" />
@@ -37,7 +37,8 @@ sap.ui.define(
37
37
  "sap/fe/core/helpers/SemanticDateOperators",
38
38
  "sap/fe/core/controllerextensions/Share",
39
39
  "./overrides/Share",
40
- "sap/fe/macros/CommonHelper"
40
+ "sap/fe/macros/CommonHelper",
41
+ "sap/fe/core/controllerextensions/KPIManagement"
41
42
  ],
42
43
  function(
43
44
  PageController,
@@ -72,7 +73,8 @@ sap.ui.define(
72
73
  SemanticDateOperators,
73
74
  Share,
74
75
  ShareOverrides,
75
- CommonHelper
76
+ CommonHelper,
77
+ KPIManagement
76
78
  ) {
77
79
  "use strict";
78
80
  var TemplateContentView = CoreLibrary.TemplateContentView,
@@ -120,6 +122,7 @@ sap.ui.define(
120
122
  share: Share.override(ShareOverrides),
121
123
  editFlow: EditFlow.override(EditFlowOverrides),
122
124
  viewState: ViewState.override(ViewStateOverrides),
125
+ kpiManagement: KPIManagement,
123
126
 
124
127
  getExtensionAPI: function() {
125
128
  if (!this.extensionAPI) {
@@ -184,36 +187,33 @@ sap.ui.define(
184
187
  this.extensionAPI && this.extensionAPI.destroy();
185
188
  delete this.extensionAPI;
186
189
  },
190
+
187
191
  _onAfterBinding: function() {
188
192
  var aTables = this._getTables();
189
193
  var that = this;
190
194
  if (EditState.isEditStateDirty()) {
191
195
  var oTableBinding = this._getTableBinding();
192
- if (!this.sUpdateTimer) {
193
- this.sUpdateTimer = setTimeout(function() {
194
- if (oTableBinding) {
196
+ if (oTableBinding) {
197
+ if (!this.sUpdateTimer) {
198
+ this.sUpdateTimer = setTimeout(function() {
195
199
  oTableBinding.refresh();
196
- }
197
- delete that.sUpdateTimer;
198
- }, 0);
200
+ delete that.sUpdateTimer;
201
+ }, 0);
202
+ }
203
+
204
+ // Update action enablement and visibility upon table data update.
205
+ var fnUpdateTableActions = function() {
206
+ that._updateTableActions(aTables);
207
+ oTableBinding.detachDataReceived(fnUpdateTableActions);
208
+ };
209
+ oTableBinding.attachDataReceived(fnUpdateTableActions);
199
210
  }
200
211
  EditState.setEditStateProcessed();
201
212
  }
202
- var aIBNActions = [];
203
- aTables.forEach(function(oTable) {
204
- aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
205
- TableUtils.getSemanticTargetsFromTable(that, oTable);
206
- // Update 'enabled' property of DataFieldForAction buttons on table toolbar
207
- // The same is also performed on Table selectionChange event
208
- var oInternalModelContext = oTable.getBindingContext("internal"),
209
- oActionOperationAvailableMap = JSON.parse(
210
- CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
211
- ),
212
- aSelectedContexts = oTable.getSelectedContexts();
213
-
214
- CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
215
- });
216
- CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
213
+
214
+ if (!this.sUpdateTimer) {
215
+ this._updateTableActions(aTables);
216
+ }
217
217
 
218
218
  this.pageReady.waitFor(
219
219
  this.getAppComponent()
@@ -221,6 +221,7 @@ sap.ui.define(
221
221
  .applyAppState()
222
222
  );
223
223
  },
224
+
224
225
  onAfterRendering: function(oEvent) {
225
226
  var that = this;
226
227
  this.getView()
@@ -314,6 +315,32 @@ sap.ui.define(
314
315
  }
315
316
  return this._sEntitySet;
316
317
  },
318
+
319
+ /**
320
+ * This method initiates update of enabled state of DataFieldForAction and visible state of DataFieldForIBN buttons.
321
+ * @param aTables Array of tables in the List report
322
+ * @private
323
+ */
324
+ _updateTableActions: function(aTables) {
325
+ var aIBNActions = [];
326
+ aTables.forEach(
327
+ function(oTable) {
328
+ aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
329
+ TableUtils.getSemanticTargetsFromTable(this, oTable);
330
+ // Update 'enabled' property of DataFieldForAction buttons on table toolbar
331
+ // The same is also performed on Table selectionChange event
332
+ var oInternalModelContext = oTable.getBindingContext("internal"),
333
+ oActionOperationAvailableMap = JSON.parse(
334
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
335
+ ),
336
+ aSelectedContexts = oTable.getSelectedContexts();
337
+
338
+ CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
339
+ }.bind(this)
340
+ );
341
+ CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
342
+ },
343
+
317
344
  /**
318
345
  * This method scrolls to a specific row on all the available tables.
319
346
  *
@@ -2,7 +2,7 @@
2
2
  * SAPUI5
3
3
  * (c) Copyright 2009-2021 SAP SE. All rights reserved.
4
4
  */
5
- sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
5
+ sap.ui.define(["sap/fe/core/CommonUtils", "sap/fe/macros/filter/FilterUtils"], function(CommonUtils, FilterUtils) {
6
6
  "use strict";
7
7
  return {
8
8
  adaptNavigationContext: function(oSelectionVariant, oTargetInfo) {
@@ -28,6 +28,10 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
28
28
  sRootPath,
29
29
  aParameters
30
30
  );
31
+ var oFilterBar = oController._getFilterBarControl();
32
+ var oFilterInfo = FilterUtils.getFilterInfo(oFilterBar, {
33
+ targetControl: oController._getCurrentTable()
34
+ }).filters;
31
35
  var oInternalModelContext = oView.getBindingContext("internal");
32
36
  var mTabs = oInternalModelContext.getProperty("tabs");
33
37
  // Do we need to exclude Fields (mutli tables mode)?
@@ -40,7 +44,7 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
40
44
  }
41
45
  }
42
46
  // TODO: move this also into the intent based navigation controller extension
43
- CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo);
47
+ CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo, oFilterInfo);
44
48
  delete oTargetInfo.propertiesWithoutConflict;
45
49
  }
46
50
  },
@@ -51,15 +51,15 @@ sap.ui.define(
51
51
  return baseUrl + aSupportedParams.join("&");
52
52
  }
53
53
 
54
- function getCustomUrl() {
55
- var sCustomUrl;
54
+ function getShareUrl() {
55
+ var sShareUrl;
56
56
  var sHash = HashChanger.getInstance().getHash();
57
57
  var sBasePath = HashChanger.getInstance().hrefForAppSpecificHash ? HashChanger.getInstance().hrefForAppSpecificHash("") : "";
58
- sCustomUrl = sHash ? sBasePath + sHash : window.location.href;
59
- return sCustomUrl;
58
+ sShareUrl = sHash ? sBasePath + sHash : window.location.hash;
59
+ return sShareUrl;
60
60
  }
61
61
 
62
- function getServiceUrl(oController) {
62
+ function getSaveAsTileServiceUrl(oController) {
63
63
  var oFilterBar = oController.getView().byId(
64
64
  oController
65
65
  .getView()
@@ -67,46 +67,56 @@ sap.ui.define(
67
67
  .data("filterBarId")
68
68
  );
69
69
  var oConditions = oFilterBar.getFilterConditions();
70
- var bServiceUrlAllowed = SemanticDateOperators.hasSemanticDateOperations(oConditions);
71
- if (bServiceUrlAllowed) {
70
+ var bsaveAsTileServiceUrlAllowed = SemanticDateOperators.hasSemanticDateOperations(oConditions);
71
+ if (bsaveAsTileServiceUrlAllowed) {
72
72
  return getCountUrl(oController);
73
73
  } else {
74
74
  return "";
75
75
  }
76
76
  }
77
77
 
78
- return {
79
- adaptShareData: function(oShareData) {
80
- var oAppComponent = CommonUtils.getAppComponent(this.base.getView());
81
- var oMetadata = oAppComponent.getMetadata();
82
- var oUIManifest = oMetadata.getManifestEntry("sap.ui");
83
- var sIcon = (oUIManifest && oUIManifest.icons && oUIManifest.icons.icon) || "";
84
- var oAppManifest = oMetadata.getManifestEntry("sap.app");
85
- var sTitle = (oAppManifest && oAppManifest.title) || "";
86
- var that = this;
87
- var oGetResourceBundle = this.base
88
- .getView()
89
- .getModel("sap.fe.i18n")
90
- .getResourceBundle();
91
- var sEmailSubject;
92
- return oGetResourceBundle
93
- .then(function(oBundle) {
94
- sEmailSubject = oBundle.getText("T_SHARE_UTIL_HELPER_SAPFE_EMAIL_SUBJECT", [document.title]);
95
- // TODO: check if there is any semantic date used before adding serviceURL as BLI:FIORITECHP1-18023
96
- oShareData = {
97
- icon: sIcon,
98
- title: sTitle,
99
- serviceUrl: getServiceUrl(that.base),
100
- shareEmailUrl: document.URL,
101
- emailSubject: sEmailSubject,
102
- jamText: document.title
103
- };
104
- oShareData.customUrl = getCustomUrl();
105
- return oShareData;
78
+ function getJamUrl() {
79
+ var sJamUrl;
80
+ var sHash = HashChanger.getInstance().getHash();
81
+ var sBasePath = HashChanger.getInstance().hrefForAppSpecificHash ? HashChanger.getInstance().hrefForAppSpecificHash("") : "";
82
+ sJamUrl = sHash ? sBasePath + sHash : window.location.hash;
83
+ // in case we are in cFLP scenario, the application is running
84
+ // inside an iframe, and there for we need to get the cFLP URL
85
+ // and not 'document.URL' that represents the iframe URL
86
+ if (sap.ushell && sap.ushell.Container && sap.ushell.Container.runningInIframe && sap.ushell.Container.runningInIframe()) {
87
+ sap.ushell.Container.getFLPUrl(true)
88
+ .then(function(sUrl) {
89
+ return sUrl.substr(0, sUrl.indexOf("#")) + sJamUrl;
106
90
  })
107
- .catch(function(oError) {
108
- Log.error("Error while getting the resource bundle", oError);
91
+ .catch(function(sError) {
92
+ Log.error("Could not retrieve cFLP URL for the sharing dialog (dialog will not be opened)", sError);
109
93
  });
94
+ } else {
95
+ return window.location.origin + window.location.pathname + sJamUrl;
96
+ }
97
+ }
98
+
99
+ return {
100
+ adaptShareMetadata: function(oShareMetadata) {
101
+ var that = this;
102
+ return Promise.resolve(getJamUrl()).then(function(sJamUrl) {
103
+ var oAppComponent = CommonUtils.getAppComponent(that.base.getView());
104
+ var oMetadata = oAppComponent.getMetadata();
105
+ var oUIManifest = oMetadata.getManifestEntry("sap.ui");
106
+ var sIcon = (oUIManifest && oUIManifest.icons && oUIManifest.icons.icon) || "";
107
+ var oAppManifest = oMetadata.getManifestEntry("sap.app");
108
+ var sTitle = (oAppManifest && oAppManifest.title) || "";
109
+ // TODO: check if there is any semantic date used before adding serviceURL as BLI:FIORITECHP1-18023
110
+ oShareMetadata.tile = {
111
+ icon: sIcon,
112
+ title: sTitle,
113
+ queryUrl: getSaveAsTileServiceUrl(that.base)
114
+ };
115
+ oShareMetadata.title = document.title;
116
+ oShareMetadata.url = getShareUrl();
117
+ oShareMetadata.jam.url = sJamUrl;
118
+ return oShareMetadata;
119
+ });
110
120
  }
111
121
  };
112
122
  }