@sapui5/sap.fe.core 1.124.5 → 1.124.6

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.
@@ -405,6 +405,20 @@ export type ShowMessageParameters = {
405
405
  filteredMessages?: Message[];
406
406
  fnGetMessageSubtitle?: Function;
407
407
  };
408
+
409
+ function isNonTechnicalMessage(message: Message): boolean {
410
+ const technicalDetails = message.getTechnicalDetails() as MessageTechnicalDetails | undefined;
411
+ if (
412
+ (technicalDetails &&
413
+ ((technicalDetails.originalMessage !== undefined && technicalDetails.originalMessage !== null) ||
414
+ (technicalDetails.httpStatus !== undefined && technicalDetails.httpStatus !== null))) ||
415
+ message.getCode()
416
+ ) {
417
+ return true;
418
+ }
419
+ return false;
420
+ }
421
+
408
422
  async function showUnboundMessages(
409
423
  this: messageHandlingType,
410
424
  aCustomMessages: CustomMessage[] | undefined,
@@ -424,6 +438,7 @@ async function showUnboundMessages(
424
438
  let showMessageDialog: boolean | undefined = false,
425
439
  showMessageBox: boolean | undefined = false;
426
440
 
441
+ const isNonTechnicalMessageFilter = new Filter({ path: "", test: isNonTechnicalMessage });
427
442
  if (bShowBoundTransition) {
428
443
  aTransitionMessages = aTransitionMessages.concat(getMessages(true, true));
429
444
  // we only want to show bound transition messages not bound state messages hence add a filter for the same
@@ -457,9 +472,21 @@ async function showUnboundMessages(
457
472
  caseSensitive: true
458
473
  })
459
474
  );
475
+ aFilters.push(isNonTechnicalMessageFilter);
460
476
  } else {
461
477
  // only unbound messages have to be shown so add filter accordingly
462
- aFilters.push(new Filter({ path: "target", operator: FilterOperator.EQ, value1: "" }));
478
+ aFilters.push(
479
+ new Filter({
480
+ filters: [
481
+ new Filter({
482
+ path: "",
483
+ test: (message: Message) => message.getTargets().length === 0 || message.getTargets()[0] === ""
484
+ }),
485
+ isNonTechnicalMessageFilter
486
+ ],
487
+ and: true
488
+ })
489
+ );
463
490
  }
464
491
  if (aCustomMessages && aCustomMessages.length) {
465
492
  aCustomMessages.forEach(function (oMessage: CustomMessage) {
@@ -1240,18 +1267,7 @@ function getMessages(bBoundMessages = false, bTransitionOnly = false, sPathToBeR
1240
1267
  }
1241
1268
  }
1242
1269
  //Filtering messages again here to avoid showing pure technical messages raised by the model
1243
- const backendMessages: Message[] = [];
1244
- for (i = 0; i < aTransitionMessages.length; i++) {
1245
- const technicalDetails = aTransitionMessages[i].getTechnicalDetails() as MessageTechnicalDetails | undefined;
1246
- if (
1247
- (technicalDetails &&
1248
- ((technicalDetails.originalMessage !== undefined && technicalDetails.originalMessage !== null) ||
1249
- (technicalDetails.httpStatus !== undefined && technicalDetails.httpStatus !== null))) ||
1250
- aTransitionMessages[i].getCode()
1251
- ) {
1252
- backendMessages.push(aTransitionMessages[i]);
1253
- }
1254
- }
1270
+ const backendMessages: Message[] = aTransitionMessages.filter(isNonTechnicalMessage);
1255
1271
 
1256
1272
  return backendMessages;
1257
1273
  }