@sapui5/sap.fe.navigation 1.100.0 → 1.102.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapui5/sap.fe.navigation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.102.0",
|
|
4
4
|
"description": "SAPUI5 Library sap.fe.navigation",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"author": "SAP SE (https://www.sap.com)",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"build": "echo 'nothing to do'",
|
|
10
10
|
"prepare-npm-sources": "babel target/npm-sources/src --out-dir target/npm-sources/src --extensions \".ts\" --config-file ../../.babelrc",
|
|
11
11
|
"prepare-ts-class-doc": "echo 'nothing to do'",
|
|
12
|
-
"prepare-ui5-build-sources": "
|
|
12
|
+
"prepare-ui5-build-sources": "echo 'nothing to do'",
|
|
13
13
|
"test": "echo 'nothing to do'"
|
|
14
14
|
},
|
|
15
15
|
"keywords": [
|
|
@@ -19,7 +19,7 @@ sap.ui.define(
|
|
|
19
19
|
"sap/ui/thirdparty/URI",
|
|
20
20
|
"sap/ui/util/openWindow"
|
|
21
21
|
],
|
|
22
|
-
function(
|
|
22
|
+
function (
|
|
23
23
|
NavError,
|
|
24
24
|
SelectionVariant,
|
|
25
25
|
NavLibrary,
|
|
@@ -97,7 +97,7 @@ sap.ui.define(
|
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
99
|
|
|
100
|
-
constructor: function(oController, sMode, sParamHandlingMode) {
|
|
100
|
+
constructor: function (oController, sMode, sParamHandlingMode) {
|
|
101
101
|
if (!oController) {
|
|
102
102
|
throw new NavError("NavigationHandler.INVALID_INPUT");
|
|
103
103
|
}
|
|
@@ -192,7 +192,7 @@ sap.ui.define(
|
|
|
192
192
|
* @returns {object} The Navigation service
|
|
193
193
|
* @private
|
|
194
194
|
*/
|
|
195
|
-
_getAppNavigationService: function() {
|
|
195
|
+
_getAppNavigationService: function () {
|
|
196
196
|
return sap.ushell.Container.getService("CrossApplicationNavigation");
|
|
197
197
|
},
|
|
198
198
|
|
|
@@ -203,10 +203,19 @@ sap.ui.define(
|
|
|
203
203
|
* @returns {object} The Router for the given Controller
|
|
204
204
|
* @private
|
|
205
205
|
*/
|
|
206
|
-
_getRouter: function(oController) {
|
|
206
|
+
_getRouter: function (oController) {
|
|
207
207
|
return UIComponent.getRouterFor(oController);
|
|
208
208
|
},
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* This method is to be used only by FE V2 to get access to toExternal promise.
|
|
212
|
+
* @param {object} fnCallback Callback to be called by 'navigate' method in case of toExternal is used to navigate.
|
|
213
|
+
* @private
|
|
214
|
+
*/
|
|
215
|
+
registerNavigateCallback: function (fnCallback) {
|
|
216
|
+
this._navigateCallback = fnCallback;
|
|
217
|
+
},
|
|
218
|
+
|
|
210
219
|
/**
|
|
211
220
|
* Triggers a cross-app navigation after saving the inner and the cross-app states. The navigation mode based on
|
|
212
221
|
* <code>sap-ushell-next-navmode</code> is taken into account. If set to <code>explace</code> the inner app state will not be changed.
|
|
@@ -295,14 +304,15 @@ sap.ui.define(
|
|
|
295
304
|
* });
|
|
296
305
|
* </code>
|
|
297
306
|
*/
|
|
298
|
-
navigate: function(sSemanticObject, sActionName, vNavigationParameters, oInnerAppData, fnOnError, oExternalAppData, sNavMode) {
|
|
307
|
+
navigate: function (sSemanticObject, sActionName, vNavigationParameters, oInnerAppData, fnOnError, oExternalAppData, sNavMode) {
|
|
299
308
|
var sSelectionVariant,
|
|
300
309
|
mParameters,
|
|
301
310
|
oXAppDataObj,
|
|
302
311
|
oComponentData,
|
|
303
312
|
oStartupParameters,
|
|
304
313
|
bExPlace = false,
|
|
305
|
-
oTmpData = {}
|
|
314
|
+
oTmpData = {},
|
|
315
|
+
that = this;
|
|
306
316
|
|
|
307
317
|
oComponentData = this.oComponent.getComponentData();
|
|
308
318
|
/*
|
|
@@ -340,8 +350,11 @@ sap.ui.define(
|
|
|
340
350
|
if (typeof vNavigationParameters === "string") {
|
|
341
351
|
sSelectionVariant = vNavigationParameters;
|
|
342
352
|
} else if (typeof vNavigationParameters === "object") {
|
|
343
|
-
var oEnrichedSelVar = this._splitInboundNavigationParameters(
|
|
344
|
-
|
|
353
|
+
var oEnrichedSelVar = this._splitInboundNavigationParameters(
|
|
354
|
+
new SelectionVariant(),
|
|
355
|
+
vNavigationParameters,
|
|
356
|
+
[]
|
|
357
|
+
).oNavigationSelVar;
|
|
345
358
|
sSelectionVariant = oEnrichedSelVar.toJSONString();
|
|
346
359
|
} else {
|
|
347
360
|
throw new NavError("NavigationHandler.INVALID_INPUT");
|
|
@@ -377,7 +390,7 @@ sap.ui.define(
|
|
|
377
390
|
}
|
|
378
391
|
|
|
379
392
|
var oSupportedPromise = oNavHandler.oCrossAppNavService.isNavigationSupported([oNavArguments], oNavHandler.oComponent);
|
|
380
|
-
oSupportedPromise.done(function(oTargets) {
|
|
393
|
+
oSupportedPromise.done(function (oTargets) {
|
|
381
394
|
if (oTargets[0].supported) {
|
|
382
395
|
var oReturn;
|
|
383
396
|
|
|
@@ -406,14 +419,23 @@ sap.ui.define(
|
|
|
406
419
|
// toExternal sets sap-xapp-state in the URL if appStateKey is provided in oNavArguments
|
|
407
420
|
// toExternal has issues on sticky apps FIORITECHP1-14400, temp fix using hrefForExternal
|
|
408
421
|
if (sNavMode == "explace") {
|
|
409
|
-
var
|
|
422
|
+
var sNewHrefPromise = oNavHandler.oCrossAppNavService.hrefForExternalAsync(
|
|
410
423
|
oNavArguments,
|
|
411
|
-
oNavHandler.oComponent
|
|
412
|
-
false
|
|
424
|
+
oNavHandler.oComponent
|
|
413
425
|
);
|
|
414
|
-
|
|
426
|
+
sNewHrefPromise
|
|
427
|
+
.then(function (sNewHref) {
|
|
428
|
+
openWindow(sNewHref);
|
|
429
|
+
})
|
|
430
|
+
.catch(function (oError) {
|
|
431
|
+
Log.error("Error while retireving hrefForExternal : " + oError);
|
|
432
|
+
});
|
|
415
433
|
} else {
|
|
416
|
-
oNavHandler.oCrossAppNavService.toExternal(oNavArguments, oNavHandler.oComponent);
|
|
434
|
+
var ptoExt = oNavHandler.oCrossAppNavService.toExternal(oNavArguments, oNavHandler.oComponent);
|
|
435
|
+
// TODO: This is just a temporary solution to allow FE V2 to use toExternal promise.
|
|
436
|
+
if (that._navigateCallback) {
|
|
437
|
+
that._navigateCallback(ptoExt);
|
|
438
|
+
}
|
|
417
439
|
}
|
|
418
440
|
} // else : error was already reported
|
|
419
441
|
} else {
|
|
@@ -426,7 +448,7 @@ sap.ui.define(
|
|
|
426
448
|
});
|
|
427
449
|
|
|
428
450
|
if (fnOnError) {
|
|
429
|
-
oSupportedPromise.fail(function() {
|
|
451
|
+
oSupportedPromise.fail(function () {
|
|
430
452
|
// technical error: could not determine if intent is supported
|
|
431
453
|
var oError = oNavHandler._createTechnicalError("NavigationHandler.isIntentSupported.failed");
|
|
432
454
|
fnOnError(oError);
|
|
@@ -487,7 +509,7 @@ sap.ui.define(
|
|
|
487
509
|
* });
|
|
488
510
|
* </code>
|
|
489
511
|
*/
|
|
490
|
-
parseNavigation: function() {
|
|
512
|
+
parseNavigation: function () {
|
|
491
513
|
var sAppHash = HashChanger.getInstance().getHash();
|
|
492
514
|
/*
|
|
493
515
|
* use .getHash() here instead of .getAppHash() to also be able dealing with environments where only SAPUI5 is loaded and the UShell is
|
|
@@ -523,7 +545,7 @@ sap.ui.define(
|
|
|
523
545
|
|
|
524
546
|
var oMyDeferred = jQuery.Deferred();
|
|
525
547
|
var oNavHandler = this;
|
|
526
|
-
var parseUrlParams = function(oStartupParameters, aDefaultedParameters, oMyDeferred, sNavType) {
|
|
548
|
+
var parseUrlParams = function (oStartupParameters, aDefaultedParameters, oMyDeferred, sNavType) {
|
|
527
549
|
// standard URL navigation
|
|
528
550
|
var oSelVars = oNavHandler._splitInboundNavigationParameters(
|
|
529
551
|
new SelectionVariant(),
|
|
@@ -559,7 +581,7 @@ sap.ui.define(
|
|
|
559
581
|
// inner app state was not found in the AppHash, but xapp state => try to read the xapp state
|
|
560
582
|
var oStartupPromise = this.oCrossAppNavService.getStartupAppState(this.oComponent);
|
|
561
583
|
|
|
562
|
-
oStartupPromise.done(function(oAppState) {
|
|
584
|
+
oStartupPromise.done(function (oAppState) {
|
|
563
585
|
// get app state from sap-xapp-state,
|
|
564
586
|
// create a copy, not only a reference, because we want to modify the object
|
|
565
587
|
var oAppStateData = oAppState.getData();
|
|
@@ -596,7 +618,7 @@ sap.ui.define(
|
|
|
596
618
|
}
|
|
597
619
|
}
|
|
598
620
|
});
|
|
599
|
-
oStartupPromise.fail(function() {
|
|
621
|
+
oStartupPromise.fail(function () {
|
|
600
622
|
var oError = oNavHandler._createTechnicalError("NavigationHandler.getStartupState.failed");
|
|
601
623
|
oMyDeferred.reject(oError, {}, NavType.xAppState);
|
|
602
624
|
});
|
|
@@ -627,7 +649,7 @@ sap.ui.define(
|
|
|
627
649
|
* <code>undefined</code> may be used to reset the complete list.
|
|
628
650
|
* @public
|
|
629
651
|
*/
|
|
630
|
-
setTechnicalParameters: function(aTechnicalParameters) {
|
|
652
|
+
setTechnicalParameters: function (aTechnicalParameters) {
|
|
631
653
|
if (!aTechnicalParameters) {
|
|
632
654
|
aTechnicalParameters = [];
|
|
633
655
|
}
|
|
@@ -652,7 +674,7 @@ sap.ui.define(
|
|
|
652
674
|
* @returns {Array} Containing the technical parameters.
|
|
653
675
|
* @public
|
|
654
676
|
*/
|
|
655
|
-
getTechnicalParameters: function() {
|
|
677
|
+
getTechnicalParameters: function () {
|
|
656
678
|
return this._aTechnicalParamaters.concat([]);
|
|
657
679
|
},
|
|
658
680
|
|
|
@@ -662,7 +684,7 @@ sap.ui.define(
|
|
|
662
684
|
* @returns {boolean} Indicates if the parameter is considered as technical parameter or not.
|
|
663
685
|
* @private
|
|
664
686
|
*/
|
|
665
|
-
_isTechnicalParameter: function(sParameterName) {
|
|
687
|
+
_isTechnicalParameter: function (sParameterName) {
|
|
666
688
|
if (sParameterName) {
|
|
667
689
|
if (
|
|
668
690
|
!(
|
|
@@ -682,13 +704,17 @@ sap.ui.define(
|
|
|
682
704
|
return false;
|
|
683
705
|
},
|
|
684
706
|
|
|
707
|
+
_isFEParameter: function (sParameterName) {
|
|
708
|
+
return sParameterName.toLowerCase().indexOf("sap-ui-fe") === 0;
|
|
709
|
+
},
|
|
710
|
+
|
|
685
711
|
/**
|
|
686
712
|
* Rmoves if the passed parameter is considered as technical parameter.
|
|
687
713
|
* @param {object} oSelectionVariant Selection Variant which consists of technical Parameters.
|
|
688
714
|
* @returns {object} Selection Variant without technical Parameters.
|
|
689
715
|
* @private
|
|
690
716
|
*/
|
|
691
|
-
_removeTechnicalParameters: function(oSelectionVariant) {
|
|
717
|
+
_removeTechnicalParameters: function (oSelectionVariant) {
|
|
692
718
|
var sPropName, i;
|
|
693
719
|
var aSelVarPropNames = oSelectionVariant.getSelectOptionsPropertyNames();
|
|
694
720
|
for (i = 0; i < aSelVarPropNames.length; i++) {
|
|
@@ -728,7 +754,7 @@ sap.ui.define(
|
|
|
728
754
|
* returned as is.
|
|
729
755
|
* @private
|
|
730
756
|
*/
|
|
731
|
-
_splitInboundNavigationParameters: function(oSelectionVariant, oStartupParameters, aDefaultedParameters) {
|
|
757
|
+
_splitInboundNavigationParameters: function (oSelectionVariant, oStartupParameters, aDefaultedParameters) {
|
|
732
758
|
if (!Array.isArray(aDefaultedParameters)) {
|
|
733
759
|
throw new NavError("NavigationHandler.INVALID_INPUT");
|
|
734
760
|
}
|
|
@@ -742,11 +768,12 @@ sap.ui.define(
|
|
|
742
768
|
}
|
|
743
769
|
|
|
744
770
|
// if (sPropName === this.sSAPSystemProp || sPropName === this.sDefaultedParamProp) {
|
|
745
|
-
if (this._isTechnicalParameter(sPropName)) {
|
|
771
|
+
if (this._isTechnicalParameter(sPropName) || this._isFEParameter(sPropName)) {
|
|
746
772
|
// Do not add the SAP system parameter to the selection variant as it is a technical parameter
|
|
747
773
|
// not relevant for the selection variant.
|
|
748
774
|
// Do not add the startup parameter for default values to the selection variant. The information, which parameters
|
|
749
775
|
// are defaulted, is available in the defaulted selection variant.
|
|
776
|
+
// In case, FE Parameters we shall skip it.(the application needs to fetch it from URL params)
|
|
750
777
|
continue;
|
|
751
778
|
}
|
|
752
779
|
|
|
@@ -842,7 +869,7 @@ sap.ui.define(
|
|
|
842
869
|
};
|
|
843
870
|
},
|
|
844
871
|
|
|
845
|
-
_addParameterValues: function(oSelVariant, sPropName, sSign, sOption, oValues) {
|
|
872
|
+
_addParameterValues: function (oSelVariant, sPropName, sSign, sOption, oValues) {
|
|
846
873
|
if (Array.isArray(oValues)) {
|
|
847
874
|
for (var i = 0; i < oValues.length; i++) {
|
|
848
875
|
oSelVariant.addSelectOption(sPropName, sSign, sOption, oValues[i]);
|
|
@@ -857,7 +884,7 @@ sap.ui.define(
|
|
|
857
884
|
* @param {string} sAppStateKey The new app state key.
|
|
858
885
|
* @public
|
|
859
886
|
*/
|
|
860
|
-
replaceHash: function(sAppStateKey) {
|
|
887
|
+
replaceHash: function (sAppStateKey) {
|
|
861
888
|
var oHashChanger = this.oRouter.oHashChanger ? this.oRouter.oHashChanger : HashChanger.getInstance();
|
|
862
889
|
var sAppHashOld = oHashChanger.getHash();
|
|
863
890
|
/*
|
|
@@ -906,14 +933,14 @@ sap.ui.define(
|
|
|
906
933
|
* });
|
|
907
934
|
* </code>
|
|
908
935
|
*/
|
|
909
|
-
storeInnerAppState: function(mInnerAppData, bImmediateHashReplace) {
|
|
936
|
+
storeInnerAppState: function (mInnerAppData, bImmediateHashReplace) {
|
|
910
937
|
if (typeof bImmediateHashReplace !== "boolean") {
|
|
911
938
|
bImmediateHashReplace = true; // default
|
|
912
939
|
}
|
|
913
940
|
var oNavHandler = this;
|
|
914
941
|
var oMyDeferred = jQuery.Deferred();
|
|
915
942
|
|
|
916
|
-
var fnReplaceHash = function(sAppStateKey) {
|
|
943
|
+
var fnReplaceHash = function (sAppStateKey) {
|
|
917
944
|
var oHashChanger = oNavHandler.oRouter.oHashChanger ? oNavHandler.oRouter.oHashChanger : HashChanger.getInstance();
|
|
918
945
|
var sAppHashOld = oHashChanger.getHash();
|
|
919
946
|
/*
|
|
@@ -947,7 +974,7 @@ sap.ui.define(
|
|
|
947
974
|
// passed inner app state not found in cache
|
|
948
975
|
this._oLastSavedInnerAppData.iCacheMiss++;
|
|
949
976
|
|
|
950
|
-
var fnOnAfterSave = function(sAppStateKey) {
|
|
977
|
+
var fnOnAfterSave = function (sAppStateKey) {
|
|
951
978
|
// replace inner app hash with new appStateKey in url
|
|
952
979
|
if (!bImmediateHashReplace) {
|
|
953
980
|
fnReplaceHash(sAppStateKey);
|
|
@@ -959,7 +986,7 @@ sap.ui.define(
|
|
|
959
986
|
oMyDeferred.resolve(sAppStateKey);
|
|
960
987
|
};
|
|
961
988
|
|
|
962
|
-
var fnOnError = function(oError) {
|
|
989
|
+
var fnOnError = function (oError) {
|
|
963
990
|
oMyDeferred.reject(oError);
|
|
964
991
|
};
|
|
965
992
|
|
|
@@ -1025,7 +1052,7 @@ sap.ui.define(
|
|
|
1025
1052
|
* </code>
|
|
1026
1053
|
* @public
|
|
1027
1054
|
*/
|
|
1028
|
-
storeInnerAppStateWithImmediateReturn: function(mInnerAppData, bImmediateHashReplace) {
|
|
1055
|
+
storeInnerAppStateWithImmediateReturn: function (mInnerAppData, bImmediateHashReplace) {
|
|
1029
1056
|
if (typeof bImmediateHashReplace !== "boolean") {
|
|
1030
1057
|
bImmediateHashReplace = false; // default
|
|
1031
1058
|
}
|
|
@@ -1057,7 +1084,7 @@ sap.ui.define(
|
|
|
1057
1084
|
// passed inner app state not found in cache
|
|
1058
1085
|
this._oLastSavedInnerAppData.iCacheMiss++;
|
|
1059
1086
|
|
|
1060
|
-
var fnOnAfterSave = function(sAppStateKey) {
|
|
1087
|
+
var fnOnAfterSave = function (sAppStateKey) {
|
|
1061
1088
|
// replace inner app hash with new appStateKey in url
|
|
1062
1089
|
if (!bImmediateHashReplace) {
|
|
1063
1090
|
that.replaceHash(sAppStateKey);
|
|
@@ -1069,7 +1096,7 @@ sap.ui.define(
|
|
|
1069
1096
|
oAppStatePromise.resolve(sAppStateKey);
|
|
1070
1097
|
};
|
|
1071
1098
|
|
|
1072
|
-
var fnOnError = function(oError) {
|
|
1099
|
+
var fnOnError = function (oError) {
|
|
1073
1100
|
oAppStatePromise.reject(oError);
|
|
1074
1101
|
};
|
|
1075
1102
|
|
|
@@ -1162,7 +1189,7 @@ sap.ui.define(
|
|
|
1162
1189
|
* });
|
|
1163
1190
|
* </code>
|
|
1164
1191
|
*/
|
|
1165
|
-
processBeforeSmartLinkPopoverOpens: function(oTableEventParameters, sSelectionVariant, mInnerAppData, oExternalAppData) {
|
|
1192
|
+
processBeforeSmartLinkPopoverOpens: function (oTableEventParameters, sSelectionVariant, mInnerAppData, oExternalAppData) {
|
|
1166
1193
|
var oMyDeferred = jQuery.Deferred();
|
|
1167
1194
|
var mSemanticAttributes;
|
|
1168
1195
|
if (oTableEventParameters != undefined) {
|
|
@@ -1178,7 +1205,7 @@ sap.ui.define(
|
|
|
1178
1205
|
oXAppDataObj = oExternalAppData;
|
|
1179
1206
|
}
|
|
1180
1207
|
|
|
1181
|
-
var fnStoreXappAndCallOpen = function(mSemanticAttributes, sSelectionVariant) {
|
|
1208
|
+
var fnStoreXappAndCallOpen = function (mSemanticAttributes, sSelectionVariant) {
|
|
1182
1209
|
// mix the semantic attributes (e.g. from the row line) with the selection variant (e.g. from the filter bar)
|
|
1183
1210
|
sSelectionVariant = oXAppDataObj.selectionVariant || sSelectionVariant || "{}";
|
|
1184
1211
|
|
|
@@ -1209,7 +1236,7 @@ sap.ui.define(
|
|
|
1209
1236
|
? oNavHandler._getURLParametersFromSelectionVariant(new SelectionVariant(oTmpData.selectionVariant))
|
|
1210
1237
|
: {};
|
|
1211
1238
|
|
|
1212
|
-
var fnOnContainerSave = function(sAppStateKey) {
|
|
1239
|
+
var fnOnContainerSave = function (sAppStateKey) {
|
|
1213
1240
|
if (oTableEventParameters === undefined) {
|
|
1214
1241
|
// If oTableEventParameters is undefined, return both semanticAttributes and appStatekey
|
|
1215
1242
|
oMyDeferred.resolve(mSemanticAttributes, sAppStateKey);
|
|
@@ -1223,7 +1250,7 @@ sap.ui.define(
|
|
|
1223
1250
|
}
|
|
1224
1251
|
};
|
|
1225
1252
|
|
|
1226
|
-
var fnOnError = function(oError) {
|
|
1253
|
+
var fnOnError = function (oError) {
|
|
1227
1254
|
oMyDeferred.reject(oError);
|
|
1228
1255
|
};
|
|
1229
1256
|
|
|
@@ -1238,11 +1265,11 @@ sap.ui.define(
|
|
|
1238
1265
|
var oStoreInnerAppStatePromise = this.storeInnerAppState(mInnerAppData, true);
|
|
1239
1266
|
|
|
1240
1267
|
// if the inner app state was successfully stored, store also the xapp-state
|
|
1241
|
-
oStoreInnerAppStatePromise.done(function() {
|
|
1268
|
+
oStoreInnerAppStatePromise.done(function () {
|
|
1242
1269
|
fnStoreXappAndCallOpen(mSemanticAttributes, sSelectionVariant);
|
|
1243
1270
|
});
|
|
1244
1271
|
|
|
1245
|
-
oStoreInnerAppStatePromise.fail(function(oError) {
|
|
1272
|
+
oStoreInnerAppStatePromise.fail(function (oError) {
|
|
1246
1273
|
oMyDeferred.reject(oError);
|
|
1247
1274
|
});
|
|
1248
1275
|
} else {
|
|
@@ -1282,11 +1309,11 @@ sap.ui.define(
|
|
|
1282
1309
|
* @private
|
|
1283
1310
|
* @ui5-restricted
|
|
1284
1311
|
*/
|
|
1285
|
-
_getAppStateKeyAndUrlParameters: function(sSelectionVariant) {
|
|
1312
|
+
_getAppStateKeyAndUrlParameters: function (sSelectionVariant) {
|
|
1286
1313
|
return this.processBeforeSmartLinkPopoverOpens(undefined, sSelectionVariant, undefined, undefined);
|
|
1287
1314
|
},
|
|
1288
1315
|
|
|
1289
|
-
_mixAttributesToSelVariant: function(mSemanticAttributes, oSelVariant, iSuppressionBehavior) {
|
|
1316
|
+
_mixAttributesToSelVariant: function (mSemanticAttributes, oSelVariant, iSuppressionBehavior) {
|
|
1290
1317
|
// add all semantic attributes to the mixed selection variant
|
|
1291
1318
|
for (var sPropertyName in mSemanticAttributes) {
|
|
1292
1319
|
if (mSemanticAttributes.hasOwnProperty(sPropertyName)) {
|
|
@@ -1377,7 +1404,7 @@ sap.ui.define(
|
|
|
1377
1404
|
* });
|
|
1378
1405
|
* </code>
|
|
1379
1406
|
*/
|
|
1380
|
-
mixAttributesAndSelectionVariant: function(vSemanticAttributes, sSelectionVariant, iSuppressionBehavior) {
|
|
1407
|
+
mixAttributesAndSelectionVariant: function (vSemanticAttributes, sSelectionVariant, iSuppressionBehavior) {
|
|
1381
1408
|
var oSelectionVariant = new SelectionVariant(sSelectionVariant);
|
|
1382
1409
|
var oNewSelVariant = new SelectionVariant();
|
|
1383
1410
|
var that = this;
|
|
@@ -1389,7 +1416,7 @@ sap.ui.define(
|
|
|
1389
1416
|
oNewSelVariant.setParameterContextUrl(oSelectionVariant.getParameterContextUrl());
|
|
1390
1417
|
}
|
|
1391
1418
|
if (Array.isArray(vSemanticAttributes)) {
|
|
1392
|
-
vSemanticAttributes.forEach(function(mSemanticAttributes) {
|
|
1419
|
+
vSemanticAttributes.forEach(function (mSemanticAttributes) {
|
|
1393
1420
|
that._mixAttributesToSelVariant(mSemanticAttributes, oNewSelVariant, iSuppressionBehavior);
|
|
1394
1421
|
});
|
|
1395
1422
|
} else {
|
|
@@ -1425,7 +1452,7 @@ sap.ui.define(
|
|
|
1425
1452
|
return oNewSelVariant;
|
|
1426
1453
|
},
|
|
1427
1454
|
|
|
1428
|
-
_ensureSelectionVariantFormatString: function(vSelectionVariant) {
|
|
1455
|
+
_ensureSelectionVariantFormatString: function (vSelectionVariant) {
|
|
1429
1456
|
/*
|
|
1430
1457
|
* There are legacy AppStates where the SelectionVariant is being stored as a string. However, that is not compliant to the specification,
|
|
1431
1458
|
* which states that a standard JS object shall be provided. Internally, however, the selectionVariant is always of type string. Situation
|
|
@@ -1446,10 +1473,10 @@ sap.ui.define(
|
|
|
1446
1473
|
return vConvertedSelectionVariant;
|
|
1447
1474
|
},
|
|
1448
1475
|
|
|
1449
|
-
_saveAppState: function(oAppData, fnOnAfterSave, fnOnError) {
|
|
1476
|
+
_saveAppState: function (oAppData, fnOnAfterSave, fnOnError) {
|
|
1450
1477
|
var oReturn = this._saveAppStateWithImmediateReturn(oAppData, fnOnError);
|
|
1451
1478
|
if (oReturn) {
|
|
1452
|
-
oReturn.promise.done(function() {
|
|
1479
|
+
oReturn.promise.done(function () {
|
|
1453
1480
|
if (fnOnAfterSave) {
|
|
1454
1481
|
fnOnAfterSave(oReturn.appStateKey);
|
|
1455
1482
|
}
|
|
@@ -1457,7 +1484,7 @@ sap.ui.define(
|
|
|
1457
1484
|
|
|
1458
1485
|
if (fnOnError) {
|
|
1459
1486
|
var oNavHandler = this;
|
|
1460
|
-
oReturn.promise.fail(function() {
|
|
1487
|
+
oReturn.promise.fail(function () {
|
|
1461
1488
|
var oError = oNavHandler._createTechnicalError("NavigationHandler.AppStateSave.failed");
|
|
1462
1489
|
fnOnError(oError);
|
|
1463
1490
|
});
|
|
@@ -1468,7 +1495,7 @@ sap.ui.define(
|
|
|
1468
1495
|
return undefined;
|
|
1469
1496
|
},
|
|
1470
1497
|
|
|
1471
|
-
_saveAppStateWithImmediateReturn: function(oAppData, fnOnError) {
|
|
1498
|
+
_saveAppStateWithImmediateReturn: function (oAppData, fnOnError) {
|
|
1472
1499
|
var oAppState = this.oCrossAppNavService.createEmptyAppState(this.oComponent);
|
|
1473
1500
|
var sAppStateKey = oAppState.getKey();
|
|
1474
1501
|
var oAppDataForSave = {};
|
|
@@ -1534,11 +1561,11 @@ sap.ui.define(
|
|
|
1534
1561
|
};
|
|
1535
1562
|
},
|
|
1536
1563
|
|
|
1537
|
-
_loadAppState: function(sAppStateKey, oDeferred) {
|
|
1564
|
+
_loadAppState: function (sAppStateKey, oDeferred) {
|
|
1538
1565
|
var oAppStatePromise = this.oCrossAppNavService.getAppState(this.oComponent, sAppStateKey);
|
|
1539
1566
|
var oNavHandler = this;
|
|
1540
1567
|
|
|
1541
|
-
oAppStatePromise.done(function(oAppState) {
|
|
1568
|
+
oAppStatePromise.done(function (oAppState) {
|
|
1542
1569
|
var oAppData = {};
|
|
1543
1570
|
var oAppDataLoaded = oAppState.getData();
|
|
1544
1571
|
|
|
@@ -1601,7 +1628,7 @@ sap.ui.define(
|
|
|
1601
1628
|
// the done method will receive the loaded appState and the navigation type as parameters
|
|
1602
1629
|
oDeferred.resolve(oAppData, {}, NavType.iAppState);
|
|
1603
1630
|
});
|
|
1604
|
-
oAppStatePromise.fail(function() {
|
|
1631
|
+
oAppStatePromise.fail(function () {
|
|
1605
1632
|
var oError = oNavHandler._createTechnicalError("NavigationHandler.getAppState.failed");
|
|
1606
1633
|
oDeferred.reject(oError, {}, NavType.iAppState);
|
|
1607
1634
|
});
|
|
@@ -1616,7 +1643,7 @@ sap.ui.define(
|
|
|
1616
1643
|
* case that no sap-iapp-state was found in <code>sAppHash</code>.
|
|
1617
1644
|
* @private
|
|
1618
1645
|
*/
|
|
1619
|
-
_getInnerAppStateKey: function(sAppHash) {
|
|
1646
|
+
_getInnerAppStateKey: function (sAppHash) {
|
|
1620
1647
|
// trivial case: no app hash available at all.
|
|
1621
1648
|
if (!sAppHash) {
|
|
1622
1649
|
return undefined;
|
|
@@ -1657,7 +1684,7 @@ sap.ui.define(
|
|
|
1657
1684
|
* format (sap-iapp-state as part of the keys/route), the format is converted to the new format before the result is returned.
|
|
1658
1685
|
* @private
|
|
1659
1686
|
*/
|
|
1660
|
-
_replaceInnerAppStateKey: function(sAppHash, sAppStateKey) {
|
|
1687
|
+
_replaceInnerAppStateKey: function (sAppHash, sAppStateKey) {
|
|
1661
1688
|
var sNewIAppState = this.IAPP_STATE + "=" + sAppStateKey;
|
|
1662
1689
|
|
|
1663
1690
|
/*
|
|
@@ -1668,7 +1695,7 @@ sap.ui.define(
|
|
|
1668
1695
|
return "?" + sNewIAppState;
|
|
1669
1696
|
}
|
|
1670
1697
|
|
|
1671
|
-
var fnAppendToQueryParameter = function(sAppHash) {
|
|
1698
|
+
var fnAppendToQueryParameter = function (sAppHash) {
|
|
1672
1699
|
// there is an AppHash available, but it does not contain a sap-iapp-state parameter yet - we need to append one
|
|
1673
1700
|
|
|
1674
1701
|
// new approach: we need to check, if a set of query parameters is already available
|
|
@@ -1687,14 +1714,14 @@ sap.ui.define(
|
|
|
1687
1714
|
|
|
1688
1715
|
if (this._rIAppStateNew.test(sAppHash)) {
|
|
1689
1716
|
// the new approach is being used
|
|
1690
|
-
return sAppHash.replace(this._rIAppStateNew, function(sNeedle) {
|
|
1717
|
+
return sAppHash.replace(this._rIAppStateNew, function (sNeedle) {
|
|
1691
1718
|
return sNeedle.replace(/\=.*/gi, "=" + sAppStateKey);
|
|
1692
1719
|
});
|
|
1693
1720
|
}
|
|
1694
1721
|
|
|
1695
1722
|
// we need to remove the old AppHash entirely and replace it with a new one.
|
|
1696
1723
|
|
|
1697
|
-
var fnReplaceOldApproach = function(rOldApproach, sAppHash) {
|
|
1724
|
+
var fnReplaceOldApproach = function (rOldApproach, sAppHash) {
|
|
1698
1725
|
sAppHash = sAppHash.replace(rOldApproach, "");
|
|
1699
1726
|
return fnAppendToQueryParameter(sAppHash);
|
|
1700
1727
|
};
|
|
@@ -1711,7 +1738,7 @@ sap.ui.define(
|
|
|
1711
1738
|
return undefined;
|
|
1712
1739
|
},
|
|
1713
1740
|
|
|
1714
|
-
_getURLParametersFromSelectionVariant: function(vSelectionVariant) {
|
|
1741
|
+
_getURLParametersFromSelectionVariant: function (vSelectionVariant) {
|
|
1715
1742
|
var mURLParameters = {};
|
|
1716
1743
|
var i = 0;
|
|
1717
1744
|
|
|
@@ -1742,7 +1769,7 @@ sap.ui.define(
|
|
|
1742
1769
|
return mURLParameters;
|
|
1743
1770
|
},
|
|
1744
1771
|
|
|
1745
|
-
_createTechnicalError: function(sErrorCode) {
|
|
1772
|
+
_createTechnicalError: function (sErrorCode) {
|
|
1746
1773
|
return new NavError(sErrorCode);
|
|
1747
1774
|
},
|
|
1748
1775
|
|
|
@@ -1752,15 +1779,15 @@ sap.ui.define(
|
|
|
1752
1779
|
* @public
|
|
1753
1780
|
* @param {sap.ui.model.odata.v2.ODataModel} oModel For checking sensitive information
|
|
1754
1781
|
*/
|
|
1755
|
-
setModel: function(oModel) {
|
|
1782
|
+
setModel: function (oModel) {
|
|
1756
1783
|
this._oModel = oModel;
|
|
1757
1784
|
},
|
|
1758
1785
|
|
|
1759
|
-
_getModel: function() {
|
|
1786
|
+
_getModel: function () {
|
|
1760
1787
|
return this._oModel || this.oComponent.getModel();
|
|
1761
1788
|
},
|
|
1762
1789
|
|
|
1763
|
-
_removeAllProperties: function(oData) {
|
|
1790
|
+
_removeAllProperties: function (oData) {
|
|
1764
1791
|
if (oData) {
|
|
1765
1792
|
if (oData.selectionVariant) {
|
|
1766
1793
|
oData.selectionVariant = null;
|
|
@@ -1776,11 +1803,11 @@ sap.ui.define(
|
|
|
1776
1803
|
}
|
|
1777
1804
|
},
|
|
1778
1805
|
|
|
1779
|
-
_removeProperties: function(aFilterName, aParameterName, oData) {
|
|
1806
|
+
_removeProperties: function (aFilterName, aParameterName, oData) {
|
|
1780
1807
|
if (aFilterName.length && oData && (oData.selectionVariant || oData.valueTexts || oData.semanticDates)) {
|
|
1781
|
-
aFilterName.forEach(function(sName) {
|
|
1808
|
+
aFilterName.forEach(function (sName) {
|
|
1782
1809
|
if (oData.selectionVariant.SelectOptions) {
|
|
1783
|
-
oData.selectionVariant.SelectOptions.some(function(oValue, nIdx) {
|
|
1810
|
+
oData.selectionVariant.SelectOptions.some(function (oValue, nIdx) {
|
|
1784
1811
|
if (sName === oValue.PropertyName) {
|
|
1785
1812
|
oData.selectionVariant.SelectOptions.splice(nIdx, 1);
|
|
1786
1813
|
return true;
|
|
@@ -1791,9 +1818,9 @@ sap.ui.define(
|
|
|
1791
1818
|
}
|
|
1792
1819
|
|
|
1793
1820
|
if (oData.valueTexts && oData.valueTexts.Texts) {
|
|
1794
|
-
oData.valueTexts.Texts.forEach(function(oTexts) {
|
|
1821
|
+
oData.valueTexts.Texts.forEach(function (oTexts) {
|
|
1795
1822
|
if (oTexts.PropertyTexts) {
|
|
1796
|
-
oTexts.PropertyTexts.some(function(oValue, nIdx) {
|
|
1823
|
+
oTexts.PropertyTexts.some(function (oValue, nIdx) {
|
|
1797
1824
|
if (sName === oValue.PropertyName) {
|
|
1798
1825
|
oTexts.PropertyTexts.splice(nIdx, 1);
|
|
1799
1826
|
return true;
|
|
@@ -1806,7 +1833,7 @@ sap.ui.define(
|
|
|
1806
1833
|
}
|
|
1807
1834
|
|
|
1808
1835
|
if (oData.semanticDates && oData.semanticDates.Dates) {
|
|
1809
|
-
oData.semanticDates.Dates.forEach(function(oDates, nIdx) {
|
|
1836
|
+
oData.semanticDates.Dates.forEach(function (oDates, nIdx) {
|
|
1810
1837
|
if (sName === oDates.PropertyName) {
|
|
1811
1838
|
oData.semanticDates.Dates.splice(nIdx, 1);
|
|
1812
1839
|
}
|
|
@@ -1816,8 +1843,8 @@ sap.ui.define(
|
|
|
1816
1843
|
}
|
|
1817
1844
|
|
|
1818
1845
|
if (aParameterName.length && oData && oData.selectionVariant && oData.selectionVariant.Parameters) {
|
|
1819
|
-
aParameterName.forEach(function(sName) {
|
|
1820
|
-
oData.selectionVariant.Parameters.some(function(oValue, nIdx) {
|
|
1846
|
+
aParameterName.forEach(function (sName) {
|
|
1847
|
+
oData.selectionVariant.Parameters.some(function (oValue, nIdx) {
|
|
1821
1848
|
if (sName === oValue.PropertyName || "$Parameter." + sName === oValue.PropertyName) {
|
|
1822
1849
|
oData.selectionVariant.Parameters.splice(nIdx, 1);
|
|
1823
1850
|
return true;
|
|
@@ -1829,8 +1856,8 @@ sap.ui.define(
|
|
|
1829
1856
|
}
|
|
1830
1857
|
},
|
|
1831
1858
|
|
|
1832
|
-
_isTermTrue: function(oProperty, sTerm) {
|
|
1833
|
-
var fIsTermDefaultTrue = function(oTerm) {
|
|
1859
|
+
_isTermTrue: function (oProperty, sTerm) {
|
|
1860
|
+
var fIsTermDefaultTrue = function (oTerm) {
|
|
1834
1861
|
if (oTerm) {
|
|
1835
1862
|
return oTerm.Bool ? oTerm.Bool !== "false" : true;
|
|
1836
1863
|
}
|
|
@@ -1840,19 +1867,19 @@ sap.ui.define(
|
|
|
1840
1867
|
return !!oProperty[sTerm] && fIsTermDefaultTrue(oProperty[sTerm]);
|
|
1841
1868
|
},
|
|
1842
1869
|
|
|
1843
|
-
_isExcludedFromNavigationContext: function(oProperty) {
|
|
1870
|
+
_isExcludedFromNavigationContext: function (oProperty) {
|
|
1844
1871
|
return this._isTermTrue(oProperty, "com.sap.vocabularies.UI.v1.ExcludeFromNavigationContext");
|
|
1845
1872
|
},
|
|
1846
1873
|
|
|
1847
|
-
_isPotentiallySensitive: function(oProperty) {
|
|
1874
|
+
_isPotentiallySensitive: function (oProperty) {
|
|
1848
1875
|
return this._isTermTrue(oProperty, "com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive");
|
|
1849
1876
|
},
|
|
1850
1877
|
|
|
1851
|
-
_isMeasureProperty: function(oProperty) {
|
|
1878
|
+
_isMeasureProperty: function (oProperty) {
|
|
1852
1879
|
return this._isTermTrue(oProperty, "com.sap.vocabularies.Analytics.v1.Measure");
|
|
1853
1880
|
},
|
|
1854
1881
|
|
|
1855
|
-
_isToBeExcluded: function(oProperty) {
|
|
1882
|
+
_isToBeExcluded: function (oProperty) {
|
|
1856
1883
|
return this._isPotentiallySensitive(oProperty) || this._isExcludedFromNavigationContext(oProperty);
|
|
1857
1884
|
},
|
|
1858
1885
|
|
|
@@ -1867,7 +1894,7 @@ sap.ui.define(
|
|
|
1867
1894
|
* @returns {string} The context url for the given entities
|
|
1868
1895
|
* @protected
|
|
1869
1896
|
*/
|
|
1870
|
-
constructContextUrl: function(sEntitySetName, oModel) {
|
|
1897
|
+
constructContextUrl: function (sEntitySetName, oModel) {
|
|
1871
1898
|
if (!sEntitySetName) {
|
|
1872
1899
|
throw new NavError("NavigationHandler.NO_ENTITY_SET_PROVIDED");
|
|
1873
1900
|
}
|
|
@@ -1879,7 +1906,7 @@ sap.ui.define(
|
|
|
1879
1906
|
return this._constructContextUrl(oModel) + "#" + sEntitySetName;
|
|
1880
1907
|
},
|
|
1881
1908
|
|
|
1882
|
-
_constructContextUrl: function(oModel) {
|
|
1909
|
+
_constructContextUrl: function (oModel) {
|
|
1883
1910
|
// TODO: replace with public APIs, once available
|
|
1884
1911
|
var sServerUrl;
|
|
1885
1912
|
|
|
@@ -1907,7 +1934,7 @@ sap.ui.define(
|
|
|
1907
1934
|
* @returns {object} Data without properties marked as sensitive or an empty object if the OData metadata is not fully loaded yet
|
|
1908
1935
|
* @private
|
|
1909
1936
|
*/
|
|
1910
|
-
_checkIsPotentiallySensitive: function(oData) {
|
|
1937
|
+
_checkIsPotentiallySensitive: function (oData) {
|
|
1911
1938
|
var oAdaptedData = oData;
|
|
1912
1939
|
if (
|
|
1913
1940
|
oData &&
|
|
@@ -2025,7 +2052,7 @@ sap.ui.define(
|
|
|
2025
2052
|
return oAdaptedData;
|
|
2026
2053
|
},
|
|
2027
2054
|
|
|
2028
|
-
_removeMeasureBasedInformation: function(oAppData) {
|
|
2055
|
+
_removeMeasureBasedInformation: function (oAppData) {
|
|
2029
2056
|
var oAppDataForSave = oAppData;
|
|
2030
2057
|
|
|
2031
2058
|
if (oAppData.selectionVariant) {
|
|
@@ -2056,7 +2083,7 @@ sap.ui.define(
|
|
|
2056
2083
|
* @returns {object} Data without properties marked as measures or an empty object if the OData metadata is not fully loaded yet
|
|
2057
2084
|
* @private
|
|
2058
2085
|
*/
|
|
2059
|
-
_removeMeasureBasedProperties: function(oData) {
|
|
2086
|
+
_removeMeasureBasedProperties: function (oData) {
|
|
2060
2087
|
var oAdaptedData = oData,
|
|
2061
2088
|
aMeasureFilterName = [],
|
|
2062
2089
|
aMeasureParameterName = [];
|
|
@@ -2181,7 +2208,7 @@ sap.ui.define(
|
|
|
2181
2208
|
* @param {boolean} bMeasure Should measures be removed
|
|
2182
2209
|
* @returns {object} The selection variant after sensitive data has been removed
|
|
2183
2210
|
**/
|
|
2184
|
-
_removeSensitiveDataForODataV4: function(oData, bMeasure) {
|
|
2211
|
+
_removeSensitiveDataForODataV4: function (oData, bMeasure) {
|
|
2185
2212
|
var that = this,
|
|
2186
2213
|
aFilterContextPart,
|
|
2187
2214
|
oSV = new SelectionVariant(oData.selectionVariant),
|
|
@@ -2210,7 +2237,7 @@ sap.ui.define(
|
|
|
2210
2237
|
var sEntitySet = aFilterContextPart[1],
|
|
2211
2238
|
oMetaModel = oModel.getMetaModel(),
|
|
2212
2239
|
aPropertyNames = oSV.getPropertyNames() || [],
|
|
2213
|
-
fnIsSensitiveData = function(sProp, esName, mData) {
|
|
2240
|
+
fnIsSensitiveData = function (sProp, esName, mData) {
|
|
2214
2241
|
var aPropertyAnnotations;
|
|
2215
2242
|
esName = esName || sEntitySet;
|
|
2216
2243
|
aPropertyAnnotations = oMetaModel.getObject("/" + esName + "/" + sProp + "@");
|
|
@@ -2242,7 +2269,7 @@ sap.ui.define(
|
|
|
2242
2269
|
return oData;
|
|
2243
2270
|
},
|
|
2244
2271
|
|
|
2245
|
-
_checkPropertyAnnotationsForSensitiveData: function(aPropertyAnnotations) {
|
|
2272
|
+
_checkPropertyAnnotationsForSensitiveData: function (aPropertyAnnotations) {
|
|
2246
2273
|
return (
|
|
2247
2274
|
aPropertyAnnotations["@com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"] ||
|
|
2248
2275
|
aPropertyAnnotations["@com.sap.vocabularies.UI.v1.ExcludeFromNavigationContext"]
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(
|
|
7
7
|
["./NavError", "sap/ui/base/Object", "sap/base/util/each", "sap/base/Log"],
|
|
8
|
-
function(NavError, BaseObject, each, Log) {
|
|
8
|
+
function (NavError, BaseObject, each, Log) {
|
|
9
9
|
"use strict";
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -41,7 +41,7 @@ sap.ui.define(
|
|
|
41
41
|
_rVALIDATE_SIGN: new RegExp("[E|I]"),
|
|
42
42
|
_rVALIDATE_OPTION: new RegExp("EQ|NE|LE|GE|LT|GT|BT|CP"),
|
|
43
43
|
|
|
44
|
-
constructor: function(vSelectionVariant) {
|
|
44
|
+
constructor: function (vSelectionVariant) {
|
|
45
45
|
this._mParameters = {};
|
|
46
46
|
this._mSelectOptions = {};
|
|
47
47
|
|
|
@@ -63,7 +63,7 @@ sap.ui.define(
|
|
|
63
63
|
* @returns {string} The identification of the selection variant as made available during construction
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
getID: function() {
|
|
66
|
+
getID: function () {
|
|
67
67
|
return this._sId;
|
|
68
68
|
},
|
|
69
69
|
|
|
@@ -72,7 +72,7 @@ sap.ui.define(
|
|
|
72
72
|
* @param {string} sId The new identification of the selection variant
|
|
73
73
|
* @public
|
|
74
74
|
*/
|
|
75
|
-
setID: function(sId) {
|
|
75
|
+
setID: function (sId) {
|
|
76
76
|
this._sId = sId;
|
|
77
77
|
},
|
|
78
78
|
|
|
@@ -86,7 +86,7 @@ sap.ui.define(
|
|
|
86
86
|
* <tr><td>SelectionVariant.INVALID_INPUT_TYPE</td><td>Indicates that an input parameter has an invalid type</td></tr>
|
|
87
87
|
* </table>
|
|
88
88
|
*/
|
|
89
|
-
setText: function(sNewText) {
|
|
89
|
+
setText: function (sNewText) {
|
|
90
90
|
if (typeof sNewText !== "string") {
|
|
91
91
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
92
92
|
}
|
|
@@ -98,7 +98,7 @@ sap.ui.define(
|
|
|
98
98
|
* @returns {string} The current description of this selection variant.
|
|
99
99
|
* @public
|
|
100
100
|
*/
|
|
101
|
-
getText: function() {
|
|
101
|
+
getText: function () {
|
|
102
102
|
return this._sText;
|
|
103
103
|
},
|
|
104
104
|
|
|
@@ -112,7 +112,7 @@ sap.ui.define(
|
|
|
112
112
|
* <tr><td>SelectionVariant.INVALID_INPUT_TYPE</td><td>Indicates that an input parameter has an invalid type</td></tr>
|
|
113
113
|
* </table>
|
|
114
114
|
*/
|
|
115
|
-
setParameterContextUrl: function(sURL) {
|
|
115
|
+
setParameterContextUrl: function (sURL) {
|
|
116
116
|
if (typeof sURL !== "string") {
|
|
117
117
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
118
118
|
}
|
|
@@ -124,7 +124,7 @@ sap.ui.define(
|
|
|
124
124
|
* @returns {string} The current context URL for the parameters
|
|
125
125
|
* @public
|
|
126
126
|
*/
|
|
127
|
-
getParameterContextUrl: function() {
|
|
127
|
+
getParameterContextUrl: function () {
|
|
128
128
|
return this._sParameterCtxUrl;
|
|
129
129
|
},
|
|
130
130
|
|
|
@@ -133,7 +133,7 @@ sap.ui.define(
|
|
|
133
133
|
* @returns {string} The current context URL for the filters
|
|
134
134
|
* @public
|
|
135
135
|
*/
|
|
136
|
-
getFilterContextUrl: function() {
|
|
136
|
+
getFilterContextUrl: function () {
|
|
137
137
|
return this._sFilterCtxUrl;
|
|
138
138
|
},
|
|
139
139
|
|
|
@@ -147,7 +147,7 @@ sap.ui.define(
|
|
|
147
147
|
* <tr><td>SelectionVariant.INVALID_INPUT_TYPE</td><td>Indicates that an input parameter has an invalid type</td></tr>
|
|
148
148
|
* </table>
|
|
149
149
|
*/
|
|
150
|
-
setFilterContextUrl: function(sURL) {
|
|
150
|
+
setFilterContextUrl: function (sURL) {
|
|
151
151
|
if (typeof sURL !== "string") {
|
|
152
152
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
153
153
|
}
|
|
@@ -169,7 +169,7 @@ sap.ui.define(
|
|
|
169
169
|
* <tr><td>SelectionVariant.PARAMETER_SELOPT_COLLISION</td><td>Indicates that another SelectOption with the same name as the parameter already exists</td></tr>
|
|
170
170
|
* </table>
|
|
171
171
|
*/
|
|
172
|
-
addParameter: function(sName, sValue) {
|
|
172
|
+
addParameter: function (sName, sValue) {
|
|
173
173
|
/*
|
|
174
174
|
* {string} sName The name of the parameter to be set; the <code>null</code> value is not allowed
|
|
175
175
|
* (see specification "Selection Variants for UI Navigation in Fiori", section 2.4.2.1)
|
|
@@ -205,7 +205,7 @@ sap.ui.define(
|
|
|
205
205
|
* <tr><td>SelectionVariant.INVALID_INPUT_TYPE</td><td>Indicates that an input parameter has an invalid type</td></tr>
|
|
206
206
|
* </table>
|
|
207
207
|
*/
|
|
208
|
-
removeParameter: function(sName) {
|
|
208
|
+
removeParameter: function (sName) {
|
|
209
209
|
if (typeof sName !== "string") {
|
|
210
210
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
211
211
|
}
|
|
@@ -235,7 +235,7 @@ sap.ui.define(
|
|
|
235
235
|
* <tr><td>SelectionVariant.PARAMETER_COLLISION</td><td>Indicates that another parameter with the same new name already exists</td></tr>
|
|
236
236
|
* </table>
|
|
237
237
|
*/
|
|
238
|
-
renameParameter: function(sNameOld, sNameNew) {
|
|
238
|
+
renameParameter: function (sNameOld, sNameNew) {
|
|
239
239
|
if (typeof sNameOld !== "string" || typeof sNameNew !== "string") {
|
|
240
240
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
241
241
|
}
|
|
@@ -267,7 +267,7 @@ sap.ui.define(
|
|
|
267
267
|
* <tr><td>SelectionVariant.INVALID_INPUT_TYPE</td><td>Indicates that an input parameter has an invalid type</td></tr>
|
|
268
268
|
* </table>
|
|
269
269
|
*/
|
|
270
|
-
getParameter: function(sName) {
|
|
270
|
+
getParameter: function (sName) {
|
|
271
271
|
if (typeof sName !== "string") {
|
|
272
272
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
273
273
|
}
|
|
@@ -280,7 +280,7 @@ sap.ui.define(
|
|
|
280
280
|
* @returns {Array} The list of parameter names which are valid
|
|
281
281
|
* @public
|
|
282
282
|
*/
|
|
283
|
-
getParameterNames: function() {
|
|
283
|
+
getParameterNames: function () {
|
|
284
284
|
return Object.keys(this._mParameters);
|
|
285
285
|
},
|
|
286
286
|
|
|
@@ -294,6 +294,9 @@ sap.ui.define(
|
|
|
294
294
|
* (ABAP-styled pattern matching with the asterisk as wildcard)
|
|
295
295
|
* @param {string} sLow The single value or the lower boundary of the interval; the <code>null</code> value is not allowed
|
|
296
296
|
* @param {string} [sHigh] Set only if sOption is <b>BT</b>: the upper boundary of the interval;
|
|
297
|
+
* @param {string} [sText] Text representing the SelectOption. This is an optional parameter, consumption of this parameter is
|
|
298
|
+
* completely decided by the consumer. For an example in most Fiori applications fetch the Text based on the ID and doesn't
|
|
299
|
+
* consider this text property
|
|
297
300
|
* must be <code>undefined</code> or <code>null</code> in all other cases
|
|
298
301
|
* @returns {object} This instance to allow method chaining.
|
|
299
302
|
* @public
|
|
@@ -308,7 +311,8 @@ sap.ui.define(
|
|
|
308
311
|
* <tr><td>SelectionVariant.PARAMETER_SELOPT_COLLISION</td><td>Indicates that another parameter with the same name as the property name already exists</td></tr>
|
|
309
312
|
* </table>
|
|
310
313
|
*/
|
|
311
|
-
|
|
314
|
+
|
|
315
|
+
addSelectOption: function (sPropertyName, sSign, sOption, sLow, sHigh, sText) {
|
|
312
316
|
/* {string} sLow The single value or the lower boundary of the interval; the <code>null</code> value is not allowed
|
|
313
317
|
* (see specification "Selection Variants for UI Navigation in Fiori", section 2.4.2.1)
|
|
314
318
|
*/
|
|
@@ -361,6 +365,12 @@ sap.ui.define(
|
|
|
361
365
|
Low: sLow
|
|
362
366
|
};
|
|
363
367
|
|
|
368
|
+
if (sText) {
|
|
369
|
+
// Add Text property only in case it is passed by the consumer of the API.
|
|
370
|
+
// Otherwise keep the structure as is.
|
|
371
|
+
oEntry.Text = sText;
|
|
372
|
+
}
|
|
373
|
+
|
|
364
374
|
if (sOption === "BT") {
|
|
365
375
|
oEntry.High = sHigh;
|
|
366
376
|
} else {
|
|
@@ -399,7 +409,7 @@ sap.ui.define(
|
|
|
399
409
|
* <tr><td>SelectionVariant.SELOPT_WRONG_TYPE</td><td>Indicates that the name of the parameter <code>sName</code> has an invalid type</td></tr>
|
|
400
410
|
* </table>
|
|
401
411
|
*/
|
|
402
|
-
removeSelectOption: function(sName) {
|
|
412
|
+
removeSelectOption: function (sName) {
|
|
403
413
|
if (typeof sName !== "string") {
|
|
404
414
|
throw new NavError("SelectionVariant.SELOPT_WRONG_TYPE");
|
|
405
415
|
}
|
|
@@ -430,7 +440,7 @@ sap.ui.define(
|
|
|
430
440
|
* <tr><td>SelectionVariant.SELOPT_COLLISION</td><td>Indicates that another select option with the same new name already exists</td></tr>
|
|
431
441
|
* </table>
|
|
432
442
|
*/
|
|
433
|
-
renameSelectOption: function(sNameOld, sNameNew) {
|
|
443
|
+
renameSelectOption: function (sNameOld, sNameNew) {
|
|
434
444
|
if (typeof sNameOld !== "string" || typeof sNameNew !== "string") {
|
|
435
445
|
throw new NavError("SelectionVariant.SELOPT_WRONG_TYPE");
|
|
436
446
|
}
|
|
@@ -471,7 +481,7 @@ sap.ui.define(
|
|
|
471
481
|
* <tr><td>SelectionVariant.INVALID_PROPERTY_NAME</td><td>Indicates that the property name is invalid, for example, it has not been specified</td></tr>
|
|
472
482
|
* </table>
|
|
473
483
|
*/
|
|
474
|
-
getSelectOption: function(sPropertyName) {
|
|
484
|
+
getSelectOption: function (sPropertyName) {
|
|
475
485
|
if (typeof sPropertyName !== "string") {
|
|
476
486
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
477
487
|
}
|
|
@@ -492,7 +502,7 @@ sap.ui.define(
|
|
|
492
502
|
* @returns {Array} The list of property names available for this instance
|
|
493
503
|
* @public
|
|
494
504
|
*/
|
|
495
|
-
getSelectOptionsPropertyNames: function() {
|
|
505
|
+
getSelectOptionsPropertyNames: function () {
|
|
496
506
|
return Object.keys(this._mSelectOptions);
|
|
497
507
|
},
|
|
498
508
|
|
|
@@ -501,7 +511,7 @@ sap.ui.define(
|
|
|
501
511
|
* @returns {Array} The list of parameter and select option property names available for this instance
|
|
502
512
|
* @public
|
|
503
513
|
*/
|
|
504
|
-
getPropertyNames: function() {
|
|
514
|
+
getPropertyNames: function () {
|
|
505
515
|
return this.getParameterNames().concat(this.getSelectOptionsPropertyNames());
|
|
506
516
|
},
|
|
507
517
|
|
|
@@ -517,7 +527,7 @@ sap.ui.define(
|
|
|
517
527
|
* </table>
|
|
518
528
|
* @public
|
|
519
529
|
*/
|
|
520
|
-
massAddSelectOption: function(sPropertyName, aSelectOptions) {
|
|
530
|
+
massAddSelectOption: function (sPropertyName, aSelectOptions) {
|
|
521
531
|
if (!Array.isArray(aSelectOptions)) {
|
|
522
532
|
throw new NavError("SelectionVariant.INVALID_INPUT_TYPE");
|
|
523
533
|
}
|
|
@@ -561,7 +571,7 @@ sap.ui.define(
|
|
|
561
571
|
* <tr><td>SelectionVariant.INVALID_PROPERTY_NAME</td><td>Indicates that the property name is invalid, for example, it has not been specified</td></tr>
|
|
562
572
|
* </table>
|
|
563
573
|
*/
|
|
564
|
-
getValue: function(sName) {
|
|
574
|
+
getValue: function (sName) {
|
|
565
575
|
var aValue = this.getSelectOption(sName);
|
|
566
576
|
if (aValue !== undefined) {
|
|
567
577
|
// a range for the selection option is provided; so this is the leading one
|
|
@@ -592,7 +602,7 @@ sap.ui.define(
|
|
|
592
602
|
* the selection variant; <code>false</code> otherwise.
|
|
593
603
|
* @public
|
|
594
604
|
*/
|
|
595
|
-
isEmpty: function() {
|
|
605
|
+
isEmpty: function () {
|
|
596
606
|
return this.getParameterNames().length === 0 && this.getSelectOptionsPropertyNames().length === 0;
|
|
597
607
|
},
|
|
598
608
|
|
|
@@ -601,7 +611,7 @@ sap.ui.define(
|
|
|
601
611
|
* @returns {object} The external representation of this instance as a JSON object
|
|
602
612
|
* @public
|
|
603
613
|
*/
|
|
604
|
-
toJSONObject: function() {
|
|
614
|
+
toJSONObject: function () {
|
|
605
615
|
var oExternalSelectionVariant = {
|
|
606
616
|
Version: {
|
|
607
617
|
// Version attributes are not part of the official specification,
|
|
@@ -639,16 +649,16 @@ sap.ui.define(
|
|
|
639
649
|
* @returns {string} The JSON-formatted representation of this instance in stringified format
|
|
640
650
|
* @public
|
|
641
651
|
*/
|
|
642
|
-
toJSONString: function() {
|
|
652
|
+
toJSONString: function () {
|
|
643
653
|
return JSON.stringify(this.toJSONObject());
|
|
644
654
|
},
|
|
645
655
|
|
|
646
|
-
_determineODataFilterExpression: function(oExternalSelectionVariant) {
|
|
656
|
+
_determineODataFilterExpression: function (oExternalSelectionVariant) {
|
|
647
657
|
// TODO - specification does not indicate what is expected here in detail
|
|
648
658
|
oExternalSelectionVariant.ODataFilterExpression = ""; // not supported yet - it's allowed to be optional
|
|
649
659
|
},
|
|
650
660
|
|
|
651
|
-
_serializeParameters: function(oExternalSelectionVariant) {
|
|
661
|
+
_serializeParameters: function (oExternalSelectionVariant) {
|
|
652
662
|
if (this._mParameters.length === 0) {
|
|
653
663
|
return;
|
|
654
664
|
}
|
|
@@ -656,7 +666,7 @@ sap.ui.define(
|
|
|
656
666
|
// Note: Parameters section is optional (see specification section 2.4.2.1)
|
|
657
667
|
oExternalSelectionVariant.Parameters = [];
|
|
658
668
|
|
|
659
|
-
each(this._mParameters, function(sParameterName, sParameterValue) {
|
|
669
|
+
each(this._mParameters, function (sParameterName, sParameterValue) {
|
|
660
670
|
var oParObject = {
|
|
661
671
|
PropertyName: sParameterName,
|
|
662
672
|
PropertyValue: sParameterValue
|
|
@@ -665,14 +675,14 @@ sap.ui.define(
|
|
|
665
675
|
});
|
|
666
676
|
},
|
|
667
677
|
|
|
668
|
-
_serializeSelectOptions: function(oExternalSelectionVariant) {
|
|
678
|
+
_serializeSelectOptions: function (oExternalSelectionVariant) {
|
|
669
679
|
if (this._mSelectOptions.length === 0) {
|
|
670
680
|
return;
|
|
671
681
|
}
|
|
672
682
|
|
|
673
683
|
oExternalSelectionVariant.SelectOptions = [];
|
|
674
684
|
|
|
675
|
-
each(this._mSelectOptions, function(sPropertyName, aEntries) {
|
|
685
|
+
each(this._mSelectOptions, function (sPropertyName, aEntries) {
|
|
676
686
|
var oSelectOption = {
|
|
677
687
|
PropertyName: sPropertyName,
|
|
678
688
|
Ranges: aEntries
|
|
@@ -682,7 +692,7 @@ sap.ui.define(
|
|
|
682
692
|
});
|
|
683
693
|
},
|
|
684
694
|
|
|
685
|
-
_parseFromString: function(sJSONString) {
|
|
695
|
+
_parseFromString: function (sJSONString) {
|
|
686
696
|
if (sJSONString === undefined) {
|
|
687
697
|
throw new NavError("SelectionVariant.UNABLE_TO_PARSE_INPUT");
|
|
688
698
|
}
|
|
@@ -697,7 +707,7 @@ sap.ui.define(
|
|
|
697
707
|
this._parseFromObject(oInput);
|
|
698
708
|
},
|
|
699
709
|
|
|
700
|
-
_parseFromObject: function(oInput) {
|
|
710
|
+
_parseFromObject: function (oInput) {
|
|
701
711
|
if (oInput.SelectionVariantID === undefined) {
|
|
702
712
|
// Do not throw an error, but only write a warning into the log.
|
|
703
713
|
// The SelectionVariantID is mandatory according to the specification document version 1.0,
|
|
@@ -734,19 +744,19 @@ sap.ui.define(
|
|
|
734
744
|
}
|
|
735
745
|
},
|
|
736
746
|
|
|
737
|
-
_parseFromStringParameters: function(aParameters) {
|
|
747
|
+
_parseFromStringParameters: function (aParameters) {
|
|
738
748
|
each(
|
|
739
749
|
aParameters,
|
|
740
|
-
function(iIdx, oEntry) {
|
|
750
|
+
function (iIdx, oEntry) {
|
|
741
751
|
this.addParameter(oEntry.PropertyName, oEntry.PropertyValue);
|
|
742
752
|
}.bind(this)
|
|
743
753
|
);
|
|
744
754
|
},
|
|
745
755
|
|
|
746
|
-
_parseFromStringSelectOptions: function(aSelectOptions) {
|
|
756
|
+
_parseFromStringSelectOptions: function (aSelectOptions) {
|
|
747
757
|
each(
|
|
748
758
|
aSelectOptions,
|
|
749
|
-
function(iIdx, oSelectOption) {
|
|
759
|
+
function (iIdx, oSelectOption) {
|
|
750
760
|
if (!oSelectOption.Ranges) {
|
|
751
761
|
Log.warning("Select Option object does not contain a Ranges entry; ignoring entry");
|
|
752
762
|
return true; // "continue"
|
|
@@ -758,7 +768,7 @@ sap.ui.define(
|
|
|
758
768
|
|
|
759
769
|
each(
|
|
760
770
|
oSelectOption.Ranges,
|
|
761
|
-
function(iIdx2, oRange) {
|
|
771
|
+
function (iIdx2, oRange) {
|
|
762
772
|
this.addSelectOption(oSelectOption.PropertyName, oRange.Sign, oRange.Option, oRange.Low, oRange.High);
|
|
763
773
|
}.bind(this)
|
|
764
774
|
);
|
|
@@ -4,30 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Common library for all cross-application navigation functions.
|
|
9
|
-
*
|
|
10
|
-
* @namespace
|
|
11
|
-
* @name sap.fe.navigation
|
|
12
|
-
* @public
|
|
13
|
-
* @since 1.83.0
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Initialization Code and shared classes of library sap.fe.navigation
|
|
18
|
-
*/
|
|
19
7
|
sap.ui.define(
|
|
20
8
|
[
|
|
21
|
-
"sap/ui/core/Core", // implicit dependency, provides sap.ui.getCore()
|
|
9
|
+
"sap/ui/core/Core", // implicit dependency, provides sap.ui.getCore(),
|
|
22
10
|
"sap/ui/core/library" // library dependency
|
|
23
11
|
],
|
|
24
|
-
function() {
|
|
12
|
+
function () {
|
|
25
13
|
"use strict";
|
|
26
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Common library for all cross-application navigation functions.
|
|
17
|
+
*
|
|
18
|
+
* @namespace
|
|
19
|
+
* @name sap.fe.navigation
|
|
20
|
+
* @public
|
|
21
|
+
* @since 1.83.0
|
|
22
|
+
*/
|
|
23
|
+
|
|
27
24
|
// library dependencies
|
|
28
|
-
|
|
25
|
+
// delegate further initialization of this library to the Core
|
|
26
|
+
var thisLib = sap.ui.getCore().initLibrary({
|
|
29
27
|
name: "sap.fe.navigation",
|
|
30
|
-
version: "1.
|
|
28
|
+
version: "1.102.0",
|
|
31
29
|
dependencies: ["sap.ui.core"],
|
|
32
30
|
types: ["sap.fe.navigation.NavType", "sap.fe.navigation.ParamHandlingMode", "sap.fe.navigation.SuppressionBehavior"],
|
|
33
31
|
interfaces: [],
|
|
@@ -46,7 +44,7 @@ sap.ui.define(
|
|
|
46
44
|
* @public
|
|
47
45
|
* @since 1.83.0
|
|
48
46
|
*/
|
|
49
|
-
|
|
47
|
+
thisLib.ParamHandlingMode = {
|
|
50
48
|
/**
|
|
51
49
|
* The conflict resolution favors the SelectionVariant over URL parameters
|
|
52
50
|
* @public
|
|
@@ -77,7 +75,7 @@ sap.ui.define(
|
|
|
77
75
|
* @public
|
|
78
76
|
* @since 1.83.0
|
|
79
77
|
*/
|
|
80
|
-
|
|
78
|
+
thisLib.NavType = {
|
|
81
79
|
/**
|
|
82
80
|
* Initial startup without any navigation or default parameters
|
|
83
81
|
* @public
|
|
@@ -115,7 +113,7 @@ sap.ui.define(
|
|
|
115
113
|
* @public
|
|
116
114
|
* @since 1.83.0
|
|
117
115
|
*/
|
|
118
|
-
|
|
116
|
+
thisLib.SuppressionBehavior = {
|
|
119
117
|
/**
|
|
120
118
|
* Standard suppression behavior: semantic attributes with a <code>null</code> or an <code>undefined</code> value are ignored,
|
|
121
119
|
* the remaining attributes are mixed in to the selection variant
|
|
@@ -151,7 +149,7 @@ sap.ui.define(
|
|
|
151
149
|
* @public
|
|
152
150
|
* @since 1.83.0
|
|
153
151
|
*/
|
|
154
|
-
|
|
152
|
+
thisLib.Mode = {
|
|
155
153
|
/**
|
|
156
154
|
* This is used for ODataV2 services to do some internal tasks like creation of appstate, removal of sensitive data etc.,
|
|
157
155
|
* @public
|
|
@@ -165,6 +163,6 @@ sap.ui.define(
|
|
|
165
163
|
ODataV4: "ODataV4"
|
|
166
164
|
};
|
|
167
165
|
|
|
168
|
-
return
|
|
166
|
+
return thisLib;
|
|
169
167
|
}
|
|
170
168
|
);
|