@fluxhub/fluxhub-lib 19.0.214 → 19.0.216

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.
@@ -32262,6 +32262,24 @@ class FHWorkflowForm {
32262
32262
  reject_back_ground_color = '#f44336';
32263
32263
  b_init_next = false;
32264
32264
  sort_field = '';
32265
+ // --- Step in modalita' task (step_mode='T') --------------------------------
32266
+ // 'A' = avanzamento manuale (comportamento storico), 'T' = task paralleli:
32267
+ // il pulsante Procedi sparisce e l'avanzamento scatta alla chiusura
32268
+ // dell'ultimo task obbligatorio. Vedi db/004_step_tasks.sql.
32269
+ step_mode = 'A';
32270
+ step_tasks = [];
32271
+ tasks_all_done = false;
32272
+ b_tasks_loading = false;
32273
+ /**
32274
+ * Validazione applicativa alla chiusura di un task.
32275
+ * La libreria non conosce i campi della pratica: il componente concreto fa
32276
+ * l'override e decide, in base a `check_key` (stringa concordata in
32277
+ * configurazione), se ci sono dati obbligatori mancanti.
32278
+ * @returns [] se si puo' chiudere; array di messaggi per bloccare la chiusura.
32279
+ */
32280
+ ck_task(check_key) {
32281
+ return [];
32282
+ }
32265
32283
  ripristina_imp() {
32266
32284
  if (localStorage.getItem(this.app_s.COMPANY_KEY + '_imp_user') == null) {
32267
32285
  if (this.app_s.user)
@@ -34324,6 +34342,181 @@ class FHWorkflowForm {
34324
34342
  edit_doc() {
34325
34343
  this.load_document();
34326
34344
  }
34345
+ // ---------------------------------------------------------------------------
34346
+ // Step in modalita' task
34347
+ // ---------------------------------------------------------------------------
34348
+ /**
34349
+ * Carica i task dello step corrente con il loro stato sul documento.
34350
+ * `can_close` e `locked` sono calcolati lato SQL: il primo dai ruoli/variabili
34351
+ * speciali dell'utente, il secondo dal task da cui questo dipende (`depends_on`)
34352
+ * quando non e' ancora chiuso. Le catene si propagano da sole: un padre bloccato
34353
+ * non e' chiuso, quindi il figlio resta bloccato.
34354
+ */
34355
+ load_step_tasks(after) {
34356
+ if (!this.id_documento || this.m_obj == null)
34357
+ return;
34358
+ this.b_tasks_loading = true;
34359
+ let p = new QParam();
34360
+ p.sql = 'SELECT_WKF_STEP_TASKS';
34361
+ p.values = [
34362
+ this.id_applicativo,
34363
+ this.id_documento,
34364
+ this.m_obj.stato,
34365
+ this.app_s.user,
34366
+ ];
34367
+ p.types = ['string', 'string', 'int', 'string'];
34368
+ this.m_dataService.doQuery(p).subscribe({
34369
+ next: (data) => {
34370
+ this.b_tasks_loading = false;
34371
+ if (data == null || data.result_msg != 'OK')
34372
+ return;
34373
+ this.step_tasks = (data.result_data || []).map((t) => ({
34374
+ ...t,
34375
+ stato: Number(t.stato || 0),
34376
+ required: Number(t.required || 0),
34377
+ note_required: Number(t.note_required || 0),
34378
+ can_close: Number(t.can_close || 0) > 0,
34379
+ locked: Number(t.locked || 0) > 0,
34380
+ mine: Number(t.mine || 0),
34381
+ }));
34382
+ this.recompute_tasks_done();
34383
+ if (after)
34384
+ after();
34385
+ },
34386
+ error: () => {
34387
+ this.b_tasks_loading = false;
34388
+ },
34389
+ });
34390
+ }
34391
+ /** Tutti i task OBBLIGATORI chiusi? I facoltativi non bloccano l'avanzamento. */
34392
+ recompute_tasks_done() {
34393
+ const req = this.step_tasks.filter((t) => t.required == 1);
34394
+ this.tasks_all_done =
34395
+ req.length > 0 && req.every((t) => t.stato == 1);
34396
+ }
34397
+ /**
34398
+ * Presa in carico ATOMICA di un task. E' il lock che risolve la concorrenza:
34399
+ * solo chi ha la presa in carico puo' chiudere il task.
34400
+ *
34401
+ * Tre passi, e la correttezza sta tutta nel secondo:
34402
+ * 1) INSERT IGNORE -> materializza la riga se non c'e' (nessun errore se c'e')
34403
+ * 2) UPDATE ... WHERE preso_da IS NULL -> due utenti simultanei arrivano
34404
+ * entrambi qui, ma UNO SOLO trova la riga libera: l'altro aggiorna 0 righe
34405
+ * 3) SELECT del proprietario -> chi ha perso legge il nome del vincitore
34406
+ *
34407
+ * Il punto di serializzazione e' il DB, non il frontend. Non contiamo le "rows
34408
+ * affected" (dipendono dal driver e da CLIENT_FOUND_ROWS): rileggiamo il
34409
+ * proprietario, che dopo il passo 2 e' univoco e stabile.
34410
+ *
34411
+ * @param done (ok, owner) — ok=false se un altro utente ha vinto la corsa.
34412
+ */
34413
+ claim_task(task, done) {
34414
+ if (task == null || !task.can_close || task.locked || task.stato == 1) {
34415
+ if (done)
34416
+ done(false, task?.preso_da || '');
34417
+ return;
34418
+ }
34419
+ const pi = new QParam();
34420
+ pi.sql = 'INSERT_IGNORE_WKF_DOC_TASK';
34421
+ pi.values = [this.id_applicativo, this.id_documento, task.uiid, this.m_obj.stato];
34422
+ pi.types = ['string', 'string', 'string', 'int'];
34423
+ this.m_dataService.doQuery(pi).subscribe(() => {
34424
+ const pc = new QParam();
34425
+ pc.sql = 'CLAIM_WKF_DOC_TASK';
34426
+ pc.values = [this.id_applicativo, this.id_documento, task.uiid, this.app_s.user];
34427
+ pc.types = ['string', 'string', 'string', 'string'];
34428
+ this.m_dataService.doQuery(pc).subscribe(() => {
34429
+ const po = new QParam();
34430
+ po.sql = 'SELECT_WKF_DOC_TASK_OWNER';
34431
+ po.values = [this.id_applicativo, this.id_documento, task.uiid];
34432
+ po.types = ['string', 'string', 'string'];
34433
+ this.m_dataService.doQuery(po).subscribe((d) => {
34434
+ const owner = d != null && d.result_msg == 'OK' && d.result_data && d.result_data.length
34435
+ ? d.result_data[0].preso_da || ''
34436
+ : '';
34437
+ const ok = owner === this.app_s.user;
34438
+ this.load_step_tasks(() => {
34439
+ if (done)
34440
+ done(ok, owner);
34441
+ });
34442
+ });
34443
+ });
34444
+ });
34445
+ }
34446
+ /**
34447
+ * Rilascia la presa in carico. `force` (supervisori) sblocca anche i task presi
34448
+ * in carico da altri: serve per i lock rimasti appesi.
34449
+ */
34450
+ release_task(task, force = false) {
34451
+ const p = new QParam();
34452
+ p.sql = force ? 'RELEASE_WKF_DOC_TASK_FORCE' : 'RELEASE_WKF_DOC_TASK';
34453
+ p.values = force
34454
+ ? [this.id_applicativo, this.id_documento, task.uiid]
34455
+ : [this.id_applicativo, this.id_documento, task.uiid, this.app_s.user];
34456
+ p.types = force
34457
+ ? ['string', 'string', 'string']
34458
+ : ['string', 'string', 'string', 'string'];
34459
+ this.m_dataService.doQuery(p).subscribe(() => this.load_step_tasks());
34460
+ }
34461
+ /**
34462
+ * Chiude un task. Richiede la presa in carico (`task.mine`): la UPDATE porta
34463
+ * `preso_da=<me>` nella WHERE, quindi se nel frattempo un supervisore ha forzato
34464
+ * il rilascio la chiusura non passa e il reload lo rende evidente.
34465
+ *
34466
+ * Se dopo la chiusura tutti i task obbligatori sono chiusi, innesca l'avanzamento
34467
+ * riusando `procedi()`: transizioni, destinatari, notifiche e log restano quelli
34468
+ * standard del motore.
34469
+ *
34470
+ * NOTA: l'avanzamento automatico richiede che chi chiude l'ultimo task sia anche
34471
+ * autore dello step (`b_edit`). Configurare i ruoli del task come sottoinsieme
34472
+ * dei ruoli dello step. Se non lo e', il documento resta fermo con
34473
+ * `tasks_all_done=true` e avanza il primo autore che apre la pratica.
34474
+ */
34475
+ close_task(task, nota) {
34476
+ if (task == null || task.stato == 1 || task.locked)
34477
+ return false;
34478
+ if (Number(task.mine || 0) != 1)
34479
+ return false; // serve la presa in carico
34480
+ const errs = this.ck_task(task.check_key || '');
34481
+ if (errs && errs.length > 0)
34482
+ return false;
34483
+ const p = new QParam();
34484
+ p.sql = 'CLOSE_WKF_DOC_TASK';
34485
+ p.values = [
34486
+ this.id_applicativo,
34487
+ this.id_documento,
34488
+ task.uiid,
34489
+ this.app_s.user,
34490
+ nota,
34491
+ ];
34492
+ p.types = ['string', 'string', 'string', 'string', 'string'];
34493
+ this.m_dataService.doQuery(p).subscribe((data) => {
34494
+ if (data == null || data.result_msg != 'OK')
34495
+ return;
34496
+ // Ricarico dal DB invece di aggiornare in locale: `locked` degli altri task
34497
+ // dipende da questo, e un altro utente puo' aver chiuso qualcosa nel frattempo.
34498
+ this.load_step_tasks(() => {
34499
+ if (this.tasks_all_done && this.b_edit)
34500
+ this.procedi();
34501
+ });
34502
+ });
34503
+ return true;
34504
+ }
34505
+ /**
34506
+ * Riapre un task chiuso, azzerando anche la presa in carico. Ammesso a chiunque
34507
+ * abbia i ruoli del task, finche' il documento e' ancora in quello step (dopo
34508
+ * l'avanzamento i task non sono piu' raggiungibili: la finestra si chiude da sola).
34509
+ */
34510
+ reopen_task(task) {
34511
+ if (task == null || !task.can_close || task.stato != 1)
34512
+ return false;
34513
+ const p = new QParam();
34514
+ p.sql = 'REOPEN_WKF_DOC_TASK';
34515
+ p.values = [this.id_applicativo, this.id_documento, task.uiid];
34516
+ p.types = ['string', 'string', 'string'];
34517
+ this.m_dataService.doQuery(p).subscribe(() => this.load_step_tasks());
34518
+ return true;
34519
+ }
34327
34520
  s_uto = '';
34328
34521
  b_respingi_button = false;
34329
34522
  return_edit() {
@@ -34377,8 +34570,17 @@ class FHWorkflowForm {
34377
34570
  this.reject_label_color = data.result_data[0].reject_label_color || '#FFFFFF';
34378
34571
  this.reject_back_ground_color =
34379
34572
  data.result_data[0].reject_back_ground_color || '#f44336';
34573
+ // step_mode arriva dalla stessa query (join su wkf2_config_steps
34574
+ // per lo step corrente): nessun round-trip aggiuntivo.
34575
+ this.step_mode = data.result_data[0].step_mode || 'A';
34380
34576
  }
34381
34577
  this.b_init_next = true;
34578
+ if (this.step_mode == 'T')
34579
+ this.load_step_tasks();
34580
+ else {
34581
+ this.step_tasks = [];
34582
+ this.tasks_all_done = false;
34583
+ }
34382
34584
  }
34383
34585
  });
34384
34586
  this.r_count();
@@ -34795,7 +34997,7 @@ class FHWorkflowHeaderBar {
34795
34997
  <button
34796
34998
  mat-flat-button
34797
34999
  (click)="procedi()"
34798
- *ngIf="edit_button && procedi_button && !in_carico"
35000
+ *ngIf="edit_button && procedi_button && !in_carico && dt_agg?.step_mode !== 'T'"
34799
35001
  [disabled]="dt_agg?.b_saving"
34800
35002
  style="font-weight:bold"
34801
35003
  [style.background-color]="
@@ -35043,7 +35245,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
35043
35245
  <button
35044
35246
  mat-flat-button
35045
35247
  (click)="procedi()"
35046
- *ngIf="edit_button && procedi_button && !in_carico"
35248
+ *ngIf="edit_button && procedi_button && !in_carico && dt_agg?.step_mode !== 'T'"
35047
35249
  [disabled]="dt_agg?.b_saving"
35048
35250
  style="font-weight:bold"
35049
35251
  [style.background-color]="
@@ -35230,6 +35432,433 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
35230
35432
  type: Output
35231
35433
  }] } });
35232
35434
 
35435
+ /**
35436
+ * Pannello dei task dello step corrente (step_mode='T').
35437
+ *
35438
+ * Si usa nel form della pratica, accanto/sotto la FHWorkflowHeaderBar:
35439
+ *
35440
+ * <FHWorkflowTasksPanel [dt_agg]="this"></FHWorkflowTasksPanel>
35441
+ *
35442
+ * Un task senza `depends_on` e' eseguibile subito. Un task che dipende da un altro
35443
+ * resta bloccato (lucchetto) finche' quello non e' chiuso; le catene si propagano
35444
+ * da sole, perche' un padre bloccato non e' chiuso.
35445
+ *
35446
+ * Non e' una FHGrid: sono pochi record, servono pulsanti per riga e nessuna
35447
+ * paginazione.
35448
+ */
35449
+ class FHWorkflowTasksPanel {
35450
+ dialog;
35451
+ toastr;
35452
+ /** La form del documento: `<FHWorkflowTasksPanel [dt_agg]="this">`. */
35453
+ dt_agg;
35454
+ /** Abilita il rilascio forzato dei lock altrui (passare `is_Supervisor`). */
35455
+ is_supervisor = false;
35456
+ title = 'Attività dello step';
35457
+ claim_label = 'PRENDI IN CARICO';
35458
+ release_label = 'Rilascia la presa in carico';
35459
+ force_release_label = 'Forza il rilascio (supervisore)';
35460
+ in_charge_label = 'in carico a';
35461
+ in_charge_you_label = 'in carico a te';
35462
+ claim_lost_label = 'Attività già presa in carico da';
35463
+ close_label = 'CONCLUDI';
35464
+ reopen_label = 'RIAPRI';
35465
+ optional_label = 'facoltativo';
35466
+ closed_by_label = 'chiuso da';
35467
+ empty_label = 'Nessuna attività configurata per questo step.';
35468
+ no_role_label = 'Non hai un ruolo abilitato su questa attività.';
35469
+ after_label = 'dopo';
35470
+ locked_label = 'Si sblocca al completamento di';
35471
+ reopen_confirm = 'Vuoi riaprire questa attività?';
35472
+ note_label = 'Nota di chiusura';
35473
+ // Valori pre-calcolati: MAI getter dinamici nel template (un getter che costruisce
35474
+ // array darebbe a *ngFor un riferimento nuovo a ogni change detection).
35475
+ tasks = [];
35476
+ totalRequired = 0;
35477
+ doneRequired = 0;
35478
+ progressPct = 0;
35479
+ /** Riferimento all'array task dell'ultimo ricalcolo. `load_step_tasks()` lo rimpiazza. */
35480
+ _lastTasksRef = null;
35481
+ constructor(dialog, toastr) {
35482
+ this.dialog = dialog;
35483
+ this.toastr = toastr;
35484
+ }
35485
+ ngDoCheck() {
35486
+ const tasks = this.dt_agg?.step_tasks || null;
35487
+ if (tasks === this._lastTasksRef)
35488
+ return; // confronto per riferimento: O(1)
35489
+ this._lastTasksRef = tasks;
35490
+ this.rebuild();
35491
+ }
35492
+ rebuild() {
35493
+ const tasks = this.dt_agg?.step_tasks || [];
35494
+ for (const t of tasks) {
35495
+ // Campi di sola presentazione, calcolati UNA volta: niente funzioni in *ngFor.
35496
+ t._icon = t.stato === 1 ? 'check_circle' : t.locked ? 'lock' : 'radio_button_unchecked';
35497
+ t._tooltip = t.locked
35498
+ ? this.locked_label + (t.depends_title ? ': ' + t.depends_title : '')
35499
+ : !t.can_close
35500
+ ? this.no_role_label
35501
+ : '';
35502
+ t._data_txt = this.fmtDate(t.data_chiusura);
35503
+ t._presa_txt = this.fmtDate(t.data_presa);
35504
+ }
35505
+ this.tasks = tasks;
35506
+ const req = tasks.filter((t) => t.required === 1);
35507
+ this.totalRequired = req.length;
35508
+ this.doneRequired = req.filter((t) => t.stato === 1).length;
35509
+ this.progressPct =
35510
+ this.totalRequired === 0
35511
+ ? 0
35512
+ : Math.round((this.doneRequired / this.totalRequired) * 100);
35513
+ }
35514
+ fmtDate(v) {
35515
+ if (!v)
35516
+ return '';
35517
+ const d = new Date(v);
35518
+ return isNaN(d.getTime()) ? '' : d.toLocaleString('it-IT');
35519
+ }
35520
+ /**
35521
+ * Prende in carico il task. L'esito lo decide il DB (UPDATE condizionato su
35522
+ * `preso_da IS NULL`): se un altro utente ha vinto la corsa, `ok=false` e gli
35523
+ * mostriamo chi ha vinto. La lista e' gia' stata ricaricata dal motore, quindi
35524
+ * la riga si aggiorna da sola.
35525
+ */
35526
+ onClaim(t) {
35527
+ this.dt_agg.claim_task(t, (ok, owner) => {
35528
+ if (!ok && this.toastr)
35529
+ this.toastr.warning(this.claim_lost_label + ' ' + (owner || '?'), t.title);
35530
+ });
35531
+ }
35532
+ onRelease(t, force) {
35533
+ if (!force) {
35534
+ this.dt_agg.release_task(t, false);
35535
+ return;
35536
+ }
35537
+ const ref = this.dialog.open(FHWinConfirmComponent, {
35538
+ disableClose: true,
35539
+ data: {
35540
+ title_dialog: this.force_release_label,
35541
+ msg_dialog: 'Forzare il rilascio della presa in carico di ' + (t.preso_da || '?') + '?',
35542
+ },
35543
+ });
35544
+ ref.afterClosed().subscribe((ok) => {
35545
+ if (ok)
35546
+ this.dt_agg.release_task(t, true);
35547
+ });
35548
+ }
35549
+ onClose(t) {
35550
+ // La validazione applicativa la fa il componente concreto via ck_task():
35551
+ // qui la anticipiamo per non aprire il dialog nota se tanto non si puo' chiudere.
35552
+ const errs = this.dt_agg.ck_task(t.check_key || '');
35553
+ if (errs && errs.length > 0) {
35554
+ if (this.toastr)
35555
+ this.toastr.error(errs.join(' - '), t.title);
35556
+ return;
35557
+ }
35558
+ if (t.note_required === 1) {
35559
+ const ref = this.dialog.open(FHWinAskBigTextComponent, {
35560
+ width: '600px',
35561
+ maxWidth: '95vw',
35562
+ disableClose: true,
35563
+ data: { title: t.title, label: this.note_label, min_chars: 1 },
35564
+ });
35565
+ ref.afterClosed().subscribe((nota) => {
35566
+ if (nota != null && nota.trim() !== '')
35567
+ this.dt_agg.close_task(t, nota);
35568
+ });
35569
+ return;
35570
+ }
35571
+ this.dt_agg.close_task(t, null);
35572
+ }
35573
+ onReopen(t) {
35574
+ const ref = this.dialog.open(FHWinConfirmComponent, {
35575
+ disableClose: true,
35576
+ data: { title_dialog: this.reopen_label, msg_dialog: this.reopen_confirm },
35577
+ });
35578
+ ref.afterClosed().subscribe((ok) => {
35579
+ if (ok)
35580
+ this.dt_agg.reopen_task(t);
35581
+ });
35582
+ }
35583
+ 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 });
35584
+ 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: `
35585
+ <div class="fh-tasks" *ngIf="dt_agg && dt_agg.step_mode === 'T'">
35586
+ <div class="fh-tasks-head">
35587
+ <span class="material-symbols-outlined">checklist</span>
35588
+ <span class="fh-tasks-title">{{ title | translate }}</span>
35589
+
35590
+ <span class="fh-tasks-progress" *ngIf="totalRequired > 0">
35591
+ {{ doneRequired }} / {{ totalRequired }}
35592
+ </span>
35593
+ <div class="fh-tasks-bar" *ngIf="totalRequired > 0">
35594
+ <div class="fh-tasks-bar-fill" [style.width]="progressPct + '%'"></div>
35595
+ </div>
35596
+
35597
+ <mat-spinner *ngIf="dt_agg.b_tasks_loading" diameter="18"></mat-spinner>
35598
+ </div>
35599
+
35600
+ <div class="fh-tasks-empty" *ngIf="!dt_agg.b_tasks_loading && tasks.length === 0">
35601
+ {{ empty_label | translate }}
35602
+ </div>
35603
+
35604
+ <div class="fh-lane">
35605
+ <div class="fh-task" *ngFor="let t of tasks" [class.fh-task-done]="t.stato === 1">
35606
+ <span
35607
+ class="material-symbols-outlined fh-task-ico"
35608
+ [class.done]="t.stato === 1"
35609
+ [class.locked]="t.locked && t.stato !== 1"
35610
+ >
35611
+ {{ t._icon }}
35612
+ </span>
35613
+
35614
+ <div class="fh-task-body">
35615
+ <div class="fh-task-title">
35616
+ {{ t.title }}
35617
+ <span class="fh-task-opt" *ngIf="t.required !== 1">{{ optional_label | translate }}</span>
35618
+ </div>
35619
+ <div class="fh-task-meta">
35620
+ <span *ngIf="t.ruoli">{{ t.ruoli }}</span>
35621
+ <span class="fh-task-dep" *ngIf="t.stato !== 1 && t.depends_title">
35622
+ &middot;
35623
+ <span class="material-symbols-outlined fh-lock-ico">arrow_right_alt</span>
35624
+ {{ after_label }} {{ t.depends_title }}
35625
+ </span>
35626
+ <span *ngIf="t.stato === 1 && t.chiuso_da">
35627
+ &middot; {{ closed_by_label | translate }} {{ t.chiuso_da }}
35628
+ <ng-container *ngIf="t._data_txt">
35629
+ &middot; {{ t._data_txt }}
35630
+ </ng-container>
35631
+ </span>
35632
+ <span class="fh-task-lock" *ngIf="t.stato !== 1 && t.preso_da">
35633
+ &middot;
35634
+ <span class="material-symbols-outlined fh-lock-ico">person</span>
35635
+ {{ t.mine === 1 ? in_charge_you_label : (in_charge_label + ' ' + t.preso_da) }}
35636
+ <ng-container *ngIf="t._presa_txt">&middot; {{ t._presa_txt }}</ng-container>
35637
+ </span>
35638
+ </div>
35639
+ <div class="fh-task-note" *ngIf="t.nota">{{ t.nota }}</div>
35640
+ </div>
35641
+
35642
+ <!-- Libero: si prende in carico. Chi vince la corsa lo decide il DB. -->
35643
+ <button
35644
+ mat-stroked-button
35645
+ *ngIf="t.stato !== 1 && !t.preso_da"
35646
+ [disabled]="!t.can_close || t.locked || dt_agg.b_saving"
35647
+ [matTooltip]="t._tooltip"
35648
+ (click)="onClaim(t)"
35649
+ >
35650
+ {{ claim_label | translate }}
35651
+ </button>
35652
+
35653
+ <!-- Preso in carico da me: concludo o rilascio. -->
35654
+ <button
35655
+ mat-flat-button
35656
+ color="primary"
35657
+ *ngIf="t.stato !== 1 && t.mine === 1"
35658
+ [disabled]="dt_agg.b_saving"
35659
+ (click)="onClose(t)"
35660
+ >
35661
+ {{ close_label | translate }}
35662
+ </button>
35663
+ <button
35664
+ mat-icon-button
35665
+ *ngIf="t.stato !== 1 && t.mine === 1"
35666
+ [matTooltip]="release_label"
35667
+ (click)="onRelease(t, false)"
35668
+ >
35669
+ <span class="material-symbols-outlined">lock_open</span>
35670
+ </button>
35671
+
35672
+ <!-- Preso in carico da un altro: solo il supervisore puo' forzare. -->
35673
+ <button
35674
+ mat-icon-button
35675
+ color="warn"
35676
+ *ngIf="t.stato !== 1 && t.preso_da && t.mine !== 1 && is_supervisor"
35677
+ [matTooltip]="force_release_label"
35678
+ (click)="onRelease(t, true)"
35679
+ >
35680
+ <span class="material-symbols-outlined">lock_reset</span>
35681
+ </button>
35682
+
35683
+ <button
35684
+ mat-stroked-button
35685
+ color="warn"
35686
+ *ngIf="t.stato === 1"
35687
+ [disabled]="!t.can_close || dt_agg.b_saving"
35688
+ [matTooltip]="!t.can_close ? no_role_label : ''"
35689
+ (click)="onReopen(t)"
35690
+ >
35691
+ {{ reopen_label | translate }}
35692
+ </button>
35693
+ </div>
35694
+ </div>
35695
+ </div>
35696
+ `, isInline: true, styles: [".fh-tasks{border:1px solid rgba(0,0,0,.12);border-radius:8px;padding:10px 14px 6px;margin:8px 0;background:#fff}.fh-tasks-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}.fh-tasks-title{font-weight:600}.fh-tasks-progress{font-size:12px;color:#6b6363;margin-left:auto}.fh-tasks-bar{width:120px;height:6px;border-radius:4px;background:#00000014;overflow:hidden}.fh-tasks-bar-fill{height:100%;background:#4caf50;transition:width .2s ease}.fh-tasks-empty{color:#6b6363;font-size:13px;padding:6px 0 10px}.fh-lane{margin-bottom:6px}.fh-task-dep{color:#6b6363;font-style:italic}.fh-task{display:flex;align-items:center;gap:10px;padding:6px 4px;border-top:1px solid rgba(0,0,0,.06)}.fh-task-done .fh-task-title{text-decoration:line-through;color:#6b6363}.fh-task-ico{color:#b0bec5}.fh-task-ico.done{color:#4caf50}.fh-task-ico.locked{color:#90a4ae}.fh-task-body{flex:1 1 auto;min-width:0}.fh-task-title{font-size:14px}.fh-task-opt{font-size:10px;font-weight:600;color:#6b6363;border:1px solid rgba(0,0,0,.18);border-radius:10px;padding:0 6px;margin-left:6px}.fh-task-meta{font-size:11px;color:#6b6363}.fh-task-lock{color:#e65100;font-weight:600}.fh-lock-ico{font-size:13px;vertical-align:text-bottom}.fh-task-note{font-size:12px;color:#455a64;font-style:italic;margin-top:2px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i9$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i9$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] });
35697
+ }
35698
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FHWorkflowTasksPanel, decorators: [{
35699
+ type: Component,
35700
+ args: [{ selector: 'FHWorkflowTasksPanel', imports: [
35701
+ CommonModule,
35702
+ TranslateModule,
35703
+ MatButtonModule,
35704
+ MatIconModule,
35705
+ MatTooltipModule,
35706
+ MatProgressSpinnerModule,
35707
+ ], template: `
35708
+ <div class="fh-tasks" *ngIf="dt_agg && dt_agg.step_mode === 'T'">
35709
+ <div class="fh-tasks-head">
35710
+ <span class="material-symbols-outlined">checklist</span>
35711
+ <span class="fh-tasks-title">{{ title | translate }}</span>
35712
+
35713
+ <span class="fh-tasks-progress" *ngIf="totalRequired > 0">
35714
+ {{ doneRequired }} / {{ totalRequired }}
35715
+ </span>
35716
+ <div class="fh-tasks-bar" *ngIf="totalRequired > 0">
35717
+ <div class="fh-tasks-bar-fill" [style.width]="progressPct + '%'"></div>
35718
+ </div>
35719
+
35720
+ <mat-spinner *ngIf="dt_agg.b_tasks_loading" diameter="18"></mat-spinner>
35721
+ </div>
35722
+
35723
+ <div class="fh-tasks-empty" *ngIf="!dt_agg.b_tasks_loading && tasks.length === 0">
35724
+ {{ empty_label | translate }}
35725
+ </div>
35726
+
35727
+ <div class="fh-lane">
35728
+ <div class="fh-task" *ngFor="let t of tasks" [class.fh-task-done]="t.stato === 1">
35729
+ <span
35730
+ class="material-symbols-outlined fh-task-ico"
35731
+ [class.done]="t.stato === 1"
35732
+ [class.locked]="t.locked && t.stato !== 1"
35733
+ >
35734
+ {{ t._icon }}
35735
+ </span>
35736
+
35737
+ <div class="fh-task-body">
35738
+ <div class="fh-task-title">
35739
+ {{ t.title }}
35740
+ <span class="fh-task-opt" *ngIf="t.required !== 1">{{ optional_label | translate }}</span>
35741
+ </div>
35742
+ <div class="fh-task-meta">
35743
+ <span *ngIf="t.ruoli">{{ t.ruoli }}</span>
35744
+ <span class="fh-task-dep" *ngIf="t.stato !== 1 && t.depends_title">
35745
+ &middot;
35746
+ <span class="material-symbols-outlined fh-lock-ico">arrow_right_alt</span>
35747
+ {{ after_label }} {{ t.depends_title }}
35748
+ </span>
35749
+ <span *ngIf="t.stato === 1 && t.chiuso_da">
35750
+ &middot; {{ closed_by_label | translate }} {{ t.chiuso_da }}
35751
+ <ng-container *ngIf="t._data_txt">
35752
+ &middot; {{ t._data_txt }}
35753
+ </ng-container>
35754
+ </span>
35755
+ <span class="fh-task-lock" *ngIf="t.stato !== 1 && t.preso_da">
35756
+ &middot;
35757
+ <span class="material-symbols-outlined fh-lock-ico">person</span>
35758
+ {{ t.mine === 1 ? in_charge_you_label : (in_charge_label + ' ' + t.preso_da) }}
35759
+ <ng-container *ngIf="t._presa_txt">&middot; {{ t._presa_txt }}</ng-container>
35760
+ </span>
35761
+ </div>
35762
+ <div class="fh-task-note" *ngIf="t.nota">{{ t.nota }}</div>
35763
+ </div>
35764
+
35765
+ <!-- Libero: si prende in carico. Chi vince la corsa lo decide il DB. -->
35766
+ <button
35767
+ mat-stroked-button
35768
+ *ngIf="t.stato !== 1 && !t.preso_da"
35769
+ [disabled]="!t.can_close || t.locked || dt_agg.b_saving"
35770
+ [matTooltip]="t._tooltip"
35771
+ (click)="onClaim(t)"
35772
+ >
35773
+ {{ claim_label | translate }}
35774
+ </button>
35775
+
35776
+ <!-- Preso in carico da me: concludo o rilascio. -->
35777
+ <button
35778
+ mat-flat-button
35779
+ color="primary"
35780
+ *ngIf="t.stato !== 1 && t.mine === 1"
35781
+ [disabled]="dt_agg.b_saving"
35782
+ (click)="onClose(t)"
35783
+ >
35784
+ {{ close_label | translate }}
35785
+ </button>
35786
+ <button
35787
+ mat-icon-button
35788
+ *ngIf="t.stato !== 1 && t.mine === 1"
35789
+ [matTooltip]="release_label"
35790
+ (click)="onRelease(t, false)"
35791
+ >
35792
+ <span class="material-symbols-outlined">lock_open</span>
35793
+ </button>
35794
+
35795
+ <!-- Preso in carico da un altro: solo il supervisore puo' forzare. -->
35796
+ <button
35797
+ mat-icon-button
35798
+ color="warn"
35799
+ *ngIf="t.stato !== 1 && t.preso_da && t.mine !== 1 && is_supervisor"
35800
+ [matTooltip]="force_release_label"
35801
+ (click)="onRelease(t, true)"
35802
+ >
35803
+ <span class="material-symbols-outlined">lock_reset</span>
35804
+ </button>
35805
+
35806
+ <button
35807
+ mat-stroked-button
35808
+ color="warn"
35809
+ *ngIf="t.stato === 1"
35810
+ [disabled]="!t.can_close || dt_agg.b_saving"
35811
+ [matTooltip]="!t.can_close ? no_role_label : ''"
35812
+ (click)="onReopen(t)"
35813
+ >
35814
+ {{ reopen_label | translate }}
35815
+ </button>
35816
+ </div>
35817
+ </div>
35818
+ </div>
35819
+ `, styles: [".fh-tasks{border:1px solid rgba(0,0,0,.12);border-radius:8px;padding:10px 14px 6px;margin:8px 0;background:#fff}.fh-tasks-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}.fh-tasks-title{font-weight:600}.fh-tasks-progress{font-size:12px;color:#6b6363;margin-left:auto}.fh-tasks-bar{width:120px;height:6px;border-radius:4px;background:#00000014;overflow:hidden}.fh-tasks-bar-fill{height:100%;background:#4caf50;transition:width .2s ease}.fh-tasks-empty{color:#6b6363;font-size:13px;padding:6px 0 10px}.fh-lane{margin-bottom:6px}.fh-task-dep{color:#6b6363;font-style:italic}.fh-task{display:flex;align-items:center;gap:10px;padding:6px 4px;border-top:1px solid rgba(0,0,0,.06)}.fh-task-done .fh-task-title{text-decoration:line-through;color:#6b6363}.fh-task-ico{color:#b0bec5}.fh-task-ico.done{color:#4caf50}.fh-task-ico.locked{color:#90a4ae}.fh-task-body{flex:1 1 auto;min-width:0}.fh-task-title{font-size:14px}.fh-task-opt{font-size:10px;font-weight:600;color:#6b6363;border:1px solid rgba(0,0,0,.18);border-radius:10px;padding:0 6px;margin-left:6px}.fh-task-meta{font-size:11px;color:#6b6363}.fh-task-lock{color:#e65100;font-weight:600}.fh-lock-ico{font-size:13px;vertical-align:text-bottom}.fh-task-note{font-size:12px;color:#455a64;font-style:italic;margin-top:2px}\n"] }]
35820
+ }], ctorParameters: () => [{ type: i1$2.MatDialog }, { type: i3$1.ToastrService, decorators: [{
35821
+ type: Optional
35822
+ }] }], propDecorators: { dt_agg: [{
35823
+ type: Input
35824
+ }], is_supervisor: [{
35825
+ type: Input
35826
+ }], title: [{
35827
+ type: Input
35828
+ }], claim_label: [{
35829
+ type: Input
35830
+ }], release_label: [{
35831
+ type: Input
35832
+ }], force_release_label: [{
35833
+ type: Input
35834
+ }], in_charge_label: [{
35835
+ type: Input
35836
+ }], in_charge_you_label: [{
35837
+ type: Input
35838
+ }], claim_lost_label: [{
35839
+ type: Input
35840
+ }], close_label: [{
35841
+ type: Input
35842
+ }], reopen_label: [{
35843
+ type: Input
35844
+ }], optional_label: [{
35845
+ type: Input
35846
+ }], closed_by_label: [{
35847
+ type: Input
35848
+ }], empty_label: [{
35849
+ type: Input
35850
+ }], no_role_label: [{
35851
+ type: Input
35852
+ }], after_label: [{
35853
+ type: Input
35854
+ }], locked_label: [{
35855
+ type: Input
35856
+ }], reopen_confirm: [{
35857
+ type: Input
35858
+ }], note_label: [{
35859
+ type: Input
35860
+ }] } });
35861
+
35233
35862
  class AuthHttpRequestInterceptor {
35234
35863
  loginservice;
35235
35864
  appService;
@@ -37679,5 +38308,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
37679
38308
  * Generated bundle index. Do not edit.
37680
38309
  */
37681
38310
 
37682
- export { AppMakerService, AppService, ApprovaGridComponent, AuthHttpRequestInterceptor, AuthenticationService, BpmnEditorComponent, CheckboxEditorComponent, ComboBoxEditorComponent, CurrencyComponent, DialogBaseComponent, FHAiAssistantComponent, FHAiChatComponent, FHAiService, FHAutoCompleteComponent, FHCheckBoxComponent, FHColorPickerComponent, FHComboboxComponent, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHDateRangePickerComponent, FHFieldPickListComponent, FHFilterComboboxComponent, FHFormBuilderComponent, FHFormExecuterComponent, FHFormToolBarComponent, FHGridComponent, FHGridJSONComponent, FHGridToolBarComponent, FHGuard, FHHelpButtonComponent, FHHomeDocsComponent, FHHomeLauncherComponent, FHHomeStatsComponent, FHHomeTodoComponent, FHIconPickerComponent, FHImageViewerComponent, FHListComponent, FHLogPanelComponent, FHMultiComboboxComponent, FHNotesPanelComponent, FHNumericFieldComponent, FHPickFieldComponent, FHPickUsersComponent, FHRichTextComponent, FHRoleManagerComponent, FHTableManagerComponent, FHTextAreaComponent, FHTextInputComponent, FHTimePickerComponent, FHToolBarCustomAction, FHToolbarCommandType, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FHWinAppLogsComponent, FHWinAskBigTextComponent, FHWinAskButtonsComponent, FHWinAskNumberComponent, FHWinAskRichTextComponent, FHWinAskTextComponent, FHWinAutoComplete, FHWinComboComponent, FHWinConfirmComponent, FHWinErrorComponent, FHWinGridSelection, FHWinInfoComponent, FHWinListComponent, FHWinMappaComponent, FHWinOutputComponent, FHWinPicklistComponent, FHWinSalvaAnnulla, FHWinSelectByGridComponent, FHWinShowEmail, FHWinShowEmailS3, FHWinShowImage, FHWinShowLog, FHWinShowLogDett, FHWinTimeSlider, FHWinUploadComponent, FHWinUserInfo, FHWinUserPickerComponent, FHWinWaitComponent, FHWorkflowForm, FHWorkflowHeaderBar, FHWorkflowView, FSInput, FSResult, FileService, GridService, LocalDBService, MonthYearPickerComponent, NumericEditorComponent, OdbcService, OfficeAutomatorService, OfficeOperation, OfficeResult, QGParam, QGResult, QParam, QResult, QueryOpenService, QueryService, RegistrationService, ReplaceLineBreaks, SafePipe, TextAreaEditorComponent, UtilityService, WkfService, YearPickerComponent, createButtonCommand, createCheckboxCommand, createSpacerCommand, createTableManagerCommand, fh_win_translate };
38311
+ export { AppMakerService, AppService, ApprovaGridComponent, AuthHttpRequestInterceptor, AuthenticationService, BpmnEditorComponent, CheckboxEditorComponent, ComboBoxEditorComponent, CurrencyComponent, DialogBaseComponent, FHAiAssistantComponent, FHAiChatComponent, FHAiService, FHAutoCompleteComponent, FHCheckBoxComponent, FHColorPickerComponent, FHComboboxComponent, FHConfirmValues, FHCurrencyFormatterDirective, FHCurrencyPipe, FHDatePickerComponent, FHDateRangePickerComponent, FHFieldPickListComponent, FHFilterComboboxComponent, FHFormBuilderComponent, FHFormExecuterComponent, FHFormToolBarComponent, FHGridComponent, FHGridJSONComponent, FHGridToolBarComponent, FHGuard, FHHelpButtonComponent, FHHomeDocsComponent, FHHomeLauncherComponent, FHHomeStatsComponent, FHHomeTodoComponent, FHIconPickerComponent, FHImageViewerComponent, FHListComponent, FHLogPanelComponent, FHMultiComboboxComponent, FHNotesPanelComponent, FHNumericFieldComponent, FHPickFieldComponent, FHPickUsersComponent, FHRichTextComponent, FHRoleManagerComponent, FHTableManagerComponent, FHTextAreaComponent, FHTextInputComponent, FHTimePickerComponent, FHToolBarCustomAction, FHToolbarCommandType, FHUploadComponent, FHUploadPanelComponent, FHUploadPanelS3Component, FHUploadS3Component, FHUserFieldComponent, FHWinAppLogsComponent, FHWinAskBigTextComponent, FHWinAskButtonsComponent, FHWinAskNumberComponent, FHWinAskRichTextComponent, FHWinAskTextComponent, FHWinAutoComplete, FHWinComboComponent, FHWinConfirmComponent, FHWinErrorComponent, FHWinGridSelection, FHWinInfoComponent, FHWinListComponent, FHWinMappaComponent, FHWinOutputComponent, FHWinPicklistComponent, FHWinSalvaAnnulla, FHWinSelectByGridComponent, FHWinShowEmail, FHWinShowEmailS3, FHWinShowImage, FHWinShowLog, FHWinShowLogDett, FHWinTimeSlider, FHWinUploadComponent, FHWinUserInfo, FHWinUserPickerComponent, FHWinWaitComponent, FHWorkflowForm, FHWorkflowHeaderBar, FHWorkflowTasksPanel, FHWorkflowView, FSInput, FSResult, FileService, GridService, LocalDBService, MonthYearPickerComponent, NumericEditorComponent, OdbcService, OfficeAutomatorService, OfficeOperation, OfficeResult, QGParam, QGResult, QParam, QResult, QueryOpenService, QueryService, RegistrationService, ReplaceLineBreaks, SafePipe, TextAreaEditorComponent, UtilityService, WkfService, YearPickerComponent, createButtonCommand, createCheckboxCommand, createSpacerCommand, createTableManagerCommand, fh_win_translate };
37683
38312
  //# sourceMappingURL=fluxhub-fluxhub-lib.mjs.map