@sapui5/sap.fe.core 1.121.1 → 1.121.3

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.
@@ -2099,7 +2099,7 @@ class EditFlow extends BaseControllerExtension {
2099
2099
 
2100
2100
  try {
2101
2101
  await this.syncTask();
2102
- const oResponse = await transactionHelper.callAction(
2102
+ let oResponse = await transactionHelper.callAction(
2103
2103
  sActionName,
2104
2104
  mParameters,
2105
2105
  this.getView(),
@@ -2166,11 +2166,30 @@ class EditFlow extends BaseControllerExtension {
2166
2166
  ? _fnValidContexts(mParameters.contexts, mParameters.applicableContexts)[0]
2167
2167
  : mParameters.contexts;
2168
2168
  const sActionContextMetaPath = oActionContext && oMetaModel.getMetaPath(oActionContext.getPath());
2169
+
2169
2170
  if (sContextMetaPath != undefined && sContextMetaPath === sActionContextMetaPath) {
2170
2171
  if (oActionContext?.getPath() !== context.getPath()) {
2171
2172
  this.getInternalRouting().navigateForwardToContext(context, {
2172
2173
  checkNoHashChange: true
2173
2174
  });
2175
+
2176
+ // If the action returns a draft context, we already take care during navigation to either create a new
2177
+ // (full screen) or to use the list binding context after refresh (and not the return value context).
2178
+ // If the draft is discarded or activated, having the context still as dependent context cause issues
2179
+ // (e.g. if a side effect is triggered). Therefore, we destroy the return value context here,
2180
+ // and to be compatible we return a new context with the same path.
2181
+ if (
2182
+ this.getProgrammingModel(context) === ProgrammingModel.Draft &&
2183
+ context.getProperty("IsActiveEntity") === false
2184
+ ) {
2185
+ const returnContext = context.getModel().bindContext(context.getPath()).getBoundContext();
2186
+ if (Array.isArray(oResponse)) {
2187
+ (oResponse[0] as PromiseFulfilledResult<ODataV4Context>).value = returnContext;
2188
+ } else {
2189
+ oResponse = returnContext;
2190
+ }
2191
+ context.getBinding().destroy();
2192
+ }
2174
2193
  } else {
2175
2194
  Log.info("Navigation to the same context is not allowed");
2176
2195
  }