@sapui5/sap.suite.ui.commons 1.108.0 → 1.108.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/suite/ui/commons/.library +1 -1
- package/src/sap/suite/ui/commons/AriaProperties.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilder.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderFunction.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderGroup.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderItem.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderValidationResult.js +1 -1
- package/src/sap/suite/ui/commons/CalculationBuilderVariable.js +1 -1
- package/src/sap/suite/ui/commons/CloudFilePicker.js +19 -14
- package/src/sap/suite/ui/commons/MicroProcessFlow.js +1 -1
- package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +1 -1
- package/src/sap/suite/ui/commons/Timeline.js +1 -1
- package/src/sap/suite/ui/commons/collaboration/CollaborationHelper.js +260 -0
- package/src/sap/suite/ui/commons/collaboration/ServiceContainer.js +12 -9
- package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +62 -18
- package/src/sap/suite/ui/commons/flexibility/changeHandler/PropertyChangeMapper.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropCustomShapeHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropEllipseHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CropRectangleHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/CustomSizeItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/FilterHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/FlipHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/HistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditor.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorContainer.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ImageEditorResponsiveContainer.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/ResizeHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/imageeditor/RotateHistoryItem.js +1 -1
- package/src/sap/suite/ui/commons/library.js +1 -1
- package/src/sap/suite/ui/commons/messagebundle_ar.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_bg.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_ca.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_cs.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_cy.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_da.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_de.properties +3 -3
- package/src/sap/suite/ui/commons/messagebundle_el.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_en.properties +2 -2
- package/src/sap/suite/ui/commons/messagebundle_es.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_es_MX.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_et.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_fi.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_fr.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_fr_CA.properties +5 -5
- package/src/sap/suite/ui/commons/messagebundle_hi.properties +5 -5
- package/src/sap/suite/ui/commons/messagebundle_hr.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_hu.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_id.properties +5 -5
- package/src/sap/suite/ui/commons/messagebundle_it.properties +3 -3
- package/src/sap/suite/ui/commons/messagebundle_iw.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_ja.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_kk.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_ko.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_lt.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_lv.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_ms.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_nl.properties +3 -3
- package/src/sap/suite/ui/commons/messagebundle_no.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_pl.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_pt.properties +5 -5
- package/src/sap/suite/ui/commons/messagebundle_pt_PT.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_ro.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_ru.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_sh.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_sl.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_sv.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_th.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_tr.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_uk.properties +5 -5
- package/src/sap/suite/ui/commons/messagebundle_vi.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_zh_CN.properties +4 -4
- package/src/sap/suite/ui/commons/messagebundle_zh_TW.properties +5 -5
- package/src/sap/suite/ui/commons/mockserver/mockServer.js +121 -0
- package/src/sap/suite/ui/commons/statusindicator/Circle.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/CustomShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/DiscreteThreshold.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/FillingOption.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/LibraryShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Path.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/PropertyThreshold.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Rectangle.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/Shape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/ShapeGroup.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/SimpleShape.js +1 -1
- package/src/sap/suite/ui/commons/statusindicator/StatusIndicator.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccount.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountGroup.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountItem.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountItemProperty.js +1 -1
- package/src/sap/suite/ui/commons/taccount/TAccountPanel.js +1 -1
- package/src/sap/suite/ui/commons/collaboration/URLMinifier.js +0 -190
package/package.json
CHANGED
|
@@ -113,7 +113,7 @@ sap.ui.define([
|
|
|
113
113
|
* @class
|
|
114
114
|
* @public
|
|
115
115
|
* @internal
|
|
116
|
-
* @version 1.108.
|
|
116
|
+
* @version 1.108.2
|
|
117
117
|
*/
|
|
118
118
|
var CloudFilePicker = Dialog.extend("sap.suite.ui.commons.CloudFilePicker", {
|
|
119
119
|
metadata: {
|
|
@@ -371,7 +371,10 @@ sap.ui.define([
|
|
|
371
371
|
id: this.getId() + "-fileName",
|
|
372
372
|
liveChange: function (oControlEvent) {
|
|
373
373
|
oTableControl.removeSelections();
|
|
374
|
-
|
|
374
|
+
var oSelectedFolderInfo = oNavigationMap.get(
|
|
375
|
+
aVisibleLinks[aVisibleLinks.length - 1].fileShareItemId
|
|
376
|
+
);
|
|
377
|
+
this._setConfirmationButtonEnabled(null, oSelectedFolderInfo, true);
|
|
375
378
|
}.bind(this)
|
|
376
379
|
});
|
|
377
380
|
oSimpleForm.addContent(oLabel);
|
|
@@ -650,17 +653,18 @@ sap.ui.define([
|
|
|
650
653
|
placeholder: "Enter Folder Name",
|
|
651
654
|
width: "100%",
|
|
652
655
|
visible: true,
|
|
653
|
-
|
|
654
|
-
if (this._checkForDuplicateInTable(oTableControl, oEvent.getParameter("value").toLowerCase())) {
|
|
655
|
-
oEvent.getSource().setValueState(ValueState.Error);
|
|
656
|
-
oEvent.getSource().setValueStateText(oResourceBundle.getText("CFP_FOLDER_EXIST"));
|
|
657
|
-
} else {
|
|
658
|
-
oEvent.getSource().setValueState(ValueState.None);
|
|
659
|
-
oEvent.getSource().setValueStateText("");
|
|
660
|
-
this._makeNewFolderEntry(oEvent.getParameter("value"));
|
|
661
|
-
}
|
|
662
|
-
}.bind(this)
|
|
656
|
+
value: oResourceBundle.getText("CFP_TITLE_NEWFOLDER")
|
|
663
657
|
});
|
|
658
|
+
oNewFolderInput.attachBrowserEvent("focusout", function(oEvent) {
|
|
659
|
+
if (this._checkForDuplicateInTable(oTableControl, oEvent.target.value.toLowerCase())) {
|
|
660
|
+
oNewFolderInput.setValueState(ValueState.Error);
|
|
661
|
+
oNewFolderInput.setValueStateText(oResourceBundle.getText("CFP_FOLDER_EXIST"));
|
|
662
|
+
} else {
|
|
663
|
+
oNewFolderInput.setValueState(ValueState.None);
|
|
664
|
+
oNewFolderInput.setValueStateText("");
|
|
665
|
+
this._makeNewFolderEntry(oEvent.target.value);
|
|
666
|
+
}
|
|
667
|
+
}.bind(this));
|
|
664
668
|
oNewFolderColumnListItem = new ColumnListItem({
|
|
665
669
|
cells: [
|
|
666
670
|
new HBox({
|
|
@@ -868,6 +872,7 @@ sap.ui.define([
|
|
|
868
872
|
} else {
|
|
869
873
|
oBreadcrumbLinkControl.destroyLinks();
|
|
870
874
|
this._initializeVisibleLinks();
|
|
875
|
+
this._enableDisableNewFolderBtn();
|
|
871
876
|
}
|
|
872
877
|
this._setConfirmationButtonEnabled(false);
|
|
873
878
|
};
|
|
@@ -935,9 +940,9 @@ sap.ui.define([
|
|
|
935
940
|
} else {
|
|
936
941
|
oConfirmationButton.setEnabled(true);
|
|
937
942
|
}
|
|
938
|
-
} else if (bFileNameEdit
|
|
943
|
+
} else if (bFileNameEdit) {
|
|
939
944
|
if (this.getFileNameMandatory()) {
|
|
940
|
-
oConfirmationButton.setEnabled(bIsFileNameExist);
|
|
945
|
+
oConfirmationButton.setEnabled((oSelectedFolderInfo && oSelectedFolderInfo.getIsDocumentCreationAllowed()) ? bIsFileNameExist : false);
|
|
941
946
|
}
|
|
942
947
|
} else {
|
|
943
948
|
oConfirmationButton.setEnabled(bEnabled ? bEnabled : false);
|
|
@@ -1152,7 +1152,7 @@ sap.ui.define([
|
|
|
1152
1152
|
aCurrentFilters = [];
|
|
1153
1153
|
if (oBinding) {
|
|
1154
1154
|
if (!bResetAll) {
|
|
1155
|
-
aFilters = this.aPrevFilters || [];
|
|
1155
|
+
aFilters = oBinding.aFilters.length != 0 ? oBinding.aFilters : this.aPrevFilters || [];
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
1158
|
if (this._dataFilter) {
|
|
@@ -0,0 +1,260 @@
|
|
|
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", "sap/ui/core/routing/HashChanger", "sap/ui/base/Object"],
|
|
9
|
+
function (Log, HashChanger, BaseObject) {
|
|
10
|
+
"use strict";
|
|
11
|
+
var URL_KEY = "sap-url-hash";
|
|
12
|
+
var TRANSIENT_KEY = "transient";
|
|
13
|
+
var oLogger = Log.getLogger("sap.suite.ui.commons.collaboration.CollaborationHelper");
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* CollaborationHelper for collaboration-related functionalities
|
|
17
|
+
* @namespace
|
|
18
|
+
* @since 1.108
|
|
19
|
+
* @alias module:sap/suite/ui/commons/collaboration/CollaborationHelper
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
var CollaborationHelper = BaseObject.extend(
|
|
23
|
+
"sap.suite.ui.commons.collaboration.CollaborationHelper"
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This function creates a shortened URL.
|
|
28
|
+
* @param {string} sUrl Full URL
|
|
29
|
+
* @returns {string} This function returns a shortened URL in the format
|
|
30
|
+
* `<protocol>/<hostname>#<semantic-object>&/sap-url-hash=<UUID>`
|
|
31
|
+
* @private
|
|
32
|
+
* @ui5-restricted sap.suite.suite-ui-commons
|
|
33
|
+
* @experimental since 1.108
|
|
34
|
+
*/
|
|
35
|
+
CollaborationHelper.compactHash = function (sUrl) {
|
|
36
|
+
var oShellContainer = sap.ushell && sap.ushell.Container;
|
|
37
|
+
if (!oShellContainer) {
|
|
38
|
+
//In case uShell Container is not present, minification is not needed.
|
|
39
|
+
return {
|
|
40
|
+
url: sUrl
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return oShellContainer.getServiceAsync("AppState").then(
|
|
44
|
+
function (oAppStateService) {
|
|
45
|
+
var oEmptyAppState = oAppStateService.createEmptyAppState(
|
|
46
|
+
undefined,
|
|
47
|
+
false
|
|
48
|
+
);
|
|
49
|
+
var sKey = this._getNextKey(oEmptyAppState);
|
|
50
|
+
if (!this._isEligibleForBackendPersistency(oAppStateService)) {
|
|
51
|
+
oLogger.warning("Transient flag is true. URL will not be shortened");
|
|
52
|
+
return {
|
|
53
|
+
url: sUrl
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var sUrlBeforeHash = this._extractURLBeforeHash(sUrl);
|
|
57
|
+
var sSemanticObjectAndAction = this._extractSemanticObjectAndAction(sUrl);
|
|
58
|
+
if (!sSemanticObjectAndAction) {
|
|
59
|
+
// In case sSemanticObjectAndAction is undefined, let's not minify the url.
|
|
60
|
+
return {
|
|
61
|
+
url: sUrl
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return this._storeUrl(sUrl, oEmptyAppState)
|
|
65
|
+
.then(function () {
|
|
66
|
+
return {
|
|
67
|
+
url: sUrlBeforeHash + "#" + sSemanticObjectAndAction + "&/" + URL_KEY + "=" + sKey
|
|
68
|
+
};
|
|
69
|
+
})
|
|
70
|
+
.catch(function (error) {
|
|
71
|
+
oLogger.warning("URL is not shortened due to an error." + error.toString());
|
|
72
|
+
//In case if the wrapper promise is rejected then return the current url as shortened url.
|
|
73
|
+
return {
|
|
74
|
+
url: sUrl
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}.bind(this)
|
|
78
|
+
);
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Function that returns a Promise that resolves to the current URL.
|
|
83
|
+
* @returns {Promise} Promise which resolves to the current URL
|
|
84
|
+
* @private
|
|
85
|
+
*/
|
|
86
|
+
CollaborationHelper._getCurrentUrl = function () {
|
|
87
|
+
var oUShellContainer = sap.ushell && sap.ushell.Container;
|
|
88
|
+
return oUShellContainer ? new Promise(function (fnResolve) {
|
|
89
|
+
oUShellContainer.getFLPUrlAsync(true).done(function (sFLPUrl) {
|
|
90
|
+
fnResolve(sFLPUrl);
|
|
91
|
+
});
|
|
92
|
+
}) : Promise.resolve(document.URL);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Method that checks whether the application is running in the Microsoft Teams environment. If yes, the
|
|
97
|
+
* method disables the Avatar icon on the shell. This is done synchronously. The Method returns
|
|
98
|
+
* a promise. The promise is resolved immediately if the URL is not compact. In case of a compact hash,
|
|
99
|
+
* the method retrieves the original or complete hash and replaces it in the window. The method then resolves the promise.
|
|
100
|
+
* @return {Promise} Return the resolved promise when the redirection of the URL is done.
|
|
101
|
+
* @public
|
|
102
|
+
*/
|
|
103
|
+
CollaborationHelper.processAndExpandHash = function () {
|
|
104
|
+
this._hideAvatarFromShellbar();
|
|
105
|
+
return this._getCurrentUrl().then(function (sCurrentUrl) {
|
|
106
|
+
//if the current url has url param, sap-url-hash, then we have to redirect to an actual url.
|
|
107
|
+
if (sCurrentUrl.indexOf(URL_KEY) > -1) {
|
|
108
|
+
var sHash = sCurrentUrl.split('#')[1].split('=')[1];
|
|
109
|
+
return this._retrieveURL(sHash).then(function (oAppState) {
|
|
110
|
+
window.location.replace(oAppState.getData());
|
|
111
|
+
return Promise.resolve();
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return Promise.resolve();
|
|
115
|
+
}.bind(this));
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Hides the avatar of the user if the app is running in the Microsoft Teams application.
|
|
120
|
+
* @private
|
|
121
|
+
* @ui5-restricted sap.suite.suite-ui-commons
|
|
122
|
+
* @experimental since 1.108
|
|
123
|
+
*/
|
|
124
|
+
CollaborationHelper._hideAvatarFromShellbar = function () {
|
|
125
|
+
this.isTeamsModeActive().then(function (bIsActive) {
|
|
126
|
+
if (bIsActive) {
|
|
127
|
+
var oAvatar = sap.ui.getCore().byId('meAreaHeaderButton');
|
|
128
|
+
if (oAvatar) {
|
|
129
|
+
oAvatar.setVisible(false);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Determines whether the app is running in the Microsoft Teams application.
|
|
137
|
+
* If the URL parameter "sap-collaboration-teams" is set to true and if the appState is set to lean,
|
|
138
|
+
* the method ensures that the application runs in the Microsoft Teams environment
|
|
139
|
+
* @returns {Promise} Return the resolved promise with the data if the conditions are met with 'true', else 'false'
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
CollaborationHelper.isTeamsModeActive = function () {
|
|
143
|
+
var bAppRunningInTeams = false;
|
|
144
|
+
var oUshellContainer = sap.ushell && sap.ushell.Container;
|
|
145
|
+
var oURLParsing = oUshellContainer && oUshellContainer.getService("URLParsing");
|
|
146
|
+
return this._getCurrentUrl().then(function (sCurrentUrl) {
|
|
147
|
+
var sBeforeHashURL = sCurrentUrl.split("#")[0];
|
|
148
|
+
if (sBeforeHashURL.indexOf('?') !== -1) {
|
|
149
|
+
var oParsedUrl = oURLParsing && oURLParsing.parseParameters(sBeforeHashURL.substring(sBeforeHashURL.indexOf('?')));
|
|
150
|
+
if (oParsedUrl &&
|
|
151
|
+
oParsedUrl["sap-collaboration-teams"] &&
|
|
152
|
+
oParsedUrl["sap-collaboration-teams"][0] &&
|
|
153
|
+
oParsedUrl["sap-collaboration-teams"][0] === "true") {
|
|
154
|
+
bAppRunningInTeams = true;
|
|
155
|
+
}
|
|
156
|
+
var bAppStateLean = false;
|
|
157
|
+
if (oParsedUrl &&
|
|
158
|
+
oParsedUrl["appState"] &&
|
|
159
|
+
oParsedUrl["appState"][0] &&
|
|
160
|
+
oParsedUrl["appState"][0] === "lean") {
|
|
161
|
+
bAppStateLean = true;
|
|
162
|
+
}
|
|
163
|
+
return Promise.resolve(bAppRunningInTeams && bAppStateLean);
|
|
164
|
+
} else {
|
|
165
|
+
return Promise.resolve(false);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* This function retrieves the URL stored against the hash in the key/value persistent store.
|
|
172
|
+
* @param {string} The hash from the URL
|
|
173
|
+
* @returns {AppState} The instance of the AppState
|
|
174
|
+
* @private
|
|
175
|
+
*/
|
|
176
|
+
CollaborationHelper._retrieveURL = function (hash) {
|
|
177
|
+
if (sap.ushell && sap.ushell.Container) {
|
|
178
|
+
return sap.ushell.Container.getServiceAsync("AppState").then(function (oAppStateService) {
|
|
179
|
+
return oAppStateService.getAppState(hash);
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* This function checks the transient flag in the _oConfig object.
|
|
186
|
+
* @param {AppState} appStateInstance Instance of the AppState
|
|
187
|
+
* @returns {boolean} 'True' if the transient flag is set to 'false'
|
|
188
|
+
* @private
|
|
189
|
+
*/
|
|
190
|
+
CollaborationHelper._isEligibleForBackendPersistency = function (appStateInstance) {
|
|
191
|
+
return appStateInstance && appStateInstance._oConfig && TRANSIENT_KEY in appStateInstance._oConfig && !appStateInstance._oConfig[TRANSIENT_KEY];
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* This function generates an alphanumeric UUID string.
|
|
196
|
+
* @param {AppState} oAppStateService Instance of the AppState
|
|
197
|
+
* @returns {string} Returns a randomly generated UUID string.
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
200
|
+
CollaborationHelper._getNextKey = function (oAppStateService) {
|
|
201
|
+
return oAppStateService.getKey();
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* This functions parses a URL and extracts the semantic-object, the action and the context-raw if applicable.
|
|
206
|
+
* @param {string} sUrl Full URL
|
|
207
|
+
* @returns {string} Returns a string in the format <semantic-object>-<action>~<contextRaw>.
|
|
208
|
+
* @private
|
|
209
|
+
*/
|
|
210
|
+
CollaborationHelper._extractSemanticObjectAndAction = function (sUrl) {
|
|
211
|
+
var URLParser = sap.ushell && sap.ushell.services && new sap.ushell.services.URLParsing();
|
|
212
|
+
if (URLParser) {
|
|
213
|
+
var parsedShellHash = URLParser.parseShellHash(this._extractURLHash(sUrl));
|
|
214
|
+
if (parsedShellHash) {
|
|
215
|
+
return parsedShellHash.contextRaw ?
|
|
216
|
+
parsedShellHash.semanticObject + "-" +
|
|
217
|
+
parsedShellHash.action + "~" +
|
|
218
|
+
parsedShellHash.contextRaw :
|
|
219
|
+
parsedShellHash.semanticObject + "-" + parsedShellHash.action;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return undefined;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Extracting URL present before the hash character.
|
|
227
|
+
* @param {string} sUrl Full URL
|
|
228
|
+
* @returns {string} String before the hash character in the URL.
|
|
229
|
+
* @private
|
|
230
|
+
*/
|
|
231
|
+
CollaborationHelper._extractURLBeforeHash = function (sUrl) {
|
|
232
|
+
var sUrlFragementBeforeHash = sUrl.split("#")[0];
|
|
233
|
+
return sUrlFragementBeforeHash;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* Extracting the hash from the URL
|
|
238
|
+
* @param {string} sUrl Full URL
|
|
239
|
+
* @returns {string} Hash from the URL
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
242
|
+
CollaborationHelper._extractURLHash = function (sUrl) {
|
|
243
|
+
var sUrlHash = sUrl.substring(sUrl.indexOf('#'));
|
|
244
|
+
return sUrlHash;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* This function saves the hash and the long URL in the key/value DB.
|
|
249
|
+
* @param {string} sUrl Full URL
|
|
250
|
+
* @param {AppState} oAppStateService Instance of the AppState
|
|
251
|
+
* @returns {Promise} Promise which ultimately resolves once the value is stored successfully.
|
|
252
|
+
* @private
|
|
253
|
+
*/
|
|
254
|
+
CollaborationHelper._storeUrl = function (sUrl, oAppStateService) {
|
|
255
|
+
oAppStateService.setData(sUrl);
|
|
256
|
+
return oAppStateService.save();
|
|
257
|
+
};
|
|
258
|
+
return CollaborationHelper;
|
|
259
|
+
}
|
|
260
|
+
);
|
|
@@ -27,19 +27,22 @@ sap.ui.define([
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
// Private constructor so that no one could create an instance of the class
|
|
30
|
-
function ServiceContainer() {
|
|
30
|
+
function ServiceContainer() {}
|
|
31
31
|
|
|
32
|
+
/**
|
|
33
|
+
* Service container to get the collaboration type.
|
|
34
|
+
* @namespace
|
|
35
|
+
* @since 1.108
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
32
38
|
sap.suite.ui.commons.collaboration.ServiceContainer = new ServiceContainer();
|
|
33
39
|
|
|
34
40
|
/**
|
|
35
|
-
*
|
|
36
|
-
* collaboration
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* @internal
|
|
41
|
-
* @static
|
|
42
|
-
* @experimental Since 1.108
|
|
41
|
+
* Method that returns the collaboration service object as 'active' on the system.
|
|
42
|
+
* Microsoft Teams is supported as a collaboration option and must be enabled using the communication service SAP_COM_0860.
|
|
43
|
+
* The type definition and class are only available internally and are not intended for external consumers.
|
|
44
|
+
* @returns {Promise} Returns the promise that is resolved to the instance of the collaboration service.
|
|
45
|
+
* @public
|
|
43
46
|
*/
|
|
44
47
|
sap.suite.ui.commons.collaboration.ServiceContainer.getServiceAsync = function () {
|
|
45
48
|
if (oServicePromise) {
|
|
@@ -8,11 +8,10 @@ sap.ui.define([
|
|
|
8
8
|
"sap/base/Log",
|
|
9
9
|
"sap/ui/core/Core",
|
|
10
10
|
"sap/base/security/URLListValidator",
|
|
11
|
-
"./
|
|
11
|
+
"./CollaborationHelper",
|
|
12
12
|
"sap/suite/ui/commons/collaboration/BaseHelperService",
|
|
13
|
-
'sap/ui/performance/trace/FESRHelper',
|
|
14
13
|
'sap/ui/core/Element'
|
|
15
|
-
], function (Log, Core, URLListValidator,
|
|
14
|
+
], function (Log, Core, URLListValidator, CollaborationHelper, BaseHelperService, Element) {
|
|
16
15
|
"use strict";
|
|
17
16
|
|
|
18
17
|
/**
|
|
@@ -29,11 +28,10 @@ sap.ui.define([
|
|
|
29
28
|
/**
|
|
30
29
|
* sTeamsAppID is hardcoded as of now, will be changed when app is published at org level.
|
|
31
30
|
*/
|
|
32
|
-
var COLLABORATION_MSTEAMS_APPID = '
|
|
31
|
+
var COLLABORATION_MSTEAMS_APPID = 'db5b69c6-0430-4ae1-8d6e-a65c2220b50c';
|
|
33
32
|
var oLogger = Log.getLogger("sap.suite.ui.commons.collaboration.TeamsHelperService");
|
|
34
33
|
|
|
35
34
|
var oResourceBundle = Core.getLibraryResourceBundle("sap.suite.ui.commons");
|
|
36
|
-
var oElement = new Element();
|
|
37
35
|
|
|
38
36
|
/**
|
|
39
37
|
* Gives list of all Collaboration Options
|
|
@@ -60,7 +58,8 @@ sap.ui.define([
|
|
|
60
58
|
aOptions.push({
|
|
61
59
|
"text": oResourceBundle.getText("COLLABORATION_MSTEAMS_CHAT"),
|
|
62
60
|
"key": "COLLABORATION_MSTEAMS_CHAT",
|
|
63
|
-
"icon": "sap-icon://post"
|
|
61
|
+
"icon": "sap-icon://post",
|
|
62
|
+
"fesrStepName": "MST:ShareAsLink"
|
|
64
63
|
});
|
|
65
64
|
} else {
|
|
66
65
|
oLogger.info("Share as Chat option is not enabled in the tenant");
|
|
@@ -70,11 +69,16 @@ sap.ui.define([
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
if (oTeamsParams.isShareAsTabEnabled) {
|
|
73
|
-
|
|
72
|
+
// TODO: Share as Tab option is enabled only based on the Feature flag. Communication arrangement will not expose
|
|
73
|
+
// this flag in UI Extension 9.0 delivery. This code will have to be changed to check
|
|
74
|
+
// this._providerConfig.isShareAsTabEnabled once communication arrangement expose this switch and make generally
|
|
75
|
+
// available. Till then feature will work based on the feature toggle
|
|
76
|
+
if (this._isShareAsTabEnabled()) {
|
|
74
77
|
aOptions.push({
|
|
75
78
|
"text": oResourceBundle.getText("COLLABORATION_MSTEAMS_TAB"),
|
|
76
79
|
"key": "COLLABORATION_MSTEAMS_TAB",
|
|
77
|
-
"icon": "sap-icon://image-viewer"
|
|
80
|
+
"icon": "sap-icon://image-viewer",
|
|
81
|
+
"fesrStepName": "MST:ShareAsTab"
|
|
78
82
|
});
|
|
79
83
|
} else {
|
|
80
84
|
oLogger.info("Share as Tab option is not enabled in the tenant");
|
|
@@ -112,6 +116,8 @@ sap.ui.define([
|
|
|
112
116
|
* @param {Object} oParams Parameter object which contain the information to share
|
|
113
117
|
* @param {string} oParams.url Url of the application which needs to be shared
|
|
114
118
|
* @param {string} oParams.appTitle Title of the application which needs to be used while integration
|
|
119
|
+
* @param {string} oParams.subTitle Title of the object page which needs to be used while integration
|
|
120
|
+
* @param {boolean} oParams.minifyUrlForChat Experimental flag. Set to true to minify the Url in chat scenario
|
|
115
121
|
* @returns {void}
|
|
116
122
|
* @private
|
|
117
123
|
* @ui5-restricted
|
|
@@ -146,14 +152,14 @@ sap.ui.define([
|
|
|
146
152
|
* @param {Object} oParams Parameter object which contain the information to share
|
|
147
153
|
* @param {string} oParams.url Url of the application which needs to be shared
|
|
148
154
|
* @param {string} oParams.appTitle Title of the application which needs to be used in the chat message
|
|
155
|
+
* @param {string} oParams.subTitle Title of the object page which needs to be used in the chat message
|
|
156
|
+
* @param {boolean} oParams.minifyUrlForChat Experimental flag. Set to true to minify the Url.
|
|
149
157
|
* @returns {void}
|
|
150
158
|
* @private
|
|
151
159
|
* @ui5-restricted
|
|
152
160
|
* @experimental Since 1.108
|
|
153
161
|
*/
|
|
154
162
|
TeamsHelperService.prototype._shareAsChat = function (oParams) {
|
|
155
|
-
// Needed for Telemetry
|
|
156
|
-
FESRHelper.setSemanticStepname(oElement, "press", "ShareAsLink");
|
|
157
163
|
var newWindow = window.open(
|
|
158
164
|
"",
|
|
159
165
|
"ms-teams-share-popup",
|
|
@@ -165,9 +171,13 @@ sap.ui.define([
|
|
|
165
171
|
}
|
|
166
172
|
|
|
167
173
|
newWindow.opener = null;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
if (oParams.minifyUrlForChat) {
|
|
175
|
+
CollaborationHelper.compactHash(oParams.url, []).then(function (sShortURL) {
|
|
176
|
+
newWindow.location = "https://teams.microsoft.com/share?msgText=" + encodeURIComponent(sMessage) + "&href=" + encodeURIComponent(sShortURL.url);
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
newWindow.location = "https://teams.microsoft.com/share?msgText=" + encodeURIComponent(sMessage) + "&href=" + encodeURIComponent(oParams.url);
|
|
180
|
+
}
|
|
171
181
|
};
|
|
172
182
|
|
|
173
183
|
/**
|
|
@@ -176,14 +186,13 @@ sap.ui.define([
|
|
|
176
186
|
* @param {Object} oParams Parameter object which contain the information to share
|
|
177
187
|
* @param {string} oParams.url Url of the application which needs to be shared
|
|
178
188
|
* @param {string} oParams.appTitle Title of the application which needs to be used in the Tab title
|
|
189
|
+
* @param {string} oParams.subTitle Title of the object page which needs to be used in the Tab title
|
|
179
190
|
* @returns {void}
|
|
180
191
|
* @private
|
|
181
192
|
* @ui5-restricted
|
|
182
193
|
* @experimental Since 1.108
|
|
183
194
|
*/
|
|
184
195
|
TeamsHelperService.prototype._shareAsTab = function (oParams) {
|
|
185
|
-
// Needed for Telemetry
|
|
186
|
-
FESRHelper.setSemanticStepname(oElement, "press", "ShareAsTab");
|
|
187
196
|
var oUshellContainer = sap.ushell && sap.ushell.Container;
|
|
188
197
|
var oURLParsing = oUshellContainer && oUshellContainer.getService("URLParsing");
|
|
189
198
|
var sAppUri = oParams.url;
|
|
@@ -191,7 +200,7 @@ sap.ui.define([
|
|
|
191
200
|
if (iIndexOfHash !== -1) {
|
|
192
201
|
var sUriForHeaderLess = sAppUri.substring(0, iIndexOfHash);
|
|
193
202
|
var iIndexOfQuestionMark = sUriForHeaderLess.indexOf('?', 0);
|
|
194
|
-
var sParam = '
|
|
203
|
+
var sParam = 'appState=lean&sap-collaboration-teams=true';
|
|
195
204
|
if (iIndexOfQuestionMark !== -1) {
|
|
196
205
|
sUriForHeaderLess = sUriForHeaderLess.substring(0, iIndexOfQuestionMark + 1) + sParam + '&' + sUriForHeaderLess.substring(iIndexOfQuestionMark + 1);
|
|
197
206
|
} else {
|
|
@@ -214,8 +223,43 @@ sap.ui.define([
|
|
|
214
223
|
"mode": "tab"
|
|
215
224
|
}
|
|
216
225
|
};
|
|
217
|
-
|
|
218
|
-
|
|
226
|
+
this._getApplicationID().then(function(teamsAppId) {
|
|
227
|
+
var sURL = "https://teams.microsoft.com/l/entity/" + teamsAppId + "/home?&context=" + encodeURIComponent(JSON.stringify(oData));
|
|
228
|
+
sap.m.URLHelper.redirect(sURL, true);
|
|
229
|
+
});
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
TeamsHelperService.prototype._getApplicationID = function () {
|
|
233
|
+
var oUshellContainer = sap.ushell && sap.ushell.Container;
|
|
234
|
+
var oURLParsing = oUshellContainer && oUshellContainer.getService("URLParsing");
|
|
235
|
+
return CollaborationHelper._getCurrentUrl().then(function (sCurrentUrl) {
|
|
236
|
+
var sBeforeHashURL = sCurrentUrl.split("#")[0];
|
|
237
|
+
if (sBeforeHashURL.indexOf('?') !== -1) {
|
|
238
|
+
var oParsedUrl = oURLParsing && oURLParsing.parseParameters(sBeforeHashURL.substring(sBeforeHashURL.indexOf('?')));
|
|
239
|
+
if (oParsedUrl &&
|
|
240
|
+
oParsedUrl["sap-collaboration-xx-TeamsAppId"] &&
|
|
241
|
+
oParsedUrl["sap-collaboration-xx-TeamsAppId"][0] &&
|
|
242
|
+
oParsedUrl["sap-collaboration-xx-TeamsAppId"][0].length > 0) {
|
|
243
|
+
return Promise.resolve(oParsedUrl["sap-collaboration-xx-TeamsAppId"][0]);
|
|
244
|
+
}
|
|
245
|
+
return Promise.resolve(COLLABORATION_MSTEAMS_APPID);
|
|
246
|
+
} else {
|
|
247
|
+
return Promise.resolve(COLLABORATION_MSTEAMS_APPID);
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
TeamsHelperService.prototype._isShareAsTabEnabled = function () {
|
|
253
|
+
if (window["sap-ushell-config"] &&
|
|
254
|
+
window["sap-ushell-config"].renderers &&
|
|
255
|
+
window["sap-ushell-config"].renderers.fiori2 &&
|
|
256
|
+
window["sap-ushell-config"].renderers.fiori2.componentData &&
|
|
257
|
+
window["sap-ushell-config"].renderers.fiori2.componentData.config &&
|
|
258
|
+
window["sap-ushell-config"].renderers.fiori2.componentData.config.sapHorizonEnabled) {
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return false;
|
|
219
263
|
};
|
|
220
264
|
|
|
221
265
|
return TeamsHelperService;
|