@fluxhub/fluxhub-lib 19.0.219 → 19.0.220

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.
@@ -34415,6 +34415,17 @@ class FHWorkflowForm {
34415
34415
  this.after_task_change();
34416
34416
  if (after)
34417
34417
  after();
34418
+ // Avanzamento automatico. Sta QUI e non in close_task() perche' load_step_tasks
34419
+ // gira anche all'APERTURA del documento: se l'utente aveva chiuso l'ultimo task e
34420
+ // poi il dialog di scelta transizione con la X, il documento restava fermo con
34421
+ // tutti i task chiusi e senza pulsante Procedi -- bloccato. Riaprendolo, avanza.
34422
+ if (this.step_mode == 'T' &&
34423
+ this.tasks_all_done &&
34424
+ this.b_edit &&
34425
+ !this.b_saving &&
34426
+ !this.btnprocedi) {
34427
+ this.procedi();
34428
+ }
34418
34429
  },
34419
34430
  error: () => {
34420
34431
  this.b_tasks_loading = false;
@@ -34528,16 +34539,13 @@ class FHWorkflowForm {
34528
34539
  return;
34529
34540
  // Ricarico dal DB invece di aggiornare in locale: `locked` degli altri task
34530
34541
  // dipende da questo, e un altro utente puo' aver chiuso qualcosa nel frattempo.
34542
+ // L'avanzamento automatico lo decide load_step_tasks (vedi li'): se lo step avanza
34543
+ // ci pensa procedi() -> exec_wkf, che ricalcola lettori e notifiche sullo step di
34544
+ // destinazione, ed e' inutile (e sbagliato) notificare i task di uno step che
34545
+ // stiamo lasciando.
34531
34546
  this.load_step_tasks(() => {
34532
- if (this.tasks_all_done && this.b_edit) {
34533
- // Lo step avanza: ci pensa procedi() -> exec_wkf, che ricalcola lettori e
34534
- // notifiche sullo step di destinazione. Inutile (e sbagliato) notificare i
34535
- // task di uno step che stiamo lasciando.
34536
- this.procedi();
34537
- }
34538
- else {
34547
+ if (!this.tasks_all_done)
34539
34548
  this.notify_task_closed(task.uiid);
34540
- }
34541
34549
  });
34542
34550
  });
34543
34551
  return true;
@@ -35559,6 +35567,8 @@ class FHWorkflowTasksPanel {
35559
35567
  locked_label = 'Si sblocca al completamento di';
35560
35568
  reopen_confirm = 'Vuoi riaprire questa attività?';
35561
35569
  note_label = 'Nota di chiusura';
35570
+ last_task_title = 'Ultima attività dello step';
35571
+ last_task_confirm = "Questa è l'ultima attività obbligatoria dello step: concludendola la pratica avanzerà. Vuoi procedere?";
35562
35572
  // Valori pre-calcolati: MAI getter dinamici nel template (un getter che costruisce
35563
35573
  // array darebbe a *ngFor un riferimento nuovo a ogni change detection).
35564
35574
  tasks = [];
@@ -35644,6 +35654,29 @@ class FHWorkflowTasksPanel {
35644
35654
  this.toastr.error(errs.join(' - '), t.title);
35645
35655
  return;
35646
35656
  }
35657
+ // Ultima attivita' obbligatoria rimasta aperta: chiuderla fa avanzare la pratica,
35658
+ // e l'avanzamento non e' annullabile. Chiediamo conferma PRIMA di chiudere: se
35659
+ // l'utente dice no, il task resta aperto e non succede nulla.
35660
+ if (this.isLastRequiredOpen(t)) {
35661
+ const ref = this.dialog.open(FHWinConfirmComponent, {
35662
+ disableClose: true,
35663
+ data: { title_dialog: this.last_task_title, msg_dialog: this.last_task_confirm },
35664
+ });
35665
+ ref.afterClosed().subscribe((ok) => {
35666
+ if (ok)
35667
+ this.doClose(t);
35668
+ });
35669
+ return;
35670
+ }
35671
+ this.doClose(t);
35672
+ }
35673
+ /** L'unico task obbligatorio ancora aperto e' proprio questo? */
35674
+ isLastRequiredOpen(t) {
35675
+ if (t.required !== 1)
35676
+ return false;
35677
+ return this.tasks.every((x) => x.required !== 1 || x.stato === 1 || x.uiid === t.uiid);
35678
+ }
35679
+ doClose(t) {
35647
35680
  if (t.note_required === 1) {
35648
35681
  const ref = this.dialog.open(FHWinAskBigTextComponent, {
35649
35682
  width: '600px',
@@ -35670,7 +35703,7 @@ class FHWorkflowTasksPanel {
35670
35703
  });
35671
35704
  }
35672
35705
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FHWorkflowTasksPanel, deps: [{ token: i1$2.MatDialog }, { token: i3$1.ToastrService, optional: true }], target: i0.ɵɵFactoryTarget.Component });
35673
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: FHWorkflowTasksPanel, isStandalone: true, selector: "FHWorkflowTasksPanel", inputs: { dt_agg: "dt_agg", is_supervisor: "is_supervisor", title: "title", claim_label: "claim_label", release_label: "release_label", force_release_label: "force_release_label", in_charge_label: "in_charge_label", in_charge_you_label: "in_charge_you_label", claim_lost_label: "claim_lost_label", close_label: "close_label", reopen_label: "reopen_label", optional_label: "optional_label", closed_by_label: "closed_by_label", empty_label: "empty_label", no_role_label: "no_role_label", after_label: "after_label", locked_label: "locked_label", reopen_confirm: "reopen_confirm", note_label: "note_label" }, ngImport: i0, template: `
35706
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: FHWorkflowTasksPanel, isStandalone: true, selector: "FHWorkflowTasksPanel", inputs: { dt_agg: "dt_agg", is_supervisor: "is_supervisor", title: "title", claim_label: "claim_label", release_label: "release_label", force_release_label: "force_release_label", in_charge_label: "in_charge_label", in_charge_you_label: "in_charge_you_label", claim_lost_label: "claim_lost_label", close_label: "close_label", reopen_label: "reopen_label", optional_label: "optional_label", closed_by_label: "closed_by_label", empty_label: "empty_label", no_role_label: "no_role_label", after_label: "after_label", locked_label: "locked_label", reopen_confirm: "reopen_confirm", note_label: "note_label", last_task_title: "last_task_title", last_task_confirm: "last_task_confirm" }, ngImport: i0, template: `
35674
35707
  <div class="fh-tasks" *ngIf="dt_agg && dt_agg.step_mode === 'T'">
35675
35708
  <div class="fh-tasks-head">
35676
35709
  <span class="material-symbols-outlined">checklist</span>
@@ -35946,6 +35979,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
35946
35979
  type: Input
35947
35980
  }], note_label: [{
35948
35981
  type: Input
35982
+ }], last_task_title: [{
35983
+ type: Input
35984
+ }], last_task_confirm: [{
35985
+ type: Input
35949
35986
  }] } });
35950
35987
 
35951
35988
  class AuthHttpRequestInterceptor {