@sapui5/sap.suite.ui.generic.template 1.150.1 → 1.152.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/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/control/visualfilterbar/SmartVisualFilterBar.js +4 -3
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_US_sappsd.properties +17 -9
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_en_US_saptrc.properties +113 -105
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/AnnotationHelperSmartList.js +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/Component.js +4 -2
- package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +0 -6
- package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +9 -0
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_sappsd.properties +8 -5
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_en_US_saptrc.properties +61 -58
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_fr.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sv.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/FullscreenPage.fragment.xml +3 -0
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/ControllerImplementation.js +3 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/RelatedAppsHandler.js +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/controller/inlineCreationRows/InlineCreationRowsHelper.js +10 -7
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_de.properties +4 -4
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_sappsd.properties +53 -9
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_saprigi.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_en_US_saptrc.properties +143 -95
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_fr.properties +3 -3
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_no.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ro.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ru.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sl.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_sv.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_uk.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/i18n/i18n_en_US_saptrc.properties +14 -14
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/i18n/i18n_en_US_saptrc.properties +2 -2
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/detailTemplates/i18n/i18n_en_US_saptrc.properties +6 -6
- package/src/sap/suite/ui/generic/template/fragments/AnalyticalTableColumns.fragment.xml +0 -10
- package/src/sap/suite/ui/generic/template/fragments/EasyFilter.fragment.xml +0 -2
- package/src/sap/suite/ui/generic/template/fragments/GridTableColumns.fragment.xml +5 -2
- package/src/sap/suite/ui/generic/template/fragments/TreeTableColumns.fragment.xml +5 -2
- package/src/sap/suite/ui/generic/template/genericUtilities/controlHelper.js +10 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartFilterBarWrapper.js +45 -32
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartTableChartCommon.js +10 -0
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +21 -17
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +3 -1
- package/src/sap/suite/ui/generic/template/lib/Application.js +15 -2
- package/src/sap/suite/ui/generic/template/lib/CRUDManager.js +5 -24
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +30 -8
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +13 -5
- package/src/sap/suite/ui/generic/template/lib/PageLeaveHandler.js +19 -14
- package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillAIOrchestrator.js +1 -6
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillApplyHandler.js +25 -44
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillDialogController.js +80 -64
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFieldCollector.js +442 -259
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillFormRenderer.js +125 -161
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillHandler.js +134 -160
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/EasyFillTableRenderer.js +55 -189
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFill/fragments/EasyFillDialog.fragment.xml +67 -86
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +175 -54
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterDataFetcherHelper.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_sappsd.properties +275 -14
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saptrc.properties +392 -163
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +4 -4
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +7 -7
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsCardHelper.js +16 -4
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +3 -2
- package/src/sap/suite/ui/generic/template/lib/presentationControl/SmartTableHandler.js +13 -13
- package/src/sap/suite/ui/generic/template/library.js +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/controller/IappStateHandler.js +12 -3
- package/src/sap/suite/ui/generic/template/listTemplates/i18n/i18n_en_US_saptrc.properties +1 -1
- package/src/sap/suite/ui/generic/template/themes/base/ObjectPage.less +1 -1
|
@@ -28,6 +28,14 @@ sap.ui.define([
|
|
|
28
28
|
var oSmartFilterBar = oControl;
|
|
29
29
|
var oEasyFilterCallbacks = null;
|
|
30
30
|
var oPendingEasyFilterState = null;
|
|
31
|
+
// Holds SVM callbacks once setSVMWrapperCallbacks is called. The afterVariantLoad handler
|
|
32
|
+
// is attached eagerly (in fnInitialize) so it fires even when setSVMWrapperCallbacks has
|
|
33
|
+
// not yet been called (race condition on second navigation: bAllControlsInitialized=true
|
|
34
|
+
// causes fnApplyVariantState to run synchronously, triggering afterVariantLoad before the
|
|
35
|
+
// Promise.all in SmartVariantManagementWrapper resolves and calls setSVMWrapperCallbacks).
|
|
36
|
+
// Cold-start _CUSTOM restore is also handled there: afterVariantLoad("INIT") fires before
|
|
37
|
+
// getInitializedPromise() resolves, so modifyStartupExtension always gets the final word.
|
|
38
|
+
var oSVMWrapperCallbacks = null;
|
|
31
39
|
|
|
32
40
|
var oVariantManagementInitializedPromise;
|
|
33
41
|
|
|
@@ -42,44 +50,20 @@ sap.ui.define([
|
|
|
42
50
|
|
|
43
51
|
// Initialize variant management promise
|
|
44
52
|
oVariantManagementInitializedPromise = oSmartFilterBar.getInitializedPromise();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// Attach to variantFetch and variantLoad events to be able to store and restore also custom filters and state of other controls (in case of page VM) with variant.
|
|
48
|
-
// Events for storing/restoring are provided by SFB, data to be stored/restored can come from 3 sources:
|
|
49
|
-
// - standard filters: handled directly by SFB
|
|
50
|
-
// - extension filters: provided from mParams.oCustomFiltersWrapper
|
|
51
|
-
// - other controls being part of VM: provided by oSVMWrapperCallbacks (controls with direct connection to VM are skipped in SVM wrapper)
|
|
52
|
-
function setSVMWrapperCallbacks(oSVMWrapperCallbacks){
|
|
53
|
-
// Before saving the current state as a new variant, we need to provide all state data of controls controlled by VM, but not known to it with setCustomFilterData. From a
|
|
54
|
-
// logical point of view, the event (beforeVariantFetch) as well as the method to store the extension data (setCustomFilterData) belong to SVM, but both are implemented
|
|
55
|
-
// in SFB. Additionally, beforeVariantSave would actually be the name more logical to the consumer, however that name had been used earlier and was deprecated and
|
|
56
|
-
// replaced by the given one. Fetch actually does not mean to fetch variant content from the place variants are stored, but to get the current state from the controls!
|
|
57
|
-
oSmartFilterBar.attachBeforeVariantFetch(function(){
|
|
58
|
-
var oCustomData = Object.create(null);
|
|
59
|
-
oCustomData[dataPropertyNameGeneric] = oSVMWrapperCallbacks.getManagedControlStates();
|
|
60
|
-
oCustomData[dataPropertyNameGeneric].customFilters = mParams.oCustomFiltersWrapper.getState();
|
|
61
|
-
if (oEasyFilterCallbacks) {
|
|
62
|
-
var oEFState = oEasyFilterCallbacks.getState();
|
|
63
|
-
oCustomData[dataPropertyNameGeneric].filterMode = oEFState.filterMode;
|
|
64
|
-
oCustomData[dataPropertyNameGeneric].easyFilter = oEFState.easyFilter;
|
|
65
|
-
}
|
|
66
|
-
oSmartFilterBar.setCustomFilterData(oCustomData);
|
|
67
|
-
});
|
|
68
53
|
|
|
69
|
-
//
|
|
70
|
-
//
|
|
71
|
-
//
|
|
72
|
-
//
|
|
54
|
+
// Attach afterVariantLoad eagerly so custom filter state is restored regardless of
|
|
55
|
+
// when setSVMWrapperCallbacks is called. setManagedControlStates is only called if
|
|
56
|
+
// SVM callbacks are already available; otherwise those controls are restored via the
|
|
57
|
+
// iAppState path (SmartVariantManagementWrapper.fnSetManagedControlStates).
|
|
73
58
|
oSmartFilterBar.attachAfterVariantLoad(function(){
|
|
74
59
|
var oCustomData = oSmartFilterBar.getCustomFilterData();
|
|
75
60
|
var oGenericData;
|
|
76
61
|
if (oCustomData && oCustomData[dataPropertyNameGeneric]) {
|
|
77
62
|
oGenericData = oCustomData[dataPropertyNameGeneric];
|
|
78
63
|
} else {
|
|
79
|
-
// getCustomFilterData() returns null
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
// variant content — fall back to reading it via getVariantContent().
|
|
64
|
+
// getCustomFilterData() returns null when no beforeVariantFetch has run yet for this
|
|
65
|
+
// variant (e.g. a named variant being switched to for the first time in the session, or cold-start INIT).
|
|
66
|
+
// The _CUSTOM section is present in the variant content — fall back to reading it via getVariantContent().
|
|
83
67
|
try {
|
|
84
68
|
var oSVM = oSmartFilterBar.getSmartVariant();
|
|
85
69
|
// getCurrentVariantId() converts STANDARDVARIANTKEY to "" which _getVariantById can't look up.
|
|
@@ -102,7 +86,9 @@ sap.ui.define([
|
|
|
102
86
|
};
|
|
103
87
|
aBasicFilters = oSmartFilterBar.getAllFilterItems(true);
|
|
104
88
|
mParams.oCustomFiltersWrapper.setState(oCustomFiltersState);
|
|
105
|
-
oSVMWrapperCallbacks
|
|
89
|
+
if (oSVMWrapperCallbacks) {
|
|
90
|
+
oSVMWrapperCallbacks.setManagedControlStates(oGenericData);
|
|
91
|
+
}
|
|
106
92
|
if (oEasyFilterCallbacks) {
|
|
107
93
|
oEasyFilterCallbacks.setState({
|
|
108
94
|
filterMode: oGenericData.filterMode,
|
|
@@ -115,7 +101,34 @@ sap.ui.define([
|
|
|
115
101
|
};
|
|
116
102
|
}
|
|
117
103
|
});
|
|
104
|
+
}
|
|
118
105
|
|
|
106
|
+
// When a variant is loaded, correspondingly we have to get the customData and apply the states to the controls not known to SVM. Again, event and method are implemented
|
|
107
|
+
// in SFB instead of SVM where it would make more sense.
|
|
108
|
+
// Here the event is afterVariantLoad, as the variant content known to SVM/SFB has first to be applied to the SFB, which will also pass the custom data accordingly. Only
|
|
109
|
+
// after this has happened, we can get the custom data from SFB.
|
|
110
|
+
// Attach to variantFetch and variantLoad events to be able to store and restore also custom filters and state of other controls (in case of page VM) with variant.
|
|
111
|
+
// Events for storing/restoring are provided by SFB, data to be stored/restored can come from 3 sources:
|
|
112
|
+
// - standard filters: handled directly by SFB
|
|
113
|
+
// - extension filters: provided from mParams.oCustomFiltersWrapper
|
|
114
|
+
// - other controls being part of VM: provided by oSVMWrapperCallbacks (controls with direct connection to VM are skipped in SVM wrapper)
|
|
115
|
+
function setSVMWrapperCallbacks(oCallbacks){
|
|
116
|
+
oSVMWrapperCallbacks = oCallbacks;
|
|
117
|
+
// Before saving the current state as a new variant, we need to provide all state data of controls controlled by VM, but not known to it with setCustomFilterData. From a
|
|
118
|
+
// logical point of view, the event (beforeVariantFetch) as well as the method to store the extension data (setCustomFilterData) belong to SVM, but both are implemented
|
|
119
|
+
// in SFB. Additionally, beforeVariantSave would actually be the name more logical to the consumer, however that name had been used earlier and was deprecated and
|
|
120
|
+
// replaced by the given one. Fetch actually does not mean to fetch variant content from the place variants are stored, but to get the current state from the controls!
|
|
121
|
+
oSmartFilterBar.attachBeforeVariantFetch(function(){
|
|
122
|
+
var oCustomData = Object.create(null);
|
|
123
|
+
oCustomData[dataPropertyNameGeneric] = oSVMWrapperCallbacks.getManagedControlStates();
|
|
124
|
+
oCustomData[dataPropertyNameGeneric].customFilters = mParams.oCustomFiltersWrapper.getState();
|
|
125
|
+
if (oEasyFilterCallbacks) {
|
|
126
|
+
var oEFState = oEasyFilterCallbacks.getState();
|
|
127
|
+
oCustomData[dataPropertyNameGeneric].filterMode = oEFState.filterMode;
|
|
128
|
+
oCustomData[dataPropertyNameGeneric].easyFilter = oEFState.easyFilter;
|
|
129
|
+
}
|
|
130
|
+
oSmartFilterBar.setCustomFilterData(oCustomData);
|
|
131
|
+
});
|
|
119
132
|
}
|
|
120
133
|
|
|
121
134
|
function fnGetState() {
|
|
@@ -49,6 +49,12 @@ sap.ui.define([
|
|
|
49
49
|
function getControlWrapper(oControl) {
|
|
50
50
|
var bIsApplying = false; // avoid forwarding change event when caused by us applying a state
|
|
51
51
|
function fnGetState() {
|
|
52
|
+
// getCurrentState can iterate a managed control whose view was already torn down (e.g. navigation
|
|
53
|
+
// while an appState write is in flight). Reading state from a destroyed control crashes in
|
|
54
|
+
// getUiState() because its inner aggregation is gone, so skip it.
|
|
55
|
+
if (oControl.isDestroyed()) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
52
58
|
var oControlUiState = oControl.getUiState(); // unfortunately not serializable, but a managed object
|
|
53
59
|
var oStateUiState = {
|
|
54
60
|
oPresentationVariant: oControlUiState.getPresentationVariant(),
|
|
@@ -66,6 +72,10 @@ sap.ui.define([
|
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
function fnSetState(oState) {
|
|
75
|
+
// Symmetric to fnGetState: never apply state to a destroyed control.
|
|
76
|
+
if (oControl.isDestroyed()) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
69
79
|
if (oState) {
|
|
70
80
|
if (!oState.oUiState) {
|
|
71
81
|
// Legacy handling for state without additional level oUiState (created with 1.99.0 - 1.99.3). Could be relevant on LR and OP, and independent of VM
|
|
@@ -924,26 +924,30 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
924
924
|
oDataField = oCollection[i];
|
|
925
925
|
oResult = null;
|
|
926
926
|
// if type is DataFieldForAnnotation, then loop over target annotations
|
|
927
|
-
|
|
928
|
-
oDataField.
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
927
|
+
try {
|
|
928
|
+
if (oDataField.RecordType === "com.sap.vocabularies.UI.v1.DataFieldForAnnotation" &&
|
|
929
|
+
oDataField.Target.AnnotationPath.indexOf("com.sap.vocabularies.UI.v1.FieldGroup") >= 0) {
|
|
930
|
+
// oDataField = oAnnotationHelper.getDataFieldFromDataFieldForAnnotation(oInterface, oDataField);
|
|
931
|
+
var oTargetLineItem = oMetaModel.getContext(oInterface.getPath() + "/" + i + "/Target");
|
|
932
|
+
var sResolvedPath = AnnotationHelperModel.resolvePath(oTargetLineItem);
|
|
933
|
+
var oDataFieldTarget = oMetaModel.getObject(sResolvedPath);
|
|
934
|
+
|
|
935
|
+
if (oDataFieldTarget.Data && oDataFieldTarget.Data.length > 0) {
|
|
936
|
+
for (var j = 0; j < oDataFieldTarget.Data.length; j++) {
|
|
937
|
+
oResult = oAnnotationHelper.generateAnnotatedActionCustomData(oDataFieldTarget.Data[j], oFacet, oTabItem, oChartItem);
|
|
938
|
+
if (oResult) {
|
|
939
|
+
aButtonsData.push(oResult);
|
|
940
|
+
}
|
|
939
941
|
}
|
|
940
942
|
}
|
|
943
|
+
} else {
|
|
944
|
+
oResult = oAnnotationHelper.generateAnnotatedActionCustomData(oDataField, oFacet, oTabItem, oChartItem);
|
|
945
|
+
if (oResult) {
|
|
946
|
+
aButtonsData.push(oResult);
|
|
947
|
+
}
|
|
941
948
|
}
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
if (oResult) {
|
|
945
|
-
aButtonsData.push(oResult);
|
|
946
|
-
}
|
|
949
|
+
} catch (oError) {
|
|
950
|
+
oLogger.error("configure - " + JSON.stringify(oDataField));
|
|
947
951
|
}
|
|
948
952
|
}
|
|
949
953
|
}
|
|
@@ -661,6 +661,7 @@ sap.ui.define([
|
|
|
661
661
|
|
|
662
662
|
function restore(){
|
|
663
663
|
oTemplateContract.oBusyHelper.setBusyReason("exiting", false);
|
|
664
|
+
oTemplateContract.oApplicationProxy.resetExternalNavigation();
|
|
664
665
|
for (var sComponentId in oTemplateContract.componentRegistry){
|
|
665
666
|
var oRegistryEntry = oTemplateContract.componentRegistry[sComponentId];
|
|
666
667
|
if (oRegistryEntry.methods.onRestore) {
|
|
@@ -942,6 +943,7 @@ sap.ui.define([
|
|
|
942
943
|
var fnNormalizePagesMapToArray = testableHelper.testable(fnNormalizePagesMapToArray, "fnNormalizePagesMapToArray");
|
|
943
944
|
getConfig = testableHelper.testable(getConfig, "getConfig");
|
|
944
945
|
testableHelper.testable(setLeaveAppPromise, "AppComponent_setLeaveAppPromise");
|
|
946
|
+
testableHelper.testable(restore, "AppComponent_restore");
|
|
945
947
|
/* eslint-enable */
|
|
946
948
|
|
|
947
949
|
return oMethods;
|
|
@@ -959,7 +961,7 @@ sap.ui.define([
|
|
|
959
961
|
* @public
|
|
960
962
|
* @extends sap.ui.core.UIComponent
|
|
961
963
|
* @author SAP SE
|
|
962
|
-
* @version 1.
|
|
964
|
+
* @version 1.152.0
|
|
963
965
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
964
966
|
*/
|
|
965
967
|
var oAppComponent = UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -82,6 +82,11 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
82
82
|
*/
|
|
83
83
|
function getMethods(oTemplateContract) {
|
|
84
84
|
|
|
85
|
+
// Set on first fnNavigateExternal call; blocks re-entry until reset. NavigationHandler.navigate() calls fnOnError
|
|
86
|
+
// on all failure paths and does not call it on the success path (app is leaving). The two valid reset points are
|
|
87
|
+
// therefore fnOnErrorWrapper (navigation failed) and AppComponent.restore() (FLP re-activated this app).
|
|
88
|
+
var bExternalNavigationTriggered = false;
|
|
89
|
+
|
|
85
90
|
var oFocusHelper = new FocusHelper(oTemplateContract);
|
|
86
91
|
var oContextBookkeeping = new ContextBookkeeping(oTemplateContract);
|
|
87
92
|
var mEntitySetToETagInfo = Object.create(null); // maps the name of the entity sets which have been already checked for eTag
|
|
@@ -671,8 +676,13 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
671
676
|
if (oCurrentNavigationHandler === GHOSTNAVIGATIONHANDLER){
|
|
672
677
|
return;
|
|
673
678
|
}
|
|
679
|
+
if (bExternalNavigationTriggered){
|
|
680
|
+
return;
|
|
681
|
+
}
|
|
682
|
+
bExternalNavigationTriggered = true;
|
|
674
683
|
oTemplateContract.oNavigationControllerProxy.leave();
|
|
675
|
-
var fnOnErrorWrapper = function(){
|
|
684
|
+
var fnOnErrorWrapper = function () {
|
|
685
|
+
bExternalNavigationTriggered = false;
|
|
676
686
|
oFocusHelper.setNextFocus(Function.prototype); // Do not change focus in case exiting the application fails
|
|
677
687
|
oTemplateContract.oBusyHelper.setBusyReason("exiting", false); // in error case we are not navigating away
|
|
678
688
|
if (fnOnError){
|
|
@@ -834,7 +844,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
834
844
|
removeTransientMessages: fnRemoveTransientMessages,
|
|
835
845
|
getTransientMessages: getTransientMessages,
|
|
836
846
|
setNextFocus: oFocusHelper.setNextFocus,
|
|
837
|
-
setStates: setStates
|
|
847
|
+
setStates: setStates,
|
|
848
|
+
resetExternalNavigation: function() {
|
|
849
|
+
bExternalNavigationTriggered = false;
|
|
850
|
+
}
|
|
838
851
|
};
|
|
839
852
|
|
|
840
853
|
return {
|
|
@@ -541,13 +541,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
541
541
|
var aMessagesBeforeSave = CRUDHelper.fnGetMessagesFromContextFilter(oContextFilter, oMessageManager, true);
|
|
542
542
|
var mMessagesBeforeSave = Object.create(null);
|
|
543
543
|
aMessagesBeforeSave.forEach(function(oMessage){
|
|
544
|
-
|
|
545
|
-
// Including them causes false-positive deduplication on retry: the new 412 produces
|
|
546
|
-
// the same message IDs, they are filtered out of aNewMessages, and fnHandleWarning
|
|
547
|
-
// is never called.
|
|
548
|
-
if (oMessage.persistent !== false) {
|
|
549
|
-
mMessagesBeforeSave[oMessage.getId()] = oMessage;
|
|
550
|
-
}
|
|
544
|
+
mMessagesBeforeSave[oMessage.getId()] = oMessage;
|
|
551
545
|
});
|
|
552
546
|
|
|
553
547
|
// Handles the 412 Warning case.
|
|
@@ -570,23 +564,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
570
564
|
var aMessagesAfterSave = CRUDHelper.fnGetMessagesFromContextFilter(oContextFilter, oMessageManager, true);
|
|
571
565
|
var aAllMessages = aMessagesAfterSave.map(function(oMessage){
|
|
572
566
|
if (!mMessagesBeforeSave[oMessage.getId()]) { // if this is a new message
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
var oNewMessage = new Message({
|
|
578
|
-
message: oMessage.getMessage(),
|
|
579
|
-
type: oMessage.getType(),
|
|
580
|
-
target: oMessage.getTargets ? oMessage.getTargets() : [oMessage.getTarget()],
|
|
581
|
-
processor: oMessage.getMessageProcessor(),
|
|
582
|
-
persistent: false,
|
|
583
|
-
technical: false,
|
|
584
|
-
code: oMessage.getCode(),
|
|
585
|
-
description: oMessage.getDescription(),
|
|
586
|
-
technicalDetails: oMessage.getTechnicalDetails()
|
|
587
|
-
});
|
|
588
|
-
bWarningOccured = bWarningOccured || oNewMessage.technicalDetails.statusCode === "412" && oNewMessage.technicalDetails.headers["preference-applied"] === "handling=strict";
|
|
589
|
-
aNewMessages.push(oNewMessage);
|
|
567
|
+
oMessage.persistent = false;
|
|
568
|
+
oMessage.technical = false;
|
|
569
|
+
bWarningOccured = bWarningOccured || oMessage.technicalDetails.statusCode === "412" && oMessage.technicalDetails.headers["preference-applied"] === "handling=strict";
|
|
570
|
+
aNewMessages.push(oMessage);
|
|
590
571
|
}
|
|
591
572
|
return oMessage;
|
|
592
573
|
});
|
|
@@ -720,7 +720,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
720
720
|
}
|
|
721
721
|
|
|
722
722
|
// null object has to be passed as the fourth argument (i.e. for oInnerAppData) to the navigate method as an indicator that the state should not be overwritten
|
|
723
|
-
|
|
723
|
+
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
724
|
+
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
725
|
+
if (oOutbound.parameters && oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
726
|
+
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
727
|
+
if (oNavHandler.navigate) {
|
|
728
|
+
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
729
|
+
}
|
|
730
|
+
} else {
|
|
731
|
+
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
732
|
+
}
|
|
724
733
|
}
|
|
725
734
|
|
|
726
735
|
function fnNavigateIntentSmartLink(oOutbound, oEventSource) {
|
|
@@ -803,9 +812,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
803
812
|
|
|
804
813
|
function fnOnSemanticObjectLinkNavigationPressed(oEventSource, oEventParameters){
|
|
805
814
|
var oEventObject = deepExtend({}, oEventSource);
|
|
815
|
+
var sSemanticObject = oEventObject.data('SemanticObject');
|
|
816
|
+
var sAction = oEventObject.data('Action');
|
|
817
|
+
var oTarget = (sSemanticObject && sAction) ? { semanticObject: sSemanticObject, action: sAction } : undefined;
|
|
806
818
|
oCommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(function() {
|
|
807
|
-
var sSemanticObject = oEventObject.data('SemanticObject');
|
|
808
|
-
var sAction = oEventObject.data('Action');
|
|
809
819
|
var sSemanticAttributes = oEventObject.data('SemanticAttributes');
|
|
810
820
|
if (sSemanticObject && sAction){
|
|
811
821
|
var oOutbound = {
|
|
@@ -818,7 +828,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
818
828
|
}
|
|
819
829
|
fnNavigateIntentSmartLink(oOutbound, oEventObject);
|
|
820
830
|
}
|
|
821
|
-
}, Function.prototype, "LeaveApp");
|
|
831
|
+
}, Function.prototype, "LeaveApp", false, oTarget);
|
|
822
832
|
}
|
|
823
833
|
|
|
824
834
|
function fnOnSemanticObjectLinkNavigationTargetObtained(sEntitySet, mFieldSemanticObjects, oEventParameters, oState, sTitle) {
|
|
@@ -1988,6 +1998,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1988
1998
|
var oContext = oEventSource.getParent().getBindingContext();
|
|
1989
1999
|
var sSemanticObject = oEventSource.data("SemanticObject");
|
|
1990
2000
|
var sAction = oEventSource.data("Action");
|
|
2001
|
+
var oTarget = { semanticObject: sSemanticObject, action: sAction };
|
|
1991
2002
|
|
|
1992
2003
|
oCommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(function() {
|
|
1993
2004
|
var oOutbound = {
|
|
@@ -1995,7 +2006,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1995
2006
|
semanticObject: sSemanticObject
|
|
1996
2007
|
};
|
|
1997
2008
|
fnNavigateIntent(oOutbound, [oContext], oState.oSmartFilterbar || undefined);
|
|
1998
|
-
}, Function.prototype, "LeaveApp");
|
|
2009
|
+
}, Function.prototype, "LeaveApp", false, oTarget);
|
|
1999
2010
|
}
|
|
2000
2011
|
|
|
2001
2012
|
/*
|
|
@@ -2025,13 +2036,15 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2025
2036
|
if (bRequiresContext && !aSelectedContexts.length) { // not consistent, since contexts missing
|
|
2026
2037
|
fnShowMessageForInvalidNumberOfSelects(aSelectedContexts.length);
|
|
2027
2038
|
} else {
|
|
2039
|
+
var oTarget = { semanticObject: oCustomData.SemanticObject, action: oCustomData.Action };
|
|
2028
2040
|
oCommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(function () {
|
|
2029
2041
|
onDataFieldForIntentBasedNavigationSelectedContext(oCustomData, aSelectedContexts, oSmartFilterbar);
|
|
2030
|
-
}, Function.prototype, "LeaveApp");
|
|
2042
|
+
}, Function.prototype, "LeaveApp", false, oTarget);
|
|
2031
2043
|
}
|
|
2032
2044
|
}
|
|
2033
2045
|
|
|
2034
2046
|
function onInlineDataFieldForIntentBasedNavigation(oEventSource, oState){
|
|
2047
|
+
var oTarget = { semanticObject: oEventSource.data("SemanticObject"), action: oEventSource.data("Action") };
|
|
2035
2048
|
oCommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(function() {
|
|
2036
2049
|
var oOutbound = {
|
|
2037
2050
|
semanticObject: oEventSource.data("SemanticObject"),
|
|
@@ -2039,7 +2052,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2039
2052
|
};
|
|
2040
2053
|
var oContext = oEventSource.getParent().getBindingContext();
|
|
2041
2054
|
fnNavigateIntent(oOutbound, [oContext], oState.oSmartFilterbar);
|
|
2042
|
-
}, Function.prototype, "LeaveApp");
|
|
2055
|
+
}, Function.prototype, "LeaveApp", false, oTarget);
|
|
2043
2056
|
}
|
|
2044
2057
|
|
|
2045
2058
|
function onInlineDataFieldForAction(oEvent) {
|
|
@@ -2709,7 +2722,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2709
2722
|
var oSelectionVariant = fnBuildSelectionVariantForNavigation(oOutbound, [], oContext);
|
|
2710
2723
|
oController.adaptNavigationParameterExtension(oSelectionVariant, oOutbound);
|
|
2711
2724
|
oCommonUtils.setComponentRefreshBehaviour(oOutbound);
|
|
2712
|
-
|
|
2725
|
+
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
2726
|
+
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
2727
|
+
if (oOutbound.parameters && oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
2728
|
+
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
2729
|
+
if (oNavHandler.navigate) {
|
|
2730
|
+
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
2731
|
+
}
|
|
2732
|
+
} else {
|
|
2733
|
+
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
2734
|
+
}
|
|
2713
2735
|
}
|
|
2714
2736
|
|
|
2715
2737
|
function onSmartFieldInitialise(oEvent,sViewId){
|
|
@@ -845,7 +845,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
845
845
|
//indicator that the state should not be overwritten
|
|
846
846
|
//if draft enabled then passing NavigateExternal else on back button passing LeavePage
|
|
847
847
|
}
|
|
848
|
-
}, Function.prototype, "LeaveApp");
|
|
848
|
+
}, Function.prototype, "LeaveApp", false, { semanticObject: oOutbound.semanticObject, action: oOutbound.action });
|
|
849
849
|
}
|
|
850
850
|
|
|
851
851
|
function fnGetNavigationKeyProperties(sTargetEntitySet) {
|
|
@@ -1020,7 +1020,6 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1020
1020
|
var oSelectionVariant, sSelectionVariantPrepared, sParameter, sSemanticObject, aSelVariantPropertyNames, aSelOptionPropertyNames, aParameterNames;
|
|
1021
1021
|
var oEventParameters = oEvent.getParameters();
|
|
1022
1022
|
var oNavigationHandler = oServices.oApplication.getNavigationHandler();
|
|
1023
|
-
var SuppressionBehavior = FENavLibrary.SuppressionBehavior;
|
|
1024
1023
|
// fill oSelectionVariant with the selectOptions from sSelectionVariant
|
|
1025
1024
|
oSelectionVariant = oNavigationHandler.mixAttributesAndSelectionVariant({}, sSelectionVariant);
|
|
1026
1025
|
//Invoke the "beforeSmartLinkPopoverOpensExtension" method to determine whether FE can process the event.
|
|
@@ -1068,7 +1067,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1068
1067
|
}
|
|
1069
1068
|
});
|
|
1070
1069
|
// add the resulting selectOptions and parameters (if any!) in oSelectionVariant with the ones of the semanticObject in oEventParameters as selectOptions to oSelectionVariant
|
|
1071
|
-
|
|
1070
|
+
// Only suppress empty-string properties that are not present in the empty-string semantic object bucket.
|
|
1071
|
+
// Properties in oSemObjEmpty are genuine entity key fields (e.g. MaintenanceOrderSubOperation:"") and must be kept.
|
|
1072
|
+
// Properties absent from oSemObjEmpty but present with "" in the event semantic object are spurious cache-inflated values and must be dropped.
|
|
1073
|
+
var mSemanticAttrsFiltered = Object.assign({}, mSemanticAttributesOfEventSemanticObject);
|
|
1074
|
+
Object.keys(mSemanticAttrsFiltered).forEach(function(sKey) {
|
|
1075
|
+
if (mSemanticAttrsFiltered[sKey] === "" && !(sKey in oSemObjEmpty)) {
|
|
1076
|
+
delete mSemanticAttrsFiltered[sKey];
|
|
1077
|
+
}
|
|
1078
|
+
});
|
|
1079
|
+
oSelectionVariant = oNavigationHandler.mixAttributesAndSelectionVariant(mSemanticAttrsFiltered, oSelectionVariant.toJSONString());
|
|
1072
1080
|
// Remove sensitive data from the context
|
|
1073
1081
|
oSelectionVariant = fnRemovePropertiesFromNavigationContext(oSelectionVariant, oEvent.getSource(), oState);
|
|
1074
1082
|
var oObjectInfo = {
|
|
@@ -1361,10 +1369,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1361
1369
|
// "LeaveApp": leave the app via a forward navigation
|
|
1362
1370
|
// "LeavePage": leave the page via an internal navigation or a backward navigation (which may or may not be internal)
|
|
1363
1371
|
// Note: if sMode is faulty it will be considered as "LeavePage"
|
|
1364
|
-
function fnProcessDataLossOrDraftDiscardConfirmation(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck){
|
|
1372
|
+
function fnProcessDataLossOrDraftDiscardConfirmation(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck, oTarget){
|
|
1365
1373
|
sMode = sMode || "LeavePage";
|
|
1366
1374
|
if (oComponentUtils.isDraftEnabled()){
|
|
1367
|
-
return oServices.oPageLeaveHandler.performAfterDiscardOrKeepDraft(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck, false);
|
|
1375
|
+
return oServices.oPageLeaveHandler.performAfterDiscardOrKeepDraft(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck, false, oTarget);
|
|
1368
1376
|
} else {
|
|
1369
1377
|
return oServices.oDataLossHandler.performIfNoDataLoss(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck, false);
|
|
1370
1378
|
}
|
|
@@ -22,19 +22,24 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
22
22
|
firstListItemOption.focus();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
function checkIfNavigationIsExplace() {
|
|
25
|
+
function checkIfNavigationIsExplace(oTarget) {
|
|
26
26
|
var UShellContainer = sap.ui.require("sap/ushell/Container");
|
|
27
27
|
if (!UShellContainer) {
|
|
28
|
-
return Promise.resolve(false);
|
|
28
|
+
return Promise.resolve(false);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
return
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
return new Promise(function(resolve) {
|
|
32
|
+
sap.ui.require(["sap/ushell/api/FioriElements"], function(FioriElements) {
|
|
33
|
+
FioriElements.isExplaceNavigation(oTarget ? { target: oTarget } : undefined)
|
|
34
|
+
.then(function(bExplace) {
|
|
35
|
+
resolve(bExplace);
|
|
36
|
+
})
|
|
37
|
+
.catch(function() {
|
|
38
|
+
resolve(false);
|
|
39
|
+
});
|
|
40
|
+
}, function() {
|
|
41
|
+
resolve(false);
|
|
42
|
+
});
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
|
|
@@ -147,7 +152,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
147
152
|
return oDiscardPromise;
|
|
148
153
|
}
|
|
149
154
|
|
|
150
|
-
function fnPerformAfterDiscardOrKeepDraftImpl(fnPositive, fnNegative, sMode, bIsTechnical) {
|
|
155
|
+
function fnPerformAfterDiscardOrKeepDraftImpl(fnPositive, fnNegative, sMode, bIsTechnical, oTarget) {
|
|
151
156
|
var sEnableDiscardDraftConfirmation = oTemplateContract.oNavigationControllerProxy.isDiscardDraftConfirmationNeeded();
|
|
152
157
|
var bNeedsPopup = ((sEnableDiscardDraftConfirmation === "always" && sMode.startsWith("Leave")) || (sEnableDiscardDraftConfirmation === "restricted" && sMode === "LeavePage")) && isObjectEditable();
|
|
153
158
|
|
|
@@ -157,7 +162,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
157
162
|
}
|
|
158
163
|
|
|
159
164
|
// Check if navigation will be explace and skip popup if so
|
|
160
|
-
checkIfNavigationIsExplace().then(function(bIsExplace) {
|
|
165
|
+
checkIfNavigationIsExplace(oTarget).then(function(bIsExplace) {
|
|
161
166
|
if (bIsExplace) {
|
|
162
167
|
fnPositive(); // Skip popup for explace navigation
|
|
163
168
|
} else {
|
|
@@ -195,7 +200,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
195
200
|
}
|
|
196
201
|
|
|
197
202
|
// Parameter sMode has same possible values as fnProcessDataLossOrDraftDiscardConfirmation in CommonUtils
|
|
198
|
-
function fnPerformAfterDiscardOrKeepDraft(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck, bIsTechnical) {
|
|
203
|
+
function fnPerformAfterDiscardOrKeepDraft(fnProcessFunction, fnCancelFunction, sMode, bNoBusyCheck, bIsTechnical, oTarget) {
|
|
199
204
|
var oRet = new Promise(function (fnResolve, fnReject) {
|
|
200
205
|
var fnPositive = function () {
|
|
201
206
|
var oRet = fnProcessFunction();
|
|
@@ -206,9 +211,9 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
206
211
|
fnReject();
|
|
207
212
|
};
|
|
208
213
|
if (bNoBusyCheck) {
|
|
209
|
-
fnPerformAfterDiscardOrKeepDraftImpl(fnPositive, fnNegative, sMode, bIsTechnical);
|
|
214
|
+
fnPerformAfterDiscardOrKeepDraftImpl(fnPositive, fnNegative, sMode, bIsTechnical, oTarget);
|
|
210
215
|
} else {
|
|
211
|
-
oTemplateContract.oApplicationProxy.performAfterSideEffectExecution(fnPerformAfterDiscardOrKeepDraftImpl.bind(null, fnPositive, fnNegative, sMode, bIsTechnical), true);
|
|
216
|
+
oTemplateContract.oApplicationProxy.performAfterSideEffectExecution(fnPerformAfterDiscardOrKeepDraftImpl.bind(null, fnPositive, fnNegative, sMode, bIsTechnical, oTarget), true);
|
|
212
217
|
}
|
|
213
218
|
});
|
|
214
219
|
return oRet;
|
|
@@ -13,7 +13,7 @@ sap.ui.define(["sap/base/util/ObjectPath", "sap/ushell/ui/footerbar/AddBookmarkB
|
|
|
13
13
|
// Here we have introduced probing as for test scenarios as sap.ushell is not present all the iframe cases
|
|
14
14
|
var UShellContainer = sap.ui.require("sap/ushell/Container");
|
|
15
15
|
return UShellContainer ? new Promise(function(fnResolve){
|
|
16
|
-
UShellContainer.getFLPUrlAsync(true).
|
|
16
|
+
UShellContainer.getFLPUrlAsync(true).then(function (sFLPUrl){
|
|
17
17
|
fnResolve(sFLPUrl);
|
|
18
18
|
});
|
|
19
19
|
}) : Promise.resolve(document.URL);
|
|
@@ -188,14 +188,9 @@ sap.ui.define([
|
|
|
188
188
|
oSplitResult.collectionsWithRejectedNewRows[sFieldName] = sRejectionType;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
// All proposed new rows are accepted when creation is allowed
|
|
191
192
|
var aNewRows = bAllowsCreation ? aRawNewRows : [];
|
|
192
193
|
|
|
193
|
-
// Cap new rows to one per table; flag if the AI proposed more
|
|
194
|
-
if (aNewRows.length > 1) {
|
|
195
|
-
oSplitResult.attemptedMultipleNewRows = true;
|
|
196
|
-
aNewRows = [aNewRows[0]];
|
|
197
|
-
}
|
|
198
|
-
|
|
199
194
|
var aRowUpdates = aExistingRowUpdates.concat(aNewRows);
|
|
200
195
|
|
|
201
196
|
var oValidation = oFieldCollector.isValidSmartTable(oFieldMeta.entitySet, oObjectPage);
|