@topconsultnpm/sdkui-react 6.22.0-dev3.9 → 6.22.0-dev4.10
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/NewComponents/ContextMenu/styles.d.ts +43 -45
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +60 -67
- package/lib/components/base/Styled.d.ts +77 -93
- 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/TMCounterBar.d.ts +2 -2
- package/lib/components/base/TMCounterContainer.d.ts +4 -3
- package/lib/components/base/TMCounterContainer.js +16 -1
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +40 -48
- package/lib/components/base/TMDataGrid.js +243 -223
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -2
- package/lib/components/base/TMFileManager.d.ts +1 -2
- package/lib/components/base/TMFileManagerDataGridView.d.ts +1 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +1 -1
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +1 -1
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -4
- package/lib/components/base/TMLayout.d.ts +4 -4
- package/lib/components/base/TMList.d.ts +1 -2
- package/lib/components/base/TMListView.d.ts +1 -1
- package/lib/components/base/TMPanel.js +173 -170
- package/lib/components/base/TMSpinner.d.ts +3 -3
- package/lib/components/base/TMSpinner.js +9 -7
- package/lib/components/base/TMTab.d.ts +3 -4
- package/lib/components/base/TMTabControl.d.ts +5 -0
- package/lib/components/base/TMTabControl.js +219 -208
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTreeView.d.ts +8 -14
- package/lib/components/base/TMTreeView.js +20 -0
- package/lib/components/base/TMUserAvatar.d.ts +1 -2
- package/lib/components/base/TMVilViewer.d.ts +1 -2
- package/lib/components/base/TMWaitPanel.d.ts +2 -3
- 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 +179 -0
- package/lib/components/base/waitPanel/TMWaitPanelManager.js +373 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.d.ts +57 -0
- package/lib/components/base/waitPanel/TMWaitPanelView.js +346 -0
- package/lib/components/base/waitPanel/index.d.ts +1 -0
- package/lib/components/base/waitPanel/index.js +1 -0
- package/lib/components/choosers/TMDistinctValues.js +3 -3
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMInvoiceRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMOrderRetrieveFormats.d.ts +1 -2
- package/lib/components/choosers/TMPathChooser.js +17 -34
- package/lib/components/choosers/TMQuickSearchInfo.d.ts +1 -2
- package/lib/components/choosers/TMRelationChooser.d.ts +3 -3
- package/lib/components/choosers/TMUserChooser.d.ts +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -20
- package/lib/components/editors/TMFormulaEditor.d.ts +1 -1
- package/lib/components/editors/TMHtmlContentDisplay.d.ts +1 -2
- package/lib/components/editors/TMHtmlEditor.d.ts +1 -2
- package/lib/components/editors/TMTextBox.d.ts +4 -0
- package/lib/components/editors/TMTextBox.js +99 -11
- package/lib/components/editors/TMTreeDropDown.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +7 -2
- package/lib/components/features/assistant/TMHelpOnLineChat.d.ts +28 -0
- package/lib/components/features/assistant/TMHelpOnLineChat.js +1231 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +1 -1
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +2 -2
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +1 -2
- 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/TMDcmtFormActionButtons.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtIcon.d.ts +1 -4
- package/lib/components/features/documents/TMDcmtIcon.js +3 -5
- package/lib/components/features/documents/TMDcmtPreview.d.ts +6 -8
- package/lib/components/features/documents/TMDcmtPreview.js +5 -3
- package/lib/components/features/documents/TMDcmtTasks.d.ts +1 -2
- package/lib/components/features/documents/TMDcmtTasks.js +2 -9
- package/lib/components/features/documents/TMDragDropOverlay.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +5 -5
- 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.d.ts +1 -2
- package/lib/components/features/documents/TMMasterInfoFields.js +3 -2
- package/lib/components/features/documents/TMMergeToPdfForm.d.ts +1 -2
- package/lib/components/features/documents/TMMergeToPdfForm.js +52 -56
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.d.ts +1 -2
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsForm.js +14 -15
- package/lib/components/features/documents/TMMultiMasterDetailDcmtsUtils.d.ts +5 -5
- 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/TMDcmtCheckoutInfoForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataOutputForm.d.ts +1 -2
- package/lib/components/features/search/TMMetadataSorterForm.d.ts +1 -2
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +2 -2
- package/lib/components/features/search/TMSearch.d.ts +1 -2
- package/lib/components/features/search/TMSearch.js +3 -4
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -9
- 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 +129 -102
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +1 -2
- package/lib/components/features/search/TMTreeSelector.js +23 -27
- package/lib/components/features/search/TMViewHistoryDcmt.d.ts +1 -2
- package/lib/components/features/search/TMViewHistoryDcmt.js +15 -26
- package/lib/components/features/tasks/TMTaskForm.d.ts +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.d.ts +10 -10
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksHeader.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksPanelContent.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.d.ts +5 -5
- package/lib/components/features/tasks/TMTasksView.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksView.js +97 -90
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +2 -3
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +95 -91
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +7 -8
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -3
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -3
- package/lib/components/forms/Login/Chooser.d.ts +2 -2
- package/lib/components/forms/TMChooserForm.d.ts +1 -2
- package/lib/components/forms/TMResultDialog.js +1 -1
- package/lib/components/forms/TMSaveForm.d.ts +4 -4
- package/lib/components/grids/TMBlogAttachments.d.ts +1 -2
- package/lib/components/grids/TMBlogHeader.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.d.ts +1 -1
- package/lib/components/grids/TMBlogsPost.js +93 -97
- package/lib/components/grids/TMBlogsPostUtils.d.ts +9 -9
- package/lib/components/grids/TMValidationItemsList.d.ts +1 -2
- package/lib/components/index.d.ts +5 -1
- package/lib/components/index.js +4 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -2
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +4 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.d.ts +3 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +5 -1
- package/lib/components/layout/panelManager/TMPanelManagerLoader.d.ts +5 -0
- package/lib/components/layout/panelManager/TMPanelManagerLoader.js +18 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +6 -5
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +4 -8
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.d.ts +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerWithPersistenceProvider.js +2 -1
- package/lib/components/layout/panelManager/TMPanelWrapper.d.ts +2 -2
- package/lib/components/pages/TMPage.d.ts +1 -1
- package/lib/components/pages/TMPage.js +32 -31
- package/lib/components/query/TMQueryEditor.d.ts +13 -14
- package/lib/components/query/TMQueryEditor.js +2 -1
- package/lib/components/settings/SettingsAppearance.d.ts +1 -2
- package/lib/components/sidebar/TMAboutApp.d.ts +1 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -4
- package/lib/components/sidebar/TMHeader.d.ts +4 -3
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +2 -3
- package/lib/components/viewers/TMMidViewer.d.ts +2 -2
- package/lib/components/viewers/TMTidViewer.d.ts +2 -2
- package/lib/helper/Enum_Localizator.js +1 -0
- package/lib/helper/SDKUI_Globals.d.ts +7 -2
- package/lib/helper/SDKUI_Globals.js +7 -2
- package/lib/helper/SDKUI_Localizator.d.ts +31 -6
- package/lib/helper/SDKUI_Localizator.js +301 -51
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -2
- package/lib/helper/TMAppUpdatedModal.js +93 -93
- package/lib/helper/TMCommandsContextMenu.d.ts +1 -1
- package/lib/helper/TMIcons.d.ts +280 -280
- package/lib/helper/TMPdfViewer.d.ts +1 -2
- package/lib/helper/TMToppyMessage.d.ts +2 -2
- package/lib/helper/TMUtils.d.ts +4 -10
- 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/helper/helpers.d.ts +1 -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 +174 -227
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +14 -25
- package/lib/hooks/useInputDialog.d.ts +1 -2
- package/lib/hooks/useMultiMasterDetailDcmts.d.ts +0 -15
- package/lib/hooks/useMultiMasterDetailDcmts.js +70 -68
- package/lib/hooks/usePreventFileDrop.js +9 -0
- package/lib/hooks/useWorkflowApprove.js +33 -17
- package/lib/services/caseflow/CaseFlowService.d.ts +69 -9
- package/lib/services/caseflow/CaseFlowService.js +126 -58
- package/lib/services/platform_services.d.ts +2 -3
- package/package.json +2 -2
|
@@ -11,5 +11,5 @@ interface TMToppyDraggableHelpCenterProps {
|
|
|
11
11
|
/** Callback chiamato quando si clicca sull'immagine di Toppy */
|
|
12
12
|
onToppyImageClick?: () => void;
|
|
13
13
|
}
|
|
14
|
-
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) =>
|
|
14
|
+
declare const TMToppyDraggableHelpCenter: (props: TMToppyDraggableHelpCenterProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default TMToppyDraggableHelpCenter;
|
|
@@ -60,7 +60,7 @@ const TMToppyButton = styled.div.attrs((props) => ({
|
|
|
60
60
|
height: ${(props) => props.$isCollapsed ? '56px' : '110px'};
|
|
61
61
|
max-width: 100%;
|
|
62
62
|
max-height: 100%;
|
|
63
|
-
z-index:
|
|
63
|
+
z-index: 2147483600;
|
|
64
64
|
background-color: ${(props) => props.$isCollapsed ? '#ffffff' : 'transparent'};
|
|
65
65
|
border: ${(props) => props.$isCollapsed ? '3px solid #3b82f6' : 'none'};
|
|
66
66
|
border-radius: ${(props) => props.$isCollapsed ? '50%' : '0'};
|
|
@@ -130,7 +130,7 @@ const DragOverlay = styled.div `
|
|
|
130
130
|
left: 0;
|
|
131
131
|
right: 0;
|
|
132
132
|
bottom: 0;
|
|
133
|
-
z-index:
|
|
133
|
+
z-index: 2147483599;
|
|
134
134
|
cursor: grabbing;
|
|
135
135
|
`;
|
|
136
136
|
const TMToppyDraggableHelpCenter = (props) => {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { BlogPost, UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
2
|
import { FileItem } from '../../base/TMFileManagerUtils';
|
|
4
3
|
import { TMBlogContextDescriptor } from '../../grids/TMBlogsPostUtils';
|
|
@@ -19,5 +18,5 @@ interface TMBlogCommentFormProps {
|
|
|
19
18
|
/** External save handler - when provided, bypasses internal engine logic */
|
|
20
19
|
onCustomSave?: (blogPost: BlogPost) => Promise<void>;
|
|
21
20
|
}
|
|
22
|
-
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) =>
|
|
21
|
+
declare const TMBlogCommentForm: (props: TMBlogCommentFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
export default TMBlogCommentForm;
|
|
@@ -6,11 +6,10 @@ import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
|
6
6
|
import { DcmtOperationTypes, FormModes } from '../../../ts';
|
|
7
7
|
import { StyledToolbarCardContainer, StyledFormButtonsContainer } from '../../base/Styled';
|
|
8
8
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
9
|
-
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
9
|
+
import TMLayoutContainer, { TMSplitterLayout } from '../../base/TMLayout';
|
|
10
10
|
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
11
11
|
import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
|
|
12
12
|
import TMSpinner from '../../base/TMSpinner';
|
|
13
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
14
13
|
import TMDistinctValues from '../../choosers/TMDistinctValues';
|
|
15
14
|
import TMFormulaEditor, { FormulaDescriptor, FormulaHelper, FormulaTargets } from '../../editors/TMFormulaEditor';
|
|
16
15
|
import { useMetadataEditableList } from '../../editors/TMMetadataEditor';
|
|
@@ -28,7 +27,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
28
27
|
const [showFormulaEditor, setShowFormulaEditor] = useState(false);
|
|
29
28
|
const [focusedMetadataValue, setFocusedMetadataValue] = useState();
|
|
30
29
|
const [addOrRemoveEditableList] = useMetadataEditableList();
|
|
31
|
-
const {
|
|
30
|
+
const { runOperationAsync } = useDcmtOperations();
|
|
32
31
|
const deviceType = useDeviceType();
|
|
33
32
|
useEffect(() => {
|
|
34
33
|
if (!TID)
|
|
@@ -131,7 +130,7 @@ const TMBatchUpdateForm = ({ inputDcmts, TID, DID, isExpertMode = SDKUI_Globals.
|
|
|
131
130
|
});
|
|
132
131
|
};
|
|
133
132
|
const renderContent = () => {
|
|
134
|
-
return (_jsx(
|
|
133
|
+
return (_jsx(TMLayoutContainer, { children: _jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorColor: 'transparent', separatorActiveColor: 'transparent', showSeparator: showFormulaEditor, start: showFormulaEditor ? ['50%', '50%'] : ['100%', '0%'], min: ['0', '0'], children: [_jsx(TMPanel, { title: isModal ? 'Modifica i metadati' : `${SDKUI_Localizator.BatchUpdate} (${inputDcmts.length} documenti selezionati)`, onBack: deviceType === DeviceType.MOBILE ? handleClose : undefined, allowMaximize: !isModal, showHeader: !isModal, children: _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, isExpertMode: isExpertMode, showCheckBoxes: ShowCheckBoxesMode.Always, showNullValueCheckBoxes: true, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, validationItems: validationItems, isOpenDistinctValues: showDistinctValuesPanel, selectedMID: focusedMetadataValue?.mid, onFocusedItemChanged: (item) => { setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
135
134
|
setMetadataValues((prevItems) => prevItems.map((item) => {
|
|
136
135
|
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
|
137
136
|
return newItem ? { ...item, ...newItem } : item;
|
|
@@ -13,36 +13,26 @@ import TMOrderRetrieveFormats from '../../choosers/TMOrderRetrieveFormats';
|
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import { ButtonNames, TMMessageBoxManager } from '../../base/TMPopUp';
|
|
15
15
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
16
|
-
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
17
16
|
import { TMSplitterLayout } from '../../base/TMLayout';
|
|
17
|
+
import TMWaitPanelManager from '../../base/waitPanel/TMWaitPanelManager';
|
|
18
18
|
import TMCheckBox from '../../editors/TMCheckBox';
|
|
19
19
|
import ShowAlert from '../../base/TMAlert';
|
|
20
20
|
import { TMColors } from '../../../utils/theme';
|
|
21
21
|
import TMDownloadRelationViewerSection from './TMDownloadRelationViewerSection';
|
|
22
22
|
import { buildInitialDownloadSettings, fileExists, generateTargetFileName, generateUniqueFileName, getDcmtInfosToDownload, getFloatingLabelStyle, isDirectoryPickerSupported, } from './copyAndMergeDcmtsShared';
|
|
23
|
-
/**
|
|
24
|
-
* Numero di documenti scaricati in parallelo.
|
|
25
|
-
* I file vengono consumati via callback (scrittura su cartella o raccolta per lo ZIP),
|
|
26
|
-
* quindi il parallelismo è sicuro; l'ordine finale è garantito a valle del download.
|
|
27
|
-
*/
|
|
28
|
-
const COPY_DOWNLOAD_CONCURRENCY = 5;
|
|
29
23
|
/**
|
|
30
24
|
* Form per la copia/zip dei documenti in una cartella locale.
|
|
31
25
|
* Logica condivisa con TMMergeToPdfForm è esternalizzata in copyAndMergeDcmtsShared
|
|
32
26
|
* e TMDownloadRelationViewerSection.
|
|
33
27
|
*/
|
|
34
28
|
const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationViewer, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
35
|
-
|
|
29
|
+
// Il wait panel del download lo apre e lo aggiorna l'hook: qui serve solo la funzione.
|
|
30
|
+
const { downloadDcmtsAsync } = useDcmtOperations();
|
|
36
31
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
37
32
|
const deviceType = useDeviceType();
|
|
38
33
|
// ---- Stato dei settings ----
|
|
39
34
|
const [settings, setSettings] = useState(() => buildInitialDownloadSettings(SDKUI_Globals.userSettings.documentDownloadSettings, SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat, SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat));
|
|
40
35
|
const [selectedItemsRelationViewer, setSelectedItemsRelationViewer] = useState([]);
|
|
41
|
-
// ---- Stato per la creazione ZIP (spinner separato) ----
|
|
42
|
-
const [isCreatingZip, setIsCreatingZip] = useState(false);
|
|
43
|
-
const [zipProgressText, setZipProgressText] = useState('');
|
|
44
|
-
const [zipProgressValue, setZipProgressValue] = useState(0);
|
|
45
|
-
const [zipProgressMax, setZipProgressMax] = useState(0);
|
|
46
36
|
const [hasSavedLayout, setHasSavedLayout] = useState(() => {
|
|
47
37
|
const saved = SDKUI_Globals.userSettings.documentDownloadSettings;
|
|
48
38
|
const defaults = new DocumentDownloadSettings();
|
|
@@ -117,23 +107,9 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
117
107
|
const handleSeparatorChange = (e) => {
|
|
118
108
|
updateSettings('separatorChar', e.target.value.slice(0, 1));
|
|
119
109
|
};
|
|
120
|
-
// ---- Serializzazione delle scritture su filesystem ----
|
|
121
|
-
// I download sono paralleli, le scritture no: fileExists/generateUniqueFileName/
|
|
122
|
-
// getFileHandle sono check-then-act sulla stessa cartella e due scritture contemporanee
|
|
123
|
-
// potrebbero sovrascriversi o calcolare lo stesso nome "univoco".
|
|
124
|
-
const writeChainRef = useRef(Promise.resolve());
|
|
125
|
-
const runExclusive = (action) => {
|
|
126
|
-
const result = writeChainRef.current.then(action);
|
|
127
|
-
// La catena non deve interrompersi se una scrittura fallisce: l'errore viene
|
|
128
|
-
// comunque propagato al chiamante tramite il promise restituito.
|
|
129
|
-
writeChainRef.current = result.catch(() => undefined);
|
|
130
|
-
return result;
|
|
131
|
-
};
|
|
132
110
|
// ---- Scrittura file nel filesystem locale ----
|
|
133
111
|
const writeFileToFolder = async (file, dcmtInfo) => {
|
|
134
112
|
try {
|
|
135
|
-
// Fuori dal lock: con la denominazione da metadati questa fa una chiamata al
|
|
136
|
-
// server per documento e deve poter andare in parallelo agli altri download.
|
|
137
113
|
const baseFileName = await generateTargetFileName(file, dcmtInfo, {
|
|
138
114
|
fileNamingMode: settings.fileNamingMode,
|
|
139
115
|
separatorChar: settings.separatorChar,
|
|
@@ -152,29 +128,25 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
152
128
|
URL.revokeObjectURL(url);
|
|
153
129
|
return;
|
|
154
130
|
}
|
|
155
|
-
// Dentro il lock: controllo esistenza, calcolo del nome univoco e scrittura
|
|
156
|
-
// devono restare un'unica operazione atomica sulla cartella.
|
|
157
131
|
const folderHandle = folderHandleRef.current;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
132
|
+
let targetFileName = baseFileName;
|
|
133
|
+
const exists = await fileExists(folderHandle, targetFileName);
|
|
134
|
+
if (exists) {
|
|
135
|
+
switch (settings.fileExistsMode) {
|
|
136
|
+
case 'skip':
|
|
137
|
+
return;
|
|
138
|
+
case 'rename':
|
|
139
|
+
targetFileName = await generateUniqueFileName(folderHandle, targetFileName);
|
|
140
|
+
break;
|
|
141
|
+
case 'overwrite':
|
|
142
|
+
default:
|
|
143
|
+
break;
|
|
172
144
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
145
|
+
}
|
|
146
|
+
const fileHandle = await folderHandle.getFileHandle(targetFileName, { create: true });
|
|
147
|
+
const writable = await fileHandle.createWritable();
|
|
148
|
+
await writable.write(file);
|
|
149
|
+
await writable.close();
|
|
178
150
|
}
|
|
179
151
|
catch (err) {
|
|
180
152
|
console.error('Errore nella scrittura del file:', err);
|
|
@@ -202,10 +174,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
202
174
|
retrieveOptions.invoiceRetrieveFormat = settings.invoiceFormat ?? SDKUI_Globals.userSettings.searchSettings.invoiceRetrieveFormat;
|
|
203
175
|
retrieveOptions.orderRetrieveFormat = settings.orderFormat ?? SDKUI_Globals.userSettings.searchSettings.orderRetrieveFormat;
|
|
204
176
|
if (settings.exportMode === 'copy') {
|
|
205
|
-
|
|
206
|
-
// in quel caso si resta sequenziali, perché il browser blocca i click ravvicinati.
|
|
207
|
-
const copyConcurrency = folderHandleRef.current ? COPY_DOWNLOAD_CONCURRENCY : 1;
|
|
208
|
-
await downloadDcmtsAsync({ inputDcmts: dcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: writeFileToFolder, skipConfirmation: true, retrieveOptions, useCache: false, downloadConcurrency: copyConcurrency });
|
|
177
|
+
await downloadDcmtsAsync({ inputDcmts: dcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: writeFileToFolder, skipConfirmation: true, retrieveOptions, useCache: false });
|
|
209
178
|
}
|
|
210
179
|
else if (settings.exportMode === 'zip') {
|
|
211
180
|
const fileNameCounts = new Map();
|
|
@@ -220,9 +189,8 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
220
189
|
const ext = dotIndex > 0 ? fileName.substring(dotIndex) : '';
|
|
221
190
|
return `${baseName} (${count})${ext}`;
|
|
222
191
|
};
|
|
223
|
-
//
|
|
224
|
-
//
|
|
225
|
-
// nell'ordine di selezione, così i suffissi di deduplica restano quelli sequenziali.
|
|
192
|
+
// I file scaricati si raccolgono in mappa (nome incluso) e l'archivio viene costruito
|
|
193
|
+
// dopo, nell'ordine di selezione, così i suffissi di deduplica restano coerenti.
|
|
226
194
|
const downloadedEntries = new Map();
|
|
227
195
|
const collectFileForZip = async (file, dcmtInfo) => {
|
|
228
196
|
const targetFileName = await generateTargetFileName(file, dcmtInfo, {
|
|
@@ -231,7 +199,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
231
199
|
});
|
|
232
200
|
downloadedEntries.set(`${dcmtInfo.TID}_${dcmtInfo.DID}`, { file, targetFileName });
|
|
233
201
|
};
|
|
234
|
-
await downloadDcmtsAsync({ inputDcmts: dcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForZip, skipConfirmation: true, retrieveOptions, useCache: false
|
|
202
|
+
await downloadDcmtsAsync({ inputDcmts: dcmtInfosToDownload, downloadType: DownloadTypes.Dcmt, downloadMode: 'download', onFileDownloaded: collectFileForZip, skipConfirmation: true, retrieveOptions, useCache: false });
|
|
235
203
|
const zipEntries = [];
|
|
236
204
|
for (const dcmtInfo of dcmtInfosToDownload) {
|
|
237
205
|
const entry = downloadedEntries.get(`${dcmtInfo.TID}_${dcmtInfo.DID}`);
|
|
@@ -243,18 +211,19 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
243
211
|
const zipFileName = settings.zipFileName.trim().toLowerCase().endsWith('.zip')
|
|
244
212
|
? settings.zipFileName.trim()
|
|
245
213
|
: settings.zipFileName.trim() + '.zip';
|
|
246
|
-
// Crea il blob ZIP
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
214
|
+
// Crea il blob ZIP: la compressione non e' interrompibile, quindi niente Interrompi.
|
|
215
|
+
const zipPanel = TMWaitPanelManager.show({
|
|
216
|
+
title: SDKUI_Localizator.CompressToZipFile,
|
|
217
|
+
subtitle: SDKUI_Localizator.CompressToZipFile,
|
|
218
|
+
max: zipEntries.length,
|
|
219
|
+
showCounters: false,
|
|
220
|
+
});
|
|
251
221
|
try {
|
|
252
222
|
const zipBlob = await ZipManager.createZip(zipEntries, {
|
|
253
223
|
compressionLevel: 6,
|
|
254
224
|
password: settings.zipPassword.trim() || undefined,
|
|
255
225
|
onProgress: (current, total, filename) => {
|
|
256
|
-
|
|
257
|
-
setZipProgressText(`${SDKUI_Localizator.CompressToZipFile}: ${filename}`);
|
|
226
|
+
zipPanel.update({ value: current, subtitle: `${SDKUI_Localizator.CompressToZipFile}: ${filename}` });
|
|
258
227
|
},
|
|
259
228
|
});
|
|
260
229
|
// Se c'è un handle della cartella: salva direttamente nella cartella selezionata
|
|
@@ -286,7 +255,7 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
286
255
|
ShowAlert({ message: SDKUI_Localizator.Error, mode: 'error', duration: 5000, title: SDKUI_Localizator.CompressToZipFile });
|
|
287
256
|
}
|
|
288
257
|
finally {
|
|
289
|
-
|
|
258
|
+
zipPanel.close();
|
|
290
259
|
}
|
|
291
260
|
}
|
|
292
261
|
}
|
|
@@ -416,25 +385,25 @@ const TMCopyToFolderForm = ({ mode, selectedDcmtInfos, onClose, showTMRelationVi
|
|
|
416
385
|
{ value: 'skip', display: SDKUI_Localizator.DoNotCopy },
|
|
417
386
|
{ value: 'rename', display: SDKUI_Localizator.CopyButRename },
|
|
418
387
|
], value: isUsingDefaultDownloads ? 'rename' : settings.fileExistsMode, direction: "row", disabled: isUsingDefaultDownloads, onValueChanged: (value) => updateSettings('fileExistsMode', value), fontSize: '0.9rem' }) }), isUsingDefaultDownloads && (_jsx("span", { style: { fontSize: '0.8rem', color: '#888', fontStyle: 'italic', marginTop: '4px', display: 'block' }, children: SDKUI_Localizator.BrowserAutoRenamesDuplicateFilesInDownloadsFolder }))] }) }), fileNamingRow, formatSelectorsRow] })), settings.exportMode === 'zip' && (_jsxs("div", { style: { display: 'flex', flexWrap: 'wrap', columnGap: '10px' }, children: [_jsxs("div", { style: { display: 'flex', flexWrap: 'wrap', columnGap: '10px', width: '100%' }, children: [folderSelector, _jsx("div", { style: { flex: '1 1 280px', minWidth: '280px' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.ZipFileName, value: settings.zipFileName, validationItems: zipValidationItems, autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipFileName', e.target.value) }) }), _jsx("div", { style: { flex: '1 1 280px', minWidth: '280px' }, children: _jsx(TMTextBox, { label: SDKUI_Localizator.ProtectWithPasswordOptional, value: settings.zipPassword, type: "password", autoComplete: "one-time-code", onValueChanged: (e) => updateSettings('zipPassword', e.target.value) }) })] }), fileNamingRow, formatSelectorsRow] }))] })] }));
|
|
419
|
-
return (_jsx(
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
388
|
+
return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, showTMRelationViewer ? '95%' : '950px', '95%', '95%'), height: showTMRelationViewer ? '95%' : 'auto', title: getTitle(), onClose: onClose, showCloseButton: true, children: _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { display: 'flex', flexDirection: 'column', padding: '4px 4px 16px 4px', width: '100%', height: '100%', boxSizing: 'border-box', overflow: 'hidden' }, children: [showTMRelationViewer ? (_jsx("div", { style: { flex: 1, minHeight: 0, display: 'flex', flexDirection: 'column' }, children: _jsxs(TMSplitterLayout, { direction: 'vertical', showSeparator: true, separatorSize: 8, separatorColor: 'transparent', separatorActiveColor: 'transparent', overflow: 'hidden', min: ["50", "50"], start: ['65%', '35%'], children: [_jsx(TMDownloadRelationViewerSection, { selectedDcmtInfos: selectedDcmtInfos, onSelectionChanged: setSelectedItemsRelationViewer, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), configSection] }, "TMCopyToFolder-relation-config") })) : (configSection), _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center', flexShrink: 0, marginTop: '12px' }, children: _jsxs("button", { disabled: !isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0), onClick: run, style: {
|
|
389
|
+
display: 'flex',
|
|
390
|
+
alignItems: 'center',
|
|
391
|
+
justifyContent: 'center',
|
|
392
|
+
gap: '6px',
|
|
393
|
+
padding: '8px 20px',
|
|
394
|
+
fontSize: '0.95rem',
|
|
395
|
+
fontWeight: 600,
|
|
396
|
+
color: '#fff',
|
|
397
|
+
background: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0))
|
|
398
|
+
? '#b0b0b0'
|
|
399
|
+
: 'linear-gradient(135deg, #28a745 0%, #218838 100%)',
|
|
400
|
+
border: 'none',
|
|
401
|
+
borderRadius: '6px',
|
|
402
|
+
cursor: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0)) ? 'not-allowed' : 'pointer',
|
|
403
|
+
boxShadow: (!isFormValid() || (showTMRelationViewer && selectedItemsRelationViewer.filter(i => i.isDcmt).length === 0))
|
|
404
|
+
? 'none'
|
|
405
|
+
: '0 2px 8px rgba(40, 167, 69, 0.35)',
|
|
406
|
+
transition: 'all 0.2s ease',
|
|
407
|
+
}, children: [_jsx(IconPlay, {}), _jsx("span", { children: SDKUI_Localizator.Execute })] }) })] }) }));
|
|
439
408
|
};
|
|
440
409
|
export default TMCopyToFolderForm;
|
|
@@ -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
|
}
|
|
@@ -41,5 +41,5 @@ interface TMDcmtFormActionButtonsProps {
|
|
|
41
41
|
setShowMoreInfoTaskPopup: React.Dispatch<React.SetStateAction<boolean>>;
|
|
42
42
|
setShowMoreInfoTaskTask: React.Dispatch<React.SetStateAction<TaskDescriptor | undefined>>;
|
|
43
43
|
}
|
|
44
|
-
declare const TMDcmtFormActionButtons: (props: TMDcmtFormActionButtonsProps) =>
|
|
44
|
+
declare const TMDcmtFormActionButtons: (props: TMDcmtFormActionButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
45
|
export default TMDcmtFormActionButtons;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { DcmtInfo, DownloadModes, DownloadTypes } from '../../../ts';
|
|
3
2
|
import { FileDescriptor } from '@topconsultnpm/sdk-ts';
|
|
4
3
|
interface ITMDcmtIconProps {
|
|
@@ -14,8 +13,6 @@ interface ITMDcmtIconProps {
|
|
|
14
13
|
tooltipContent?: JSX.Element | string;
|
|
15
14
|
openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
|
|
16
15
|
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
16
|
}
|
|
20
|
-
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync
|
|
17
|
+
declare const TMDcmtIcon: ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isShared, tid, did, downloadMode, tooltipContent, openInOffice, onDownloadDcmtsAsync }: ITMDcmtIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
18
|
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) {
|
|
@@ -25,12 +25,10 @@ export declare const TMNothingToShow: ({ text, secondText, fileExt, icon }: {
|
|
|
25
25
|
secondText?: any;
|
|
26
26
|
fileExt?: string;
|
|
27
27
|
icon?: any;
|
|
28
|
-
}) =>
|
|
29
|
-
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
30
|
-
style?: React.CSSProperties | import("styled-components/dist/types").CSSPropertiesWithVars | undefined;
|
|
31
|
-
}, {
|
|
28
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
|
|
32
30
|
$color: string;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
|
|
32
|
+
$color: string;
|
|
33
|
+
}, never>>> & string;
|
|
34
|
+
export declare const StyledPanelStatusContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never> & Partial<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>>> & string;
|