tuain-ng-forms-lib 17.2.7 → 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
  }
@@ -3192,8 +3186,6 @@ class BasicFormComponent extends FormStructureAndData {
3192
3186
  this.fileMgmtServices = fileMgmtServices;
3193
3187
  this._eventEmiter = this._eventManager;
3194
3188
  this.cleanStart();
3195
- this.preStart();
3196
- this.customPreProcessing();
3197
3189
  }
3198
3190
  cleanStart() {
3199
3191
  this._errorType = '';
@@ -3234,6 +3226,10 @@ class BasicFormComponent extends FormStructureAndData {
3234
3226
  }
3235
3227
  get formVisible() { return this.visible; }
3236
3228
  get form() { return this; }
3229
+ ngOnInit() {
3230
+ this.preStart();
3231
+ this.customPreProcessing();
3232
+ }
3237
3233
  // Métodos virtuales
3238
3234
  preStart() { }
3239
3235
  start() { }
@@ -3643,6 +3639,12 @@ class BasicFormComponent extends FormStructureAndData {
3643
3639
  if (!actionObject) {
3644
3640
  return;
3645
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() };
3646
3648
  this.resetError();
3647
3649
  actionObject.start();
3648
3650
  const clientActionMethods = this._formActionsStart[code];
@@ -3657,10 +3659,14 @@ class BasicFormComponent extends FormStructureAndData {
3657
3659
  const continueAction = clientActionResults.reduce((total, curr) => (total && (curr !== false)), true);
3658
3660
  if (!continueAction) {
3659
3661
  actionObject.stop();
3662
+ this._actionsInProgress[code] = null;
3663
+ delete this._actionsInProgress[code];
3660
3664
  return;
3661
3665
  }
3662
3666
  }
3663
3667
  this.startServerAction(actionObject);
3668
+ this._actionsInProgress[code] = null;
3669
+ delete this._actionsInProgress[code];
3664
3670
  }
3665
3671
  async startServerAction(actionInput) {
3666
3672
  const action = (typeof actionInput === 'string')
@@ -3671,16 +3677,7 @@ class BasicFormComponent extends FormStructureAndData {
3671
3677
  let serverError = false;
3672
3678
  let actionResult = null;
3673
3679
  if (action.backend) {
3674
- if (this._actionsInProgress[action.actionCode]) {
3675
- const { sent } = this._actionsInProgress[action.actionCode];
3676
- console.log(`Acción ${action.actionCode} en ejecución desde ${sent}`);
3677
- }
3678
- else {
3679
- this._actionsInProgress[action.actionCode] = { sent: new Date() };
3680
- actionResult = await this.requestFormAction(action.actionCode);
3681
- this._actionsInProgress[action.actionCode] = null;
3682
- delete this._actionsInProgress[action.actionCode];
3683
- }
3680
+ actionResult = await this.requestFormAction(action.actionCode);
3684
3681
  }
3685
3682
  await this.finishAction(action, actionResult, serverError);
3686
3683
  serverError = !!this.errorOccured();