@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.3
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/TMAlert.js +6 -8
- package/lib/components/base/TMAreaManager.js +53 -55
- package/lib/components/base/TMButton.js +4 -2
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +219 -219
- package/lib/components/base/TMPanel.js +173 -170
- package/lib/components/base/TMSpinner.d.ts +2 -1
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTabControl.d.ts +5 -0
- package/lib/components/base/TMTabControl.js +18 -7
- package/lib/components/base/TMTreeView.js +20 -0
- package/lib/components/base/TMWaitPanel.js +1 -1
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.d.ts +12 -0
- package/lib/components/base/waitPanel/TMWaitPanelConfirm.js +185 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.d.ts +169 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +320 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +53 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +274 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/editors/TMTextBox.d.ts +4 -0
- package/lib/components/editors/TMTextBox.js +99 -11
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +29 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1384 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/assistant/dataset/Designer-Suggested-Questions.json +102 -0
- package/lib/components/features/assistant/dataset/Login-Suggested-Questions.json +32 -0
- package/lib/components/features/assistant/dataset/Surfer-Suggested-Questions.json +102 -0
- package/lib/components/features/documents/TMBatchUpdateForm.js +3 -4
- package/lib/components/features/documents/TMCopyToFolderForm.js +53 -84
- package/lib/components/features/documents/TMDcmtForm.js +50 -61
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -3
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMFileUploader.js +26 -26
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +2 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.js +53 -148
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +49 -54
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +1 -1
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.js +3 -3
- package/lib/components/features/documents/TMRelationViewer.d.ts +13 -14
- package/lib/components/features/documents/TMRelationViewer.js +206 -143
- package/lib/components/features/documents/relationTreeState.d.ts +32 -0
- package/lib/components/features/documents/relationTreeState.js +89 -0
- package/lib/components/features/search/TMSearch.js +3 -4
- package/lib/components/features/search/TMSearchQueryPanel.js +0 -4
- package/lib/components/features/search/TMSearchResult.d.ts +5 -0
- package/lib/components/features/search/TMSearchResult.js +39 -19
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.js +14 -25
- package/lib/components/features/tasks/TMTasksView.js +91 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +91 -91
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +92 -96
- package/lib/components/index.d.ts +5 -1
- package/lib/components/index.js +4 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +16 -15
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
- package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +6 -0
- package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
- package/lib/components/pages/TMPage.js +29 -31
- package/lib/components/query/TMQueryEditor.d.ts +3 -0
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/sidebar/TMHeader.d.ts +1 -0
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Globals.d.ts +3 -0
- package/lib/helper/SDKUI_Globals.js +3 -0
- package/lib/helper/SDKUI_Localizator.d.ts +21 -0
- package/lib/helper/SDKUI_Localizator.js +210 -0
- package/lib/helper/ZipManager.d.ts +1 -1
- package/lib/helper/ZipManager.js +2 -1
- package/lib/helper/dcmtsHelper.d.ts +2 -0
- package/lib/helper/dcmtsHelper.js +3 -1
- package/lib/hooks/useCheckInOutOperations.d.ts +0 -6
- package/lib/hooks/useCheckInOutOperations.js +14 -34
- package/lib/hooks/useDcmtOperations.d.ts +3 -19
- package/lib/hooks/useDcmtOperations.js +160 -222
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +14 -25
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +65 -67
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +36 -6
- package/lib/services/caseflow/CaseFlowService.js +55 -14
- package/package.json +69 -69
|
@@ -13,7 +13,8 @@ import ShowAlert from '../../base/TMAlert';
|
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
15
15
|
import TMSpinner, { Spinner } from '../../base/TMSpinner';
|
|
16
|
-
import
|
|
16
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
17
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
17
18
|
import TMDistinctValues from '../../choosers/TMDistinctValues';
|
|
18
19
|
import TMFormulaEditor, { FormulaDescriptor, FormulaHelper, FormulaTargets } from '../../editors/TMFormulaEditor';
|
|
19
20
|
import TMMetadataValues, { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
|
@@ -64,17 +65,6 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
64
65
|
const { onRefreshSearchAsyncDatagrid, onRefreshBlogDatagrid, onRefreshPreviewDatagrid } = datagridUtility || {};
|
|
65
66
|
const floatingBarContainerRef = useRef(null);
|
|
66
67
|
const [id, setID] = useState('');
|
|
67
|
-
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
68
|
-
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
69
|
-
const [showPrimaryLocal, setShowPrimaryLocal] = useState(false);
|
|
70
|
-
const [waitPanelTextPrimaryLocal, setWaitPanelTextPrimaryLocal] = useState('');
|
|
71
|
-
const [waitPanelValuePrimaryLocal, setWaitPanelValuePrimaryLocal] = useState(0);
|
|
72
|
-
const [waitPanelMaxValuePrimaryLocal, setWaitPanelMaxValuePrimaryLocal] = useState(0);
|
|
73
|
-
const [showSecondaryLocal, setShowSecondaryLocal] = useState(false);
|
|
74
|
-
const [waitPanelTextSecondaryLocal, setWaitPanelTextSecondaryLocal] = useState('');
|
|
75
|
-
const [waitPanelValueSecondaryLocal, setWaitPanelValueSecondaryLocal] = useState(0);
|
|
76
|
-
const [waitPanelMaxValueSecondaryLocal, setWaitPanelMaxValueSecondaryLocal] = useState(0);
|
|
77
|
-
const [useWaitPanelLocalState, setUseWaitPanelLocalState] = useState(false);
|
|
78
68
|
const [formData, setFormData] = useState([]);
|
|
79
69
|
const [formDataOrig, setFormDataOrig] = useState([]);
|
|
80
70
|
const [validationItems, setValidationItems] = useState([]);
|
|
@@ -469,7 +459,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
469
459
|
openTaskFormHandler,
|
|
470
460
|
},
|
|
471
461
|
});
|
|
472
|
-
const { handleSignApprove,
|
|
462
|
+
const { handleSignApprove, relatedDocumentsInfo: { isOpenDetails, isOpenMaster, canArchiveDetailRelation, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, }, toppyOperations: { updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup } } = features;
|
|
473
463
|
useEffect(() => {
|
|
474
464
|
const fetchAllUsers = async () => {
|
|
475
465
|
const users = await UserListCacheService.GetAllAsync();
|
|
@@ -970,15 +960,15 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
970
960
|
}
|
|
971
961
|
}, [DID, TID, getSpecificChangedKeysWithValues, refreshMetadataAsync, onSavedAsyncCallback, onClose]);
|
|
972
962
|
const handleArchiveCompleted = useCallback(async () => {
|
|
973
|
-
let firstBlock = true;
|
|
974
|
-
let maxFileSize = 0;
|
|
975
963
|
let operationTitle = SDKUI_Localizator.Archiving;
|
|
976
|
-
setUseWaitPanelLocalState(true);
|
|
977
|
-
setShowWaitPanelLocal(true);
|
|
978
|
-
setShowPrimaryLocal(false);
|
|
979
|
-
setShowSecondaryLocal(true);
|
|
980
|
-
setWaitPanelTitleLocal(operationTitle);
|
|
981
964
|
abortControllerLocal = new AbortController();
|
|
965
|
+
// Interrompi solo sopra il megabyte: sotto, l'upload finisce prima che serva.
|
|
966
|
+
const panel = TMWaitPanelManager.show({
|
|
967
|
+
title: operationTitle,
|
|
968
|
+
showCounters: false,
|
|
969
|
+
cancelable: (dcmtFileRef.current?.size ?? 0) >= 1000000,
|
|
970
|
+
onAbort: () => abortControllerLocal.abort(),
|
|
971
|
+
});
|
|
982
972
|
const ae = new ArchiveEngineByID(SDK_Globals.tmSession);
|
|
983
973
|
ae.TID = TID;
|
|
984
974
|
ae.Metadata_ClearAll();
|
|
@@ -1014,42 +1004,41 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1014
1004
|
sharedDcmt.did = sharedSourceDID;
|
|
1015
1005
|
ae.SharedDcmt = sharedDcmt;
|
|
1016
1006
|
}
|
|
1007
|
+
// Fase 1: upload del file, la barra segue i byte.
|
|
1017
1008
|
let newDID = await ae.ArchiveAsync(abortControllerLocal.signal, (pd) => {
|
|
1018
|
-
|
|
1019
|
-
maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
1020
|
-
setWaitPanelMaxValueSecondaryLocal(maxFileSize);
|
|
1021
|
-
firstBlock = false;
|
|
1022
|
-
}
|
|
1023
|
-
setWaitPanelValueSecondaryLocal(pd.ProgressBarValue);
|
|
1024
|
-
setWaitPanelTextSecondaryLocal(`${SDKUI_Localizator.Archiving}... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`);
|
|
1009
|
+
const maxFileSize = pd.ProgressBarMaximum ?? 0;
|
|
1025
1010
|
if (pd.ProgressBarValue === pd.ProgressBarMaximum) {
|
|
1026
|
-
//
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
firstBlock = true;
|
|
1011
|
+
// Upload finito: fase 2 sulla stessa barra, tre passi, gia' al 20%.
|
|
1012
|
+
panel.update({
|
|
1013
|
+
title: SDKUI_Localizator.ArchivingCompletionInProgress,
|
|
1014
|
+
subtitle: SDKUI_Localizator.ArchivingCompletionInProgress,
|
|
1015
|
+
value: 0.6,
|
|
1016
|
+
max: 3,
|
|
1017
|
+
});
|
|
1018
|
+
return;
|
|
1035
1019
|
}
|
|
1020
|
+
panel.update({
|
|
1021
|
+
value: pd.ProgressBarValue,
|
|
1022
|
+
max: maxFileSize,
|
|
1023
|
+
subtitle: `${SDKUI_Localizator.Archiving}... ${Globalization.getNumberDisplayValue(pd.ProgressBarValue, true)} / ${Globalization.getNumberDisplayValue(maxFileSize, true)}`,
|
|
1024
|
+
});
|
|
1036
1025
|
});
|
|
1037
1026
|
// Aggiorna lo stato locale immediatamente dopo il salvataggio riuscito
|
|
1038
1027
|
// Questo garantisce che isModified diventi false anche se il reload fallisce
|
|
1039
1028
|
const savedFormData = structuredClone(formDataRef.current);
|
|
1040
1029
|
setFormDataOrig(savedFormData);
|
|
1041
1030
|
formDataOrigRef.current = savedFormData;
|
|
1042
|
-
// Fase 2: Completamento archiviazione (la
|
|
1031
|
+
// Fase 2: Completamento archiviazione (la barra a tre passi è già visibile dal callback)
|
|
1043
1032
|
// Imposta il titolo anche qui per sicurezza, nel caso il callback non venga eseguito
|
|
1044
|
-
|
|
1033
|
+
panel.update({ title: SDKUI_Localizator.ArchivingCompletionInProgress, max: 3 });
|
|
1045
1034
|
// Step 1/3: Aggiornamento griglia di ricerca
|
|
1046
|
-
|
|
1035
|
+
panel.setValue(1);
|
|
1047
1036
|
await onRefreshSearchAsyncDatagrid?.();
|
|
1048
1037
|
// Step 2/3: Callback di salvataggio
|
|
1049
|
-
|
|
1038
|
+
panel.setValue(2);
|
|
1050
1039
|
await onSavedAsyncCallback?.(ae.TID, newDID);
|
|
1051
1040
|
// Step 3/3: Aggiornamento lista metadati
|
|
1052
|
-
|
|
1041
|
+
panel.setValue(3);
|
|
1053
1042
|
// Usa fromDTDRef.current invece di fromDTD per evitare stale closure,
|
|
1054
1043
|
// garantendo di avere il descrittore del tipo documento corrente.
|
|
1055
1044
|
await setMetadataList(fromDTDRef.current?.metadata ?? [], undefined, true, newDID);
|
|
@@ -1072,8 +1061,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1072
1061
|
return undefined;
|
|
1073
1062
|
}
|
|
1074
1063
|
finally {
|
|
1075
|
-
|
|
1076
|
-
setUseWaitPanelLocalState(false);
|
|
1064
|
+
panel.close();
|
|
1077
1065
|
}
|
|
1078
1066
|
}, [TID, connectorFileSave, onSavedAsyncCallback, onSaveRecents, onClose, DID, setMetadataList, handleReset, layoutMode, isSharedDcmt]);
|
|
1079
1067
|
// Messaggio di conferma dell'archiviazione in base al vincolo del tipo documento (ArchiveConstraints).
|
|
@@ -1678,23 +1666,23 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1678
1666
|
height: '100%',
|
|
1679
1667
|
position: 'relative',
|
|
1680
1668
|
overflow: 'hidden'
|
|
1681
|
-
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) &&
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1669
|
+
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsxs(TMLayoutContainer, { direction: 'vertical', children: [(groupId && groupId.length > 0)
|
|
1670
|
+
? _jsxs(_Fragment, { children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] })
|
|
1671
|
+
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile && layoutMode !== LayoutModes.Ark ? hasSavedLayout() : false, persistPanelStates: !isMobile && layoutMode !== LayoutModes.Ark ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: layoutMode !== LayoutModes.Ark ? getPersistedPanelStates() : undefined, children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled, persistedWFVisible: persistedWFVisibleRef.current }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1672
|
+
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onClosePanelCallback: () => setIsOpenDistinctValues(false), onSelectionChanged: (e) => {
|
|
1673
|
+
if (!e)
|
|
1674
|
+
return;
|
|
1675
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
|
1676
|
+
} }), isOpenFormulaEditor &&
|
|
1677
|
+
_jsx(TMFormulaEditor, { isModal: true, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
|
1678
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
|
1679
|
+
setFocusedMetadataValue(prevState => ({
|
|
1680
|
+
...prevState,
|
|
1681
|
+
isSelected: true,
|
|
1682
|
+
isEditable: true,
|
|
1683
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1684
|
+
}));
|
|
1685
|
+
} }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), _jsx(TMToppyDraggableHelpCenter, { isVisible: isToppyVisible, content: _jsx(TMDcmtFormActionButtons, { showToppyForApprove: showToppyForApprove, workItems: workItems, caseFlowWorkItems: showToppyForCaseFlow ? caseFlowWorkItems : [], onCompleteCaseFlowWorkItem: completeCaseFlowWorkItem, onRejectCaseFlowWorkItem: rejectCaseFlowWorkItem, deviceType: deviceType, isMobile: isMobile, handleSignApprove: handleSignApprove, updateShowApprovePopup: updateShowApprovePopup, updateShowRejectPopup: updateShowRejectPopup, updateShowReAssignPopup: updateShowReAssignPopup, updateShowMoreInfoPopup: updateShowMoreInfoPopup, fromDTD: fromDTD, showToppyForCompleteMoreInfo: showToppyForCompleteMoreInfo, moreInfoTasks: moreInfoTasks, setShowCommentForm: setShowCommentForm, showToppyForReferences: showToppyForReferences, dcmtReferences: dcmtReferences, referenceActionMap: referenceActionMap, handleNavigateToReference: handleNavigateToReference, setShowMoreInfoTaskPopup: setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask: setShowMoreInfoTaskTask }) })] }), (showCommentForm && TID && DID) &&
|
|
1698
1686
|
_jsx(TMBlogCommentForm, { maxLength: 500, context: blogCommentFormContext, onClose: handleBlogCommentFormClose, onCustomSave: onBlogCommentFormCustomSave, participants: emptyParticipants, showAttachmentsSection: false, allArchivedDocumentsFileItems: emptyArchivedDocumentsFileItems })] }), renderDcmtOperations, renderFloatingBar] }));
|
|
1699
1687
|
};
|
|
1700
1688
|
return (_jsxs("div", { style: (isModal && onClose) ? { width: 0, height: 0 } : { width: '100%', height: '100%' }, children: [(isModal && onClose)
|
|
@@ -1783,7 +1771,8 @@ const validateCustomRegEx = (mvd, value, validationItems) => {
|
|
|
1783
1771
|
const regex = new RegExp(`^(?:${pattern})$`);
|
|
1784
1772
|
if (!regex.test(value)) {
|
|
1785
1773
|
const fieldName = mvd.md?.nameLoc ?? mvd.md?.name ?? SDKUI_Localizator.Field;
|
|
1786
|
-
const
|
|
1774
|
+
const description = mvd.md?.description?.trim();
|
|
1775
|
+
const message = description ? description : SDKUI_Localizator.InvalidFormatValue;
|
|
1787
1776
|
validationItems.push(new ValidationItem(ResultTypes.ERROR, fieldName, message));
|
|
1788
1777
|
}
|
|
1789
1778
|
}
|
|
@@ -14,8 +14,6 @@ interface ITMDcmtIconProps {
|
|
|
14
14
|
tooltipContent?: JSX.Element | string;
|
|
15
15
|
openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
|
|
16
16
|
onDownloadDcmtsAsync?: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>;
|
|
17
|
-
/** Se true, renderizza il wait panel nel body tramite Portal (centrato a schermo intero) */
|
|
18
|
-
usePortal?: boolean;
|
|
19
17
|
}
|
|
20
|
-
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync
|
|
18
|
+
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync }: ITMDcmtIconProps) => React.JSX.Element;
|
|
21
19
|
export default TMDcmtIcon;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useMemo } from 'react';
|
|
3
|
-
import { createPortal } from 'react-dom';
|
|
4
3
|
import styled from 'styled-components';
|
|
5
4
|
import { getFileIcon } from '../../../helper';
|
|
6
5
|
import TMTooltip from '../../base/TMTooltip';
|
|
7
6
|
import { DownloadTypes } from '../../../ts';
|
|
8
7
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
8
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
|
-
import { TMWaitPanel } from '../../base/TMWaitPanel';
|
|
11
9
|
const StyledCellRenderDcmtIcon = styled.div `
|
|
12
10
|
display: flex;
|
|
13
11
|
flex-direction: row;
|
|
@@ -16,8 +14,8 @@ const StyledCellRenderDcmtIcon = styled.div `
|
|
|
16
14
|
overflow: visible;
|
|
17
15
|
position: relative;
|
|
18
16
|
`;
|
|
19
|
-
const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, openInOffice, onDownloadDcmtsAsync
|
|
20
|
-
const { downloadDcmtsAsync
|
|
17
|
+
const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode = "none", tooltipContent, openInOffice, onDownloadDcmtsAsync }) => {
|
|
18
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
21
19
|
const deviceType = useDeviceType();
|
|
22
20
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
23
21
|
const icon = useMemo(() => {
|
|
@@ -59,7 +57,7 @@ const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isS
|
|
|
59
57
|
: deviceType === DeviceType.MOBILE
|
|
60
58
|
? { onClick: handleDownloadAction } // Su mobile, un singolo click sull'icona avvia il download
|
|
61
59
|
: { onDoubleClick: handleDownloadAction } // Su desktop, un doppio click sull'icona avvia il download
|
|
62
|
-
), children: [icon, isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })
|
|
60
|
+
), children: [icon, isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) })] }));
|
|
63
61
|
};
|
|
64
62
|
export default TMDcmtIcon;
|
|
65
63
|
function IconLexProtLock(props) {
|
|
@@ -9,7 +9,7 @@ import { TMColors } from '../../../utils/theme';
|
|
|
9
9
|
import ShowAlert from '../../base/TMAlert';
|
|
10
10
|
import TMButton from '../../base/TMButton';
|
|
11
11
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
12
|
-
import
|
|
12
|
+
import TMLayoutContainer from '../../base/TMLayout';
|
|
13
13
|
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
|
14
14
|
import { StyledAnimatedComponentOpacity } from '../../base/Styled';
|
|
15
15
|
import TMPanel from '../../base/TMPanel';
|
|
@@ -28,7 +28,7 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
28
28
|
const [isFromCache, setIsFromCache] = useState(false);
|
|
29
29
|
const [error, setError] = useState('');
|
|
30
30
|
const [isAbortError, setIsAbortError] = useState(false);
|
|
31
|
-
const {
|
|
31
|
+
const { getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache } = useDcmtOperations();
|
|
32
32
|
const isBasketMode = !!(dcmtData?.btid !== undefined && dcmtData?.bid !== undefined && dcmtData?.bfid !== undefined);
|
|
33
33
|
const getCacheKey = () => {
|
|
34
34
|
if (!dcmtData)
|
|
@@ -80,6 +80,8 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
80
80
|
setLastLoadedDid(currentCacheKey);
|
|
81
81
|
}, [dcmtData?.tid, dcmtData?.did, isVisible, hasLoadedDataOnce, lastLoadedDid]);
|
|
82
82
|
const loadBasketFile = async () => {
|
|
83
|
+
// Il recupero dal basket non passa da useDcmtOperations: ha il suo AbortController.
|
|
84
|
+
const abortController = new AbortController();
|
|
83
85
|
try {
|
|
84
86
|
// Check cache first
|
|
85
87
|
if (dcmtsFileCachePreview.has(cacheKey)) {
|
|
@@ -187,7 +189,7 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
|
|
|
187
189
|
{ icon: _jsx(IconCloseCircle, {}), name: SDKUI_Localizator.RemoveFromCache, onClick: () => { removeDcmtsFileCache(cacheKey); setIsFromCache(false); } },
|
|
188
190
|
{ icon: _jsx(IconClear, {}), name: SDKUI_Localizator.ClearCache, onClick: () => { clearDcmtsFileCache(); setIsFromCache(false); } },
|
|
189
191
|
], [cacheKey, removeDcmtsFileCache, clearDcmtsFileCache, setIsFromCache]);
|
|
190
|
-
return (_jsx(
|
|
192
|
+
return (_jsx(TMLayoutContainer, { direction: 'vertical', children: _jsx(TMPanel, { padding: '0', title: titleHandler(), onClose: onClosePanel, onBack: onBack, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [onPrev && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), onNext && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(StyledHeaderIcon, { $color: TMColors.primaryColor, children: _jsx(ContextMenu, { items: cacheMenuItems, trigger: "left", children: _jsx(IconMenuVertical, {}) }) }), _jsx(StyledHeaderIcon, { onClick: reOpenDcmt, $color: TMColors.primaryColor, children: _jsx(TMTooltip, { content: SDKUI_Localizator.ReopenDocument, children: _jsx(IconRefresh, {}) }) })] }), children: error
|
|
191
193
|
? _jsx(ErrorContent, { error: error, isAbortError: isAbortError, onRetry: reOpenDcmt })
|
|
192
194
|
: renderedPreview(dcmtData?.tid, dcmtData?.did, dcmtData?.fileExt, dcmtData?.fileSize, dcmtData?.fileCount, extensionHandler(dcmtData?.fileExt), showPreview, isResizingActive, () => { isBasketMode ? loadBasketFile() : loadDocumentWithCache(); setShowPreview(true); }, dcmtBlob, isBasketMode) }) }));
|
|
193
195
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { SDKUI_Localizator } from "../../../helper";
|
|
4
4
|
import { DeviceType, useDeviceType } from "../../base/TMDeviceProvider";
|
|
5
5
|
import { useTMPanelManagerContext } from "../../layout/panelManager/TMPanelManagerContext";
|
|
6
6
|
import TMPanel from "../../base/TMPanel";
|
|
@@ -12,13 +12,6 @@ const TMDcmtTasks = (props) => {
|
|
|
12
12
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
13
13
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
14
14
|
const { togglePanelVisibility, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
icon: _jsx(IconRefresh, {}),
|
|
18
|
-
onClick: async () => await getAllTasks(),
|
|
19
|
-
text: SDKUI_Localizator.Refresh,
|
|
20
|
-
},
|
|
21
|
-
], children: _jsx(IconMenuVertical, { id: "TMTaksPanel-Commands-Header", color: 'white', cursor: 'pointer' }) }), []);
|
|
22
|
-
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, toolbar: toolbar, onBack: onBack, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs ? handleNavigateToWGs : () => { return Promise.resolve(); }, handleNavigateToDossiers: handleNavigateToDossiers ? handleNavigateToDossiers : () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
15
|
+
return _jsx("div", { style: { width: "100%", height: "100%", position: 'relative' }, children: _jsx(TMPanel, { title: SDKUI_Localizator.Widget_Activities, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onClose: countVisibleLeafPanels() > 1 ? () => togglePanelVisibility("tmDcmtTasks") : undefined, onMaximize: countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmDcmtTasks") : undefined, onRefresh: getAllTasks, onBack: onBack, children: _jsx(TMTasksPanelContent, { id: "dcmtTasks", taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs ? handleNavigateToWGs : () => { return Promise.resolve(); }, handleNavigateToDossiers: handleNavigateToDossiers ? handleNavigateToDossiers : () => { return Promise.resolve(); }, afterTaskSaved: afterTaskSaved }) }) });
|
|
23
16
|
};
|
|
24
17
|
export default TMDcmtTasks;
|
|
@@ -29,6 +29,7 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
29
29
|
const [fileSize, setFileSize] = useState(undefined);
|
|
30
30
|
const [fileExt, setFileExt] = useState(undefined);
|
|
31
31
|
const uploaderRef = useRef(null);
|
|
32
|
+
const fileInputRef = useRef(null);
|
|
32
33
|
// Ref al TMPanel per chiamare focusPanel()
|
|
33
34
|
const fileUploaderPanelRef = useRef(null);
|
|
34
35
|
usePreventFileDrop([uploaderRef]);
|
|
@@ -85,19 +86,18 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
85
86
|
setFileSize(undefined);
|
|
86
87
|
setFileExt(undefined);
|
|
87
88
|
onFileUpload?.(null);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
fileInput.value = '';
|
|
89
|
+
if (fileInputRef.current) {
|
|
90
|
+
fileInputRef.current.value = '';
|
|
91
91
|
}
|
|
92
92
|
//Rifocalizza dopo la cancellazione del file
|
|
93
93
|
if (refocus)
|
|
94
94
|
refocusAfterFileInput();
|
|
95
95
|
}, [onFileUpload, refocusAfterFileInput]);
|
|
96
96
|
const browseHandler = useCallback(() => {
|
|
97
|
-
|
|
97
|
+
fileInputRef.current?.click();
|
|
98
98
|
}, []);
|
|
99
99
|
let content = !uploadedFile ?
|
|
100
|
-
_jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, {
|
|
100
|
+
_jsxs("div", { style: { display: 'flex', gap: 10, width: '100%', height: '100%' }, children: [_jsx(HiddenInput, { ref: fileInputRef, type: "file", onChange: handleInputChange }), _jsxs(UploadContainer, { ref: uploaderRef, tabIndex: 0, onDragOver: handleDragOver, onDragLeave: handleDragLeave, onDrop: handleDrop, style: { backgroundColor: dragOver ? '#76b1e6' : 'white' }, onDoubleClick: browseHandler, $isRequired: isRequired, children: [_jsxs("div", { style: { display: 'flex', gap: '10px', flexDirection: 'column', position: 'absolute', right: 5, top: 5 }, children: [_jsx(TMButton, { btnStyle: 'icon', caption: 'Sfoglia', color: isRequired && !uploadedFile ? 'error' : 'primary', onClick: browseHandler, icon: _jsx(IconFolderOpen, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { onScanRequest((file) => { onFileUpload?.(file); }); }, icon: _jsx(IconScanner, { fontSize: 22 }) }), showScannerIcon && isScannerLicenseConfigured() && !onScanRequest && _jsx(TMButton, { btnStyle: 'icon', caption: 'Scanner', color: 'primary', onClick: () => { ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' }); }, icon: _jsx(IconScanner, { fontSize: 22 }) })] }), _jsx("p", { style: { fontSize: '1.2rem', fontWeight: 'bold' }, children: deviceType === DeviceType.MOBILE ? SDKUI_Localizator.ClickToBrowseFile : SDKUI_Localizator.DragOrDoubleClickToBrowseFile }), isRequired && _jsxs("p", { style: { fontWeight: 'bold' }, children: [" ", SDKUI_Localizator.RequiredField, " "] })] })] }) :
|
|
101
101
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 10, width: '100%', height: '100%' }, children: [_jsxs("div", { style: { backgroundColor: 'white', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.primaryColor }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 5 }, children: [_jsx("p", { children: "File name:" }), _jsxs("div", { style: { fontWeight: 'bold' }, children: [fileName, " ", _jsxs("span", { children: [" ", ` (${formatBytes(fileSize)})`, " "] })] })] }), uploadedFile && _jsx(TMButton, { btnStyle: 'icon', color: 'error', caption: 'Pulisci', onClick: () => clearFile(true), icon: _jsx(IconClear, { fontSize: 22 }) })] }), extensionHandler(fileExt) === FileExtensionHandler.READY_TO_SHOW ? _jsx(TMFileViewer, { fileBlob: uploadedFile, isResizingActive: isResizingActive }) :
|
|
102
102
|
_jsx("div", { style: { backgroundColor: '#f6dbdb', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.error }, children: _jsxs("div", { children: [" ", SDKUI_Localizator.PreviewNotAvailable, fileExt && _jsx("b", { children: ` (*.${fileExt})` })] }) })] });
|
|
103
103
|
const innerContent = (_jsxs("div", { style: { width: '100%', height: '100%', padding: '2px', display: 'flex', flexDirection: 'column', gap: 10 }, children: [enableDragDropOverlay && _jsx(TMDragDropOverlay, { handleFile: handleFile, refocusAfterFileInput: refocusAfterFileInput }), content] }));
|
|
@@ -112,27 +112,27 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
112
112
|
}, [deviceType, fromDTD, onClose]);
|
|
113
113
|
return showTMPanel ? (_jsx(TMPanel, { ref: fileUploaderPanelRef, panelID: 'file-uploader-panel', title: SDKUI_Localizator.FileUpload, onBack: deviceType === DeviceType.MOBILE ? () => onClose?.() : undefined, toolbar: toolbar, children: innerContent })) : (innerContent);
|
|
114
114
|
};
|
|
115
|
-
const UploadContainer = styled.div `
|
|
116
|
-
position: relative;
|
|
117
|
-
display: flex;
|
|
118
|
-
align-items: center;
|
|
119
|
-
justify-content: center;
|
|
120
|
-
flex-direction: column;
|
|
121
|
-
gap: 5px;
|
|
122
|
-
border: 2px dashed ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
123
|
-
/* max-height: 100px; */
|
|
124
|
-
width: 100%;
|
|
125
|
-
height: 100%;
|
|
126
|
-
border-radius: 8px;
|
|
127
|
-
padding: 30px;
|
|
128
|
-
text-align: center;
|
|
129
|
-
color: ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
130
|
-
transition: background-color 0.3s;
|
|
131
|
-
&:hover {
|
|
132
|
-
background-color: #658cab;
|
|
133
|
-
}
|
|
115
|
+
const UploadContainer = styled.div `
|
|
116
|
+
position: relative;
|
|
117
|
+
display: flex;
|
|
118
|
+
align-items: center;
|
|
119
|
+
justify-content: center;
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
gap: 5px;
|
|
122
|
+
border: 2px dashed ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
123
|
+
/* max-height: 100px; */
|
|
124
|
+
width: 100%;
|
|
125
|
+
height: 100%;
|
|
126
|
+
border-radius: 8px;
|
|
127
|
+
padding: 30px;
|
|
128
|
+
text-align: center;
|
|
129
|
+
color: ${props => props.$isRequired ? () => TMColors.error : () => TMColors.primaryColor};
|
|
130
|
+
transition: background-color 0.3s;
|
|
131
|
+
&:hover {
|
|
132
|
+
background-color: #658cab;
|
|
133
|
+
}
|
|
134
134
|
`;
|
|
135
|
-
const HiddenInput = styled.input `
|
|
136
|
-
display: none;
|
|
135
|
+
const HiddenInput = styled.input `
|
|
136
|
+
display: none;
|
|
137
137
|
`;
|
|
138
138
|
export default TMFileUploader;
|
|
@@ -22,6 +22,8 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
|
22
22
|
onNext?: () => void;
|
|
23
23
|
onPrev?: () => void;
|
|
24
24
|
onBack?: () => void;
|
|
25
|
+
/** Invocato quando il calcolo iniziale delle correlazioni è finito */
|
|
26
|
+
onFirstLoadCompleted?: () => void;
|
|
25
27
|
appendMasterDcmts?: (tid: number | undefined, did: number | undefined) => void;
|
|
26
28
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
27
29
|
onRefreshAfterAddDcmtToFavs?: () => void;
|