@topconsultnpm/sdkui-react 6.22.0-dev1.8 → 6.22.0-dev2.2
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.
- package/lib/components/base/TMDataGridExportForm.js +39 -30
- package/lib/components/base/TMModal.js +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +4 -6
- package/lib/components/editors/TMDateBox.d.ts +16 -1
- package/lib/components/editors/TMDateBox.js +90 -22
- package/lib/components/editors/TMMetadataEditor.js +19 -20
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +23 -15
- package/lib/components/editors/TMTextBox.d.ts +2 -0
- package/lib/components/editors/TMTextBox.js +38 -22
- package/lib/components/features/documents/TMDcmtForm.d.ts +2 -1
- package/lib/components/features/documents/TMDcmtForm.js +112 -25
- package/lib/components/features/documents/TMRelationViewer.js +13 -32
- package/lib/components/features/search/TMSearch.d.ts +2 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +2 -1
- package/lib/components/features/search/TMSearchResult.js +13 -40
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +4 -2
- package/lib/components/features/search/TMSignatureInfoContent.js +373 -79
- package/lib/components/forms/Login/TMLoginForm.d.ts +2 -0
- package/lib/components/forms/Login/TMLoginForm.js +17 -3
- package/lib/components/forms/Login/TextBox.d.ts +3 -0
- package/lib/components/forms/Login/TextBox.js +2 -2
- package/lib/components/pages/TMPage.js +3 -1
- package/lib/components/query/TMQueryEditor.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +1 -1
- package/lib/helper/Globalization.d.ts +1 -1
- package/lib/helper/SDKUI_Globals.js +22 -2
- package/lib/helper/SDKUI_Localizator.d.ts +9 -0
- package/lib/helper/SDKUI_Localizator.js +90 -0
- package/lib/helper/TMUtils.d.ts +29 -1
- package/lib/helper/TMUtils.js +249 -10
- package/lib/helper/grafometricSignaturesCache.d.ts +45 -0
- package/lib/helper/grafometricSignaturesCache.js +56 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDocumentOperations.d.ts +2 -1
- package/lib/hooks/useDocumentOperations.js +15 -15
- package/lib/hooks/usePreventFileDrop.js +14 -3
- package/lib/ts/graphometricTypes.d.ts +62 -0
- package/lib/ts/graphometricTypes.js +1 -0
- package/lib/ts/index.d.ts +1 -0
- package/lib/ts/index.js +1 -0
- package/package.json +66 -61
package/lib/helper/TMUtils.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import styled from "styled-components";
|
|
3
3
|
import { TMTooltip } from '../components';
|
|
4
4
|
import { IconCADossier, IconKey, IconMenuCAWorkingGroups } from './TMIcons';
|
|
5
|
-
import { AccessLevels, AppModules, DataListCacheService, DcmtTypeListCacheService, LicenseModuleStatus, MetadataDataDomains, PdGs, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { AccessLevels, AppModules, DataColumnTypes, DataListCacheService, DcmtTypeListCacheService, LicenseModuleStatus, MetadataDataDomains, MetadataFormats, PdGs, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts';
|
|
6
6
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
7
7
|
/**
|
|
8
8
|
* Estensioni di firma/marca temporale note che possono avvolgere altre estensioni.
|
|
@@ -439,16 +439,10 @@ export const buildDcmtDisplayName = (obj) => {
|
|
|
439
439
|
if (!obj)
|
|
440
440
|
return [];
|
|
441
441
|
const sysAbstractKey = Object.keys(obj).find(k => k.toUpperCase() === 'SYS_ABSTRACT');
|
|
442
|
-
if (sysAbstractKey) {
|
|
443
|
-
|
|
444
|
-
return [sysAbstractKey];
|
|
445
|
-
}
|
|
446
|
-
// SYS_Abstract esiste ma è vuoto: usa DID se presente, altrimenti continua con la logica standard
|
|
447
|
-
const didKey = Object.keys(obj).find(k => k.toUpperCase() === 'DID');
|
|
448
|
-
if (didKey && obj[didKey]?.value) {
|
|
449
|
-
return [didKey];
|
|
450
|
-
}
|
|
442
|
+
if (sysAbstractKey && obj[sysAbstractKey]?.value) {
|
|
443
|
+
return [sysAbstractKey];
|
|
451
444
|
}
|
|
445
|
+
// SYS_Abstract esiste ma è vuoto: continua con la logica standard
|
|
452
446
|
const keys = Object.keys(obj);
|
|
453
447
|
const sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
|
|
454
448
|
const viewableMetadataKeys = keys.filter(k => obj?.[k]?.value &&
|
|
@@ -461,6 +455,7 @@ export const buildDcmtDisplayName = (obj) => {
|
|
|
461
455
|
if (specialOutputKeys.length > 0) {
|
|
462
456
|
return specialOutputKeys;
|
|
463
457
|
}
|
|
458
|
+
// Se non ci sono metadati speciali, restituisci i primi 5 metadati non di sistema con permesso canView
|
|
464
459
|
if (viewableMetadataKeys.length > 0) {
|
|
465
460
|
return viewableMetadataKeys.slice(0, 5);
|
|
466
461
|
}
|
|
@@ -533,3 +528,247 @@ export const getDTDDisplayNameInfo = async (dtd) => {
|
|
|
533
528
|
return SDKUI_Localizator.DisplayNameMethod_Top5;
|
|
534
529
|
}
|
|
535
530
|
};
|
|
531
|
+
export const getCurrencySymbol = (format) => {
|
|
532
|
+
switch (format) {
|
|
533
|
+
case MetadataFormats.CurrencyEuro: return '€';
|
|
534
|
+
case MetadataFormats.CurrencyDollar: return '$';
|
|
535
|
+
case MetadataFormats.CurrencyPound: return '£';
|
|
536
|
+
case MetadataFormats.CurrencyYen: return '¥';
|
|
537
|
+
default: return undefined;
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
/** Estrae Format e FormatCulture dalle proprietà estese di una colonna. */
|
|
541
|
+
export const getColumnFormatInfo = (col) => {
|
|
542
|
+
const format = MetadataFormats[(col.extendedProperties?.["Format"] ?? "None")];
|
|
543
|
+
const formatCulture = col.extendedProperties?.["FormatCulture"] ?? window.navigator.language;
|
|
544
|
+
return { format, formatCulture };
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* Restituisce il pattern di formato DevExtreme per DateBox basato su MetadataFormats e cultura.
|
|
548
|
+
* Usa la stessa logica di formatDateTimeByMetadataFormat per garantire coerenza.
|
|
549
|
+
* Supporta: IT (it-IT), GB (en-GB), US (en-US), JP (ja-JP)
|
|
550
|
+
*/
|
|
551
|
+
export const getDevExtremeDateDisplayFormat = (format, formatCulture) => {
|
|
552
|
+
try {
|
|
553
|
+
const culture = (formatCulture ?? window.navigator.language).toLowerCase();
|
|
554
|
+
const isItalian = culture === 'it-it' || culture.startsWith('it');
|
|
555
|
+
const isUS = culture === 'en-us';
|
|
556
|
+
const isGB = culture === 'en-gb';
|
|
557
|
+
const isJP = culture === 'ja-jp' || culture.startsWith('ja');
|
|
558
|
+
// Formati data base per cultura (coerenti con formatDateTimeByMetadataFormat)
|
|
559
|
+
const getShortDate = () => {
|
|
560
|
+
if (isItalian)
|
|
561
|
+
return 'dd/MM/yyyy'; // 17/07/2026
|
|
562
|
+
if (isUS)
|
|
563
|
+
return 'M/d/yyyy'; // 7/17/2026
|
|
564
|
+
if (isGB)
|
|
565
|
+
return 'dd/MM/yyyy'; // 17/07/2026
|
|
566
|
+
if (isJP)
|
|
567
|
+
return 'yyyy/MM/dd'; // 2026/07/17
|
|
568
|
+
return 'dd/MM/yyyy'; // default
|
|
569
|
+
};
|
|
570
|
+
const getLongDate = () => {
|
|
571
|
+
if (isItalian)
|
|
572
|
+
return 'EEEE d MMMM yyyy'; // lunedì 17 luglio 2026
|
|
573
|
+
if (isUS)
|
|
574
|
+
return 'EEEE, MMMM d, yyyy'; // Monday, July 17, 2026
|
|
575
|
+
if (isGB)
|
|
576
|
+
return 'd MMMM yyyy'; // 17 July 2026 (senza weekday)
|
|
577
|
+
if (isJP)
|
|
578
|
+
return 'yyyy年M月d日'; // 2026年7月17日 (senza weekday)
|
|
579
|
+
return 'd MMMM yyyy'; // default (senza weekday)
|
|
580
|
+
};
|
|
581
|
+
// Formati ora per cultura (US usa 12h con AM/PM, altri usano 24h)
|
|
582
|
+
const getShortTime = () => {
|
|
583
|
+
if (isUS)
|
|
584
|
+
return 'h:mm a'; // 3:30 PM
|
|
585
|
+
return 'HH:mm'; // 15:30
|
|
586
|
+
};
|
|
587
|
+
const getLongTime = () => {
|
|
588
|
+
if (isUS)
|
|
589
|
+
return 'h:mm:ss a'; // 3:30:45 PM
|
|
590
|
+
return 'HH:mm:ss'; // 15:30:45
|
|
591
|
+
};
|
|
592
|
+
const shortDate = getShortDate();
|
|
593
|
+
const longDate = getLongDate();
|
|
594
|
+
const shortTime = getShortTime();
|
|
595
|
+
const longTime = getLongTime();
|
|
596
|
+
switch (format) {
|
|
597
|
+
case MetadataFormats.ShortDate:
|
|
598
|
+
return shortDate;
|
|
599
|
+
case MetadataFormats.LongDate:
|
|
600
|
+
return longDate;
|
|
601
|
+
case MetadataFormats.ShortTime:
|
|
602
|
+
return shortTime;
|
|
603
|
+
case MetadataFormats.LongTime:
|
|
604
|
+
return longTime;
|
|
605
|
+
case MetadataFormats.ShortDateShortTime:
|
|
606
|
+
return `${shortDate} ${shortTime}`;
|
|
607
|
+
case MetadataFormats.ShortDateLongTime:
|
|
608
|
+
return `${shortDate} ${longTime}`;
|
|
609
|
+
case MetadataFormats.LongDateShortTime:
|
|
610
|
+
return `${longDate} ${shortTime}`;
|
|
611
|
+
case MetadataFormats.LongDateLongTime:
|
|
612
|
+
return `${longDate} ${longTime}`;
|
|
613
|
+
default:
|
|
614
|
+
return shortDate;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
catch {
|
|
618
|
+
// Fallback: restituisce formato data breve di default
|
|
619
|
+
return 'dd/MM/yyyy';
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
/** Formatta una data secondo MetadataFormats e cultura. */
|
|
623
|
+
export const formatDateTimeByMetadataFormat = (value, format, formatCulture) => {
|
|
624
|
+
try {
|
|
625
|
+
// Fallback sicuro per formatCulture
|
|
626
|
+
const safeCulture = (formatCulture && typeof formatCulture === 'string' && formatCulture.trim()) ? formatCulture.trim() : window.navigator.language;
|
|
627
|
+
const culture = safeCulture.toLowerCase();
|
|
628
|
+
// Culture che includono il giorno della settimana nei formati lunghi
|
|
629
|
+
const includeWeekday = culture === 'it-it' || culture === 'en-us';
|
|
630
|
+
// Opzioni per data lunga (con o senza giorno settimana)
|
|
631
|
+
const longDateOptions = includeWeekday
|
|
632
|
+
? { weekday: "long", year: "numeric", month: "long", day: "numeric" }
|
|
633
|
+
: { year: "numeric", month: "long", day: "numeric" };
|
|
634
|
+
// Opzioni ShortDate: IT usa dd/MM/yyyy, US usa M/d/yyyy (anno a 4 cifre), altri usano dateStyle: 'short'
|
|
635
|
+
const getShortDateOptions = () => {
|
|
636
|
+
if (culture === "it-it")
|
|
637
|
+
return { year: "numeric", month: "2-digit", day: "2-digit" };
|
|
638
|
+
if (culture === "en-us")
|
|
639
|
+
return { year: "numeric", month: "numeric", day: "numeric" };
|
|
640
|
+
return { dateStyle: 'short' };
|
|
641
|
+
};
|
|
642
|
+
switch (format) {
|
|
643
|
+
case MetadataFormats.ShortDate:
|
|
644
|
+
return value.toLocaleString(safeCulture, getShortDateOptions());
|
|
645
|
+
case MetadataFormats.ShortTime:
|
|
646
|
+
return value.toLocaleString(safeCulture, { timeStyle: 'short' });
|
|
647
|
+
case MetadataFormats.ShortDateLongTime:
|
|
648
|
+
if (culture === "it-it")
|
|
649
|
+
return value.toLocaleString(safeCulture, { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit', second: '2-digit' }).replace(',', '');
|
|
650
|
+
if (culture === "en-us")
|
|
651
|
+
return value.toLocaleString(safeCulture, { year: "numeric", month: "numeric", day: "numeric", hour: 'numeric', minute: '2-digit', second: '2-digit' }).replace(',', '');
|
|
652
|
+
return value.toLocaleString(safeCulture, { dateStyle: 'short', timeStyle: 'medium' }).replace(',', '');
|
|
653
|
+
case MetadataFormats.ShortDateShortTime:
|
|
654
|
+
if (culture === "it-it")
|
|
655
|
+
return value.toLocaleString(safeCulture, { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit' }).replace(',', '');
|
|
656
|
+
if (culture === "en-us")
|
|
657
|
+
return value.toLocaleString(safeCulture, { year: "numeric", month: "numeric", day: "numeric", hour: 'numeric', minute: '2-digit' }).replace(',', '');
|
|
658
|
+
return value.toLocaleString(safeCulture, { dateStyle: 'short', timeStyle: 'short' }).replace(',', '');
|
|
659
|
+
case MetadataFormats.LongDate:
|
|
660
|
+
return value.toLocaleString(safeCulture, longDateOptions);
|
|
661
|
+
case MetadataFormats.LongTime:
|
|
662
|
+
return value.toLocaleString(safeCulture, { timeStyle: 'medium' });
|
|
663
|
+
case MetadataFormats.LongDateLongTime: {
|
|
664
|
+
const datePart = value.toLocaleString(safeCulture, longDateOptions);
|
|
665
|
+
const timePart = value.toLocaleString(safeCulture, culture === "en-us" ? { hour: 'numeric', minute: '2-digit', second: '2-digit' } : { hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
666
|
+
return `${datePart} ${timePart}`;
|
|
667
|
+
}
|
|
668
|
+
case MetadataFormats.LongDateShortTime: {
|
|
669
|
+
const datePart = value.toLocaleString(safeCulture, longDateOptions);
|
|
670
|
+
const timePart = value.toLocaleString(safeCulture, culture === "en-us" ? { hour: 'numeric', minute: '2-digit' } : { hour: '2-digit', minute: '2-digit' });
|
|
671
|
+
return `${datePart} ${timePart}`;
|
|
672
|
+
}
|
|
673
|
+
default:
|
|
674
|
+
return value.toLocaleString(safeCulture, getShortDateOptions());
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
catch {
|
|
678
|
+
// Fallback: restituisce la data in formato ISO se la conversione fallisce
|
|
679
|
+
return value?.toISOString?.() ?? String(value);
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
/** Formatta un numero secondo MetadataFormats e cultura. Valute con simbolo e 2 decimali (0 per Yen). */
|
|
683
|
+
export const formatNumberByMetadataFormat = (value, format, formatCulture) => {
|
|
684
|
+
try {
|
|
685
|
+
const numValue = typeof value === 'number' ? value : Number(value);
|
|
686
|
+
if (isNaN(numValue))
|
|
687
|
+
return String(value);
|
|
688
|
+
const currencySymbol = getCurrencySymbol(format);
|
|
689
|
+
if (currencySymbol) {
|
|
690
|
+
const decimals = format === MetadataFormats.CurrencyYen ? 0 : 2;
|
|
691
|
+
return `${currencySymbol} ${numValue.toLocaleString(formatCulture, { useGrouping: true, minimumFractionDigits: decimals, maximumFractionDigits: decimals })}`;
|
|
692
|
+
}
|
|
693
|
+
return numValue.toLocaleString(formatCulture, { useGrouping: format == MetadataFormats.NumberWithThousandsSeparator });
|
|
694
|
+
}
|
|
695
|
+
catch {
|
|
696
|
+
// Fallback: restituisce il valore come stringa se la conversione fallisce
|
|
697
|
+
return String(value);
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
/** Converte un valore in data locale. Restituisce il valore originale se il parsing fallisce. */
|
|
701
|
+
export const safeParseDateToLocaleString = (value) => {
|
|
702
|
+
try {
|
|
703
|
+
if (!value)
|
|
704
|
+
return value ?? '';
|
|
705
|
+
const parsedDate = new Date(value);
|
|
706
|
+
if (!isNaN(parsedDate.getTime())) {
|
|
707
|
+
return parsedDate.toLocaleDateString();
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
catch {
|
|
711
|
+
// Keep original value if parsing fails
|
|
712
|
+
}
|
|
713
|
+
return String(value ?? '');
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Trova un DataColumnDescriptor corrispondente a un dataField (formato TID_MID).
|
|
717
|
+
* Cerca prima per MID nelle extendedProperties, poi per caption.
|
|
718
|
+
*/
|
|
719
|
+
export const findDataColumnByField = (columns, dataField, caption) => {
|
|
720
|
+
// Se l'array di colonne è vuoto/null o il dataField non è definito, ritorna undefined (nessuna corrispondenza possibile)
|
|
721
|
+
if (!columns || !dataField)
|
|
722
|
+
return undefined;
|
|
723
|
+
// Itera sulle colonne cercando la prima che soddisfa i criteri di matching
|
|
724
|
+
return columns.find(c => {
|
|
725
|
+
// Estrae il MID (Metadata ID) dalle proprietà estese della colonna corrente
|
|
726
|
+
const colMid = c.extendedProperties?.["MID"];
|
|
727
|
+
// Se la colonna ha un MID definito, prova a matchare per MID
|
|
728
|
+
if (colMid) {
|
|
729
|
+
// Converte il MID in stringa per il confronto
|
|
730
|
+
const midStr = String(colMid);
|
|
731
|
+
// Verifica se dataField termina con "_MID" (es: "123_456" dove 456 è il MID)
|
|
732
|
+
// oppure se dataField è esattamente uguale al MID (caso in cui dataField contiene solo il MID)
|
|
733
|
+
if (dataField.endsWith(`_${midStr}`) || dataField === midStr)
|
|
734
|
+
return true;
|
|
735
|
+
}
|
|
736
|
+
// Fallback: se il match per MID fallisce, prova a matchare per caption
|
|
737
|
+
// Confronta la caption della colonna con dataField o con il parametro caption opzionale
|
|
738
|
+
return c.caption === dataField || c.caption === caption;
|
|
739
|
+
});
|
|
740
|
+
};
|
|
741
|
+
/**
|
|
742
|
+
* Formatta un valore per l'export in base al tipo di colonna.
|
|
743
|
+
* Gestisce date, numeri e valute secondo il formato definito nella colonna.
|
|
744
|
+
*/
|
|
745
|
+
export const formatValueForExport = (value, dataCol, fallbackDataType) => {
|
|
746
|
+
try {
|
|
747
|
+
let result = value;
|
|
748
|
+
if (dataCol) {
|
|
749
|
+
const { format, formatCulture } = getColumnFormatInfo(dataCol);
|
|
750
|
+
// Date: il valore arriva come stringa e va prima convertito in Date
|
|
751
|
+
if (dataCol.dataType === DataColumnTypes.DateTime && result) {
|
|
752
|
+
const parsedDate = new Date(result);
|
|
753
|
+
if (!isNaN(parsedDate.getTime())) {
|
|
754
|
+
result = formatDateTimeByMetadataFormat(parsedDate, format, formatCulture);
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
// Numeri (incluse valute)
|
|
758
|
+
if (dataCol.dataType === DataColumnTypes.Number && result !== null && result !== undefined && result !== '') {
|
|
759
|
+
result = formatNumberByMetadataFormat(result, format, formatCulture);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
else {
|
|
763
|
+
// Fallback: formattazione base per date
|
|
764
|
+
if (fallbackDataType === 'datetime' && result) {
|
|
765
|
+
result = safeParseDateToLocaleString(result);
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
// Pulisci il valore: rimuovi doppi apici per evitare problemi CSV
|
|
769
|
+
return (result ?? '').toString().replace(/"/g, '');
|
|
770
|
+
}
|
|
771
|
+
catch {
|
|
772
|
+
return String(value ?? '');
|
|
773
|
+
}
|
|
774
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IWacomBiometricData } from "../ts";
|
|
2
|
+
/** Informazioni su una firma grafometrica estratta dal PDF con dati biometrici */
|
|
3
|
+
export interface ExtractedGrafometricSignature {
|
|
4
|
+
biometricData: IWacomBiometricData;
|
|
5
|
+
/** Dati biometrici originali in Base64 (file FSS) */
|
|
6
|
+
originalDataBase64?: string;
|
|
7
|
+
/** Nome file originale dell'attachment */
|
|
8
|
+
originalFileName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Recupera le firme grafometriche dalla cache
|
|
12
|
+
* @param tid - TID del documento
|
|
13
|
+
* @param did - DID del documento
|
|
14
|
+
* @returns Le firme grafometriche se presenti in cache, undefined altrimenti
|
|
15
|
+
*/
|
|
16
|
+
export declare const getGrafometricSignatures: (tid: number, did: number) => ExtractedGrafometricSignature[] | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* Salva le firme grafometriche nella cache
|
|
19
|
+
* @param tid - TID del documento
|
|
20
|
+
* @param did - DID del documento
|
|
21
|
+
* @param signatures - Array delle firme grafometriche da salvare
|
|
22
|
+
*/
|
|
23
|
+
export declare const putGrafometricSignatures: (tid: number, did: number, signatures: ExtractedGrafometricSignature[]) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Rimuove le firme grafometriche di un documento specifico dalla cache
|
|
26
|
+
* @param tid - TID del documento
|
|
27
|
+
* @param did - DID del documento
|
|
28
|
+
* @returns true se l'elemento è stato rimosso, false se non esisteva
|
|
29
|
+
*/
|
|
30
|
+
export declare const removeGrafometricSignatures: (tid: number, did: number) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Verifica se le firme grafometriche di un documento sono in cache
|
|
33
|
+
* @param tid - TID del documento
|
|
34
|
+
* @param did - DID del documento
|
|
35
|
+
* @returns true se presenti in cache, false altrimenti
|
|
36
|
+
*/
|
|
37
|
+
export declare const hasGrafometricSignatures: (tid: number, did: number) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Svuota completamente la cache delle firme grafometriche
|
|
40
|
+
*/
|
|
41
|
+
export declare const clearGrafometricSignaturesCache: () => void;
|
|
42
|
+
/**
|
|
43
|
+
* Restituisce il numero di documenti in cache
|
|
44
|
+
*/
|
|
45
|
+
export declare const getGrafometricSignaturesCacheSize: () => number;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/** Genera una chiave stringa dalla coppia TID/DID */
|
|
2
|
+
const generateKey = (tid, did) => `${tid}_${did}`;
|
|
3
|
+
/** Cache locale per le firme grafometriche */
|
|
4
|
+
const grafometricSignaturesCache = new Map();
|
|
5
|
+
/**
|
|
6
|
+
* Recupera le firme grafometriche dalla cache
|
|
7
|
+
* @param tid - TID del documento
|
|
8
|
+
* @param did - DID del documento
|
|
9
|
+
* @returns Le firme grafometriche se presenti in cache, undefined altrimenti
|
|
10
|
+
*/
|
|
11
|
+
export const getGrafometricSignatures = (tid, did) => {
|
|
12
|
+
const key = generateKey(tid, did);
|
|
13
|
+
return grafometricSignaturesCache.get(key);
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Salva le firme grafometriche nella cache
|
|
17
|
+
* @param tid - TID del documento
|
|
18
|
+
* @param did - DID del documento
|
|
19
|
+
* @param signatures - Array delle firme grafometriche da salvare
|
|
20
|
+
*/
|
|
21
|
+
export const putGrafometricSignatures = (tid, did, signatures) => {
|
|
22
|
+
const key = generateKey(tid, did);
|
|
23
|
+
grafometricSignaturesCache.set(key, signatures);
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Rimuove le firme grafometriche di un documento specifico dalla cache
|
|
27
|
+
* @param tid - TID del documento
|
|
28
|
+
* @param did - DID del documento
|
|
29
|
+
* @returns true se l'elemento è stato rimosso, false se non esisteva
|
|
30
|
+
*/
|
|
31
|
+
export const removeGrafometricSignatures = (tid, did) => {
|
|
32
|
+
const key = generateKey(tid, did);
|
|
33
|
+
return grafometricSignaturesCache.delete(key);
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Verifica se le firme grafometriche di un documento sono in cache
|
|
37
|
+
* @param tid - TID del documento
|
|
38
|
+
* @param did - DID del documento
|
|
39
|
+
* @returns true se presenti in cache, false altrimenti
|
|
40
|
+
*/
|
|
41
|
+
export const hasGrafometricSignatures = (tid, did) => {
|
|
42
|
+
const key = generateKey(tid, did);
|
|
43
|
+
return grafometricSignaturesCache.has(key);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Svuota completamente la cache delle firme grafometriche
|
|
47
|
+
*/
|
|
48
|
+
export const clearGrafometricSignaturesCache = () => {
|
|
49
|
+
grafometricSignaturesCache.clear();
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Restituisce il numero di documenti in cache
|
|
53
|
+
*/
|
|
54
|
+
export const getGrafometricSignaturesCacheSize = () => {
|
|
55
|
+
return grafometricSignaturesCache.size;
|
|
56
|
+
};
|
package/lib/helper/index.d.ts
CHANGED
package/lib/helper/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import React, { RefObject } from "react";
|
|
|
2
2
|
import { DcmtTypeDescriptor, FileFormats, HomeBlogPost, LayoutDescriptor, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, UserDescriptor, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import { IColumnProps } from "devextreme-react/cjs/data-grid";
|
|
4
4
|
import { TMContextMenuItemProps } from '../components/NewComponents/ContextMenu/types';
|
|
5
|
-
import { DcmtInfo, MetadataValueDescriptorEx, SearchResultContext, TaskContext } from "../ts";
|
|
5
|
+
import { DcmtInfo, MetadataValueDescriptorEx, SearchResultContext, TaskContext, IGraphometricManagerProp } from "../ts";
|
|
6
6
|
import { UseCheckInOutOperationsReturn } from "./useCheckInOutOperations";
|
|
7
7
|
import { UseDcmtOperationsReturn } from "./useDcmtOperations";
|
|
8
8
|
import { UseRelatedDocumentsReturn } from "./useRelatedDocuments";
|
|
@@ -62,6 +62,7 @@ export interface UIConfigProps {
|
|
|
62
62
|
showToppyDraggableHelpCenter?: boolean;
|
|
63
63
|
toppyHelpCenterUsePortal?: boolean;
|
|
64
64
|
inputDcmtFormLayoutMode?: LayoutModes;
|
|
65
|
+
graphometricManager?: IGraphometricManagerProp;
|
|
65
66
|
}
|
|
66
67
|
export interface TasksProps {
|
|
67
68
|
allTasks?: Array<TaskDescriptor>;
|
|
@@ -85,7 +85,7 @@ export const useDocumentOperations = (props) => {
|
|
|
85
85
|
const { dataColumns, dataSource, selectedRowKeys, } = exportData ?? {};
|
|
86
86
|
const { visibleItems = [], onRefreshSearchAsyncDatagrid, onRefreshDataRowsAsync, refreshFocusedDataRowAsync, onRefreshBlogDatagrid, onRefreshPreviewDatagrid, refreshOperationsTrigger = 0, onRefreshOperationsDatagrid, } = datagridUtility ?? {};
|
|
87
87
|
const { approvalVID, dcmtDataRowForCicoStatus, selectedDcmtSearchResultRelations, dcmtTIDHasDetailRelations = false, dcmtTIDHasMasterRelations = false, updateCurrentDcmt, onCloseDcmtForm, onRefreshBlogForm, onRefreshPreviewForm, taskFormDialogComponent, s4TViewerDialogComponent } = dcmtUtility ?? {};
|
|
88
|
-
const { floatingBarContainerRef, customButtonsLayout, workingGroupContext, openS4TViewer = false, openDcmtFormAsModal = false, showDcmtFormSidebar = true, allowFloatingBar = true, enablePinIcons = true, allowRelations = true, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, editPdfForm = false, inputDcmtFormLayoutMode = LayoutModes.Update, } = uiConfig;
|
|
88
|
+
const { floatingBarContainerRef, customButtonsLayout, workingGroupContext, openS4TViewer = false, openDcmtFormAsModal = false, showDcmtFormSidebar = true, allowFloatingBar = true, enablePinIcons = true, allowRelations = true, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, editPdfForm = false, inputDcmtFormLayoutMode = LayoutModes.Update, graphometricManager, } = uiConfig;
|
|
89
89
|
const { allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback } = tasks;
|
|
90
90
|
const {
|
|
91
91
|
// Refresh operations (data consistency)
|
|
@@ -175,6 +175,9 @@ export const useDocumentOperations = (props) => {
|
|
|
175
175
|
const openMasterDcmtsModalHandler = (value) => { setIsOpenMasterModal(value); };
|
|
176
176
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
177
177
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
178
|
+
// State to control signature info modal
|
|
179
|
+
const [showSignatureInfoModal, setShowSignatureInfoModal] = useState(false);
|
|
180
|
+
const [signatureInfoDcmt, setSignatureInfoDcmt] = useState(undefined);
|
|
178
181
|
const updateShowApprovePopup = (value) => {
|
|
179
182
|
setShowApprovePopup(value);
|
|
180
183
|
};
|
|
@@ -243,14 +246,8 @@ export const useDocumentOperations = (props) => {
|
|
|
243
246
|
});
|
|
244
247
|
return;
|
|
245
248
|
}
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
buttons: [ButtonNames.OK],
|
|
249
|
-
showToppy: false,
|
|
250
|
-
resizable: true,
|
|
251
|
-
initialWidth: !isMobile ? '700px' : undefined,
|
|
252
|
-
message: _jsx(TMSignatureInfoContent, { inputDcmt: inputDcmts[0] })
|
|
253
|
-
});
|
|
249
|
+
setSignatureInfoDcmt(inputDcmts[0]);
|
|
250
|
+
setShowSignatureInfoModal(true);
|
|
254
251
|
}
|
|
255
252
|
catch (error) {
|
|
256
253
|
console.error(error);
|
|
@@ -552,8 +549,8 @@ export const useDocumentOperations = (props) => {
|
|
|
552
549
|
if (!currentDcmt)
|
|
553
550
|
return;
|
|
554
551
|
const cacheKey = `${currentDcmt.TID}-${currentDcmt.DID}`;
|
|
555
|
-
|
|
556
|
-
|
|
552
|
+
// Invalida sempre la cache (file preview/download e firme grafometriche)
|
|
553
|
+
removeDcmtsFileCache(cacheKey);
|
|
557
554
|
await onRefreshPreviewCallback();
|
|
558
555
|
await onRefreshDataRowsAsync?.();
|
|
559
556
|
};
|
|
@@ -912,7 +909,7 @@ export const useDocumentOperations = (props) => {
|
|
|
912
909
|
name: SDKUI_Localizator.ArchiveDetailDocument,
|
|
913
910
|
operationType: 'multiRow',
|
|
914
911
|
disabled: canArchiveDetailRelation !== true,
|
|
915
|
-
onClick: async () => await archiveDetailDocuments
|
|
912
|
+
onClick: async () => await archiveDetailDocuments(selectedDcmtInfos?.[0]?.TID)
|
|
916
913
|
},
|
|
917
914
|
{
|
|
918
915
|
id: 'rel-mst',
|
|
@@ -1383,7 +1380,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1383
1380
|
refreshFocusedDataRowAsync,
|
|
1384
1381
|
onRefreshBlogDatagrid,
|
|
1385
1382
|
onRefreshPreviewDatagrid
|
|
1386
|
-
}, fetchRemoteCertificates: fetchRemoteCertificates })) }), (showHistory && dtd && selectedDcmtInfos.length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: dtd, deviceType: deviceType, inputDcmt: selectedDcmtInfos[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && selectedDcmtInfos.length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: selectedDcmtInfos[0].TID, did: selectedDcmtInfos[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: onRefreshBlog, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(selectedDcmtInfos[0].DID)] }), (showCheckoutInformationForm && dtd && selectedDcmtInfos.length > 0) &&
|
|
1383
|
+
}, fetchRemoteCertificates: fetchRemoteCertificates, graphometricManager: graphometricManager })) }), (showHistory && dtd && selectedDcmtInfos.length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: dtd, deviceType: deviceType, inputDcmt: selectedDcmtInfos[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && selectedDcmtInfos.length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: selectedDcmtInfos[0].TID, did: selectedDcmtInfos[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: onRefreshBlog, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(selectedDcmtInfos[0].DID)] }), (showCheckoutInformationForm && dtd && selectedDcmtInfos.length > 0) &&
|
|
1387
1384
|
_jsx(TMDcmtCheckoutInfoForm, { dtdName: dtd.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: selectedDcmtInfos[0], onClose: hideCheckoutInformationFormCallback }), isOpenDetailsModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenDetailsModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetailsModal(false) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { ...masterDetailDetailsCommonProps, onBack: () => setIsOpenDetails(false) }) }), isOpenMasterModal && _jsx(TMModal, { width: "95%", height: "95%", onClose: () => setIsOpenMasterModal(false), title: SDKUI_Localizator.Relations, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMasterModal(false) }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, onBack: () => setIsOpenMaster(false) }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
1388
1385
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { ...masterDetailMasterCommonProps, inputDcmts: [dcmt], allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID) }) }, `${index}-${dcmt.DID}`));
|
|
1389
1386
|
})] }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
@@ -1397,7 +1394,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1397
1394
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
1398
1395
|
setArchiveRelatedDcmtFormMids([]);
|
|
1399
1396
|
await onRefreshSearchAsyncDatagrid?.();
|
|
1400
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, openFileUploaderPdfEditor: openFileUploaderPdfEditor, showTodoDcmtForm: showTodoDcmtForm }), showRelatedDcmtsChooser &&
|
|
1397
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar, openFileUploaderPdfEditor: openFileUploaderPdfEditor, showTodoDcmtForm: showTodoDcmtForm, graphometricManager: graphometricManager }), showRelatedDcmtsChooser &&
|
|
1401
1398
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
1402
1399
|
try {
|
|
1403
1400
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -1443,7 +1440,10 @@ export const useDocumentOperations = (props) => {
|
|
|
1443
1440
|
updateBatchUpdateForm(false);
|
|
1444
1441
|
setIsModifiedBatchUpdate(false);
|
|
1445
1442
|
await onRefreshDataRowsAsync?.();
|
|
1446
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'mergeToPdf' && _jsx(TMMergeToPdfForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, selectedItemsFull: selectedItemsFull, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'copyToFolder' && _jsx(TMCopyToFolderForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), _jsx(FileSourceDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })
|
|
1443
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'mergeToPdf' && _jsx(TMMergeToPdfForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, selectedItemsFull: selectedItemsFull, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), openCopyToFolderForm.open && openCopyToFolderForm.operationType === 'copyToFolder' && _jsx(TMCopyToFolderForm, { mode: openCopyToFolderForm.mode, selectedDcmtInfos: selectedDcmtInfos, onClose: () => setOpenCopyToFolderForm({ open: false, operationType: 'copyToFolder', mode: 'onlySelected' }), showTMRelationViewer: showTMRelationViewerInCopyToFolderForm, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), _jsx(FileSourceDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) }), showSignatureInfoModal && signatureInfoDcmt && (_jsx(TMSignatureInfoContent, { inputDcmt: signatureInfoDcmt, graphometricManager: graphometricManager, onClose: () => {
|
|
1444
|
+
setShowSignatureInfoModal(false);
|
|
1445
|
+
setSignatureInfoDcmt(undefined);
|
|
1446
|
+
} }))] }));
|
|
1447
1447
|
return {
|
|
1448
1448
|
operationItems: operationItems(),
|
|
1449
1449
|
renderFloatingBar,
|
|
@@ -3,13 +3,24 @@ const usePreventFileDrop = (allowedDropZones) => {
|
|
|
3
3
|
useEffect(() => {
|
|
4
4
|
const isOverAllowedZone = (event) => allowedDropZones.some((ref) => ref.current?.contains(event.target));
|
|
5
5
|
const handleDragOver = (event) => {
|
|
6
|
-
if (
|
|
6
|
+
if (isOverAllowedZone(event)) {
|
|
7
|
+
// Riafferma "copy" ad ogni dragover: altrimenti un "none"
|
|
8
|
+
// impostato mentre si era fuori zona resta e mostra "not-allowed"
|
|
9
|
+
if (event.dataTransfer)
|
|
10
|
+
event.dataTransfer.dropEffect = "copy";
|
|
11
|
+
document.body.style.cursor = "default";
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
7
14
|
event.preventDefault();
|
|
8
|
-
event.dataTransfer
|
|
15
|
+
if (event.dataTransfer)
|
|
16
|
+
event.dataTransfer.dropEffect = "none";
|
|
9
17
|
}
|
|
10
18
|
};
|
|
11
19
|
const handleDragEnter = (event) => {
|
|
12
|
-
if (
|
|
20
|
+
if (isOverAllowedZone(event)) {
|
|
21
|
+
document.body.style.cursor = "default";
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
13
24
|
document.body.style.cursor = "not-allowed";
|
|
14
25
|
}
|
|
15
26
|
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export interface IWacomBiometricData {
|
|
2
|
+
/** Nome del firmatario */
|
|
3
|
+
signatureName: string;
|
|
4
|
+
/** Motivo della firma */
|
|
5
|
+
reasonForSigning: string;
|
|
6
|
+
/** Data e ora della firma (timestamp) */
|
|
7
|
+
dateTime: number;
|
|
8
|
+
/** Data e ora formattata */
|
|
9
|
+
dateTimeFormatted: string;
|
|
10
|
+
/** Tipo di digitalizzatore (es. "Wacom STU-540") */
|
|
11
|
+
digitizerType: string;
|
|
12
|
+
/** Driver del digitalizzatore */
|
|
13
|
+
digitizerDriver: string;
|
|
14
|
+
/** Sistema operativo */
|
|
15
|
+
operatingSystem: string;
|
|
16
|
+
/** Scheda di rete (Network Interface Card) */
|
|
17
|
+
networkInterfaceCard: string;
|
|
18
|
+
/** Immagine della firma in formato Base64 (PNG) */
|
|
19
|
+
signatureImage: string;
|
|
20
|
+
/** Stato integrità firma (OK, FAIL, MISSING, WRONG_TYPE, INSUFFICIENT_DATA, UNCERTAIN, NOT_SUPPORTED) */
|
|
21
|
+
integrityStatus: string;
|
|
22
|
+
/** Messaggio di warning sull'integrità (se presente) */
|
|
23
|
+
integrityWarning?: string;
|
|
24
|
+
/** Stato della firma (GOOD, NO_HASH, BAD_TYPE, BAD_HASH, ERROR, UNCERTAIN, SIG_MOVED) */
|
|
25
|
+
dataStatus: string;
|
|
26
|
+
/** Messaggio di warning sui dati (se presente) */
|
|
27
|
+
dataWarning?: string;
|
|
28
|
+
/** Dati aggiuntivi specifici del contesto */
|
|
29
|
+
extraData?: Record<string, string>;
|
|
30
|
+
}
|
|
31
|
+
export type IWacomBiometricResult = {
|
|
32
|
+
success: true;
|
|
33
|
+
data: IWacomBiometricData;
|
|
34
|
+
} | {
|
|
35
|
+
success: false;
|
|
36
|
+
error: string;
|
|
37
|
+
};
|
|
38
|
+
export interface ISignatureRenderConfig {
|
|
39
|
+
width?: number;
|
|
40
|
+
height?: number;
|
|
41
|
+
format?: "image/png" | "image/jpeg";
|
|
42
|
+
inkWidth?: number;
|
|
43
|
+
inkColor?: string;
|
|
44
|
+
backgroundColor?: string;
|
|
45
|
+
}
|
|
46
|
+
export type ExtractBiometricDataFn = (signatures: string[]) => Promise<IWacomBiometricResult[]>;
|
|
47
|
+
export interface IGraphometricManagerProp {
|
|
48
|
+
extractGraphometricAttachments(pdfFile: File): Promise<{
|
|
49
|
+
fileName?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
mimeType?: string | undefined;
|
|
52
|
+
creationDate?: Date | undefined;
|
|
53
|
+
modificationDate?: Date | undefined;
|
|
54
|
+
size?: number;
|
|
55
|
+
dataBase64?: string | undefined;
|
|
56
|
+
}[]>;
|
|
57
|
+
extractBiometricData: ExtractBiometricDataFn;
|
|
58
|
+
downloadDecryptedPngWithBiometricData: (attachment: {
|
|
59
|
+
dataBase64: string;
|
|
60
|
+
fileName?: string | undefined;
|
|
61
|
+
}) => Promise<void>;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/ts/index.d.ts
CHANGED
package/lib/ts/index.js
CHANGED