@sapui5/sap.suite.ui.generic.template 1.128.1 → 1.129.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 (42) 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/Component.js +0 -2
  4. package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/ControllerImplementation.js +1 -1
  5. package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
  6. package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
  7. package/src/sap/suite/ui/generic/template/ListReport/Component.js +0 -2
  8. package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n.properties +4 -4
  9. package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
  10. package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +5 -7
  11. package/src/sap/suite/ui/generic/template/ObjectPage/controller/MessageSortingHandler.js +7 -0
  12. package/src/sap/suite/ui/generic/template/ObjectPage/controller/PasteHandler.js +28 -0
  13. package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +1 -1
  14. package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
  15. package/src/sap/suite/ui/generic/template/ObjectPage/templateSpecificPreparationHelper.js +0 -11
  16. package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Actions.fragment.xml +6 -6
  17. package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
  18. package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
  19. package/src/sap/suite/ui/generic/template/designtime/ObjectPage.designtime.js +11 -2
  20. package/src/sap/suite/ui/generic/template/fragments/ContactDetails.fragment.xml +0 -1
  21. package/src/sap/suite/ui/generic/template/fragments/SmartControlContextMenu.fragment.xml +6 -0
  22. package/src/sap/suite/ui/generic/template/genericUtilities/utils.js +48 -39
  23. package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +19 -3
  24. package/src/sap/suite/ui/generic/template/js/AnnotationHelperHiddenTermSupport.js +6 -12
  25. package/src/sap/suite/ui/generic/template/js/preparationHelper.js +3 -0
  26. package/src/sap/suite/ui/generic/template/lib/AppComponent.js +16 -26
  27. package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +1 -3
  28. package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +78 -10
  29. package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +6 -1
  30. package/src/sap/suite/ui/generic/template/lib/ComponentUtils.js +6 -8
  31. package/src/sap/suite/ui/generic/template/lib/ContextMenuHandler.js +23 -67
  32. package/src/sap/suite/ui/generic/template/lib/FlexibleColumnLayoutHandler.js +2 -1
  33. package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +24 -5
  34. package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +4 -5
  35. package/src/sap/suite/ui/generic/template/lib/insights/InsightsFECardProvider.js +30 -0
  36. package/src/sap/suite/ui/generic/template/lib/insights/InsightsHandler.js +38 -33
  37. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +91 -13
  38. package/src/sap/suite/ui/generic/template/library.js +1 -1
  39. package/src/sap/suite/ui/generic/template/listTemplates/fragments/DetailSmartTable.fragment.xml +3 -1
  40. package/src/sap/suite/ui/generic/template/manifestMerger/ChangePageConfiguration.js +50 -6
  41. package/src/sap/suite/ui/generic/template/manifestMerger/MergerUtil.js +4 -3
  42. package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +4 -0
@@ -420,20 +420,7 @@ sap.ui.define([
420
420
  oViewDependencyHelper: new ViewDependencyHelper(oTemplateContract)
421
421
  };
422
422
  oTemplateContract.oViewDependencyHelper = oAppRegistryEntry.oViewDependencyHelper;
423
- oTemplateContract.oShellServicePromise = oAppComponent.getService("ShellUIService").catch(function(){
424
- // fallback to old generic logic if service is not defined in manifest
425
- var oShellServiceFactory = ServiceFactoryRegistry.get("sap.ushell.ui5service.ShellUIService");
426
- var oServiceContext = {
427
- scopeObject: oAppComponent,
428
- scopeType: "component"
429
- };
430
-
431
- if (oShellServiceFactory) {
432
- return Promise.resolve(oShellServiceFactory.createInstance(oServiceContext));
433
- } else {
434
- return Promise.reject();
435
- }
436
- });
423
+ oTemplateContract.oShellServicePromise = oAppComponent.getService("ShellUIService");
437
424
  oTemplateContract.oShellServicePromise.catch(function(){
438
425
  oLogger.warning("No ShellService available");
439
426
  });
@@ -610,6 +597,7 @@ sap.ui.define([
610
597
  oTemplateContract.JouleContextProvider.fnUnregisterProvider();
611
598
  oTemplateContract.JouleContextProvider.destroy();
612
599
  }
600
+
613
601
  CommonMethods.setAppComponent(null);
614
602
  (UIComponent.prototype.exit || Function.prototype).apply(oAppComponent, arguments);
615
603
  fnDeregister();
@@ -943,7 +931,7 @@ sap.ui.define([
943
931
  * @public
944
932
  * @extends sap.ui.core.UIComponent
945
933
  * @author SAP SE
946
- * @version 1.128.1
934
+ * @version 1.129.1
947
935
  * @name sap.suite.ui.generic.template.lib.AppComponent
948
936
  */
949
937
  var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
@@ -952,18 +940,16 @@ sap.ui.define([
952
940
  title: "SAP UI Application Component", // TODO: This should be set from App descriptor
953
941
  fullWidth: true
954
942
  },
943
+ manifest: {
944
+ "sap.ui5": {
945
+ "services": {
946
+ "ShellUIService": {
947
+ "factoryName": "sap.ushell.ui5service.ShellUIService"
948
+ }
949
+ }
950
+ }
951
+ },
955
952
  properties: {
956
- // ghostapp: { //a boolean property which is not used publicly but only used to identify the ghostapp
957
- // type: "boolean"
958
- // },
959
- // draftSettings : { property which is not used publicly to influence the way the framework deals with drafts
960
- // type: "object",
961
- // properties: {
962
- // dataSaveFrequency: { // value "immediate" causes drafts to be merged immediately. All other values let draft be saved with the standard delay.
963
- // type: "string"
964
- // }
965
- // }
966
- // },
967
953
  forceGlobalRefresh: {
968
954
  type: "boolean",
969
955
  defaultValue: false //since the parameter is highly performance critical the default value is set to false
@@ -1038,6 +1024,10 @@ sap.ui.define([
1038
1024
  mergeObjectPageSectionTitle: {
1039
1025
  type: "boolean",
1040
1026
  defaultValue: true
1027
+ },
1028
+ externalNavigationSettings: {
1029
+ type: "object",
1030
+ defaultValue: null
1041
1031
  }
1042
1032
  },
1043
1033
  events: {
@@ -546,13 +546,11 @@ sap.ui.define(["sap/ui/base/Object",
546
546
  var bWarningOccured = false;
547
547
  var aNewMessages = [];
548
548
  var aMessagesAfterSave = CRUDHelper.fnGetMessagesFromContextFilter(oContextFilter, oMessageManager, true);
549
- var bCreateAccessRestrict = false;
550
549
  var aAllMessages = aMessagesAfterSave.map(function(oMessage){
551
550
  if (!mMessagesBeforeSave[oMessage.getId()]) { // if this is a new message
552
551
  oMessage.persistent = false;
553
552
  oMessage.technical = false;
554
553
  bWarningOccured = bWarningOccured || oMessage.technicalDetails.statusCode === "412" && oMessage.technicalDetails.headers["preference-applied"] === "handling=strict";
555
- bCreateAccessRestrict = oMessage.technicalDetails.statusCode === "403" ? true : bCreateAccessRestrict;
556
554
  aNewMessages.push(oMessage);
557
555
  }
558
556
  return oMessage;
@@ -571,7 +569,7 @@ sap.ui.define(["sap/ui/base/Object",
571
569
  fnHandleWarning();
572
570
  return;
573
571
  }
574
- if (!oCreateWithDialogFilters || (oCreateWithDialogFilters && bCreateAccessRestrict)) {
572
+ if (!oCreateWithDialogFilters) {
575
573
  oServices.oTemplateCapabilities.oMessageButtonHelper.showMessagePopover();
576
574
  }
577
575
  }
@@ -27,9 +27,38 @@ sap.ui.define(["sap/ui/base/Object",
27
27
  'sap/ui/performance/trace/FESRHelper',
28
28
  "sap/ui/core/CustomData",
29
29
  "sap/m/VBox",
30
- "sap/m/HBox"
31
- ], function(BaseObject, Event, MessageBox, Sorter, controlHelper, expressionHelper, testableHelper, oDataModelHelper, JSONModel, AnnotationHelper,
32
- Controller, FeLogger, MessageUtils, SideEffectUtil, extend, isEmptyObject, deepExtend, CRUDHelper, XMLView, FormatUtil, FileUploaderParameter, IconPool, ServiceContainer, ContactCardDetailHelper, mLibrary, Button, FESRHelper, CustomData, VBox, HBox) {
30
+ "sap/suite/ui/generic/template/genericUtilities/utils"
31
+ ], function(
32
+ BaseObject,
33
+ Event,
34
+ MessageBox,
35
+ Sorter,
36
+ controlHelper,
37
+ expressionHelper,
38
+ testableHelper,
39
+ oDataModelHelper,
40
+ JSONModel,
41
+ AnnotationHelper,
42
+ Controller,
43
+ FeLogger,
44
+ MessageUtils,
45
+ SideEffectUtil,
46
+ extend,
47
+ isEmptyObject,
48
+ deepExtend,
49
+ CRUDHelper,
50
+ XMLView,
51
+ FormatUtil,
52
+ FileUploaderParameter,
53
+ IconPool,
54
+ ServiceContainer,
55
+ ContactCardDetailHelper,
56
+ mLibrary,
57
+ Button,
58
+ FESRHelper,
59
+ CustomData,
60
+ VBox,
61
+ genericUtils) {
33
62
  "use strict";
34
63
 
35
64
  var oLogger = new FeLogger("lib.CommonEventHandlers").getLogger();
@@ -108,8 +137,8 @@ sap.ui.define(["sap/ui/base/Object",
108
137
  // if not determined here the threshold will be determined by PaginatorButtonHelper on demand
109
138
  var iThreshold = oPresentationControlHandler.getThreshold && oPresentationControlHandler.getThreshold();
110
139
 
111
- var oParent = oRow.getParent();
112
- var sParentId = oParent.getId();
140
+ var oTableFromRow = oCommonUtils.getOwnerControl(oRow);
141
+ var sParentId = oTableFromRow.getId();
113
142
  // bIsActive stores the information whether the object was in display mode when the paginator info was created (only used in draft scenario)
114
143
  var bIsActive = oComponentUtils.isDraftEnabled() && !oController.getView().getModel("ui").getProperty("/editable");
115
144
  // This function is called by the PaginatorButtonHelper.
@@ -125,7 +154,7 @@ sap.ui.define(["sap/ui/base/Object",
125
154
  if (!oVirtualItem){
126
155
  var bIsRowSelected = oRow.getSelected && oRow.getSelected();
127
156
  oVirtualItem = oRow.clone();
128
- oVirtualItem.setParent(oParent);
157
+ oVirtualItem.setParent(oTableFromRow);
129
158
  if (bIsRowSelected){ // if oRow was selected it has possibly lost this property when oVirtualItem was added to the same parent
130
159
  oRow.setSelected(true);
131
160
  }
@@ -1689,7 +1718,7 @@ sap.ui.define(["sap/ui/base/Object",
1689
1718
  // oCommonUtils.fnProcessDataLossOrDraftDiscardConfirmation will care for:
1690
1719
  // - wait until side-effects have been executed
1691
1720
  // - app is not busy (otherwise do nothing)
1692
- // - send a data loss popup in case needed (might also result in doing nothing)
1721
+ // - send a data loss popup in case needed (might also result in doing nothing)
1693
1722
  oCommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(onListNavigateImpl.bind(null, oEventSource, oEventParameters, oState, oBindingContext, bReplace), Function.prototype, "LeaveApp");
1694
1723
  } else if (!oServices.oApplication.getBusyHelper().isBusy()) { // if the app is already busy with something else stop navigation here
1695
1724
  onListNavigateImpl(oEventSource, oEventParameters, oState, oBindingContext, bReplace, oViewProxy);
@@ -1927,7 +1956,11 @@ sap.ui.define(["sap/ui/base/Object",
1927
1956
  }
1928
1957
  if (oFileUploader.FUEl.files[0].name){
1929
1958
  var headerParameterContentDispositionToken = new FileUploaderParameter();
1930
- var fileName = "filename=" + oFileUploader.FUEl.files[0].name;
1959
+ var sUploadedFileName = oFileUploader.FUEl.files[0].name;
1960
+ if (!genericUtils.isASCII(sUploadedFileName)) {
1961
+ sUploadedFileName = encodeURIComponent(sUploadedFileName);
1962
+ }
1963
+ var fileName = "filename=" + sUploadedFileName;
1931
1964
  headerParameterContentDispositionToken.setName("Content-Disposition");
1932
1965
  headerParameterContentDispositionToken.setValue(fileName);
1933
1966
  oFileUploader.addHeaderParameter(headerParameterContentDispositionToken);
@@ -1987,11 +2020,15 @@ sap.ui.define(["sap/ui/base/Object",
1987
2020
  oPrivModel.setProperty("/generic/controlProperties/" + "fileUploader/" + sEntitySet, oFileUploaderSettings);
1988
2021
  }
1989
2022
 
1990
- oFileUploaderSettings.fileName = oEvent.mParameters.fileName;
2023
+ // URLEncoded filenames are decoded by Chrome, Firefox browsers but Safari doesn't do this automatically.
2024
+ // Therefore, FE decodes it on our side & ensure actual file name is used for further processing.
2025
+ oFileUploaderSettings.fileName = decodeURIComponent(oEvent.mParameters.fileName);
1991
2026
  var fileType = oEvent.mParameters.requestHeaders.find(function(requestHeader) {
1992
2027
  if (requestHeader.name === "Content-Type") {
1993
2028
  return requestHeader;
1994
2029
  }
2030
+
2031
+ return undefined;
1995
2032
  });
1996
2033
  oFileUploaderSettings.fileType = fileType.value;
1997
2034
  var bIcon = IconPool.getIconForMimeType(fileType.value);
@@ -2696,6 +2733,35 @@ sap.ui.define(["sap/ui/base/Object",
2696
2733
  oComponentUtils.getBusyHelper().setBusy(oAIFilterQueryHandlerPromise);
2697
2734
  }
2698
2735
 
2736
+ /**
2737
+ * Performs intent based navigation and opens the given line item context in a new tab.
2738
+ *
2739
+ * @param {object} oOutbound The target outbound intent (contains semantic object and action)
2740
+ * @param {sap.ui.model.Context} oLineItemContext The line item context to be opened in new tab
2741
+ * @param {sap.ui.comp.smartfilterbar.SmartFilterBar} oSmartFilterBar The filter bar
2742
+ * @param {Function} fnHandleError The error handling function
2743
+ */
2744
+ function fnNavigateIntentOnNewTab(oOutbound, oLineItemContext, oSmartFilterBar, fnHandleError) {
2745
+ var sSelectionVariant,
2746
+ oSelectionVariant,
2747
+ sNavMode = "explace"; // "explace" is the navigation mode for opening in new tab
2748
+ // Get selection variant from filter bar
2749
+ if (oSmartFilterBar) {
2750
+ sSelectionVariant = oSmartFilterBar.getUiState().getSelectionVariant();
2751
+ if (typeof sSelectionVariant !== "string"){
2752
+ sSelectionVariant = JSON.stringify(sSelectionVariant);
2753
+ }
2754
+ }
2755
+ // Build the selection variant from line item context, page context and the selection variant of filter bar
2756
+ oSelectionVariant = fnBuildSelectionVariantForNavigation(oOutbound, [oLineItemContext], oController.getView().getBindingContext(), sSelectionVariant);
2757
+ var oObjectInfo = {
2758
+ semanticObject: oOutbound.semanticObject,
2759
+ action: oOutbound.action
2760
+ };
2761
+ oController.adaptNavigationParameterExtension(oSelectionVariant, oObjectInfo);
2762
+ oServices.oApplication.getNavigationHandler().navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, fnHandleError, null, sNavMode);
2763
+ }
2764
+
2699
2765
  /* eslint-disable */
2700
2766
  var fnBuildSelectionVariantForNavigation = testableHelper.testable(fnBuildSelectionVariantForNavigation, "fnBuildSelectionVariantForNavigation");
2701
2767
  var fnEvaluateParameters = testableHelper.testable(fnEvaluateParameters, "fnEvaluateParameters");
@@ -2704,6 +2770,7 @@ sap.ui.define(["sap/ui/base/Object",
2704
2770
  var fnGetSelectedItemContextForDeleteMessage = testableHelper.testable(fnGetSelectedItemContextForDeleteMessage, "fnGetSelectedItemContextForDeleteMessage");
2705
2771
  var getDataForDeleteDialog = testableHelper.testable(getDataForDeleteDialog, "getDataForDeleteDialog");
2706
2772
  var fnNavigateIntentSmartLink = testableHelper.testable(fnNavigateIntentSmartLink, "CommonEventHandlers_fnNavigateIntentSmartLink");
2773
+ var getPaginatorInfo = testableHelper.testable(getPaginatorInfo, "getPaginatorInfo");
2707
2774
  /* eslint-enable */
2708
2775
 
2709
2776
  return {
@@ -2747,7 +2814,8 @@ sap.ui.define(["sap/ui/base/Object",
2747
2814
  onSmartFieldModeToggled: onSmartFieldModeToggled,
2748
2815
  onRenderTeamsContactCollabOptions: fnRenderTeamsContactCollabOptions,
2749
2816
  hideTableCells: fnHideTableCells,
2750
- onEasyFilterChange: fnHandleEasyFilterChange
2817
+ onEasyFilterChange: fnHandleEasyFilterChange,
2818
+ navigateIntentOnNewTab: fnNavigateIntentOnNewTab
2751
2819
  };
2752
2820
  }
2753
2821
 
@@ -728,6 +728,10 @@ sap.ui.define(["sap/ui/base/Object",
728
728
  oComponentUtils.navigateAccordingToContext(oContext, iDisplayMode, bReplace);
729
729
  }
730
730
 
731
+ function fnOpenContextInNewTabFromListItem (oContext) {
732
+ oComponentUtils.openContextInNewTab(oContext);
733
+ }
734
+
731
735
  // Fix for BCP 1770053414 where error message is displayed instead of error code
732
736
  function fnHandleError(oError) {
733
737
  if (oError instanceof sap.fe.navigation.NavError) {
@@ -1992,7 +1996,8 @@ sap.ui.define(["sap/ui/base/Object",
1992
1996
  getControlStateWrapperById: oControlStateWrapperFactory.getControlStateWrapperById,
1993
1997
  handleError: fnHandleError,
1994
1998
  transformTechnicalPropsOnExportedFile: fnTransformTechnicalPropsOnExportedFile,
1995
- includeEntitySetParametersToExportedFile: fnIncludeEntitySetParametersToExportedFile
1999
+ includeEntitySetParametersToExportedFile: fnIncludeEntitySetParametersToExportedFile,
2000
+ openContextInNewTabFromListItem: fnOpenContextInNewTabFromListItem
1996
2001
  };
1997
2002
  }
1998
2003
 
@@ -1064,17 +1064,15 @@ sap.ui.define(["sap/ui/base/Object",
1064
1064
  function fnIsStateHandlingSuspended() {
1065
1065
  return oComponentRegistryEntry.oTemplateContract.bStateHandlingSuspended;
1066
1066
  }
1067
-
1068
- function fnAdjustCopyButtonSettings(oTableSettings) {
1069
- if (oTableSettings.copy === undefined) { // means it's not defined in the manifest
1070
- oTableSettings.copy = oTableSettings.type !== "ResponsiveTable" || oTableSettings.mode !== "None";
1071
- }
1072
- }
1073
1067
 
1074
1068
  function fnGetUI5VersionInfo() {
1075
1069
  var oTemplatePrivateGlobalModel = getTemplatePrivateGlobalModel();
1076
1070
  return oTemplatePrivateGlobalModel.getProperty("/generic/ui5VersionInfo");
1077
1071
  }
1072
+
1073
+ function fnOpenContextInNewTab (oNavigationContext) {
1074
+ oComponentRegistryEntry.oTemplateContract.oNavigationControllerProxy.openContextInNewTab(oTreeNode, oNavigationContext);
1075
+ }
1078
1076
 
1079
1077
  return {
1080
1078
  getBusyHelper: function() {
@@ -1155,8 +1153,8 @@ sap.ui.define(["sap/ui/base/Object",
1155
1153
  getToolbarDataFieldForActionCommandDetails: oCommandComponentUtils.getToolbarDataFieldForActionCommandDetails,
1156
1154
  getToolbarDataFieldForIBNCommandDetails: oCommandComponentUtils.getToolbarDataFieldForIBNCommandDetails,
1157
1155
  isStateHandlingSuspended: fnIsStateHandlingSuspended,
1158
- adjustCopyButtonSettings: fnAdjustCopyButtonSettings,
1159
- getUI5VersionInfo: fnGetUI5VersionInfo
1156
+ getUI5VersionInfo: fnGetUI5VersionInfo,
1157
+ openContextInNewTab: fnOpenContextInNewTab
1160
1158
  };
1161
1159
  }
1162
1160
 
@@ -1,14 +1,12 @@
1
1
  sap.ui.define([
2
2
  "sap/base/util/extend",
3
3
  "sap/base/util/ObjectPath",
4
- "sap/f/library",
5
4
  "sap/m/MessageBox",
6
5
  "sap/suite/ui/generic/template/genericUtilities/controlHelper",
7
6
  "sap/suite/ui/generic/template/genericUtilities/FeLogger",
8
7
  "sap/ui/base/Object",
9
- "sap/ui/base/Event",
10
- "sap/ui/util/openWindow"
11
- ], function (extend, ObjectPath, fioriLibrary, MessageBox, controlHelper, FeLogger, BaseObject, Event, openWindow) {
8
+ "sap/ui/base/Event"
9
+ ], function (extend, ObjectPath, MessageBox, controlHelper, FeLogger, BaseObject, Event) {
12
10
  "use strict";
13
11
 
14
12
  /* This class provides generic functionality for handling of the context menu for one smart control (oSourceControl).
@@ -16,9 +14,7 @@ sap.ui.define([
16
14
  * oConfiguration is an object which contains logic which is specific to the floorplan using this functionality.
17
15
  */
18
16
  var oLogger = new FeLogger("lib.ContextMenuHandler").getLogger();
19
- // shortcut for sap.f.LayoutType
20
- var LayoutType = fioriLibrary.LayoutType;
21
-
17
+
22
18
  // Constants
23
19
  var MAX_RECORDS_OPEN_IN_NEW_TAB = 10;
24
20
  var aToolbarContentsToBeOmitted = ["btnPersonalisation", "btnExcelExport"];
@@ -65,7 +61,9 @@ sap.ui.define([
65
61
  var bNavigationSupported = oComponentUtils.canNavigateToSubEntitySet(oSourceControl.getEntitySet());
66
62
  var mHandlers; // maps keys of context menu entries to handler functions for the corresponding entry
67
63
  var iCreatedMenuItemsCounter = 0; // increased whenever a new MenuItem is being created In fnAddMenuItem). Used to generate a key for mHandlers.
68
-
64
+ // Store the outbound navigation target
65
+ var sOutboundNavigationTarget = oSourceControl.getTable().getContextMenu().data("CrossNavigation");
66
+ var oOutbound = sOutboundNavigationTarget && fnGetOutboundInfoFromManifest(sOutboundNavigationTarget);
69
67
  /**
70
68
  * The method does the following
71
69
  * - Adds an entry (menu item) to the context menu.
@@ -306,51 +304,14 @@ sap.ui.define([
306
304
  return !bIsEmptyRow;
307
305
  }
308
306
 
309
- /**
310
- * Constructs the app specific route for the target to be opened on new tab. The target route consists of
311
- * 1. Deep path of the context
312
- * 2. URL parameters of the current app specific route.
313
- *
314
- * Note: All the URL parameters from source are retained in the target except the "FCLLayout".
315
- * The target "FCLLayout" is calculated by the below logic:
316
- *
317
- * If the app supports FCL.
318
- * - If the current page is LR (iViewLevel = 0), the target layout is "MidColumnFullScreen"
319
- * - If the current page is OP (iViewLevel > 0), the target layout is "EndColumnFullScreen"
320
- *
321
- * @returns {string} target path
322
- */
323
- function fnConstructTargetAppSpecificRoute (oContext, oAppComponent, sSrcAppSpecificRoute) {
324
- var sUrlParams = sSrcAppSpecificRoute.includes("?") ? sSrcAppSpecificRoute.substring(sSrcAppSpecificRoute.indexOf("?")) : "";
325
- var oUrlParams = new URLSearchParams(sUrlParams);
326
- var sDeepPath = oContext.getDeepPath();
327
- var sTargetPathPrefix = sDeepPath.startsWith("/") ? "&" : "&/";
328
- // If the app supports FCL, the object page should be opened in full screen mode
329
- if (oAppComponent.getFlexibleColumnLayout()) {
330
- var iViewLevel = oComponentUtils.getViewLevel();
331
- var sTargetFCLLayout = iViewLevel === 0 ? LayoutType.MidColumnFullScreen : LayoutType.EndColumnFullScreen;
332
- // Update "FCLLayout"
333
- oUrlParams.set("FCLLayout", sTargetFCLLayout);
334
- }
335
- return sTargetPathPrefix + sDeepPath + "?" + oUrlParams.toString();
307
+ // Fetches the outbound target from manifest
308
+ function fnGetOutboundInfoFromManifest (sOutboundNavigationTarget) {
309
+ var oManifestEntry = oController.getOwnerComponent().getAppComponent().getManifestEntry("sap.app");
310
+ return oManifestEntry.crossNavigation.outbounds[sOutboundNavigationTarget];
336
311
  }
337
312
 
338
- // Opens the given context in a new tab
339
- function fnOpenContextInNewTab (oContext, oUrlParser, sFLPUrl, oAppComponent) {
340
- // Construct URL object from FLP URL
341
- var oFLPUrl = new URL(sFLPUrl);
342
- // Get the hash from URL object
343
- var sHash = oFLPUrl.hash;
344
- // Parse the hash and update "appSpecificRoute" with the calculated target path.
345
- // Then, reconstruct the hash with updated value.
346
- var oHash = oUrlParser.parseShellHash(sHash);
347
- oHash.appSpecificRoute = fnConstructTargetAppSpecificRoute(oContext, oAppComponent, oHash.appSpecificRoute);
348
- sHash = oUrlParser.constructShellHash(oHash);
349
- // Update the hash on the FLP URL and reconstruct the URL
350
- oFLPUrl.hash = sHash;
351
- var sTargetUrl = oFLPUrl.toString();
352
- //Open the new window with the target URL
353
- openWindow(sTargetUrl);
313
+ function fnCrossAppNavErrorHandler(oContext, oError) {
314
+ oLogger.error("Error while opening the context " + oContext.getPath() + "in new tab: " + oError);
354
315
  }
355
316
 
356
317
  /**
@@ -366,23 +327,17 @@ sap.ui.define([
366
327
  return;
367
328
  }
368
329
 
369
- var oAppComponent = oController.getOwnerComponent().getAppComponent();
370
- var UShellContainer = sap.ui.require("sap/ushell/Container");
371
- var oUrlParsingPromise = UShellContainer.getServiceAsync("URLParsing");
372
- var oFLPUrlPromise = UShellContainer.getFLPUrlAsync(true);
373
- // If the table has any pending changes, synchronize the draft before navigation.
374
330
  var oSynchronizeDraftPromise = oSourceControl.getModel().hasPendingChanges() ? oTemplateUtils.oServices.oApplicationController.synchronizeDraftAsync() : Promise.resolve();
375
-
376
- Promise.all([oUrlParsingPromise, oFLPUrlPromise, oSynchronizeDraftPromise]).then(function (aResults) {
377
- var oUrlParser = aResults[0];
378
- var sFLPUrl = aResults[1];
379
-
331
+ oSynchronizeDraftPromise.then(function () {
380
332
  aNavigableContexts.forEach(function (oContext) {
381
- fnOpenContextInNewTab(oContext, oUrlParser, sFLPUrl, oAppComponent);
333
+ if (oOutbound) {
334
+ var fnHandleError = fnCrossAppNavErrorHandler.bind(null, oContext);
335
+ oTemplateUtils.oCommonEventHandlers.navigateIntentOnNewTab(oOutbound, oContext, oState.oSmartFilterbar, fnHandleError);
336
+ } else {
337
+ oTemplateUtils.oCommonUtils.openContextInNewTabFromListItem(oContext);
338
+ }
382
339
  });
383
- }).catch(function (oError) {
384
- oLogger.error("Error while opening in new tab", oError);
385
- });
340
+ });
386
341
  }
387
342
 
388
343
  /**
@@ -393,7 +348,7 @@ sap.ui.define([
393
348
  * a. Navigation is not supported by the table
394
349
  * b. Direct edit flow (when the edit icon is pressed on row, the object is opened with draft record) is configured.
395
350
  * c. The controller is configured with onListNavigationExtension (i.e custom navigation logic written by app).
396
- * //TODO: These negative scenarios need to be revisited
351
+ * d. If ushell container is unavailable
397
352
  *
398
353
  * @param {sap.suite.ui.generic.template.lib.ContextMenuHandler.FocusInfo} oFocusInfo
399
354
  * @returns {Promise<Function|undefined>} Promise which resolves the handler method
@@ -405,7 +360,8 @@ sap.ui.define([
405
360
 
406
361
  var bDirectEdit = oTemplateUtils.oServices.oApplication.getEditFlowOfRoot() === "direct";
407
362
  var bOnListNavigationExtensionFound = oController.hasOwnProperty("onListNavigationExtension");
408
- if (!bNavigationSupported || bDirectEdit || bOnListNavigationExtensionFound) {
363
+ var UshellContainer = sap.ui.require("sap/ushell/Container");
364
+ if (!bNavigationSupported || bDirectEdit || bOnListNavigationExtensionFound || !UshellContainer) {
409
365
  return;
410
366
  }
411
367
 
@@ -705,7 +705,8 @@ sap.ui.define(["sap/ui/base/Object", "sap/f/FlexibleColumnLayoutSemanticHelper",
705
705
  isListAndFirstEntryLoadedOnStartup: isListAndFirstEntryLoadedOnStartup,
706
706
  setStoredTargetLayoutToFullscreen: setStoredTargetLayoutToFullscreen,
707
707
  adaptAppStatesForExternalNavigation: fnAdaptAppStatesForExternalNavigation,
708
- willBeOpenedInFullscreen: fnWillBeOpenedInFullscreen
708
+ willBeOpenedInFullscreen: fnWillBeOpenedInFullscreen,
709
+ getFullscreenLayout: getFullscreenLayout
709
710
  };
710
711
  }
711
712
 
@@ -15,7 +15,7 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
15
15
  return UShellContainer ? new Promise(function(fnResolve){
16
16
  UShellContainer.getFLPUrlAsync(true).done(function (sFLPUrl){
17
17
  fnResolve(sFLPUrl);
18
- });
18
+ });
19
19
  }) : Promise.resolve(document.URL);
20
20
  }
21
21
 
@@ -84,18 +84,18 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
84
84
  }
85
85
 
86
86
  oCommonUtils.getDialogFragmentAsync("sap.suite.ui.generic.template.fragments.ShareSheet", oFragmentController, "share", ShareUtils.setStaticShareData, true).then(function (oFragment) {
87
- oShareActionSheet = oFragment;
87
+ oShareActionSheet = oFragment;
88
88
  var oShareModel = oShareActionSheet.getModel("share");
89
89
  oFragmentController.getModelData().then(function (oFragmentModelData) {
90
90
  oShareModel.setData(oFragmentModelData, true);
91
- ServiceContainer.getServiceAsync().then(function (oTeamsHelper) {
92
- this.addMenuItem(oShareModel, oTeamsHelper, oShareActionSheet, oControlToOpenBy);
91
+ ServiceContainer.getCollaborationServices().then(function (mResults) {
92
+ this.addMenuItem(oShareModel, mResults.oTeamsHelperService, oShareActionSheet, oControlToOpenBy, mResults.oCMHelperService);
93
93
  }.bind(this));
94
94
  }.bind(this));
95
95
  }.bind(this));
96
96
  };
97
97
 
98
- ShareUtils.addMenuItem = function (oShareModel, oTeamsHelper, oShareActionSheet, oControlToOpenBy) {
98
+ ShareUtils.addMenuItem = function (oShareModel, oTeamsHelper, oShareActionSheet, oControlToOpenBy, oCollaborationManager) {
99
99
  var iIndexForCollaborationOptions = 2;
100
100
  if (!oShareModel.getProperty("/jamVisible")) {
101
101
  iIndexForCollaborationOptions = 1;
@@ -142,6 +142,17 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
142
142
  iIndexForCollaborationOptions++;
143
143
  }.bind(this));
144
144
  }
145
+ var oCMOptions = oCollaborationManager.getOptions();
146
+ if (oCMOptions) {
147
+ var oItem = new MenuItem({
148
+ text: oCMOptions.text,
149
+ icon: oCMOptions.icon,
150
+ press: this.CollaborationButtonPress.bind(this, oCMOptions.press, oShareModel)
151
+ });
152
+ FESRHelper.setSemanticStepname(oItem, "press", oCMOptions.fesrStepName);
153
+ oShareActionSheet.insertItem(oItem, iIndexForCollaborationOptions);
154
+ iIndexForCollaborationOptions++;
155
+ }
145
156
  oBookmarkButton = new AddBookmarkButton();
146
157
  oBookmarkButton.setCustomUrl(oShareModel.getProperty("/customUrl"));
147
158
  oBookmarkButton.setServiceUrl(oShareModel.getProperty("/serviceUrl"));
@@ -161,6 +172,14 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
161
172
  oShareActionSheet.openBy(oControlToOpenBy);
162
173
  };
163
174
 
175
+ ShareUtils.CollaborationButtonPress = function (fnCallBackHandler, oShareModel) {
176
+ var sCurrentURLPromise = getCurrentUrl();
177
+ sCurrentURLPromise.then(function (sCurrentURL) {
178
+ var sAppTitle = oShareModel && oShareModel.getProperty("/title");
179
+ fnCallBackHandler(sAppTitle, sCurrentURL);
180
+ });
181
+ };
182
+
164
183
  /**
165
184
  * Press handler for the Collaboration Helper Option.
166
185
  * This method create Payload that need to pass for invoking Collaboration
@@ -819,12 +819,11 @@ sap.ui.define(["sap/suite/ui/generic/template/genericUtilities/metadataAnalyser"
819
819
  if (bIsPropertySemanticKey) {
820
820
  oColumnObject.identifier = bIsPropertySemanticKey;
821
821
  }
822
- if (bIsCriticality) {
823
- oColumnObject.state = fnBuildExpressionForCriticalityColor(oCriticalityAnnotation);
824
- oColumnObject.showStateIcon = oCriticalityAnnotation.CriticalityRepresentation ? (oCriticalityAnnotation.CriticalityRepresentation.EnumMember !== "com.sap.vocabularies.UI.v1.CriticalityRepresentationType/WithoutIcon") : true;
825
- }
826
822
  }
827
-
823
+ if (bIsCriticality) {
824
+ oColumnObject.state = fnBuildExpressionForCriticalityColor(oCriticalityAnnotation);
825
+ oColumnObject.showStateIcon = oCriticalityAnnotation.CriticalityRepresentation ? (oCriticalityAnnotation.CriticalityRepresentation.EnumMember !== "com.sap.vocabularies.UI.v1.CriticalityRepresentationType/WithoutIcon") : true;
826
+ }
828
827
  if (oProperty['com.sap.vocabularies.Common.v1.Label'] && oProperty['com.sap.vocabularies.Common.v1.Label'].String) {
829
828
  var sLabel = oProperty['com.sap.vocabularies.Common.v1.Label'].String,
830
829
  oRB = oCardDefinition['component'].getModel('i18n').getResourceBundle();
@@ -13,6 +13,30 @@ sap.ui.define([
13
13
  var aShareCards = [] , sAppComponentId, oInsightsCardProvider,
14
14
  mCardProviders = {};
15
15
 
16
+ function fnOnConsumerConnectedHandler() {
17
+ const iViewLevel = oTemplateContract.oTemplatePrivateGlobalModel.getProperty("/generic/routeLevel");
18
+ // DT Card is available only in Main Object page hence level = 1
19
+ if (iViewLevel === 1) {
20
+
21
+ const oCurrentRoutingTree = Object.values(oTemplateContract.mRoutingTree).find(oTreeNode => oTreeNode.level === 1);
22
+ const oController = oTemplateContract.componentRegistry[oCurrentRoutingTree.componentId]?.oController;
23
+ if (!oController) {
24
+ return;
25
+ }
26
+ const aExistingShareCards = oTemplateContract.oTemplatePrivateGlobalModel.getProperty("/generic/insights/shareCards/" + oCurrentRoutingTree.level);
27
+ const oInsightsHandler = mCardProviders[oController.getView().getId()];
28
+ let oGetCardsPromise = Promise.resolve(aExistingShareCards);
29
+ // Fetch the manifest only if:
30
+ // 1. It is the main object page to avoid errors when called from the list report.
31
+ // 2. There are no existing entries in the model for the specific view level, indicating it is the first time.
32
+ if (aExistingShareCards === undefined) {
33
+ oGetCardsPromise = oInsightsHandler.getCardsToShare("DT_CARD");
34
+ }
35
+ oGetCardsPromise.then(function (aShareCards) {
36
+ oInsightsCardProvider.onViewUpdate(true, aShareCards);
37
+ });
38
+ }
39
+ }
16
40
  /**
17
41
  * This method creates an instance of the insights card provider and it already takes care of registering this app to the "sap-insights" channel as a card provider.
18
42
  */
@@ -20,6 +44,12 @@ sap.ui.define([
20
44
  sAppComponentId = oTemplateContract.oAppComponent.getId();
21
45
  oInsightsCardProvider = new CardProvider(sAppComponentId, aShareCards);
22
46
  oInsightsCardProvider.onCardRequested = onCardDetailsRequested;
47
+ const fnOriginalOnConsumerConnectedHandler = oInsightsCardProvider.onConsumerConnected;
48
+ oInsightsCardProvider.onConsumerConnected = function(sConsumerId) {
49
+ fnOnConsumerConnectedHandler();
50
+ fnOriginalOnConsumerConnectedHandler.call(oInsightsCardProvider, sConsumerId);
51
+ };
52
+
23
53
  }
24
54
  /**
25
55
  * Each component can individually register as a card provider within the application (ex : List Report acts as a individual provider).