@topconsultnpm/sdkui-react 6.20.0-dev2.9 → 6.20.0-prova-sdkui2.13
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/choosers/TMMetadataChooser.js +1 -1
- package/lib/components/features/archive/TMArchive.js +29 -42
- package/lib/components/features/documents/TMDcmtForm.js +114 -38
- package/lib/components/features/documents/TMMasterDetailDcmts.js +1 -1
- package/lib/components/features/search/TMSearchResult.d.ts +1 -0
- package/lib/components/features/search/TMSearchResult.js +39 -70
- 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/lib/components/forms/Login/TMLoginForm.js +1 -1
- package/lib/components/query/TMQueryEditor.d.ts +1 -0
- package/lib/components/query/TMQueryEditor.js +2 -2
- package/lib/helper/GlobalStyles.js +3 -0
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/TMUtils.js +2 -2
- package/lib/helper/queryHelper.js +1 -1
- package/lib/hooks/useDcmtOperations.js +14 -2
- package/lib/hooks/useRelatedDocuments.js +34 -11
- 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;
|
|
@@ -21,7 +21,7 @@ const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, butto
|
|
|
21
21
|
return undefined;
|
|
22
22
|
};
|
|
23
23
|
const renderTemplate = useMemo(() => {
|
|
24
|
-
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
|
|
24
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder ?? SDKUI_Localizator.SelectMetadata })] }));
|
|
25
25
|
}, [values, tmSession, showId, showCompleteMetadataName, placeHolder]);
|
|
26
26
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => {
|
|
27
27
|
if (!disabled) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import Logo from '../../../assets/Toppy-generico.png';
|
|
4
|
-
import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { ArchiveConstraints, DcmtTypeListCacheService, LayoutModes, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { IconTree, SDKUI_Globals, SDKUI_Localizator, IconRecentlyViewed, IconPreview, IconShow, IconBoard, IconDcmtTypeSys, removeMruTid, getMoreInfoTasksForDocument } from '../../../helper';
|
|
6
6
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
7
7
|
import TMLayoutContainer from '../../base/TMLayout';
|
|
@@ -145,49 +145,36 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
145
145
|
export default TMArchive;
|
|
146
146
|
const TMTreeSelectorWrapper = ({ isMobile, isSharedArchive, onSelectedTIDChanged }) => {
|
|
147
147
|
const { setPanelVisibilityById, toggleMaximize, setToolbarButtonVisibility, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
162
|
-
} }));
|
|
148
|
+
const updatePanelsVisibility = async (tid) => {
|
|
149
|
+
if (!tid)
|
|
150
|
+
return;
|
|
151
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
152
|
+
const isOnlyMetadata = dtd?.archiveConstraint === ArchiveConstraints.OnlyMetadata;
|
|
153
|
+
const previewVisible = !isSharedArchive && !isOnlyMetadata;
|
|
154
|
+
setPanelVisibilityById('tmDcmtPreview', previewVisible);
|
|
155
|
+
setToolbarButtonVisibility('tmDcmtPreview', previewVisible);
|
|
156
|
+
setPanelVisibilityById('tmDcmtForm', true);
|
|
157
|
+
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
158
|
+
};
|
|
159
|
+
return (_jsx(TMTreeSelector, { layoutMode: LayoutModes.Ark, onClosePanel: !isMobile && countVisibleLeafPanels() > 1 ? () => setPanelVisibilityById('tmTreeSelector', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: !isMobile && countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmTreeSelector") : undefined, onSelectedTIDChanged: async (tid) => { updatePanelsVisibility(tid); onSelectedTIDChanged?.(tid); } }));
|
|
163
160
|
};
|
|
164
161
|
const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceType, isSharedArchive, onSelectedTID, onDeletedTID }) => {
|
|
165
162
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
163
|
+
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
164
|
+
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
165
|
+
const updatePanelsVisibility = async (tid) => {
|
|
166
|
+
if (!tid)
|
|
167
|
+
return;
|
|
168
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
169
|
+
const isOnlyMetadata = dtd?.archiveConstraint === ArchiveConstraints.OnlyMetadata;
|
|
170
|
+
const previewVisible = !isSharedArchive && !isOnlyMetadata;
|
|
171
|
+
setPanelVisibilityById('tmDcmtPreview', previewVisible);
|
|
172
|
+
setToolbarButtonVisibility('tmDcmtPreview', previewVisible);
|
|
173
|
+
setPanelVisibilityById('tmDcmtForm', true);
|
|
174
|
+
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
175
|
+
};
|
|
166
176
|
useEffect(() => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
171
|
-
}
|
|
172
|
-
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
173
|
-
}
|
|
174
|
-
}, [currentTID, isSharedArchive]);
|
|
175
|
-
return (_jsx(TMRecentsManager, { accessFilter: 'canArchive', mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
176
|
-
onSelectedTID?.(tid);
|
|
177
|
-
if (deviceType === DeviceType.MOBILE) {
|
|
178
|
-
setPanelVisibilityById('tmDcmtForm', true);
|
|
179
|
-
}
|
|
180
|
-
else {
|
|
181
|
-
setPanelVisibilityById('tmDcmtForm', true);
|
|
182
|
-
if (!isSharedArchive) {
|
|
183
|
-
setPanelVisibilityById('tmDcmtPreview', true);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
if (!isSharedArchive) {
|
|
187
|
-
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
188
|
-
}
|
|
189
|
-
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
190
|
-
}, onDeletedTID: (tid) => {
|
|
191
|
-
onDeletedTID?.(tid);
|
|
192
|
-
} }));
|
|
177
|
+
updatePanelsVisibility(currentTID);
|
|
178
|
+
}, [currentTID, isSharedArchive, isMobile]);
|
|
179
|
+
return (_jsx(TMRecentsManager, { accessFilter: "canArchive", mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: async (tid) => { await updatePanelsVisibility(tid); onSelectedTID?.(tid); }, onDeletedTID: onDeletedTID }));
|
|
193
180
|
};
|
|
@@ -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';
|
|
@@ -123,6 +123,10 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
123
123
|
const [refreshBlogTrigger, setRefreshBlogTrigger] = useState(0);
|
|
124
124
|
const [wfError, setWfError] = useState(null);
|
|
125
125
|
const [metadataDcmtOrigin, setMetadataDcmtOrigin] = useState(null);
|
|
126
|
+
const isReadOnlyOriginCallback = useCallback((fromTID) => {
|
|
127
|
+
return layoutMode !== LayoutModes.Ark && layoutMode !== LayoutModes.ArkFromBasket && layoutMode !== LayoutModes.ArkFromFile && layoutMode !== LayoutModes.ArkFromMail
|
|
128
|
+
&& fromTID?.toString() !== TID?.toString();
|
|
129
|
+
}, [layoutMode, TID]);
|
|
126
130
|
const triggerBlogRefresh = useCallback(async () => {
|
|
127
131
|
setRefreshBlogTrigger(prev => prev + 1);
|
|
128
132
|
}, []);
|
|
@@ -194,7 +198,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
194
198
|
let dtd = res?.dtdResult;
|
|
195
199
|
let rows = dtd.rows ? dtd.rows[0] : [];
|
|
196
200
|
let mids = res?.selectMIDs;
|
|
197
|
-
let metadataList = searchResultToMetadataValues(TID, dtd, rows, mids, mdList, layoutMode, origin.fromTID
|
|
201
|
+
let metadataList = searchResultToMetadataValues(TID, dtd, rows, mids, mdList, layoutMode, isReadOnlyOriginCallback(origin.fromTID));
|
|
198
202
|
if (archived) {
|
|
199
203
|
// Usa setFormData con funzione callback per accedere allo stato precedente
|
|
200
204
|
// invece di dipendere da formDataOrig nell'array di dipendenze
|
|
@@ -282,7 +286,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
282
286
|
}
|
|
283
287
|
else {
|
|
284
288
|
const renderedMetadata = dtd?.metadata?.filter((metadata) => handleArchiveVisibility(metadata)) ?? [];
|
|
285
|
-
const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode, metadataDcmtOrigin?.fromTID
|
|
289
|
+
const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode, isReadOnlyOriginCallback(metadataDcmtOrigin?.fromTID));
|
|
286
290
|
setFormDataOrig(structuredClone(metadataList));
|
|
287
291
|
setFormData(structuredClone(metadataList));
|
|
288
292
|
formDataOrigRef.current = structuredClone(metadataList);
|
|
@@ -297,7 +301,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
297
301
|
setIsInitialLoading(false);
|
|
298
302
|
setIsNavigating(false);
|
|
299
303
|
}
|
|
300
|
-
}, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs, metadataDcmtOrigin?.fromTID]);
|
|
304
|
+
}, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs, isReadOnlyOriginCallback, metadataDcmtOrigin?.fromTID]);
|
|
301
305
|
const createChange = useCallback((mid, metadataType, modifiedValue) => {
|
|
302
306
|
return { mid, metadataType, modifiedValue };
|
|
303
307
|
}, []);
|
|
@@ -642,8 +646,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
642
646
|
if (layoutMode !== LayoutModes.Update || !moreInfoTasks) {
|
|
643
647
|
return false;
|
|
644
648
|
}
|
|
645
|
-
return moreInfoTasks.some(task => isTaskMoreInfo(task.name) &&
|
|
646
|
-
task.state !== Task_States.Completed);
|
|
649
|
+
return moreInfoTasks.some(task => isTaskMoreInfo(task.name) && task.state !== Task_States.Completed);
|
|
647
650
|
}, [layoutMode, moreInfoTasks]);
|
|
648
651
|
const showToppyForReferences = useMemo(() => {
|
|
649
652
|
if (!allowButtonsRefs || layoutMode !== LayoutModes.Update || isOpenDetails || isOpenMaster)
|
|
@@ -1184,8 +1187,10 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1184
1187
|
}, [focusedMetadataValue?.value, focusedMetadataValue?.mid, TID]);
|
|
1185
1188
|
const handleWFOperationCompleted = useCallback(async () => {
|
|
1186
1189
|
await onWFOperationCompleted?.();
|
|
1187
|
-
|
|
1188
|
-
|
|
1190
|
+
if (!showMoreInfoPopup) {
|
|
1191
|
+
onClose?.();
|
|
1192
|
+
}
|
|
1193
|
+
}, [onWFOperationCompleted, onClose, showMoreInfoPopup]);
|
|
1189
1194
|
// Determina se showAll deve essere automaticamente true
|
|
1190
1195
|
// Best practice: usa useMemo per calcolare valori derivati invece di useEffect con setState
|
|
1191
1196
|
const shouldShowAll = useMemo(() => {
|
|
@@ -1214,17 +1219,9 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1214
1219
|
return null;
|
|
1215
1220
|
return (_jsx(Ribbon, { "$isMobile": isMobile, children: _jsx(TMTooltip, { content: checkoutStatus.editLockTooltipText, position: "right", children: _jsx("span", { children: checkoutStatus.mode === 'editMode' ? SDKUI_Localizator.CheckOut : 'Locked' }) }) }));
|
|
1216
1221
|
}, [formData, fromDTD, isMobile]);
|
|
1217
|
-
const isReadOnlyOrigin = useMemo(() => {
|
|
1218
|
-
return layoutMode !== LayoutModes.Ark &&
|
|
1219
|
-
layoutMode !== LayoutModes.ArkFromBasket &&
|
|
1220
|
-
layoutMode !== LayoutModes.ArkFromFile &&
|
|
1221
|
-
layoutMode !== LayoutModes.ArkFromMail &&
|
|
1222
|
-
metadataDcmtOrigin?.fromTID?.toString() !== TID?.toString();
|
|
1223
|
-
}, [layoutMode, metadataDcmtOrigin?.fromTID, TID]);
|
|
1224
1222
|
const tmDcmtForm = useMemo(() => {
|
|
1225
|
-
console.log("layoutMode:", layoutMode);
|
|
1226
1223
|
return _jsxs(_Fragment, { children: [checkoutBadge && _jsx("div", { style: { padding: '10px', display: 'flex', justifyContent: 'center' }, children: checkoutBadge }), metadataValuesSource.length > 0 &&
|
|
1227
|
-
_jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, isReadOnlyOrigin:
|
|
1224
|
+
_jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, isReadOnlyOrigin: isReadOnlyOriginCallback(metadataDcmtOrigin?.fromTID), onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
|
|
1228
1225
|
setFormData((prevItems) => prevItems.map((item) => {
|
|
1229
1226
|
const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
|
|
1230
1227
|
return newItem ? { ...item, ...newItem } : item;
|
|
@@ -1270,7 +1267,8 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1270
1267
|
handleConfirmAction,
|
|
1271
1268
|
handleUndo,
|
|
1272
1269
|
handleClearForm,
|
|
1273
|
-
|
|
1270
|
+
isReadOnlyOriginCallback,
|
|
1271
|
+
metadataDcmtOrigin?.fromTID,
|
|
1274
1272
|
]);
|
|
1275
1273
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID, allTasks: allTasks, fetchBlogDataTrigger: refreshBlogTrigger, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [TID, DID, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers]);
|
|
1276
1274
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
|
|
@@ -1392,7 +1390,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1392
1390
|
const { assignedToMe, assignedByMe } = getDcmtTasksCounter(TID, DID, allTasks);
|
|
1393
1391
|
let titleDcmtFormPanel = fromDTD?.nameLoc ?? "";
|
|
1394
1392
|
// Caso: Il documento proviene da un'origine esterna
|
|
1395
|
-
if (
|
|
1393
|
+
if (isReadOnlyOriginCallback(metadataDcmtOrigin?.fromTID)) {
|
|
1396
1394
|
titleDcmtFormPanel = (_jsxs("div", { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' }, children: [_jsx(TMTooltip, { content: _jsxs("div", { style: { textAlign: 'left' }, children: [_jsx("p", { children: "Questo documento proviene da un'altra origine e non pu\u00F2 essere modificato." }), _jsx("hr", {}), _jsxs("p", { children: [_jsx("strong", { children: "TID corrente:" }), " ", TID?.toString()] }), _jsxs("p", { children: [_jsx("strong", { children: "Nome corrente:" }), " ", fromDTD?.nameLoc] }), _jsx("hr", {}), _jsxs("p", { children: [_jsx("strong", { children: "TID origine:" }), " ", metadataDcmtOrigin?.fromTID?.toString()] }), _jsxs("p", { children: [_jsx("strong", { children: "Nome origine:" }), " ", metadataDcmtOrigin?.fromName] })] }), children: _jsx(IconLock, { fontSize: 16, style: { alignSelf: 'center' } }) }), metadataDcmtOrigin?.fromName] }));
|
|
1397
1395
|
}
|
|
1398
1396
|
const panels = [
|
|
@@ -1476,7 +1474,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1476
1474
|
},
|
|
1477
1475
|
];
|
|
1478
1476
|
return panels;
|
|
1479
|
-
}, [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID,
|
|
1477
|
+
}, [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID, isReadOnlyOriginCallback, metadataDcmtOrigin?.fromTID]);
|
|
1480
1478
|
// Retrieves the current document form setting based on the normalized TID
|
|
1481
1479
|
const getCurrentDcmtFormSetting = () => {
|
|
1482
1480
|
const settings = SDKUI_Globals.userSettings.dcmtFormSettings;
|
|
@@ -1531,15 +1529,30 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1531
1529
|
};
|
|
1532
1530
|
const handleCompleteMoreInfo = useCallback(async () => {
|
|
1533
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];
|
|
1534
1543
|
TMSpinner.show();
|
|
1535
|
-
|
|
1544
|
+
const newTask = { ...firstTask, state: Task_States.Completed };
|
|
1536
1545
|
await SDK_Globals.tmSession?.NewTaskEngine().UpdateAsync(newTask);
|
|
1537
1546
|
onTaskCompleted?.(newTask);
|
|
1538
1547
|
onClose?.();
|
|
1539
|
-
ShowAlert({
|
|
1548
|
+
ShowAlert({
|
|
1549
|
+
mode: 'success',
|
|
1550
|
+
title: SDKUI_Localizator.MoreInformation,
|
|
1551
|
+
message: SDKUI_Localizator.MoreInfoCompleted,
|
|
1552
|
+
duration: 3000
|
|
1553
|
+
});
|
|
1540
1554
|
}
|
|
1541
1555
|
catch (e) {
|
|
1542
|
-
TMSpinner.hide();
|
|
1543
1556
|
TMExceptionBoxManager.show({ exception: e });
|
|
1544
1557
|
}
|
|
1545
1558
|
finally {
|
|
@@ -1605,19 +1618,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1605
1618
|
isEditable: true,
|
|
1606
1619
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1607
1620
|
}));
|
|
1608
|
-
} }), 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:
|
|
1609
|
-
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1610
|
-
:
|
|
1611
|
-
_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)
|
|
1612
|
-
.map((ref, index, arr) => {
|
|
1613
|
-
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
1614
|
-
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
1615
|
-
return (_jsxs(React.Fragment, { children: [index === 0 && (showToppyForApprove || showToppyForCompleteMoreInfo) && (_jsx("div", { style: {
|
|
1616
|
-
height: 1,
|
|
1617
|
-
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
1618
|
-
margin: '6px 0'
|
|
1619
|
-
} })), _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}`));
|
|
1620
|
-
})] }) })] }), (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) &&
|
|
1621
1622
|
_jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: TID, did: DID } }, onClose: () => setShowCommentForm(false), refreshCallback: handleCompleteMoreInfo, participants: [], showAttachmentsSection: false, allArchivedDocumentsFileItems: [] }), isOpenDetails &&
|
|
1622
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 &&
|
|
1623
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) => {
|
|
@@ -1781,3 +1782,78 @@ const Ribbon = styled.div `
|
|
|
1781
1782
|
}
|
|
1782
1783
|
`}
|
|
1783
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: '#FFFFFF',
|
|
1824
|
+
maxWidth: '240px',
|
|
1825
|
+
background: 'linear-gradient(135deg, #1E90FF 0%, #0077BE 60%, #00509E 100%)',
|
|
1826
|
+
border: '1px solid rgba(255,255,255,0.15)',
|
|
1827
|
+
boxShadow: '0 8px 20px rgba(0, 0, 50, 0.4)',
|
|
1828
|
+
backdropFilter: 'blur(6px)',
|
|
1829
|
+
display: 'flex',
|
|
1830
|
+
flexDirection: 'column',
|
|
1831
|
+
alignItems: 'center',
|
|
1832
|
+
textAlign: 'center',
|
|
1833
|
+
gap: '10px',
|
|
1834
|
+
cursor: 'default',
|
|
1835
|
+
}, children: (() => {
|
|
1836
|
+
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
1837
|
+
const isSender = currentTask?.fromID !== undefined && currentTask.fromID === userID;
|
|
1838
|
+
const isRecipient = currentTask?.toID !== undefined && currentTask.toID === userID;
|
|
1839
|
+
const truncate = (str, maxLength) => str && str.length > maxLength ? str.substring(0, maxLength) + '...' : str;
|
|
1840
|
+
const senderNameTruncated = currentTask?.fromName ? truncate(currentTask.fromName, 30) : 'N/A';
|
|
1841
|
+
const recipientNameTruncated = currentTask?.toName ? truncate(currentTask.toName, 30) : 'N/A';
|
|
1842
|
+
const taskNameTrunc = currentTask?.name ? truncate(currentTask.name.replace(TASK_MORE_INFO_PREFIX_NAME ?? '', ''), 30) : 'N/A';
|
|
1843
|
+
return (_jsxs(_Fragment, { children: [(isSender && !isRecipient) && (_jsx(TaskLink, { messagePrefix: `Hai richiesto maggiori informazioni a "${recipientNameTruncated}" tramite l'attività`, name: currentTask.name ?? 'N/A', taskNameTrunc: taskNameTrunc ?? 'N/A', description: currentTask.description ?? 'N/A' })), (isRecipient && !isSender) && (_jsxs("div", { style: {
|
|
1844
|
+
display: 'flex',
|
|
1845
|
+
flexDirection: 'column',
|
|
1846
|
+
alignItems: 'center',
|
|
1847
|
+
gap: '10px'
|
|
1848
|
+
}, children: [_jsx(TaskLink, { messagePrefix: `"${senderNameTruncated}" ti ha richiesto maggiori informazioni tramite l'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" })] }))] }));
|
|
1849
|
+
})() }) })) : (_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 ?
|
|
1850
|
+
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1851
|
+
:
|
|
1852
|
+
_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
|
|
1853
|
+
?.filter(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup)
|
|
1854
|
+
.map((ref, index) => {
|
|
1855
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
1856
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
1857
|
+
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}`));
|
|
1858
|
+
}) }))] });
|
|
1859
|
+
};
|
|
@@ -267,7 +267,7 @@ const TMFormOrResultWrapper = ({ deviceType, focusedItem, onTaskCreateRequest, a
|
|
|
267
267
|
_jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => {
|
|
268
268
|
setPanelVisibilityById('tmTreeView', true);
|
|
269
269
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did) }) :
|
|
270
|
-
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => {
|
|
270
|
+
_jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => {
|
|
271
271
|
setPanelVisibilityById('tmTreeView', true);
|
|
272
272
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }));
|
|
273
273
|
};
|
|
@@ -3,7 +3,7 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
|
|
3
3
|
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService, AppModules } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument,
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconPlatform, getSearchToolbarVisibility } from '../../../helper';
|
|
7
7
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
8
8
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
@@ -36,7 +36,6 @@ import ShowAlert from '../../base/TMAlert';
|
|
|
36
36
|
import TMSpinner from '../../base/TMSpinner';
|
|
37
37
|
import TMChooserForm from '../../forms/TMChooserForm';
|
|
38
38
|
import TMModal from '../../base/TMModal';
|
|
39
|
-
import TMTooltip from '../../base/TMTooltip';
|
|
40
39
|
import TMSearch from './TMSearch';
|
|
41
40
|
import TMArchive from '../archive/TMArchive';
|
|
42
41
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
@@ -69,7 +68,7 @@ const orderByName = (array) => {
|
|
|
69
68
|
return 1;
|
|
70
69
|
} return 0; });
|
|
71
70
|
};
|
|
72
|
-
const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
|
|
71
|
+
const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
|
|
73
72
|
const [id, setID] = useState('');
|
|
74
73
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
75
74
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -98,10 +97,9 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
98
97
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
99
98
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
100
99
|
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
101
|
-
const [indexingInfoCache, setIndexingInfoCache] = useState(new Map());
|
|
102
100
|
const [showIndexingInfo, setShowIndexingInfo] = useState(false);
|
|
103
101
|
const [loadingIndexingInfo, setLoadingIndexingInfo] = useState(false);
|
|
104
|
-
const [
|
|
102
|
+
const [indexingInfo, setIndexingInfo] = useState('');
|
|
105
103
|
const floatingBarContainerRef = useRef(null);
|
|
106
104
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
107
105
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
@@ -619,7 +617,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
619
617
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
620
618
|
:
|
|
621
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 &&
|
|
622
|
-
_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: () => {
|
|
623
621
|
setIsOpenBatchUpdate(false);
|
|
624
622
|
}, onSavedCallbackAsync: async () => {
|
|
625
623
|
setIsOpenBatchUpdate(false);
|
|
@@ -737,32 +735,35 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
737
735
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID, fetchBlogDataTrigger: refreshBlogTrigger, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [focusedItem, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers]);
|
|
738
736
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [focusedItem, currentMetadataValues, deviceType]);
|
|
739
737
|
const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }, refreshPreviewTrigger), [currentDcmt, refreshPreviewTrigger]);
|
|
738
|
+
// Auto-fetch indexing info when drawer is open and focusedItem changes
|
|
740
739
|
useEffect(() => {
|
|
741
|
-
if (!focusedItem)
|
|
740
|
+
if (!focusedItem || !showIndexingInfo)
|
|
742
741
|
return;
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
|
|
742
|
+
const fetchData = async () => {
|
|
743
|
+
try {
|
|
744
|
+
setLoadingIndexingInfo(true);
|
|
745
|
+
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
|
|
746
|
+
setIndexingInfo(msg ?? '');
|
|
747
|
+
}
|
|
748
|
+
catch (e) {
|
|
749
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
750
|
+
}
|
|
751
|
+
finally {
|
|
752
|
+
setLoadingIndexingInfo(false);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
fetchData();
|
|
756
|
+
}, [focusedItem, showIndexingInfo]);
|
|
746
757
|
const handleToggleIndexingInfo = async () => {
|
|
747
758
|
if (!focusedItem)
|
|
748
759
|
return;
|
|
749
|
-
const
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
const newSet = new Set(prev);
|
|
753
|
-
newSet.delete(cacheKey);
|
|
754
|
-
return newSet;
|
|
755
|
-
});
|
|
756
|
-
setShowIndexingInfo(false);
|
|
757
|
-
return;
|
|
758
|
-
}
|
|
759
|
-
setOpenedDrawerItems(prev => new Set(prev).add(cacheKey));
|
|
760
|
-
setShowIndexingInfo(true);
|
|
761
|
-
if (!indexingInfoCache.has(cacheKey)) {
|
|
760
|
+
const newShowState = !showIndexingInfo;
|
|
761
|
+
setShowIndexingInfo(newShowState);
|
|
762
|
+
if (newShowState) {
|
|
762
763
|
try {
|
|
763
764
|
setLoadingIndexingInfo(true);
|
|
764
765
|
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
|
|
765
|
-
|
|
766
|
+
setIndexingInfo(msg ?? '');
|
|
766
767
|
}
|
|
767
768
|
catch (e) {
|
|
768
769
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -772,22 +773,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
772
773
|
}
|
|
773
774
|
}
|
|
774
775
|
};
|
|
775
|
-
const handleRefreshIndexingInfo = async () => {
|
|
776
|
-
if (!focusedItem)
|
|
777
|
-
return;
|
|
778
|
-
const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
|
|
779
|
-
try {
|
|
780
|
-
setLoadingIndexingInfo(true);
|
|
781
|
-
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
|
|
782
|
-
setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
|
|
783
|
-
}
|
|
784
|
-
catch (e) {
|
|
785
|
-
TMExceptionBoxManager.show({ exception: e });
|
|
786
|
-
}
|
|
787
|
-
finally {
|
|
788
|
-
setLoadingIndexingInfo(false);
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
776
|
const tmFullTextSearch = useMemo(() => {
|
|
792
777
|
if (!focusedItem) {
|
|
793
778
|
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Seleziona un documento per visualizzare i dettagli della ricerca full-text" }), " "] }));
|
|
@@ -804,23 +789,21 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
804
789
|
if (!ftExplanation) {
|
|
805
790
|
return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info disponibile per questo documento" }), " "] }));
|
|
806
791
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden', width: '100%' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsxs(StyledLeftContent, { children: [_jsx(IconInfo, {}), _jsx("span", { children: showIndexingInfo ? 'Nascondi' : SDKUI_Localizator.IndexingInformation })] }), _jsxs(StyledRightContent, { children: [cachedInfo && (_jsxs(_Fragment, { children: [_jsx(TMTooltip, { content: "Aggiorna", children: _jsx(StyledRefreshIcon, { onClick: (e) => { e.stopPropagation(); handleRefreshIndexingInfo(); }, children: _jsx(IconRefresh, {}) }) }), _jsx(TMTooltip, { content: "Da cache", children: _jsx(StyledCachedIcon, { children: _jsx(IconCache, {}) }) })] })), _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" })] })] }), loadingIndexingInfo && !cachedInfo && (_jsxs("div", { style: { marginTop: '10px', color: '#666' }, children: [SDKUI_Localizator.Loading, "..."] })), showIndexingInfo && cachedInfo && (_jsxs(StyledIndexingInfoBox, { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: cachedInfo } }), loadingIndexingInfo && (_jsxs("div", { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', background: 'rgba(255, 255, 255, 0.9)', padding: '10px', borderRadius: '4px', boxShadow: '0 2px 8px rgba(0,0,0,0.15)' }, children: [SDKUI_Localizator.Loading, "..."] }))] }))] })] }));
|
|
810
|
-
}, [selectedSearchResult, focusedItem, indexingInfoCache, showIndexingInfo, loadingIndexingInfo]);
|
|
792
|
+
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden', width: '100%' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsx(StyledLeftContent, { children: _jsx("span", { children: SDKUI_Localizator.IndexingInformation }) }), _jsx(StyledRightContent, { children: _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" }) })] }), showIndexingInfo && indexingInfo && (_jsxs(StyledIndexingInfoBox, { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: indexingInfo } }), loadingIndexingInfo && (_jsxs("div", { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', background: 'rgba(255, 255, 255, 0.9)', padding: '10px', borderRadius: '4px', boxShadow: '0 2px 8px rgba(0,0,0,0.15)' }, children: [SDKUI_Localizator.Loading, "..."] }))] }))] })] }));
|
|
793
|
+
}, [selectedSearchResult, focusedItem, indexingInfo, showIndexingInfo, loadingIndexingInfo]);
|
|
811
794
|
const allInitialPanelVisibility = {
|
|
812
795
|
'tmSearchResult': true,
|
|
813
796
|
'tmBlog': false,
|
|
814
797
|
'tmSysMetadata': false,
|
|
815
|
-
'tmDcmtPreview': false,
|
|
816
798
|
'tmFullTextSearch': false,
|
|
799
|
+
'tmDcmtPreview': false,
|
|
817
800
|
};
|
|
818
801
|
const initialPanelDimensions = {
|
|
819
802
|
'tmSearchResult': { width: '25%', height: '100%' },
|
|
820
803
|
'tmBlog': { width: '25%', height: '100%' },
|
|
821
804
|
'tmSysMetadata': { width: '25%', height: '100%' },
|
|
822
|
-
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
823
805
|
'tmFullTextSearch': { width: '25%', height: '100%' },
|
|
806
|
+
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
824
807
|
};
|
|
825
808
|
const initialPanels = useMemo(() => [
|
|
826
809
|
{
|
|
@@ -853,20 +836,20 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
853
836
|
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
|
854
837
|
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
855
838
|
},
|
|
856
|
-
{
|
|
857
|
-
id: 'tmDcmtPreview',
|
|
858
|
-
name: SDKUI_Localizator.PreviewDocument,
|
|
859
|
-
contentOptions: { component: tmDcmtPreview },
|
|
860
|
-
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
861
|
-
},
|
|
862
839
|
...(context === SearchResultContext.FREE_SEARCH ? [
|
|
863
840
|
{
|
|
864
841
|
id: 'tmFullTextSearch',
|
|
865
842
|
name: SDKUI_Localizator.ResultDetails,
|
|
866
843
|
contentOptions: { component: tmFullTextSearch, panelContainer: { title: SDKUI_Localizator.ResultDetails, allowMaximize: !isMobile } },
|
|
867
|
-
toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber:
|
|
844
|
+
toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 4, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
|
|
868
845
|
}
|
|
869
|
-
] : [])
|
|
846
|
+
] : []),
|
|
847
|
+
{
|
|
848
|
+
id: 'tmDcmtPreview',
|
|
849
|
+
name: SDKUI_Localizator.PreviewDocument,
|
|
850
|
+
contentOptions: { component: tmDcmtPreview },
|
|
851
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: context === SearchResultContext.FREE_SEARCH ? 5 : 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
852
|
+
}
|
|
870
853
|
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
|
|
871
854
|
return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
|
|
872
855
|
display: 'flex',
|
|
@@ -880,7 +863,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
880
863
|
:
|
|
881
864
|
_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar }) }) }) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), 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) => {
|
|
882
865
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }, `${index}-${dcmt.DID}`));
|
|
883
|
-
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: handleSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar:
|
|
866
|
+
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: handleSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
|
|
884
867
|
setIsOpenArchiveRelationForm(false);
|
|
885
868
|
setArchiveType(undefined);
|
|
886
869
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -891,7 +874,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
891
874
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
892
875
|
setArchiveRelatedDcmtFormMids([]);
|
|
893
876
|
await onRefreshSearchAsync?.();
|
|
894
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar:
|
|
877
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
|
|
895
878
|
};
|
|
896
879
|
export default TMSearchResult;
|
|
897
880
|
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
|
|
@@ -1423,20 +1406,6 @@ const StyledRightContent = styled.div `
|
|
|
1423
1406
|
align-items: center;
|
|
1424
1407
|
gap: 8px;
|
|
1425
1408
|
`;
|
|
1426
|
-
const StyledCachedIcon = styled.div `
|
|
1427
|
-
display: flex;
|
|
1428
|
-
align-items: center;
|
|
1429
|
-
justify-content: center;
|
|
1430
|
-
font-size: 16px;
|
|
1431
|
-
`;
|
|
1432
|
-
const StyledRefreshIcon = styled.div `
|
|
1433
|
-
display: flex;
|
|
1434
|
-
align-items: center;
|
|
1435
|
-
justify-content: center;
|
|
1436
|
-
font-size: 16px;
|
|
1437
|
-
cursor: pointer;
|
|
1438
|
-
transition: transform 0.2s ease;
|
|
1439
|
-
`;
|
|
1440
1409
|
const StyledChevron = styled.span `
|
|
1441
1410
|
transition: transform 0.2s ease;
|
|
1442
1411
|
transform: ${props => props.$isOpen ? 'rotate(180deg)' : 'rotate(0deg)'};
|
|
@@ -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) {
|
|
@@ -115,7 +115,7 @@ const TMLoginForm = (props) => {
|
|
|
115
115
|
const [dcmtArchive, setDcmtArchive] = useState();
|
|
116
116
|
const [manualArchiveID, setManualArchiveID] = useState('');
|
|
117
117
|
const [authMode, setAuthMode] = useState(AuthenticationModes.TopMedia);
|
|
118
|
-
const [username, setUsername] = useState('
|
|
118
|
+
const [username, setUsername] = useState('');
|
|
119
119
|
const [password, setPassword] = useState('');
|
|
120
120
|
const [authDomain, setAuthDomain] = useState('');
|
|
121
121
|
const [usernameOnBehalf, setUsernameOnBehalf] = useState('');
|
|
@@ -48,6 +48,7 @@ interface ITMQueryEditor extends ITMApplyFormProps<QueryDescriptor> {
|
|
|
48
48
|
ShowOnlySAP?: boolean;
|
|
49
49
|
updateIsModalOpen?: (isOpen: boolean) => void;
|
|
50
50
|
showSearchResultSidebar?: boolean;
|
|
51
|
+
showDcmtFormSidebar?: boolean;
|
|
51
52
|
showToppyDraggableHelpCenter?: boolean;
|
|
52
53
|
toppyHelpCenterUsePortal?: boolean;
|
|
53
54
|
}
|
|
@@ -62,7 +62,7 @@ export function useQueryApplyForm(d, formMode, inputData, onApplied, parameters)
|
|
|
62
62
|
const [validationItems, setValidationItems] = useState([]);
|
|
63
63
|
return { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData };
|
|
64
64
|
}
|
|
65
|
-
const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged, ShowOnlySAP, updateIsModalOpen, showSearchResultSidebar = true, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false }) => {
|
|
65
|
+
const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged, ShowOnlySAP, updateIsModalOpen, showSearchResultSidebar = true, showDcmtFormSidebar = true, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false }) => {
|
|
66
66
|
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
|
67
67
|
const { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData } = useQueryApplyForm(Descriptors.Query, formMode, inputData, onApplied);
|
|
68
68
|
const [dcmtTypesList, setDcmtTypesList] = useState([]);
|
|
@@ -598,7 +598,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
|
|
|
598
598
|
// #region Ricerca
|
|
599
599
|
const renderResultSearchForm = (_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, onClose: () => {
|
|
600
600
|
setShowResultSearch(false);
|
|
601
|
-
}, searchResults: resultSearch, showSearchResultSidebar: showSearchResultSidebar, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal }));
|
|
601
|
+
}, searchResults: resultSearch, showSearchResultSidebar: showSearchResultSidebar, showDcmtFormSidebar: showDcmtFormSidebar, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal }));
|
|
602
602
|
const onSearchAsync = async (qdInput) => {
|
|
603
603
|
try {
|
|
604
604
|
let qdSearch = await prepareQdForSearchAsync(qdInput);
|
|
@@ -569,6 +569,7 @@ export declare class SDKUI_Localizator {
|
|
|
569
569
|
static get SelectArchiveToStart(): "Klicken Sie auf Archivieren, um zu beginnen." | "Click on Archive button to start." | "Haz clic en el botón Archivar para comenzar." | "Cliquez sur le bouton Archiver pour commencer." | "Clique no botão Arquivar para iniciar." | "Clicca sul pulsante Archivia per iniziare.";
|
|
570
570
|
static get SelectAttachToStart(): "Sie können Dateien zu Ihrer E-Mail hinzufügen, klicken Sie auf Anhängen, um zu beginnen." | "You can attach files to your email, click on Attach button to start." | "Puedes adjuntar archivos a tu correo electrónico, haz clic en el botón Adjuntar para comenzar." | "Vous pouvez joindre des fichiers à votre e-mail, cliquez sur le bouton Joindre pour commencer." | "Você pode anexar arquivos ao seu e-mail, clique no botão Anexar para iniciar." | "Puoi allegare file alla tua email, clicca sul pulsante Allega per iniziare.";
|
|
571
571
|
static get SelectFromAttachments(): "Aus Anhängen auswählen" | "Select from attachments" | "Seleccionar de archivos adjuntos" | "Sélectionner parmi les pièces jointes" | "Selecionar dos anexos" | "Seleziona dagli allegati";
|
|
572
|
+
static get SelectMetadata(): "Metadaten auswählen" | "Select metadata" | "Seleccionar metadatos" | "Sélectionner les métadonnées" | "Selecionar metadados" | "Seleziona metadato";
|
|
572
573
|
static get SelectSupportAreaMessage(): "Wählen Sie einen Ablagebereich aus" | "Select a support area" | "Seleccione un área de apoyo" | "Sélectionnez une zone de support" | "Selecione uma área de apoio" | "Selezionare un'area di appoggio";
|
|
573
574
|
static get SelectedSingular(): string;
|
|
574
575
|
static get Selected(): "Ausgewählt" | "Selected" | "Sélectionné" | "Selecionado" | "Seleccionados" | "Selezionati";
|
|
@@ -5661,6 +5661,16 @@ export class SDKUI_Localizator {
|
|
|
5661
5661
|
default: return "Seleziona dagli allegati";
|
|
5662
5662
|
}
|
|
5663
5663
|
}
|
|
5664
|
+
static get SelectMetadata() {
|
|
5665
|
+
switch (this._cultureID) {
|
|
5666
|
+
case CultureIDs.De_DE: return "Metadaten auswählen";
|
|
5667
|
+
case CultureIDs.En_US: return "Select metadata";
|
|
5668
|
+
case CultureIDs.Es_ES: return "Seleccionar metadatos";
|
|
5669
|
+
case CultureIDs.Fr_FR: return "Sélectionner les métadonnées";
|
|
5670
|
+
case CultureIDs.Pt_PT: return "Selecionar metadados";
|
|
5671
|
+
default: return "Seleziona metadato";
|
|
5672
|
+
}
|
|
5673
|
+
}
|
|
5664
5674
|
static get SelectSupportAreaMessage() {
|
|
5665
5675
|
switch (this._cultureID) {
|
|
5666
5676
|
case CultureIDs.De_DE: return "Wählen Sie einen Ablagebereich aus";
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -473,8 +473,8 @@ export const getSearchToolbarVisibility = (appModuleID) => {
|
|
|
473
473
|
return {
|
|
474
474
|
tmSearchResult: true,
|
|
475
475
|
tmBlog: false,
|
|
476
|
-
tmSysMetadata:
|
|
477
|
-
tmDcmtPreview:
|
|
476
|
+
tmSysMetadata: false,
|
|
477
|
+
tmDcmtPreview: false,
|
|
478
478
|
tmFullTextSearch: false,
|
|
479
479
|
};
|
|
480
480
|
}
|
|
@@ -49,7 +49,7 @@ export const IsParametricQuery = (qd) => {
|
|
|
49
49
|
return false;
|
|
50
50
|
};
|
|
51
51
|
export const addHiddenSelectItem = (select, tid, mid) => {
|
|
52
|
-
if (select.findIndex(o => o.mid == mid) >= 0)
|
|
52
|
+
if (select.findIndex(o => o.tid == tid && o.mid == mid) >= 0)
|
|
53
53
|
return;
|
|
54
54
|
let si = new SelectItem();
|
|
55
55
|
si.tid = tid;
|
|
@@ -8,6 +8,18 @@ import { useFileDialog } from './useInputDialog';
|
|
|
8
8
|
import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
9
9
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
10
10
|
let abortController = new AbortController();
|
|
11
|
+
const downloadCountMap = new Map();
|
|
12
|
+
const getDownloadFileName = (fileName) => {
|
|
13
|
+
const firstDot = fileName.indexOf('.');
|
|
14
|
+
const lastDot = fileName.lastIndexOf('.');
|
|
15
|
+
if (firstDot === -1 || firstDot === lastDot)
|
|
16
|
+
return fileName;
|
|
17
|
+
const count = downloadCountMap.get(fileName) ?? 0;
|
|
18
|
+
downloadCountMap.set(fileName, count + 1);
|
|
19
|
+
if (count === 0)
|
|
20
|
+
return fileName;
|
|
21
|
+
return `${fileName.slice(0, firstDot)}(${count})${fileName.slice(firstDot)}`;
|
|
22
|
+
};
|
|
11
23
|
export function useDcmtOperations() {
|
|
12
24
|
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
13
25
|
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
|
@@ -96,8 +108,8 @@ export function useDcmtOperations() {
|
|
|
96
108
|
else {
|
|
97
109
|
const alink2 = document.createElement('a');
|
|
98
110
|
alink2.href = fileURL;
|
|
99
|
-
const
|
|
100
|
-
alink2.download =
|
|
111
|
+
const baseFileName = inputDcmts[i].fileName ?? (inputDcmts[i].FILEEXT ? `${inputDcmts[i].DID}.${inputDcmts[i].FILEEXT}` : file?.name);
|
|
112
|
+
alink2.download = getDownloadFileName(baseFileName);
|
|
101
113
|
alink2.target = "_blank";
|
|
102
114
|
alink2.rel = "noreferrer";
|
|
103
115
|
alink2.click();
|
|
@@ -225,9 +225,6 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
225
225
|
const filterRelationsWithAssociations = (relations) => {
|
|
226
226
|
return relations.filter(rel => rel.associations && rel.associations.length > 0);
|
|
227
227
|
};
|
|
228
|
-
const getRelatedDcmt = async (relation, type) => {
|
|
229
|
-
return await DcmtTypeListCacheService.GetAsync(type === 'detail' ? relation.detailTID : relation.masterTID);
|
|
230
|
-
};
|
|
231
228
|
const showNoRelationsAlert = (type) => {
|
|
232
229
|
ShowAlert({
|
|
233
230
|
message: type === 'detail'
|
|
@@ -282,6 +279,26 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
282
279
|
TMExceptionBoxManager.show({ exception: error });
|
|
283
280
|
}
|
|
284
281
|
}, [mapAssociationsToMids]);
|
|
282
|
+
const filterRelationsByPermission = async (relations, type) => {
|
|
283
|
+
const dataSourcePromises = relations.map(async (rel) => {
|
|
284
|
+
const targetTID = type === 'detail' ? rel.detailTID : rel.masterTID;
|
|
285
|
+
const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(targetTID, undefined);
|
|
286
|
+
const hasPermission = dtd?.perm?.canArchive === AccessLevelsEx.Yes || dtd?.perm?.canArchive === AccessLevelsEx.Mixed;
|
|
287
|
+
return { id: rel?.id, name: dtd?.name, hasPermission, relation: rel };
|
|
288
|
+
});
|
|
289
|
+
const allResults = await Promise.all(dataSourcePromises);
|
|
290
|
+
return allResults.filter(r => r.hasPermission);
|
|
291
|
+
};
|
|
292
|
+
const showNoPermissionAlert = (type) => {
|
|
293
|
+
ShowAlert({
|
|
294
|
+
message: type === 'detail'
|
|
295
|
+
? SDKUI_Localizator.YouDoNotHavePermissionsToArchiveDetailDocumentsOfThisType
|
|
296
|
+
: SDKUI_Localizator.YouDoNotHavePermissionsToArchiveMasterDocumentsOfThisType,
|
|
297
|
+
mode: 'warning',
|
|
298
|
+
title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
|
|
299
|
+
duration: 5000
|
|
300
|
+
});
|
|
301
|
+
};
|
|
285
302
|
const archiveRelatedDocuments = useCallback(async (tid, type) => {
|
|
286
303
|
try {
|
|
287
304
|
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
@@ -300,14 +317,20 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
|
|
|
300
317
|
}
|
|
301
318
|
setRelatedDcmts(withAssociations);
|
|
302
319
|
if (withAssociations.length > 1) {
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
320
|
+
const permittedResults = await filterRelationsByPermission(withAssociations, type);
|
|
321
|
+
if (permittedResults.length === 0) {
|
|
322
|
+
showNoPermissionAlert(type);
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (permittedResults.length === 1) {
|
|
326
|
+
await archiveRelatedDcmtHandler(permittedResults[0].relation, type);
|
|
327
|
+
}
|
|
328
|
+
else {
|
|
329
|
+
const dataSource = permittedResults.map(r => ({ id: r.id, name: r.name }));
|
|
330
|
+
setRelatedDcmtsChooserDataSource(dataSource);
|
|
331
|
+
setArchiveType(type);
|
|
332
|
+
setShowRelatedDcmtsChooser(true);
|
|
333
|
+
}
|
|
311
334
|
}
|
|
312
335
|
else {
|
|
313
336
|
await archiveRelatedDcmtHandler(withAssociations[0], type);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.20.0-
|
|
3
|
+
"version": "6.20.0-prova-sdkui2.13",
|
|
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-
|
|
43
|
+
"@topconsultnpm/sdk-ts": "6.20.0-prova-sdk2.13",
|
|
44
44
|
"buffer": "^6.0.3",
|
|
45
45
|
"devextreme": "25.2.4",
|
|
46
46
|
"devextreme-react": "25.2.4",
|