@sapui5/sap.suite.ui.generic.template 1.120.47 → 1.120.49
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/i18n/i18n_pt.properties +1 -1
- 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/controller/IappStateHandler.js +10 -8
- 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/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- 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/CommonEventHandlers.js +20 -2
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +6 -1
- package/src/sap/suite/ui/generic/template/lib/ComponentUtils.js +87 -67
- package/src/sap/suite/ui/generic/template/lib/TemplateAssembler.js +39 -40
- package/src/sap/suite/ui/generic/template/lib/ViewCreationHelper.js +39 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +1 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +35 -27
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -55,7 +55,7 @@ VISUAL_FILTER_MEASURES=Medida por
|
|
|
55
55
|
|
|
56
56
|
VISUAL_FILTER_CHART_TYPES=Tipos de gr\u00E1fico
|
|
57
57
|
|
|
58
|
-
VISUAL_FILTER_CHART_TYPE_BAR=Gr\u00E1fico de
|
|
58
|
+
VISUAL_FILTER_CHART_TYPE_BAR=Gr\u00E1fico de barras
|
|
59
59
|
|
|
60
60
|
VISUAL_FILTER_CHART_TYPE_Line=Gr\u00E1fico de linha
|
|
61
61
|
|
|
@@ -108,7 +108,7 @@ sap.ui.define([
|
|
|
108
108
|
aCollection.sort(function (oFirstData, oSecondData) {
|
|
109
109
|
var iFirstDataImportance = getImportance(oFirstData);
|
|
110
110
|
var iSecondDataImportance = getImportance(oSecondData);
|
|
111
|
-
return iFirstDataImportance < iSecondDataImportance ? -1 : 1;
|
|
111
|
+
return iFirstDataImportance < iSecondDataImportance ? -1 : iFirstDataImportance > iSecondDataImportance ? 1 : 0;
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
114
|
|
|
@@ -478,16 +478,15 @@ sap.ui.define([
|
|
|
478
478
|
// setCurrentVariantId which triggers SFB's filterChange event. oDataLoadedWrapper
|
|
479
479
|
// is attached to filterChange and resets bDataAreShownInTable to false — overwriting
|
|
480
480
|
// the value that was correctly restored from iAppState. Re-applying it explicitly
|
|
481
|
-
// after
|
|
482
|
-
//
|
|
483
|
-
//
|
|
481
|
+
// after all wrapper promises settle ensures the saved value wins after all async
|
|
482
|
+
// activity completes (including SmartVariantManagementWrapper waiting for control
|
|
483
|
+
// initialization on cold start, e.g. tile click after browser refresh).
|
|
484
484
|
var bDataLoaded = oAppData.controlStates && oAppData.controlStates["$dataLoaded"];
|
|
485
|
-
fnAdaptOtherControlsToAppState(oAppData.controlStates)
|
|
486
|
-
Promise.resolve().then(function() {
|
|
485
|
+
fnAdaptOtherControlsToAppState(oAppData.controlStates).then(function() {
|
|
487
486
|
oDataLoadedWrapper.setState(bDataLoaded);
|
|
488
487
|
if (areDataShownInTable() && Object.keys(oState.oSmartFilterbar.verifySearchAllowed()).length === 0) {
|
|
489
|
-
// fnAdaptOtherControlsToAppState
|
|
490
|
-
//
|
|
488
|
+
// fnAdaptOtherControlsToAppState sets the state including the information whether data should be loaded and search is allowed.
|
|
489
|
+
// Now that all wrappers (including SVM) have finished applying state, trigger the actual data loading.
|
|
491
490
|
loadData();
|
|
492
491
|
} else {
|
|
493
492
|
// hide placeholder already here, if no data is to be loaded - in case data is loaded, it will be hidden in data received event
|
|
@@ -817,12 +816,15 @@ sap.ui.define([
|
|
|
817
816
|
}
|
|
818
817
|
|
|
819
818
|
function fnAdaptOtherControlsToAppState(mControlsStates) {
|
|
819
|
+
var aPromises = [];
|
|
820
820
|
// adapt controls according to current implementation
|
|
821
821
|
// Information in state could actually differ (if state originates from old release, change in FE or app layer). Additional information in state should be ignored,
|
|
822
822
|
// missing information should lead to set initial state (which wrappers should do if called with undefined)
|
|
823
823
|
aControlStateWrappers.forEach(function (oWrapper) {
|
|
824
|
-
oWrapper.setState(mControlsStates[oWrapper.getLocalId()]);
|
|
824
|
+
var vResult = oWrapper.setState(mControlsStates[oWrapper.getLocalId()]);
|
|
825
|
+
aPromises.push(Promise.resolve(vResult));
|
|
825
826
|
});
|
|
827
|
+
return Promise.all(aPromises);
|
|
826
828
|
}
|
|
827
829
|
|
|
828
830
|
/**
|
|
@@ -631,6 +631,7 @@ sap.ui.define([
|
|
|
631
631
|
|
|
632
632
|
function restore(){
|
|
633
633
|
oTemplateContract.oBusyHelper.setBusyReason("exiting", false);
|
|
634
|
+
oTemplateContract.oApplicationProxy.resetExternalNavigation();
|
|
634
635
|
for (var sComponentId in oTemplateContract.componentRegistry){
|
|
635
636
|
var oRegistryEntry = oTemplateContract.componentRegistry[sComponentId];
|
|
636
637
|
if (oRegistryEntry.methods.onRestore) {
|
|
@@ -926,6 +927,7 @@ sap.ui.define([
|
|
|
926
927
|
var fnNormalizePagesMapToArray = testableHelper.testable(fnNormalizePagesMapToArray, "fnNormalizePagesMapToArray");
|
|
927
928
|
getConfig = testableHelper.testable(getConfig, "getConfig");
|
|
928
929
|
testableHelper.testable(setLeaveAppPromise, "AppComponent_setLeaveAppPromise");
|
|
930
|
+
testableHelper.testable(restore, "AppComponent_restore");
|
|
929
931
|
/* eslint-enable */
|
|
930
932
|
|
|
931
933
|
return oMethods;
|
|
@@ -939,7 +941,7 @@ sap.ui.define([
|
|
|
939
941
|
* @extends sap.ui.core.UIComponent
|
|
940
942
|
* @abstract
|
|
941
943
|
* @author SAP SE
|
|
942
|
-
* @version 1.120.
|
|
944
|
+
* @version 1.120.49
|
|
943
945
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
944
946
|
*/
|
|
945
947
|
return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -84,6 +84,11 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
84
84
|
*/
|
|
85
85
|
function getMethods(oTemplateContract) {
|
|
86
86
|
|
|
87
|
+
// Set on first fnNavigateExternal call; blocks re-entry until reset. NavigationHandler.navigate() calls fnOnError
|
|
88
|
+
// on all failure paths and does not call it on the success path (app is leaving). The two valid reset points are
|
|
89
|
+
// therefore fnOnErrorWrapper (navigation failed) and AppComponent.restore() (FLP re-activated this app).
|
|
90
|
+
var bExternalNavigationTriggered = false;
|
|
91
|
+
|
|
87
92
|
var oFocusHelper = new FocusHelper(oTemplateContract);
|
|
88
93
|
var oContextBookkeeping = new ContextBookkeeping(oTemplateContract);
|
|
89
94
|
var mEntitySetToETagInfo = Object.create(null); // maps the name of the entity sets which have been already checked for eTag
|
|
@@ -673,8 +678,13 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
673
678
|
if (oCurrentNavigationHandler === GHOSTNAVIGATIONHANDLER){
|
|
674
679
|
return;
|
|
675
680
|
}
|
|
681
|
+
if (bExternalNavigationTriggered){
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
684
|
+
bExternalNavigationTriggered = true;
|
|
676
685
|
oTemplateContract.oNavigationControllerProxy.leave();
|
|
677
|
-
var fnOnErrorWrapper = function(){
|
|
686
|
+
var fnOnErrorWrapper = function () {
|
|
687
|
+
bExternalNavigationTriggered = false;
|
|
678
688
|
oFocusHelper.setNextFocus(Function.prototype); // Do not change focus in case exiting the application fails
|
|
679
689
|
oTemplateContract.oBusyHelper.setBusyReason("exiting", false); // in error case we are not navigating away
|
|
680
690
|
if (fnOnError){
|
|
@@ -835,7 +845,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
835
845
|
removeTransientMessages: fnRemoveTransientMessages,
|
|
836
846
|
getTransientMessages: getTransientMessages,
|
|
837
847
|
setNextFocus: oFocusHelper.setNextFocus,
|
|
838
|
-
setStates: setStates
|
|
848
|
+
setStates: setStates,
|
|
849
|
+
resetExternalNavigation: function() {
|
|
850
|
+
bExternalNavigationTriggered = false;
|
|
851
|
+
}
|
|
839
852
|
};
|
|
840
853
|
|
|
841
854
|
return {
|
|
@@ -712,7 +712,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
712
712
|
}
|
|
713
713
|
|
|
714
714
|
// 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
|
|
715
|
-
|
|
715
|
+
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
716
|
+
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
717
|
+
if (oOutbound.parameters && oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
718
|
+
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
719
|
+
if (oNavHandler.navigate) {
|
|
720
|
+
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
721
|
+
}
|
|
722
|
+
} else {
|
|
723
|
+
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
724
|
+
}
|
|
716
725
|
}
|
|
717
726
|
|
|
718
727
|
function fnNavigateIntentSmartLink(oOutbound, oEventSource) {
|
|
@@ -2498,7 +2507,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2498
2507
|
var oSelectionVariant = fnBuildSelectionVariantForNavigation(oOutbound, [], oContext);
|
|
2499
2508
|
oController.adaptNavigationParameterExtension(oSelectionVariant, oOutbound);
|
|
2500
2509
|
oCommonUtils.setComponentRefreshBehaviour(oOutbound);
|
|
2501
|
-
|
|
2510
|
+
// Explace outbounds must bypass fnNavigateExternal to avoid setting the app busy and consuming the re-entry guard.
|
|
2511
|
+
// getNavigationHandler() returns a ghost stub (no .navigate) when ghostapp=true — guard before calling.
|
|
2512
|
+
if (oOutbound.parameters && oOutbound.parameters["sap-ushell-navmode"] === "explace") {
|
|
2513
|
+
var oNavHandler = oServices.oApplication.getNavigationHandler();
|
|
2514
|
+
if (oNavHandler.navigate) {
|
|
2515
|
+
oNavHandler.navigate(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError, null, "explace");
|
|
2516
|
+
}
|
|
2517
|
+
} else {
|
|
2518
|
+
oServices.oApplication.navigateExternal(oOutbound.semanticObject, oOutbound.action, oSelectionVariant.toJSONString(), null, oCommonUtils.handleError);
|
|
2519
|
+
}
|
|
2502
2520
|
}
|
|
2503
2521
|
|
|
2504
2522
|
function onSmartFieldInitialise(oEvent,sViewId){
|
|
@@ -811,7 +811,8 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
811
811
|
// oResponse is never going to have the value for oDatafield.name in the encoded format, hence the transformation into encodedURI.
|
|
812
812
|
// It may happen that the oResponse[oDatafield.name] contains some special characters (for ex: space) but in a decoded manner.
|
|
813
813
|
// but the route for Context Navigation requires the route string in the encoded way.
|
|
814
|
-
var
|
|
814
|
+
var sFieldValueFromODataResponse = oResponse[oDatafield.name];
|
|
815
|
+
var sEncodedFieldValueFromODataResponse = encodeURIComponent(sFieldValueFromODataResponse);
|
|
815
816
|
switch (oDatafield.type) {
|
|
816
817
|
case "Edm.Guid":
|
|
817
818
|
if (oResponse.DraftAdministrativeData && oResponse.DraftAdministrativeData.DraftIsCreatedByMe) {
|
|
@@ -838,6 +839,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
838
839
|
var sFormattedvalue = ODataUtils.formatValue(sEncodedFieldValueFromODataResponse, oDatafield.type);
|
|
839
840
|
sRoute += sKeySeparator + oDatafield.name + "=" + sFormattedvalue;
|
|
840
841
|
break;
|
|
842
|
+
case "Edm.DateTime":
|
|
843
|
+
var sFormattedvalue = ODataUtils.formatValue(sFieldValueFromODataResponse, oDatafield.type);
|
|
844
|
+
sRoute += sKeySeparator + oDatafield.name + "=" + encodeURIComponent(sFormattedvalue);
|
|
845
|
+
break;
|
|
841
846
|
default:
|
|
842
847
|
if (typeof sEncodedFieldValueFromODataResponse === "string") {
|
|
843
848
|
sRoute += sKeySeparator + oDatafield.name + "=" + "'" + sEncodedFieldValueFromODataResponse + "'";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
sap.ui.define([
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/ui/base/Object",
|
|
2
3
|
"sap/ui/model/base/ManagedObjectModel",
|
|
3
4
|
"sap/suite/ui/generic/template/genericUtilities/controlHelper",
|
|
4
5
|
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
@@ -9,8 +10,9 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
9
10
|
"sap/base/util/isEmptyObject",
|
|
10
11
|
"sap/suite/ui/generic/template/genericUtilities/FeError",
|
|
11
12
|
"sap/base/util/UriParameters",
|
|
13
|
+
"sap/suite/ui/generic/template/lib/ViewCreationHelper",
|
|
12
14
|
"sap/suite/ui/generic/template/lib/CommandComponentUtils"
|
|
13
|
-
], function(BaseObject, ManagedObjectModel, controlHelper, FeLogger, oDataModelHelper, CRUDActionHandler, StatePreserver, extend, isEmptyObject, FeError, UriParameters,
|
|
15
|
+
], function(BaseObject, ManagedObjectModel, controlHelper, FeLogger, oDataModelHelper, CRUDActionHandler, StatePreserver, extend, isEmptyObject, FeError, UriParameters, ViewCreationHelper,
|
|
14
16
|
CommandComponentUtils) {
|
|
15
17
|
"use strict";
|
|
16
18
|
var sClassName = "lib.ComponentUtils";
|
|
@@ -474,80 +476,98 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
474
476
|
if (oComponentRegistryEntry.routingSpec && oComponentRegistryEntry.routingSpec.noOData){
|
|
475
477
|
fnPageDataLoadedOnNavigation(null, bAreKeysDifferent);
|
|
476
478
|
}
|
|
477
|
-
return;
|
|
479
|
+
return Promise.resolve();
|
|
480
|
+
}
|
|
481
|
+
var oViewReadyPromise = Promise.resolve();
|
|
482
|
+
if (oComponentRegistryEntry.oController) {
|
|
483
|
+
var oView = oComponentRegistryEntry.oController.getView();
|
|
484
|
+
if (oView && oView.isDestroyed()) {
|
|
485
|
+
// View creation of a specific component use to happen only once in the lifecycle of the component.
|
|
486
|
+
// View is expected to be alive for the lifecycle of the template component. In some edge cases where
|
|
487
|
+
// the same application variant is used as a target application & the source application has Keep-Alive
|
|
488
|
+
// as true the source application, aggregated components & their corresponding views are not destroyed.
|
|
489
|
+
// When target application is started and component is being created FE checks for the view with ID & if
|
|
490
|
+
// exist it is destroyed. This means the Source App & component is active but its view will be destroyed.
|
|
491
|
+
// Now if user navigates back to the source application & opens the same view again. To handle this
|
|
492
|
+
// scenario, FE checks for such situation and re-creates the view here.
|
|
493
|
+
oViewReadyPromise = ViewCreationHelper.initializeViewCreation(oComponentRegistryEntry);
|
|
494
|
+
oComponent.onBeforeRendering(oComponentRegistryEntry);
|
|
495
|
+
}
|
|
478
496
|
}
|
|
479
497
|
var oComponentContainer = oComponent.getComponentContainer();
|
|
480
498
|
if (!oComponentContainer){
|
|
481
|
-
return;
|
|
499
|
+
return Promise.resolve();
|
|
482
500
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
fnHeaderDataAvailableResolve
|
|
496
|
-
|
|
501
|
+
return oViewReadyPromise.then(function() {
|
|
502
|
+
var oUIModel = oComponent.getModel("ui");
|
|
503
|
+
var bIsNonDraftCreate = !!oComponentRegistryEntry.nonDraftCreateContext;
|
|
504
|
+
if (bIsNonDraftCreate) {
|
|
505
|
+
var oBindingContext = oComponentContainer.getBindingContext();
|
|
506
|
+
if (oBindingContext === oComponentRegistryEntry.nonDraftCreateContext){
|
|
507
|
+
return; // page is already in correct state
|
|
508
|
+
}
|
|
509
|
+
oUIModel.setProperty("/enabled", true);
|
|
510
|
+
oUIModel.setProperty("/editable", true);
|
|
511
|
+
oUIModel.setProperty("/createMode", true);
|
|
512
|
+
fnUnbind(); // unbind if bound to another context or an element binding
|
|
513
|
+
if (fnHeaderDataAvailableResolve){
|
|
514
|
+
fnHeaderDataAvailableResolve(oComponentRegistryEntry.nonDraftCreateContext);
|
|
515
|
+
fnHeaderDataAvailableResolve = null;
|
|
516
|
+
} else {
|
|
517
|
+
oHeaderDataAvailablePromise = Promise.resolve(oComponentRegistryEntry.nonDraftCreateContext);
|
|
518
|
+
}
|
|
519
|
+
fnPreparePageDataLoaded();
|
|
520
|
+
if (oComponentRegistryEntry.methods.beforeRebind) {
|
|
521
|
+
oComponentRegistryEntry.methods.beforeRebind(oHeaderDataAvailablePromise);
|
|
522
|
+
}
|
|
523
|
+
oComponentContainer.setBindingContext(oComponentRegistryEntry.nonDraftCreateContext);
|
|
524
|
+
Promise.all([oComponentRegistryEntry.oViewRenderedPromise, oComponentRegistryEntry.viewRegistered]).then(fnCallPathUnchangedReuseCallbacks.bind(null, true, false));
|
|
525
|
+
if (oComponentRegistryEntry.methods.afterRebind) {
|
|
526
|
+
oComponentRegistryEntry.methods.afterRebind();
|
|
527
|
+
}
|
|
497
528
|
} else {
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
} else {
|
|
510
|
-
var oElementBinding = oComponentContainer.getElementBinding();
|
|
511
|
-
if (oElementBinding){
|
|
512
|
-
if (sLogicalBindingPath === sBindingPath) {
|
|
513
|
-
/*
|
|
514
|
-
* component is already bound to this object - no rebound to avoid that 1:1, 1:N and expands are read
|
|
515
|
-
* again
|
|
516
|
-
*/
|
|
517
|
-
if (oElementBinding.isSuspended()) {
|
|
518
|
-
oElementBinding.resume();
|
|
519
|
-
fnAdaptToContext();
|
|
520
|
-
}
|
|
521
|
-
if (bIsDataLoading){
|
|
522
|
-
fnStartBusy();
|
|
523
|
-
}
|
|
524
|
-
oComponentRegistryEntry.oApplication.getBusyHelper().getUnbusy().then(fnCallPathUnchangedReuseCallbacks.bind(null, bAreKeysDifferent, false));
|
|
525
|
-
if (!bIsComponentCurrentlyActive){
|
|
526
|
-
fnPreparePageDataLoaded();
|
|
527
|
-
}
|
|
528
|
-
if (!bIsComponentCurrentlyActive && !isDraftEnabled()){ // in non-draft case: even if this object has been left in edit mode we now return to display mode, since the changes have already been discarded
|
|
529
|
-
var bEditFlowOfRoot = oComponentRegistryEntry.oApplication.getEditFlowOfRoot();
|
|
530
|
-
if (bEditFlowOfRoot === "direct") {
|
|
531
|
-
oUIModel.setProperty("/editable", true);
|
|
532
|
-
} else {
|
|
533
|
-
oUIModel.setProperty("/editable", false);
|
|
529
|
+
var oElementBinding = oComponentContainer.getElementBinding();
|
|
530
|
+
if (oElementBinding){
|
|
531
|
+
if (sLogicalBindingPath === sBindingPath) {
|
|
532
|
+
/*
|
|
533
|
+
* component is already bound to this object - no rebound to avoid that 1:1, 1:N and expands are read
|
|
534
|
+
* again
|
|
535
|
+
*/
|
|
536
|
+
if (oElementBinding.isSuspended()) {
|
|
537
|
+
oElementBinding.resume();
|
|
538
|
+
fnAdaptToContext();
|
|
534
539
|
}
|
|
540
|
+
if (bIsDataLoading){
|
|
541
|
+
fnStartBusy();
|
|
542
|
+
}
|
|
543
|
+
oComponentRegistryEntry.oApplication.getBusyHelper().getUnbusy().then(fnCallPathUnchangedReuseCallbacks.bind(null, bAreKeysDifferent, false));
|
|
544
|
+
if (!bIsComponentCurrentlyActive){
|
|
545
|
+
fnPreparePageDataLoaded();
|
|
546
|
+
}
|
|
547
|
+
if (!bIsComponentCurrentlyActive && !isDraftEnabled()){ // in non-draft case: even if this object has been left in edit mode we now return to display mode, since the changes have already been discarded
|
|
548
|
+
var bEditFlowOfRoot = oComponentRegistryEntry.oApplication.getEditFlowOfRoot();
|
|
549
|
+
if (bEditFlowOfRoot === "direct") {
|
|
550
|
+
oUIModel.setProperty("/editable", true);
|
|
551
|
+
} else {
|
|
552
|
+
oUIModel.setProperty("/editable", false);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
oUIModel.setProperty("/enabled", true);
|
|
556
|
+
return;
|
|
557
|
+
} else if (!bIsComponentCurrentlyActive){
|
|
558
|
+
fnUnbind();
|
|
535
559
|
}
|
|
536
|
-
oUIModel.setProperty("/enabled", true);
|
|
537
|
-
return;
|
|
538
|
-
} else if (!bIsComponentCurrentlyActive){
|
|
539
|
-
fnUnbind();
|
|
540
560
|
}
|
|
561
|
+
// the following properties will be adapted by the change event of the binding
|
|
562
|
+
oUIModel.setProperty("/enabled", false);
|
|
563
|
+
oUIModel.setProperty("/editable", false);
|
|
564
|
+
oUIModel.setProperty("/createMode", false);
|
|
565
|
+
// and read the header data if necessary
|
|
566
|
+
fnRebindHeaderData(sBindingPath);
|
|
567
|
+
|
|
568
|
+
fnPreparePageDataLoaded();
|
|
541
569
|
}
|
|
542
|
-
|
|
543
|
-
oUIModel.setProperty("/enabled", false);
|
|
544
|
-
oUIModel.setProperty("/editable", false);
|
|
545
|
-
oUIModel.setProperty("/createMode", false);
|
|
546
|
-
// and read the header data if necessary
|
|
547
|
-
fnRebindHeaderData(sBindingPath);
|
|
548
|
-
|
|
549
|
-
fnPreparePageDataLoaded();
|
|
550
|
-
}
|
|
570
|
+
});
|
|
551
571
|
}
|
|
552
572
|
|
|
553
573
|
// This method can be called in two scenarios:
|
|
@@ -6,24 +6,43 @@
|
|
|
6
6
|
// Note that this method cannot be used by any other class.
|
|
7
7
|
// - getExtensionAPIPromise provides access to the instance of the extensionAPI suitable for a certain control
|
|
8
8
|
|
|
9
|
-
sap.ui.define([
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
9
|
+
sap.ui.define([
|
|
10
|
+
"sap/ui/core/mvc/ControllerExtension",
|
|
11
|
+
"sap/ui/core/mvc/OverrideExecution",
|
|
12
|
+
"sap/ui/core/mvc/View",
|
|
13
|
+
"sap/ui/model/base/ManagedObjectModel",
|
|
14
|
+
"sap/suite/ui/generic/template/lib/TemplateViewController",
|
|
15
|
+
"sap/suite/ui/generic/template/lib/TemplateComponent",
|
|
16
|
+
"sap/suite/ui/generic/template/lib/CRUDManager",
|
|
17
|
+
"sap/suite/ui/generic/template/lib/CommonUtils",
|
|
18
|
+
"sap/suite/ui/generic/template/lib/ComponentUtils",
|
|
19
|
+
"sap/suite/ui/generic/template/lib/CommonEventHandlers",
|
|
20
|
+
"sap/suite/ui/generic/template/genericUtilities/testableHelper",
|
|
21
|
+
"sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
22
|
+
"sap/base/util/deepExtend",
|
|
23
|
+
"sap/suite/ui/generic/template/lib/presentationControl/PresentationControlHandlerFactory",
|
|
24
|
+
"sap/suite/ui/generic/template/lib/info/InfoObjectHandler",
|
|
25
|
+
"sap/m/IllustratedMessageType",
|
|
26
|
+
"sap/suite/ui/generic/template/lib/ViewCreationHelper"
|
|
27
|
+
], function(
|
|
28
|
+
ControllerExtension,
|
|
29
|
+
OverrideExecution,
|
|
30
|
+
View,
|
|
31
|
+
ManagedObjectModel,
|
|
32
|
+
TemplateViewController,
|
|
33
|
+
TemplateComponent,
|
|
34
|
+
CRUDManager,
|
|
35
|
+
CommonUtils,
|
|
36
|
+
ComponentUtils,
|
|
37
|
+
CommonEventHandlers,
|
|
38
|
+
testableHelper,
|
|
39
|
+
FeLogger,
|
|
40
|
+
deepExtend,
|
|
41
|
+
PresentationControlHandlerFactory,
|
|
42
|
+
InfoObjectHandler,
|
|
43
|
+
IllustratedMessageType,
|
|
44
|
+
ViewCreationHelper
|
|
45
|
+
) {
|
|
27
46
|
"use strict";
|
|
28
47
|
var oLogger = new FeLogger("lib.TemplateAssembler").getLogger();
|
|
29
48
|
|
|
@@ -376,28 +395,8 @@ sap.ui.define(["sap/ui/core/mvc/ControllerExtension",
|
|
|
376
395
|
var oComponentRegistryEntry = oComponentData.registryEntry;
|
|
377
396
|
var oAppRegistryEntry = getAppRegistryEntry(oComponentRegistryEntry.oAppComponent);
|
|
378
397
|
var oTemplateContract = oAppRegistryEntry.oTemplateContract;
|
|
379
|
-
var oTreeNode = oAppRegistryEntry.oTemplateContract.mRoutingTree[oComponentRegistryEntry.route];
|
|
380
|
-
|
|
381
|
-
// Note: oError is faulty in regular situations
|
|
382
|
-
oComponentRegistryEntry.fnViewRegisteredResolve = function(oError){
|
|
383
|
-
if (oError){
|
|
384
|
-
oComponentRegistryEntry.fnViewRegisteredResolve = Function.prototype;
|
|
385
|
-
fnReject(oError);
|
|
386
|
-
} else {
|
|
387
|
-
delete oComponentRegistryEntry.fnViewRegisteredResolve;
|
|
388
|
-
fnResolve();
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
});
|
|
392
|
-
oComponentRegistryEntry.oViewRenderedPromise = new Promise(function(fnResolve) {
|
|
393
|
-
oComponentRegistryEntry.fnViewRenderdResolve = fnResolve;
|
|
394
|
-
});
|
|
395
|
-
oComponentRegistryEntry.oViewRenderedPromise.then(function () {
|
|
396
|
-
// Application status needs to be handled here to support use cases where Diagnostics Tool gets loaded after the app itself.
|
|
397
|
-
CommonMethods.setApplicationStatus(CommonMethods.mApplicationStatus.RENDERED);
|
|
398
|
-
// When view rendering has finished, publish global event "GetData" at channel "elements".
|
|
399
|
-
CommonMethods.publishEvent("elements", "ViewRendered", {});
|
|
400
|
-
});
|
|
398
|
+
var oTreeNode = oAppRegistryEntry.oTemplateContract.mRoutingTree[oComponentRegistryEntry.route];
|
|
399
|
+
ViewCreationHelper.initializeViewCreation(oComponentRegistryEntry);
|
|
401
400
|
oComponentRegistryEntry.componentName = sComponentNameFull;
|
|
402
401
|
oComponentRegistryEntry.oComponent = this;
|
|
403
402
|
oComponentRegistryEntry.aKeys = [];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
sap.ui.define([
|
|
2
|
+
"sap/suite/ui/generic/template/support/lib/CommonMethods"
|
|
3
|
+
], function(CommonMethods) {
|
|
4
|
+
"use strict";
|
|
5
|
+
|
|
6
|
+
// This class contain methods which plays role in view creation of Template Component.
|
|
7
|
+
return {
|
|
8
|
+
initializeViewCreation: function(oComponentRegistryEntry) {
|
|
9
|
+
// Set the creation view started flag to false, to indicate that the view creation has not started yet.
|
|
10
|
+
oComponentRegistryEntry.createViewStarted = false;
|
|
11
|
+
|
|
12
|
+
// Create a promise for the view registration. This promise will be resolved when the view is registered.
|
|
13
|
+
oComponentRegistryEntry.viewRegistered = new Promise(function(fnResolve, fnReject) {
|
|
14
|
+
// Note: oError is faulty in regular situations
|
|
15
|
+
oComponentRegistryEntry.fnViewRegisteredResolve = function(oError){
|
|
16
|
+
if (oError){
|
|
17
|
+
oComponentRegistryEntry.fnViewRegisteredResolve = Function.prototype;
|
|
18
|
+
fnReject(oError);
|
|
19
|
+
} else {
|
|
20
|
+
delete oComponentRegistryEntry.fnViewRegisteredResolve;
|
|
21
|
+
fnResolve();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// Create a promise for the view rendering. This promise will be resolved when the view is rendered.
|
|
27
|
+
oComponentRegistryEntry.oViewRenderedPromise = new Promise(function(fnResolve) {
|
|
28
|
+
oComponentRegistryEntry.fnViewRenderdResolve = fnResolve;
|
|
29
|
+
// Application status needs to be handled here to support use cases where Diagnostics Tool gets loaded after the app itself.
|
|
30
|
+
CommonMethods.setApplicationStatus(CommonMethods.mApplicationStatus.RENDERED);
|
|
31
|
+
// When view rendering has finished, publish global event "GetData" at channel "elements".
|
|
32
|
+
CommonMethods.publishEvent("elements", "ViewRendered", {});
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Returns view registered promise as the view creation is completed and process can continue.
|
|
36
|
+
return oComponentRegistryEntry.viewRegistered;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
});
|
|
@@ -176,7 +176,7 @@ ST_GENERIC_ERROR_NAVIGATION_PROPERTY_NOT_CORRECT=Lastnost navigacije {0} v pripo
|
|
|
176
176
|
|
|
177
177
|
ST_GENERIC_FCL_FULLSCREEN=Celotni ekran
|
|
178
178
|
|
|
179
|
-
ST_GENERIC_FCL_EXIT_FULLSCREEN=Izhod iz
|
|
179
|
+
ST_GENERIC_FCL_EXIT_FULLSCREEN=Izhod iz celozaslonskega na\u010Dina
|
|
180
180
|
|
|
181
181
|
ST_GENERIC_FCL_CLOSE_COLUMN=Zapri
|
|
182
182
|
|
|
@@ -2149,38 +2149,46 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2149
2149
|
oRegistryEntry.sCurrentBindingPath = sBindingPath;
|
|
2150
2150
|
var fnActivate = function() {
|
|
2151
2151
|
// Bind the model for the page itself and all its ancestors (up to level 1)
|
|
2152
|
-
oRegistryEntry.utils.bindComponent(oRegistryEntry.sCurrentBindingPath, bIsComponentCurrentlyActive);
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
var
|
|
2163
|
-
|
|
2152
|
+
var bindComponentPromise = oRegistryEntry.utils.bindComponent(oRegistryEntry.sCurrentBindingPath, bIsComponentCurrentlyActive);
|
|
2153
|
+
bindComponentPromise.then(function(){
|
|
2154
|
+
if (sComponentId === oCurrentIdentity.treeNode.componentId){
|
|
2155
|
+
var mAncestors = Object.create(null); // Collect all ancestor routes
|
|
2156
|
+
mAncestors.root = true;
|
|
2157
|
+
for (var oTreeNode = oCurrentIdentity.treeNode; oTreeNode.level > 0; oTreeNode = oTemplateContract.mRoutingTree[oTreeNode.parentRoute]){
|
|
2158
|
+
mAncestors[oTreeNode.sRouteName] = true;
|
|
2159
|
+
oTreeNode.bindElement(oTemplateContract.oNavigationHost, null, true);
|
|
2160
|
+
// Temporary solution (AncestorFeature)
|
|
2161
|
+
if (oTreeNode.contextTargets){
|
|
2162
|
+
for (var i = 0; i < oTreeNode.contextTargets.length; i++){
|
|
2163
|
+
var oContextTarget = oTreeNode.contextTargets[i];
|
|
2164
|
+
// Link control used for BreadCrumbs is bound to the context of the ancestor node as the description is fetched from
|
|
2165
|
+
// the ancestor object. Unfortunately, the OP where the link is on the OP & its context is propagated, even specific call
|
|
2166
|
+
// to set the context of ancestor node is not respected as the model find a context which is already bound. Hence, we need
|
|
2167
|
+
// to break the propagation of current object context before setting the context of ancestor node.
|
|
2168
|
+
oContextTarget.setBindingContext(null);
|
|
2169
|
+
oTreeNode.bindElement(oContextTarget, null, false);
|
|
2170
|
+
}
|
|
2164
2171
|
}
|
|
2165
2172
|
}
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2173
|
+
// Now we have done the binding of the tree node specific model for all ancestors of the current page.
|
|
2174
|
+
// Unbind the tree node specific models for all other pages, as they might use outdated binding pathes.
|
|
2175
|
+
for (var sRouteName in oTemplateContract.mRoutingTree) {
|
|
2176
|
+
if (!mAncestors[sRouteName]) {
|
|
2177
|
+
var oOtherTreeNode = oTemplateContract.mRoutingTree[sRouteName];
|
|
2178
|
+
oOtherTreeNode.unbindElement(oTemplateContract.oNavigationHost, true);
|
|
2179
|
+
// Temporary solution (AncestorFeature)
|
|
2180
|
+
if (oOtherTreeNode.contextTargets) {
|
|
2181
|
+
oOtherTreeNode.contextTargets.forEach(oOtherTreeNode.unbindElement);
|
|
2182
|
+
}
|
|
2176
2183
|
}
|
|
2177
2184
|
}
|
|
2178
2185
|
}
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2186
|
+
oRegistryEntry.utils.refreshBinding();
|
|
2187
|
+
oRegistryEntry.oStatePreserverPromise.then(function(oStatePreserver){
|
|
2188
|
+
oStatePreserver.applyAppState(sBindingPath, bIsComponentCurrentlyActive);
|
|
2189
|
+
});
|
|
2183
2190
|
});
|
|
2191
|
+
|
|
2184
2192
|
return (oRegistryEntry.methods.onActivate || Function.prototype)(sBindingPath, bIsComponentCurrentlyActive);
|
|
2185
2193
|
};
|
|
2186
2194
|
// If view is not registered yet ( == oComponentRegistryEntry.fnViewRegisteredResolve still available) perform fnActivate asyncronously, otherwise synchronosly
|
|
@@ -3094,7 +3102,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3094
3102
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3095
3103
|
* @public
|
|
3096
3104
|
* @extends sap.ui.base.Object
|
|
3097
|
-
* @version 1.120.
|
|
3105
|
+
* @version 1.120.49
|
|
3098
3106
|
* @since 1.30.0
|
|
3099
3107
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3100
3108
|
*/
|