tuain-ng-forms-lib 17.2.8 → 17.2.9

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.
@@ -436,9 +436,6 @@ class LibTableRecordActionComponent extends PieceComponent {
436
436
  if (this.action && this.action.restrictedOnField && this.recordData) {
437
437
  const relatedField = this.action.restrictedOnField;
438
438
  if (relatedField) {
439
- console.log('this.action.actionCode');
440
- console.log(this.action.actionCode);
441
- console.log(this.action);
442
439
  const relatedFieldValue = this.recordData[relatedField];
443
440
  const restrictionOper = this.action.restrictedOnOperator;
444
441
  const restrictionValue = this.action.restrictedOnValue;
@@ -449,9 +446,6 @@ class LibTableRecordActionComponent extends PieceComponent {
449
446
  else if ((restrictionOper === '!=' || restrictionOper === '!==') && relatedFieldValue !== restrictionValue) {
450
447
  visibility = true;
451
448
  }
452
- console.log({
453
- relatedField, relatedFieldValue, restrictionOper, restrictionValue, visibility
454
- });
455
449
  this.visible.set(visibility);
456
450
  }
457
451
  }
@@ -3645,6 +3639,12 @@ class BasicFormComponent extends FormStructureAndData {
3645
3639
  if (!actionObject) {
3646
3640
  return;
3647
3641
  }
3642
+ if (this._actionsInProgress[code]) {
3643
+ const { sent } = this._actionsInProgress[code];
3644
+ console.log(`Acción ${code} en ejecución desde ${sent}`);
3645
+ return;
3646
+ }
3647
+ this._actionsInProgress[code] = { sent: new Date() };
3648
3648
  this.resetError();
3649
3649
  actionObject.start();
3650
3650
  const clientActionMethods = this._formActionsStart[code];
@@ -3659,10 +3659,14 @@ class BasicFormComponent extends FormStructureAndData {
3659
3659
  const continueAction = clientActionResults.reduce((total, curr) => (total && (curr !== false)), true);
3660
3660
  if (!continueAction) {
3661
3661
  actionObject.stop();
3662
+ this._actionsInProgress[code] = null;
3663
+ delete this._actionsInProgress[code];
3662
3664
  return;
3663
3665
  }
3664
3666
  }
3665
3667
  this.startServerAction(actionObject);
3668
+ this._actionsInProgress[code] = null;
3669
+ delete this._actionsInProgress[code];
3666
3670
  }
3667
3671
  async startServerAction(actionInput) {
3668
3672
  const action = (typeof actionInput === 'string')
@@ -3673,16 +3677,7 @@ class BasicFormComponent extends FormStructureAndData {
3673
3677
  let serverError = false;
3674
3678
  let actionResult = null;
3675
3679
  if (action.backend) {
3676
- if (this._actionsInProgress[action.actionCode]) {
3677
- const { sent } = this._actionsInProgress[action.actionCode];
3678
- console.log(`Acción ${action.actionCode} en ejecución desde ${sent}`);
3679
- }
3680
- else {
3681
- this._actionsInProgress[action.actionCode] = { sent: new Date() };
3682
- actionResult = await this.requestFormAction(action.actionCode);
3683
- this._actionsInProgress[action.actionCode] = null;
3684
- delete this._actionsInProgress[action.actionCode];
3685
- }
3680
+ actionResult = await this.requestFormAction(action.actionCode);
3686
3681
  }
3687
3682
  await this.finishAction(action, actionResult, serverError);
3688
3683
  serverError = !!this.errorOccured();