@fluxhub/fluxhub-lib 19.0.214 → 19.0.215

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,180 @@ 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 (ruoli dell'utente / wave
34351
+ * precedente della stessa corsia ancora aperta).
34352
+ */
34353
+ load_step_tasks(after) {
34354
+ if (!this.id_documento || this.m_obj == null)
34355
+ return;
34356
+ this.b_tasks_loading = true;
34357
+ let p = new QParam();
34358
+ p.sql = 'SELECT_WKF_STEP_TASKS';
34359
+ p.values = [
34360
+ this.id_applicativo,
34361
+ this.id_documento,
34362
+ this.m_obj.stato,
34363
+ this.app_s.user,
34364
+ ];
34365
+ p.types = ['string', 'string', 'int', 'string'];
34366
+ this.m_dataService.doQuery(p).subscribe({
34367
+ next: (data) => {
34368
+ this.b_tasks_loading = false;
34369
+ if (data == null || data.result_msg != 'OK')
34370
+ return;
34371
+ this.step_tasks = (data.result_data || []).map((t) => ({
34372
+ ...t,
34373
+ stato: Number(t.stato || 0),
34374
+ wave: Number(t.wave || 1),
34375
+ required: Number(t.required || 0),
34376
+ note_required: Number(t.note_required || 0),
34377
+ can_close: Number(t.can_close || 0) > 0,
34378
+ locked: Number(t.locked || 0) > 0,
34379
+ mine: Number(t.mine || 0),
34380
+ }));
34381
+ this.recompute_tasks_done();
34382
+ if (after)
34383
+ after();
34384
+ },
34385
+ error: () => {
34386
+ this.b_tasks_loading = false;
34387
+ },
34388
+ });
34389
+ }
34390
+ /** Tutti i task OBBLIGATORI chiusi? I facoltativi non bloccano l'avanzamento. */
34391
+ recompute_tasks_done() {
34392
+ const req = this.step_tasks.filter((t) => t.required == 1);
34393
+ this.tasks_all_done =
34394
+ req.length > 0 && req.every((t) => t.stato == 1);
34395
+ }
34396
+ /**
34397
+ * Presa in carico ATOMICA di un task. E' il lock che risolve la concorrenza:
34398
+ * solo chi ha la presa in carico puo' chiudere il task.
34399
+ *
34400
+ * Tre passi, e la correttezza sta tutta nel secondo:
34401
+ * 1) INSERT IGNORE -> materializza la riga se non c'e' (nessun errore se c'e')
34402
+ * 2) UPDATE ... WHERE preso_da IS NULL -> due utenti simultanei arrivano
34403
+ * entrambi qui, ma UNO SOLO trova la riga libera: l'altro aggiorna 0 righe
34404
+ * 3) SELECT del proprietario -> chi ha perso legge il nome del vincitore
34405
+ *
34406
+ * Il punto di serializzazione e' il DB, non il frontend. Non contiamo le "rows
34407
+ * affected" (dipendono dal driver e da CLIENT_FOUND_ROWS): rileggiamo il
34408
+ * proprietario, che dopo il passo 2 e' univoco e stabile.
34409
+ *
34410
+ * @param done (ok, owner) — ok=false se un altro utente ha vinto la corsa.
34411
+ */
34412
+ claim_task(task, done) {
34413
+ if (task == null || !task.can_close || task.locked || task.stato == 1) {
34414
+ if (done)
34415
+ done(false, task?.preso_da || '');
34416
+ return;
34417
+ }
34418
+ const pi = new QParam();
34419
+ pi.sql = 'INSERT_IGNORE_WKF_DOC_TASK';
34420
+ pi.values = [this.id_applicativo, this.id_documento, task.uiid, this.m_obj.stato];
34421
+ pi.types = ['string', 'string', 'string', 'int'];
34422
+ this.m_dataService.doQuery(pi).subscribe(() => {
34423
+ const pc = new QParam();
34424
+ pc.sql = 'CLAIM_WKF_DOC_TASK';
34425
+ pc.values = [this.id_applicativo, this.id_documento, task.uiid, this.app_s.user];
34426
+ pc.types = ['string', 'string', 'string', 'string'];
34427
+ this.m_dataService.doQuery(pc).subscribe(() => {
34428
+ const po = new QParam();
34429
+ po.sql = 'SELECT_WKF_DOC_TASK_OWNER';
34430
+ po.values = [this.id_applicativo, this.id_documento, task.uiid];
34431
+ po.types = ['string', 'string', 'string'];
34432
+ this.m_dataService.doQuery(po).subscribe((d) => {
34433
+ const owner = d != null && d.result_msg == 'OK' && d.result_data && d.result_data.length
34434
+ ? d.result_data[0].preso_da || ''
34435
+ : '';
34436
+ const ok = owner === this.app_s.user;
34437
+ this.load_step_tasks(() => {
34438
+ if (done)
34439
+ done(ok, owner);
34440
+ });
34441
+ });
34442
+ });
34443
+ });
34444
+ }
34445
+ /**
34446
+ * Rilascia la presa in carico. `force` (supervisori) sblocca anche i task presi
34447
+ * in carico da altri: serve per i lock rimasti appesi.
34448
+ */
34449
+ release_task(task, force = false) {
34450
+ const p = new QParam();
34451
+ p.sql = force ? 'RELEASE_WKF_DOC_TASK_FORCE' : 'RELEASE_WKF_DOC_TASK';
34452
+ p.values = force
34453
+ ? [this.id_applicativo, this.id_documento, task.uiid]
34454
+ : [this.id_applicativo, this.id_documento, task.uiid, this.app_s.user];
34455
+ p.types = force
34456
+ ? ['string', 'string', 'string']
34457
+ : ['string', 'string', 'string', 'string'];
34458
+ this.m_dataService.doQuery(p).subscribe(() => this.load_step_tasks());
34459
+ }
34460
+ /**
34461
+ * Chiude un task. Richiede la presa in carico (`task.mine`): la UPDATE porta
34462
+ * `preso_da=<me>` nella WHERE, quindi se nel frattempo un supervisore ha forzato
34463
+ * il rilascio la chiusura non passa e il reload lo rende evidente.
34464
+ *
34465
+ * Se dopo la chiusura tutti i task obbligatori sono chiusi, innesca l'avanzamento
34466
+ * riusando `procedi()`: transizioni, destinatari, notifiche e log restano quelli
34467
+ * standard del motore.
34468
+ *
34469
+ * NOTA: l'avanzamento automatico richiede che chi chiude l'ultimo task sia anche
34470
+ * autore dello step (`b_edit`). Configurare i ruoli del task come sottoinsieme
34471
+ * dei ruoli dello step. Se non lo e', il documento resta fermo con
34472
+ * `tasks_all_done=true` e avanza il primo autore che apre la pratica.
34473
+ */
34474
+ close_task(task, nota) {
34475
+ if (task == null || task.stato == 1 || task.locked)
34476
+ return false;
34477
+ if (Number(task.mine || 0) != 1)
34478
+ return false; // serve la presa in carico
34479
+ const errs = this.ck_task(task.check_key || '');
34480
+ if (errs && errs.length > 0)
34481
+ return false;
34482
+ const p = new QParam();
34483
+ p.sql = 'CLOSE_WKF_DOC_TASK';
34484
+ p.values = [
34485
+ this.id_applicativo,
34486
+ this.id_documento,
34487
+ task.uiid,
34488
+ this.app_s.user,
34489
+ nota,
34490
+ ];
34491
+ p.types = ['string', 'string', 'string', 'string', 'string'];
34492
+ this.m_dataService.doQuery(p).subscribe((data) => {
34493
+ if (data == null || data.result_msg != 'OK')
34494
+ return;
34495
+ // Ricarico dal DB invece di aggiornare in locale: `locked` degli altri task
34496
+ // dipende da questo, e un altro utente puo' aver chiuso qualcosa nel frattempo.
34497
+ this.load_step_tasks(() => {
34498
+ if (this.tasks_all_done && this.b_edit)
34499
+ this.procedi();
34500
+ });
34501
+ });
34502
+ return true;
34503
+ }
34504
+ /**
34505
+ * Riapre un task chiuso, azzerando anche la presa in carico. Ammesso a chiunque
34506
+ * abbia i ruoli del task, finche' il documento e' ancora in quello step (dopo
34507
+ * l'avanzamento i task non sono piu' raggiungibili: la finestra si chiude da sola).
34508
+ */
34509
+ reopen_task(task) {
34510
+ if (task == null || !task.can_close || task.stato != 1)
34511
+ return false;
34512
+ const p = new QParam();
34513
+ p.sql = 'REOPEN_WKF_DOC_TASK';
34514
+ p.values = [this.id_applicativo, this.id_documento, task.uiid];
34515
+ p.types = ['string', 'string', 'string'];
34516
+ this.m_dataService.doQuery(p).subscribe(() => this.load_step_tasks());
34517
+ return true;
34518
+ }
34327
34519
  s_uto = '';
34328
34520
  b_respingi_button = false;
34329
34521
  return_edit() {
@@ -34377,8 +34569,17 @@ class FHWorkflowForm {
34377
34569
  this.reject_label_color = data.result_data[0].reject_label_color || '#FFFFFF';
34378
34570
  this.reject_back_ground_color =
34379
34571
  data.result_data[0].reject_back_ground_color || '#f44336';
34572
+ // step_mode arriva dalla stessa query (join su wkf2_config_steps
34573
+ // per lo step corrente): nessun round-trip aggiuntivo.
34574
+ this.step_mode = data.result_data[0].step_mode || 'A';
34380
34575
  }
34381
34576
  this.b_init_next = true;
34577
+ if (this.step_mode == 'T')
34578
+ this.load_step_tasks();
34579
+ else {
34580
+ this.step_tasks = [];
34581
+ this.tasks_all_done = false;
34582
+ }
34382
34583
  }
34383
34584
  });
34384
34585
  this.r_count();
@@ -34795,7 +34996,7 @@ class FHWorkflowHeaderBar {
34795
34996
  <button
34796
34997
  mat-flat-button
34797
34998
  (click)="procedi()"
34798
- *ngIf="edit_button && procedi_button && !in_carico"
34999
+ *ngIf="edit_button && procedi_button && !in_carico && dt_agg?.step_mode !== 'T'"
34799
35000
  [disabled]="dt_agg?.b_saving"
34800
35001
  style="font-weight:bold"
34801
35002
  [style.background-color]="
@@ -35043,7 +35244,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
35043
35244
  <button
35044
35245
  mat-flat-button
35045
35246
  (click)="procedi()"
35046
- *ngIf="edit_button && procedi_button && !in_carico"
35247
+ *ngIf="edit_button && procedi_button && !in_carico && dt_agg?.step_mode !== 'T'"
35047
35248
  [disabled]="dt_agg?.b_saving"
35048
35249
  style="font-weight:bold"
35049
35250
  [style.background-color]="
@@ -35230,6 +35431,431 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
35230
35431
  type: Output
35231
35432
  }] } });
35232
35433
 
35434
+ /**
35435
+ * Pannello dei task dello step corrente (step_mode='T').
35436
+ *
35437
+ * Si usa nel form della pratica, accanto/sotto la FHWorkflowHeaderBar:
35438
+ *
35439
+ * <FHWorkflowTasksPanel [dt_agg]="this"></FHWorkflowTasksPanel>
35440
+ *
35441
+ * Mostra i task raggruppati per corsia (`lane`) e ondata (`wave`): i task di una
35442
+ * wave si sbloccano quando tutti i task obbligatori delle wave precedenti della
35443
+ * STESSA corsia sono chiusi. Le corsie sono indipendenti fra loro.
35444
+ *
35445
+ * Non e' una FHGrid: sono pochi record, servono pulsanti per riga e nessuna
35446
+ * paginazione.
35447
+ */
35448
+ class FHWorkflowTasksPanel {
35449
+ dialog;
35450
+ toastr;
35451
+ /** La form del documento: `<FHWorkflowTasksPanel [dt_agg]="this">`. */
35452
+ dt_agg;
35453
+ /** Abilita il rilascio forzato dei lock altrui (passare `is_Supervisor`). */
35454
+ is_supervisor = false;
35455
+ title = 'Attività dello step';
35456
+ claim_label = 'PRENDI IN CARICO';
35457
+ release_label = 'Rilascia la presa in carico';
35458
+ force_release_label = 'Forza il rilascio (supervisore)';
35459
+ in_charge_label = 'in carico a';
35460
+ in_charge_you_label = 'in carico a te';
35461
+ claim_lost_label = 'Attività già presa in carico da';
35462
+ close_label = 'CONCLUDI';
35463
+ reopen_label = 'RIAPRI';
35464
+ optional_label = 'facoltativo';
35465
+ closed_by_label = 'chiuso da';
35466
+ empty_label = 'Nessuna attività configurata per questo step.';
35467
+ no_role_label = 'Non hai un ruolo abilitato su questa attività.';
35468
+ locked_label = 'Si sblocca al completamento delle attività precedenti della stessa corsia.';
35469
+ reopen_confirm = 'Vuoi riaprire questa attività?';
35470
+ note_label = 'Nota di chiusura';
35471
+ // Valori pre-calcolati: MAI getter dinamici nel template. `lanes` costruisce
35472
+ // array nuovi, e un getter lo rifarebbe a ogni change detection, dando a *ngFor
35473
+ // un riferimento diverso ogni giro (churn e possibili loop di CD).
35474
+ lanes = [];
35475
+ totalRequired = 0;
35476
+ doneRequired = 0;
35477
+ progressPct = 0;
35478
+ /** Riferimento all'array task dell'ultimo ricalcolo. `load_step_tasks()` lo rimpiazza. */
35479
+ _lastTasksRef = null;
35480
+ constructor(dialog, toastr) {
35481
+ this.dialog = dialog;
35482
+ this.toastr = toastr;
35483
+ }
35484
+ ngDoCheck() {
35485
+ const tasks = this.dt_agg?.step_tasks || null;
35486
+ if (tasks === this._lastTasksRef)
35487
+ return; // confronto per riferimento: O(1)
35488
+ this._lastTasksRef = tasks;
35489
+ this.rebuild();
35490
+ }
35491
+ rebuild() {
35492
+ const tasks = this.dt_agg?.step_tasks || [];
35493
+ // Raggruppa per corsia preservando l'ordine restituito dalla query
35494
+ // (lane, wave, ord, title).
35495
+ const out = [];
35496
+ const idx = {};
35497
+ for (const t of tasks) {
35498
+ // Campi di sola presentazione, calcolati UNA volta: niente funzioni in *ngFor.
35499
+ t._icon = t.stato === 1 ? 'check_circle' : t.locked ? 'lock' : 'radio_button_unchecked';
35500
+ t._tooltip = t.locked ? this.locked_label : !t.can_close ? this.no_role_label : '';
35501
+ t._data_txt = this.fmtDate(t.data_chiusura);
35502
+ t._presa_txt = this.fmtDate(t.data_presa);
35503
+ const key = t.lane || '';
35504
+ if (idx[key] === undefined) {
35505
+ idx[key] = out.length;
35506
+ out.push({ name: key, tasks: [] });
35507
+ }
35508
+ out[idx[key]].tasks.push(t);
35509
+ }
35510
+ this.lanes = out;
35511
+ const req = tasks.filter((t) => t.required === 1);
35512
+ this.totalRequired = req.length;
35513
+ this.doneRequired = req.filter((t) => t.stato === 1).length;
35514
+ this.progressPct =
35515
+ this.totalRequired === 0
35516
+ ? 0
35517
+ : Math.round((this.doneRequired / this.totalRequired) * 100);
35518
+ }
35519
+ fmtDate(v) {
35520
+ if (!v)
35521
+ return '';
35522
+ const d = new Date(v);
35523
+ return isNaN(d.getTime()) ? '' : d.toLocaleString('it-IT');
35524
+ }
35525
+ /**
35526
+ * Prende in carico il task. L'esito lo decide il DB (UPDATE condizionato su
35527
+ * `preso_da IS NULL`): se un altro utente ha vinto la corsa, `ok=false` e gli
35528
+ * mostriamo chi ha vinto. La lista e' gia' stata ricaricata dal motore, quindi
35529
+ * la riga si aggiorna da sola.
35530
+ */
35531
+ onClaim(t) {
35532
+ this.dt_agg.claim_task(t, (ok, owner) => {
35533
+ if (!ok && this.toastr)
35534
+ this.toastr.warning(this.claim_lost_label + ' ' + (owner || '?'), t.title);
35535
+ });
35536
+ }
35537
+ onRelease(t, force) {
35538
+ if (!force) {
35539
+ this.dt_agg.release_task(t, false);
35540
+ return;
35541
+ }
35542
+ const ref = this.dialog.open(FHWinConfirmComponent, {
35543
+ disableClose: true,
35544
+ data: {
35545
+ title_dialog: this.force_release_label,
35546
+ msg_dialog: 'Forzare il rilascio della presa in carico di ' + (t.preso_da || '?') + '?',
35547
+ },
35548
+ });
35549
+ ref.afterClosed().subscribe((ok) => {
35550
+ if (ok)
35551
+ this.dt_agg.release_task(t, true);
35552
+ });
35553
+ }
35554
+ onClose(t) {
35555
+ // La validazione applicativa la fa il componente concreto via ck_task():
35556
+ // qui la anticipiamo per non aprire il dialog nota se tanto non si puo' chiudere.
35557
+ const errs = this.dt_agg.ck_task(t.check_key || '');
35558
+ if (errs && errs.length > 0) {
35559
+ if (this.toastr)
35560
+ this.toastr.error(errs.join(' - '), t.title);
35561
+ return;
35562
+ }
35563
+ if (t.note_required === 1) {
35564
+ const ref = this.dialog.open(FHWinAskBigTextComponent, {
35565
+ width: '600px',
35566
+ maxWidth: '95vw',
35567
+ disableClose: true,
35568
+ data: { title: t.title, label: this.note_label, min_chars: 1 },
35569
+ });
35570
+ ref.afterClosed().subscribe((nota) => {
35571
+ if (nota != null && nota.trim() !== '')
35572
+ this.dt_agg.close_task(t, nota);
35573
+ });
35574
+ return;
35575
+ }
35576
+ this.dt_agg.close_task(t, null);
35577
+ }
35578
+ onReopen(t) {
35579
+ const ref = this.dialog.open(FHWinConfirmComponent, {
35580
+ disableClose: true,
35581
+ data: { title_dialog: this.reopen_label, msg_dialog: this.reopen_confirm },
35582
+ });
35583
+ ref.afterClosed().subscribe((ok) => {
35584
+ if (ok)
35585
+ this.dt_agg.reopen_task(t);
35586
+ });
35587
+ }
35588
+ 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 });
35589
+ 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", locked_label: "locked_label", reopen_confirm: "reopen_confirm", note_label: "note_label" }, ngImport: i0, template: `
35590
+ <div class="fh-tasks" *ngIf="dt_agg && dt_agg.step_mode === 'T'">
35591
+ <div class="fh-tasks-head">
35592
+ <span class="material-symbols-outlined">checklist</span>
35593
+ <span class="fh-tasks-title">{{ title | translate }}</span>
35594
+
35595
+ <span class="fh-tasks-progress" *ngIf="totalRequired > 0">
35596
+ {{ doneRequired }} / {{ totalRequired }}
35597
+ </span>
35598
+ <div class="fh-tasks-bar" *ngIf="totalRequired > 0">
35599
+ <div class="fh-tasks-bar-fill" [style.width]="progressPct + '%'"></div>
35600
+ </div>
35601
+
35602
+ <mat-spinner *ngIf="dt_agg.b_tasks_loading" diameter="18"></mat-spinner>
35603
+ </div>
35604
+
35605
+ <div class="fh-tasks-empty" *ngIf="!dt_agg.b_tasks_loading && lanes.length === 0">
35606
+ {{ empty_label | translate }}
35607
+ </div>
35608
+
35609
+ <div class="fh-lane" *ngFor="let lane of lanes">
35610
+ <div class="fh-lane-name" *ngIf="lane.name">{{ lane.name }}</div>
35611
+
35612
+ <div class="fh-task" *ngFor="let t of lane.tasks" [class.fh-task-done]="t.stato === 1">
35613
+ <span
35614
+ class="material-symbols-outlined fh-task-ico"
35615
+ [class.done]="t.stato === 1"
35616
+ [class.locked]="t.locked && t.stato !== 1"
35617
+ >
35618
+ {{ t._icon }}
35619
+ </span>
35620
+
35621
+ <div class="fh-task-body">
35622
+ <div class="fh-task-title">
35623
+ {{ t.title }}
35624
+ <span class="fh-task-opt" *ngIf="t.required !== 1">{{ optional_label | translate }}</span>
35625
+ </div>
35626
+ <div class="fh-task-meta">
35627
+ <span *ngIf="t.ruoli">{{ t.ruoli }}</span>
35628
+ <span *ngIf="t.stato === 1 && t.chiuso_da">
35629
+ &middot; {{ closed_by_label | translate }} {{ t.chiuso_da }}
35630
+ <ng-container *ngIf="t._data_txt">
35631
+ &middot; {{ t._data_txt }}
35632
+ </ng-container>
35633
+ </span>
35634
+ <span class="fh-task-lock" *ngIf="t.stato !== 1 && t.preso_da">
35635
+ &middot;
35636
+ <span class="material-symbols-outlined fh-lock-ico">person</span>
35637
+ {{ t.mine === 1 ? in_charge_you_label : (in_charge_label + ' ' + t.preso_da) }}
35638
+ <ng-container *ngIf="t._presa_txt">&middot; {{ t._presa_txt }}</ng-container>
35639
+ </span>
35640
+ </div>
35641
+ <div class="fh-task-note" *ngIf="t.nota">{{ t.nota }}</div>
35642
+ </div>
35643
+
35644
+ <!-- Libero: si prende in carico. Chi vince la corsa lo decide il DB. -->
35645
+ <button
35646
+ mat-stroked-button
35647
+ *ngIf="t.stato !== 1 && !t.preso_da"
35648
+ [disabled]="!t.can_close || t.locked || dt_agg.b_saving"
35649
+ [matTooltip]="t._tooltip"
35650
+ (click)="onClaim(t)"
35651
+ >
35652
+ {{ claim_label | translate }}
35653
+ </button>
35654
+
35655
+ <!-- Preso in carico da me: concludo o rilascio. -->
35656
+ <button
35657
+ mat-flat-button
35658
+ color="primary"
35659
+ *ngIf="t.stato !== 1 && t.mine === 1"
35660
+ [disabled]="dt_agg.b_saving"
35661
+ (click)="onClose(t)"
35662
+ >
35663
+ {{ close_label | translate }}
35664
+ </button>
35665
+ <button
35666
+ mat-icon-button
35667
+ *ngIf="t.stato !== 1 && t.mine === 1"
35668
+ [matTooltip]="release_label"
35669
+ (click)="onRelease(t, false)"
35670
+ >
35671
+ <span class="material-symbols-outlined">lock_open</span>
35672
+ </button>
35673
+
35674
+ <!-- Preso in carico da un altro: solo il supervisore puo' forzare. -->
35675
+ <button
35676
+ mat-icon-button
35677
+ color="warn"
35678
+ *ngIf="t.stato !== 1 && t.preso_da && t.mine !== 1 && is_supervisor"
35679
+ [matTooltip]="force_release_label"
35680
+ (click)="onRelease(t, true)"
35681
+ >
35682
+ <span class="material-symbols-outlined">lock_reset</span>
35683
+ </button>
35684
+
35685
+ <button
35686
+ mat-stroked-button
35687
+ color="warn"
35688
+ *ngIf="t.stato === 1"
35689
+ [disabled]="!t.can_close || dt_agg.b_saving"
35690
+ [matTooltip]="!t.can_close ? no_role_label : ''"
35691
+ (click)="onReopen(t)"
35692
+ >
35693
+ {{ reopen_label | translate }}
35694
+ </button>
35695
+ </div>
35696
+ </div>
35697
+ </div>
35698
+ `, 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-lane-name{font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;color:#6b6363;margin:8px 0 4px}.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"] }] });
35699
+ }
35700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: FHWorkflowTasksPanel, decorators: [{
35701
+ type: Component,
35702
+ args: [{ selector: 'FHWorkflowTasksPanel', imports: [
35703
+ CommonModule,
35704
+ TranslateModule,
35705
+ MatButtonModule,
35706
+ MatIconModule,
35707
+ MatTooltipModule,
35708
+ MatProgressSpinnerModule,
35709
+ ], template: `
35710
+ <div class="fh-tasks" *ngIf="dt_agg && dt_agg.step_mode === 'T'">
35711
+ <div class="fh-tasks-head">
35712
+ <span class="material-symbols-outlined">checklist</span>
35713
+ <span class="fh-tasks-title">{{ title | translate }}</span>
35714
+
35715
+ <span class="fh-tasks-progress" *ngIf="totalRequired > 0">
35716
+ {{ doneRequired }} / {{ totalRequired }}
35717
+ </span>
35718
+ <div class="fh-tasks-bar" *ngIf="totalRequired > 0">
35719
+ <div class="fh-tasks-bar-fill" [style.width]="progressPct + '%'"></div>
35720
+ </div>
35721
+
35722
+ <mat-spinner *ngIf="dt_agg.b_tasks_loading" diameter="18"></mat-spinner>
35723
+ </div>
35724
+
35725
+ <div class="fh-tasks-empty" *ngIf="!dt_agg.b_tasks_loading && lanes.length === 0">
35726
+ {{ empty_label | translate }}
35727
+ </div>
35728
+
35729
+ <div class="fh-lane" *ngFor="let lane of lanes">
35730
+ <div class="fh-lane-name" *ngIf="lane.name">{{ lane.name }}</div>
35731
+
35732
+ <div class="fh-task" *ngFor="let t of lane.tasks" [class.fh-task-done]="t.stato === 1">
35733
+ <span
35734
+ class="material-symbols-outlined fh-task-ico"
35735
+ [class.done]="t.stato === 1"
35736
+ [class.locked]="t.locked && t.stato !== 1"
35737
+ >
35738
+ {{ t._icon }}
35739
+ </span>
35740
+
35741
+ <div class="fh-task-body">
35742
+ <div class="fh-task-title">
35743
+ {{ t.title }}
35744
+ <span class="fh-task-opt" *ngIf="t.required !== 1">{{ optional_label | translate }}</span>
35745
+ </div>
35746
+ <div class="fh-task-meta">
35747
+ <span *ngIf="t.ruoli">{{ t.ruoli }}</span>
35748
+ <span *ngIf="t.stato === 1 && t.chiuso_da">
35749
+ &middot; {{ closed_by_label | translate }} {{ t.chiuso_da }}
35750
+ <ng-container *ngIf="t._data_txt">
35751
+ &middot; {{ t._data_txt }}
35752
+ </ng-container>
35753
+ </span>
35754
+ <span class="fh-task-lock" *ngIf="t.stato !== 1 && t.preso_da">
35755
+ &middot;
35756
+ <span class="material-symbols-outlined fh-lock-ico">person</span>
35757
+ {{ t.mine === 1 ? in_charge_you_label : (in_charge_label + ' ' + t.preso_da) }}
35758
+ <ng-container *ngIf="t._presa_txt">&middot; {{ t._presa_txt }}</ng-container>
35759
+ </span>
35760
+ </div>
35761
+ <div class="fh-task-note" *ngIf="t.nota">{{ t.nota }}</div>
35762
+ </div>
35763
+
35764
+ <!-- Libero: si prende in carico. Chi vince la corsa lo decide il DB. -->
35765
+ <button
35766
+ mat-stroked-button
35767
+ *ngIf="t.stato !== 1 && !t.preso_da"
35768
+ [disabled]="!t.can_close || t.locked || dt_agg.b_saving"
35769
+ [matTooltip]="t._tooltip"
35770
+ (click)="onClaim(t)"
35771
+ >
35772
+ {{ claim_label | translate }}
35773
+ </button>
35774
+
35775
+ <!-- Preso in carico da me: concludo o rilascio. -->
35776
+ <button
35777
+ mat-flat-button
35778
+ color="primary"
35779
+ *ngIf="t.stato !== 1 && t.mine === 1"
35780
+ [disabled]="dt_agg.b_saving"
35781
+ (click)="onClose(t)"
35782
+ >
35783
+ {{ close_label | translate }}
35784
+ </button>
35785
+ <button
35786
+ mat-icon-button
35787
+ *ngIf="t.stato !== 1 && t.mine === 1"
35788
+ [matTooltip]="release_label"
35789
+ (click)="onRelease(t, false)"
35790
+ >
35791
+ <span class="material-symbols-outlined">lock_open</span>
35792
+ </button>
35793
+
35794
+ <!-- Preso in carico da un altro: solo il supervisore puo' forzare. -->
35795
+ <button
35796
+ mat-icon-button
35797
+ color="warn"
35798
+ *ngIf="t.stato !== 1 && t.preso_da && t.mine !== 1 && is_supervisor"
35799
+ [matTooltip]="force_release_label"
35800
+ (click)="onRelease(t, true)"
35801
+ >
35802
+ <span class="material-symbols-outlined">lock_reset</span>
35803
+ </button>
35804
+
35805
+ <button
35806
+ mat-stroked-button
35807
+ color="warn"
35808
+ *ngIf="t.stato === 1"
35809
+ [disabled]="!t.can_close || dt_agg.b_saving"
35810
+ [matTooltip]="!t.can_close ? no_role_label : ''"
35811
+ (click)="onReopen(t)"
35812
+ >
35813
+ {{ reopen_label | translate }}
35814
+ </button>
35815
+ </div>
35816
+ </div>
35817
+ </div>
35818
+ `, 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-lane-name{font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;color:#6b6363;margin:8px 0 4px}.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"] }]
35819
+ }], ctorParameters: () => [{ type: i1$2.MatDialog }, { type: i3$1.ToastrService, decorators: [{
35820
+ type: Optional
35821
+ }] }], propDecorators: { dt_agg: [{
35822
+ type: Input
35823
+ }], is_supervisor: [{
35824
+ type: Input
35825
+ }], title: [{
35826
+ type: Input
35827
+ }], claim_label: [{
35828
+ type: Input
35829
+ }], release_label: [{
35830
+ type: Input
35831
+ }], force_release_label: [{
35832
+ type: Input
35833
+ }], in_charge_label: [{
35834
+ type: Input
35835
+ }], in_charge_you_label: [{
35836
+ type: Input
35837
+ }], claim_lost_label: [{
35838
+ type: Input
35839
+ }], close_label: [{
35840
+ type: Input
35841
+ }], reopen_label: [{
35842
+ type: Input
35843
+ }], optional_label: [{
35844
+ type: Input
35845
+ }], closed_by_label: [{
35846
+ type: Input
35847
+ }], empty_label: [{
35848
+ type: Input
35849
+ }], no_role_label: [{
35850
+ type: Input
35851
+ }], locked_label: [{
35852
+ type: Input
35853
+ }], reopen_confirm: [{
35854
+ type: Input
35855
+ }], note_label: [{
35856
+ type: Input
35857
+ }] } });
35858
+
35233
35859
  class AuthHttpRequestInterceptor {
35234
35860
  loginservice;
35235
35861
  appService;
@@ -37679,5 +38305,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImpo
37679
38305
  * Generated bundle index. Do not edit.
37680
38306
  */
37681
38307
 
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 };
38308
+ 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
38309
  //# sourceMappingURL=fluxhub-fluxhub-lib.mjs.map