@topconsultnpm/sdkui-react 6.21.0-dev2.8 → 6.21.0-dev2.9
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.
|
@@ -19,6 +19,18 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
19
19
|
return null;
|
|
20
20
|
return moreInfoTasks[0];
|
|
21
21
|
}, [moreInfoTasks]);
|
|
22
|
+
// Verifica se la More Info Card sarà effettivamente renderizzata (non null)
|
|
23
|
+
const isMoreInfoCardVisible = useMemo(() => {
|
|
24
|
+
if (!firstTask)
|
|
25
|
+
return false;
|
|
26
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
27
|
+
const isSender = firstTask?.fromID !== undefined && firstTask.fromID === userID;
|
|
28
|
+
const isRecipient = firstTask?.toID !== undefined && firstTask.toID === userID;
|
|
29
|
+
// Caso 4: L'utente è sia mittente che destinatario - la card non viene renderizzata
|
|
30
|
+
if (isSender && isRecipient)
|
|
31
|
+
return false;
|
|
32
|
+
return true;
|
|
33
|
+
}, [firstTask]);
|
|
22
34
|
const { hasMoreInfo, hasApprove, hasReferences } = useMemo(() => {
|
|
23
35
|
const referencesExist = showToppyForReferences && dcmtReferences?.some(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup);
|
|
24
36
|
return {
|
|
@@ -56,6 +68,9 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
56
68
|
const senderNameTruncated = task?.fromName ? truncate(task.fromName, 30) : 'N/A';
|
|
57
69
|
const recipientNameTruncated = task?.toName ? truncate(task.toName, 30) : 'N/A';
|
|
58
70
|
const taskNameTrunc = task?.name ? truncate(task.name.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', ''), 30) : 'N/A';
|
|
71
|
+
// Caso 4: L'utente è sia mittente che destinatario - non renderizzare nulla
|
|
72
|
+
if (isSender && isRecipient)
|
|
73
|
+
return null;
|
|
59
74
|
return (_jsxs("div", { style: { position: 'relative', display: 'flex' }, children: [_jsxs("div", { style: {
|
|
60
75
|
padding: '10px',
|
|
61
76
|
color: '#FFFFFF',
|
|
@@ -156,10 +171,10 @@ const TMDcmtFormActionButtons = (props) => {
|
|
|
156
171
|
e.currentTarget.style.transform = 'translateY(-50%)';
|
|
157
172
|
}, children: formatBadgeCount(othersCount) }))] }));
|
|
158
173
|
};
|
|
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 ?
|
|
174
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [hasMoreInfo && firstTask && isMoreInfoCardVisible && (_jsx("div", { style: { display: 'flex', gap: "10px", flexDirection: 'column', alignItems: 'center', paddingRight: tasksNumber > 1 ? '36px' : '0' }, children: renderMoreInfoCard(firstTask, tasksNumber > 1) })), hasMoreInfo && isMoreInfoCardVisible && hasApprove && _jsx(Divider, {}), hasApprove && (workItems.length === 1 ?
|
|
160
175
|
_jsx(WorkFlowOperationButtons, { dtd: fromDTD, deviceType: deviceType, onApprove: () => updateShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => updateShowRejectPopup(true), onReAssign: () => updateShowReAssignPopup(true), onMoreInfo: () => updateShowMoreInfoPopup(true) })
|
|
161
176
|
:
|
|
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: {
|
|
177
|
+
_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 && isMoreInfoCardVisible && !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
178
|
display: 'flex',
|
|
164
179
|
flexDirection: 'column',
|
|
165
180
|
gap: '8px',
|