@sapui5/sap.suite.ui.commons 1.140.0 → 1.142.0
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 +13 -2
- package/src/sap/suite/ui/commons/CalculationBuilderExpression.js +11 -7
- 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 +12 -6
- 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 +21 -21
- package/src/sap/suite/ui/commons/MicroProcessFlow.js +2 -2
- package/src/sap/suite/ui/commons/MicroProcessFlowItem.js +7 -9
- package/src/sap/suite/ui/commons/Timeline.js +22 -24
- package/src/sap/suite/ui/commons/TimelineItemRenderer.js +12 -2
- package/src/sap/suite/ui/commons/TimelineRenderManager.js +25 -13
- package/src/sap/suite/ui/commons/collaboration/BaseHelperService.js +12 -12
- package/src/sap/suite/ui/commons/collaboration/CollaborationCardHelper.js +6 -5
- package/src/sap/suite/ui/commons/collaboration/CollaborationContactInfoHelper.js +15 -15
- package/src/sap/suite/ui/commons/collaboration/CollaborationHelper.js +94 -76
- package/src/sap/suite/ui/commons/collaboration/CollaborationManagerService.js +41 -41
- package/src/sap/suite/ui/commons/collaboration/ContactHelper.js +288 -286
- package/src/sap/suite/ui/commons/collaboration/ServiceContainer.js +33 -33
- package/src/sap/suite/ui/commons/collaboration/TeamsHelperService.js +446 -150
- package/src/sap/suite/ui/commons/collaboration/UniversalCollaborationBar.js +366 -0
- package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component-preload.js +6 -3
- package/src/sap/suite/ui/commons/collaboration/flpplugins/msplugin/Component.js +11 -13
- 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.properties +16 -1
- package/src/sap/suite/ui/commons/messagebundle_en.properties +3 -0
- package/src/sap/suite/ui/commons/networkgraph/Graph.js +105 -5
- package/src/sap/suite/ui/commons/networkgraph/Node.js +33 -11
- package/src/sap/suite/ui/commons/networkgraph/util/DragDropManager.js +197 -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/themes/base/CollaborationPopover.less +29 -1
- package/src/sap/suite/ui/commons/themes/base/NetworkGraph.less +5 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/base/Object",
|
|
9
|
-
"sap/base/Log"
|
|
9
|
+
"sap/base/Log"
|
|
10
10
|
], function (BaseObject, Log) {
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
@@ -29,7 +29,7 @@ sap.ui.define([
|
|
|
29
29
|
"sap.suite.ui.commons.collaboration.CollaborationCardHelper"
|
|
30
30
|
);
|
|
31
31
|
|
|
32
|
-
CollaborationCardHelper.fetchCSRFToken = function() {
|
|
32
|
+
CollaborationCardHelper.fetchCSRFToken = function () {
|
|
33
33
|
return fetch(REPO_BASE_URL, {
|
|
34
34
|
method: HEAD,
|
|
35
35
|
headers: {
|
|
@@ -46,10 +46,11 @@ sap.ui.define([
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Post Card
|
|
49
|
+
* @param {string} sCardId Card ID
|
|
49
50
|
* @param {string} oContent Adaptive Card Base64
|
|
50
51
|
* @returns {object} response
|
|
51
52
|
*/
|
|
52
|
-
CollaborationCardHelper.postCard = function(sCardId, oContent) {
|
|
53
|
+
CollaborationCardHelper.postCard = function (sCardId, oContent) {
|
|
53
54
|
return this.fetchCSRFToken().then(function (sCSRFToken) {
|
|
54
55
|
let sContent = JSON.stringify(oContent);
|
|
55
56
|
try {
|
|
@@ -62,8 +63,8 @@ sap.ui.define([
|
|
|
62
63
|
return fetch(CARD_READ_URL, {
|
|
63
64
|
method: POST,
|
|
64
65
|
headers: {
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
"X-CSRF-Token": sCSRFToken,
|
|
67
|
+
"content-type": "application/json;odata.metadata=minimal;charset=utf-8"
|
|
67
68
|
},
|
|
68
69
|
body: sPayload
|
|
69
70
|
}).then(function (oResponse) {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/base/Object"
|
|
9
|
-
], function
|
|
9
|
+
], function(BaseObject) {
|
|
10
10
|
"use strict";
|
|
11
11
|
|
|
12
12
|
var BASE_URL = "/sap/opu/odata4/sap/aps_ui_contact_srv/srvd_a2x/sap/";
|
|
@@ -40,7 +40,7 @@ sap.ui.define([
|
|
|
40
40
|
headers: {
|
|
41
41
|
"X-CSRF-Token": "Fetch"
|
|
42
42
|
}
|
|
43
|
-
}).then(function
|
|
43
|
+
}).then(function(resposne) {
|
|
44
44
|
var token = resposne.headers.get("X-CSRF-Token");
|
|
45
45
|
if (resposne.ok && token) {
|
|
46
46
|
return token;
|
|
@@ -50,17 +50,17 @@ sap.ui.define([
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
CollaborationContactInfoHelper.fetchContact = function(sEmail) {
|
|
53
|
-
return this.fetchCSRFToken().then(function
|
|
53
|
+
return this.fetchCSRFToken().then(function(sCSRFToken) {
|
|
54
54
|
return fetch(CONTACTINFO_URL + "/" + sEmail, {
|
|
55
55
|
method: GET,
|
|
56
56
|
headers: {
|
|
57
57
|
"X-CSRF-Token": sCSRFToken,
|
|
58
58
|
"content-type": "application/json;odata.metadata=minimal;charset=utf-8"
|
|
59
59
|
}
|
|
60
|
-
}).then(function
|
|
60
|
+
}).then(function(oResponse) {
|
|
61
61
|
return oResponse.json();
|
|
62
62
|
});
|
|
63
|
-
});
|
|
63
|
+
});
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
CollaborationContactInfoHelper.fetchContactCalendar = function(sEmail) {
|
|
@@ -69,58 +69,58 @@ sap.ui.define([
|
|
|
69
69
|
if (sStartDateTime) {
|
|
70
70
|
url = CONTACTCALENDAR_URL + "?$filter=(mail eq '" + sEmail + "'&start_datetime eq '" + sStartDateTime.toISOString() + "')";
|
|
71
71
|
}
|
|
72
|
-
return this.fetchCSRFToken().then(function
|
|
72
|
+
return this.fetchCSRFToken().then(function(sCSRFToken) {
|
|
73
73
|
return fetch(url, {
|
|
74
74
|
method: GET,
|
|
75
75
|
headers: {
|
|
76
76
|
"X-CSRF-Token": sCSRFToken,
|
|
77
77
|
"content-type": "application/json;odata.metadata=minimal;charset=utf-8"
|
|
78
78
|
}
|
|
79
|
-
}).then(function
|
|
79
|
+
}).then(function(oResponse) {
|
|
80
80
|
return oResponse.json();
|
|
81
81
|
});
|
|
82
|
-
});
|
|
82
|
+
});
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
CollaborationContactInfoHelper.fetchContactPicture = function(sEmail) {
|
|
86
|
-
return this.fetchCSRFToken().then(function
|
|
86
|
+
return this.fetchCSRFToken().then(function(sCSRFToken) {
|
|
87
87
|
return fetch(CONTACTIMAGE_URL + "/" + sEmail + "/photo", {
|
|
88
88
|
method: GET,
|
|
89
89
|
headers: {
|
|
90
90
|
"X-CSRF-Token": sCSRFToken
|
|
91
91
|
}
|
|
92
|
-
}).then(function
|
|
92
|
+
}).then(function(oResponse) {
|
|
93
93
|
return oResponse.blob();
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
96
|
};
|
|
97
97
|
|
|
98
98
|
CollaborationContactInfoHelper.fetchContactStatus = function(sId) {
|
|
99
|
-
return this.fetchCSRFToken().then(function
|
|
99
|
+
return this.fetchCSRFToken().then(function(sCSRFToken) {
|
|
100
100
|
return fetch(CONTACTSTATUS_URL + "?$filter=id eq '" + sId + "'", {
|
|
101
101
|
method: GET,
|
|
102
102
|
headers: {
|
|
103
103
|
"X-CSRF-Token": sCSRFToken,
|
|
104
104
|
"content-type": "application/json;odata.metadata=minimal;charset=utf-8"
|
|
105
105
|
}
|
|
106
|
-
}).then(function
|
|
106
|
+
}).then(function(oResponse) {
|
|
107
107
|
return oResponse.json();
|
|
108
108
|
});
|
|
109
109
|
});
|
|
110
110
|
};
|
|
111
111
|
|
|
112
112
|
CollaborationContactInfoHelper.fetchServiceStatus = function() {
|
|
113
|
-
return this.fetchCSRFToken().then(function
|
|
113
|
+
return this.fetchCSRFToken().then(function(sCSRFToken) {
|
|
114
114
|
return fetch(CHECKCONTACTSERVICE, {
|
|
115
115
|
method: GET,
|
|
116
116
|
headers: {
|
|
117
117
|
"X-CSRF-Token": sCSRFToken,
|
|
118
118
|
"content-type": "application/json;odata.metadata=minimal;charset=utf-8"
|
|
119
119
|
}
|
|
120
|
-
}).then(function
|
|
120
|
+
}).then(function(oResponse) {
|
|
121
121
|
return oResponse.json();
|
|
122
122
|
});
|
|
123
|
-
});
|
|
123
|
+
});
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
return CollaborationContactInfoHelper;
|
|
@@ -5,8 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
sap.ui.define(
|
|
8
|
-
[
|
|
9
|
-
|
|
8
|
+
[
|
|
9
|
+
"sap/base/Log",
|
|
10
|
+
"sap/ui/base/Object",
|
|
11
|
+
"sap/ui/core/Element",
|
|
12
|
+
"../windowmessages/CollaborationMessageConsumer"
|
|
13
|
+
],
|
|
14
|
+
function(Log, BaseObject, Element, CollaborationMessageConsumer) {
|
|
10
15
|
"use strict";
|
|
11
16
|
var URL_KEY = "sap-url-hash";
|
|
12
17
|
var PARAM_SAP_CARD_TITLE = "&sap-ui-cardTitle";
|
|
@@ -40,7 +45,7 @@ sap.ui.define(
|
|
|
40
45
|
* @ui5-restricted sap.suite.suite-ui-commons
|
|
41
46
|
* @experimental since 1.108
|
|
42
47
|
*/
|
|
43
|
-
CollaborationHelper.compactHash = function
|
|
48
|
+
CollaborationHelper.compactHash = function(sUrl) {
|
|
44
49
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
45
50
|
if (!UshellContainer) {
|
|
46
51
|
//In case uShell Container is not present, minification is not needed.
|
|
@@ -48,44 +53,46 @@ sap.ui.define(
|
|
|
48
53
|
url: sUrl
|
|
49
54
|
};
|
|
50
55
|
}
|
|
51
|
-
return UshellContainer && UshellContainer.getServiceAsync("AppState").then(async function
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
return UshellContainer && UshellContainer.getServiceAsync("AppState").then(async function(oAppStateService) {
|
|
57
|
+
var oEmptyAppState = oAppStateService.createEmptyAppState(
|
|
58
|
+
undefined,
|
|
59
|
+
false
|
|
60
|
+
);
|
|
61
|
+
var sKey = this._getNextKey(oEmptyAppState);
|
|
62
|
+
if (!this._isEligibleForBackendPersistency(oAppStateService)) {
|
|
63
|
+
oLogger.warning("Transient flag is true. URL will not be shortened");
|
|
64
|
+
return {
|
|
65
|
+
url: sUrl
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
var sUrlBeforeHash = this._extractURLBeforeHash(sUrl);
|
|
69
|
+
var sSemanticObjectAndAction = await this._extractSemanticObjectAndAction(sUrl);
|
|
70
|
+
var isMinificationPossible = false;
|
|
71
|
+
try {
|
|
72
|
+
isMinificationPossible = await this._isMinificationFeasible(sUrl);
|
|
73
|
+
} catch (e) {
|
|
74
|
+
oLogger.error("isMinificationPossible check failed. URL will not be shortened");
|
|
75
|
+
}
|
|
76
|
+
if (!sSemanticObjectAndAction || !isMinificationPossible) {
|
|
77
|
+
// In case sSemanticObjectAndAction is undefined
|
|
78
|
+
// or the fragment is not resolved, then return the current url as shortened url.
|
|
79
|
+
return {
|
|
80
|
+
url: sUrl
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return this._storeUrl(sUrl, oEmptyAppState)
|
|
84
|
+
.then(function() {
|
|
59
85
|
return {
|
|
60
|
-
url:
|
|
86
|
+
url: sUrlBeforeHash + "#" + sSemanticObjectAndAction + "&/" + URL_KEY + "=" + sKey
|
|
61
87
|
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
isMinificationPossible = await this._isMinificationFeasible(sUrl);
|
|
68
|
-
} catch (e) {}
|
|
69
|
-
if (!sSemanticObjectAndAction || !isMinificationPossible) {
|
|
70
|
-
// In case sSemanticObjectAndAction is undefined
|
|
71
|
-
// or the fragment is not resolved, then return the current url as shortened url.
|
|
88
|
+
})
|
|
89
|
+
.catch(function(error) {
|
|
90
|
+
oLogger.warning("URL is not shortened due to an error." + error.toString());
|
|
91
|
+
//In case if the wrapper promise is rejected then return the current url as shortened url.
|
|
72
92
|
return {
|
|
73
93
|
url: sUrl
|
|
74
94
|
};
|
|
75
|
-
}
|
|
76
|
-
return this._storeUrl(sUrl, oEmptyAppState)
|
|
77
|
-
.then(function () {
|
|
78
|
-
return {
|
|
79
|
-
url: sUrlBeforeHash + "#" + sSemanticObjectAndAction + "&/" + URL_KEY + "=" + sKey
|
|
80
|
-
};
|
|
81
|
-
})
|
|
82
|
-
.catch(function (error) {
|
|
83
|
-
oLogger.warning("URL is not shortened due to an error." + error.toString());
|
|
84
|
-
//In case if the wrapper promise is rejected then return the current url as shortened url.
|
|
85
|
-
return {
|
|
86
|
-
url: sUrl
|
|
87
|
-
};
|
|
88
|
-
});
|
|
95
|
+
});
|
|
89
96
|
}.bind(this));
|
|
90
97
|
};
|
|
91
98
|
|
|
@@ -94,10 +101,10 @@ sap.ui.define(
|
|
|
94
101
|
* @returns {Promise} Promise which resolves to the current URL
|
|
95
102
|
* @private
|
|
96
103
|
*/
|
|
97
|
-
CollaborationHelper._getCurrentUrl = function
|
|
104
|
+
CollaborationHelper._getCurrentUrl = function() {
|
|
98
105
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
99
|
-
return UshellContainer && UshellContainer ? new Promise(function(fnResolve){
|
|
100
|
-
UshellContainer.getFLPUrlAsync(true).then(function
|
|
106
|
+
return UshellContainer && UshellContainer ? new Promise(function(fnResolve) {
|
|
107
|
+
UshellContainer.getFLPUrlAsync(true).then(function(sFLPUrl) {
|
|
101
108
|
fnResolve(sFLPUrl);
|
|
102
109
|
});
|
|
103
110
|
}) : Promise.resolve(document.URL);
|
|
@@ -111,26 +118,29 @@ sap.ui.define(
|
|
|
111
118
|
* @return {Promise} Return the resolved promise when the redirection of the URL is done.
|
|
112
119
|
* @public
|
|
113
120
|
*/
|
|
114
|
-
CollaborationHelper.processAndExpandHash = function
|
|
121
|
+
CollaborationHelper.processAndExpandHash = function() {
|
|
115
122
|
this._hideAvatarFromShellbar();
|
|
116
|
-
return this._getCurrentUrl().then(async function
|
|
123
|
+
return this._getCurrentUrl().then(async function(sCurrentUrl) {
|
|
117
124
|
//if the current url has url param, sap-url-hash, then we have to redirect to an actual url.
|
|
118
125
|
if (sCurrentUrl.indexOf(URL_KEY) > -1) {
|
|
119
|
-
var sHash = sCurrentUrl.split(URL_KEY)[1].split(
|
|
126
|
+
var sHash = sCurrentUrl.split(URL_KEY)[1].split("=")[1];
|
|
120
127
|
if (sCurrentUrl.indexOf(PARAM_SAP_STAGEVIEW_HASH) > 0) {
|
|
121
128
|
sHash = sHash.split(PARAM_SAP_STAGEVIEW_HASH)[0];
|
|
122
129
|
} else if (sCurrentUrl.includes("info=")) {
|
|
123
|
-
|
|
124
|
-
} else if (
|
|
125
|
-
|
|
130
|
+
sHash = sHash.includes(",") ? sHash.split(",")[0] : sHash.split("&")[0];
|
|
131
|
+
} else if (
|
|
132
|
+
sCurrentUrl.indexOf(PARAM_SAP_CARD_ID) > 0 ||
|
|
133
|
+
sCurrentUrl.indexOf(PARAM_SAP_XX_CARD_ID) > 0
|
|
134
|
+
) {
|
|
135
|
+
if (sCurrentUrl.indexOf(PARAM_SAP_CARD_ID) > 0) {
|
|
126
136
|
sHash = sHash.split(PARAM_SAP_CARD_ID)[0];
|
|
127
137
|
} else {
|
|
128
138
|
sHash = sHash.split(PARAM_SAP_XX_CARD_ID)[0];
|
|
129
139
|
}
|
|
130
|
-
} else if (sCurrentUrl.indexOf(PARAM_SAP_CARD_TITLE) > 0){
|
|
140
|
+
} else if (sCurrentUrl.indexOf(PARAM_SAP_CARD_TITLE) > 0) {
|
|
131
141
|
sHash = sHash.split(PARAM_SAP_CARD_TITLE)[0];
|
|
132
142
|
}
|
|
133
|
-
return this._retrieveURL(sHash).then(function
|
|
143
|
+
return this._retrieveURL(sHash).then(function(oAppState) {
|
|
134
144
|
if (oAppState.getData()) {
|
|
135
145
|
window.location.replace(oAppState.getData());
|
|
136
146
|
} else {
|
|
@@ -146,7 +156,10 @@ sap.ui.define(
|
|
|
146
156
|
} else if (sCurrentUrl.indexOf(PARAM_SAP_CARD_TITLE) > -1) {
|
|
147
157
|
const sUrl = sCurrentUrl.split(PARAM_SAP_CARD_TITLE)[0];
|
|
148
158
|
await this._redirectBasedOnRuntime(sUrl);
|
|
149
|
-
} else if (
|
|
159
|
+
} else if (
|
|
160
|
+
sCurrentUrl.includes(PARAM_SAP_CARD_INFO) &&
|
|
161
|
+
this._isFromTeams(sCurrentUrl)
|
|
162
|
+
) {
|
|
150
163
|
const sUrl = sCurrentUrl.split(PARAM_SAP_CARD_INFO)[0];
|
|
151
164
|
await this._redirectBasedOnRuntime(sUrl);
|
|
152
165
|
}
|
|
@@ -162,7 +175,7 @@ sap.ui.define(
|
|
|
162
175
|
* @param {string} sCurrentUrl - The full URL to inspect.
|
|
163
176
|
* @returns {boolean} True if the URL contains `sap-collaboration-teams=true`; otherwise, false.
|
|
164
177
|
*/
|
|
165
|
-
CollaborationHelper._isFromTeams = function
|
|
178
|
+
CollaborationHelper._isFromTeams = function(sCurrentUrl) {
|
|
166
179
|
const urlObj = new URL(sCurrentUrl);
|
|
167
180
|
const bIsFromTeams = urlObj.searchParams.get("sap-collaboration-teams");
|
|
168
181
|
return bIsFromTeams === "true";
|
|
@@ -177,7 +190,7 @@ sap.ui.define(
|
|
|
177
190
|
* @param {string} sUrl - The target URL for redirection.
|
|
178
191
|
* @private
|
|
179
192
|
*/
|
|
180
|
-
CollaborationHelper._redirectBasedOnRuntime = async function
|
|
193
|
+
CollaborationHelper._redirectBasedOnRuntime = async function(sUrl) {
|
|
181
194
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
182
195
|
|
|
183
196
|
// Get indication is if we are in AppRuntime (for special use cases handling, e.g. BTP Fiori App in S/Cube)
|
|
@@ -197,7 +210,7 @@ sap.ui.define(
|
|
|
197
210
|
* @returns {string} - The cleaned URL
|
|
198
211
|
* @private
|
|
199
212
|
*/
|
|
200
|
-
CollaborationHelper._removeTeamsParams = function
|
|
213
|
+
CollaborationHelper._removeTeamsParams = function(sUrl) {
|
|
201
214
|
try {
|
|
202
215
|
const urlParts = sUrl.split("#");
|
|
203
216
|
const baseUrl = urlParts[0];
|
|
@@ -231,7 +244,7 @@ sap.ui.define(
|
|
|
231
244
|
* @returns {string} - The cleaned URL
|
|
232
245
|
* @private
|
|
233
246
|
*/
|
|
234
|
-
CollaborationHelper._stripTeamsParams = function
|
|
247
|
+
CollaborationHelper._stripTeamsParams = function(sUrl) {
|
|
235
248
|
if (this._isTopWindow()) {
|
|
236
249
|
return this._removeTeamsParams(sUrl);
|
|
237
250
|
}
|
|
@@ -245,21 +258,20 @@ sap.ui.define(
|
|
|
245
258
|
* @returns {boolean} - Returns true if the current window is not inside an iframe, false otherwise.
|
|
246
259
|
* @private
|
|
247
260
|
*/
|
|
248
|
-
CollaborationHelper._isTopWindow = function
|
|
261
|
+
CollaborationHelper._isTopWindow = function() {
|
|
249
262
|
return window.self === window.top;
|
|
250
263
|
};
|
|
251
264
|
|
|
252
|
-
|
|
253
265
|
/**
|
|
254
266
|
* Hides the avatar of the user if the app is running in the Microsoft Teams application.
|
|
255
267
|
* @private
|
|
256
268
|
* @ui5-restricted sap.suite.suite-ui-commons
|
|
257
269
|
* @experimental since 1.108
|
|
258
270
|
*/
|
|
259
|
-
CollaborationHelper._hideAvatarFromShellbar = function
|
|
260
|
-
this.isTeamsModeActive().then(function
|
|
271
|
+
CollaborationHelper._hideAvatarFromShellbar = function() {
|
|
272
|
+
this.isTeamsModeActive().then(function(bIsActive) {
|
|
261
273
|
if (bIsActive) {
|
|
262
|
-
var oAvatar = Element.getElementById(
|
|
274
|
+
var oAvatar = Element.getElementById("userActionsMenuHeaderButton");
|
|
263
275
|
if (oAvatar) {
|
|
264
276
|
oAvatar.setVisible(false);
|
|
265
277
|
}
|
|
@@ -274,15 +286,15 @@ sap.ui.define(
|
|
|
274
286
|
* @returns {Promise} Return the resolved promise with the data if the conditions are met with 'true', else 'false'
|
|
275
287
|
* @public
|
|
276
288
|
*/
|
|
277
|
-
CollaborationHelper.isTeamsModeActive = function
|
|
289
|
+
CollaborationHelper.isTeamsModeActive = function() {
|
|
278
290
|
var bAppRunningInTeams = false;
|
|
279
291
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
280
292
|
if (UshellContainer) {
|
|
281
|
-
return UshellContainer.getServiceAsync("URLParsing").then(function
|
|
282
|
-
return this._getCurrentUrl().then(function
|
|
293
|
+
return UshellContainer.getServiceAsync("URLParsing").then(function(oURLParsing) {
|
|
294
|
+
return this._getCurrentUrl().then(function(sCurrentUrl) {
|
|
283
295
|
var sBeforeHashURL = sCurrentUrl.split("#")[0];
|
|
284
|
-
if (sBeforeHashURL.indexOf(
|
|
285
|
-
var oParsedUrl = oURLParsing && oURLParsing.parseParameters(sBeforeHashURL.substring(sBeforeHashURL.indexOf(
|
|
296
|
+
if (sBeforeHashURL.indexOf("?") !== -1) {
|
|
297
|
+
var oParsedUrl = oURLParsing && oURLParsing.parseParameters(sBeforeHashURL.substring(sBeforeHashURL.indexOf("?")));
|
|
286
298
|
if (oParsedUrl &&
|
|
287
299
|
oParsedUrl["sap-collaboration-teams"] &&
|
|
288
300
|
oParsedUrl["sap-collaboration-teams"][0] &&
|
|
@@ -313,9 +325,9 @@ sap.ui.define(
|
|
|
313
325
|
* @returns {AppState} The instance of the AppState
|
|
314
326
|
* @private
|
|
315
327
|
*/
|
|
316
|
-
CollaborationHelper._retrieveURL = function
|
|
328
|
+
CollaborationHelper._retrieveURL = function(hash) {
|
|
317
329
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
318
|
-
return UshellContainer && UshellContainer.getServiceAsync("AppState").then(function
|
|
330
|
+
return UshellContainer && UshellContainer.getServiceAsync("AppState").then(function(oAppStateService) {
|
|
319
331
|
return oAppStateService.getAppState(hash);
|
|
320
332
|
});
|
|
321
333
|
};
|
|
@@ -326,8 +338,13 @@ sap.ui.define(
|
|
|
326
338
|
* @returns {boolean} 'True' if the transient flag is set to 'false'
|
|
327
339
|
* @private
|
|
328
340
|
*/
|
|
329
|
-
CollaborationHelper._isEligibleForBackendPersistency = function
|
|
330
|
-
return
|
|
341
|
+
CollaborationHelper._isEligibleForBackendPersistency = function(appStateInstance) {
|
|
342
|
+
return (
|
|
343
|
+
appStateInstance &&
|
|
344
|
+
appStateInstance._oConfig &&
|
|
345
|
+
TRANSIENT_KEY in appStateInstance._oConfig &&
|
|
346
|
+
!appStateInstance._oConfig[TRANSIENT_KEY]
|
|
347
|
+
);
|
|
331
348
|
};
|
|
332
349
|
|
|
333
350
|
/**
|
|
@@ -336,7 +353,7 @@ sap.ui.define(
|
|
|
336
353
|
* @returns {string} Returns a randomly generated UUID string.
|
|
337
354
|
* @private
|
|
338
355
|
*/
|
|
339
|
-
CollaborationHelper._getNextKey = function
|
|
356
|
+
CollaborationHelper._getNextKey = function(oAppStateService) {
|
|
340
357
|
return oAppStateService.getKey();
|
|
341
358
|
};
|
|
342
359
|
|
|
@@ -346,9 +363,9 @@ sap.ui.define(
|
|
|
346
363
|
* @returns {string} Returns a string in the format <semantic-object>-<action>~<contextRaw>.
|
|
347
364
|
* @private
|
|
348
365
|
*/
|
|
349
|
-
CollaborationHelper._extractSemanticObjectAndAction = function
|
|
366
|
+
CollaborationHelper._extractSemanticObjectAndAction = function(sUrl) {
|
|
350
367
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
351
|
-
return UshellContainer && UshellContainer.getServiceAsync("URLParsing").then(function
|
|
368
|
+
return UshellContainer && UshellContainer.getServiceAsync("URLParsing").then(function(oURLParsing) {
|
|
352
369
|
var parsedShellHash = oURLParsing.parseShellHash(this._extractURLHash(sUrl));
|
|
353
370
|
if (parsedShellHash) {
|
|
354
371
|
return Promise.resolve(parsedShellHash.contextRaw ?
|
|
@@ -366,7 +383,7 @@ sap.ui.define(
|
|
|
366
383
|
* @returns {boolean} Returns 'true' if the fragment is resolved successfully.
|
|
367
384
|
* @private
|
|
368
385
|
*/
|
|
369
|
-
CollaborationHelper._isMinificationFeasible = async function
|
|
386
|
+
CollaborationHelper._isMinificationFeasible = async function(sUrl) {
|
|
370
387
|
const UshellContainer = sap.ui.require("sap/ushell/Container");
|
|
371
388
|
if (UshellContainer) {
|
|
372
389
|
const oNavTargetResolution = await UshellContainer.getServiceAsync("NavTargetResolution");
|
|
@@ -375,9 +392,10 @@ sap.ui.define(
|
|
|
375
392
|
var iParamsCount = Object.keys(oParsedShellHash.params).length;
|
|
376
393
|
if (iParamsCount > 0) {
|
|
377
394
|
return oNavTargetResolution.resolveHashFragment(`#${oParsedShellHash.semanticObject}-${oParsedShellHash.action}`)
|
|
378
|
-
.then(function
|
|
395
|
+
.then(function(param) {
|
|
379
396
|
return true;
|
|
380
|
-
})
|
|
397
|
+
})
|
|
398
|
+
.catch(function(e) {
|
|
381
399
|
return false;
|
|
382
400
|
});
|
|
383
401
|
} else {
|
|
@@ -393,7 +411,7 @@ sap.ui.define(
|
|
|
393
411
|
* @returns {string} String before the hash character in the URL.
|
|
394
412
|
* @private
|
|
395
413
|
*/
|
|
396
|
-
CollaborationHelper._extractURLBeforeHash = function
|
|
414
|
+
CollaborationHelper._extractURLBeforeHash = function(sUrl) {
|
|
397
415
|
var sUrlFragementBeforeHash = sUrl.split("#")[0];
|
|
398
416
|
return sUrlFragementBeforeHash;
|
|
399
417
|
};
|
|
@@ -404,8 +422,8 @@ sap.ui.define(
|
|
|
404
422
|
* @returns {string} Hash from the URL
|
|
405
423
|
* @private
|
|
406
424
|
*/
|
|
407
|
-
CollaborationHelper._extractURLHash = function
|
|
408
|
-
var sUrlHash = sUrl.substring(sUrl.indexOf(
|
|
425
|
+
CollaborationHelper._extractURLHash = function(sUrl) {
|
|
426
|
+
var sUrlHash = sUrl.substring(sUrl.indexOf("#"));
|
|
409
427
|
return sUrlHash;
|
|
410
428
|
};
|
|
411
429
|
|
|
@@ -416,7 +434,7 @@ sap.ui.define(
|
|
|
416
434
|
* @returns {Promise} Promise which ultimately resolves once the value is stored successfully.
|
|
417
435
|
* @private
|
|
418
436
|
*/
|
|
419
|
-
CollaborationHelper._storeUrl = function
|
|
437
|
+
CollaborationHelper._storeUrl = function(sUrl, oAppStateService) {
|
|
420
438
|
oAppStateService.setData(sUrl);
|
|
421
439
|
return oAppStateService.save();
|
|
422
440
|
};
|
|
@@ -5,51 +5,51 @@
|
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
], function
|
|
15
|
-
|
|
8
|
+
"sap/base/Log",
|
|
9
|
+
"sap/ui/core/Core",
|
|
10
|
+
"./BaseHelperService",
|
|
11
|
+
"sap/ui/Device",
|
|
12
|
+
"sap/ui/core/Lib",
|
|
13
|
+
"sap/suite/ui/commons/collaboration/channels/MessageChannel"
|
|
14
|
+
], function(Log, Core, BaseHelperService, Device, Library, MessageChannel) {
|
|
15
|
+
"use strict";
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Provides the Collaboration options
|
|
19
|
+
* @namespace
|
|
20
|
+
* @since 1.125
|
|
21
|
+
* @alias module:sap/suite/ui/commons/collaboration/CollaborationManagerService
|
|
22
|
+
* @private
|
|
23
|
+
* @ui5-restricted
|
|
24
|
+
* @experimental Since 1.125
|
|
25
|
+
*/
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
var CollaborationManagerService = BaseHelperService.extend("sap.suite.ui.commons.collaboration.CollaborationManagerService");
|
|
28
|
+
var oResourceBundle = Library.getResourceBundleFor("sap.suite.ui.commons");
|
|
29
|
+
var oLogger = Log.getLogger("sap.suite.ui.commons.collaboration.CollaborationManagerService");
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
CollaborationManagerService.prototype.triggerH2HChat = function(sAppTitle, sCurrentURL, sEmailId) {
|
|
32
32
|
this.publishData({ sAppTitle, sCurrentURL, sEmailId });
|
|
33
|
-
|
|
33
|
+
};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
CollaborationManagerService.prototype.getOptions = function() {
|
|
36
|
+
var H2hChatPlugins = window["sap-ushell-config"] && window["sap-ushell-config"].bootstrapPlugins && window["sap-ushell-config"].bootstrapPlugins.H2H_CHAT_PLUGIN;
|
|
37
|
+
if (Device.system.desktop) {
|
|
38
|
+
if (H2hChatPlugins) {
|
|
39
|
+
return {
|
|
40
|
+
"text": oResourceBundle.getText("COLLABORATION_MANGER"),
|
|
41
|
+
"icon": "sap-icon://BusinessSuiteInAppSymbols/icon-collaboration-manager",
|
|
42
|
+
"press": this.triggerH2HChat.bind(this),
|
|
43
|
+
"fesrStepName": "CM:ShareLink"
|
|
44
|
+
};
|
|
45
|
+
} else {
|
|
46
|
+
oLogger.info("Consumer disable Collaboration Manager option");
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
oLogger.info("Collaboration Manager is not supported in Phone and Tablet");
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Distributes data from FLP and embedded iframes.
|
|
@@ -66,5 +66,5 @@ sap.ui.define([
|
|
|
66
66
|
}
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
return CollaborationManagerService;
|
|
70
70
|
});
|