@topconsultnpm/sdkui-react 6.21.0-dev1.9 → 6.21.0-dev2.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/NewComponents/ContextMenu/TMContextMenu.js +2 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -19
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +79 -27
- package/lib/components/base/Styled.d.ts +76 -40
- package/lib/components/base/TMAreaManager.js +28 -11
- package/lib/components/base/TMFileManagerDataGridView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -2
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/base/TMTreeView.d.ts +5 -3
- package/lib/components/choosers/TMDataListItemChooser.js +56 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +51 -23
- package/lib/components/editors/TMDropDown.js +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -10
- package/lib/components/editors/TMFormulaEditor.js +15 -3
- package/lib/components/editors/TMMetadataEditor.js +4 -3
- package/lib/components/editors/TMMetadataValues.js +1 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +49 -21
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +244 -60
- package/lib/components/features/documents/TMDcmtPreview.d.ts +5 -3
- package/lib/components/features/documents/TMDragDropOverlay.js +7 -2
- package/lib/components/features/documents/TMFileUploader.js +5 -4
- package/lib/components/features/documents/TMMasterDetailDcmts.js +25 -51
- package/lib/components/features/documents/TMRelationViewer.js +1 -0
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +13 -1
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -3
- package/lib/components/features/search/TMSearchResult.js +15 -2
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -1
- package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +15 -5
- package/lib/components/forms/TMChooserForm.js +25 -2
- package/lib/components/grids/TMBlogsPost.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -2
- package/lib/components/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryCountButton.d.ts +11 -0
- package/lib/components/query/TMQueryCountButton.js +32 -0
- package/lib/components/query/TMQueryEditor.d.ts +10 -6
- package/lib/components/query/TMQueryEditor.js +42 -5
- package/lib/components/query/TMQuerySummary.js +3 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +2 -2
- package/lib/components/viewers/TMTidViewer.js +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/TMPdfViewer.js +143 -86
- package/lib/helper/TMUtils.d.ts +4 -9
- package/lib/helper/TMUtils.js +12 -74
- package/lib/helper/checkinCheckoutManager.d.ts +6 -1
- package/lib/helper/checkinCheckoutManager.js +203 -9
- package/lib/helper/helpers.js +8 -6
- package/lib/hooks/useCheckInOutOperations.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.js +9 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +75 -5
- package/lib/hooks/useDocumentOperations.js +17 -4
- package/lib/hooks/useForm.js +20 -14
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +37 -0
- package/lib/hooks/useQueryParametersDialog.js +5 -5
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/services/platform_services.js +8 -0
- package/lib/ts/types.d.ts +1 -0
- package/package.json +11 -12
|
@@ -8,7 +8,7 @@ import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
|
8
8
|
import TMBlogsPost from '../../grids/TMBlogsPost';
|
|
9
9
|
import TMSpinner from '../../base/TMSpinner';
|
|
10
10
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
11
|
-
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
11
|
+
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, showFloatingCommentButton = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
12
12
|
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
13
13
|
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
14
14
|
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
@@ -74,7 +74,7 @@ const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDa
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
return (_jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsx(StyledContainer, { children: _jsx(StyledSectionContainer, { style: { position: 'relative' }, children: _jsx(StyledBoardContainer, { children: !did ? _jsx(TMNothingToShow, { text: `${SDKUI_Localizator.NoDcmtSelected}.`, secondText: `${SDKUI_Localizator.BlogCase} - ${SDKUI_Localizator.NotAvailable}`, icon: _jsx(IconBoard, { fontSize: 96 }) }) :
|
|
77
|
-
_jsx(TMBlogsPost, { context: { engine: 'SearchEngine', object: { tid, did } }, id: "dcmt-blog", displayMode: 'chat', scrollToSelected: true, posts: blogsDatasource, showExtendedAttachments: false, showFloatingCommentButton:
|
|
77
|
+
_jsx(TMBlogsPost, { context: { engine: 'SearchEngine', object: { tid, did } }, id: "dcmt-blog", displayMode: 'chat', scrollToSelected: true, posts: blogsDatasource, showExtendedAttachments: false, showFloatingCommentButton: showFloatingCommentButton, showCommentFormCallback: showCommentFormCallback, refreshCallback: refreshCallback, contextMenuParams: {
|
|
78
78
|
isShowHideFilterEnabled: true,
|
|
79
79
|
isShowHideIDEnaled: true,
|
|
80
80
|
isCommentEnabled: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
|
-
import { AccessLevelsEx, AppModules, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataDomains, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { AccessLevelsEx, AppModules, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, DossierCacheService, LayoutCacheService, LayoutModes, MetadataDataDomains, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkingGroupCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { FormModes, SearchResultContext } from '../../../ts';
|
|
6
6
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
7
7
|
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
@@ -114,6 +114,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
114
114
|
const [refreshPreviewTrigger, setRefreshPreviewTrigger] = useState(0);
|
|
115
115
|
const [wfError, setWfError] = useState(null);
|
|
116
116
|
const [metadataDcmtOrigin, setMetadataDcmtOrigin] = useState(null);
|
|
117
|
+
const { workflowApproveData, getWorkItemsByDID } = useWorkflowApprove();
|
|
117
118
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
118
119
|
const deviceType = useDeviceType();
|
|
119
120
|
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
@@ -235,7 +236,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
235
236
|
const handleReset = useCallback(() => {
|
|
236
237
|
setDcmtFile(null);
|
|
237
238
|
}, []);
|
|
238
|
-
const
|
|
239
|
+
const loadDocumentFormDataAsync = useCallback(async () => {
|
|
239
240
|
try {
|
|
240
241
|
setFetchError(false);
|
|
241
242
|
if (!TID)
|
|
@@ -254,12 +255,34 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
254
255
|
layoutMode === LayoutModes.Update
|
|
255
256
|
? LayoutCacheService.GetAsync(TID, LayoutModes.None)
|
|
256
257
|
: Promise.resolve(undefined),
|
|
257
|
-
// 4.
|
|
258
|
-
(() => {
|
|
259
|
-
|
|
260
|
-
const
|
|
258
|
+
// 4. FindAllReferencesAsync - Cerca riferimenti a WorkingGroup, Dossier e Workflow se presenti nel sistema e se allowButtonsRefs è abilitato
|
|
259
|
+
(async () => {
|
|
260
|
+
// Array per raccogliere le classi di riferimento da cercare
|
|
261
|
+
const refs = [];
|
|
262
|
+
// Recupera working groups, dossier e dati di approvazione workflow in parallelo
|
|
263
|
+
const [workingGroups, dossiers] = await Promise.all([
|
|
264
|
+
WorkingGroupCacheService.GetAllAsync(),
|
|
265
|
+
DossierCacheService.GetAllAsync(),
|
|
266
|
+
]);
|
|
267
|
+
// Aggiunge WorkingGroup se esistono WG diversi da quello di sistema (id=1)
|
|
268
|
+
if (workingGroups.filter(wg => wg.id !== 1).length > 0) {
|
|
269
|
+
refs.push(ObjectClasses.WorkingGroup);
|
|
270
|
+
}
|
|
271
|
+
// Aggiunge Dossier se ne esistono
|
|
272
|
+
if (dossiers.length > 0) {
|
|
273
|
+
refs.push(ObjectClasses.Dossier);
|
|
274
|
+
}
|
|
275
|
+
// Aggiunge Workflow se ci sono dati di approvazione presenti
|
|
276
|
+
if (workflowApproveData.length > 0) {
|
|
277
|
+
refs.push(ObjectClasses.Workflow);
|
|
278
|
+
}
|
|
279
|
+
// Recupera le preferenze utente per autoFindReferences e le merge con i refs già raccolti
|
|
280
|
+
const userRefs = SDKUI_Globals?.userSettings?.searchSettings?.autoFindReferences ?? [];
|
|
281
|
+
const mergedRefs = [...new Set([...refs, ...userRefs])];
|
|
282
|
+
// Verifica se ci sono riferimenti da cercare e se i bottoni sono abilitati
|
|
283
|
+
const hasRefs = allowButtonsRefs && Array.isArray(mergedRefs) && mergedRefs.length > 0;
|
|
261
284
|
return hasRefs
|
|
262
|
-
? SDK_Globals.tmSession?.NewSearchEngine().FindAllReferencesAsync(TID, DID,
|
|
285
|
+
? SDK_Globals.tmSession?.NewSearchEngine().FindAllReferencesAsync(TID, DID, mergedRefs) ?? Promise.resolve(undefined)
|
|
263
286
|
: Promise.resolve(undefined);
|
|
264
287
|
})()
|
|
265
288
|
];
|
|
@@ -342,8 +365,8 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
342
365
|
context: SearchResultContext.DCMT_FORM,
|
|
343
366
|
documentData: {
|
|
344
367
|
dtd: fromDTD,
|
|
345
|
-
selectedItems: currentDcmt ? [{ TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt, rowIndex: 0 }] : [],
|
|
346
|
-
focusedItem: currentDcmt ? { TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt, rowIndex: 0 } : undefined,
|
|
368
|
+
selectedItems: currentDcmt ? [{ TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt, ISSIGNED: currentDcmt.isSigned ?? 0, rowIndex: 0 }] : [],
|
|
369
|
+
focusedItem: currentDcmt ? { TID: currentDcmt.tid, DID: currentDcmt.did, FILEEXT: currentDcmt.fileExt, ISSIGNED: currentDcmt.isSigned ?? 0, rowIndex: 0 } : undefined,
|
|
347
370
|
searchResult: currentSearchResults ? currentSearchResults[0] : undefined,
|
|
348
371
|
currentSearchResults,
|
|
349
372
|
currentMetadataValues: formData,
|
|
@@ -385,7 +408,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
385
408
|
},
|
|
386
409
|
callbacks: {
|
|
387
410
|
// Refresh operations (data consistency)
|
|
388
|
-
onRefreshSearchAsync,
|
|
411
|
+
onRefreshSearchAsync: loadDocumentFormDataAsync,
|
|
389
412
|
onSavedAsyncCallback,
|
|
390
413
|
// Workflow operations
|
|
391
414
|
onWFOperationCompleted,
|
|
@@ -413,7 +436,6 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
413
436
|
if (!allowButtonsRefs)
|
|
414
437
|
setDcmtReferences(undefined);
|
|
415
438
|
}, [allowButtonsRefs]);
|
|
416
|
-
const { workflowApproveData, getWorkItemsByDID } = useWorkflowApprove();
|
|
417
439
|
const fetchErrorShownRef = useRef(false);
|
|
418
440
|
useEffect(() => {
|
|
419
441
|
if (!TID)
|
|
@@ -467,12 +489,12 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
467
489
|
// Distinguish between initial load and navigation
|
|
468
490
|
if (isInitialLoading) {
|
|
469
491
|
// First load - keep isInitialLoading true
|
|
470
|
-
await
|
|
492
|
+
await loadDocumentFormDataAsync();
|
|
471
493
|
}
|
|
472
494
|
else {
|
|
473
495
|
// Navigation - use isNavigating instead
|
|
474
496
|
setIsNavigating(true);
|
|
475
|
-
await
|
|
497
|
+
await loadDocumentFormDataAsync();
|
|
476
498
|
}
|
|
477
499
|
}
|
|
478
500
|
catch (e) {
|
|
@@ -486,7 +508,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
486
508
|
}
|
|
487
509
|
};
|
|
488
510
|
run();
|
|
489
|
-
}, [TID, DID,
|
|
511
|
+
}, [TID, DID, loadDocumentFormDataAsync]);
|
|
490
512
|
useEffect(() => {
|
|
491
513
|
if (formData.length > 0) {
|
|
492
514
|
setValidationItems(validateMetadataList(formData));
|
|
@@ -495,14 +517,16 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
495
517
|
did: formData.find(o => o.mid == SystemMIDsAsNumber.DID)?.value,
|
|
496
518
|
fileCount: formData.find(o => o.mid == SystemMIDsAsNumber.FileCount)?.value,
|
|
497
519
|
fileSize: formData.find(o => o.mid == SystemMIDsAsNumber.FileSize)?.value,
|
|
498
|
-
fileExt: formData.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
|
520
|
+
fileExt: formData.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value,
|
|
521
|
+
isSigned: formData.find(o => o.mid == SystemMIDsAsNumber.IsSigned)?.value?.toString() === '1' ? 1 : 0,
|
|
499
522
|
};
|
|
500
523
|
if (!currentDcmt ||
|
|
501
524
|
currentDcmt.tid !== newDcmt.tid ||
|
|
502
525
|
currentDcmt.did !== newDcmt.did ||
|
|
503
526
|
currentDcmt.fileExt !== newDcmt.fileExt ||
|
|
504
527
|
currentDcmt.fileSize !== newDcmt.fileSize ||
|
|
505
|
-
currentDcmt.fileCount !== newDcmt.fileCount
|
|
528
|
+
currentDcmt.fileCount !== newDcmt.fileCount ||
|
|
529
|
+
currentDcmt.isSigned !== newDcmt.isSigned) {
|
|
506
530
|
setCurrentDcmt(newDcmt);
|
|
507
531
|
}
|
|
508
532
|
}
|
|
@@ -1238,7 +1262,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1238
1262
|
},
|
|
1239
1263
|
{
|
|
1240
1264
|
id: 'tmDcmtPreview',
|
|
1241
|
-
name: SDKUI_Localizator.PreviewDocument,
|
|
1265
|
+
name: layoutMode === LayoutModes.Update ? SDKUI_Localizator.PreviewDocument : SDKUI_Localizator.UploadFile,
|
|
1242
1266
|
contentOptions: { component: tmDcmtPreview },
|
|
1243
1267
|
toolbarOptions: {
|
|
1244
1268
|
icon: _jsx(IconShow, { fontSize: 24 }),
|
|
@@ -1421,8 +1445,8 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1421
1445
|
position: 'relative',
|
|
1422
1446
|
overflow: 'hidden'
|
|
1423
1447
|
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showCicoWaitPanel, showWaitPanelPrimary: showCicoPrimaryProgress, waitPanelTitle: cicoWaitPanelTitle, waitPanelTextPrimary: cicoPrimaryProgressText, waitPanelValuePrimary: cicoPrimaryProgressValue, waitPanelMaxValuePrimary: cicoPrimaryProgressMax, isCancelable: true, abortController: abortControllerLocal, children: [(groupId && groupId.length > 0)
|
|
1424
|
-
? _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })
|
|
1425
|
-
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1448
|
+
? _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 })] })
|
|
1449
|
+
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1426
1450
|
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onClosePanelCallback: () => setIsOpenDistinctValues(false), onSelectionChanged: (e) => {
|
|
1427
1451
|
if (!e)
|
|
1428
1452
|
return;
|
|
@@ -1512,7 +1536,7 @@ const validateMaxLength = (mvd, value, validationItems) => {
|
|
|
1512
1536
|
};
|
|
1513
1537
|
//#endregion Validation
|
|
1514
1538
|
// Synchronizes panel visibility and toolbar button disabled states when panels become disabled
|
|
1515
|
-
const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoardDisabled, isDcmtTasksDisabled }) => {
|
|
1539
|
+
const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoardDisabled, isDcmtTasksDisabled, isPreviewDisabled }) => {
|
|
1516
1540
|
const { setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility } = useTMPanelManagerContext();
|
|
1517
1541
|
useEffect(() => {
|
|
1518
1542
|
// Aggiorna lo stato disabled del bottone toolbar
|
|
@@ -1520,6 +1544,7 @@ const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoar
|
|
|
1520
1544
|
setToolbarButtonDisabled('tmBlog', isBoardDisabled);
|
|
1521
1545
|
setToolbarButtonDisabled('tmWF', isWFDisabled);
|
|
1522
1546
|
setToolbarButtonDisabled('tmDcmtTasks', isDcmtTasksDisabled);
|
|
1547
|
+
setToolbarButtonDisabled('tmDcmtPreview', isPreviewDisabled);
|
|
1523
1548
|
// Chiude il pannello solo se è attualmente visibile e deve essere disabilitato
|
|
1524
1549
|
if (isSysMetadataDisabled && panelVisibility['tmSysMetadata']) {
|
|
1525
1550
|
setPanelVisibilityById('tmSysMetadata', false);
|
|
@@ -1533,7 +1558,10 @@ const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoar
|
|
|
1533
1558
|
if (isDcmtTasksDisabled && panelVisibility['tmDcmtTasks']) {
|
|
1534
1559
|
setPanelVisibilityById('tmDcmtTasks', false);
|
|
1535
1560
|
}
|
|
1536
|
-
|
|
1561
|
+
if (isPreviewDisabled && panelVisibility['tmDcmtPreview']) {
|
|
1562
|
+
setPanelVisibilityById('tmDcmtPreview', false);
|
|
1563
|
+
}
|
|
1564
|
+
}, [isSysMetadataDisabled, isBoardDisabled, isWFDisabled, isDcmtTasksDisabled, isPreviewDisabled, setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility]);
|
|
1537
1565
|
return null;
|
|
1538
1566
|
};
|
|
1539
1567
|
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, layoutMode, dcmtFile, deviceType, isVisible, onFileUpload, openFileUploaderPdfEditor, enableDragDropOverlay = false, onScanRequest }) => {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef } from "react";
|
|
2
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { ObjectClasses, SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
4
|
-
import { TASK_MORE_INFO_PREFIX_NAME, SDKUI_Localizator, PDGS_COLORS } from "../../../helper";
|
|
4
|
+
import { TASK_MORE_INFO_PREFIX_NAME, SDKUI_Localizator, PDGS_COLORS, calcResponsiveSizes } from "../../../helper";
|
|
5
5
|
import { TMColors } from "../../../utils/theme";
|
|
6
|
-
import {
|
|
6
|
+
import { StyledReferenceButton } from "../../base/Styled";
|
|
7
7
|
import TMButton from "../../base/TMButton";
|
|
8
|
+
import TMModal from "../../base/TMModal";
|
|
8
9
|
import TMTooltip from "../../base/TMTooltip";
|
|
9
10
|
import { WorkFlowOperationButtons } from "../workflow/TMWorkflowPopup";
|
|
10
11
|
const TMDcmtFormActionButtons = (props) => {
|
|
11
12
|
const { showToppyForApprove, workItems, deviceType, isMobile, handleSignApprove, updateShowApprovePopup, updateShowRejectPopup, updateShowReAssignPopup, updateShowMoreInfoPopup, fromDTD, showToppyForCompleteMoreInfo, moreInfoTasks, setShowCommentForm, showToppyForReferences, dcmtReferences, referenceActionMap, handleNavigateToReference, setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask } = props;
|
|
13
|
+
const [showAllMoreInfoModal, setShowAllMoreInfoModal] = useState(false);
|
|
14
|
+
const [showAllDossiersModal, setShowAllDossiersModal] = useState(false);
|
|
15
|
+
const [showAllWorkingGroupsModal, setShowAllWorkingGroupsModal] = useState(false);
|
|
12
16
|
const tasksNumber = useMemo(() => moreInfoTasks?.length ?? 0, [moreInfoTasks]);
|
|
13
|
-
const
|
|
17
|
+
const firstTask = useMemo(() => {
|
|
14
18
|
if (!moreInfoTasks || moreInfoTasks.length === 0)
|
|
15
19
|
return null;
|
|
16
|
-
|
|
17
|
-
return moreInfoTasks[0];
|
|
18
|
-
// If there are multiple tasks, we cannot determine which one is relevant, so we return null
|
|
19
|
-
return null;
|
|
20
|
+
return moreInfoTasks[0];
|
|
20
21
|
}, [moreInfoTasks]);
|
|
21
22
|
const { hasMoreInfo, hasApprove, hasReferences } = useMemo(() => {
|
|
22
23
|
const referencesExist = showToppyForReferences && dcmtReferences?.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
@@ -31,8 +32,31 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
31
32
|
showToppyForReferences,
|
|
32
33
|
dcmtReferences
|
|
33
34
|
]);
|
|
35
|
+
// Raggruppa references per categoria
|
|
36
|
+
const { dossierRefs, workingGroupRefs } = useMemo(() => {
|
|
37
|
+
const dossiers = dcmtReferences?.filter(ref => ref.objClass === ObjectClasses.Dossier) ?? [];
|
|
38
|
+
const workingGroups = dcmtReferences?.filter(ref => ref.objClass === ObjectClasses.WorkingGroup) ?? [];
|
|
39
|
+
return { dossierRefs: dossiers, workingGroupRefs: workingGroups };
|
|
40
|
+
}, [dcmtReferences]);
|
|
41
|
+
const refButtonMouseMoved = useRef(false);
|
|
42
|
+
const handleRefButtonMouseDown = useCallback(() => { refButtonMouseMoved.current = false; }, []);
|
|
43
|
+
const handleRefButtonMouseMove = useCallback(() => { refButtonMouseMoved.current = true; }, []);
|
|
44
|
+
const handleRefButtonClick = useCallback((ref) => {
|
|
45
|
+
if (!refButtonMouseMoved.current) {
|
|
46
|
+
handleNavigateToReference(ref);
|
|
47
|
+
}
|
|
48
|
+
}, [handleNavigateToReference]);
|
|
34
49
|
const Divider = () => (_jsx("div", { style: { height: '1px', width: '100%', background: 'linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent)', margin: '3px 0', opacity: 0.8, } }));
|
|
35
|
-
|
|
50
|
+
const truncate = (str, maxLength) => str && str.length > maxLength ? str.substring(0, maxLength) + '...' : str;
|
|
51
|
+
const formatBadgeCount = (count) => count > 99 ? '99+' : `+${count}`;
|
|
52
|
+
const renderMoreInfoCard = (task, showOthersIndicator = false) => {
|
|
53
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
54
|
+
const isSender = task?.fromID !== undefined && task.fromID === userID;
|
|
55
|
+
const isRecipient = task?.toID !== undefined && task.toID === userID;
|
|
56
|
+
const senderNameTruncated = task?.fromName ? truncate(task.fromName, 30) : 'N/A';
|
|
57
|
+
const recipientNameTruncated = task?.toName ? truncate(task.toName, 30) : 'N/A';
|
|
58
|
+
const taskNameTrunc = task?.name ? truncate(task.name.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', ''), 30) : 'N/A';
|
|
59
|
+
return (_jsxs("div", { style: { position: 'relative', display: 'flex' }, children: [_jsxs("div", { style: {
|
|
36
60
|
padding: '10px',
|
|
37
61
|
color: '#FFFFFF',
|
|
38
62
|
maxWidth: '240px',
|
|
@@ -46,58 +70,218 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
46
70
|
textAlign: 'center',
|
|
47
71
|
gap: '10px',
|
|
48
72
|
cursor: 'default',
|
|
49
|
-
|
|
73
|
+
flex: 1,
|
|
74
|
+
}, children: [(isSender && !isRecipient) && (_jsx(TaskLink, { messagePrefix: `Hai richiesto maggiori informazioni a "${recipientNameTruncated}" tramite l'attività`, name: task.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: task.description ?? 'N/A', currentTask: task, setShowMoreInfoTaskPopup: setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask: setShowMoreInfoTaskTask })), (isRecipient && !isSender) && (_jsxs("div", { style: {
|
|
75
|
+
display: 'flex',
|
|
76
|
+
flexDirection: 'column',
|
|
77
|
+
alignItems: 'center',
|
|
78
|
+
gap: '10px'
|
|
79
|
+
}, children: [_jsx(TaskLink, { messagePrefix: `"${senderNameTruncated}" ti ha richiesto maggiori informazioni tramite l'attività`, name: task.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: task.description ?? 'N/A', currentTask: task, setShowMoreInfoTaskPopup: setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask: setShowMoreInfoTaskTask }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx("span", { className: "dx-icon-chat" }), caption: SDKUI_Localizator.CommentAndComplete, width: "180px", disabled: false, onClick: () => setShowCommentForm(true), onMouseDown: e => e.stopPropagation(), advancedColor: TMColors.success, color: "success" })] })), (!isSender && !isRecipient) && (_jsx(TaskLink, { messagePrefix: `Richiesta maggiori informazioni tramite l'attività`, name: task.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: task.description ?? 'N/A', currentTask: task, setShowMoreInfoTaskPopup: setShowMoreInfoTaskPopup, setShowMoreInfoTaskTask: setShowMoreInfoTaskTask }))] }), showOthersIndicator && tasksNumber > 1 && ((() => {
|
|
80
|
+
const bgColor = '#0077BE';
|
|
81
|
+
const bgColorHover = '#1E90FF';
|
|
82
|
+
return (_jsx("div", { onClick: () => setShowAllMoreInfoModal(true), onMouseDown: e => e.stopPropagation(), style: {
|
|
83
|
+
position: 'absolute',
|
|
84
|
+
right: '-36px',
|
|
85
|
+
top: '50%',
|
|
86
|
+
transform: 'translateY(-50%)',
|
|
87
|
+
width: '28px',
|
|
88
|
+
height: '28px',
|
|
89
|
+
background: bgColor,
|
|
90
|
+
border: '2px solid rgba(255,255,255,0.5)',
|
|
91
|
+
borderRadius: '50%',
|
|
92
|
+
display: 'flex',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
justifyContent: 'center',
|
|
95
|
+
cursor: 'pointer',
|
|
96
|
+
color: '#FFFFFF',
|
|
97
|
+
fontSize: '11px',
|
|
98
|
+
fontWeight: 700,
|
|
99
|
+
boxShadow: '0 2px 8px rgba(0, 0, 50, 0.3)',
|
|
100
|
+
transition: 'all 0.2s',
|
|
101
|
+
}, onMouseEnter: e => {
|
|
102
|
+
e.currentTarget.style.background = bgColorHover;
|
|
103
|
+
e.currentTarget.style.transform = 'translateY(-50%) scale(1.1)';
|
|
104
|
+
}, onMouseLeave: e => {
|
|
105
|
+
e.currentTarget.style.background = bgColor;
|
|
106
|
+
e.currentTarget.style.transform = 'translateY(-50%)';
|
|
107
|
+
}, children: formatBadgeCount(tasksNumber - 1) }));
|
|
108
|
+
})())] }));
|
|
109
|
+
};
|
|
110
|
+
const renderReferenceCard = (ref, allRefs, showOthersIndicator, onShowAll, onClickRef) => {
|
|
111
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
112
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
113
|
+
const othersCount = allRefs.length - 1;
|
|
114
|
+
let backgroundColor;
|
|
115
|
+
switch (ref.objClass) {
|
|
116
|
+
case ObjectClasses.WorkingGroup:
|
|
117
|
+
backgroundColor = PDGS_COLORS.WORKING_GROUP;
|
|
118
|
+
break;
|
|
119
|
+
case ObjectClasses.Dossier:
|
|
120
|
+
backgroundColor = PDGS_COLORS.DOSSIER;
|
|
121
|
+
break;
|
|
122
|
+
case ObjectClasses.Document:
|
|
123
|
+
backgroundColor = PDGS_COLORS.DOCUMENT;
|
|
124
|
+
break;
|
|
125
|
+
default:
|
|
126
|
+
backgroundColor = "#C2388B";
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
return (_jsxs("div", { style: { position: 'relative', display: 'inline-flex' }, children: [_jsxs(StyledReferenceButton, { onMouseDown: handleRefButtonMouseDown, onMouseMove: handleRefButtonMouseMove, onClick: () => {
|
|
130
|
+
handleRefButtonClick(ref);
|
|
131
|
+
onClickRef?.();
|
|
132
|
+
}, onDoubleClick: (e) => { e.preventDefault(); e.stopPropagation(); }, "$bgColor": backgroundColor, children: [_jsx("span", { children: label }), _jsx("span", { children: `"${ref.objName}"` })] }), showOthersIndicator && othersCount > 0 && (_jsx("div", { onClick: (e) => { e.stopPropagation(); onShowAll(); }, onMouseDown: e => e.stopPropagation(), style: {
|
|
133
|
+
position: 'absolute',
|
|
134
|
+
right: '-36px',
|
|
135
|
+
top: '50%',
|
|
136
|
+
transform: 'translateY(-50%)',
|
|
137
|
+
width: '28px',
|
|
138
|
+
height: '28px',
|
|
139
|
+
background: backgroundColor,
|
|
140
|
+
border: '2px solid rgba(255,255,255,0.5)',
|
|
141
|
+
borderRadius: '50%',
|
|
142
|
+
display: 'flex',
|
|
143
|
+
alignItems: 'center',
|
|
144
|
+
justifyContent: 'center',
|
|
145
|
+
cursor: 'pointer',
|
|
146
|
+
color: '#FFFFFF',
|
|
147
|
+
fontSize: '11px',
|
|
148
|
+
fontWeight: 700,
|
|
149
|
+
boxShadow: '0 2px 8px rgba(0, 0, 50, 0.3)',
|
|
150
|
+
transition: 'all 0.2s',
|
|
151
|
+
}, onMouseEnter: e => {
|
|
152
|
+
e.currentTarget.style.filter = 'brightness(1.2)';
|
|
153
|
+
e.currentTarget.style.transform = 'translateY(-50%) scale(1.1)';
|
|
154
|
+
}, onMouseLeave: e => {
|
|
155
|
+
e.currentTarget.style.filter = 'none';
|
|
156
|
+
e.currentTarget.style.transform = 'translateY(-50%)';
|
|
157
|
+
}, children: formatBadgeCount(othersCount) }))] }));
|
|
158
|
+
};
|
|
159
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && firstTask && (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center', paddingRight: tasksNumber > 1 ? '36px' : '0' }, children: renderMoreInfoCard(firstTask, tasksNumber > 1) })), hasMoreInfo && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
160
|
+
_jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => updateShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => updateShowRejectPopup(true), onReAssign: () => updateShowReAssignPopup(true), onMoreInfo: () => updateShowMoreInfoPopup(true) })
|
|
161
|
+
:
|
|
162
|
+
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Questo documento è associato a ${workItems.length} workitem.`, _jsx("br", {}), `Per approvare, vai alla pagina "Approvazione workflow".`] })), (hasApprove && hasReferences) || (hasMoreInfo && !hasApprove && hasReferences) ? (_jsx(Divider, {})) : null, hasReferences && (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px', alignItems: 'center' }, children: [dossierRefs.length > 0 && (_jsx("div", { style: { paddingRight: dossierRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(dossierRefs[0], dossierRefs, dossierRefs.length > 1, () => setShowAllDossiersModal(true)) })), workingGroupRefs.length > 0 && (_jsx("div", { style: { paddingRight: workingGroupRefs.length > 1 ? '36px' : '0' }, children: renderReferenceCard(workingGroupRefs[0], workingGroupRefs, workingGroupRefs.length > 1, () => setShowAllWorkingGroupsModal(true)) }))] }))] }), showAllMoreInfoModal && moreInfoTasks && moreInfoTasks.length > 1 && (_jsx(TMModal, { title: `Altre richieste maggiori informazioni (${moreInfoTasks.length - 1})`, onClose: () => setShowAllMoreInfoModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: 'auto', children: _jsx("div", { style: {
|
|
163
|
+
display: 'flex',
|
|
164
|
+
flexDirection: 'column',
|
|
165
|
+
gap: '8px',
|
|
166
|
+
padding: '15px',
|
|
167
|
+
maxHeight: '50vh',
|
|
168
|
+
overflowY: 'auto',
|
|
169
|
+
scrollbarWidth: 'thin',
|
|
170
|
+
scrollbarColor: '#888 #f1f1f1'
|
|
171
|
+
}, children: moreInfoTasks.slice(1).map((task, index) => {
|
|
50
172
|
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
51
|
-
const isSender =
|
|
52
|
-
const isRecipient =
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
173
|
+
const isSender = task?.fromID !== undefined && task.fromID === userID;
|
|
174
|
+
const isRecipient = task?.toID !== undefined && task.toID === userID;
|
|
175
|
+
const taskName = task?.name?.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', '') ?? 'N/A';
|
|
176
|
+
let roleInfo = '';
|
|
177
|
+
if (isSender && !isRecipient) {
|
|
178
|
+
roleInfo = `Richiesta a: ${task.toName ?? 'N/A'}`;
|
|
179
|
+
}
|
|
180
|
+
else if (isRecipient && !isSender) {
|
|
181
|
+
roleInfo = `Da: ${task.fromName ?? 'N/A'}`;
|
|
182
|
+
}
|
|
183
|
+
return (_jsxs("div", { onClick: () => {
|
|
184
|
+
setShowMoreInfoTaskPopup(true);
|
|
185
|
+
setShowMoreInfoTaskTask(task);
|
|
186
|
+
setShowAllMoreInfoModal(false);
|
|
187
|
+
}, style: {
|
|
188
|
+
display: 'flex',
|
|
189
|
+
alignItems: 'center',
|
|
190
|
+
gap: '12px',
|
|
191
|
+
padding: '12px 16px',
|
|
192
|
+
borderRadius: '8px',
|
|
193
|
+
backgroundColor: '#f5f5f5',
|
|
194
|
+
cursor: 'pointer',
|
|
195
|
+
transition: 'background-color 0.2s',
|
|
196
|
+
}, onMouseEnter: e => e.currentTarget.style.backgroundColor = '#e8e8e8', onMouseLeave: e => e.currentTarget.style.backgroundColor = '#f5f5f5', children: [_jsx("div", { style: {
|
|
197
|
+
width: '8px',
|
|
198
|
+
height: '8px',
|
|
199
|
+
borderRadius: '50%',
|
|
200
|
+
backgroundColor: '#0077BE',
|
|
201
|
+
flexShrink: 0
|
|
202
|
+
} }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '2px' }, children: [_jsx("span", { style: {
|
|
203
|
+
fontSize: '1rem',
|
|
204
|
+
color: '#333',
|
|
205
|
+
wordBreak: 'break-word',
|
|
206
|
+
fontWeight: 500
|
|
207
|
+
}, children: taskName }), roleInfo && (_jsx("span", { style: {
|
|
208
|
+
fontSize: '1rem',
|
|
209
|
+
color: '#333',
|
|
210
|
+
wordBreak: 'break-word'
|
|
211
|
+
}, children: roleInfo }))] })] }, `moreinfo-task-${index}-${task.id}`));
|
|
212
|
+
}) }) })), showAllDossiersModal && dossierRefs.length > 1 && (_jsx(TMModal, { title: `Altre ${SDKUI_Localizator.Dossiers} (${dossierRefs.length - 1})`, onClose: () => setShowAllDossiersModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: calcResponsiveSizes(deviceType, 'auto', 'auto', '95%'), children: _jsx("div", { style: {
|
|
213
|
+
display: 'flex',
|
|
214
|
+
flexDirection: 'column',
|
|
215
|
+
gap: '8px',
|
|
216
|
+
padding: '15px',
|
|
217
|
+
maxHeight: '50vh',
|
|
218
|
+
overflowY: 'auto',
|
|
219
|
+
scrollbarWidth: 'thin',
|
|
220
|
+
scrollbarColor: '#888 #f1f1f1'
|
|
221
|
+
}, children: dossierRefs.slice(1).map((ref, index) => {
|
|
222
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
223
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
224
|
+
return (_jsxs("div", { onClick: () => { handleNavigateToReference(ref); setShowAllDossiersModal(false); }, style: {
|
|
225
|
+
display: 'flex',
|
|
226
|
+
alignItems: 'center',
|
|
227
|
+
gap: '12px',
|
|
228
|
+
padding: '12px 16px',
|
|
229
|
+
borderRadius: '8px',
|
|
230
|
+
backgroundColor: '#f5f5f5',
|
|
231
|
+
cursor: 'pointer',
|
|
232
|
+
transition: 'background-color 0.2s',
|
|
233
|
+
}, onMouseEnter: e => e.currentTarget.style.backgroundColor = '#e8e8e8', onMouseLeave: e => e.currentTarget.style.backgroundColor = '#f5f5f5', children: [_jsx("div", { style: {
|
|
234
|
+
width: '8px',
|
|
235
|
+
height: '8px',
|
|
236
|
+
borderRadius: '50%',
|
|
237
|
+
backgroundColor: PDGS_COLORS.DOSSIER,
|
|
238
|
+
flexShrink: 0
|
|
239
|
+
} }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '2px' }, children: [_jsxs("span", { style: {
|
|
240
|
+
fontSize: '1rem',
|
|
241
|
+
color: '#333'
|
|
242
|
+
}, children: [label, ":"] }), _jsx("span", { style: {
|
|
243
|
+
fontSize: '1rem',
|
|
244
|
+
color: '#333',
|
|
245
|
+
wordBreak: 'break-word',
|
|
246
|
+
fontWeight: 500
|
|
247
|
+
}, children: ref.objName })] })] }, `dossier-ref-${index}-${ref.objID}`));
|
|
248
|
+
}) }) })), showAllWorkingGroupsModal && workingGroupRefs.length > 1 && (_jsx(TMModal, { title: `Altri ${SDKUI_Localizator.WorkingGroups} (${workingGroupRefs.length - 1})`, onClose: () => setShowAllWorkingGroupsModal(false), width: calcResponsiveSizes(deviceType, '450px', '450px', '95%'), height: calcResponsiveSizes(deviceType, 'auto', 'auto', '95%'), children: _jsx("div", { style: {
|
|
249
|
+
display: 'flex',
|
|
250
|
+
flexDirection: 'column',
|
|
251
|
+
gap: '8px',
|
|
252
|
+
padding: '15px',
|
|
253
|
+
maxHeight: '50vh',
|
|
254
|
+
overflowY: 'auto',
|
|
255
|
+
scrollbarWidth: 'thin',
|
|
256
|
+
scrollbarColor: '#888 #f1f1f1'
|
|
257
|
+
}, children: workingGroupRefs.slice(1).map((ref, index) => {
|
|
258
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
259
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
260
|
+
return (_jsxs("div", { onClick: () => { handleNavigateToReference(ref); setShowAllWorkingGroupsModal(false); }, style: {
|
|
261
|
+
display: 'flex',
|
|
262
|
+
alignItems: 'center',
|
|
263
|
+
gap: '12px',
|
|
264
|
+
padding: '12px 16px',
|
|
265
|
+
borderRadius: '8px',
|
|
266
|
+
backgroundColor: '#f5f5f5',
|
|
267
|
+
cursor: 'pointer',
|
|
268
|
+
transition: 'background-color 0.2s',
|
|
269
|
+
}, onMouseEnter: e => e.currentTarget.style.backgroundColor = '#e8e8e8', onMouseLeave: e => e.currentTarget.style.backgroundColor = '#f5f5f5', children: [_jsx("div", { style: {
|
|
270
|
+
width: '8px',
|
|
271
|
+
height: '8px',
|
|
272
|
+
borderRadius: '50%',
|
|
273
|
+
backgroundColor: PDGS_COLORS.WORKING_GROUP,
|
|
274
|
+
flexShrink: 0
|
|
275
|
+
} }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '2px' }, children: [_jsxs("span", { style: {
|
|
276
|
+
fontSize: '1rem',
|
|
277
|
+
color: '#333'
|
|
278
|
+
}, children: [label, ":"] }), _jsx("span", { style: {
|
|
279
|
+
fontSize: '1rem',
|
|
280
|
+
color: '#333',
|
|
281
|
+
wordBreak: 'break-word',
|
|
282
|
+
fontWeight: 500
|
|
283
|
+
}, children: ref.objName })] })] }, `wg-ref-${index}-${ref.objID}`));
|
|
284
|
+
}) }) }))] }));
|
|
101
285
|
};
|
|
102
286
|
export default TMDcmtFormActionButtons;
|
|
103
287
|
const TaskLink = (props) => {
|
|
@@ -25,7 +25,9 @@ export declare const TMNothingToShow: ({ text, secondText, fileExt, icon }: {
|
|
|
25
25
|
fileExt?: string;
|
|
26
26
|
icon?: any;
|
|
27
27
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export declare const StyledHeaderIcon: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components
|
|
28
|
+
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"> & {
|
|
29
29
|
$color: string;
|
|
30
|
-
}
|
|
31
|
-
|
|
30
|
+
}, never> & Partial<Pick<import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "$color"> & {
|
|
31
|
+
$color: string;
|
|
32
|
+
}, never>>> & string;
|
|
33
|
+
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;
|
|
@@ -8,7 +8,10 @@ const TMDragDropOverlay = (props) => {
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
const handleWindowDragEnter = (e) => {
|
|
10
10
|
e.preventDefault();
|
|
11
|
-
|
|
11
|
+
// Attiva solo se si trascina un file
|
|
12
|
+
if (e.dataTransfer?.types.includes('Files')) {
|
|
13
|
+
setDragOver(true);
|
|
14
|
+
}
|
|
12
15
|
};
|
|
13
16
|
const handleWindowDragOver = (e) => {
|
|
14
17
|
e.preventDefault();
|
|
@@ -60,7 +63,9 @@ const TMDragDropOverlay = (props) => {
|
|
|
60
63
|
boxShadow: '0 8px 20px rgba(0,0,0,0.3)',
|
|
61
64
|
backdropFilter: 'blur(5px)',
|
|
62
65
|
transition: 'opacity 0.2s, transform 0.2s, background 0.2s',
|
|
63
|
-
}, onDragEnter: (e) => { e.preventDefault(); e.stopPropagation();
|
|
66
|
+
}, onDragEnter: (e) => { e.preventDefault(); e.stopPropagation(); if (e.dataTransfer?.types.includes('Files'))
|
|
67
|
+
setDragOver(true); }, onDragOver: (e) => { e.preventDefault(); e.stopPropagation(); if (e.dataTransfer?.types.includes('Files'))
|
|
68
|
+
setDragOver(true); }, onDragLeave: (e) => {
|
|
64
69
|
e.preventDefault();
|
|
65
70
|
e.stopPropagation();
|
|
66
71
|
// Solo se il cursore ha lasciato il div principale
|