tuain-ng-forms-lib 17.2.6 → 17.2.8

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.
@@ -3168,6 +3168,8 @@ class BasicFormComponent extends FormStructureAndData {
3168
3168
  _actionServerError = [];
3169
3169
  _fieldServerError = [];
3170
3170
  _tableServerError = [];
3171
+ // Acciones en curso dentro del formulario
3172
+ _actionsInProgress = {};
3171
3173
  // Datos complementarios del formulario
3172
3174
  inputDataFields = {};
3173
3175
  extraData = {};
@@ -3190,8 +3192,6 @@ class BasicFormComponent extends FormStructureAndData {
3190
3192
  this.fileMgmtServices = fileMgmtServices;
3191
3193
  this._eventEmiter = this._eventManager;
3192
3194
  this.cleanStart();
3193
- this.preStart();
3194
- this.customPreProcessing();
3195
3195
  }
3196
3196
  cleanStart() {
3197
3197
  this._errorType = '';
@@ -3232,6 +3232,10 @@ class BasicFormComponent extends FormStructureAndData {
3232
3232
  }
3233
3233
  get formVisible() { return this.visible; }
3234
3234
  get form() { return this; }
3235
+ ngOnInit() {
3236
+ this.preStart();
3237
+ this.customPreProcessing();
3238
+ }
3235
3239
  // Métodos virtuales
3236
3240
  preStart() { }
3237
3241
  start() { }
@@ -3669,7 +3673,16 @@ class BasicFormComponent extends FormStructureAndData {
3669
3673
  let serverError = false;
3670
3674
  let actionResult = null;
3671
3675
  if (action.backend) {
3672
- actionResult = await this.requestFormAction(action.actionCode);
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
+ }
3673
3686
  }
3674
3687
  await this.finishAction(action, actionResult, serverError);
3675
3688
  serverError = !!this.errorOccured();