@topconsultnpm/sdkui-react 6.22.0-dev2.42 → 6.22.0-dev2.44
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/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.js +19 -9
- package/lib/components/base/TMFileManagerUtils.d.ts +1 -0
- package/lib/components/base/TMFileManagerUtils.js +21 -1
- package/lib/components/features/documents/TMDcmtIcon.js +5 -3
- package/lib/components/grids/TMBlogAttachments.js +13 -2
- package/lib/components/viewers/TMTidViewer.js +2 -2
- package/lib/helper/SDKUI_Globals.d.ts +1 -0
- package/lib/helper/SDKUI_Globals.js +1 -0
- package/lib/helper/SDKUI_Localizator.d.ts +5 -0
- package/lib/helper/SDKUI_Localizator.js +50 -0
- package/lib/helper/TMAppUpdatedModal.d.ts +1 -0
- package/lib/helper/TMAppUpdatedModal.js +134 -0
- package/lib/helper/TMUtils.d.ts +5 -0
- package/lib/helper/TMUtils.js +13 -1
- package/lib/helper/helpers.d.ts +2 -0
- package/lib/helper/helpers.js +2 -0
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { getFileItemLinkUrl } from "./TMFileManagerUtils";
|
|
3
4
|
import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from "../../helper";
|
|
4
5
|
import TMDataGrid from "./TMDataGrid";
|
|
5
6
|
import TMDcmtIcon from "../features/documents/TMDcmtIcon";
|
|
@@ -43,6 +44,12 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
43
44
|
}, [handleSelectedFiles]);
|
|
44
45
|
// Handler for double-click cell event
|
|
45
46
|
const onCellDblClick = useCallback((e) => {
|
|
47
|
+
// i link non hanno un documento da aprire: il doppio click (anche sull'icona dell'estensione) apre l'url in un nuovo tab
|
|
48
|
+
const linkUrl = getFileItemLinkUrl(e.data);
|
|
49
|
+
if (linkUrl) {
|
|
50
|
+
window.open(linkUrl, '_blank', 'noopener,noreferrer');
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
46
53
|
if (e.column.dataField === "ext")
|
|
47
54
|
return;
|
|
48
55
|
if (onDoubleClickHandler)
|
|
@@ -62,8 +69,10 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
62
69
|
}, [searchText, findCheckOutUserName]);
|
|
63
70
|
const cellExtRender = useCallback((cellData) => {
|
|
64
71
|
const item = cellData.data;
|
|
65
|
-
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.Extension, ":"] }), " ", item.ext ?? '-'] }), _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)] })] }));
|
|
66
|
-
|
|
72
|
+
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.Extension, ":"] }), " ", item.ext ?? '-'] }), _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)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
|
|
73
|
+
// i link non hanno un file associato: l'icona non deve avviare il download
|
|
74
|
+
const isLink = getFileItemLinkUrl(item) !== undefined;
|
|
75
|
+
return _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: isLink ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned });
|
|
67
76
|
}, []);
|
|
68
77
|
const cellDatetimeRender = useCallback((cellData) => {
|
|
69
78
|
if (!cellData.value)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
|
-
import { colors, TMFileItemContainer } from './TMFileManagerUtils';
|
|
3
|
+
import { colors, getFileItemLinkUrl, TMFileItemContainer } from './TMFileManagerUtils';
|
|
4
4
|
import { formatBytes, Globalization, renderHighlightedText, SDKUI_Localizator } from '../../helper';
|
|
5
5
|
import TMTooltip from './TMTooltip';
|
|
6
6
|
import TMDcmtIcon from '../features/documents/TMDcmtIcon';
|
|
@@ -35,6 +35,16 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}, [items, lastSelectedIndexRef.current]);
|
|
38
|
+
// Apre l'item: i link non hanno un documento da aprire, si apre direttamente l'url in un nuovo tab
|
|
39
|
+
const openFileItem = useCallback((item) => {
|
|
40
|
+
const linkUrl = getFileItemLinkUrl(item);
|
|
41
|
+
if (linkUrl) {
|
|
42
|
+
window.open(linkUrl, '_blank', 'noopener,noreferrer');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (onDoubleClick)
|
|
46
|
+
onDoubleClick(item);
|
|
47
|
+
}, [onDoubleClick]);
|
|
38
48
|
const handleKeyDown = useCallback((event) => {
|
|
39
49
|
event.preventDefault();
|
|
40
50
|
if (event.key === 'ArrowDown' && lastSelectedIndexRef.current !== null) {
|
|
@@ -44,21 +54,21 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
44
54
|
lastSelectedIndexRef.current = currentIndex;
|
|
45
55
|
}
|
|
46
56
|
}
|
|
47
|
-
if (event.key === 'Enter' && selectedFiles.length === 1
|
|
57
|
+
if (event.key === 'Enter' && selectedFiles.length === 1) {
|
|
48
58
|
const currentItem = items.find(item => item.id === selectedFiles[0].id);
|
|
49
59
|
if (currentItem)
|
|
50
|
-
|
|
60
|
+
openFileItem(currentItem);
|
|
51
61
|
}
|
|
52
|
-
}, [items, lastSelectedIndexRef.current, selectedFiles]);
|
|
62
|
+
}, [items, lastSelectedIndexRef.current, selectedFiles, openFileItem]);
|
|
53
63
|
// Double click handler with timeout cleanup
|
|
54
64
|
const onDoubleClickHandler = useCallback((item) => {
|
|
55
65
|
if (clickTimeoutRef.current) {
|
|
56
66
|
clearTimeout(clickTimeoutRef.current);
|
|
57
67
|
clickTimeoutRef.current = null;
|
|
58
68
|
}
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
}, [
|
|
69
|
+
if (item)
|
|
70
|
+
openFileItem(item);
|
|
71
|
+
}, [openFileItem]);
|
|
62
72
|
const onClickHandler = useCallback((e, item) => {
|
|
63
73
|
// If a click timeout is already running, clear it (distinguish between single and double clicks)
|
|
64
74
|
if (clickTimeoutRef.current) {
|
|
@@ -144,8 +154,8 @@ const TMFileManagerThumbnailItems = (props) => {
|
|
|
144
154
|
bgHoverColor = isSelected ? colors.PRIMARY_BLUE : "#fff59d";
|
|
145
155
|
}
|
|
146
156
|
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.Extension }), ": ", 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())] })] })] })] });
|
|
147
|
-
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.Extension, ":"] }), " ", item.ext ?? '-'] }), _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)] })] }));
|
|
148
|
-
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, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("div", { style: { width: '40px' }, children: _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned }) }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', width: '40px' }, children: [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);
|
|
157
|
+
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.Extension, ":"] }), " ", item.ext ?? '-'] }), _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)] }), item.description && _jsxs(_Fragment, { children: [_jsx("hr", {}), _jsxs("div", { style: { maxWidth: '400px', overflowWrap: 'anywhere' }, children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Description, ":"] }), " ", item.description] })] })] }));
|
|
158
|
+
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, display: 'flex', flexDirection: 'column', alignItems: 'center' }, children: [_jsx("div", { style: { width: '40px' }, children: _jsx(TMDcmtIcon, { tid: item.tid, did: item.did, fileExtension: item.ext, downloadMode: getFileItemLinkUrl(item) !== undefined ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: item.isSigned }) }), _jsxs("div", { style: { display: 'flex', justifyContent: 'center', width: '40px' }, children: [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);
|
|
149
159
|
}) });
|
|
150
160
|
};
|
|
151
161
|
export default TMFileManagerThumbnailItems;
|
|
@@ -57,6 +57,7 @@ export declare const TMFileItemContainer: import("styled-components/dist/types")
|
|
|
57
57
|
$textColor?: string;
|
|
58
58
|
$bgHoverColor?: string;
|
|
59
59
|
}, never>>> & string;
|
|
60
|
+
export declare const getFileItemLinkUrl: (fileItem: FileItem | undefined) => string | undefined;
|
|
60
61
|
export declare const findFileItems: (items: Array<FileItem>, id: number) => FileItem | undefined;
|
|
61
62
|
export declare const setFolderTreeViewItems: (items: Array<FileItem>) => Array<TMFileManagerTreeViewDirectory>;
|
|
62
63
|
export declare const buildFolderHierarchy: (fileSystemTree: WGTreeDescriptor | undefined, draftsFile: SearchResultDescriptor | undefined, archivedDocuments: Array<SearchResultDescriptor> | undefined, participants: Array<UserDescriptor> | undefined) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import { associateColumnsToRows, SIGNATURE_EXTENSIONS } from "../../helper";
|
|
2
|
+
import { associateColumnsToRows, SIGNATURE_EXTENSIONS, WHATS_NEWS_FILE_NAME, WHATS_NEWS_LINK_URL } from "../../helper";
|
|
3
3
|
/**
|
|
4
4
|
* Verifica se un'estensione indica che il file è firmato digitalmente.
|
|
5
5
|
* Controlla se l'estensione (es. "pdf.p7m", ".p7m", "p7m") contiene
|
|
@@ -63,6 +63,26 @@ export const TMFileItemContainer = styled.div `
|
|
|
63
63
|
outline: none;
|
|
64
64
|
}
|
|
65
65
|
`;
|
|
66
|
+
// Confronto case-insensitive con il nome del file
|
|
67
|
+
const isWhatsNewsFileName = (name) => (name ?? '').toLowerCase() === WHATS_NEWS_FILE_NAME;
|
|
68
|
+
// Ritorna l'url del link associato al file: un file il cui metadato "description" contiene un url http/https
|
|
69
|
+
// e' un link, quindi non ha un file/documento da scaricare o da aprire nella form: si apre direttamente l'url
|
|
70
|
+
export const getFileItemLinkUrl = (fileItem) => {
|
|
71
|
+
if (!fileItem || fileItem.isDirectory)
|
|
72
|
+
return undefined;
|
|
73
|
+
if (isWhatsNewsFileName(fileItem.name))
|
|
74
|
+
return WHATS_NEWS_LINK_URL;
|
|
75
|
+
const value = fileItem.description?.trim();
|
|
76
|
+
if (!value)
|
|
77
|
+
return undefined;
|
|
78
|
+
try {
|
|
79
|
+
const url = new URL(value);
|
|
80
|
+
return (url.protocol === 'http:' || url.protocol === 'https:') ? url.href : undefined;
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
66
86
|
// Function to find a specific file or folder based on its ID (used for finding nested items)
|
|
67
87
|
export const findFileItems = (items, id) => {
|
|
68
88
|
for (let item of items) {
|
|
@@ -54,9 +54,11 @@ const TMDcmtIcon = ({ fileExtension, fileCount, isLexProt, isSigned, isMail, isS
|
|
|
54
54
|
cursor: isMobile
|
|
55
55
|
? (isDownloadable ? "pointer" : undefined)
|
|
56
56
|
: (isDownloadable ? "default" : undefined)
|
|
57
|
-
}, ...(
|
|
58
|
-
? {
|
|
59
|
-
:
|
|
57
|
+
}, ...(downloadMode === "none"
|
|
58
|
+
? {}
|
|
59
|
+
: deviceType === DeviceType.MOBILE
|
|
60
|
+
? { onClick: handleDownloadAction } // Su mobile, un singolo click sull'icona avvia il download
|
|
61
|
+
: { onDoubleClick: handleDownloadAction } // Su desktop, un doppio click sull'icona avvia il download
|
|
60
62
|
), children: [icon, isLexProt == 1 && _jsx("div", { style: { position: 'absolute', left: '-7px', top: isShared ? undefined : '2px' }, children: _jsx(TMTooltip, { content: "Protezione LEX", children: _jsx(IconLexProtLock, { color: 'blue', fontSize: 13 }) }) }), isShared == 1 && _jsx("div", { style: { position: 'absolute', top: '-7px', left: '-5px' }, children: _jsx(TMTooltip, { content: "Documento condiviso", children: _jsx(IconShared, { fontSize: 16 }) }) }), isSigned == 1 && _jsx("div", { style: { position: 'absolute', bottom: '-4px', right: '-7px' }, children: _jsx(TMTooltip, { content: "Documento firmato", children: _jsx(IconSignature, { fontSize: 28 }) }) }), showWaitPanel && (usePortal ? createPortal(_jsx(TMWaitPanel, { title: waitPanelTitle, showSecondary: showSecondary, textSecondary: waitPanelTextSecondary, valueSecondary: waitPanelValueSecondary, maxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); }, useHighZIndex: true }), document.body) : (_jsx(TMWaitPanel, { title: waitPanelTitle, showSecondary: showSecondary, textSecondary: waitPanelTextSecondary, valueSecondary: waitPanelValueSecondary, maxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, onAbortClick: (abortController) => { setTimeout(() => { abortController?.abort(); }, 1000); } })))] }));
|
|
61
63
|
};
|
|
62
64
|
export default TMDcmtIcon;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
3
|
-
import { getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
|
|
3
|
+
import { findFileItemByDraftID, getAttachmentInfo, lightenColor, removeFileExtension } from "./TMBlogsPostUtils";
|
|
4
4
|
import TMDcmtIcon from "../features/documents/TMDcmtIcon";
|
|
5
5
|
import { IconAttachment } from "../../helper";
|
|
6
|
+
import { getFileItemLinkUrl } from "../base/TMFileManagerUtils";
|
|
6
7
|
const TMBlogAttachments = (props) => {
|
|
7
8
|
const { layoutMode, attachments, isSelected, isLoading = false, searchText, dcmtTypeDescriptors, treeFs, draftLatestInfoMap, archivedDocumentMap, handleAttachmentFocus, openDcmtForm } = props;
|
|
9
|
+
// Ritorna l'url del link associato all'allegato: gli allegati che sono link non hanno un documento da scaricare o da aprire nella form
|
|
10
|
+
const getAttachmentLinkUrl = (blogPostAttachment) => getFileItemLinkUrl(findFileItemByDraftID(treeFs, blogPostAttachment.draftID) ?? undefined);
|
|
8
11
|
const handleMouseEnter = (e, blogPostAttachment, name, fileExt) => {
|
|
9
12
|
e.currentTarget.style.boxShadow = '0 4px 8px rgba(0, 0, 0, 0.15)';
|
|
10
13
|
e.currentTarget.style.backgroundColor = isSelected ? lightenColor("#135596", 40) : '#cfcfcf';
|
|
@@ -18,12 +21,20 @@ const TMBlogAttachments = (props) => {
|
|
|
18
21
|
handleAttachmentFocus(undefined);
|
|
19
22
|
};
|
|
20
23
|
const onDoubleClick = (e, blogPostAttachment, name, fileExt) => {
|
|
24
|
+
// i link non hanno un documento da aprire: il doppio click (su icona o testo) apre l'url in un nuovo tab
|
|
25
|
+
const linkUrl = getAttachmentLinkUrl(blogPostAttachment);
|
|
26
|
+
if (linkUrl) {
|
|
27
|
+
window.open(linkUrl, '_blank', 'noopener,noreferrer');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
21
30
|
const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
|
|
22
31
|
const fileName = `${removeFileExtension(name)}_${archiveID}_${blogPostAttachment.tid}_${blogPostAttachment.did}.${fileExt}`;
|
|
23
32
|
openDcmtForm({ TID: blogPostAttachment.tid, DID: blogPostAttachment.did, fileName });
|
|
24
33
|
};
|
|
25
34
|
return _jsx("div", { style: { width: "100%", marginTop: "5px", overflow: "hidden" }, children: attachments.map((blogPostAttachment, index) => {
|
|
26
35
|
const { name, nameElement, tooltipContent, fileExt, archivedDocumentsExist, draftExist, isSigned } = getAttachmentInfo(blogPostAttachment, treeFs, draftLatestInfoMap, archivedDocumentMap, dcmtTypeDescriptors, isSelected, searchText);
|
|
36
|
+
// i link non hanno un file associato: l'icona non deve avviare il download
|
|
37
|
+
const isLink = getAttachmentLinkUrl(blogPostAttachment) !== undefined;
|
|
27
38
|
return _jsx("div", { onDoubleClick: (e) => !isLoading && onDoubleClick(e, blogPostAttachment, name, fileExt), onMouseEnter: (e) => !isLoading && handleMouseEnter(e, blogPostAttachment, name, fileExt), onMouseLeave: (e) => !isLoading && handleMouseLeave(e), style: {
|
|
28
39
|
display: layoutMode === "extended" ? "inline-flex" : "flex",
|
|
29
40
|
padding: '4px 8px',
|
|
@@ -63,7 +74,7 @@ const TMBlogAttachments = (props) => {
|
|
|
63
74
|
}
|
|
64
75
|
` })] })) : (_jsxs(_Fragment, { children: [(!archivedDocumentsExist && !draftExist) ?
|
|
65
76
|
_jsx(IconAttachment, { style: { marginRight: "5px", flexShrink: 0 } }) :
|
|
66
|
-
_jsx("div", { style: { marginRight: "10px", flexShrink: 0, width: isSigned ? "40px" : undefined }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent, isSigned: isSigned }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
|
|
77
|
+
_jsx("div", { style: { marginRight: "10px", flexShrink: 0, width: isSigned ? "40px" : undefined }, children: _jsx(TMDcmtIcon, { tid: blogPostAttachment.tid, did: blogPostAttachment.did, fileExtension: fileExt, downloadMode: isLink ? 'none' : 'openInNewWindow', tooltipContent: tooltipContent, isSigned: isSigned }) }), _jsx("span", { title: layoutMode === 'compact' ? name + " (DID: " + blogPostAttachment.did + ")" : undefined, style: {
|
|
67
78
|
whiteSpace: 'nowrap',
|
|
68
79
|
overflow: 'hidden',
|
|
69
80
|
textOverflow: 'ellipsis',
|
|
@@ -272,9 +272,9 @@ const TMTidViewer = ({ tmSession, tid, did, showIcon = false, color, showId = fa
|
|
|
272
272
|
if (count <= 0)
|
|
273
273
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.ListDcmtTypeOrView} ...` });
|
|
274
274
|
try {
|
|
275
|
-
let resultDTD = await DcmtTypeListCacheService.GetAsync(tid);
|
|
275
|
+
let resultDTD = await DcmtTypeListCacheService.GetAsync(tid, true, tmSession);
|
|
276
276
|
if (!resultDTD) {
|
|
277
|
-
resultDTD = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did);
|
|
277
|
+
resultDTD = await DcmtTypeListCacheService.GetWithNotGrantedAsync(tid, did, undefined, true, tmSession);
|
|
278
278
|
}
|
|
279
279
|
setDtd(resultDTD);
|
|
280
280
|
}
|
|
@@ -37,6 +37,7 @@ export declare class UserSettings {
|
|
|
37
37
|
dcmtCheckoutInfo: CheckoutInfo[];
|
|
38
38
|
defaultCheckInOutFolder: string;
|
|
39
39
|
documentDownloadSettings: DocumentDownloadSettings;
|
|
40
|
+
lastSeenAppVersion: string;
|
|
40
41
|
constructor(skipCssUpdate?: boolean);
|
|
41
42
|
/** Load settings from local storage or other sources */
|
|
42
43
|
static LoadSettings(userID: number | undefined, archiveID: string | undefined): UserSettings;
|
|
@@ -59,6 +59,7 @@ export class UserSettings {
|
|
|
59
59
|
this.dcmtCheckoutInfo = [];
|
|
60
60
|
this.defaultCheckInOutFolder = DEFAULT_CHECK_IN_OUT_FOLDER;
|
|
61
61
|
this.documentDownloadSettings = new DocumentDownloadSettings();
|
|
62
|
+
this.lastSeenAppVersion = '';
|
|
62
63
|
this.themeSettings = new ThemeSettings(skipCssUpdate);
|
|
63
64
|
}
|
|
64
65
|
/** Load settings from local storage or other sources */
|
|
@@ -43,6 +43,10 @@ export declare class SDKUI_Localizator {
|
|
|
43
43
|
static get Apply(): "Anwenden" | "Apply" | "Aplicar" | "Applique" | "Applica";
|
|
44
44
|
static get ApplyAndClose(): "Anwenden und Schließen" | "Apply and close" | "Aplicar y cerrar" | "Applique et ferme" | "Aplicar e fechar" | "Applica e chiudi";
|
|
45
45
|
static get ApplyContextualFilter(): string;
|
|
46
|
+
static get AppUpdatedMessage(): string;
|
|
47
|
+
static get AppUpdatedMessageFromTo(): string;
|
|
48
|
+
static get AppUpdatedSubMessage(): string;
|
|
49
|
+
static get AppUpdatedTitle(): string;
|
|
46
50
|
static get Approve(): "Genehmigen" | "Approve" | "Aprobar" | "Approuver" | "Aprovar" | "Approva";
|
|
47
51
|
static get Archive(): "Archiv" | "Archive" | "Almacenar" | "Armazena" | "Archivia";
|
|
48
52
|
static get ArchiveConstraint(): "Archivierungsbeschränkung" | "Archive constraint" | "Vínculo de almacenamiento" | "Contrainte d'archivage" | "Armazenamento de restrição" | "Vincolo di archiviazione";
|
|
@@ -220,6 +224,7 @@ export declare class SDKUI_Localizator {
|
|
|
220
224
|
static get DiagramItemTypes_End(): "Ende" | "End" | "Fin" | "Fim" | "Fine";
|
|
221
225
|
static get Disabled(): "Deaktiviert" | "Disabled" | "Deshabilitado" | "Désactivé" | "Desabilitado" | "Disabilitato";
|
|
222
226
|
static get DisableMultipleSelection(): string;
|
|
227
|
+
static get DiscoverWhatsNew(): string;
|
|
223
228
|
static get DisplayFormat(): string;
|
|
224
229
|
static get DisplayNameMethod(): string;
|
|
225
230
|
static get DisplayNameMethod_Abstract(): string;
|
|
@@ -384,6 +384,46 @@ export class SDKUI_Localizator {
|
|
|
384
384
|
default: return "Applica filtro contestuale";
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
+
static get AppUpdatedMessage() {
|
|
388
|
+
switch (this._cultureID) {
|
|
389
|
+
case CultureIDs.De_DE: return "Die Anwendung wurde auf Version {{0}} aktualisiert.";
|
|
390
|
+
case CultureIDs.En_US: return "The application has been updated to version {{0}}.";
|
|
391
|
+
case CultureIDs.Es_ES: return "La aplicación se ha actualizado a la versión {{0}}.";
|
|
392
|
+
case CultureIDs.Fr_FR: return "L'application a été mise à jour vers la version {{0}}.";
|
|
393
|
+
case CultureIDs.Pt_PT: return "A aplicação foi atualizada para a versão {{0}}.";
|
|
394
|
+
default: return "L'applicazione è stata aggiornata alla versione {{0}}.";
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
static get AppUpdatedMessageFromTo() {
|
|
398
|
+
switch (this._cultureID) {
|
|
399
|
+
case CultureIDs.De_DE: return "Die Anwendung wurde von Version {{0}} auf Version {{1}} aktualisiert.";
|
|
400
|
+
case CultureIDs.En_US: return "The application has been updated from version {{0}} to version {{1}}.";
|
|
401
|
+
case CultureIDs.Es_ES: return "La aplicación se ha actualizado de la versión {{0}} a la versión {{1}}.";
|
|
402
|
+
case CultureIDs.Fr_FR: return "L'application a été mise à jour de la version {{0}} à la version {{1}}.";
|
|
403
|
+
case CultureIDs.Pt_PT: return "A aplicação foi atualizada da versão {{0}} para a versão {{1}}.";
|
|
404
|
+
default: return "L'applicazione è stata aggiornata dalla versione {{0}} alla versione {{1}}.";
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
static get AppUpdatedSubMessage() {
|
|
408
|
+
switch (this._cultureID) {
|
|
409
|
+
case CultureIDs.De_DE: return "Entdecken Sie die neuen Funktionen und Verbesserungen dieser Version.";
|
|
410
|
+
case CultureIDs.En_US: return "Discover the new features and improvements introduced in this version.";
|
|
411
|
+
case CultureIDs.Es_ES: return "Descubra las nuevas funciones y mejoras introducidas en esta versión.";
|
|
412
|
+
case CultureIDs.Fr_FR: return "Découvrez les nouvelles fonctionnalités et améliorations de cette version.";
|
|
413
|
+
case CultureIDs.Pt_PT: return "Descubra as novas funcionalidades e melhorias desta versão.";
|
|
414
|
+
default: return "Scopri le nuove funzionalità e i miglioramenti introdotti in questa versione.";
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
static get AppUpdatedTitle() {
|
|
418
|
+
switch (this._cultureID) {
|
|
419
|
+
case CultureIDs.De_DE: return "Aktualisierung abgeschlossen";
|
|
420
|
+
case CultureIDs.En_US: return "Update completed";
|
|
421
|
+
case CultureIDs.Es_ES: return "Actualización completada";
|
|
422
|
+
case CultureIDs.Fr_FR: return "Mise à jour terminée";
|
|
423
|
+
case CultureIDs.Pt_PT: return "Atualização concluída";
|
|
424
|
+
default: return "Aggiornamento completato";
|
|
425
|
+
}
|
|
426
|
+
}
|
|
387
427
|
static get Approve() {
|
|
388
428
|
switch (this._cultureID) {
|
|
389
429
|
case CultureIDs.De_DE: return "Genehmigen";
|
|
@@ -2149,6 +2189,16 @@ export class SDKUI_Localizator {
|
|
|
2149
2189
|
default: return "Disabilita selezione multipla";
|
|
2150
2190
|
}
|
|
2151
2191
|
}
|
|
2192
|
+
static get DiscoverWhatsNew() {
|
|
2193
|
+
switch (this._cultureID) {
|
|
2194
|
+
case CultureIDs.De_DE: return "Neuigkeiten entdecken";
|
|
2195
|
+
case CultureIDs.En_US: return "Discover what's new";
|
|
2196
|
+
case CultureIDs.Es_ES: return "Descubre las novedades";
|
|
2197
|
+
case CultureIDs.Fr_FR: return "Découvrir les nouveautés";
|
|
2198
|
+
case CultureIDs.Pt_PT: return "Descobrir as novidades";
|
|
2199
|
+
default: return "Scopri le novità";
|
|
2200
|
+
}
|
|
2201
|
+
}
|
|
2152
2202
|
static get DisplayFormat() {
|
|
2153
2203
|
switch (this._cultureID) {
|
|
2154
2204
|
case CultureIDs.De_DE: return "Anzeigeformat";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TMAppUpdatedModal: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import styled from 'styled-components';
|
|
4
|
+
import { AppModules, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
5
|
+
import { useDeviceType, TMModal } from '../components';
|
|
6
|
+
import { calcResponsiveSizes, WHATS_NEWS_LINK_URL } from './helpers';
|
|
7
|
+
import { SDKUI_Globals } from './SDKUI_Globals';
|
|
8
|
+
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
9
|
+
import { IconUpdate, IconOpenInNew } from './TMIcons';
|
|
10
|
+
import { getAppModuleButtonColors } from './TMUtils';
|
|
11
|
+
const Content = styled.div `
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
width: 100%;
|
|
15
|
+
background-color: #ffffff;
|
|
16
|
+
`;
|
|
17
|
+
const Header = styled.div `
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
align-items: center;
|
|
21
|
+
gap: 14px;
|
|
22
|
+
padding: 32px 30px 26px 30px;
|
|
23
|
+
background-color: ${({ $backgroundColor }) => $backgroundColor};
|
|
24
|
+
color: #ffffff;
|
|
25
|
+
text-align: center;
|
|
26
|
+
`;
|
|
27
|
+
const HeaderIcon = styled.div `
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
width: 68px;
|
|
32
|
+
height: 68px;
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
background-color: rgba(255, 255, 255, 0.18);
|
|
35
|
+
border: 1px solid rgba(255, 255, 255, 0.35);
|
|
36
|
+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
|
|
37
|
+
`;
|
|
38
|
+
const HeaderTitle = styled.h2 `
|
|
39
|
+
margin: 0;
|
|
40
|
+
font-size: 22px;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
letter-spacing: 0.2px;
|
|
43
|
+
`;
|
|
44
|
+
const VersionBadge = styled.span `
|
|
45
|
+
display: inline-block;
|
|
46
|
+
padding: 4px 12px;
|
|
47
|
+
border-radius: 999px;
|
|
48
|
+
background-color: rgba(255, 255, 255, 0.22);
|
|
49
|
+
border: 1px solid rgba(255, 255, 255, 0.4);
|
|
50
|
+
font-size: 13px;
|
|
51
|
+
font-weight: 600;
|
|
52
|
+
letter-spacing: 0.3px;
|
|
53
|
+
`;
|
|
54
|
+
const Body = styled.div `
|
|
55
|
+
display: flex;
|
|
56
|
+
flex-direction: column;
|
|
57
|
+
gap: 10px;
|
|
58
|
+
padding: 26px 30px 22px 30px;
|
|
59
|
+
text-align: center;
|
|
60
|
+
`;
|
|
61
|
+
const Message = styled.p `
|
|
62
|
+
margin: 0;
|
|
63
|
+
font-size: 15px;
|
|
64
|
+
line-height: 1.6;
|
|
65
|
+
color: #242424;
|
|
66
|
+
`;
|
|
67
|
+
const SubMessage = styled.p `
|
|
68
|
+
margin: 0;
|
|
69
|
+
font-size: 13px;
|
|
70
|
+
line-height: 1.6;
|
|
71
|
+
color: #6b6b6b;
|
|
72
|
+
`;
|
|
73
|
+
const Footer = styled.div `
|
|
74
|
+
display: flex;
|
|
75
|
+
flex-direction: row;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
align-items: center;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: 12px;
|
|
80
|
+
padding: 0 30px 28px 30px;
|
|
81
|
+
`;
|
|
82
|
+
const BaseButton = styled.button `
|
|
83
|
+
display: inline-flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
gap: 8px;
|
|
87
|
+
min-width: 150px;
|
|
88
|
+
padding: 10px 18px;
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
cursor: pointer;
|
|
93
|
+
transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
|
|
94
|
+
`;
|
|
95
|
+
const PrimaryButton = styled(BaseButton) `
|
|
96
|
+
border: 1px solid ${({ $base }) => $base};
|
|
97
|
+
background-color: ${({ $base }) => $base};
|
|
98
|
+
color: #ffffff;
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
background-color: ${({ $hover }) => $hover};
|
|
102
|
+
border-color: ${({ $hover }) => $hover};
|
|
103
|
+
box-shadow: 0 2px 8px ${({ $shadow }) => $shadow};
|
|
104
|
+
}
|
|
105
|
+
`;
|
|
106
|
+
const SecondaryButton = styled(BaseButton) `
|
|
107
|
+
border: 1px solid #d5d5d5;
|
|
108
|
+
background-color: #ffffff;
|
|
109
|
+
color: #444444;
|
|
110
|
+
|
|
111
|
+
&:hover {
|
|
112
|
+
background-color: #f3f3f3;
|
|
113
|
+
border-color: #bdbdbd;
|
|
114
|
+
}
|
|
115
|
+
`;
|
|
116
|
+
export const TMAppUpdatedModal = () => {
|
|
117
|
+
const deviceType = useDeviceType();
|
|
118
|
+
const currentVersion = SDK_Globals.appVersion ?? '';
|
|
119
|
+
const appModuleID = SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER;
|
|
120
|
+
const appModuleColors = useMemo(() => getAppModuleButtonColors(appModuleID), [appModuleID]);
|
|
121
|
+
const [previousVersion] = useState(() => SDKUI_Globals.userSettings.lastSeenAppVersion ?? '');
|
|
122
|
+
const [isOpen, setIsOpen] = useState(() => currentVersion !== '' && previousVersion !== currentVersion);
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
if (!isOpen)
|
|
125
|
+
return;
|
|
126
|
+
SDKUI_Globals.userSettings.lastSeenAppVersion = currentVersion;
|
|
127
|
+
}, [isOpen, currentVersion]);
|
|
128
|
+
const onClose = () => { setIsOpen(false); };
|
|
129
|
+
if (!isOpen)
|
|
130
|
+
return null;
|
|
131
|
+
return (_jsx(TMModal, { width: calcResponsiveSizes(deviceType, '520px', '520px', '95%'), height: 'auto', showHeader: false, resizable: false, onClose: onClose, children: _jsxs(Content, { children: [_jsxs(Header, { "$backgroundColor": appModuleColors.base, children: [_jsx(HeaderIcon, { children: _jsx(IconUpdate, { fontSize: 34 }) }), _jsx(HeaderTitle, { children: SDKUI_Localizator.AppUpdatedTitle }), _jsx(VersionBadge, { children: `${SDK_Globals.appModule} ${currentVersion}` })] }), _jsxs(Body, { children: [_jsx(Message, { children: previousVersion
|
|
132
|
+
? SDKUI_Localizator.AppUpdatedMessageFromTo.replaceParams(previousVersion, currentVersion)
|
|
133
|
+
: SDKUI_Localizator.AppUpdatedMessage.replaceParams(currentVersion) }), _jsx(SubMessage, { children: SDKUI_Localizator.AppUpdatedSubMessage })] }), _jsxs(Footer, { children: [_jsxs(PrimaryButton, { "$base": appModuleColors.base, "$hover": appModuleColors.hover, "$shadow": appModuleColors.shadow, onClick: () => window.open(WHATS_NEWS_LINK_URL, '_blank', 'noopener,noreferrer'), children: [_jsx(IconOpenInNew, { fontSize: 18 }), SDKUI_Localizator.DiscoverWhatsNew] }), _jsx(SecondaryButton, { onClick: onClose, children: SDKUI_Localizator.Close })] })] }) }));
|
|
134
|
+
};
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -58,6 +58,11 @@ export declare const getPdgsIconMap: (fontSize?: number) => Map<PdGs, JSX.Elemen
|
|
|
58
58
|
export declare const convertSearchResultDescriptorToFileItems: (documents: Array<SearchResultDescriptor>) => Array<FileItem>;
|
|
59
59
|
export declare const getAppModuleGradient: (appModuleID: AppModules) => string;
|
|
60
60
|
export declare const getPanelManagerToolbarColor: (appModuleID: AppModules) => string;
|
|
61
|
+
export declare const getAppModuleButtonColors: (appModuleID: AppModules) => {
|
|
62
|
+
base: string;
|
|
63
|
+
hover: string;
|
|
64
|
+
shadow: string;
|
|
65
|
+
};
|
|
61
66
|
export declare const getFileManagerFolderColor: (appModuleID: AppModules) => string;
|
|
62
67
|
type SearchToolbarVisibility = {
|
|
63
68
|
tmSearchResult: boolean;
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -336,7 +336,7 @@ export const getAppModuleGradient = (appModuleID) => {
|
|
|
336
336
|
case AppModules.SURFER:
|
|
337
337
|
return 'linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)';
|
|
338
338
|
case AppModules.DESIGNER:
|
|
339
|
-
return 'linear-gradient(270deg, #A06A8E 16%, #885C77 34%, #6F4C5F 54%, #5A3446 72%, #482234 100%)
|
|
339
|
+
return 'linear-gradient(270deg, #A06A8E 16%, #885C77 34%, #6F4C5F 54%, #5A3446 72%, #482234 100%)';
|
|
340
340
|
case AppModules.ORCHESTRATOR:
|
|
341
341
|
return 'linear-gradient(270deg, #46B5A2 16%, #3BAA8A 34%, #2F8F6F 54%, #277A5A 72%, #216948 88%, #1d6f42 100%)';
|
|
342
342
|
default:
|
|
@@ -355,6 +355,18 @@ export const getPanelManagerToolbarColor = (appModuleID) => {
|
|
|
355
355
|
return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
|
|
356
356
|
}
|
|
357
357
|
};
|
|
358
|
+
export const getAppModuleButtonColors = (appModuleID) => {
|
|
359
|
+
switch (appModuleID) {
|
|
360
|
+
case AppModules.SURFER:
|
|
361
|
+
return { base: '#2559a5', hover: '#1c4783', shadow: 'rgba(37, 89, 165, 0.35)' };
|
|
362
|
+
case AppModules.DESIGNER:
|
|
363
|
+
return { base: '#482234', hover: '#351826', shadow: 'rgba(72, 34, 52, 0.35)' };
|
|
364
|
+
case AppModules.ORCHESTRATOR:
|
|
365
|
+
return { base: '#1d6f42', hover: '#15532f', shadow: 'rgba(29, 111, 66, 0.35)' };
|
|
366
|
+
default:
|
|
367
|
+
return { base: '#2559a5', hover: '#1c4783', shadow: 'rgba(37, 89, 165, 0.35)' };
|
|
368
|
+
}
|
|
369
|
+
};
|
|
358
370
|
export const getFileManagerFolderColor = (appModuleID) => {
|
|
359
371
|
switch (appModuleID) {
|
|
360
372
|
case AppModules.SURFER:
|
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export declare const getSystemMetadata: (withPerm?: boolean) => MetadataDescript
|
|
|
62
62
|
export declare function deepCompare(obj1: any, obj2: any): boolean;
|
|
63
63
|
export declare const extensionHandler: (fileExt: string | undefined) => FileExtensionHandler;
|
|
64
64
|
export declare const downloadBase64File: (base64Data: string, fileName: string) => void;
|
|
65
|
+
export declare const WHATS_NEWS_FILE_NAME = "what's new";
|
|
66
|
+
export declare const WHATS_NEWS_LINK_URL = "https://www.topconsult.it/it/documentazionetopmedia";
|
|
65
67
|
export declare const TASK_MORE_INFO_PREFIX_NAME: string;
|
|
66
68
|
export declare const isTaskMoreInfo: (taskName: string | undefined) => boolean | undefined;
|
|
67
69
|
export declare const getMoreInfoTasksForDocument: (allTasks: TaskDescriptor[], TID: number | null | undefined, DID: number | null | undefined) => TaskDescriptor[];
|
package/lib/helper/helpers.js
CHANGED
|
@@ -613,6 +613,8 @@ export const downloadBase64File = (base64Data, fileName) => {
|
|
|
613
613
|
// Libera l'URL del Blob
|
|
614
614
|
URL.revokeObjectURL(blobUrl);
|
|
615
615
|
};
|
|
616
|
+
export const WHATS_NEWS_FILE_NAME = "what's new";
|
|
617
|
+
export const WHATS_NEWS_LINK_URL = 'https://www.topconsult.it/it/documentazionetopmedia';
|
|
616
618
|
export const TASK_MORE_INFO_PREFIX_NAME = `${SDKUI_Localizator.MoreInformation} - `;
|
|
617
619
|
export const isTaskMoreInfo = (taskName) => taskName?.startsWith(TASK_MORE_INFO_PREFIX_NAME);
|
|
618
620
|
// Filtra i task di tipo "More Info" non completati associati a un documento specifico.
|
package/lib/helper/index.d.ts
CHANGED
package/lib/helper/index.js
CHANGED