@sapui5/sap.suite.ui.generic.template 1.124.1 → 1.124.2

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 (25) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +1 -1
  3. package/src/sap/suite/ui/generic/template/AnalyticalListPage/extensionAPI/ExtensionAPI.js +10 -1
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  5. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  6. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  7. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  8. package/src/sap/suite/ui/generic/template/ObjectPage/templateSpecificPreparationHelper.js +38 -12
  9. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  10. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  11. package/src/sap/suite/ui/generic/template/extensionAPI/extensionAPI.js +1 -2
  12. package/src/sap/suite/ui/generic/template/fragments/ContactDetails.fragment.xml +8 -10
  13. package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +6 -4
  14. package/src/sap/suite/ui/generic/template/lib/AdaptiveCardHelper.js +90 -24
  15. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
  16. package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +7 -4
  17. package/src/sap/suite/ui/generic/template/lib/ContactCardDetailHelper.js +21 -3
  18. package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +3 -125
  19. package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +11 -1
  20. package/src/sap/suite/ui/generic/template/lib/insights/InsightsHandler.js +21 -21
  21. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  22. package/src/sap/suite/ui/generic/template/library.js +1 -1
  23. package/src/sap/suite/ui/generic/template/listTemplates/controller/DetailController.js +1 -1
  24. package/src/sap/suite/ui/generic/template/listTemplates/controller/IappStateHandler.js +2 -2
  25. package/src/sap/suite/ui/generic/template/listTemplates/controller/SmartChartController.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.124.1",
3
+ "version": "1.124.2",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "keywords": [
6
6
  "sapui5",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.124.1</version>
10
+ <version>1.124.2</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -15,6 +15,9 @@ sap.ui.define(["sap/ui/base/Object",
15
15
  var oNavigationController;
16
16
  return /** @lends sap.suite.ui.generic.template.AnalyticalListPage.extensionAPI.ExtensionAPI.prototype */ {
17
17
  /**
18
+ * Generally, this method returns the currently selected contexts in the given ui element (table, chart, or list).
19
+ * In case the context menu is opened, it returns the contexts applicable to the context menu.
20
+ *
18
21
  * Get the list entries currently selected
19
22
  * @param {string} sUiElementId the id identifying the ui element the selected context is requested for
20
23
  * @return {sap.ui.model.Context[]} contains the entries selected
@@ -26,7 +29,13 @@ sap.ui.define(["sap/ui/base/Object",
26
29
  if (sUiElementId) {
27
30
  oControl = oController.byId(sUiElementId);
28
31
  }
29
- return oTemplateUtils.oServices.oPresentationControlHandlerFactory.getPresentationControlHandler(oTemplateUtils.oCommonUtils.getOwnerPresentationControl(oControl)).getSelectedContexts();
32
+ var oPresentationControl = oTemplateUtils.oCommonUtils.getOwnerPresentationControl(oControl);
33
+ // This focus info is added to state by sap.suite.ui.generic.template.lib.ContextMenuHandler when the context menu is opened
34
+ // If the state contains focus info, return the contexts applicable for context menu
35
+ if (oState.oFocusInfo && oState.oFocusInfo.smartControlId === oPresentationControl.getId()) {
36
+ return oState.oFocusInfo.applicableContexts;
37
+ }
38
+ return oTemplateUtils.oServices.oPresentationControlHandlerFactory.getPresentationControlHandler(oPresentationControl).getSelectedContexts();
30
39
  },
31
40
  /**
32
41
  * Triggers rebinding on the list
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.124.1"
11
+ "version": "1.124.2"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.124.1"
11
+ "version": "1.124.2"
12
12
  },
13
13
  "title": "Canvas",
14
14
  "description": "Canvas Page",
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.124.1"
11
+ "version": "1.124.2"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.124.1"
9
+ "version": "1.124.2"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -331,13 +331,21 @@ sap.ui.define([
331
331
  fnSetTargetEntity(oEntitySet);
332
332
 
333
333
  var bToolbarButtonVisible = fnGetTableToolbarButtonVisibility(oSettings, oEntitySet, oResult.type);
334
- var sPathforInsertRestriction = fnGetInsertRestrictionForPasteButton(oEntitySet);
334
+ var oPathforRestriction = fnGetRestrictionForPasteButton(oEntitySet);
335
335
  /* Workaround fix for non draft apps with no section settings defined in the manifest. In UI5v1.93, the export to excel button is displayed by default because of a code gap in
336
336
  FE which later got fixed with a change related to paste button in UI5v1.96 wherein the export button is not displayed by default. This looks like a regression issue to customers
337
337
  for which we have provided this temporary solution which shall get removed soon. */
338
338
  oResult.bExportToExcel = (!oComponentUtils.isDraftEnabled() && !oSettings.sections) || bToolbarButtonVisible;
339
- if (sPathforInsertRestriction) {
340
- oResult.vShowPasteButton = bToolbarButtonVisible ? "{= ${ui>/editable} && ${" + sPathforInsertRestriction + "}}" : false;
339
+ if (oPathforRestriction) {
340
+ var sPathforRestriction = "";
341
+ if (oPathforRestriction.insertable) {
342
+ sPathforRestriction = "${" + oPathforRestriction.insertable + "}";
343
+ }
344
+ if (oPathforRestriction.updatable) {
345
+ sPathforRestriction = sPathforRestriction ? sPathforRestriction + " || ${" + oPathforRestriction.updatable + "}" : "${" + oPathforRestriction.updatable + "}";
346
+ }
347
+ sPathforRestriction = sPathforRestriction && "(" + sPathforRestriction + ")";
348
+ oResult.vShowPasteButton = bToolbarButtonVisible ? "{= ${ui>/editable} && " + sPathforRestriction + "}" : false;
341
349
  } else {
342
350
  oResult.vShowPasteButton = bToolbarButtonVisible ? "{ui>/editable}" : false;
343
351
  }
@@ -348,21 +356,39 @@ sap.ui.define([
348
356
  return oResult;
349
357
  }
350
358
 
351
- function fnGetInsertRestrictionForPasteButton(oEntitySet) {
359
+ // fnGetRestrictionForPasteButton return object contains updatable and insertable restriction for the given Entity Set.
360
+ function fnGetRestrictionForPasteButton(oEntitySet) {
352
361
  var oLeadingEntitySet = oMetaModel.getODataEntitySet(sLeadingEntitySet);
353
- var oInsertableAnnotation, oSectionInsertRestriction;
354
- var oRestrictionSetViaNavRestrictions = AnnotationHelper.handleNavigationRestrictions(oMetaModel, oLeadingEntitySet, oEntitySet, 'Insertable');
355
- if (oRestrictionSetViaNavRestrictions) {
356
- oInsertableAnnotation = oRestrictionSetViaNavRestrictions['Insertable'];
362
+ var oInsertableAnnotation, oUpdatableAnnotation;
363
+
364
+ var oInsertRestrictionSetViaNavRestrictions = AnnotationHelper.handleNavigationRestrictions(oMetaModel, oLeadingEntitySet, oEntitySet, 'Insertable');
365
+ if (oInsertRestrictionSetViaNavRestrictions) {
366
+ oInsertableAnnotation = oInsertRestrictionSetViaNavRestrictions['Insertable'];
357
367
  } else {
358
- oSectionInsertRestriction = oEntitySet['Org.OData.Capabilities.V1.InsertRestrictions'];
368
+ var oSectionInsertRestriction = oEntitySet['Org.OData.Capabilities.V1.InsertRestrictions'];
359
369
  oInsertableAnnotation = oSectionInsertRestriction && oSectionInsertRestriction['Insertable'];
360
370
  }
361
- if (oInsertableAnnotation && oInsertableAnnotation.Path) {
362
- return oInsertableAnnotation.Path;
371
+
372
+ var oUpdateRestrictionSetViaNavRestrictions = AnnotationHelper.handleNavigationRestrictions(oMetaModel, oLeadingEntitySet, oEntitySet, 'Updatable');
373
+ if (oUpdateRestrictionSetViaNavRestrictions) {
374
+ oUpdatableAnnotation = oUpdateRestrictionSetViaNavRestrictions['Updatable'];
375
+ } else {
376
+ var oSectionUpdatableRestriction = oEntitySet['Org.OData.Capabilities.V1.UpdateRestrictions'];
377
+ oUpdatableAnnotation = oSectionUpdatableRestriction && oSectionUpdatableRestriction['Updatable'];
378
+ }
379
+
380
+ var sInsertablePath = oInsertableAnnotation ? oInsertableAnnotation.Path : "";
381
+ var sUpdatablePath = oUpdatableAnnotation ? oUpdatableAnnotation.Path : "";
382
+
383
+ if (sInsertablePath || sUpdatablePath) {
384
+ return {
385
+ insertable: sInsertablePath,
386
+ updatable: sUpdatablePath
387
+ };
363
388
  }
364
- return false;
389
+ return null;
365
390
  }
391
+
366
392
  // used in the process of determining the visibility of export to excel and paste button depending on certain restrictions/conditions.
367
393
  function fnGetTableToolbarButtonVisibility(oSettings, oEntitySet, sTableType) {
368
394
  var oInsertableAnnotation, sEntityType, oSectionInsertRestriction;
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.124.1"
9
+ "version": "1.124.2"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.124.1"
9
+ "version": "1.124.2"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -43,8 +43,6 @@ sap.ui.define(["sap/suite/ui/generic/template/lib/TemplateAssembler",
43
43
  },
44
44
 
45
45
  /**
46
- * @deprecated As of version 1.124, please refer the {@link topic:4120052d90374ce8b1cea24a0d8bd317 documentation} for the migration steps.
47
- *
48
46
  * This method can be used to define specific controller extension(s) for a template which is used more than once within a SAP Fiori elements application.
49
47
  * More precisely: In the manifest of a SAP Fiori elements application, you can register a controller extension.
50
48
  * This controller extension is defined at <code>sap.ui5/extends/extensions/sap.ui.controllerExtensions/{template}</code>.
@@ -64,6 +62,7 @@ sap.ui.define(["sap/suite/ui/generic/template/lib/TemplateAssembler",
64
62
  * @param mEntitySetToImplementation a map. As a key, use the name of the entity set for which the (controller of the) page should be extended. As a value, use an
65
63
  * instance of the corresponding class as described above.
66
64
  * @public
65
+ * @deprecated As of version 1.120, please refer the {@link topic:4120052d90374ce8b1cea24a0d8bd317 documentation} for the migration steps.
67
66
  */
68
67
  registerControllerExtensions: function(sControllerExtensionName, mEntitySetToImplementation){
69
68
  var oControllerDefinition = {
@@ -1,7 +1,6 @@
1
1
  <core:FragmentDefinition
2
2
  xmlns="sap.m"
3
3
  xmlns:core="sap.ui.core"
4
- xmlns:fesr="http://schemas.sap.com/sapui5/extension/sap.ui.core.FESR/1"
5
4
  xmlns:macrodata="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1">
6
5
  <Popover
7
6
  id="quickView-popover"
@@ -10,7 +9,8 @@
10
9
  initialFocus="action"
11
10
  showHeader="false"
12
11
  contentWidth="20rem"
13
- afterClose="afterClose">
12
+ afterClose="afterClose"
13
+ afterOpen="afterOpen">
14
14
  <VBox>
15
15
  <HBox class="sapUiSmallMarginBottom">
16
16
  <Avatar
@@ -18,6 +18,7 @@
18
18
  displaySize="S"
19
19
  displayShape="Circle"
20
20
  class="sapUiTinyMarginEnd"
21
+ tooltip="{contact>/contactStatus/badgeTooltip}"
21
22
  badgeValueState="{contact>/contactStatus/badgeValueState}" badgeIcon="{contact>/contactStatus/badgeIcon}" badgeTooltip="{contact>/contactStatus/badgeTooltip}"
22
23
  macrodata:type="{contact>/teamsCollabOptions/0/key}"
23
24
  macrodata:email="{contact>/email}"
@@ -33,8 +34,8 @@
33
34
  <VBox visible="{= ${contact>/teamsCollabOptions} !== undefined &amp;&amp; ${contact>/teamsCollabOptions}.length > 0 }" class="sapUiSmallMarginBottom">
34
35
  <Toolbar width="100%" height="1px"/>
35
36
  <Toolbar >
36
- <Title text="{i18n>CONTACT_OPTION}" level="H5" class="sapUiTinyMarginBegin"/>
37
- <ToolbarSpacer/>
37
+ <Title text="{i18n>CONTACT_OPTION}" level="H5" class="sapUiTinyMarginBegin"/>
38
+ <ToolbarSpacer/>
38
39
  <Button
39
40
  icon="{contact>/teamsCollabOptions/0/icon}"
40
41
  tooltip="{contact>/teamsCollabOptions/0/tooltip}"
@@ -42,8 +43,7 @@
42
43
  macrodata:email="{contact>/email}"
43
44
  press=".onTeamsCollabOptionPress"
44
45
  class="sapUiTinyMarginEnd sapUiTinyMarginBegin"
45
- type="Ghost"
46
- fesr:press="{contact>/teamsCollabOptions/0/fesrStepName}">
46
+ type="Ghost">
47
47
  </Button>
48
48
  <Button
49
49
  icon="{contact>/teamsCollabOptions/1/icon}"
@@ -51,16 +51,14 @@
51
51
  macrodata:email="{contact>/email}"
52
52
  press=".onTeamsCollabOptionPress"
53
53
  class="sapUiTinyMarginEnd"
54
- type="Ghost"
55
- fesr:press="{contact>/teamsCollabOptions/1/fesrStepName}">
54
+ type="Ghost">
56
55
  </Button>
57
56
  <Button
58
57
  icon="{contact>/teamsCollabOptions/2/icon}"
59
58
  macrodata:type="{contact>/teamsCollabOptions/2/key}"
60
59
  macrodata:email="{contact>/email}"
61
60
  press=".onTeamsCollabOptionPress"
62
- type="Ghost"
63
- fesr:press="{contact>/teamsCollabOptions/2/fesrStepName}">
61
+ type="Ghost">
64
62
  </Button>
65
63
  </Toolbar>
66
64
  </VBox>
@@ -53,9 +53,11 @@ sap.ui.define([
53
53
  // don't create UiState (managed object) from scratch, but fetch it from control and only apply known properties from state - thus, if any other properties would be added, we don't
54
54
  // interfere with them
55
55
  var oUiState = oControl.getUiState();
56
- oUiState.setPresentationVariant(oState.oUiState.oPresentationVariant);
57
- oUiState.setSelectionVariant(oState.oUiState.oSelectionVariant);
58
- oControl.setUiState(oUiState);
56
+ if (!oUiState.getProperty("variantName")){
57
+ oUiState.setPresentationVariant(oState.oUiState.oPresentationVariant);
58
+ oUiState.setSelectionVariant(oState.oUiState.oSelectionVariant);
59
+ oControl.setUiState(oUiState);
60
+ }
59
61
  bIsApplying = false;
60
62
  } else {
61
63
  // set standard variant to overcome "implicit personalization" (esp. for OP when navigating to different object in discovery mode)
@@ -198,7 +200,7 @@ sap.ui.define([
198
200
  setState: fnSetState,
199
201
  setControl: fnSetControl,
200
202
  attachStateChanged: fnAttachStateChanged,
201
- bVMConnection: bVariantManagementActive
203
+ bVMConnection: oSmartControl && oSmartControl.getSmartVariant && !!oSmartControl.getSmartVariant()
202
204
  };
203
205
  }
204
206
 
@@ -11,6 +11,10 @@ sap.ui.define([
11
11
  var aVisibleItemsData;
12
12
  var iMaxColumns = 3;
13
13
  var objectTitle, objectSubtitle, sAppUrl, sAppTitle;
14
+ var oSapSemantics = Object.freeze({
15
+ unitOfMeasure: "unit-of-measure",
16
+ currencyCode: "currency-code"
17
+ });
14
18
 
15
19
  // function performs multiple level entity relation check to find the color
16
20
  var fnGetColorFromAnnotations = function (sCriticalityPath) {
@@ -88,8 +92,9 @@ sap.ui.define([
88
92
  var iLoop = 0;
89
93
  while (propLen > 0) {
90
94
  var oProperty = oEntityType.property.find(findFunc.bind(null, aProperties[iLoop]));
91
- if (oProperty && oProperty["type"]) {
92
- return oProperty["type"];
95
+ if (oProperty) {
96
+ var oSemantic = oEntityType.property.find(findFunc.bind(null, oProperty["sap:unit"]));
97
+ return { sEdmType: oProperty["type"], sSapUnit: oProperty["sap:unit"], sSemantic: oSemantic ? oSemantic["sap:semantics"] : undefined };
93
98
  } else if (propLen > 1) {
94
99
  var oNavigationEntitySet = oMetaModel.getODataAssociationEnd(oEntityType, aProperties[iLoop]);
95
100
  oEntityType = oMetaModel.getODataEntityType(oNavigationEntitySet.type);
@@ -97,7 +102,7 @@ sap.ui.define([
97
102
  }
98
103
  propLen--;
99
104
  }
100
- return undefined;
105
+ return { edmType: undefined, sSemantic: undefined, sSapUnit: undefined };
101
106
  };
102
107
 
103
108
  var fnExtractDataFromDataPoint = function (item, controller) {
@@ -121,7 +126,10 @@ sap.ui.define([
121
126
  if (isPotentiallyPersonal(oDataPointData.path, controller)) {
122
127
  return null;
123
128
  }
124
- oDataPointData.edmType = getEdmType(oDataPointData.path, controller);
129
+ var data = getEdmType(oDataPointData.path, controller);
130
+ oDataPointData.edmType = data.sEdmType;
131
+ oDataPointData.semantic = data.sSemantic;
132
+ oDataPointData.sapUnit = data.sSapUnit;
125
133
  oDataPointData.label = aControls[0].getText && aControls[0].getText();
126
134
  oDataPointData.value = aControls[1].getValue && aControls[1].getValue();
127
135
 
@@ -228,7 +236,10 @@ sap.ui.define([
228
236
  if (isPotentiallyPersonal(oFieldData.path, controller)) {
229
237
  continue;
230
238
  }
231
- oFieldData.edmType = getEdmType(oFieldData.path, controller);
239
+ var data = getEdmType(oFieldData.path, controller);
240
+ oFieldData.edmType = data.sEdmType;
241
+ oFieldData.sapUnit = data.sSapUnit;
242
+ oFieldData.semantic = data.sSemantic;
232
243
 
233
244
  // For Value Help
234
245
  var oObjectBinding = aFieldControls[1].getObjectBinding && aFieldControls[1].getObjectBinding();
@@ -274,6 +285,47 @@ sap.ui.define([
274
285
  }
275
286
  };
276
287
 
288
+ /**
289
+ * Create Nullish check expression
290
+ * @param {string} sPath Attribute binding to be evaluated for nullish values
291
+ * @param {string | undefined} sPath Attribute binding to be evaluated for nullish values
292
+ * @param {string | undefined} sPath Attribute binding to be evaluated for nullish values
293
+ * @returns {string} String Nullish check expression
294
+ */
295
+ var fnGetNullishPathCheckString = function (sPath, sEdmType, sValue) {
296
+ var sNullCheckPath = sPath + " == '' || " + sPath + " == null || " + sPath + " == undefined";
297
+ if (sEdmType === "Edm.Decimal") {
298
+ sNullCheckPath = sNullCheckPath + ' || ' + "formatNumber(float(" + sValue + "), 2) == '0.00'";
299
+ }
300
+ return sNullCheckPath;
301
+ };
302
+
303
+ /**
304
+ * Creates MS accepted conditional binding which will replace nullish resolved binding values ( '', null, undefined ) to -
305
+ * @param {string} sPath Attribute binding to be evaluated for nullish values
306
+ * @returns {string} String MS accepted conditional binding
307
+ */
308
+ var fnHandleDefaultValueForPath = function (sPath) {
309
+ return fnGetNullishPathCheckString(sPath) + " ? '\\\\-' : " + sPath;
310
+ };
311
+
312
+ /**
313
+ * Create generic MS accepted conditional binding based on params passed
314
+ * @param {string} sDefaultPath Attribute binding to be evaluated for nullish values
315
+ * @param {string} sValue Attribute Value binding for path
316
+ * @param {string | undefined} sFirstParam Attribute parameter binding for the path
317
+ * @param {string | undefined} sSecondParam Attribute parameter binding for the path
318
+ * @returns {string} String MS accepted conditional binding
319
+ */
320
+ var fnHandleValueForPath = function (sDefaultPath, sValue, sFirstParam, sSecondParam) {
321
+ if (sFirstParam && sSecondParam) {
322
+ return sDefaultPath + sValue + " + ' ' + " + "(" + sFirstParam + " ? " + sFirstParam + " : '') + ' ' + (" + fnGetNullishPathCheckString(sSecondParam) + " ? " + "' ' : " + "'(' + " + sSecondParam + " + ')')";
323
+ } else if (sFirstParam) {
324
+ return sDefaultPath + sValue + " + ' ' + (" + fnGetNullishPathCheckString(sFirstParam) + " ? " + "' ' : " + "'(' + " + sFirstParam + " + ')')";
325
+ }
326
+ return "";
327
+ };
328
+
277
329
  var fnSetPath = function (oField) {
278
330
  var aPaths = [];
279
331
  if (oField.paths) {
@@ -281,10 +333,17 @@ sap.ui.define([
281
333
  return oPath !== oField.path && oPath.indexOf("##@@") === -1;
282
334
  });
283
335
  }
284
- var sValue = oField.edmType === "Edm.Decimal" ? "${formatNumber(float(" + oField.path + "), 2)}" : "${" + oField.path + "}";
336
+ var sValue = oField.edmType === "Edm.Decimal" ? "formatNumber(float(" + oField.path + "), 2)" : oField.path;
337
+ var sDefaultPathValue = fnHandleDefaultValueForPath(oField.path);
285
338
  var sId = "";
286
339
  var sDescription = "";
287
340
  var sPath;
341
+ var sSapUnitConditionalPath = "";
342
+ if (oField.semantic === oSapSemantics.unitOfMeasure) {
343
+ sSapUnitConditionalPath = "(" + fnGetNullishPathCheckString(oField.sapUnit) + ")" + ' ? ' + sValue + " + ' ' + '\\\\-' : " + "";
344
+ } else if (oField.semantic === oSapSemantics.currencyCode) {
345
+ sSapUnitConditionalPath = "(" + fnGetNullishPathCheckString(oField.sapUnit) + ")" + ' ? ' + " '\\\\-' : " + "";
346
+ }
288
347
  if (aPaths.length > 1) {
289
348
  var aDescriptionText = aPaths.filter(function(oPath) {
290
349
  return oPath.endsWith("_Text");
@@ -293,47 +352,54 @@ sap.ui.define([
293
352
  return !oPath.endsWith("_Text");
294
353
  });
295
354
  if (aDescriptionText && aDescriptionText.length > 0) {
296
- sDescription = "${" + aDescriptionText[0] + "}";
355
+ sDescription = aDescriptionText[0];
297
356
  }
298
357
  if (aID && aID.length > 0){
299
- sId = "${" + aID[0] + "}";
300
- }
301
- if (aDescriptionText && aDescriptionText.length > 0) {
302
- sDescription = "${" + aDescriptionText[0] + "}";
358
+ sId = aID[0];
303
359
  }
304
360
  } else if (aPaths.length > 0) {
305
- sDescription = "${" + aPaths[0] + "}";
361
+ sDescription = aPaths[0];
306
362
  }
307
363
 
308
364
  if (oField.displayBehaviour) {
309
365
  switch (oField.displayBehaviour) {
310
- case "descriptionAndId":
311
- if (sId) {
312
- sPath = sValue + (sDescription ? " " + sDescription : "") + (sId ? " (" + sId + ")" : "");
313
- } else if (sDescription) {
314
- sPath = sDescription + (sValue ? " (" + sValue + ")" : "");
366
+ case "descriptionAndId":
367
+ if (sId && sDescription) {
368
+ sPath = fnHandleValueForPath(sSapUnitConditionalPath, sValue, sDescription, sId);
369
+ } else if (sId && !sDescription) {
370
+ sPath = fnHandleValueForPath(sSapUnitConditionalPath, sValue, sId);
371
+ } else if (sDescription && !sId) {
372
+ sPath = sSapUnitConditionalPath + " (" + fnGetNullishPathCheckString(sValue) + " ? (" + fnHandleDefaultValueForPath(sDescription) + ") : (" + sDescription + " + ' ' + " + "' (' + " + sValue + " + ')'" + "))";
315
373
  } else {
316
- sPath = sValue;
374
+ sPath = sDefaultPathValue;
317
375
  }
318
376
  break;
319
377
  case "descriptionOnly":
320
- sPath = sDescription;
378
+ sPath = fnHandleDefaultValueForPath(sDescription);
321
379
  break;
322
380
  case "idAndDescription":
323
- sPath = sValue + (sId ? " " + sId : "") + (sDescription ? " (" + sDescription + ")" : "");
381
+ if (sId && sDescription) {
382
+ sPath = fnHandleValueForPath(sSapUnitConditionalPath, sValue, sId, sDescription);
383
+ } else if (sId && !sDescription) {
384
+ sPath = sSapUnitConditionalPath + sValue + " + ' ' + (" + sId + " ? " + sId + " : '')";
385
+ } else if (!sId && sDescription) {
386
+ sPath = fnHandleValueForPath(sSapUnitConditionalPath, sValue, sDescription);
387
+ } else {
388
+ sPath = sDefaultPathValue;
389
+ }
324
390
  break;
325
391
  case "idOnly":
326
- sPath = sValue || sId;
392
+ sPath = sDefaultPathValue || sId;
327
393
  break;
328
394
  default:
329
- sPath = sValue;
395
+ sPath = sDefaultPathValue;
330
396
  break;
331
397
  }
332
398
  } else {
333
- sPath = sValue;
399
+ sPath = sDefaultPathValue;
334
400
  }
335
401
  sPath = sPath && sPath.indexOf('/') > -1 ? sPath.replaceAll('/', '.') : sPath;
336
- return sPath;
402
+ return "${" + sPath + "}";
337
403
  };
338
404
 
339
405
  var getWebUrl = function() {
@@ -919,7 +919,7 @@ sap.ui.define([
919
919
  * @extends sap.ui.core.UIComponent
920
920
  * @abstract
921
921
  * @author SAP SE
922
- * @version 1.124.1
922
+ * @version 1.124.2
923
923
  * @name sap.suite.ui.generic.template.lib.AppComponent
924
924
  */
925
925
  var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -523,15 +523,18 @@ sap.ui.define(["sap/ui/model/Context", "sap/suite/ui/generic/template/lib/Messag
523
523
  aTransientErrors.push(oMessage);
524
524
  }
525
525
  });
526
- var bHasStateError = aCurrentStateMessages.some(function(oMessage){
526
+ var bHasStateError = aCurrentStateMessages.some(function(oMessage) {
527
527
  return oMessage.type === "Error";
528
528
  });
529
529
  var bIsWarning = bIs412 && !bHasStateError;
530
- if (bIsWarning){
530
+ if (bIsWarning) {
531
531
  // Only show transient warnings in the confirmation popup if no state warning is available (note that backend sometimes sends warnings redundantly as transient and state message)
532
- var aMessagesForUserDecision = aCurrentStateMessages.length > 0 ? aCurrentStateMessages : aTransientWarnings;
532
+ var bHasStateWarning = aCurrentStateMessages.some(function(oMessage) {
533
+ return oMessage.type === "Warning";
534
+ });
535
+ var aMessagesForUserDecision = bHasStateWarning ? aCurrentStateMessages : aTransientWarnings;
533
536
  var oCustomMessageProvider = aCurrentStateMessages.length === 0 && { // if confirmation popup is to show transient messages these messages should be excluded from the
534
- isCustomMessage: function(oMessage){ // normal handling of transient messages (until the confirmation popup is closed)
537
+ isCustomMessage: function (oMessage) { // normal handling of transient messages (until the confirmation popup is closed)
535
538
  return aTransientWarnings.indexOf(oMessage) >= 0;
536
539
  }
537
540
  };
@@ -1,6 +1,8 @@
1
1
  sap.ui.define([
2
- "sap/suite/ui/commons/collaboration/ServiceContainer"
3
- ], function(ServiceContainer) {
2
+ "sap/suite/ui/commons/collaboration/ServiceContainer",
3
+ "sap/ui/performance/trace/FESRHelper",
4
+ "sap/suite/ui/generic/template/genericUtilities/controlHelper"
5
+ ], function(ServiceContainer, FESRHelper, controlHelper) {
4
6
  "use strict";
5
7
 
6
8
  /**
@@ -40,7 +42,8 @@ sap.ui.define([
40
42
  }
41
43
  },
42
44
  onTeamsCollabOptionPress: function(oEvent) {
43
- var sType = oEvent.getSource().data("type");
45
+ var oButton = oEvent.getSource();
46
+ var sType = oButton.data("type");
44
47
  var oSelectedOption = aTeamsCollabOptions.find(function(option) {
45
48
  return option.key === sType;
46
49
  });
@@ -49,6 +52,21 @@ sap.ui.define([
49
52
  afterClose: function(oEvent) {
50
53
  var oPopover = oEvent.getSource();
51
54
  oPopover.close();
55
+ },
56
+ afterOpen: function (oEvent) {
57
+ var oPopover = oEvent.getSource();
58
+ var oToolbar = oPopover.getContent()[0].getItems()[1].getItems()[1];
59
+ oToolbar.getContent().forEach(function(oItem){
60
+ if (controlHelper.isButton(oItem)) {
61
+ var sType = oItem.data("type");
62
+ if (sType) {
63
+ var oSelectedOption = aTeamsCollabOptions.find(function(option) {
64
+ return option.key === sType;
65
+ });
66
+ FESRHelper.setSemanticStepname(oItem, "press", oSelectedOption.fesrStepName);
67
+ }
68
+ }
69
+ });
52
70
  }
53
71
  }, "contact").then(function (oContactPopover) {
54
72
  var oContactModel = oContactPopover.getModel("contact");
@@ -1,7 +1,7 @@
1
1
  sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkButton",
2
2
  "sap/suite/ui/commons/collaboration/ServiceContainer", "sap/ui/core/CustomData", 'sap/ui/performance/trace/FESRHelper', "sap/ui/core/Component",
3
- "sap/suite/ui/generic/template/lib/AdaptiveCardHelper", "sap/m/MenuItem", "sap/ui/core/Lib"
4
- ], function (ObjectPath, AddBookmarkButton, ServiceContainer, CustomData, FESRHelper, Component, AdaptiveCardHelper, MenuItem, Library) {
3
+ "sap/suite/ui/generic/template/lib/AdaptiveCardHelper", "sap/m/MenuItem", "sap/ui/core/Lib", "sap/suite/ui/commons/windowmessages/CollaborationMessageConsumer"
4
+ ], function (ObjectPath, AddBookmarkButton, ServiceContainer, CustomData, FESRHelper, Component, AdaptiveCardHelper, MenuItem, Library, CollaborationMessageConsumer) {
5
5
  "use strict";
6
6
 
7
7
  var ShareUtils = {};
@@ -19,127 +19,6 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
19
19
  }) : Promise.resolve(document.URL);
20
20
  }
21
21
 
22
- function getMSTeamsConfigFromMessageBroker () {
23
- return getCurrentUrl().then(function(sCurrentUrl){
24
- var sHostName = sCurrentUrl.split(sCurrentUrl.getHash(sCurrentUrl))[0].split('/')[2];
25
- return new Promise(function (fnResolve) {
26
- var MY_CLIENT_ID = "sap-suite-ui-commons-collaboration-client-appruntime";
27
- var PLUGIN_CLIENT_ID = "sap-suite-ui-commons-collaboration-message-broker";
28
- var CHANNEL_ID = "collaboration-channel";
29
- var MSG_NAME = "get-provider-config";
30
- var aSubscribedChannels = [
31
- {
32
- channelId: CHANNEL_ID,
33
- version: "1.0"
34
- }
35
- ];
36
- var oFLPWindow = window.parent;
37
- var failTimerId;
38
- var bResponseReturned = false;
39
-
40
- //callback function to get messages from the message broker in the outer shell
41
- function processMessages (oMessage) {
42
- var oMessageData;
43
- if (typeof oMessage.data === "string" && oMessage.data.indexOf("sap.ushell.services.MessageBroker") > 0) {
44
- try {
45
- oMessageData = JSON.parse(oMessage.data);
46
- //connection accepted, now subscribe to the channel
47
- if (oMessageData.service === "sap.ushell.services.MessageBroker" &&
48
- oMessageData.type === "response" &&
49
- oMessageData.body.channelId === "sap.ushell.MessageBroker" &&
50
- oMessageData.body.clientId === MY_CLIENT_ID &&
51
- oMessageData.body.messageName === "connect" &&
52
- oMessageData.body.status === "accepted") {
53
- setTimeout(function () {
54
- oFLPWindow.postMessage(JSON.stringify({
55
- type: "request",
56
- service: "sap.ushell.services.MessageBroker",
57
- request_id: Date.now().toString(),
58
- body: {
59
- channelId: "sap.ushell.MessageBroker",
60
- clientId: MY_CLIENT_ID,
61
- messageName: "subscribe",
62
- subscribedChannels: aSubscribedChannels
63
- }
64
- }), sHostName);
65
- }, 0);
66
- }
67
- //subscription is ok, get the teams config from the shell plugin
68
- if (oMessageData.service === "sap.ushell.services.MessageBroker" &&
69
- oMessageData.type === "response" &&
70
- oMessageData.body.channelId === "sap.ushell.MessageBroker" &&
71
- oMessageData.body.clientId === MY_CLIENT_ID &&
72
- oMessageData.body.messageName == "subscribe" &&
73
- oMessageData.body.status === "accepted") {
74
- setTimeout(function () {
75
- oFLPWindow.postMessage(JSON.stringify({
76
- type: "request",
77
- service: "sap.ushell.services.MessageBroker",
78
- request_id: Date.now().toString(),
79
- body: {
80
- channelId: CHANNEL_ID,
81
- targetClientIds: [PLUGIN_CLIENT_ID],
82
- data: {},
83
- clientId: MY_CLIENT_ID,
84
- messageName: MSG_NAME
85
- }
86
- }), sHostName);
87
- }, 0);
88
- }
89
- if (oMessageData.service === "sap.ushell.services.MessageBroker" &&
90
- oMessageData.type === "request" &&
91
- oMessageData.body.channelId === CHANNEL_ID &&
92
- oMessageData.body.clientId === PLUGIN_CLIENT_ID &&
93
- oMessageData.body.messageName == MSG_NAME) {
94
- if (failTimerId) {
95
- clearTimeout(failTimerId);
96
- }
97
- if (!bResponseReturned) {
98
- fnResolve(JSON.parse(oMessageData.body.data));
99
- }
100
- }
101
- } catch (e) {
102
- fnResolve({});
103
- }
104
- }
105
- }
106
- window.addEventListener("message", processMessages);
107
- //connect to the message broker
108
- oFLPWindow.postMessage(JSON.stringify({
109
- "type": "request",
110
- "service": "sap.ushell.services.MessageBroker",
111
- "request_id": Date.now().toString(),
112
- "body": {
113
- "channelId": "sap.ushell.MessageBroker",
114
- "clientId": MY_CLIENT_ID,
115
- "messageName": "connect"
116
- }
117
- }), sHostName);
118
-
119
- //disconnect to the message broker after 2 seconds
120
- setTimeout(function () {
121
- oFLPWindow.postMessage(JSON.stringify({
122
- "type": "request",
123
- "service": "sap.ushell.services.MessageBroker",
124
- "request_id": Date.now().toString(),
125
- "body": {
126
- "channelId": "sap.ushell.MessageBroker",
127
- "clientId": MY_CLIENT_ID,
128
- "messageName": "disconnect"
129
- }
130
- }), sHostName);
131
- window.removeEventListener("message", processMessages);
132
- }, 2000);
133
-
134
- //if the outer shell did not answer within 1.5 seconds, assume there is no plugin
135
- failTimerId = setTimeout(function () {
136
- bResponseReturned = true;
137
- fnResolve({});
138
- }, 1500);
139
- });
140
- });
141
- }
142
-
143
22
  ShareUtils.getCurrentUrl = getCurrentUrl;
144
23
 
145
24
  /**
@@ -212,8 +91,7 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
212
91
  oFragmentController.getModelData().then(function (oFragmentModelData) {
213
92
  oShareModel.setData(oFragmentModelData, true);
214
93
  if (oUshellContainer && oUshellContainer.inAppRuntime()) {
215
- var oMessageBrokerPromise = getMSTeamsConfigFromMessageBroker();
216
- oMessageBrokerPromise.then(function(oProviderConfiguration){
94
+ CollaborationMessageConsumer.getProviderConfiguration().then(function(oProviderConfiguration){
217
95
  ServiceContainer.getServiceAsyncForAppRuntime(oProviderConfiguration).then(function (oTeamsHelper) {
218
96
  that.addMenuItem(oShareModel, oTeamsHelper, oShareActionSheet, oControlToOpenBy);
219
97
  });
@@ -844,7 +844,17 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
844
844
  }
845
845
  }
846
846
 
847
- oColumnObject['title'] = (oProperty['com.sap.vocabularies.Common.v1.Label'] && oProperty['com.sap.vocabularies.Common.v1.Label'].String) || oProperty['sap:label'];
847
+ if (oProperty['com.sap.vocabularies.Common.v1.Label'] && oProperty['com.sap.vocabularies.Common.v1.Label'].String) {
848
+ var sLabel = oProperty['com.sap.vocabularies.Common.v1.Label'].String,
849
+ oRB = oCardDefinition['component'].getModel('i18n').getResourceBundle();
850
+ if (sLabel.match(/{@i18n>.+}/gi) && oRB) {
851
+ oColumnObject['title'] = oRB.getText(sLabel.substring(sLabel.indexOf(">") + 1, sLabel.length - 1));
852
+ } else {
853
+ oColumnObject['title'] = sLabel;
854
+ }
855
+ } else {
856
+ oColumnObject['title'] = oProperty['sap:label'];
857
+ }
848
858
  if (oProperty.type === 'Edm.DateTime' || oProperty.type === 'Edm.DateTimeOffset') {
849
859
  var oFormatOption = JSON.stringify(oColumnData.typeInstance.oFormat.oFormatOptions).replace(/"/g, "'");
850
860
  oColumnObject['value'] = "{=$" + sColumnValue + " ? format.dateTime($" + sColumnValue + ", " + oFormatOption + ") : ''}";
@@ -4,8 +4,9 @@ sap.ui.define([
4
4
  "sap/m/MessageBox",
5
5
  "sap/suite/ui/generic/template/lib/insights/InsightsCardHelper",
6
6
  "sap/suite/ui/generic/template/lib/cards/DTCardHelper",
7
- "sap/base/util/merge"
8
- ], function(BaseObject, extend, MessageBox, InsightsCardHelper, DTCardHelper, merge) {
7
+ "sap/base/util/merge",
8
+ "sap/base/util/deepClone"
9
+ ], function(BaseObject, extend, MessageBox, InsightsCardHelper, DTCardHelper, merge, deepClone) {
9
10
  'use strict';
10
11
  function getMethods(oState, oController, oTemplateUtils) {
11
12
 
@@ -58,37 +59,36 @@ sap.ui.define([
58
59
  };
59
60
 
60
61
  // updating the same card to the global model so that the additional details can be used when card detail is requested from a card consumer.
61
- var oShareCardInfo = Object.create(null);
62
+ var oShareCardInfo = deepClone(oCardInfo);
62
63
 
63
64
  var fnGetCardInfoPromise = new Promise(function (fnResolve) {
64
65
  if (sType === InsightsCardHelper.CardTypes.DT_CARD) {
65
66
  oState.oDTCardHelper.getCardManifest(DTCardHelper.CardTypes.INTEGRATION)
66
- .then(function (oCardManifest) {
67
- if (!oCardManifest) {
68
- fnResolve(null);
69
- return;
70
- }
71
- oCardInfo.descriptorContent = merge(
72
- oCardManifest,
73
- oCardInfo.descriptorContent
74
- );
75
- fnResolve(oCardInfo);
76
- })
77
- .catch(function (oError) {
67
+ .then(function (oCardManifest) {
68
+ if (!oCardManifest) {
78
69
  fnResolve(null);
79
- });
70
+ return;
71
+ }
72
+ oShareCardInfo.descriptorContent = merge(
73
+ oShareCardInfo.descriptorContent,
74
+ oCardManifest
75
+ );
76
+ fnResolve(oShareCardInfo);
77
+ })
78
+ .catch(function (oError) {
79
+ fnResolve(null);
80
+ });
80
81
  } else {
81
- fnResolve(oCardInfo);
82
+ fnResolve(oShareCardInfo);
82
83
  }
83
84
  });
84
- return fnGetCardInfoPromise.then(function (oCardInfo) {
85
- if (oCardInfo) {
86
- extend(oShareCardInfo, oCardInfo);
85
+ return fnGetCardInfoPromise.then(function (oShareCardInfo) {
86
+ if (oShareCardInfo) {
87
87
  oShareCardInfo.cardType = sType;
88
88
  oShareCardInfo.viewId = sViewId;
89
89
  oTemplatePrivateGlobalModel.setProperty("/generic/insights/shareCards/" + iViewLevel, [oShareCardInfo]);
90
90
  }
91
- return oCardInfo ? [oCardInfo] : [];
91
+ return oShareCardInfo ? [oCardInfo] : [];
92
92
  });
93
93
 
94
94
  }
@@ -3055,7 +3055,7 @@ sap.ui.define(["sap/ui/base/Object",
3055
3055
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
3056
3056
  * @public
3057
3057
  * @extends sap.ui.base.Object
3058
- * @version 1.124.1
3058
+ * @version 1.124.2
3059
3059
  * @since 1.30.0
3060
3060
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3061
3061
  */
@@ -62,7 +62,7 @@ sap.ui.define([
62
62
  interfaces: [],
63
63
  controls: [],
64
64
  elements: [],
65
- version: "1.124.1",
65
+ version: "1.124.2",
66
66
  extensions: {
67
67
  //Configuration used for rule loading of Support Assistant
68
68
  "sap.ui.support": {
@@ -812,7 +812,7 @@ sap.ui.define([
812
812
  */
813
813
  _getSelParamsFromChart: function(chart) {
814
814
  var dpList = [];
815
- dpList = chart.getSelectedDataPoints().dataPoints;
815
+ dpList = this.oState.oTemplateUtils.oCommonUtils.getSelectionPoints(chart).dataPoints;
816
816
  return this._getSelParamsFromDPList(dpList);
817
817
  },
818
818
  /**
@@ -247,6 +247,8 @@ sap.ui.define(["sap/ui/base/Object",
247
247
  sNavType = sap.fe.navigation.NavType.iAppState;
248
248
  }
249
249
  oState.oSmartFilterbar.setSuppressSelection(false);
250
+ //Pref Improvement - Resume SetFilterData
251
+ oState.oSmartFilterbar.resumeSetFilterData();
250
252
  var sAppStateKey = oAppData.appStateKey || "";
251
253
  //Make sure that no two resolve functions are executing at the same time.
252
254
  if (bIsTransferringUrlStateToPageState){
@@ -260,8 +262,6 @@ sap.ui.define(["sap/ui/base/Object",
260
262
  bIsTransferringUrlStateToPageState = true;
261
263
  oState.sNavType = sNavType;
262
264
  var oNewUrlParameters = (!sAppStateKey && oURLParameters) || {};
263
- //Pref Improvement - Resume SetFilterData
264
- oState.oSmartFilterbar.resumeSetFilterData();
265
265
  handleVariantIdPassedViaURLParams(oNewUrlParameters);
266
266
  //Apply sort order coming from the XAppState to the smart table.
267
267
  if (sNavType !== sap.fe.navigation.NavType.iAppState && oAppData.presentationVariant !== undefined) {
@@ -283,7 +283,7 @@ sap.ui.define(["sap/ui/core/mvc/Controller",
283
283
  var oEvent = deepExtend({}, ev);
284
284
  setTimeout(function() { // due to the selection data points not being updated during the deselectData event, must check again asynchronously
285
285
  var chart = me.oChart;
286
- if (chart.getSelectedDataPoints().count == 0) {// Clear the filter if no selections remain. If a selection exists it would have come through the SelectData event
286
+ if (me.oState.oTemplateUtils.oCommonUtils.getSelectionPoints(chart).count == 0) {// Clear the filter if no selections remain. If a selection exists it would have come through the SelectData event
287
287
  me._updateTable();
288
288
  } else if (chart.getSelectionMode() == "MULTIPLE") {// Treat an unselect with remaining selection points as a select
289
289
  me._onChartSelectData(oEvent);