@mediusinc/mng-commons 2.6.0-rc.0 → 2.6.0-rc.1

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.
@@ -3341,10 +3341,11 @@ class MngActionExecutorService {
3341
3341
  * @param parameters Action parameters for activation of action instance.
3342
3342
  * @param instance Optional existing action instance (if non provided, new will be created).
3343
3343
  * @param previousActionInstance Optional previous action instance to link in next instance.
3344
+ * @param runContext Marks if context should be run.
3344
3345
  *
3345
3346
  * @return Action instance - if non provided in parameters, the newly created will be returned.
3346
3347
  */
3347
- activateAction(action, parameters, instance, previousActionInstance) {
3348
+ activateAction(action, parameters, instance, previousActionInstance, runContext = false) {
3348
3349
  instance = this.getOrCreateInstance(instance, action, parameters, ActionInstanceStateEnum.ActivationStart);
3349
3350
  instance.state = ActionInstanceStateEnum.ActivationStart;
3350
3351
  instance.activationParameters = parameters;
@@ -3393,6 +3394,9 @@ class MngActionExecutorService {
3393
3394
  // directly execute action
3394
3395
  instance.state = ActionInstanceStateEnum.ActivationEnd;
3395
3396
  const context = this.prepareContext(action, parameters, undefined, instance, previousActionInstance);
3397
+ if (runContext) {
3398
+ this.run(context);
3399
+ }
3396
3400
  return context.instance;
3397
3401
  }
3398
3402
  }
@@ -3533,10 +3537,11 @@ class MngActionExecutorService {
3533
3537
  *
3534
3538
  * @param action Action descriptor.
3535
3539
  * @param parameters Action parameters for action execution to construct new route.
3540
+ * @param runContext Marks if context should be run.
3536
3541
  *
3537
3542
  * @return Action instance - if non provided in parameters, the newly created will be returned.
3538
3543
  */
3539
- triggerAction(action, parameters) {
3544
+ triggerAction(action, parameters, runContext = false) {
3540
3545
  const instance = this.getOrCreateInstance(undefined, action, parameters);
3541
3546
  instance.triggerParameters = parameters;
3542
3547
  instance.state = ActionInstanceStateEnum.TriggerStart;
@@ -3558,7 +3563,14 @@ class MngActionExecutorService {
3558
3563
  }
3559
3564
  else {
3560
3565
  instance.state = ActionInstanceStateEnum.TriggerEnd;
3561
- return this.activateAction(action, parameters, instance);
3566
+ this.activateAction(action, parameters, instance);
3567
+ if (runContext) {
3568
+ const context = instance.context;
3569
+ if (context) {
3570
+ this.run(context);
3571
+ }
3572
+ }
3573
+ return instance;
3562
3574
  }
3563
3575
  }
3564
3576
  /**
@@ -11883,7 +11895,7 @@ class MngTableComponent {
11883
11895
  .withRoute(this.route)
11884
11896
  .withViewContainer(this.viewContainer)
11885
11897
  .withSourceComponent(this);
11886
- this.actionExecutor.triggerAction(action, parameters);
11898
+ this.actionExecutor.triggerAction(action, parameters, true);
11887
11899
  }
11888
11900
  }
11889
11901
  }