@sapui5/sap.suite.ui.commons 1.141.0 → 1.142.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 (61) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/commons/.library +1 -1
  3. package/src/sap/suite/ui/commons/AriaProperties.js +1 -1
  4. package/src/sap/suite/ui/commons/CalculationBuilder.js +18 -12
  5. package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +11 -7
  6. package/src/sap/suite/ui/commons/CalculationBuilderFunction.js +1 -1
  7. package/src/sap/suite/ui/commons/CalculationBuilderGroup.js +1 -1
  8. package/src/sap/suite/ui/commons/CalculationBuilderInput.js +5 -5
  9. package/src/sap/suite/ui/commons/CalculationBuilderItem.js +26 -7
  10. package/src/sap/suite/ui/commons/CalculationBuilderValidationResult.js +1 -1
  11. package/src/sap/suite/ui/commons/CalculationBuilderVariable.js +1 -1
  12. package/src/sap/suite/ui/commons/CloudFilePicker.js +21 -21
  13. package/src/sap/suite/ui/commons/MicroProcessFlow.js +2 -2
  14. package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +7 -9
  15. package/src/sap/suite/ui/commons/Timeline.js +22 -24
  16. package/src/sap/suite/ui/commons/TimelineItemRenderer.js +12 -2
  17. package/src/sap/suite/ui/commons/collaboration/ServiceContainer.js +18 -2
  18. package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +152 -3
  19. package/src/sap/suite/ui/commons/collaboration/UniversalCollaborationBar.js +366 -0
  20. package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component-preload.js +5 -2
  21. package/src/sap/suite/ui/commons/flexibility/changeHandler/PropertyChangeMapper.js +1 -1
  22. package/src/sap/suite/ui/commons/imageeditor/CropCustomShapeHistoryItem.js +1 -1
  23. package/src/sap/suite/ui/commons/imageeditor/CropEllipseHistoryItem.js +1 -1
  24. package/src/sap/suite/ui/commons/imageeditor/CropRectangleHistoryItem.js +1 -1
  25. package/src/sap/suite/ui/commons/imageeditor/CustomSizeItem.js +1 -1
  26. package/src/sap/suite/ui/commons/imageeditor/FilterHistoryItem.js +1 -1
  27. package/src/sap/suite/ui/commons/imageeditor/FlipHistoryItem.js +1 -1
  28. package/src/sap/suite/ui/commons/imageeditor/HistoryItem.js +1 -1
  29. package/src/sap/suite/ui/commons/imageeditor/ImageEditor.js +1 -1
  30. package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainer.js +1 -1
  31. package/src/sap/suite/ui/commons/imageeditor/ImageEditorResponsiveContainer.js +1 -1
  32. package/src/sap/suite/ui/commons/imageeditor/ResizeHistoryItem.js +1 -1
  33. package/src/sap/suite/ui/commons/imageeditor/RotateHistoryItem.js +1 -1
  34. package/src/sap/suite/ui/commons/library.js +1 -1
  35. package/src/sap/suite/ui/commons/messagebundle.properties +16 -1
  36. package/src/sap/suite/ui/commons/messagebundle_en.properties +3 -0
  37. package/src/sap/suite/ui/commons/networkgraph/Graph.js +105 -5
  38. package/src/sap/suite/ui/commons/networkgraph/Node.js +33 -11
  39. package/src/sap/suite/ui/commons/networkgraph/util/DragDropManager.js +197 -0
  40. package/src/sap/suite/ui/commons/statusindicator/Circle.js +1 -1
  41. package/src/sap/suite/ui/commons/statusindicator/CustomShape.js +1 -1
  42. package/src/sap/suite/ui/commons/statusindicator/DiscreteThreshold.js +1 -1
  43. package/src/sap/suite/ui/commons/statusindicator/FillingOption.js +1 -1
  44. package/src/sap/suite/ui/commons/statusindicator/LibraryShape.js +1 -1
  45. package/src/sap/suite/ui/commons/statusindicator/Path.js +1 -1
  46. package/src/sap/suite/ui/commons/statusindicator/PropertyThreshold.js +1 -1
  47. package/src/sap/suite/ui/commons/statusindicator/Rectangle.js +1 -1
  48. package/src/sap/suite/ui/commons/statusindicator/Shape.js +1 -1
  49. package/src/sap/suite/ui/commons/statusindicator/ShapeGroup.js +1 -1
  50. package/src/sap/suite/ui/commons/statusindicator/SimpleShape.js +1 -1
  51. package/src/sap/suite/ui/commons/statusindicator/StatusIndicator.js +1 -1
  52. package/src/sap/suite/ui/commons/taccount/TAccount.js +1 -1
  53. package/src/sap/suite/ui/commons/taccount/TAccountGroup.js +1 -1
  54. package/src/sap/suite/ui/commons/taccount/TAccountItem.js +1 -1
  55. package/src/sap/suite/ui/commons/taccount/TAccountItemProperty.js +1 -1
  56. package/src/sap/suite/ui/commons/taccount/TAccountPanel.js +1 -1
  57. package/src/sap/suite/ui/commons/themes/base/CalculationBuilderItem.less +11 -3
  58. package/src/sap/suite/ui/commons/themes/base/CollaborationPopover.less +29 -1
  59. package/src/sap/suite/ui/commons/themes/base/NetworkGraph.less +5 -0
  60. package/src/sap/suite/ui/commons/windowmessages/CollaborationMessageBroker.js +3 -3
  61. package/src/sap/suite/ui/commons/windowmessages/CollaborationMessageConsumer.js +5 -4
@@ -580,7 +580,7 @@ sap.ui.define([
580
580
  */
581
581
  TeamsHelperService.prototype._getCardInfoUrl = function(sUrl, oParams, oCardData) {
582
582
  const isValid = this._isValidDomain(sUrl);
583
- const sAppTitle = oParams.appTitle;
583
+ const sAppTitle = oParams?.appTitle;
584
584
  if (isValid) {
585
585
  return this._generateCardUnfurlingUrl(sUrl, oCardData, { appTitle: sAppTitle });
586
586
  } else {
@@ -737,8 +737,6 @@ sap.ui.define([
737
737
  return this.oContactHelper.getTeamsContactStatus(sEmail);
738
738
  };
739
739
 
740
-
741
-
742
740
  /**
743
741
  * Opens a Popup that helps to share content to teams, mail.
744
742
  * @param { object } oParams Optional argument in case consumer wants to influence the options, otherwise pass as undefined
@@ -960,5 +958,156 @@ sap.ui.define([
960
958
  sap.m.URLHelper.redirect(sURL, true);
961
959
 
962
960
  };
961
+
962
+ /**
963
+ * Shares the current or unfurled URL via email.
964
+ * @param {Object} oParams - Parameters for sharing.
965
+ * @param {string} [oParams.url] - The base URL to share.
966
+ * @param {string} [oParams.appTitle] - The subject of the email.
967
+ * @returns {Promise<void>} A promise that resolves when the email sharing process is complete.
968
+ */
969
+ TeamsHelperService.prototype._shareToEmail = async function (oParams) {
970
+ let sUnfurlingUrl = oParams?.url || window.location.href;
971
+ try {
972
+ sUnfurlingUrl = await this._getUnfurlingUrl(oParams);
973
+ } catch (error) {
974
+ oLogger.error("getUnfurlingUrl failed: " + error.message);
975
+ }
976
+
977
+ const sSubject = oParams?.appTitle?.trim() ? oParams.appTitle : null;
978
+ sap.m.URLHelper.triggerEmail(null, sSubject, sUnfurlingUrl);
979
+ };
980
+
981
+ /**
982
+ * Shares a card from the collaboration bar.
983
+ * @param {Object} params - Parameters for sharing the card.
984
+ */
985
+ TeamsHelperService.prototype._shareAsChatFromCollabBar = async function (params) {
986
+ try {
987
+ await this._shareAsCard(params);
988
+ } catch (error) {
989
+ oLogger.error("Failed to share card from collaboration bar: " + error.message);
990
+ }
991
+ };
992
+
993
+ /**
994
+ * Copies the unfurled card URL to the clipboard.
995
+ * @param {Object} oParams - Parameters for sharing.
996
+ * @param {string} [oParams.url] - The base URL to copy.
997
+ * @returns {Promise<void>} A promise that resolves when the URL has been copied to the clipboard.
998
+ */
999
+ TeamsHelperService.prototype._copyLink = async function (oParams) {
1000
+ let sUnfurlingUrl = oParams?.url || window.location.href;
1001
+ try {
1002
+ sUnfurlingUrl = await this._getUnfurlingUrl(oParams);
1003
+ } catch (error) {
1004
+ oLogger.error("getUnfurlingUrl failed: " + error.message);
1005
+ }
1006
+
1007
+ this._copyCardUrlToClipboard(sUnfurlingUrl);
1008
+ };
1009
+
1010
+ /**
1011
+ * Copies a given URL string into the clipboard.
1012
+ * @param {string} sUrl - The URL to copy into the clipboard.
1013
+ * @returns {Promise<void>} A promise that resolves when the URL has been copied to the clipboard.
1014
+ */
1015
+ TeamsHelperService.prototype._copyCardUrlToClipboard = async function(sUrl) {
1016
+ try {
1017
+ if (typeof window.navigator !== "undefined" &&
1018
+ window.navigator.clipboard &&
1019
+ typeof window.navigator.clipboard.writeText === "function") {
1020
+ try {
1021
+ await window.navigator.clipboard.writeText(sUrl);
1022
+ oLogger.info("Card URL copied to clipboard successfully.");
1023
+ sap.m.MessageToast.show(oResourceBundle.getText("COLLABORATION_POPOVER_MSGSTRIP_SUCCESS"));
1024
+ } catch (e) {
1025
+ oLogger.error("Clipboard write failed: " + e.message);
1026
+ }
1027
+ } else {
1028
+ oLogger.error("Clipboard API is not available.");
1029
+ }
1030
+
1031
+ } catch (err) {
1032
+ oLogger.error("Failed to generate or copy Card URL", err);
1033
+ }
1034
+ };
1035
+
1036
+ /**
1037
+ * Gets the unfurling URL for a card.
1038
+ * If cardId and cardManifest are provided, saves the card data and shows a busy dialog.
1039
+ * Otherwise, returns a base unfurling URL.
1040
+ * @param {Object} oParams - Parameters for the card.
1041
+ * @param {string} [oParams.url] - Base URL for the card.
1042
+ * @param {string} [oParams.cardId] - The card ID.
1043
+ * @param {Object} [oParams.cardManifest] - The card manifest definition.
1044
+ * @returns {Promise<string>} The unfurling URL.
1045
+ */
1046
+ TeamsHelperService.prototype._getUnfurlingUrl = async function(oParams) {
1047
+ if (!oParams?.cardId || !oParams.cardId.length || !oParams.cardManifest || !this.isFeatureFlagEnabled()) {
1048
+ // Base Card to unfurl
1049
+ return this._generateUnfurlingUrl(oParams, {});
1050
+ }
1051
+
1052
+ let sUnfurlingUrl = "";
1053
+ let oCardData = {};
1054
+ try {
1055
+ // Card Id and Card Manifest Passed. It will show busy helper and store card into DB.
1056
+ try {
1057
+ const oDialog = await Fragment.load({
1058
+ name: "sap.suite.ui.commons.collaboration.CollaborationBusyDialog",
1059
+ controller: this,
1060
+ type: "XML"
1061
+ });
1062
+ oBusyDialog = oDialog;
1063
+ oBusyDialog.open();
1064
+
1065
+ // Automatically close the dialog after a fixed time
1066
+ iBusyDialogTimeoutId = setTimeout(() => {
1067
+ oBusyDialog.close();
1068
+ oBusyDialog.destroy();
1069
+ }, AUTO_CLOSE_BUSY_DIALOG_TIME);
1070
+ } catch (err) {
1071
+ oLogger.error("Fragment load failed: " + err.message);
1072
+ }
1073
+
1074
+ oCardData = await this._buildCardInfo(oParams);
1075
+ } catch (err) {
1076
+ oLogger.error("buildCardInfo failed: " + err.message);
1077
+ } finally {
1078
+ if (oCardData && Object.keys(oCardData).length === 0) {
1079
+ oLogger.warn("Card info could not be saved.");
1080
+ }
1081
+
1082
+ // Auth/Base card to unfurl
1083
+ sUnfurlingUrl = this._generateUnfurlingUrl(oParams, oCardData);
1084
+ this._closeBusyDialog();
1085
+ }
1086
+
1087
+ return sUnfurlingUrl;
1088
+ };
1089
+
1090
+ /**
1091
+ * Generates a URL for unfurling a card in Microsoft Teams.
1092
+ * Handles minification, share-as-tab logic, and adds navigation modes.
1093
+ * @param {Object} oParams - Parameters for the card.
1094
+ * @param {Object} oCardData - The card data (id, version, etc.).
1095
+ * @returns {Promise<string>} The generated unfurling URL.
1096
+ */
1097
+ TeamsHelperService.prototype._generateUnfurlingUrl = async function(oParams, oCardData) {
1098
+ let sModifiedUrl = oParams?.url || window.location.href;
1099
+ try {
1100
+ if (oParams?.minifyUrlForChat) {
1101
+ sModifiedUrl = await this._getModifiedUrlForSharing(oParams);
1102
+ } else if (oTeamsParams.isShareAsTabEnabled && this._providerConfig.isShareAsTabEnabled) {
1103
+ const sUrlForTab = await this._modifyUrlForShareAsTab(sModifiedUrl, "MST:C");
1104
+ sModifiedUrl = await this._addNavmodeInUrl(sUrlForTab, 'inplace');
1105
+ }
1106
+ } catch (error) {
1107
+ oLogger.error("Error while modifying URL for sharing: " + error.message);
1108
+ }
1109
+ return this._getCardInfoUrl(sModifiedUrl, oParams, oCardData);
1110
+ };
1111
+
963
1112
  return TeamsHelperService;
964
1113
  });
@@ -0,0 +1,366 @@
1
+ /*!
2
+ *
3
+ SAP UI development toolkit for HTML5 (SAPUI5)
4
+ (c) Copyright 2009-2015 SAP SE. All rights reserved
5
+
6
+ */
7
+ sap.ui.define([
8
+ "sap/base/Log",
9
+ "sap/ui/Device",
10
+ "sap/ui/core/Lib",
11
+ "sap/m/Menu",
12
+ "sap/m/MenuItem",
13
+ "sap/ui/performance/trace/FESRHelper"
14
+ ], function (Log, Device, Library, Menu, MenuItem, FESRHelper) {
15
+ "use strict";
16
+
17
+ const COLLABORATION_MAIL = "COLLABORATION_POPOVER_MAIL";
18
+ const COLLABORATION_SHARE = "COLLABORATION_MSTEAMS_SHARE";
19
+ const COLLABORATION_CHAT = "COLLABORATION_POPOVER_CHAT";
20
+ const COLLABORATION_TAB = "COLLABORATION_POPOVER_TAB";
21
+ const COLLABORATION_MANAGER = "COLLABORATION_POPOVER_MANAGER";
22
+ const COLLABORATION_COPYURL = "COLLABORATION_POPOVER_COPYURL_BUTTON";
23
+
24
+ var UniversalCollaborationBar = Menu.extend("sap.suite.ui.commons.collaboration.UniversalCollaborationBar", {
25
+ metadata: {
26
+ properties: {
27
+ shareToEmailEnabled: { type: "boolean", defaultValue: true },
28
+ shareAsChatEnabled: { type: "boolean", defaultValue: false },
29
+ shareAsTabEnabled: { type: "boolean", defaultValue: false },
30
+ shareToCollaborationManagerEnabled: { type: "boolean", defaultValue: false },
31
+ copyLinkEnabled: { type: "boolean", defaultValue: true }
32
+ },
33
+ events: {
34
+ "shareToChatSelected": {},
35
+ "shareToTabSelected": {},
36
+ "copyLinkSelected": {},
37
+ "shareToEmailSelected": {},
38
+ "shareToCollaborationManagerSelected": {}
39
+ }
40
+ },
41
+
42
+ init: function() {
43
+ sap.m.Menu.prototype.init.apply(this, arguments);
44
+ this._mActionHandlers = {
45
+ [COLLABORATION_MAIL]: (...args) => {
46
+ if (this.hasListeners("shareToEmailSelected")) {
47
+ this.fireShareToEmailSelected({ args });
48
+ } else {
49
+ this._shareToEmail(...args);
50
+ }
51
+ },
52
+ [COLLABORATION_CHAT]: () => this.fireShareToChatSelected(),
53
+ [COLLABORATION_TAB]: () => this.fireShareToTabSelected(),
54
+ [COLLABORATION_MANAGER]: () => this.fireShareToCollaborationManagerSelected(),
55
+ [COLLABORATION_COPYURL]: (...args) => {
56
+ if (this.hasListeners("copyLinkSelected")) {
57
+ this.fireCopyLinkSelected({ args });
58
+ } else {
59
+ this._toCopyUrl(...args);
60
+ }
61
+ }
62
+ };
63
+
64
+ this._oLogger = Log.getLogger("sap.suite.ui.commons.collaboration.UniversalCollaborationBar");
65
+ this._oResourceBundle = Library.getResourceBundleFor("sap.suite.ui.commons");
66
+ this.addStyleClass("sapSuiteCollaborationBarMenu");
67
+ },
68
+
69
+ /**
70
+ * Opens the menu.
71
+ * @returns {sap.m.Menu} The menu instance.
72
+ */
73
+ openBy: function() {
74
+ if (!this.getItems().length) {
75
+ this._renderMenuItems();
76
+ }
77
+ return sap.m.Menu.prototype.openBy.apply(this, arguments);
78
+ },
79
+
80
+ /**
81
+ * Renders the menu items for the collaboration popover.
82
+ * @private
83
+ */
84
+ _renderMenuItems: async function() {
85
+ const aMenuItemOptions = await this._getCollaborationPopoverOptions();
86
+ const aMenuItems = this._getMenuItems(aMenuItemOptions);
87
+ aMenuItems.forEach((oItem) => this.addItem(oItem));
88
+ },
89
+
90
+ /**
91
+ * Gets the TeamsHelperService instance.
92
+ * @returns {Promise} A promise that resolves with the TeamsHelperService instance.
93
+ * @private
94
+ */
95
+ _getTeamsHelperService: async function() {
96
+ if (!this._oTeamsHelperService) {
97
+ const ServiceContainer = sap.ui.require("sap/suite/ui/commons/collaboration/ServiceContainer");
98
+ this._oTeamsHelperService = await ServiceContainer.getServiceAsync();
99
+ }
100
+ return this._oTeamsHelperService;
101
+ },
102
+
103
+ /**
104
+ * Gets the menu items based on the provided options.
105
+ * @param {Array} aOptions - The array of option objects.
106
+ * @returns {Array} The array of created menu items.
107
+ * @private
108
+ */
109
+ _getMenuItems: function (aOptions) {
110
+ const aMenuItems = [];
111
+ aOptions.forEach((oOption) => {
112
+ const oMenuItem = this._createMenuItem(oOption.icon, oOption.text, oOption.key, oOption.fesrStepName, oOption.styleClass);
113
+ (oOption.subOptions || []).forEach((oSubOption) => {
114
+ const subMenuItem = this._createMenuItem(oSubOption.icon, oSubOption.text, oSubOption.key, oSubOption.fesrStepName, oSubOption.styleClass);
115
+ oMenuItem.addItem(subMenuItem);
116
+ });
117
+ aMenuItems.push(oMenuItem);
118
+ });
119
+ return aMenuItems;
120
+ },
121
+
122
+ /**
123
+ * Creates a menu item based on the provided parameters.
124
+ *
125
+ * @param {string} sIcon - The icon for the menu item.
126
+ * @param {string} sText - The text for the menu item.
127
+ * @param {string} sKey - The key for the menu item.
128
+ * @param {string} [sFesrStepName] - The FESR step name for the menu item (optional).
129
+ * @param {string} [sStyleClass] - Additional style class for the menu item (optional).
130
+ * @returns {sap.m.MenuItem} The created sap.m.MenuItem object.
131
+ * @private
132
+ */
133
+ _createMenuItem: function(sIcon, sText, sKey, sFesrStepName, sStyleClass) {
134
+ const oConfig = {
135
+ icon: sIcon,
136
+ text: sText,
137
+ key: sKey
138
+ };
139
+ const oMenuItem = new MenuItem(oConfig);
140
+
141
+ oMenuItem.attachPress(() => {
142
+ const fnHandler = this._mActionHandlers[sKey];
143
+ if (fnHandler) {
144
+ fnHandler();
145
+ }
146
+ });
147
+
148
+ if (sFesrStepName) {
149
+ FESRHelper.setSemanticStepname(oMenuItem, "press", sFesrStepName);
150
+ }
151
+
152
+ oMenuItem.addEventDelegate({
153
+ onAfterRendering: () => {
154
+ const oDomRef = oMenuItem.getDomRef();
155
+ if (oDomRef && sStyleClass) {
156
+ oDomRef.classList.add(sStyleClass);
157
+ }
158
+ }
159
+ });
160
+
161
+ return oMenuItem;
162
+ },
163
+
164
+ /**
165
+ * Creates a standardized option object for the collaboration popover menu.
166
+ *
167
+ * @param {string} i18nKey - The i18n key used to fetch the localized text and as the option key.
168
+ * @param {string} iconUri - The SAP icon URI for the option (e.g., "sap-icon://email").
169
+ * @param {string} cssClass - CSS class applied to the option for styling.
170
+ * @param {Object} [options] - Additional optional properties.
171
+ * @param {string} [options.fesrStepName] - The FESR step name for tracking user interactions.
172
+ * @param {Array} [options.subOptions] - Array of sub-options for nested menu items.
173
+ *
174
+ * @returns {Object} The constructed option object to be used in the collaboration popover menu.
175
+ *
176
+ * @private
177
+ */
178
+ _createOption: function(i18nKey, iconUri, cssClass, { fesrStepName = "", subOptions = [] } = {}) {
179
+ const oOption = {
180
+ text: this._oResourceBundle.getText(i18nKey),
181
+ icon: iconUri,
182
+ key: i18nKey,
183
+ styleClass: cssClass
184
+ };
185
+
186
+ if (fesrStepName) {
187
+ oOption.fesrStepName = fesrStepName;
188
+ }
189
+
190
+ if (subOptions.length > 0) {
191
+ oOption.subOptions = subOptions;
192
+ }
193
+
194
+ return oOption;
195
+ },
196
+
197
+ /**
198
+ * Build collaboration popover options based on consumer settings,
199
+ * tenant configuration and current device type.
200
+ *
201
+ * @returns {Array} Array of option objects used to render the collaboration popover menu.
202
+ * @private
203
+ */
204
+ _getCollaborationPopoverOptions: async function() {
205
+ const oAppCollaborationParams = {
206
+ isShareAsChatEnabled: this.getShareAsChatEnabled(),
207
+ isShareAsTabEnabled: this.getShareAsTabEnabled(),
208
+ isCopyLinkEnabled: this.getCopyLinkEnabled(),
209
+ isShareToEmailEnabled: this.getShareToEmailEnabled(),
210
+ isShareToCMEnabled: this.getShareToCollaborationManagerEnabled()
211
+ };
212
+
213
+ let oProviderConfig = {};
214
+ try {
215
+ const oTeamHelperServ = await this._getTeamsHelperService();
216
+ oProviderConfig = oTeamHelperServ._providerConfig;
217
+ } catch (error) {
218
+ this._oLogger.error("Error fetching TeamsHelperService:", error);
219
+ }
220
+
221
+ const aOptions = [];
222
+ let aMSTeamsOptions = [];
223
+
224
+ // configuration array
225
+ const aConfig = [
226
+ {
227
+ key: COLLABORATION_MAIL,
228
+ icon: "sap-icon://email",
229
+ styleClass: "sapSuiteUiCommonsCollaborationMail",
230
+ consumerEnabled: oAppCollaborationParams.isShareToEmailEnabled,
231
+ providerEnabled: true,
232
+ fesrStep: "",
233
+ featureName: "Email",
234
+ group: "menu"
235
+ },
236
+ {
237
+ key: COLLABORATION_CHAT,
238
+ icon: "sap-icon://discussion",
239
+ styleClass: "sapSuiteUiCommonsCollaborationChat",
240
+ consumerEnabled: oAppCollaborationParams.isShareAsChatEnabled,
241
+ providerEnabled: oProviderConfig.isShareAsLinkEnabled === "X",
242
+ fesrStep: "MST:ShareAsLink",
243
+ featureName: "Share as Chat",
244
+ desktopOnly: true,
245
+ group: "subMenu"
246
+ },
247
+ {
248
+ key: COLLABORATION_TAB,
249
+ icon: "sap-icon://image-viewer",
250
+ styleClass: "sapSuiteUiCommonsCollaborationTab",
251
+ consumerEnabled: oAppCollaborationParams.isShareAsTabEnabled,
252
+ providerEnabled: oProviderConfig.isShareAsTabEnabled === "X",
253
+ fesrStep: "MST:ShareAsTab",
254
+ featureName: "Share as Tab",
255
+ desktopOnly: true,
256
+ group: "subMenu"
257
+ },
258
+ {
259
+ key: COLLABORATION_SHARE,
260
+ icon: "sap-icon://citizen-connect",
261
+ styleClass: "sapSuiteUiCommonsCollaborationMSTeamsShare",
262
+ consumerEnabled: true,
263
+ providerEnabled: true,
264
+ isParentOfGroup: "subMenu",
265
+ group: "menu"
266
+ },
267
+ {
268
+ key: COLLABORATION_MANAGER,
269
+ icon: "sap-icon://collaborate",
270
+ styleClass: "sapSuiteUiCommonsCollaborationManager",
271
+ consumerEnabled: oAppCollaborationParams.isShareToCMEnabled,
272
+ providerEnabled: true,
273
+ fesrStep: "",
274
+ featureName: "Collaboration Manager",
275
+ group: "menu"
276
+ },
277
+ {
278
+ key: COLLABORATION_COPYURL,
279
+ icon: "sap-icon://chain-link",
280
+ styleClass: "sapSuiteUiCommonsCollaborationLink",
281
+ consumerEnabled: oAppCollaborationParams.isCopyLinkEnabled,
282
+ providerEnabled: true,
283
+ fesrStep: "",
284
+ featureName: "Copy link",
285
+ desktopOnly: true,
286
+ group: "menu"
287
+ }
288
+ ];
289
+
290
+ aConfig.forEach((conf) => {
291
+ if (conf.group === "subMenu") {
292
+ const option = this._createOptionIfEnabled(conf);
293
+ if (option) {
294
+ aMSTeamsOptions.push(option);
295
+ }
296
+ return;
297
+ }
298
+
299
+ if (conf.isParentOfGroup === "subMenu") {
300
+ if (aMSTeamsOptions.length > 0) {
301
+ conf.subOptions = aMSTeamsOptions;
302
+ aMSTeamsOptions = [];
303
+ }
304
+ }
305
+
306
+ const option = this._createOptionIfEnabled(conf);
307
+ if (option) {
308
+ aOptions.push(option);
309
+ }
310
+ });
311
+
312
+ return aOptions;
313
+ },
314
+
315
+ /**
316
+ * Create an option if it is enabled based on the configuration.
317
+ * @param {Object} conf - The configuration object for the option.
318
+ * @returns {Object|null} The created option or null if not enabled.
319
+ * @private
320
+ */
321
+ _createOptionIfEnabled: function(conf) {
322
+ if (conf.desktopOnly && !Device.system.desktop) {
323
+ this._oLogger.info(`${conf.featureName} option is not supported in Phone and Tablet`);
324
+ return null;
325
+ }
326
+
327
+ if (!conf.consumerEnabled) {
328
+ this._oLogger.info(`Consumer disabled ${conf.featureName} option`);
329
+ return null;
330
+ }
331
+
332
+ if (!conf.providerEnabled) {
333
+ this._oLogger.info(`${conf.featureName} option is not enabled in the tenant`);
334
+ return null;
335
+ }
336
+
337
+ return this._createOption(
338
+ conf.key,
339
+ conf.icon,
340
+ conf.styleClass,
341
+ { fesrStepName: conf.fesrStep, subOptions: conf.subOptions }
342
+ );
343
+ },
344
+
345
+ /**
346
+ * Share content via email.
347
+ * @private
348
+ */
349
+ _shareToEmail: async function() {
350
+ const oTeamsHelperService = await this._getTeamsHelperService();
351
+ oTeamsHelperService._shareToEmail();
352
+ },
353
+
354
+
355
+ /**
356
+ * Copy the current URL to the clipboard.
357
+ * @private
358
+ */
359
+ _toCopyUrl: async function() {
360
+ const oTeamsHelperService = await this._getTeamsHelperService();
361
+ oTeamsHelperService._copyLink();
362
+ }
363
+ });
364
+
365
+ return UniversalCollaborationBar;
366
+ });