@topconsultnpm/sdkui-react 6.20.0-dev2.24 → 6.20.0-dev2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/base/Styled.d.ts +1 -0
- package/lib/components/base/Styled.js +10 -2
- package/lib/components/features/documents/TMDcmtForm.js +103 -23
- package/lib/components/features/search/TMSearchResult.js +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +2 -2
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +2 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +2 -1
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ export declare const StyledMultiViewPanel: import("styled-components/dist/types"
|
|
|
7
7
|
}>> & string;
|
|
8
8
|
export declare const StyledParagraph: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, never>> & string;
|
|
9
9
|
export declare const StyledToolbarForm: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
|
+
export declare const ReferencesContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
10
11
|
export declare const StyledReferenceButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
11
12
|
export declare const StyledPanelPage: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
12
13
|
$isOpen?: boolean;
|
|
@@ -36,17 +36,25 @@ export const StyledToolbarForm = styled.div `
|
|
|
36
36
|
gap: 2px;
|
|
37
37
|
background-color: ${TMColors.toolbar_background};
|
|
38
38
|
`;
|
|
39
|
+
export const ReferencesContainer = styled.div `
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
gap: 12px;
|
|
43
|
+
flex-wrap: wrap;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
`;
|
|
39
47
|
export const StyledReferenceButton = styled.button `
|
|
40
48
|
display: flex;
|
|
41
49
|
flex-direction: column;
|
|
42
50
|
align-items: center;
|
|
43
51
|
justify-content: center;
|
|
44
|
-
padding: 10px
|
|
52
|
+
padding: 10px 25px;
|
|
45
53
|
border-radius: 20px;
|
|
46
54
|
border: none;
|
|
47
55
|
background-color: ${TMColors.button_floating_background};
|
|
48
56
|
color: white;
|
|
49
|
-
font-size: 0.
|
|
57
|
+
font-size: 0.95rem;
|
|
50
58
|
font-weight: 500;
|
|
51
59
|
cursor: pointer;
|
|
52
60
|
transition: all 0.2s ease;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
4
|
import { AccessLevels, AppModules, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
@@ -8,10 +8,10 @@ import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
|
8
8
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
10
10
|
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
11
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getExceptionMessage, isApprovalWorkflowView, getDcmtCicoStatus, IconFileDots, IconCustom, buildWorkItemsFromWFCtrl, IconLock, getDcmtFormToolbarVisibility } from '../../../helper';
|
|
11
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getExceptionMessage, isApprovalWorkflowView, getDcmtCicoStatus, IconFileDots, IconCustom, buildWorkItemsFromWFCtrl, IconLock, getDcmtFormToolbarVisibility, TASK_MORE_INFO_PREFIX_NAME } from '../../../helper';
|
|
12
12
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
13
13
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
14
|
-
import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
14
|
+
import { ReferencesContainer, StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
15
15
|
import ShowAlert from '../../base/TMAlert';
|
|
16
16
|
import TMButton from '../../base/TMButton';
|
|
17
17
|
import { TMExceptionBoxManager, TMMessageBoxManager, ButtonNames } from '../../base/TMPopUp';
|
|
@@ -646,8 +646,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
646
646
|
if (layoutMode !== LayoutModes.Update || !moreInfoTasks) {
|
|
647
647
|
return false;
|
|
648
648
|
}
|
|
649
|
-
return moreInfoTasks.some(task => isTaskMoreInfo(task.name) &&
|
|
650
|
-
task.state !== Task_States.Completed);
|
|
649
|
+
return moreInfoTasks.some(task => isTaskMoreInfo(task.name) && task.state !== Task_States.Completed);
|
|
651
650
|
}, [layoutMode, moreInfoTasks]);
|
|
652
651
|
const showToppyForReferences = useMemo(() => {
|
|
653
652
|
if (!allowButtonsRefs || layoutMode !== LayoutModes.Update || isOpenDetails || isOpenMaster)
|
|
@@ -1188,8 +1187,10 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1188
1187
|
}, [focusedMetadataValue?.value, focusedMetadataValue?.mid, TID]);
|
|
1189
1188
|
const handleWFOperationCompleted = useCallback(async () => {
|
|
1190
1189
|
await onWFOperationCompleted?.();
|
|
1191
|
-
|
|
1192
|
-
|
|
1190
|
+
if (!showMoreInfoPopup) {
|
|
1191
|
+
onClose?.();
|
|
1192
|
+
}
|
|
1193
|
+
}, [onWFOperationCompleted, onClose, showMoreInfoPopup]);
|
|
1193
1194
|
// Determina se showAll deve essere automaticamente true
|
|
1194
1195
|
// Best practice: usa useMemo per calcolare valori derivati invece di useEffect con setState
|
|
1195
1196
|
const shouldShowAll = useMemo(() => {
|
|
@@ -1528,15 +1529,30 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1528
1529
|
};
|
|
1529
1530
|
const handleCompleteMoreInfo = useCallback(async () => {
|
|
1530
1531
|
try {
|
|
1532
|
+
if (!moreInfoTasks || moreInfoTasks.length === 0) {
|
|
1533
|
+
ShowAlert({
|
|
1534
|
+
mode: 'info',
|
|
1535
|
+
title: SDKUI_Localizator.MoreInformation,
|
|
1536
|
+
message: 'Nessun attività di maggiori informazioni da completare',
|
|
1537
|
+
duration: 3000
|
|
1538
|
+
});
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
;
|
|
1542
|
+
const firstTask = moreInfoTasks[0];
|
|
1531
1543
|
TMSpinner.show();
|
|
1532
|
-
|
|
1544
|
+
const newTask = { ...firstTask, state: Task_States.Completed };
|
|
1533
1545
|
await SDK_Globals.tmSession?.NewTaskEngine().UpdateAsync(newTask);
|
|
1534
1546
|
onTaskCompleted?.(newTask);
|
|
1535
1547
|
onClose?.();
|
|
1536
|
-
ShowAlert({
|
|
1548
|
+
ShowAlert({
|
|
1549
|
+
mode: 'success',
|
|
1550
|
+
title: SDKUI_Localizator.MoreInformation,
|
|
1551
|
+
message: SDKUI_Localizator.MoreInfoCompleted,
|
|
1552
|
+
duration: 3000
|
|
1553
|
+
});
|
|
1537
1554
|
}
|
|
1538
1555
|
catch (e) {
|
|
1539
|
-
TMSpinner.hide();
|
|
1540
1556
|
TMExceptionBoxManager.show({ exception: e });
|
|
1541
1557
|
}
|
|
1542
1558
|
finally {
|
|
@@ -1602,19 +1618,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1602
1618
|
isEditable: true,
|
|
1603
1619
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1604
1620
|
}));
|
|
1605
|
-
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }) }), _jsx(TMToppyDraggableHelpCenter, { isVisible: isToppyVisible, content:
|
|
1606
|
-
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1607
|
-
:
|
|
1608
|
-
_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".`] })), showToppyForCompleteMoreInfo && (moreInfoTasks?.length === 1 ? (_jsxs(_Fragment, { children: [_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `${SDKUI_Localizator.MoreInfoCompleteRequestSentBy} ${moreInfoTasks[0]?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => setShowCommentForm(true) })] })) : (_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `Ci sono ${moreInfoTasks?.length ?? 0} richieste di maggiori informazioni. ${SDKUI_Localizator.ManageFromTaskPanel}` }))), showToppyForReferences && dcmtReferences?.filter(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup)
|
|
1609
|
-
.map((ref, index, arr) => {
|
|
1610
|
-
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
1611
|
-
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
1612
|
-
return (_jsxs(React.Fragment, { children: [index === 0 && (showToppyForApprove || showToppyForCompleteMoreInfo) && (_jsx("div", { style: {
|
|
1613
|
-
height: 1,
|
|
1614
|
-
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
1615
|
-
margin: '6px 0'
|
|
1616
|
-
} })), _jsxs(StyledReferenceButton, { onClick: () => handleNavigateToReference(ref), onDoubleClick: (e) => { e.preventDefault(); e.stopPropagation(); }, children: [_jsx("span", { children: label }), _jsx("span", { children: `"${ref.objName}"` })] }, `ref-${index}-${ref.objID}`)] }, `ref-frag-${index}-${ref.objID}`));
|
|
1617
|
-
})] }) })] }), (showCommentForm && TID && DID) &&
|
|
1621
|
+
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false), getAllTasks: getAllTasks }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }) }), _jsx(TMToppyDraggableHelpCenter, { isVisible: isToppyVisible, content: _jsx(TMDcmtFormActionButtons, { showToppyForApprove: showToppyForApprove, workItems: workItems, deviceType: deviceType, isMobile: isMobile, handleSignApprove: handleSignApprove, setShowApprovePopup: setShowApprovePopup, setShowRejectPopup: setShowRejectPopup, setShowReAssignPopup: setShowReAssignPopup, setShowMoreInfoPopup: setShowMoreInfoPopup, fromDTD: fromDTD, showToppyForCompleteMoreInfo: showToppyForCompleteMoreInfo, moreInfoTasks: moreInfoTasks, setShowCommentForm: setShowCommentForm, showToppyForReferences: showToppyForReferences, dcmtReferences: dcmtReferences, referenceActionMap: referenceActionMap, handleNavigateToReference: handleNavigateToReference, addTaskCallback: addTaskCallback }) })] }), (showCommentForm && TID && DID) &&
|
|
1618
1622
|
_jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: TID, did: DID } }, onClose: () => setShowCommentForm(false), refreshCallback: handleCompleteMoreInfo, participants: [], showAttachmentsSection: false, allArchivedDocumentsFileItems: [] }), isOpenDetails &&
|
|
1619
1623
|
_jsx(StyledModalContainer, { children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenMaster &&
|
|
1620
1624
|
_jsxs(StyledModalContainer, { children: [_jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
@@ -1778,3 +1782,79 @@ const Ribbon = styled.div `
|
|
|
1778
1782
|
}
|
|
1779
1783
|
`}
|
|
1780
1784
|
`;
|
|
1785
|
+
const TaskLink = (props) => {
|
|
1786
|
+
const { messagePrefix, name, taskNameTrunc, description } = props;
|
|
1787
|
+
const mouseMoved = useRef(false);
|
|
1788
|
+
const handleMouseDown = () => {
|
|
1789
|
+
mouseMoved.current = false;
|
|
1790
|
+
};
|
|
1791
|
+
const handleMouseMove = () => {
|
|
1792
|
+
mouseMoved.current = true;
|
|
1793
|
+
};
|
|
1794
|
+
return (_jsx("div", { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' }, children: _jsxs("div", { onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, style: { display: 'inline' }, children: [messagePrefix, ` "${taskNameTrunc}" `, _jsx(TMTooltip, { parentStyle: { display: 'inline' }, childStyle: { display: 'inline' }, content: _jsxs("div", { style: { whiteSpace: 'pre-line', textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("b", { children: SDKUI_Localizator.Name }), ": ", name] }), _jsxs("div", { children: [_jsx("b", { children: SDKUI_Localizator.Description }), ": ", description] })] }), children: _jsx("i", { className: "dx-icon dx-icon-info", style: { fontSize: '16px', lineHeight: 1 } }) })] }) }));
|
|
1795
|
+
};
|
|
1796
|
+
const TMDcmtFormActionButtons = (props) => {
|
|
1797
|
+
const { showToppyForApprove, workItems, deviceType, isMobile, handleSignApprove, setShowApprovePopup, setShowRejectPopup, setShowReAssignPopup, setShowMoreInfoPopup, fromDTD, showToppyForCompleteMoreInfo, moreInfoTasks, setShowCommentForm, showToppyForReferences, dcmtReferences, referenceActionMap, handleNavigateToReference, addTaskCallback } = props;
|
|
1798
|
+
const tasksNumber = useMemo(() => moreInfoTasks?.length ?? 0, [moreInfoTasks]);
|
|
1799
|
+
const currentTask = useMemo(() => {
|
|
1800
|
+
if (!moreInfoTasks || moreInfoTasks.length === 0)
|
|
1801
|
+
return null;
|
|
1802
|
+
if (moreInfoTasks.length === 1)
|
|
1803
|
+
return moreInfoTasks[0];
|
|
1804
|
+
// If there are multiple tasks, we cannot determine which one is relevant, so we return null
|
|
1805
|
+
return null;
|
|
1806
|
+
}, [moreInfoTasks]);
|
|
1807
|
+
const { hasMoreInfo, hasApprove, hasReferences } = useMemo(() => {
|
|
1808
|
+
const referencesExist = showToppyForReferences && dcmtReferences?.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
1809
|
+
return {
|
|
1810
|
+
hasMoreInfo: Boolean(showToppyForCompleteMoreInfo),
|
|
1811
|
+
hasApprove: Boolean(showToppyForApprove),
|
|
1812
|
+
hasReferences: Boolean(referencesExist)
|
|
1813
|
+
};
|
|
1814
|
+
}, [
|
|
1815
|
+
showToppyForCompleteMoreInfo,
|
|
1816
|
+
showToppyForApprove,
|
|
1817
|
+
showToppyForReferences,
|
|
1818
|
+
dcmtReferences
|
|
1819
|
+
]);
|
|
1820
|
+
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, } }));
|
|
1821
|
+
return _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && (tasksNumber === 1 ? (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center' }, children: _jsx("div", { style: {
|
|
1822
|
+
padding: '10px',
|
|
1823
|
+
color: '#F0F0F0',
|
|
1824
|
+
maxWidth: '240px',
|
|
1825
|
+
borderRadius: '18px',
|
|
1826
|
+
background: 'linear-gradient(135deg, #1B1464 0%, #3A0CA3 60%, #4361EE 100%)',
|
|
1827
|
+
border: '1px solid rgba(255,255,255,0.25)',
|
|
1828
|
+
boxShadow: '0 10px 25px rgba(0,0,0,0.35)',
|
|
1829
|
+
backdropFilter: 'blur(6px)',
|
|
1830
|
+
display: 'flex',
|
|
1831
|
+
flexDirection: 'column',
|
|
1832
|
+
alignItems: 'center',
|
|
1833
|
+
textAlign: 'center',
|
|
1834
|
+
gap: '10px',
|
|
1835
|
+
cursor: 'default',
|
|
1836
|
+
}, children: (() => {
|
|
1837
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
1838
|
+
const isSender = currentTask?.fromID !== undefined && currentTask.fromID === userID;
|
|
1839
|
+
const isRecipient = currentTask?.toID !== undefined && currentTask.toID === userID;
|
|
1840
|
+
const truncate = (str, maxLength) => str && str.length > maxLength ? str.substring(0, maxLength) + '...' : str;
|
|
1841
|
+
const senderNameTruncated = currentTask?.fromName ? truncate(currentTask.fromName, 30) : 'N/A';
|
|
1842
|
+
const recipientNameTruncated = currentTask?.toName ? truncate(currentTask.toName, 30) : 'N/A';
|
|
1843
|
+
const taskNameTrunc = currentTask?.name ? truncate(currentTask.name.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', ''), 30) : 'N/A';
|
|
1844
|
+
return (_jsxs(_Fragment, { children: [(isSender && !isRecipient) && (_jsx(TaskLink, { messagePrefix: `Hai richiesto maggiori informazioni a "${recipientNameTruncated}" in merito all'attività`, name: currentTask.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: currentTask.description ?? 'N/A' })), (isRecipient && !isSender) && (_jsxs("div", { style: {
|
|
1845
|
+
display: 'flex',
|
|
1846
|
+
flexDirection: 'column',
|
|
1847
|
+
alignItems: 'center',
|
|
1848
|
+
gap: '10px'
|
|
1849
|
+
}, children: [_jsx(TaskLink, { messagePrefix: `"${senderNameTruncated}" ti ha richiesto maggiori informazioni in merito all'attività`, name: currentTask.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: currentTask.description ?? 'N/A' }), _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" })] }))] }));
|
|
1850
|
+
})() }) })) : (_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `Ci sono ${moreInfoTasks?.length ?? 0} richieste di maggiori informazioni. ${SDKUI_Localizator.ManageFromTaskPanel}` }))), hasMoreInfo && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
1851
|
+
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1852
|
+
:
|
|
1853
|
+
_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 && (_jsx(ReferencesContainer, { children: dcmtReferences
|
|
1854
|
+
?.filter(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup)
|
|
1855
|
+
.map((ref, index) => {
|
|
1856
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
1857
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
1858
|
+
return (_jsxs(StyledReferenceButton, { onClick: () => handleNavigateToReference(ref), onDoubleClick: (e) => { e.preventDefault(); e.stopPropagation(); }, children: [_jsx("span", { children: label }), _jsx("span", { children: `"${ref.objName}"` })] }, `ref-${index}-${ref.objID}`));
|
|
1859
|
+
}) }))] });
|
|
1860
|
+
};
|
|
@@ -617,7 +617,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
617
617
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
618
618
|
:
|
|
619
619
|
_jsx(_Fragment, {}), _jsx(TMLayoutItem, { children: _jsx(TMSearchResultGrid, { showSearch: showSearch, fromDTD: fromDTD, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, openInOffice: openInOffice, onDblClick: () => openFormHandler(LayoutModes.Update), floatingMenuItems: floatingMenuItems, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }) })] }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
620
|
-
_jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: floatingMenuItems, isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
620
|
+
_jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: floatingMenuItems, isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false), getAllTasks: getAllTasks }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
621
621
|
setIsOpenBatchUpdate(false);
|
|
622
622
|
}, onSavedCallbackAsync: async () => {
|
|
623
623
|
setIsOpenBatchUpdate(false);
|
|
@@ -254,10 +254,10 @@ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, foc
|
|
|
254
254
|
const passToArchive = () => {
|
|
255
255
|
return {
|
|
256
256
|
id: 'p2a',
|
|
257
|
-
icon: _jsx(IconMenuCAArchive, { fontSize: 16, viewBox: '11 11.5 26 27', strokeWidth: 2
|
|
257
|
+
icon: _jsx(IconMenuCAArchive, { fontSize: 16, viewBox: '11 11.5 26 27', strokeWidth: 2 }),
|
|
258
258
|
name: SDKUI_Localizator.PassToArchive,
|
|
259
259
|
operationType: 'singleRow',
|
|
260
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
260
|
+
disabled: dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
261
261
|
onClick: async () => {
|
|
262
262
|
try {
|
|
263
263
|
const item = selectedItems.length === 1 ? selectedItems[0] : focusedItem;
|
|
@@ -63,11 +63,12 @@ export declare const WorkflowEndInstanceModal: ({ selectedInstances, onClose, on
|
|
|
63
63
|
onClose?: () => void;
|
|
64
64
|
onCompleted?: () => Promise<void>;
|
|
65
65
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
66
|
-
export declare const WorkFlowMoreInfoPopUp: ({ DID, TID, deviceType, onClose, onCompleted }: {
|
|
66
|
+
export declare const WorkFlowMoreInfoPopUp: ({ DID, TID, deviceType, onClose, onCompleted, getAllTasks }: {
|
|
67
67
|
TID?: number;
|
|
68
68
|
DID?: number;
|
|
69
69
|
deviceType?: DeviceType;
|
|
70
70
|
onClose?: () => void;
|
|
71
71
|
onCompleted?: () => Promise<void>;
|
|
72
|
+
getAllTasks?: () => Promise<void>;
|
|
72
73
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
73
74
|
export {};
|
|
@@ -282,7 +282,7 @@ export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onComplet
|
|
|
282
282
|
: `${SDKUI_Localizator.WorkflowEndInstance} (${selectedInstances.length} istanze)`;
|
|
283
283
|
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx("div", { style: { fontWeight: 600, marginBottom: '8px' }, children: "Motivazione (obbligatorio):" }), _jsx(StyledTextArea, { "$isValid": !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value), placeholder: "Inserisci il motivo della terminazione...", maxLength: 200 }), _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconStop, {}), caption: SDKUI_Localizator.WorkflowEndInstance, width: '150px', disabled: disable, onClick: () => !disable && endInstancesAsync(), advancedColor: TMColors.error }) })] }) }));
|
|
284
284
|
};
|
|
285
|
-
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted }) => {
|
|
285
|
+
export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted, getAllTasks }) => {
|
|
286
286
|
const [users, setUsers] = useState([]);
|
|
287
287
|
const [task, setTask] = useState();
|
|
288
288
|
const [taskOrig, setTaskOrig] = useState();
|
|
@@ -316,6 +316,7 @@ export const WorkFlowMoreInfoPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
316
316
|
name: `${TASK_MORE_INFO_PREFIX_NAME}${nameInput}`
|
|
317
317
|
};
|
|
318
318
|
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(TID, DID, taskWithPrefix);
|
|
319
|
+
await getAllTasks?.();
|
|
319
320
|
ShowAlert({ mode: 'success', position: 'TOP_RIGHT', title: SDKUI_Localizator.MoreInformation, message: SDKUI_Localizator.MoreInfoSent, duration: 3000 });
|
|
320
321
|
}
|
|
321
322
|
catch (e) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.20.0-dev2.
|
|
3
|
+
"version": "6.20.0-dev2.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"lib"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@topconsultnpm/sdk-ts": "6.20.0-dev2.
|
|
43
|
+
"@topconsultnpm/sdk-ts": "6.20.0-dev2.6",
|
|
44
44
|
"buffer": "^6.0.3",
|
|
45
45
|
"devextreme": "25.2.4",
|
|
46
46
|
"devextreme-react": "25.2.4",
|