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

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 (69) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +4 -1
  3. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/ControllerImplementation.js +16 -9
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/CtxMenuHandler.js +77 -0
  5. package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n.properties +3 -0
  6. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  7. package/src/sap/suite/ui/generic/template/AnalyticalListPage/util/FilterUtil.js +52 -51
  8. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  9. package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +5 -4
  10. package/src/sap/suite/ui/generic/template/ListReport/controller/CtxMenuHandler.js +20 -1
  11. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n.properties +3 -0
  12. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  13. package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +130 -99
  14. package/src/sap/suite/ui/generic/template/ObjectPage/controller/CtxMenuHandler.js +8 -1
  15. package/src/sap/suite/ui/generic/template/ObjectPage/controller/MessageSortingHandler.js +2 -5
  16. package/src/sap/suite/ui/generic/template/ObjectPage/controller/MessageStripHelper.js +4 -3
  17. package/src/sap/suite/ui/generic/template/ObjectPage/controller/PasteHandler.js +12 -1
  18. package/src/sap/suite/ui/generic/template/ObjectPage/controller/SectionTitleHandler.js +15 -3
  19. package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +12 -15
  20. package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/RequiredPropHelper.js +4 -3
  21. package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n.properties +4 -0
  22. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +5 -2
  23. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Actions.fragment.xml +12 -12
  24. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +1 -1
  25. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  26. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  27. package/src/sap/suite/ui/generic/template/detailTemplates/detailUtils.js +3 -3
  28. package/src/sap/suite/ui/generic/template/extensionAPI/extensionAPI.js +2 -0
  29. package/src/sap/suite/ui/generic/template/fragments/AnalyticalTableColumns.fragment.xml +1 -1
  30. package/src/sap/suite/ui/generic/template/fragments/ContactDetails.fragment.xml +15 -9
  31. package/src/sap/suite/ui/generic/template/fragments/ContactDetailsQuickViewGroupReplica.fragment.xml +6 -3
  32. package/src/sap/suite/ui/generic/template/fragments/FileUploader.fragment.xml +1 -0
  33. package/src/sap/suite/ui/generic/template/fragments/QuickViewSmartForm.fragment.xml +6 -3
  34. package/src/sap/suite/ui/generic/template/fragments/TableColumns.fragment.xml +12 -0
  35. package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +5 -9
  36. package/src/sap/suite/ui/generic/template/js/RuntimeFormatters.js +2 -3
  37. package/src/sap/suite/ui/generic/template/lib/AdaptiveCardHelper.js +2 -4
  38. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +24 -16
  39. package/src/sap/suite/ui/generic/template/lib/CRUDActionHandler.js +5 -5
  40. package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +3 -2
  41. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +68 -57
  42. package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +30 -7
  43. package/src/sap/suite/ui/generic/template/lib/ContactCardDetailHelper.js +4 -18
  44. package/src/sap/suite/ui/generic/template/lib/ContextMenuHandler.js +20 -18
  45. package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +141 -126
  46. package/src/sap/suite/ui/generic/template/lib/cards/DTCardHelper.js +48 -0
  47. package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +5 -2
  48. package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +1 -1
  49. package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +14 -7
  50. package/src/sap/suite/ui/generic/template/lib/insights/InsightsFECardProvider.js +1 -1
  51. package/src/sap/suite/ui/generic/template/lib/insights/InsightsHandler.js +54 -17
  52. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
  53. package/src/sap/suite/ui/generic/template/library.js +7 -5
  54. package/src/sap/suite/ui/generic/template/listTemplates/controller/IappStateHandler.js +5 -0
  55. package/src/sap/suite/ui/generic/template/listTemplates/fragments/DetailSmartTable.fragment.xml +6 -0
  56. package/src/sap/suite/ui/generic/template/listTemplates/listUtils.js +2 -5
  57. package/src/sap/suite/ui/generic/template/support/lib/CommonChecks.js +4 -6
  58. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal/library.source.less +10 -1
  59. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/ALPConstants.less +47 -0
  60. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/AnalyticalListPage.less +475 -0
  61. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/ListReport.less +33 -0
  62. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/ObjectPage.less +391 -0
  63. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/QuickCreate.less +96 -0
  64. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/QuickView.less +108 -0
  65. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/alr_zen.css +136 -0
  66. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/base.less +7 -0
  67. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/crosstab_library.css +20 -0
  68. package/src/sap/suite/ui/generic/template/themes/sap_bluecrystal_base/library.source.less +9 -0
  69. package/ui5.yaml +1 -0
@@ -1,8 +1,9 @@
1
1
  sap.ui.define([
2
2
  "sap/ui/dom/getFirstEditableInput",
3
3
  "sap/suite/ui/generic/template/genericUtilities/FeLogger",
4
- "sap/ui/core/Element"
5
- ], function(getFirstEditableInput, FeLogger, Element) {
4
+ "sap/ui/core/Element",
5
+ "sap/ui/table/plugins/MultiSelectionPlugin"
6
+ ], function(getFirstEditableInput, FeLogger, Element, MultiSelectionPlugin) {
6
7
  "use strict";
7
8
 
8
9
  var oFeLogger = new FeLogger("genericUtilities.controlHelper");
@@ -235,15 +236,10 @@ sap.ui.define([
235
236
  /**
236
237
  * Returns the selection plugin for the given UI table
237
238
  * @param {sap.ui.table.Table} oUiTable
238
- * @returns {sap.ui.table.plugins.MultiSelectionPlugin}
239
+ * @returns {sap.ui.table.plugins.MultiSelectionPlugin|undefined}
239
240
  */
240
241
  function fnGetSelectionPluginForUITable (oUiTable) {
241
- // TODO: "sap.ui.table.Table#getPlugins" API is deprecated.
242
- // It should be removed once the table team provides a standard API to find a plugin.
243
- var aDepsAndPlugins = oUiTable.getDependents().concat(oUiTable.getPlugins());
244
- return aDepsAndPlugins.find(function (oPlugin) {
245
- return oPlugin.isA("sap.ui.table.plugins.MultiSelectionPlugin");
246
- });
242
+ return MultiSelectionPlugin.findOn(oUiTable);
247
243
  }
248
244
 
249
245
  var oControlHelper = {
@@ -1,5 +1,5 @@
1
- sap.ui.define(["sap/base/security/encodeXML", "sap/ui/core/format/NumberFormat", "sap/suite/ui/generic/template/genericUtilities/FeLogger", "sap/suite/ui/generic/template/genericUtilities/testableHelper", "sap/suite/ui/generic/template/genericUtilities/utils"
2
- ], function (encodeXML, NumberFormat, FeLogger, testableHelper, utils) {
1
+ sap.ui.define(["sap/base/security/encodeXML", "sap/ui/core/format/NumberFormat", "sap/ui/core/message/MessageType", "sap/suite/ui/generic/template/genericUtilities/FeLogger", "sap/suite/ui/generic/template/genericUtilities/testableHelper", "sap/suite/ui/generic/template/genericUtilities/utils"
2
+ ], function (encodeXML, NumberFormat, MessageType, FeLogger, testableHelper, utils) {
3
3
  "use strict";
4
4
 
5
5
  var oLogger = new FeLogger("js.RuntimeFormatters").getLogger();
@@ -104,7 +104,6 @@ sap.ui.define(["sap/base/security/encodeXML", "sap/ui/core/format/NumberFormat",
104
104
  }
105
105
 
106
106
  var sMessage = "None";
107
- var MessageType = sap.ui.core.MessageType; // for better access to the enum
108
107
  if (bEditable){
109
108
  var aMessage = oRowContext.getMessages();
110
109
  for (var i = 0; i < aMessage.length; i++){
@@ -698,14 +698,12 @@ sap.ui.define([
698
698
  var oData;
699
699
  if (oVisibleItem.getId().endsWith("DataPoint")) {
700
700
  oData = fnExtractDataFromDataPoint(oVisibleItem, oController);
701
- if (oData) {
702
- aVisibleItemsData.push(oData);
703
- }
704
701
  } else if (oVisibleItem.getId().endsWith("PlainTextVBox")) {
705
702
  oData = fnExtractDataFromPlainTextVBox(oVisibleItem, oController);
706
- aVisibleItemsData.push(oData);
707
703
  } else if (oVisibleItem.getId().endsWith("Form")) {
708
704
  oData = fnExtractDataFromForm(oVisibleItem, oController);
705
+ }
706
+ if (oData) {
709
707
  aVisibleItemsData.push(oData);
710
708
  }
711
709
  });
@@ -478,7 +478,7 @@ sap.ui.define([
478
478
  }
479
479
 
480
480
  // busy handling for Diagnostics Plugin
481
- if (oAppComponent && oAppComponent.getMetadata() && oAppComponent.getMetadata().getManifest()) {
481
+ if (oAppComponent && oAppComponent.getManifest()) {
482
482
  // Set component id to allow access to manifest even when app does not load successfully.
483
483
  CommonMethods.setAppComponent(oAppComponent);
484
484
  }
@@ -761,20 +761,13 @@ sap.ui.define([
761
761
  function getInternalManifest() {
762
762
  if (!oInternalManifest) {
763
763
  //We need to copy the original manifest due to read-only settings of the object
764
- oInternalManifest = extend({}, oAppComponent.getMetadata().getManifest());
764
+ oInternalManifest = extend({}, oAppComponent.getManifest());
765
765
  //Overwrite the part with our app. descriptor (see getConfig)
766
766
  oInternalManifest["sap.ui.generic.app"] = getConfig();
767
767
  }
768
768
  return oInternalManifest;
769
769
  }
770
770
 
771
- // Overriding private method _getRouterClassName of Component. We do not want to have router class derived from manifest settings, but derive it
772
- // from whether we use FCL or not.
773
- function getRouterClassName(){
774
- var sRoutingType = oAppComponent.getFlexibleColumnLayout() ? "f" : "m";
775
- return "sap." + sRoutingType + ".routing.Router";
776
- }
777
-
778
771
  function fnGetShellDataLossPopup(oShellContext) {
779
772
  return !oTemplateContract.ghostapp && oTemplateContract.oDataLossHandler.getShellDataLossPopup(oShellContext);
780
773
  }
@@ -822,11 +815,6 @@ sap.ui.define([
822
815
  * @private
823
816
  */
824
817
  restore: restore,
825
- /**
826
- *
827
- * @private
828
- */
829
- _getRouterClassName: getRouterClassName,
830
818
  /**
831
819
  *
832
820
  * @private
@@ -931,10 +919,10 @@ sap.ui.define([
931
919
  * @extends sap.ui.core.UIComponent
932
920
  * @abstract
933
921
  * @author SAP SE
934
- * @version 1.123.1
922
+ * @version 1.124.1
935
923
  * @name sap.suite.ui.generic.template.lib.AppComponent
936
924
  */
937
- return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
925
+ var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
938
926
  metadata: {
939
927
  config: {
940
928
  title: "SAP UI Application Component", // TODO: This should be set from App descriptor
@@ -1018,6 +1006,10 @@ sap.ui.define([
1018
1006
  defaultValue: {
1019
1007
  isShareAsCardEnabled: true
1020
1008
  }
1009
+ },
1010
+ mergeObjectPageSectionTitle: {
1011
+ type: "boolean",
1012
+ defaultValue: true
1021
1013
  }
1022
1014
  },
1023
1015
  events: {
@@ -1068,4 +1060,20 @@ sap.ui.define([
1068
1060
  (UIComponent.prototype.constructor || Function.prototype).apply(this, arguments);
1069
1061
  }
1070
1062
  });
1063
+
1064
+ /**
1065
+ * Implement "_fnGetRouterClassName" hook to derive the router class name.
1066
+ * We do not want to have router class derived from "/sap.ui5/routing" section of manifest settings,
1067
+ * instead derive it from FCL setting of Fiori Elements section ("sap.ui.generic.app")
1068
+ * @param {*} oManifest
1069
+ * @returns {string} Router class name
1070
+ */
1071
+ oAppComponent._fnGetRouterClassName = function (oManifest) {
1072
+ var oGenericAppEntry = oManifest.getEntry("/sap.ui.generic.app");
1073
+ var bIsFlexibleColumnLayout = oGenericAppEntry && oGenericAppEntry.settings && oGenericAppEntry.settings.flexibleColumnLayout;
1074
+ var sRoutingType = bIsFlexibleColumnLayout ? "f" : "m";
1075
+ return "sap." + sRoutingType + ".routing.Router";
1076
+ };
1077
+
1078
+ return oAppComponent;
1071
1079
  });
@@ -10,8 +10,8 @@
10
10
  */
11
11
 
12
12
  sap.ui.define(["sap/ui/base/Object", "sap/ui/model/Filter", "sap/ui/model/FilterOperator", "sap/base/util/extend", "sap/suite/ui/generic/template/lib/MessageUtils", "sap/ui/model/json/JSONModel",
13
- "sap/suite/ui/generic/template/genericUtilities/controlHelper"
14
- ], function(BaseObject, Filter, FilterOperator, extend, MessageUtils, JSONModel, controlHelper) {
13
+ "sap/suite/ui/generic/template/genericUtilities/controlHelper", "sap/ui/core/message/MessageType"
14
+ ], function(BaseObject, Filter, FilterOperator, extend, MessageUtils, JSONModel, controlHelper, MessageType) {
15
15
  "use strict";
16
16
 
17
17
  // A Filter that filters for messages that are at least of severity warning
@@ -19,11 +19,11 @@
19
19
  filters: [new Filter({
20
20
  path: "type",
21
21
  operator: FilterOperator.EQ,
22
- value1: sap.ui.core.MessageType.Warning
22
+ value1: MessageType.Warning
23
23
  }), new Filter({
24
24
  path: "type",
25
25
  operator: FilterOperator.EQ,
26
- value1: sap.ui.core.MessageType.Error
26
+ value1: MessageType.Error
27
27
  })],
28
28
  and: false
29
29
  });
@@ -31,7 +31,7 @@
31
31
  var oBaseErrorFilter = new Filter({
32
32
  path: "type",
33
33
  operator: FilterOperator.EQ,
34
- value1: sap.ui.core.MessageType.Error
34
+ value1: MessageType.Error
35
35
  });
36
36
 
37
37
  var sLocalModelName = "model";
@@ -12,8 +12,9 @@ sap.ui.define(["sap/ui/base/Object",
12
12
  "sap/m/MessageBox",
13
13
  "sap/suite/ui/generic/template/genericUtilities/oDataModelHelper",
14
14
  "sap/ui/core/message/Message",
15
+ "sap/ui/core/message/MessageType",
15
16
  "sap/suite/ui/generic/template/js/AnnotationHelper"
16
- ], function(BaseObject, ModelUtil, ActionUtil, MessageUtils, CRUDHelper, CacheHelper, testableHelper, extend, isEmptyObject, FeError, Context, MessageBox, oDataModelHelper, Message, AnnotationHelper) {
17
+ ], function(BaseObject, ModelUtil, ActionUtil, MessageUtils, CRUDHelper, CacheHelper, testableHelper, extend, isEmptyObject, FeError, Context, MessageBox, oDataModelHelper, Message, MessageType, AnnotationHelper) {
17
18
  "use strict";
18
19
  var sClassName = "lib.CRUDManager";
19
20
 
@@ -486,7 +487,7 @@ sap.ui.define(["sap/ui/base/Object",
486
487
  technical: false,
487
488
  target: sTarget + "/" + sMandatory,
488
489
  fullTarget: sFullTarget + "/" + sMandatory,
489
- type: sap.ui.core.MessageType.Error,
490
+ type: MessageType.Error,
490
491
  processor: oModel
491
492
  });
492
493
  oMessageManager.addMessages(oMessage);
@@ -1074,55 +1074,18 @@ sap.ui.define(["sap/ui/base/Object",
1074
1074
  };
1075
1075
 
1076
1076
  fnFetchTeamsOptions()
1077
- .then(function (aTeamsCollabOptions) {
1078
- renderQuickViewFragment.call(this, aTeamsCollabOptions);
1079
- }).catch(function (oError) {
1080
- renderQuickViewFragment.call(this);
1081
- });
1082
-
1083
- if (false && !bFieldGroupAvailable && aContactTitleArea && aContactTitleArea.length && aContactTitleArea.length < 2) { // Below code is to consume Teams Contacts Collaboration Helper. Commenting this code until we get clarity on CA
1084
- var oModel = oController.getOwnerComponent().getModel();
1085
- var oContactDataContext = oModel.getContext(sControlBindingContextPath);
1086
- var oContactData = oContactDataContext.getProperty(oTargetAnnotation.navigation);
1087
- var oTargetEntityType = oMetaModel.getODataEntityType(oTargetAnnotation.entityType);
1088
- var oTargetContactAnnotation = aContactTitleArea[0].Target.AnnotationPath && aContactTitleArea[0].Target.AnnotationPath.replace('@', '');
1089
- var oTargetContactAnnotationData = oTargetEntityType[oTargetContactAnnotation];
1090
- var sEmail = "", sEnumTypeContactEmail;
1091
-
1092
- if (oTargetContactAnnotationData.email && oTargetContactAnnotationData.email[0]) {
1093
- sEnumTypeContactEmail = (oTargetContactAnnotationData.email[0].type) && (oTargetContactAnnotationData.email[0].type.EnumMember);
1094
- if (sEnumTypeContactEmail && sEnumTypeContactEmail.indexOf("com.sap.vocabularies.Communication.v1.ContactInformationType/work") > -1) {
1095
- if (oTargetContactAnnotationData.email[0].address && oTargetContactAnnotationData.email[0].address.Path) {
1096
- sEmail = oContactData[oTargetContactAnnotationData.email[0].address.Path];
1097
- } else {
1098
- sEmail = (oTargetContactAnnotationData.email[0].address && oTargetContactAnnotationData.email[0].address.String);
1099
- }
1100
- }
1101
- }
1102
- }
1103
-
1104
- var skipBelowCode = true;
1105
- if (!skipBelowCode) { // Below code is to consume Teams Contacts Collaboration. Commenting this code until we get clarity on CA
1106
- ServiceContainer.getServiceAsync().then(function (oTeamsHelper) {
1107
- if (typeof oTeamsHelper.isContactsCollaborationSupported === 'function' && oTeamsHelper.isContactsCollaborationSupported()) {
1108
- return oTeamsHelper.enableContactsCollaboration(sEmail);
1109
- } else {
1110
- return Promise.reject();
1111
- }
1112
- })
1113
- .then(function (oPopover) {
1114
- oPopover.openBy(oControl);
1115
- })
1116
- .catch(function (oError) {
1077
+ .then(function (aTeamsCollabOptions) {
1078
+ renderQuickViewFragment.call(this, aTeamsCollabOptions);
1079
+ }).catch(function (oError) {
1117
1080
  renderQuickViewFragment.call(this);
1118
- }.bind(this));
1119
- }
1081
+ });
1120
1082
  }
1121
1083
 
1122
- function fnRenderTeamsCollabOptionsOnContactCard (oEntityType, oEventParameters, aTeamsCollabOptions, oControl, sControlBindingContextPath) {
1084
+ function fnRenderTeamsCollabOptionsOnContactCard(oEntityType, oEventParameters, aTeamsCollabOptions, oControl, sControlBindingContextPath) {
1123
1085
  var oContactCardForm = oEventParameters && oEventParameters.popoverForms;
1124
1086
  if (aTeamsCollabOptions && aTeamsCollabOptions.length && oControl.mProperties.contactAnnotationPath && oContactCardForm && oContactCardForm.length) {
1125
1087
  var oModel = oController.getOwnerComponent().getModel();
1088
+ var oi18nModel = oController.getOwnerComponent().getModel("i18n");
1126
1089
  var oMetaModel = oModel.getMetaModel();
1127
1090
  var oNavigationEntitySet = oMetaModel.getODataAssociationEnd(oEntityType, oControl.mProperties.contactAnnotationPath);
1128
1091
  var oNavigationEntityType = oMetaModel.getODataEntityType(oNavigationEntitySet.type);
@@ -1139,7 +1102,13 @@ sap.ui.define(["sap/ui/base/Object",
1139
1102
  }));
1140
1103
  callBackHandler.call(this, oEvent);
1141
1104
  };
1142
- var Buttons = [];
1105
+ var aContent = [];
1106
+ var oTitle = new sap.m.Title({
1107
+ text: oi18nModel.getResourceBundle().getText("CONTACT_OPTION")
1108
+ }).addStyleClass("sapUiTinnyMarginTop");
1109
+ var oToolbarSpacer = new sap.m.ToolbarSpacer();
1110
+ aContent.push(oTitle);
1111
+ aContent.push(oToolbarSpacer);
1143
1112
  for (var key in aTeamsCollabOptions) {
1144
1113
  var oTeamsCollabOption = aTeamsCollabOptions[key];
1145
1114
  var oButton = new Button({
@@ -1147,18 +1116,21 @@ sap.ui.define(["sap/ui/base/Object",
1147
1116
  type: "Transparent",
1148
1117
  press: oButtonPressHandler.bind(this, oTeamsCollabOption.callBackHandler),
1149
1118
  tooltip: oTeamsCollabOption.tooltip
1150
- }).addStyleClass("sapUiSmallMarginEnd");
1119
+ }).addStyleClass("sapUiTinyMarginEnd");
1151
1120
  oButton.addCustomData(new CustomData({
1152
1121
  key: "type",
1153
1122
  value: oTeamsCollabOption.key
1154
1123
  }));
1155
1124
  FESRHelper.setSemanticStepname(oButton, "press", oTeamsCollabOption.fesrStepName);
1156
- Buttons.push(oButton);
1125
+ aContent.push(oButton);
1157
1126
  }
1158
1127
  var oVbox = new VBox({
1159
1128
  items: [
1160
- new HBox({
1161
- items: Buttons
1129
+ new sap.m.Toolbar({
1130
+ height: "1px"
1131
+ }),
1132
+ new sap.m.Toolbar({
1133
+ content: aContent
1162
1134
  })
1163
1135
  ]
1164
1136
  });
@@ -2026,6 +1998,11 @@ sap.ui.define(["sap/ui/base/Object",
2026
1998
  }
2027
1999
  }
2028
2000
 
2001
+ function handleTypeMismatch(){
2002
+ var sMessageText = oCommonUtils.getText("ST_STREAM_TYPE_MISMATCH");
2003
+ oServices.oApplication.showMessageToast(sMessageText);
2004
+ }
2005
+
2029
2006
  function removeStream(oEvent){
2030
2007
  var oSource = oEvent.getSource();
2031
2008
  var aPath = [oController.getView().getBindingContext().sPath + "/$value"];
@@ -2480,10 +2457,20 @@ sap.ui.define(["sap/ui/base/Object",
2480
2457
  }
2481
2458
  }
2482
2459
 
2460
+ function fnFetchContactStatus(sEmail) {
2461
+ return ServiceContainer.getServiceAsync().then(function (oTeamsHelper) {
2462
+ if (typeof oTeamsHelper.isContactsCollaborationSupported === 'function' && oTeamsHelper.isContactsCollaborationSupported()) {
2463
+ return oTeamsHelper.getTeamsContactStatus(sEmail);
2464
+ }
2465
+ }).then(function (oContactStatus) {
2466
+ return Promise.resolve(oContactStatus);
2467
+ });
2468
+ }
2469
+
2483
2470
  // for ColumnLayout of smartForm, layouts are no longer accepted as a part of form content
2484
2471
  // Thus binding of fragment is to be done at runtime, as opposed to inline fragment call earlier
2485
2472
  function onContactDetails(oEvent, sNavigationPropertyPath) {
2486
- var renderContactDetailsFragment = function(aTeamsCollabOptions) {
2473
+ var renderContactDetailsFragment = function (aTeamsCollabOptions, oContactStatus) {
2487
2474
  var oSourceControl = oEvent.getSource();
2488
2475
  var oModel = oSourceControl.getModel();
2489
2476
  var oContext = oSourceControl.getBindingContext();
@@ -2493,20 +2480,43 @@ sap.ui.define(["sap/ui/base/Object",
2493
2480
  // In general we can show at max fn (FullName), photo & role properties in the Contacts facet. So if these key length is more than 3 that means we have already the other required properties
2494
2481
  // in the model and straight away we can go for populating the contact quickView otherwise we need to trigger a model GET request with the bindingPath
2495
2482
  if (Object.keys(oContactData.getProperty()).length > 3) {
2496
- ContactCardDetailHelper.populateDataInContactQuickView(oCommonUtils, oSourceControl, oContactData, aTeamsCollabOptions);
2483
+ ContactCardDetailHelper.populateDataInContactQuickView(oCommonUtils, oSourceControl, oContactData, aTeamsCollabOptions, oContactStatus);
2497
2484
  } else {
2498
- var oPromise = oDataModelHelper.getData(oModel, sPath).then(function() {
2499
- ContactCardDetailHelper.populateDataInContactQuickView(oCommonUtils, oSourceControl, oContactData, aTeamsCollabOptions);
2485
+ var oPromise = oDataModelHelper.getData(oModel, sPath).then(function () {
2486
+ ContactCardDetailHelper.populateDataInContactQuickView(oCommonUtils, oSourceControl, oContactData, aTeamsCollabOptions, oContactStatus);
2500
2487
  });
2501
2488
  oComponentUtils.getBusyHelper().setBusy(oPromise);
2502
2489
  }
2503
2490
  };
2504
2491
 
2505
- fnFetchTeamsOptions()
2506
- .then(function (aTeamsCollabOptions) {
2507
- renderContactDetailsFragment.call(this, aTeamsCollabOptions);
2492
+ var oSourceControl = oEvent.getSource();
2493
+ var oModel = oSourceControl.getModel();
2494
+ var oContext = oSourceControl.getBindingContext();
2495
+ var sPath = oContext.getPath();
2496
+ var oContactData = oModel.getContext(sPath);
2497
+ var oContactAnnotation = JSON.parse(oSourceControl.data("contactDetails"));
2498
+ var sEmail;
2499
+ if (oContactAnnotation.email[0].address && oContactAnnotation.email[0].address.Path) {
2500
+ sEmail = oContactData.getProperty(oContactAnnotation.email[0].address.Path);
2501
+ } else {
2502
+ sEmail = (oContactAnnotation.email[0].address && oContactAnnotation.email[0].address.String);
2503
+ }
2504
+
2505
+
2506
+ fnFetchContactStatus(sEmail).then(function (oContactStatus) {
2507
+ fnFetchTeamsOptions()
2508
+ .then(function (aTeamsCollabOptions) {
2509
+ renderContactDetailsFragment.call(this, aTeamsCollabOptions, oContactStatus);
2510
+ }).catch(function (oError) {
2511
+ renderContactDetailsFragment.call(this);
2512
+ });
2508
2513
  }).catch(function (oError) {
2509
- renderContactDetailsFragment.call(this);
2514
+ fnFetchTeamsOptions()
2515
+ .then(function (aTeamsCollabOptions) {
2516
+ renderContactDetailsFragment.call(this, aTeamsCollabOptions);
2517
+ }).catch(function (oError) {
2518
+ renderContactDetailsFragment.call(this);
2519
+ });
2510
2520
  });
2511
2521
  }
2512
2522
 
@@ -2519,7 +2529,7 @@ sap.ui.define(["sap/ui/base/Object",
2519
2529
  var oSourceControl = oEvent;
2520
2530
  ServiceContainer.getServiceAsync().then(function (oTeamsHelper) {
2521
2531
  if (typeof oTeamsHelper.isContactsCollaborationSupported === 'function' && oTeamsHelper.isContactsCollaborationSupported()) {
2522
- return oTeamsHelper.enableMinimalContactsCollaboration(sEmail);
2532
+ return oTeamsHelper.enableContactsCollaboration(sEmail);
2523
2533
  } else {
2524
2534
  return Promise.reject();
2525
2535
  }
@@ -2678,6 +2688,7 @@ sap.ui.define(["sap/ui/base/Object",
2678
2688
  uploadStream: uploadStream,
2679
2689
  removeStream: removeStream,
2680
2690
  handleUploadComplete: handleUploadComplete,
2691
+ handleTypeMismatch: handleTypeMismatch,
2681
2692
  evaluateParameters: fnEvaluateParameters,
2682
2693
  onBeforeExport: fnOnBeforeExport,
2683
2694
  handleSideEffectForField: fnHandleSideEffectForField,
@@ -14,9 +14,10 @@ sap.ui.define(["sap/ui/base/Object",
14
14
  "sap/suite/ui/generic/template/genericUtilities/oDataModelHelper",
15
15
  "sap/ui/core/IconPool",
16
16
  "sap/ui/export/util/Filter",
17
- "sap/ui/model/odata/ODataUtils"
17
+ "sap/ui/model/odata/ODataUtils",
18
+ "sap/ui/comp/util/TableUtil"
18
19
  ], function(BaseObject, ControllerExtension, MessageBox, SelectionVariant, controlHelper, metadataAnalyser,
19
- testableHelper, FeLogger, odata4analytics, extend, deepExtend, FeError, ControlStateWrapperFactory, oDataModelHelper, IconPool, ExportFilter, ODataUtils) {
20
+ testableHelper, FeLogger, odata4analytics, extend, deepExtend, FeError, ControlStateWrapperFactory, oDataModelHelper, IconPool, ExportFilter, ODataUtils, TableUtil) {
20
21
  "use strict";
21
22
  var sClassName = "lib.CommonUtils";
22
23
 
@@ -95,6 +96,18 @@ sap.ui.define(["sap/ui/base/Object",
95
96
  return mOverflowToolbarCustomData[sControlId] || [];
96
97
  }
97
98
 
99
+ function fnIsCustomColumn(oSmartTable, oColumn) {
100
+ var isCustomColumn;
101
+ var aFERenderedAndCustomColums = TableUtil.getCustomColumns(oSmartTable);
102
+ var oCurrentColumn = aFERenderedAndCustomColums.find(function(oCol) {
103
+ return ((oColumn.data("p13nData") && oColumn.data("p13nData").columnKey) === (oCol.data("p13nData") && oCol.data("p13nData").columnKey));
104
+ });
105
+ if (oCurrentColumn) {
106
+ isCustomColumn = oCurrentColumn.data("isFERenderedColumn") ? false : true;
107
+ }
108
+ return isCustomColumn;
109
+ }
110
+
98
111
  function getMetaModelEntityType(sEntitySet) {
99
112
  var oMetaModel, oEntitySet, oEntityType;
100
113
  oMetaModel = oController.getOwnerComponent().getModel().getMetaModel();
@@ -1525,11 +1538,19 @@ sap.ui.define(["sap/ui/base/Object",
1525
1538
  if (oStreamData && oStreamData.__metadata){
1526
1539
  var edit_media = oStreamData.__metadata.edit_media;
1527
1540
  var content_type = oStreamData.__metadata.content_type;
1528
- var url = edit_media && new URL(edit_media);
1529
- var urlPath = url && url.pathname;
1541
+ var urlPath = "";
1542
+ if (edit_media) {
1543
+ if (edit_media.startsWith("http:") || edit_media.startsWith("https:")) {
1544
+ //To ensure code is backward compatible with older versions of SAP Gateway
1545
+ var url = edit_media && new URL(edit_media);
1546
+ urlPath = url && url.pathname;
1547
+ } else {
1548
+ urlPath = edit_media;
1549
+ }
1550
+ }
1530
1551
  var bIcon = IconPool.getIconForMimeType(content_type);
1531
1552
  var obj = {
1532
- url : urlPath,
1553
+ url: urlPath,
1533
1554
  fileType: content_type,
1534
1555
  icon: bIcon
1535
1556
  };
@@ -1814,17 +1835,19 @@ sap.ui.define(["sap/ui/base/Object",
1814
1835
  },
1815
1836
  getToolbarCustomData: fnGetToolbarCustomData,
1816
1837
 
1817
- isSupportedColumn: function(oColumn, oProperty) {
1838
+ isSupportedColumn: function(oColumn, oProperty, oSmartTable) {
1818
1839
  var sColumnKey = oColumn.data("p13nData") && oColumn.data("p13nData").columnKey;
1819
1840
  if (sColumnKey.indexOf("DataFieldForAnnotation") > -1 ||
1820
1841
  sColumnKey.indexOf("DataFieldForAction") > -1 ||
1821
1842
  sColumnKey.indexOf("DataFieldForIntentBasedNavigation") > -1 ||
1822
1843
  (oProperty && oProperty['com.sap.vocabularies.UI.v1.IsImageURL'] && oProperty['com.sap.vocabularies.UI.v1.IsImageURL'].Bool === "true") ||
1823
- (oColumn.data("addCardtoInsightsConfig") && oColumn.data("addCardtoInsightsConfig").isMultiValueColumn)) {
1844
+ (oColumn.data("addCardtoInsightsConfig") && oColumn.data("addCardtoInsightsConfig").isMultiValueColumn) ||
1845
+ fnIsCustomColumn(oSmartTable, oColumn)) {
1824
1846
  return false;
1825
1847
  }
1826
1848
  return true;
1827
1849
  },
1850
+ isCustomColumn: fnIsCustomColumn,
1828
1851
 
1829
1852
  getCustomDataText: function(oElement) {
1830
1853
  return new Promise(function (resolve, reject) {
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  * @private
15
15
  */
16
16
 
17
- function fnPopulateDataInContactQuickView(oCommonUtils, oSourceControl, oContactData, aTeamsCollabOptions) {
17
+ function fnPopulateDataInContactQuickView(oCommonUtils, oSourceControl, oContactData, aTeamsCollabOptions, oContactStatus) {
18
18
  var oContactAnnotation = JSON.parse(oSourceControl.data("contactDetails"));
19
19
  var sEmail = "", sEnumTypeContactEmail;
20
20
 
@@ -122,28 +122,14 @@ sap.ui.define([
122
122
  if (aTeamsCollabOptions && aTeamsCollabOptions.length && sEmail) {
123
123
  oContactModel.setProperty("/teamsCollabOptions", aTeamsCollabOptions);
124
124
  }
125
+ if (oContactStatus && oContactStatus.length && sEmail) {
126
+ oContactModel.setProperty("/contactStatus", oContactStatus[0]);
127
+ }
125
128
  oContactPopover.openBy(oSourceControl);
126
129
  });
127
130
  };
128
131
 
129
132
  renderContactDetailsFragment.call(this); // To be removed when we consume the Teams Contacts Collaboration Helper
130
-
131
- var skipBelowCode = true;
132
- if (!skipBelowCode) { // Below code is to consume Teams Contacts Collaboration. Commenting this code until we get clarity on CA
133
- ServiceContainer.getServiceAsync().then(function (oTeamsHelper) {
134
- if (typeof oTeamsHelper.isContactsCollaborationSupported === 'function' && oTeamsHelper.isContactsCollaborationSupported()) {
135
- return oTeamsHelper.enableContactsCollaboration(sEmail);
136
- } else {
137
- return Promise.reject();
138
- }
139
- })
140
- .then(function (oPopover) {
141
- oPopover.openBy(oSourceControl);
142
- })
143
- .catch(function (oError) {
144
- renderContactDetailsFragment.call(this);
145
- });
146
- }
147
133
  }
148
134
 
149
135
  function getFormattedAddress(oContactData, oContactAnnotation) {
@@ -21,6 +21,7 @@ sap.ui.define([
21
21
 
22
22
  // Constants
23
23
  var MAX_RECORDS_OPEN_IN_NEW_TAB = 10;
24
+ var aToolbarContentsToBeOmitted = ["btnPersonalisation", "btnExcelExport"];
24
25
 
25
26
  function getMethods(oController, oTemplateUtils, oState, oSourceControl, oConfiguration) {
26
27
 
@@ -46,6 +47,7 @@ sap.ui.define([
46
47
  var oView = oController.getView();
47
48
  var oTemplatePrivateModel = oView.getModel("_templPriv");
48
49
  var oCommonUtils = oTemplateUtils.oCommonUtils;
50
+ var oComponentUtils = oTemplateUtils.oComponentUtils;
49
51
 
50
52
  // reserve a place in the template private model which can be used to determine the content of the context menu in a declarative way.
51
53
  // The corresponding entries are evaluated in .fragments.SmartControlContextMenu fragment.
@@ -60,7 +62,7 @@ sap.ui.define([
60
62
  });
61
63
 
62
64
  var oPresentationControlHandler = oTemplateUtils.oServices.oPresentationControlHandlerFactory.getPresentationControlHandler(oSourceControl);
63
- var bNavigationSupported = oTemplateUtils.oComponentUtils.canNavigateToSubEntitySet(oSourceControl.getEntitySet());
65
+ var bNavigationSupported = oComponentUtils.canNavigateToSubEntitySet(oSourceControl.getEntitySet());
64
66
  var mHandlers; // maps keys of context menu entries to handler functions for the corresponding entry
65
67
  var iCreatedMenuItemsCounter = 0; // increased whenever a new MenuItem is being created In fnAddMenuItem). Used to generate a key for mHandlers.
66
68
 
@@ -213,25 +215,18 @@ sap.ui.define([
213
215
  }
214
216
 
215
217
  function fnAddToolbarButtonToContextMenu(sPathToItems, oFocusInfo, oToolbarControlsData, aItems, oButton, bStartsNewSection){
216
- // If button has the stable id, find local id using "oButton.getId()".
217
- // Otherwise, if the button was created using design time adaption, use the custom data "originalButtonId" to find local id.
218
- var sButtonId = oView.getLocalId(oButton.getId()) || oView.getLocalId(oButton.data("originalButtonId"));
219
- // In the multi table multi view scenario, the toolbar button id is suffixed with icon tab bar's current key.
220
- var oMultipleViewsHandler = oState.oMultipleViewsHandler;
221
- var sButtonIdSuffix = oMultipleViewsHandler.getMode && oMultipleViewsHandler.getMode() === "multi" ? oState.oMultipleViewsHandler.getSelectedKey() : "";
222
-
218
+ // Case 1: If button has the stable id, use it to find local id.
219
+ // Case 2: If the button was created using design time adaption, use the custom data "originalButtonId" to find local id.
220
+ var sButtonLocalId = oView.getLocalId(oButton.getId()) || oView.getLocalId(oButton.data("originalButtonId"));
221
+
223
222
  var oHandlePromise = null;
224
223
  //Check if the control data available on standard actions
225
224
  var oStandardControlData = oToolbarControlsData.standardActions.find(function(oControlData){
226
- return oControlData.ID === sButtonId;
225
+ return oControlData.ID === sButtonLocalId;
227
226
  });
228
227
 
229
228
  // If not check on breakout actions
230
- var oBreakoutControlData = !oStandardControlData && oToolbarControlsData.breakoutActions.find(function (oBreakoutAction){
231
- // In multi table multi view, breakout action id = (manifest action id + "-" + multi view tab id).
232
- var sBreakoutActionId = sButtonIdSuffix ? (oBreakoutAction.id + "-" + sButtonIdSuffix) : oBreakoutAction.id;
233
- return sBreakoutActionId === sButtonId;
234
- });
229
+ var oBreakoutControlData = oConfiguration.findBreakoutActionByLocalId(oToolbarControlsData.breakoutActions, sButtonLocalId);
235
230
 
236
231
  // Get the handle promise based on the control type (standard / breakout)
237
232
  if (oStandardControlData) {
@@ -284,7 +279,13 @@ sap.ui.define([
284
279
  aToolbarContent.forEach(function(oToolbarEntry){
285
280
  if (!(oToolbarEntry.getVisible && oToolbarEntry.getVisible())) {
286
281
  return;
287
- }
282
+ }
283
+ var bIgnoreToolbarEntry = aToolbarContentsToBeOmitted.some(function (sControlToBeOmitted) {
284
+ return oToolbarEntry.getId().includes(sControlToBeOmitted);
285
+ });
286
+ if (bIgnoreToolbarEntry) {
287
+ return;
288
+ }
288
289
  if (controlHelper.isButton(oToolbarEntry)){
289
290
  bFirst = !fnAddToolbarButtonToContextMenu(sItemsPath, oFocusInfo, oToolbarControlsData, aItems, oToolbarEntry, bFirst) && bFirst;
290
291
  } else if (controlHelper.isMenuButton(oToolbarEntry)){
@@ -326,7 +327,7 @@ sap.ui.define([
326
327
  var sTargetPathPrefix = sDeepPath.startsWith("/") ? "&" : "&/";
327
328
  // If the app supports FCL, the object page should be opened in full screen mode
328
329
  if (oAppComponent.getFlexibleColumnLayout()) {
329
- var iViewLevel = oTemplateUtils.oComponentUtils.getViewLevel();
330
+ var iViewLevel = oComponentUtils.getViewLevel();
330
331
  var sTargetFCLLayout = iViewLevel === 0 ? LayoutType.MidColumnFullScreen : LayoutType.EndColumnFullScreen;
331
332
  // Update "FCLLayout"
332
333
  oUrlParams.set("FCLLayout", sTargetFCLLayout);
@@ -361,7 +362,7 @@ sap.ui.define([
361
362
  */
362
363
  function fnOpenNavigableContextsInNewTab (oFocusInfo, aNavigableContexts) {
363
364
  if (oFocusInfo.applicableContexts.length > MAX_RECORDS_OPEN_IN_NEW_TAB) {
364
- var sWarningMessage = oTemplateUtils.oCommonUtils.getText("T_TABLE_NAVIGATION_TOO_MANY_ITEMS_SELECTED", [MAX_RECORDS_OPEN_IN_NEW_TAB]);
365
+ var sWarningMessage = oCommonUtils.getText("T_TABLE_NAVIGATION_TOO_MANY_ITEMS_SELECTED", [MAX_RECORDS_OPEN_IN_NEW_TAB]);
365
366
  MessageBox.warning(sWarningMessage);
366
367
  return;
367
368
  }
@@ -388,7 +389,8 @@ sap.ui.define([
388
389
  /**
389
390
  * Returns the promise which resolves the event handler for "Open in new tab/window" entry.
390
391
  *
391
- * Negative scenario: It just returns without value when anyone of the following condition met.
392
+ * Negative scenario: It just returns without any value when anyone of the following condition met.
393
+ * So that, "Open in new tab" option isn't added in context menu.
392
394
  * a. Navigation is not supported by the table
393
395
  * b. Direct edit flow (when the edit icon is pressed on row, the object is opened with draft record) is configured.
394
396
  * c. The controller is configured with onListNavigationExtension (i.e custom navigation logic written by app).