@sapui5/sap.suite.ui.generic.template 1.84.28 → 1.84.30
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/changeHandler/AddFilterItem.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddFooterActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddGroup.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddGroupElement.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddHeaderActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddHeaderFacet.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddSection.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddSubSection.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddTableColumn.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/AddToolbarActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveFilterItems.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveGroup.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveGroupElement.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveHeaderAndFooterActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveHeaderFacet.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveSection.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveSubSection.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveTableColumns.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/MoveToolbarActionButtons.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveFilterItem.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveGroup.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveGroupElement.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveHeaderAndFooterActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveHeaderFacet.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveSection.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveSubSection.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveTableColumn.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RemoveToolbarActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RevealFilterItem.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RevealHeaderFacet.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RevealTableColumn.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/RevealToolbarActionButton.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/generic/AddElement.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/generic/MoveElements.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/generic/RemoveElement.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/generic/RevealElement.js +1 -1
- package/src/sap/suite/ui/generic/template/changeHandler/util/AnnotationPropertyCommand.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/StatePreserver.js +11 -12
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +1 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +26 -23
- package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapui5/sap.suite.ui.generic.template",
|
|
3
|
-
"version": "1.84.
|
|
3
|
+
"version": "1.84.30",
|
|
4
4
|
"description": "SAPUI5 Library sap.suite.ui.generic.template",
|
|
5
5
|
"homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
|
|
6
6
|
"author": "SAP SE (https://www.sap.com)",
|
|
@@ -250,17 +250,16 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
250
250
|
}
|
|
251
251
|
|
|
252
252
|
// This function is called when the CrossAppNavService has retrieved the objects belonging to both appStateKeys (the one from the url and the session specific one which was stored inside).
|
|
253
|
-
// The corresponding states are oPermanentState and
|
|
253
|
+
// The corresponding states are oPermanentState and oSessionState. These states may both be faulty (e.g. in case the retrieval failed).
|
|
254
254
|
// oNewState is the target state which has already been initialized from the current state due to the analyzed transformation
|
|
255
|
-
function fnAdaptToFullAppState(fnResolve, fnReject, sAppStateKey, bIsSameAsLast, oNewState, oPermanentState, sSessionAppStateKey,
|
|
255
|
+
function fnAdaptToFullAppState(fnResolve, fnReject, sAppStateKey, bIsSameAsLast, oNewState, oPermanentState, sSessionAppStateKey, oSessionState){
|
|
256
256
|
if (sAppStateKeyInUrl === null){ // startup case
|
|
257
257
|
sAppStateKeyInUrl = sAppStateKey;
|
|
258
258
|
} else if (sAppStateKey !== sAppStateKeyInUrl){ // sAppStateKey is already outdated
|
|
259
259
|
fnReject();
|
|
260
260
|
return;
|
|
261
261
|
}
|
|
262
|
-
if (
|
|
263
|
-
var oSessionState = oRetrievedState.getData();
|
|
262
|
+
if (oSessionState){
|
|
264
263
|
fnAddKeyToLastKeys(oLastSessionKeys, oSessionState, sSessionAppStateKey);
|
|
265
264
|
fnTransferEntries(oNewState, oSessionState, true);
|
|
266
265
|
}
|
|
@@ -270,10 +269,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
270
269
|
}
|
|
271
270
|
|
|
272
271
|
// This function is called when the CrossAppNavService has retrieved the object which belongs to the specified appStateKey from the url.
|
|
273
|
-
// oRetrievedState is the corresponding object. Note that this will be
|
|
272
|
+
// oRetrievedState is the corresponding object. Note that this will be faulty in case the CrossAppNavService failed to provide an object. In this case we will nevertheless proceed.
|
|
274
273
|
// oNewState is the target state which has already been initialized from the current state due to the analyzed transformation
|
|
275
274
|
function fnAdaptToUrlAppState(fnResolve, fnReject, sAppStateKey, bIsSameAsLast, oNewState, oRetrievedState){
|
|
276
|
-
var oPermanentState = oRetrievedState
|
|
275
|
+
var oPermanentState = oRetrievedState || Object.create(null);
|
|
277
276
|
fnAddKeyToLastKeys(oLastPermanentKeys, oPermanentState, sAppStateKey);
|
|
278
277
|
|
|
279
278
|
if (!oPermanentState.permanentEntries){
|
|
@@ -291,9 +290,9 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
291
290
|
}
|
|
292
291
|
|
|
293
292
|
if (oPermanentState.sessionAppStateKey){
|
|
294
|
-
var oAppStatePromise =
|
|
295
|
-
oAppStatePromise.
|
|
296
|
-
oAppStatePromise.
|
|
293
|
+
var oAppStatePromise = oTemplateContract.oNavigationControllerProxy.getAppStateFromShell(oPermanentState.sessionAppStateKey);
|
|
294
|
+
oAppStatePromise.then(fnAdaptToFullAppState.bind(null, fnResolve, fnReject, sAppStateKey, bIsSameAsLast, oNewState, oPermanentState.permanentEntries, oPermanentState.sessionAppStateKey));
|
|
295
|
+
oAppStatePromise.catch(fnAdaptToFullAppState.bind(null, fnReject, fnReject, sAppStateKey, bIsSameAsLast, oNewState, oPermanentState.permanentEntries, "", null));
|
|
297
296
|
} else {
|
|
298
297
|
fnAdaptToFullAppState(fnResolve, fnReject, sAppStateKey, bIsSameAsLast, oNewState, oPermanentState.permanentEntries, "", null);
|
|
299
298
|
}
|
|
@@ -349,9 +348,9 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
349
348
|
fnNotifyRealizedAppStateConsistent = resolve;
|
|
350
349
|
});
|
|
351
350
|
}
|
|
352
|
-
var oAppStatePromise =
|
|
353
|
-
oAppStatePromise.
|
|
354
|
-
oAppStatePromise.
|
|
351
|
+
var oAppStatePromise = oTemplateContract.oNavigationControllerProxy.getAppStateFromShell(sAppStateKeyInUrl);
|
|
352
|
+
oAppStatePromise.then(fnAdaptToUrlAppState.bind(null, fnResolve, fnReject, sAppStateKeyInUrl, bIsSameAsLast, oNewState));
|
|
353
|
+
oAppStatePromise.catch(fnAdaptToUrlAppState.bind(null, fnReject, fnReject, sAppStateKeyInUrl, bIsSameAsLast, oNewState, null));
|
|
355
354
|
}, fnReject);
|
|
356
355
|
});
|
|
357
356
|
return oRet;
|
|
@@ -1694,6 +1694,19 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1694
1694
|
}
|
|
1695
1695
|
return oRet;
|
|
1696
1696
|
}
|
|
1697
|
+
|
|
1698
|
+
// returns a Promise that resolves to the data which have been stored with the given key if this data could be retrieved. Otherwise it is rejected to null.
|
|
1699
|
+
// The following edge cases are also rejected: sAppStateKey is faulty, or undefined has been stored with the key (note that CrossAppNav service also might provide undefined when it cannot retrieve the data).
|
|
1700
|
+
function getAppStateFromShell(sAppStateKey){
|
|
1701
|
+
return sAppStateKey ? new Promise(function(fnResolve, fnReject){
|
|
1702
|
+
var oShellPromise = oCrossAppNavigator.getAppState(oTemplateContract.oAppComponent, sAppStateKey);
|
|
1703
|
+
oShellPromise.done(function(oWrapper){
|
|
1704
|
+
var oRetrievedData = oWrapper.getData();
|
|
1705
|
+
(oRetrievedData === undefined ? fnReject : fnResolve)(oRetrievedData);
|
|
1706
|
+
});
|
|
1707
|
+
oShellPromise.fail(fnReject.bind(null, undefined));
|
|
1708
|
+
}) : Promise.reject();
|
|
1709
|
+
}
|
|
1697
1710
|
|
|
1698
1711
|
// Start: Handling url-changes
|
|
1699
1712
|
|
|
@@ -1770,20 +1783,17 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1770
1783
|
}) : Promise.resolve();
|
|
1771
1784
|
return oParentContextPromise.then(function(oParentContext){
|
|
1772
1785
|
var sBindingPath = oParentContext ? oTreeNode.navigationProperty : "/" + oComponent.getEntitySet();
|
|
1773
|
-
// reconstruct predefined values from corresponding appState information
|
|
1786
|
+
// reconstruct predefined values from corresponding appState information (if possible, otherwise create without predefined values)
|
|
1774
1787
|
var sAppStateKey = oCurrentIdentity.appStates[sAppStateForCreate];
|
|
1775
|
-
var oPredefinedValuesPromise = sAppStateKey
|
|
1776
|
-
|
|
1777
|
-
oAppStatePromise.done(fnResolve);
|
|
1778
|
-
oAppStatePromise.fail(fnResolve.bind(null, null)); // when reading of appstate fails just proceed with normal creation
|
|
1779
|
-
}) : Promise.resolve();
|
|
1780
|
-
return oPredefinedValuesPromise.then(function(oAppStateData){
|
|
1788
|
+
var oPredefinedValuesPromise = getAppStateFromShell(sAppStateKey);
|
|
1789
|
+
var fnCreateNonDraft = function(oPredefinedValues){
|
|
1781
1790
|
oRegistryEntry.nonDraftCreateContext = oPredefinedCreateContext ||
|
|
1782
1791
|
oRegistryEntry.nonDraftCreateContext ||
|
|
1783
|
-
CRUDHelper.createNonDraft(oParentContext, sBindingPath, oModel,
|
|
1792
|
+
CRUDHelper.createNonDraft(oParentContext, sBindingPath, oModel, oPredefinedValues, oTemplateContract.oApplicationProxy.mustRequireRequestsCanonical());
|
|
1784
1793
|
oPredefinedCreateContext = null;
|
|
1785
1794
|
return fnPerformActivation(oRegistryEntry.nonDraftCreateContext.getPath());
|
|
1786
|
-
}
|
|
1795
|
+
};
|
|
1796
|
+
return oPredefinedValuesPromise.then(fnCreateNonDraft, fnCreateNonDraft);
|
|
1787
1797
|
});
|
|
1788
1798
|
}
|
|
1789
1799
|
delete oRegistryEntry.nonDraftCreateContext;
|
|
@@ -2073,13 +2083,12 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2073
2083
|
}
|
|
2074
2084
|
|
|
2075
2085
|
// This method is called, when the app has been started via back navigation and restoring the history from the url has been finished.
|
|
2076
|
-
// Note that
|
|
2086
|
+
// Note that oHistoryObject might be faulty, which would mean that restoring the history from the url has failed.
|
|
2077
2087
|
// In this case a 'dummy' history is created.
|
|
2078
|
-
function fnHistoryRestored(
|
|
2088
|
+
function fnHistoryRestored(oHistoryObject){
|
|
2079
2089
|
aPreviousHashes.push(oCurrentHash); // This represents the time before the app was started the first time
|
|
2080
2090
|
var oHistoricHash; // the last hash of the previous history
|
|
2081
|
-
if (
|
|
2082
|
-
var oHistoryObject = oOldHistoryState.getData();
|
|
2091
|
+
if (oHistoryObject){ // history could be recreated
|
|
2083
2092
|
isInitialNavigation = oHistoryObject.isInitialNavigation;
|
|
2084
2093
|
// Recreate aPreviousHashes from the old history object. Note that the order is reverse.
|
|
2085
2094
|
for (var i = oHistoryObject.historicalEntries.length; i > 0; i--){
|
|
@@ -2109,19 +2118,12 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2109
2118
|
fnRouteMatchedWithHistory(); // proceed with handling the route matched event
|
|
2110
2119
|
}
|
|
2111
2120
|
|
|
2112
|
-
var fnHistoryRestoreFailed = fnHistoryRestored.bind(null, null);
|
|
2113
|
-
|
|
2114
2121
|
// This handler is registered at the route matched event of the router. It is thus called whenever the url changes within the App (if the new url is legal)
|
|
2115
2122
|
function fnHandleRouteMatched(oEvent) {
|
|
2116
2123
|
if (bIsRestoring && !aPreviousHashes.length){ // restarted this app via back navigation without direct access to the history we have returned to
|
|
2117
2124
|
var sPreviousHistoryKey = oCurrentIdentity.appStates[sAppStateForHistory]; // try to recreate history from url information
|
|
2118
|
-
var oHistoryStatePromise =
|
|
2119
|
-
|
|
2120
|
-
oHistoryStatePromise.done(fnHistoryRestored);
|
|
2121
|
-
oHistoryStatePromise.fail(fnHistoryRestoreFailed);
|
|
2122
|
-
} else {
|
|
2123
|
-
fnHistoryRestoreFailed();
|
|
2124
|
-
}
|
|
2125
|
+
var oHistoryStatePromise = getAppStateFromShell(sPreviousHistoryKey);
|
|
2126
|
+
oHistoryStatePromise.then(fnHistoryRestored, fnHistoryRestored);
|
|
2125
2127
|
return; // follow up in fnHistoryRestored
|
|
2126
2128
|
}
|
|
2127
2129
|
fnRouteMatchedWithHistory();
|
|
@@ -2269,6 +2271,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2269
2271
|
oNavigationControllerProxy.restore = fnInitSession;
|
|
2270
2272
|
oNavigationControllerProxy.prepareHostView = fnPrepareHostView;
|
|
2271
2273
|
oNavigationControllerProxy.navigateToMessagePage = fnNavigateToMessagePage;
|
|
2274
|
+
oNavigationControllerProxy.getAppStateFromShell = getAppStateFromShell;
|
|
2272
2275
|
|
|
2273
2276
|
// Note: Function createHostView will be added by routingHelper.
|
|
2274
2277
|
// Allow to mock this by unit tests
|
|
@@ -2352,7 +2355,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
2352
2355
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
2353
2356
|
* @public
|
|
2354
2357
|
* @extends sap.ui.base.Object
|
|
2355
|
-
* @version 1.84.
|
|
2358
|
+
* @version 1.84.30
|
|
2356
2359
|
* @since 1.30.0
|
|
2357
2360
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
2358
2361
|
*/
|