@sapui5/sap.fe.navigation 1.150.0 → 1.151.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.
@@ -560,7 +560,8 @@ export class NavigationHandler extends BaseObject {
560
560
  * <li><code>oAppData.customData</code></li>
561
561
  * </ul>
562
562
  * which return the inner app data as stored in {@link #.navigate navigate} or {@link #.storeInnerAppStateAsync storeInnerAppStateAsync}.
563
- * <code>oAppData.oDefaultedSelectionVariant</code> is an empty selection variant and
563
+ * <code>oAppData.oDefaultedSelectionVariant</code> is populated with the user default values when they are
564
+ * available (fetched from the cross-app state), otherwise it is an empty selection variant, and
564
565
  * <code>oAppData.bNavSelVarHasDefaultsOnly</code> is <code>false</code> in this case.<br>
565
566
  * <b>Note:</b> If the navigation type is {@link sap.fe.navigation.NavType.initial} oAppData is an empty object!<br>
566
567
  * If an error occurs, an error object of type {@link sap.fe.navigation.NavError}, URL parameters (if available)
@@ -1097,7 +1098,10 @@ export class NavigationHandler extends BaseObject {
1097
1098
  this._oLastSavedInnerAppData.iCacheHit++;
1098
1099
 
1099
1100
  // replace inner app hash with cached appStateKey in url (just in case the app has changed the hash in meantime)
1100
- fnReplaceHash(sAppStateKeyCached);
1101
+ // bSkipHashReplace must be checked here too, same as in the cache-miss paths below
1102
+ if (!bSkipHashReplace) {
1103
+ fnReplaceHash(sAppStateKeyCached);
1104
+ }
1101
1105
  oMyDeferred.resolve(sAppStateKeyCached);
1102
1106
  return oMyDeferred.promise();
1103
1107
  }
@@ -1915,6 +1919,7 @@ export class NavigationHandler extends BaseObject {
1915
1919
  if (typeof oAppDataLoaded === "undefined") {
1916
1920
  const oError = oNavHandler._createTechnicalError("NavigationHandler.getDataFromAppState.failed");
1917
1921
  oDeferred.reject(oError, {}, navType);
1922
+ return;
1918
1923
  } else if (oNavHandler._sMode === Mode.ODataV2) {
1919
1924
  oAppData = {
1920
1925
  selectionVariant: "{}",
@@ -1964,22 +1969,26 @@ export class NavigationHandler extends BaseObject {
1964
1969
  oAppData.selectionVariant = oNavHandler._ensureSelectionVariantFormatString(oAppDataLoaded.selectionVariant);
1965
1970
  oAppData.oSelectionVariant = new SelectionVariant(oAppData.selectionVariant);
1966
1971
  }
1972
+ }
1967
1973
 
1968
- if (navType === NavType.iAppState) {
1969
- const oComponentData = oNavHandler.oComponent.getComponentData() as Record<string, any>;
1970
- const oStartupParameters = oComponentData?.startupParameters as Record<string, any>;
1971
- const bHasDefaultedParams = oStartupParameters?.[DEFAULTED_PARAMETER_PROPERTY]?.length > 0;
1972
- const bHasXAppState = oComponentData?.["sap-xapp-state"] !== undefined;
1973
-
1974
- if (bHasDefaultedParams && bHasXAppState) {
1975
- oNavHandler._enrichDefaultedSelectionVariant(
1976
- oAppData,
1977
- oStartupParameters[DEFAULTED_PARAMETER_PROPERTY][0],
1978
- oDeferred,
1979
- navType
1980
- );
1981
- return;
1982
- }
1974
+ // On an iAppState reload (F5), FLP still passes the defaulted parameter names but not their
1975
+ // values, so oDefaultedSelectionVariant would be empty. Re-fetch the original defaults from the
1976
+ // xAppState. This runs after the V2/V4 if/else so it applies to both ODataV2 (FEv2) and V4 apps
1977
+ // (it was previously inside the V4 branch only, which missed the ODataV2 path).
1978
+ if (navType === NavType.iAppState) {
1979
+ const oComponentData = oNavHandler.oComponent.getComponentData() as Record<string, any>;
1980
+ const oStartupParameters = oComponentData?.startupParameters as Record<string, any>;
1981
+ const bHasDefaultedParams = oStartupParameters?.[DEFAULTED_PARAMETER_PROPERTY]?.length > 0;
1982
+ const bHasXAppState = oComponentData?.["sap-xapp-state"] !== undefined;
1983
+
1984
+ if (bHasDefaultedParams && bHasXAppState) {
1985
+ oNavHandler._enrichDefaultedSelectionVariant(
1986
+ oAppData,
1987
+ oStartupParameters[DEFAULTED_PARAMETER_PROPERTY][0],
1988
+ oDeferred,
1989
+ navType
1990
+ );
1991
+ return;
1983
1992
  }
1984
1993
  }
1985
1994
 
@@ -147,7 +147,7 @@ sap.ui.define(["sap/ui/core/Lib", "sap/ui/core/library"], function (Library, _li
147
147
  name: "sap.fe.navigation",
148
148
  apiVersion: 2,
149
149
  // eslint-disable-next-line no-template-curly-in-string
150
- version: "1.150.0",
150
+ version: "1.151.0",
151
151
  dependencies: ["sap.ui.core"],
152
152
  types: ["sap.fe.navigation.NavType", "sap.fe.navigation.ParamHandlingMode", "sap.fe.navigation.SuppressionBehavior"],
153
153
  interfaces: [],