@topconsultnpm/sdkui-react 6.19.0-dev2.2 → 6.19.0-dev2.20
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/TMCustomButton.js +2 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMFileManager.js +11 -2
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +14 -6
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +41 -38
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +8 -25
- package/lib/components/features/search/TMSearchResult.js +91 -10
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +97 -51
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +3 -3
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtils.js +1 -1
- package/lib/components/features/tasks/TMTasksView.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +11 -6
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +20 -6
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/grids/TMBlogsPost.d.ts +1 -0
- package/lib/components/grids/TMBlogsPost.js +6 -1
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +3 -3
- package/lib/components/settings/SettingsAppearance.js +5 -5
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/SDKUI_Localizator.d.ts +34 -1
- package/lib/helper/SDKUI_Localizator.js +342 -12
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/TMUtils.d.ts +1 -4
- package/lib/helper/TMUtils.js +13 -9
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.js +24 -24
- package/lib/ts/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -8,6 +8,7 @@ const IframeContainer = styled.div `
|
|
|
8
8
|
display: flex;
|
|
9
9
|
height: 100%;
|
|
10
10
|
flex-direction: column;
|
|
11
|
+
padding-left: 15px;
|
|
11
12
|
`;
|
|
12
13
|
const StyledIframe = styled.iframe `
|
|
13
14
|
border: none;
|
|
@@ -36,7 +37,6 @@ const TMCustomButton = (props) => {
|
|
|
36
37
|
const mergedAttributes = { ...attributes, selectedItems: selectedItems };
|
|
37
38
|
iframeRef.current.contentWindow.postMessage({
|
|
38
39
|
"options": mergedAttributes,
|
|
39
|
-
"selectedItems": selectedItems,
|
|
40
40
|
"session": SDK_Globals.tmSession
|
|
41
41
|
}, getTargetOrigin(scriptUrl));
|
|
42
42
|
}
|
|
@@ -58,6 +58,6 @@ const TMCustomButton = (props) => {
|
|
|
58
58
|
onClose?.();
|
|
59
59
|
}
|
|
60
60
|
}, [isModal, scriptUrl, onClose]);
|
|
61
|
-
return isModal ? (_jsx(TMModal, { title: button.title, width: '60%', height: '
|
|
61
|
+
return isModal ? (_jsx(TMModal, { title: button.title, width: '60%', height: '70%', resizable: true, onClose: onClose, children: _jsxs(IframeContainer, { children: [error && _jsx("div", { children: "Si \u00E8 verificato un errore nel caricamento del contenuto." }), !error && _jsx(StyledIframe, { ref: iframeRef, loading: 'lazy', onLoad: handleLoad, onError: handleError, src: scriptUrl })] }) })) : null;
|
|
62
62
|
};
|
|
63
63
|
export default TMCustomButton;
|
|
@@ -64,7 +64,7 @@ const TMDataGridExportForm = (props) => {
|
|
|
64
64
|
// Retrieve columns from the search result, or use an empty array if not available
|
|
65
65
|
const columns = searchResult?.dtdResult?.columns ?? [];
|
|
66
66
|
// If exportDescriptionsForDataLists is true, build a map of values to labels for the columns; otherwise use an empty Map
|
|
67
|
-
const
|
|
67
|
+
const valueToNameMap = exportDescriptionsForDataLists ? await buildValueToLabelMapFromDataColumns(columns) : new Map();
|
|
68
68
|
// Create a Set from selectedRowKeys for efficient lookup
|
|
69
69
|
const selectedSet = new Set(selectedRowKeys);
|
|
70
70
|
// If exporting only selected rows, filter the dataSource accordingly; otherwise use the full dataSource
|
|
@@ -82,8 +82,14 @@ const TMDataGridExportForm = (props) => {
|
|
|
82
82
|
const getValue = (col, value) => {
|
|
83
83
|
// Replace raw value with corresponding label from the map if applicable
|
|
84
84
|
let result = value;
|
|
85
|
-
if (exportDescriptionsForDataLists && col.
|
|
86
|
-
|
|
85
|
+
if (exportDescriptionsForDataLists && col.dataField && valueToNameMap.size > 0) {
|
|
86
|
+
const mapForField = valueToNameMap.get(col.dataField);
|
|
87
|
+
if (mapForField) {
|
|
88
|
+
result = mapForField.get(value) ?? value;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
result = value;
|
|
92
|
+
}
|
|
87
93
|
}
|
|
88
94
|
// If the column is a datetime type, attempt to format it as a locale date string
|
|
89
95
|
if (col.dataType === 'datetime' && result) {
|
|
@@ -8,11 +8,12 @@ import { TMColors } from "../../utils/theme";
|
|
|
8
8
|
import TMPanel from "./TMPanel";
|
|
9
9
|
import { TMSplitterLayout } from "./TMLayout";
|
|
10
10
|
import { ContextMenu, TreeView } from "devextreme-react";
|
|
11
|
-
import Toolbar, { Item as ToolbarItem } from 'devextreme-react/
|
|
11
|
+
import Toolbar, { Item as ToolbarItem } from 'devextreme-react/toolbar';
|
|
12
12
|
import TMButton from "./TMButton";
|
|
13
13
|
import { TMSearchBar } from "../sidebar/TMHeader";
|
|
14
14
|
import TMFileManagerThumbnailsView from "./TMFileManagerThumbnailsView";
|
|
15
15
|
import TMFileManagerDataGridView from "./TMFileManagerDataGridView";
|
|
16
|
+
import { UserListCacheService } from "@topconsultnpm/sdk-ts";
|
|
16
17
|
const TMFileManager = (props) => {
|
|
17
18
|
// Destructure props
|
|
18
19
|
const {
|
|
@@ -44,6 +45,14 @@ const TMFileManager = (props) => {
|
|
|
44
45
|
const [droppedFiles, setDroppedFiles] = useState([]);
|
|
45
46
|
// State to track whether a file drag operation is in progress
|
|
46
47
|
const [isDragging, setIsDragging] = useState(false);
|
|
48
|
+
const [allUsers, setAllUsers] = useState([]);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const fetchAllUsers = async () => {
|
|
51
|
+
const users = await UserListCacheService.GetAllAsync();
|
|
52
|
+
setAllUsers(users ?? []);
|
|
53
|
+
};
|
|
54
|
+
fetchAllUsers();
|
|
55
|
+
}, []);
|
|
47
56
|
// useEffect runs whenever `treeFs` changes
|
|
48
57
|
useEffect(() => {
|
|
49
58
|
// Initialize an empty array to hold tree view directory data
|
|
@@ -219,6 +228,6 @@ const TMFileManager = (props) => {
|
|
|
219
228
|
pointerEvents: "none",
|
|
220
229
|
backdropFilter: "blur(3px)",
|
|
221
230
|
textShadow: "0 2px 4px rgba(0,0,0,0.5)"
|
|
222
|
-
}, children: SDKUI_Localizator.DropFileToShare }), viewMode === 'thumbnails' && _jsx(TMFileManagerThumbnailsView, { items: filteredFileItems ?? [], focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID, draftThumbViewAnchor: draftThumbViewAnchor, setDraftThumbViewAnchor: setDraftThumbViewAnchor, onDoubleClickHandler: onDoubleClickHandler }), viewMode === 'details' && _jsx(TMFileManagerDataGridView, { items: filteredFileItems ?? [], focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID, onDoubleClickHandler: onDoubleClickHandler })] })] })] }) }) });
|
|
231
|
+
}, children: SDKUI_Localizator.DropFileToShare }), viewMode === 'thumbnails' && _jsx(TMFileManagerThumbnailsView, { items: filteredFileItems ?? [], allUsers: allUsers, focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID, draftThumbViewAnchor: draftThumbViewAnchor, setDraftThumbViewAnchor: setDraftThumbViewAnchor, onDoubleClickHandler: onDoubleClickHandler }), viewMode === 'details' && _jsx(TMFileManagerDataGridView, { items: filteredFileItems ?? [], allUsers: allUsers, focusedFile: focusedFile, handleFocusedFile: handleFocusedFile, selectedFiles: selectedFiles, handleSelectedFiles: handleSelectedFiles, fileContextMenuItems: fileContextMenuItems, searchText: searchText, userID: userID, onDoubleClickHandler: onDoubleClickHandler })] })] })] }) }) });
|
|
223
232
|
};
|
|
224
233
|
export default TMFileManager;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { FileItem, TMFileManagerContextMenuItem } from "./TMFileManagerUtils";
|
|
2
|
+
import { UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
3
|
interface TMFileManagerDataGridViewProps {
|
|
3
4
|
items: Array<FileItem>;
|
|
5
|
+
allUsers: Array<UserDescriptor>;
|
|
4
6
|
focusedFile: FileItem | undefined;
|
|
5
7
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
6
8
|
selectedFiles: Array<FileItem>;
|
|
@@ -5,7 +5,7 @@ import TMDataGrid from "./TMDataGrid";
|
|
|
5
5
|
import TMDcmtIcon from "../features/documents/TMDcmtIcon";
|
|
6
6
|
import TMTooltip from "./TMTooltip";
|
|
7
7
|
const TMFileManagerDataGridView = (props) => {
|
|
8
|
-
const { items, focusedFile, handleFocusedFile, selectedFiles, handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler } = props;
|
|
8
|
+
const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles, handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler } = props;
|
|
9
9
|
// State hook to store the currently focused row key, initially set to undefined
|
|
10
10
|
const [focusedRowKey, setFocusedRowKey] = useState(focusedFile?.id);
|
|
11
11
|
// State to store selected row keys
|
|
@@ -16,6 +16,15 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
setSelectedRowKeys(selectedFiles.map(selectedFile => selectedFile.id));
|
|
18
18
|
}, [selectedFiles]);
|
|
19
|
+
const findCheckOutUserName = useCallback((checkOutUserName, checkOutUserID) => {
|
|
20
|
+
if (checkOutUserName) {
|
|
21
|
+
return checkOutUserName;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
let checkOutUser = allUsers.find(user => user.id === checkOutUserID);
|
|
25
|
+
return checkOutUser ? checkOutUser.name : '-';
|
|
26
|
+
}
|
|
27
|
+
}, [allUsers]);
|
|
19
28
|
// DataGrid Callback
|
|
20
29
|
// Handles focus change in the data grid
|
|
21
30
|
const onFocusedRowChanged = useCallback((e) => {
|
|
@@ -58,7 +67,7 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
58
67
|
const checkoutUsedId = checkOutUserID;
|
|
59
68
|
const editMode = checkoutDate && checkoutUsedId && userID && userID === checkoutUsedId;
|
|
60
69
|
const lockMode = checkoutDate && checkoutUsedId && userID && userID !== checkoutUsedId;
|
|
61
|
-
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", checkOutUserName ?? '-', " (ID: ", checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(lastUpdateTime?.toString())] })] })] })] });
|
|
70
|
+
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(checkOutUserName, checkOutUserID) ?? '-', " (ID: ", checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(lastUpdateTime?.toString())] })] })] })] });
|
|
62
71
|
return _jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: "4px" }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }) }), renderHighlightedText(cellData.value, searchText, false)] });
|
|
63
72
|
}, [searchText]);
|
|
64
73
|
const cellExtRender = useCallback((cellData) => {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FileItem } from './TMFileManagerUtils';
|
|
3
|
+
import { UserDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
4
|
export interface TMFileManagerThumbnailItemsProps {
|
|
4
5
|
items: Array<FileItem>;
|
|
6
|
+
allUsers: Array<UserDescriptor>;
|
|
5
7
|
paginatedItems: Array<FileItem>;
|
|
6
8
|
focusedFile: FileItem | undefined;
|
|
7
9
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
@@ -6,7 +6,7 @@ import TMTooltip from './TMTooltip';
|
|
|
6
6
|
import TMDcmtIcon from '../features/documents/TMDcmtIcon';
|
|
7
7
|
const TMFileManagerThumbnailItems = (props) => {
|
|
8
8
|
// Destructuring props for cleaner usage
|
|
9
|
-
const { items, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setDraftThumbViewAnchor } = props;
|
|
9
|
+
const { items, allUsers, paginatedItems, selectedFiles, searchText, userID, onDoubleClick, handleSelectedFiles, handleFocusedFile, setDraftThumbViewAnchor } = props;
|
|
10
10
|
// Ref for the scrollable container
|
|
11
11
|
const containerRef = useRef(null);
|
|
12
12
|
// Stores index of the last selected item for shift selection
|
|
@@ -112,6 +112,16 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
112
112
|
setDraftThumbViewAnchor(e.currentTarget);
|
|
113
113
|
handleFocusedFile(item);
|
|
114
114
|
}, []);
|
|
115
|
+
const findCheckOutUserName = useCallback((item) => {
|
|
116
|
+
if (item.checkOutUserName) {
|
|
117
|
+
return item.checkOutUserName;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
const checkOutUserID = item.checkOutUserID;
|
|
121
|
+
let checkOutUser = allUsers.find(user => user.id === checkOutUserID);
|
|
122
|
+
return checkOutUser ? checkOutUser.name : '-';
|
|
123
|
+
}
|
|
124
|
+
}, [allUsers]);
|
|
115
125
|
return _jsx("div", { style: { width: "100%", height: "100%" }, children: paginatedItems.map(item => {
|
|
116
126
|
const isSelected = selectedFiles?.map(file => file.id).includes(item.id) ?? false;
|
|
117
127
|
const checkoutDate = item.checkoutDate;
|
|
@@ -130,7 +140,7 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
130
140
|
bgColor = isSelected ? colors.PRIMARY_BLUE : backgroundColors.lockMode;
|
|
131
141
|
bgHoverColor = isSelected ? colors.PRIMARY_BLUE : "#fff59d";
|
|
132
142
|
}
|
|
133
|
-
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", item
|
|
143
|
+
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(item) ?? '-', " (ID: ", item.checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(item.checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", item.version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", item.ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(item.creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime?.toString())] })] })] })] });
|
|
134
144
|
const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", item.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", item.did ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", item.tid ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Name, ":"] }), " ", item.name ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", item.updaterName ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", item.version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(item.size ?? 0)] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.creationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(item.lastUpdateTime)] })] }));
|
|
135
145
|
return _jsx(TMFileItemContainer, { className: "tm-file-manager-thumbnail-items", ref: containerRef, id: "tm-file-manager-thumbnail-item-" + item.id.toString(), "$backgroundColor": bgColor, "$bgHoverColor": bgHoverColor, "$textColor": textColor, onDoubleClick: () => onDoubleClickHandler(item), onContextMenu: (e) => onContextMenu(e, item), onClick: (e) => onClickHandler(e, item), tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, children: _jsxs("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between', width: '100%' }, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, children: [_jsxs("div", { style: { marginRight: '16px', flexShrink: 0 }, children: [_jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }), editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: !isSelected ? colors.MEDIUM_GREEN : '#fff', fontWeight: "bold" }, className: "dx-icon-lock" }) })] }), _jsxs("div", { style: { overflow: 'hidden', minWidth: 0 }, children: [_jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: '1rem', fontWeight: "bold" }, children: _jsx(TMTooltip, { parentStyle: { overflow: 'hidden' }, childStyle: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block' }, children: renderHighlightedText(item.name, searchText, isSelected) }) }), _jsx("div", { style: { whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', width: '100%', display: 'block', fontSize: 'calc(1rem - 1px)' }, children: formatBytes(item.size ?? 0) })] })] }), item.version && (_jsx("div", { style: { flexShrink: 0, marginLeft: '12px', whiteSpace: 'nowrap' }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.Version, children: _jsx("div", { style: { border: "2px solid #28a745", backgroundColor: "#28a745", color: "#ffffff", borderRadius: '50%', width: '30px', height: '30px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: '12px', fontWeight: 'bold' }, children: item.version }) }) }))] }) }, "tm-file-manager-thumbnail-item-" + item.id);
|
|
136
146
|
}) });
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { FileItem, TMFileManagerContextMenuItem } from "./TMFileManagerUtils";
|
|
3
|
+
import { UserDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
4
|
interface TMFileManagerThumbnailsViewProps {
|
|
4
5
|
items: Array<FileItem>;
|
|
6
|
+
allUsers: Array<UserDescriptor>;
|
|
5
7
|
focusedFile: FileItem | undefined;
|
|
6
8
|
handleFocusedFile: (fileItem: FileItem | undefined) => void;
|
|
7
9
|
selectedFiles: Array<FileItem>;
|
|
@@ -5,7 +5,7 @@ import { ContextMenu, Pagination, ScrollView } from "devextreme-react";
|
|
|
5
5
|
import TMFileManagerThumbnailItems from "./TMFileManagerThumbnailItems";
|
|
6
6
|
import { SDKUI_Localizator } from "../../helper";
|
|
7
7
|
const TMFileManagerThumbnailsView = (props) => {
|
|
8
|
-
const { items, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, draftThumbViewAnchor, setDraftThumbViewAnchor } = props;
|
|
8
|
+
const { items, allUsers, focusedFile, handleFocusedFile, selectedFiles = [], handleSelectedFiles, fileContextMenuItems, searchText, userID, onDoubleClickHandler, draftThumbViewAnchor, setDraftThumbViewAnchor } = props;
|
|
9
9
|
const PAGE_SIZES = [TMFileManagerPageSize.Small, TMFileManagerPageSize.Medium, TMFileManagerPageSize.Large];
|
|
10
10
|
const initPageSize = TMFileManagerPageSize.Small;
|
|
11
11
|
const showPagination = (items?.length ?? 0) > initPageSize;
|
|
@@ -39,7 +39,7 @@ const TMFileManagerThumbnailsView = (props) => {
|
|
|
39
39
|
handleSelectedFiles?.([]);
|
|
40
40
|
};
|
|
41
41
|
return items.length > 0 ?
|
|
42
|
-
_jsxs("div", { style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick, setDraftThumbViewAnchor: setDraftThumbViewAnchor }) }), showPagination && _jsx(Pagination, { height: "50px", showInfo: true, showNavigationButtons: true, allowedPageSizes: PAGE_SIZES, displayMode: 'compact', itemCount: items.length, pageIndex: pageIndex, pageSize: pageSize, onPageIndexChange: setPageIndex, onPageSizeChange: setPageSize }), draftThumbViewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: fileContextMenuItems, target: draftThumbViewAnchor, onHiding: closeViewContextMenu })] })
|
|
42
|
+
_jsxs("div", { style: { width: "100%", height: "100%" }, onContextMenu: onBackgroundContextMenu, children: [_jsx(ScrollView, { width: "100%", height: showPagination ? "calc(100% - 50px)" : "100%", useNative: true, direction: 'vertical', children: _jsx(TMFileManagerThumbnailItems, { items: items, allUsers: allUsers, paginatedItems: paginatedItems, focusedFile: focusedFile, selectedFiles: selectedFiles, userID: userID, searchText: searchText, handleFocusedFile: handleFocusedFile, handleSelectedFiles: handleSelectedFiles, onDoubleClick: handleItemDoubleClick, setDraftThumbViewAnchor: setDraftThumbViewAnchor }) }), showPagination && _jsx(Pagination, { height: "50px", showInfo: true, showNavigationButtons: true, allowedPageSizes: PAGE_SIZES, displayMode: 'compact', itemCount: items.length, pageIndex: pageIndex, pageSize: pageSize, onPageIndexChange: setPageIndex, onPageSizeChange: setPageSize }), draftThumbViewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: fileContextMenuItems, target: draftThumbViewAnchor, onHiding: closeViewContextMenu })] })
|
|
43
43
|
:
|
|
44
44
|
_jsxs("div", { onContextMenu: onBackgroundContextMenu, style: { width: "100%", height: "100%", display: 'flex', justifyContent: 'center', alignItems: 'center', marginTop: '10px' }, children: [SDKUI_Localizator.FolderIsEmpty, draftThumbViewAnchor && _jsx(ContextMenu, { id: 'fileViewContextMenuMobile', dataSource: fileContextMenuItems, target: draftThumbViewAnchor, onHiding: closeViewContextMenu })] });
|
|
45
45
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ITooltipOptions } from 'devextreme-react/
|
|
2
|
+
import { ITooltipOptions } from 'devextreme-react/tooltip';
|
|
3
3
|
import { Position } from 'devextreme/common';
|
|
4
4
|
import { PositionConfig } from 'devextreme/animation/position';
|
|
5
5
|
interface ITMTooltipProps extends ITooltipOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
|
-
import { Tooltip } from 'devextreme-react/
|
|
3
|
+
import { Tooltip } from 'devextreme-react/tooltip';
|
|
4
4
|
import { genUniqueId } from '../../helper';
|
|
5
5
|
import { DeviceType, useDeviceType } from './TMDeviceProvider';
|
|
6
6
|
const TMTooltip = ({ children, position, content, hideAfterDelay, parentStyle, childStyle }) => {
|
|
@@ -2,6 +2,9 @@ import React from 'react';
|
|
|
2
2
|
import { MetadataDescriptor, QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
import { ITMChooserFormProps, ITMChooserProps, TID_MID } from '../../ts';
|
|
4
4
|
import { TID_Alias } from '../../helper/queryHelper';
|
|
5
|
+
type MetadataDescriptorWithKey = MetadataDescriptor & {
|
|
6
|
+
uniqueKey: string;
|
|
7
|
+
};
|
|
5
8
|
interface ITMMetadataChooserProps extends ITMChooserProps {
|
|
6
9
|
/** Allows you to view system metadata */
|
|
7
10
|
allowSysMetadata?: boolean;
|
|
@@ -32,7 +35,7 @@ interface ITMMetadataChooserProps extends ITMChooserProps {
|
|
|
32
35
|
}
|
|
33
36
|
declare const TMMetadataChooser: React.FunctionComponent<ITMMetadataChooserProps>;
|
|
34
37
|
export default TMMetadataChooser;
|
|
35
|
-
interface ITMMetadataChooserFormProps extends ITMChooserFormProps<
|
|
38
|
+
interface ITMMetadataChooserFormProps extends ITMChooserFormProps<MetadataDescriptorWithKey> {
|
|
36
39
|
/** Allows you to view system metadata */
|
|
37
40
|
allowSysMetadata?: boolean;
|
|
38
41
|
/** TIDs of document types to retrieve metadata from */
|
|
@@ -50,15 +50,19 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
50
50
|
dtd.customData2 = alias;
|
|
51
51
|
if (!qdShowOnlySelectItems) {
|
|
52
52
|
dtd.metadata?.forEach((md) => {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const mdWithKey = md;
|
|
54
|
+
mdWithKey.customData1 = dtd.id;
|
|
55
|
+
mdWithKey.customData2 = alias;
|
|
56
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
|
|
55
57
|
});
|
|
56
58
|
}
|
|
57
59
|
else {
|
|
58
60
|
let newMetadata = dtd.metadata?.filter(o => qd.select?.some(s => s.tid == dtd.id && s.mid == o.id && ((s.alias ?? '') == alias)));
|
|
59
61
|
newMetadata?.forEach((md) => {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
const mdWithKey = md;
|
|
63
|
+
mdWithKey.customData1 = dtd.id;
|
|
64
|
+
mdWithKey.customData2 = alias;
|
|
65
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${alias}`;
|
|
62
66
|
});
|
|
63
67
|
}
|
|
64
68
|
let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
|
|
@@ -81,7 +85,11 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
81
85
|
continue;
|
|
82
86
|
}
|
|
83
87
|
let mds = filterMetadata ? dtd.metadata?.filter(filterMetadata) : dtd.metadata;
|
|
84
|
-
mds?.forEach((md) => {
|
|
88
|
+
mds?.forEach((md) => {
|
|
89
|
+
const mdWithKey = md;
|
|
90
|
+
mdWithKey.customData1 = dtd?.id;
|
|
91
|
+
mdWithKey.uniqueKey = `${dtd.id}_${md.id}_${md.customData2 ?? ''}`;
|
|
92
|
+
});
|
|
85
93
|
dtdList.push({ ...dtd, metadata: mds });
|
|
86
94
|
}
|
|
87
95
|
}
|
|
@@ -130,5 +138,5 @@ export const TMMetadataChooserForm = ({ tmSession, tids, qd, filterMetadata, qdS
|
|
|
130
138
|
const cellRenderNameAndDesc = useCallback((data) => {
|
|
131
139
|
return _jsx("p", { style: { textAlign: 'left', color: data.data.isRequired == 1 ? 'red' : '' }, children: data.value });
|
|
132
140
|
}, []);
|
|
133
|
-
return (_jsx(TMChooserForm, { title: SDK_Localizator.Metadatas, allowMultipleSelection: allowMultipleSelection, allowSorting: false, allowGrouping: dcmtTypes.length > 1, width: width, height: height, selectedIDs: selectedIDs?.map((item) => item.mid), convertID: convertID, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, customButtons: renderCustomButtons(), columns: dataColumns, summaryItems: renderSummaryItems, onClose: onClose, onChoose: (IDs) => { onChoose?.(IDs); } }));
|
|
141
|
+
return (_jsx(TMChooserForm, { title: SDK_Localizator.Metadatas, allowMultipleSelection: allowMultipleSelection, allowSorting: false, allowGrouping: dcmtTypes.length > 1, width: width, height: height, keyName: 'uniqueKey', selectedIDs: selectedIDs?.map((item) => `${item.tid}_${item.mid}_${item.aliasTID ?? ''}`), convertID: convertID, cellRenderIcon: cellRenderIcon, cellRenderNameAndDesc: cellRenderNameAndDesc, dataSource: dataSource, getItems: getItems, customButtons: renderCustomButtons(), columns: dataColumns, summaryItems: renderSummaryItems, onClose: onClose, onChoose: (IDs) => { onChoose?.(IDs); } }));
|
|
134
142
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { IDateBoxOptions } from 'devextreme-react/
|
|
3
|
+
import { IDateBoxOptions } from 'devextreme-react/date-box';
|
|
4
4
|
import { DateDisplayTypes } from '../../helper';
|
|
5
5
|
interface ITMDateBoxProps extends IDateBoxOptions {
|
|
6
6
|
dateDisplayType?: DateDisplayTypes;
|
|
@@ -8,7 +8,7 @@ import { DownloadTypes, FormModes } from '../../../ts';
|
|
|
8
8
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
9
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
10
|
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
11
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity } from '../../../helper';
|
|
11
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary } from '../../../helper';
|
|
12
12
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
13
13
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
14
14
|
import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
@@ -477,13 +477,16 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
477
477
|
];
|
|
478
478
|
// Aggiungi submenu "Bottoni personalizzati" se esistono customButtons
|
|
479
479
|
if (customButtonsLayout?.customButtons && Array.isArray(customButtonsLayout.customButtons) && customButtonsLayout.customButtons.length > 0) {
|
|
480
|
-
const customButtonsItems = customButtonsLayout.customButtons
|
|
480
|
+
const customButtonsItems = customButtonsLayout.customButtons
|
|
481
|
+
.filter((customButton) => customButton.isForUpdate && customButton.isForUpdate > 0)
|
|
482
|
+
.map((customButton) => ({
|
|
483
|
+
icon: svgToString(TMImageLibrary({ imageID: customButton.glyphID, showPath: true })),
|
|
481
484
|
text: customButton.title || 'Bottone personalizzato',
|
|
482
485
|
onClick: () => setCustomButton(customButton)
|
|
483
486
|
}));
|
|
484
487
|
items.push({
|
|
485
488
|
icon: svgToString(_jsx(IconCheck, {})),
|
|
486
|
-
text:
|
|
489
|
+
text: SDKUI_Localizator.CustomButtons,
|
|
487
490
|
items: customButtonsItems
|
|
488
491
|
});
|
|
489
492
|
}
|
|
@@ -1122,42 +1125,42 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1122
1125
|
height: '100%',
|
|
1123
1126
|
position: 'relative',
|
|
1124
1127
|
overflow: 'hidden'
|
|
1125
|
-
}, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [(groupId && groupId.length > 0)
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1128
|
+
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [(groupId && groupId.length > 0)
|
|
1129
|
+
? _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })
|
|
1130
|
+
: _jsxs(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: [_jsx(WfButtonStateHandler, { isWFDisabled: isWFDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1131
|
+
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
|
1132
|
+
if (!e)
|
|
1133
|
+
return;
|
|
1134
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == e.tid && item.mid === e.mid ? { ...item, value: e.newValue } : item));
|
|
1135
|
+
} }), isOpenFormulaEditor &&
|
|
1136
|
+
_jsx(TMFormulaEditor, { isModal: true, formMode: FormModes.Update, inputData: getFormula(), showBack: false, onClose: () => setIsOpenFormulaEditor(false), onApplied: (newFormula) => {
|
|
1137
|
+
setFormData((prevItems) => prevItems.map((item) => item.tid == newFormula.tid && item.mid === newFormula.mid ? { ...item, value: FormulaHelper.addFormulaTag(newFormula.expression), isSelected: true, isEditable: true } : item));
|
|
1138
|
+
setFocusedMetadataValue(prevState => ({
|
|
1139
|
+
...prevState,
|
|
1140
|
+
isSelected: true,
|
|
1141
|
+
isEditable: true,
|
|
1142
|
+
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
1143
|
+
}));
|
|
1144
|
+
} }), 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 })] }), (showToppyForApprove || showToppyForCompleteMoreInfo || showToppyForReferences) && (_jsx(ToppyHelpCenter, { deviceType: deviceType, usePortal: false, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [showToppyForApprove && (workItems.length === 1 ?
|
|
1145
|
+
_jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), dtd: fromDTD })
|
|
1146
|
+
:
|
|
1147
|
+
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] })), showToppyForCompleteMoreInfo && (_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} ${taskMoreInfo?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => {
|
|
1148
|
+
setShowCommentForm(true);
|
|
1149
|
+
} })] })), showToppyForReferences && dcmtReferences && dcmtReferences
|
|
1150
|
+
.filter(ref => ref.objClass === ObjectClasses.Dossier || ref.objClass === ObjectClasses.WorkingGroup) // keep only known objClass types
|
|
1151
|
+
.map((ref, index, arr) => {
|
|
1152
|
+
const mapEntry = referenceActionMap[String(ref.objClass)];
|
|
1153
|
+
const label = mapEntry?.label ?? 'Vai a riferimento';
|
|
1154
|
+
return (_jsxs(React.Fragment, { children: [index === 0 && (showToppyForApprove || showToppyForCompleteMoreInfo) && (_jsx("div", { style: {
|
|
1155
|
+
height: 1,
|
|
1156
|
+
backgroundColor: 'rgba(255,255,255,0.2)',
|
|
1157
|
+
margin: '6px 0'
|
|
1158
|
+
} })), _jsxs(StyledReferenceButton, { onClick: () => handleNavigateToReference(ref), children: [_jsx("span", { children: label }), _jsx("span", { children: `"${ref.objName}"` })] }, `ref-${index}-${ref.objID}`)] }, `ref-frag-${index}-${ref.objID}`));
|
|
1159
|
+
})] }) }))] }), (showCommentForm && TID && DID) &&
|
|
1157
1160
|
_jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: TID, did: DID } }, onClose: () => setShowCommentForm(false), refreshCallback: handleCompleteMoreInfo, participants: [], showAttachmentsSection: false, allArchivedDocumentsFileItems: [] }), isOpenDetails &&
|
|
1158
|
-
_jsx(StyledModalContainer, {
|
|
1159
|
-
_jsxs(StyledModalContainer, {
|
|
1160
|
-
return (_jsx(StyledModalContainer, {
|
|
1161
|
+
_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 &&
|
|
1162
|
+
_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) => {
|
|
1163
|
+
return (_jsx(StyledModalContainer, { 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}`));
|
|
1161
1164
|
})] }), taskFormDialogComponent, s4TViewerDialogComponent] }));
|
|
1162
1165
|
};
|
|
1163
1166
|
return (_jsx(_Fragment, { children: (isModal && onClose)
|
|
@@ -136,18 +136,22 @@ export const searchResultToDataSource = async (searchResult, hideSysMetadata) =>
|
|
|
136
136
|
}
|
|
137
137
|
return output;
|
|
138
138
|
};
|
|
139
|
-
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems
|
|
139
|
+
const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndicator = true, allowShowZeroDcmts = true, initialShowZeroDcmts = false, allowedTIDs, allowMultipleSelection = false, focusedItem, selectedItems, onFocusedItemChanged, onSelectedItemsChanged, onDocumentDoubleClick, customItemRender, customDocumentStyle, customMainContainerContent, customDocumentContent, showMetadataNames = false, maxDepthLevel = 2, invertMasterNavigation = true, additionalStaticItems, showMainDocument = true, labelMainContainer, }) => {
|
|
140
140
|
// State
|
|
141
141
|
const [dcmtTypes, setDcmtTypes] = useState([]);
|
|
142
142
|
const [treeData, setTreeData] = useState([]);
|
|
143
143
|
const [showZeroDcmts, setShowZeroDcmts] = useState(initialShowZeroDcmts);
|
|
144
144
|
const [staticItemsState, setStaticItemsState] = useState([]);
|
|
145
|
-
// Wait Panel State (only used if allowWaitPanel is true)
|
|
146
145
|
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
147
146
|
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
|
148
147
|
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
|
149
148
|
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
|
150
149
|
const [abortController] = useState(new AbortController());
|
|
150
|
+
const [showExpansionWaitPanel, setShowExpansionWaitPanel] = useState(false);
|
|
151
|
+
const [expansionWaitPanelText, setExpansionWaitPanelText] = useState('');
|
|
152
|
+
const [expansionWaitPanelValue, setExpansionWaitPanelValue] = useState(0);
|
|
153
|
+
const [expansionWaitPanelMaxValue, setExpansionWaitPanelMaxValue] = useState(0);
|
|
154
|
+
const [expansionAbortController, setExpansionAbortController] = useState(undefined);
|
|
151
155
|
// Ref to track last loaded input to prevent unnecessary reloads
|
|
152
156
|
const lastLoadedInputRef = React.useRef('');
|
|
153
157
|
// Ref to track if user has manually expanded/collapsed static items
|
|
@@ -560,30 +564,55 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
560
564
|
// If container is already loaded, return items
|
|
561
565
|
if (node.isLoaded)
|
|
562
566
|
return node.items;
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
567
|
+
const newAbortController = new AbortController();
|
|
568
|
+
setExpansionAbortController(newAbortController);
|
|
569
|
+
const itemsToLoad = node.items?.length ?? 0;
|
|
570
|
+
setShowExpansionWaitPanel(true);
|
|
571
|
+
setExpansionWaitPanelMaxValue(itemsToLoad);
|
|
572
|
+
setExpansionWaitPanelValue(0);
|
|
573
|
+
setExpansionWaitPanelText(`Caricamento documenti correlati...`);
|
|
574
|
+
try {
|
|
575
|
+
const newItems = [];
|
|
576
|
+
let processedCount = 0;
|
|
577
|
+
for (const dcmt of node.items ?? []) {
|
|
578
|
+
if (newAbortController.signal.aborted) {
|
|
579
|
+
console.log('Folder expansion aborted by user');
|
|
580
|
+
return node.items;
|
|
574
581
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
582
|
+
const item = { ...dcmt };
|
|
583
|
+
if (item.tid && item.did && !item.isLoaded) {
|
|
584
|
+
// Update progress
|
|
585
|
+
processedCount++;
|
|
586
|
+
setExpansionWaitPanelValue(processedCount);
|
|
587
|
+
setExpansionWaitPanelText(`Caricamento ${processedCount} di ${itemsToLoad}...`);
|
|
588
|
+
// Nella modalità originale (invertMasterNavigation=false),
|
|
589
|
+
// i documenti detail non devono caricare i master come figli
|
|
590
|
+
if (isForMaster && !invertMasterNavigation) {
|
|
591
|
+
// Carica i detail dei detail (navigazione naturale detail→detail)
|
|
592
|
+
const loadedItems = await getDetailDcmtsAsync(item.tid, item.did, 1);
|
|
593
|
+
item.items = updateHiddenProperty(loadedItems);
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
// Modalità standard o invertita
|
|
597
|
+
const loadedItems = isForMaster
|
|
598
|
+
? await getMasterDcmtsAsync(item.tid, item.did, 1)
|
|
599
|
+
: await getDetailDcmtsAsync(item.tid, item.did, 1);
|
|
600
|
+
item.items = updateHiddenProperty(loadedItems);
|
|
601
|
+
}
|
|
602
|
+
item.isLoaded = true;
|
|
581
603
|
}
|
|
582
|
-
item
|
|
604
|
+
newItems.push(item);
|
|
583
605
|
}
|
|
584
|
-
newItems
|
|
606
|
+
return newItems;
|
|
607
|
+
}
|
|
608
|
+
catch (error) {
|
|
609
|
+
console.error('Error loading folder contents:', error);
|
|
610
|
+
return node.items;
|
|
611
|
+
}
|
|
612
|
+
finally {
|
|
613
|
+
setShowExpansionWaitPanel(false);
|
|
614
|
+
setExpansionAbortController(undefined);
|
|
585
615
|
}
|
|
586
|
-
return newItems;
|
|
587
616
|
}, [isForMaster, invertMasterNavigation, getDetailDcmtsAsync, getMasterDcmtsAsync, updateHiddenProperty]);
|
|
588
617
|
/**
|
|
589
618
|
* Default item renderer with metadata display (adapted from TMMasterDetailDcmts.tsx)
|
|
@@ -715,6 +744,10 @@ const TMRelationViewer = ({ inputDcmts, isForMaster = false, showCurrentDcmtIndi
|
|
|
715
744
|
if (mergedTreeData.length === 0) {
|
|
716
745
|
return _jsx("div", { style: { padding: '20px', textAlign: 'center', color: '#666' }, children: "Nessuna relazione disponibile." });
|
|
717
746
|
}
|
|
718
|
-
return (_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, onSelectionChanged: handleSelectedItemsChanged }))
|
|
747
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTreeView, { dataSource: mergedTreeData, itemRender: finalItemRender, calculateItemsForNode: calculateItemsForNode, onDataChanged: handleDataChanged, focusedItem: focusedItem, onFocusedItemChanged: handleFocusedItemChanged, allowMultipleSelection: allowMultipleSelection, selectedItems: selectedItems, onSelectionChanged: handleSelectedItemsChanged }), showExpansionWaitPanel && (_jsx(TMWaitPanel, { title: isForMaster ? 'Caricamento documenti master' : 'Caricamento documenti dettaglio', showPrimary: true, textPrimary: expansionWaitPanelText, valuePrimary: expansionWaitPanelValue, maxValuePrimary: expansionWaitPanelMaxValue, isCancelable: true, abortController: expansionAbortController, onAbortClick: (abortController) => {
|
|
748
|
+
setTimeout(() => {
|
|
749
|
+
abortController?.abort();
|
|
750
|
+
}, 100);
|
|
751
|
+
} }))] }));
|
|
719
752
|
};
|
|
720
753
|
export default TMRelationViewer;
|