@magic-xpa/engine 4.1200.0-dev4120.155 → 4.1200.0-dev4120.158

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.
@@ -12485,7 +12485,7 @@ class Operation {
12485
12485
  /// </param>
12486
12486
  /// <param name = "returnedFromServer">true if the server returned the execution to this operation</param>
12487
12487
  /// <returns> boolean for verify and block operations</returns>
12488
- async execute(returnedFromServer) {
12488
+ async execute(returnedFromServer, desiredRouteName = null) {
12489
12489
  let lastRtEvent = AccessHelper.eventsManager.getLastRtEvent();
12490
12490
  let mprgCreator = null;
12491
12491
  let flowMonitor = FlowMonitorQueue.Instance;
@@ -12561,8 +12561,14 @@ class Operation {
12561
12561
  let canRoute = false;
12562
12562
  let rtEvnt = AccessHelper.eventsManager.getLastRtEvent();
12563
12563
  if (rtEvnt !== null) {
12564
- this._routeParams = rtEvnt.getRouteParamList();
12565
- if ((await rtEvnt.getArgList().getArg(0).getValue(StorageAttribute.ALPHA, 0)).trim() === this._routerPath &&
12564
+ // If we are here for default route path, set the routeParams as null because those are relevant only for the original route.
12565
+ if (desiredRouteName == null) {
12566
+ desiredRouteName = (await rtEvnt.getArgList().getArg(0).getValue(StorageAttribute.ALPHA, 0)).trim();
12567
+ this._routeParams = rtEvnt.getRouteParamList();
12568
+ }
12569
+ else
12570
+ this._routeParams = null;
12571
+ if (desiredRouteName === this._routerPath &&
12566
12572
  ((rtEvnt.getArgList().getArg(1).skipArg() && destSubForm === this._task.getForm().DefaultRouterOutlet) ||
12567
12573
  (!rtEvnt.getArgList().getArg(1).skipArg() && (await rtEvnt.getArgList().getArg(1).getValue(StorageAttribute.ALPHA, 0)).trim() === this._originalRouterOutletName)))
12568
12574
  canRoute = true;
@@ -28044,6 +28050,7 @@ class EventHandler {
28044
28050
  _scope = null; // Task|Subtask|Global
28045
28051
  _task = null;
28046
28052
  _taskMgdID = -1;
28053
+ _defRouteName = null;
28047
28054
  /// <summary>
28048
28055
  /// CTOR
28049
28056
  /// </summary>
@@ -28172,6 +28179,9 @@ class EventHandler {
28172
28179
  case ConstInterface.MG_ATTR_HANDLER_ONFORM:
28173
28180
  this._isHandlerOnForm = XmlParser.getBoolean(valueStr);
28174
28181
  break;
28182
+ case XMLConstants.MG_ATTR_DEF_ROUTER_NAME:
28183
+ this._defRouteName = XmlParser.unescape(valueStr);
28184
+ break;
28175
28185
  default:
28176
28186
  Logger.Instance.WriteExceptionToLogWithMsg("There is no such tag in EventHandler class. Insert case to EventHandler.initElements for " + attribute);
28177
28187
  break;
@@ -28400,8 +28410,13 @@ class EventHandler {
28400
28410
  await this.resetLocalVariables(args);
28401
28411
  initialLoopStackSize = this._task.getLoopStackSize();
28402
28412
  let retVals = null;
28403
- if (this._operationTab.getSize() > 0)
28413
+ if (this._operationTab.getSize() > 0) {
28404
28414
  retVals = await this.executeOperations(0, this._operationTab.getSize() - 1, taskEnd, mgdID, depth, isChangedCurrWndRef, false, false, -1);
28415
+ if (retVals == null && this.isRouteHandler() && this.getDefaultRouteName() != null) {
28416
+ // call again with an additional param Default Route Name
28417
+ retVals = await this.executeOperations(0, this._operationTab.getSize() - 1, taskEnd, mgdID, depth, isChangedCurrWndRef, false, false, -1, this.getDefaultRouteName());
28418
+ }
28419
+ }
28405
28420
  isChangedCurrWnd = isChangedCurrWndRef.value;
28406
28421
  if (retVals !== null)
28407
28422
  return retVals;
@@ -28484,7 +28499,7 @@ class EventHandler {
28484
28499
  /// <summary>
28485
28500
  /// execute the operations starting from fromIdx and ending at endIdx.
28486
28501
  /// </summary>
28487
- async executeOperations(fromIdx, toIdx, taskEnd, mgdID, depth, isChangedCurrWndRef, inBlockIf, inReturnedFromServer, inNextOperIdx) {
28502
+ async executeOperations(fromIdx, toIdx, taskEnd, mgdID, depth, isChangedCurrWndRef, inBlockIf, inReturnedFromServer, inNextOperIdx, desiredRouteName = null) {
28488
28503
  let oper;
28489
28504
  let operType;
28490
28505
  let nextOperIdx = -1;
@@ -28665,7 +28680,7 @@ class EventHandler {
28665
28680
  case ConstInterface.MG_OPER_CALL:
28666
28681
  this._task.setUseLoopStack(depth > 0);
28667
28682
  // if false is returned, it means that a route operation was executed.
28668
- routeOperationExecuted = await oper.execute(returnedFromServer);
28683
+ routeOperationExecuted = await oper.execute(returnedFromServer, desiredRouteName);
28669
28684
  break;
28670
28685
  default:
28671
28686
  // the rest of the operations (those that do not affect the flow)
@@ -28820,6 +28835,12 @@ class EventHandler {
28820
28835
  getEvent() {
28821
28836
  return this._evt;
28822
28837
  }
28838
+ isRouteHandler() {
28839
+ return (this._evt.getType() == ConstInterface.EVENT_TYPE_INTERNAL && this._evt.getInternalCode() === InternalInterface.MG_ACT_WEBCLIENT_ROUTE);
28840
+ }
28841
+ getDefaultRouteName() {
28842
+ return this._defRouteName;
28843
+ }
28823
28844
  /// <summary>
28824
28845
  /// get the Id of the event handler
28825
28846
  /// </summary>
@@ -39514,7 +39535,7 @@ class CommandsTable {
39514
39535
  }
39515
39536
  }
39516
39537
 
39517
- let CurrentClientVersion = '4.1200.0-dev4120.155';
39538
+ let CurrentClientVersion = '4.1200.0-dev4120.158';
39518
39539
 
39519
39540
  // @dynamic
39520
39541
  class ClientManager {