@topconsultnpm/sdkui-react 6.21.0-dev1.5 → 6.21.0-dev1.50
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/NewComponents/ContextMenu/TMContextMenu.js +2 -2
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/base/TMAreaManager.js +28 -11
- package/lib/components/base/TMFileManagerDataGridView.js +2 -2
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/choosers/TMDataListItemChooser.js +25 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +50 -23
- package/lib/components/choosers/TMUserChooser.js +3 -1
- package/lib/components/editors/TMFormulaEditor.js +15 -3
- package/lib/components/editors/TMMetadataEditor.js +4 -3
- package/lib/components/editors/TMMetadataValues.js +1 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +11 -7
- package/lib/components/features/documents/TMDragDropOverlay.js +7 -2
- package/lib/components/features/documents/TMFileUploader.js +5 -4
- package/lib/components/features/documents/TMMasterDetailDcmts.js +74 -21
- package/lib/components/features/documents/TMRelationViewer.d.ts +6 -1
- package/lib/components/features/documents/TMRelationViewer.js +44 -7
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +13 -1
- package/lib/components/features/search/TMSearchResult.js +16 -3
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
- package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
- package/lib/components/forms/Login/TMLoginForm.js +15 -5
- package/lib/components/forms/TMChooserForm.js +25 -2
- package/lib/components/grids/TMBlogsPost.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryCountButton.d.ts +11 -0
- package/lib/components/query/TMQueryCountButton.js +32 -0
- package/lib/components/query/TMQueryEditor.js +41 -4
- package/lib/components/query/TMQuerySummary.js +3 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +2 -2
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/TMPdfViewer.js +143 -86
- package/lib/helper/TMUtils.d.ts +1 -0
- package/lib/helper/TMUtils.js +12 -0
- package/lib/helper/checkinCheckoutManager.d.ts +7 -2
- package/lib/helper/checkinCheckoutManager.js +220 -11
- package/lib/hooks/useCheckInOutOperations.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.js +9 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +74 -4
- package/lib/hooks/useDocumentOperations.js +20 -6
- package/lib/hooks/useForm.js +20 -14
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +37 -0
- package/lib/hooks/useQueryParametersDialog.js +5 -5
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/services/platform_services.js +8 -0
- package/package.json +54 -55
|
@@ -22,7 +22,7 @@ const TMContextMenu = ({ items, trigger = 'right', children, target, externalCon
|
|
|
22
22
|
const longPressTimeoutRef = useRef(null);
|
|
23
23
|
const touchStartPos = useRef(null);
|
|
24
24
|
// Get current menu to pass items count to positioning hook
|
|
25
|
-
const currentMenu = menuState.submenuStack.
|
|
25
|
+
const currentMenu = menuState.submenuStack[menuState.submenuStack.length - 1] || items;
|
|
26
26
|
const { openLeft, openUp, isCalculated, needsScroll, maxHeight } = useMenuPosition(menuRef, menuState.position, currentMenu.length);
|
|
27
27
|
const handleClose = () => {
|
|
28
28
|
if (externalControl) {
|
|
@@ -465,7 +465,7 @@ const TMContextMenu = ({ items, trigger = 'right', children, target, externalCon
|
|
|
465
465
|
return (_jsxs(S.MenuItem, { "$disabled": item.disabled, "$hasSubmenu": !!item.submenu && item.submenu.length > 0, "$beginGroup": item.beginGroup, "data-disabled": item.disabled ? "true" : undefined, onMouseDown: handleClick, onMouseEnter: (e) => !isMobile && handleMouseEnter(item, e, depth + 1), onMouseLeave: () => !isMobile && handleMouseLeave(depth + 1), title: item.tooltip, children: [_jsxs(S.MenuItemContent, { children: [item.icon && _jsx(S.IconWrapper, { children: item.icon }), _jsx(S.MenuItemName, { children: item.name })] }), rightIconElement && rightIconClickHandler ? (_jsx(S.RightIconButton, { onClick: rightIconClickHandler, onMouseDown: (e) => e.stopPropagation(), "aria-label": `Action for ${item.name}`, children: rightIconElement })) : rightIconElement ? (_jsx(S.IconWrapper, { children: rightIconElement })) : null, item.submenu && item.submenu.length > 0 && (_jsx(S.SubmenuIndicator, { "$isMobile": isMobile, children: isMobile ? '›' : '▸' }))] }, itemKey));
|
|
466
466
|
});
|
|
467
467
|
};
|
|
468
|
-
const currentParentName = menuState.parentNames.
|
|
468
|
+
const currentParentName = menuState.parentNames[menuState.parentNames.length - 1] || '';
|
|
469
469
|
return (_jsxs(_Fragment, { children: [!externalControl && children && (_jsx("div", { ref: triggerRef, onContextMenu: handleContextMenu, onClick: handleClick, onTouchStart: handleTouchStart, onTouchMove: handleTouchMove, onTouchEnd: handleTouchEnd, onTouchCancel: handleTouchEnd, onKeyDown: (e) => {
|
|
470
470
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
471
471
|
handleClick(e);
|
|
@@ -347,7 +347,7 @@ const TMFloatingMenuBar = ({ containerRef, contextMenuItems = [], isConstrained
|
|
|
347
347
|
// Remove trailing separators from items array
|
|
348
348
|
const removeTrailingSeparators = useCallback((items) => {
|
|
349
349
|
const result = [...items];
|
|
350
|
-
while (result.length > 0 && result.
|
|
350
|
+
while (result.length > 0 && result[result.length - 1]?.isSeparator) {
|
|
351
351
|
result.pop();
|
|
352
352
|
}
|
|
353
353
|
return result;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import FileManager, { Column, Details, ItemView, Permissions, Notifications, ContextMenu, Toolbar, Item } from 'devextreme-react/file-manager';
|
|
4
|
-
import { FileDescriptor, FileFormats, FileTransferModes, SDK_Localizator, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { FileDescriptor, FileFormats, FileTransferModes, SDK_Localizator, SDK_Globals, AppModules } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import CustomFileSystemProvider from 'devextreme/file_management/custom_provider';
|
|
6
6
|
import FileSystemError from "devextreme/file_management/error";
|
|
7
7
|
import Button from "devextreme/ui/button";
|
|
8
8
|
import { alert, confirm } from "devextreme/ui/dialog";
|
|
9
9
|
import { loadMessages } from 'devextreme/localization';
|
|
10
|
-
import { Globalization, IconAll, IconCloud, IconFolder, IconFolderForCSS, IconSelected, SDKUI_Localizator, svgToString } from '../../helper';
|
|
10
|
+
import { getFileManagerFolderColor, Globalization, IconAll, IconCloud, IconFolder, IconFolderForCSS, IconSelected, SDKUI_Localizator, svgToString } from '../../helper';
|
|
11
11
|
import { TMExceptionBoxManager } from './TMPopUp';
|
|
12
12
|
import ShowAlert from './TMAlert';
|
|
13
13
|
import { TMLayoutWaitingContainer } from './TMWaitPanel';
|
|
14
14
|
import TMCounterContainer, { CounterItemKey } from './TMCounterContainer';
|
|
15
15
|
import { IconPdf, IconTxt, IconXls, IconDocx, IconImage, IconZip, IconXml, IconMp4, IconEmail, IconPpt, IconSigned, IconExe, IconHtml, IconDwg, IconDicom, IconSlddrw } from '../../assets/thumbnails';
|
|
16
|
-
import { TMColors } from '../../utils/theme';
|
|
17
16
|
import styled from 'styled-components';
|
|
18
17
|
import { renderToStaticMarkup } from 'react-dom/server';
|
|
19
18
|
export class TMFileSystemItem {
|
|
@@ -25,8 +24,10 @@ export class TMFileSystemItem {
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
let abortController = new AbortController();
|
|
28
|
-
const
|
|
29
|
-
const
|
|
27
|
+
const generateSvgDataUrl = (color) => {
|
|
28
|
+
const svgString = encodeURIComponent(renderToStaticMarkup(_jsx(IconFolderForCSS, { fill: color })));
|
|
29
|
+
return `data:image/svg+xml,${svgString}`;
|
|
30
|
+
};
|
|
30
31
|
const StyledFileManagerWrapper = styled.div `
|
|
31
32
|
.dx-filemanager .dx-treeview-item .dx-icon-folder {
|
|
32
33
|
display: none !important;
|
|
@@ -44,7 +45,7 @@ const StyledFileManagerWrapper = styled.div `
|
|
|
44
45
|
width: 20px;
|
|
45
46
|
height: 20px;
|
|
46
47
|
transform: translateY(-50%);
|
|
47
|
-
background-image: url("${
|
|
48
|
+
background-image: url("${props => generateSvgDataUrl(props.$folderColor)}");
|
|
48
49
|
background-size: contain;
|
|
49
50
|
background-repeat: no-repeat;
|
|
50
51
|
display: inline-block;
|
|
@@ -390,7 +391,9 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
390
391
|
const deleteItem = async (item) => {
|
|
391
392
|
const ad = item.dataItem.dataItem;
|
|
392
393
|
const aid = ad.id;
|
|
393
|
-
const
|
|
394
|
+
const subFolderOld = item.parentPath === ad.name ? '' : item.parentPath.replace(ad.name + '/', '');
|
|
395
|
+
const subFolder = getSubFolder(item.parentPath, ad.name);
|
|
396
|
+
console.log("Delete item with subfolder: ", subFolder, " old subfolder: ", subFolderOld);
|
|
394
397
|
const tms = props.tmSession ?? SDK_Globals.tmSession;
|
|
395
398
|
if (item.isDirectory) {
|
|
396
399
|
await tms?.NewAreaEngine().DeleteFoldersAsync(aid, subFolder, [item.name]).catch((err) => { throw new FileSystemError(5, item, err.message ?? SDKUI_Localizator.GetFolderDeletionErrorMessage); });
|
|
@@ -594,16 +597,29 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
594
597
|
throw new FileSystemError(5, undefined, error.message ?? SDKUI_Localizator.Error);
|
|
595
598
|
}
|
|
596
599
|
};
|
|
600
|
+
const getSubFolder = (dir, startStr) => {
|
|
601
|
+
//Se devo controllare che inizi per il nome dell'area, se non inizia ritorno la dir così com'è (caso di file aperto da percorso completo)
|
|
602
|
+
if (startStr && !dir.startsWith(startStr)) {
|
|
603
|
+
return dir;
|
|
604
|
+
}
|
|
605
|
+
//In tutti gli altri casi rimuovo la prima cartella del percorso (che corrisponde al nome dell'area) e la restituisco come subfolder
|
|
606
|
+
const parts = dir.split("/");
|
|
607
|
+
console.log(parts);
|
|
608
|
+
let subFolder = parts.slice(1).join("/");
|
|
609
|
+
console.log(subFolder);
|
|
610
|
+
return subFolder;
|
|
611
|
+
};
|
|
597
612
|
const onCurrentDirectoryChanged = (e) => {
|
|
598
613
|
setCurrentRoute(e.directory.path);
|
|
599
614
|
setFocusedFileSystemItem(e.directory);
|
|
615
|
+
console.log("Current directory changed: ", e.directory);
|
|
600
616
|
if (e.directory.path === '' && e.directory.name === '')
|
|
601
617
|
return;
|
|
602
618
|
let ad = e.directory.dataItem.dataItem;
|
|
603
619
|
if (!ad)
|
|
604
620
|
return;
|
|
605
621
|
let aid = ad.id;
|
|
606
|
-
let subFolder = e.directory.path
|
|
622
|
+
let subFolder = getSubFolder(e.directory.path);
|
|
607
623
|
setAreaFolder(getAreaPath(aid, subFolder));
|
|
608
624
|
e.component.option("fileSystemProvider").getItems(e.directory).then((items) => {
|
|
609
625
|
setParentDirectoryFileSystemItems(items);
|
|
@@ -632,7 +648,7 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
632
648
|
};
|
|
633
649
|
const customizeIcon = useCallback((fileSystemItem) => {
|
|
634
650
|
if (fileSystemItem.isDirectory) {
|
|
635
|
-
return svgToString(_jsx(IconFolder, { fontSize: 20, color:
|
|
651
|
+
return svgToString(_jsx(IconFolder, { fontSize: 20, color: getFileManagerFolderColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER) }));
|
|
636
652
|
}
|
|
637
653
|
else {
|
|
638
654
|
const fileExtension = fileSystemItem.getFileExtension();
|
|
@@ -723,11 +739,12 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
723
739
|
alert(`"${e.name}" ${SDKUI_Localizator.FolderExist}`, SDKUI_Localizator.Attention);
|
|
724
740
|
}
|
|
725
741
|
};
|
|
726
|
-
|
|
742
|
+
const folderColor = getFileManagerFolderColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER);
|
|
743
|
+
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsxs(StyledFileManagerWrapper, { "$folderColor": folderColor, style: { width: "100%", height: "100%" }, children: [_jsxs(FileManager, { width: props.width, ref: fileManagerRef, height: `calc(${props.height} - 30px)`, onItemMoving: onItemCopying, onItemCopying: onItemCopying, onFileUploading: onFileUploading, fileSystemProvider: areaProvider, customizeThumbnail: customizeIcon, rootFolderName: SDK_Localizator.Areas, onSelectionChanged: onSelectionChanged, onDirectoryCreating: onDirectoryCreating, onFocusedItemChanged: onFocusedItemChanged, onSelectedFileOpened: onSelectedFileOpened, onContextMenuItemClick: onContextMenuItemClick,
|
|
727
744
|
/* onItemMoved={() => setCounter(counter => counter + 1)}
|
|
728
745
|
onItemCopied={() => setCounter(counter => counter + 1)}
|
|
729
746
|
onItemDeleted={() => setCounter(counter => counter - 1)}
|
|
730
747
|
onFileUploaded={() => setCounter(counter => counter + 1)} */
|
|
731
|
-
onCurrentDirectoryChanged: onCurrentDirectoryChanged, selectionMode: props.selectionMode === 'single' ? 'single' : selectionMode, children: [_jsxs(Toolbar, { children: [_jsx(Item, { name: "showNavPane", visible: true }), _jsx(Item, { name: "create", visible: true }), _jsx(Item, { name: "upload", visible: true }), _jsx(Item, { name: "separator", location: 'after' }), _jsx(Item, { name: "switchView", visible: true }), _jsx(Item, { name: "refresh", visible: true })] }), _jsx(ContextMenu, { items: ["create", "upload", "rename", "move", "copy", "delete", "refresh", "download"] }), _jsx(Permissions, { copy: focusedFileSystemItem && focusedFileSystemItem.name !== "" &&
|
|
748
|
+
onCurrentDirectoryChanged: onCurrentDirectoryChanged, selectionMode: props.selectionMode === 'single' ? 'single' : selectionMode, children: [_jsxs(Toolbar, { children: [_jsx(Item, { name: "showNavPane", visible: true }), _jsx(Item, { name: "create", visible: true }), _jsx(Item, { name: "upload", visible: true }), _jsx(Item, { name: "separator", location: 'after' }), _jsx(Item, { name: "switchView", visible: true }), _jsx(Item, { name: "refresh", visible: true })] }), _jsx(ContextMenu, { items: ["create", "upload", "rename", "move", "copy", "delete", "refresh", "download"] }), _jsx(Permissions, { copy: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, move: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, create: focusedFileSystemItem && focusedFileSystemItem.name !== "", upload: focusedFileSystemItem && focusedFileSystemItem.name !== "", rename: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, delete: focusedFileSystemItem && focusedFileSystemItem.name !== "" && getSubFolder(focusedFileSystemItem.path).length > 0, download: true }), _jsx(ItemView, { children: _jsxs(Details, { children: [_jsx(Column, { dataField: "thumbnail", cssClass: 'file-thumbnail' }, "thumbnail"), _jsx(Column, { dataField: "name", caption: SDKUI_Localizator.Name }, "name"), _jsx(Column, { dataField: 'size', width: '120px', alignment: 'center', dataType: 'number', caption: SDKUI_Localizator.File_Size }, "size"), _jsx(Column, { dataField: 'dateModified', width: '160px', alignment: 'center', dataType: 'datetime', caption: SDKUI_Localizator.Date_Modified }, "dateModified")] }) }), _jsx(Notifications, { showPopup: true, showPanel: true })] }), _jsx("div", { style: { width: "100%", height: "30px", overflowY: "hidden" }, children: _jsx(TMCounterContainer, { items: counterValues }) })] }) }));
|
|
732
749
|
};
|
|
733
750
|
export default TMAreaManager;
|
|
@@ -59,7 +59,7 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
59
59
|
const lockMode = checkoutDate && checkoutUsedId && userID && userID !== checkoutUsedId;
|
|
60
60
|
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())] })] })] })] });
|
|
61
61
|
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)] });
|
|
62
|
-
}, [searchText]);
|
|
62
|
+
}, [searchText, findCheckOutUserName]);
|
|
63
63
|
const cellExtRender = useCallback((cellData) => {
|
|
64
64
|
const item = cellData.data;
|
|
65
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.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)] })] }));
|
|
@@ -85,7 +85,7 @@ const TMFileManagerDataGridView = (props) => {
|
|
|
85
85
|
{ dataField: "lastUpdateTime", caption: SDKUI_Localizator.LastUpdateTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
|
86
86
|
{ dataField: "creationTime", caption: SDKUI_Localizator.CreationTime, dataType: 'datetime', format: 'dd/MM/yyyy HH:mm', cellRender: cellDatetimeRender },
|
|
87
87
|
];
|
|
88
|
-
}, [searchText]);
|
|
88
|
+
}, [searchText, cellNameRender]);
|
|
89
89
|
return _jsx(TMDataGrid, { dataSource: items ?? [], dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, onFocusedRowChanged: onFocusedRowChanged, onSelectionChanged: onSelectionChanged, onCellDblClick: onCellDblClick, customContextMenuItems: fileContextMenuItems, showSearchPanel: false, noDataText: SDKUI_Localizator.FolderIsEmpty }, items.length);
|
|
90
90
|
};
|
|
91
91
|
export default TMFileManagerDataGridView;
|
|
@@ -26,6 +26,7 @@ const StyledPanelContainer = styled.div `
|
|
|
26
26
|
height: ${({ $isMaximized }) => $isMaximized ? `calc(100vh - 50px - (${Gutters.getGutters()}px * 2))` : '100%'};
|
|
27
27
|
z-index: ${({ $isMaximized }) => $isMaximized ? 2000 : 'auto'};
|
|
28
28
|
margin: ${({ $isMaximized }) => $isMaximized ? `${Gutters.getGutters()}px` : '0'};
|
|
29
|
+
outline: none;
|
|
29
30
|
/* transition: all 0.2s; */
|
|
30
31
|
`;
|
|
31
32
|
const StyledPanelHeader = styled.div `
|
|
@@ -1,17 +1,40 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo, useRef, useState } from 'react';
|
|
2
|
+
import React, { useMemo, useRef, useState } from 'react';
|
|
3
3
|
import { SDK_Localizator, DataListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { StyledDivHorizontal } from '../base/Styled';
|
|
5
5
|
import { IconSearch, SDKUI_Localizator, TMImageLibrary } from '../../helper';
|
|
6
|
+
import { TMColors } from '../../utils/theme';
|
|
6
7
|
import TMSpinner from '../base/TMSpinner';
|
|
8
|
+
import TMTooltip from '../base/TMTooltip';
|
|
7
9
|
import TMSummary from '../editors/TMSummary';
|
|
8
10
|
import TMChooserForm from '../forms/TMChooserForm';
|
|
9
11
|
import TMDataListItemViewer from '../viewers/TMDataListItemViewer';
|
|
10
12
|
const TMDataListItemChooser = ({ labelColor, width = '100%', dataListId, icon, backgroundColor, showBorder = true, readOnly, openChooserBySingleClick, buttons = [], elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, titleForm, showClearButton = false, validationItems = [], onValueChanged, updateIsModalOpen }) => {
|
|
11
13
|
const [showChooser, setShowChooser] = useState(false);
|
|
12
14
|
const renderTemplate = () => {
|
|
15
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
16
|
+
const MAX_TOOLTIP_ITEMS = 50;
|
|
13
17
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
14
|
-
|
|
18
|
+
const remainingCount = (values?.length ?? 0) - MAX_VISIBLE_ITEMS;
|
|
19
|
+
const totalCount = values?.length ?? 0;
|
|
20
|
+
const allValuesTooltip = values && values.length > MAX_TOOLTIP_ITEMS
|
|
21
|
+
? values.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${values.length - MAX_TOOLTIP_ITEMS})`
|
|
22
|
+
: values?.join(', ') ?? '';
|
|
23
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', justifyContent: 'flex-start', color: isPlaceholder ? '#a9a9a9' : 'inherit', alignItems: 'center' }, children: [values && values.length > 0 && _jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: '8px' }, children: [totalCount > MAX_VISIBLE_ITEMS && _jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: allValuesTooltip }), children: _jsx(StyledDivHorizontal, { style: { alignItems: 'center', gap: '4px' }, children: _jsx("span", { style: {
|
|
24
|
+
backgroundColor: TMColors.primary + '15',
|
|
25
|
+
color: TMColors.primary,
|
|
26
|
+
borderRadius: '4px',
|
|
27
|
+
padding: '2px 6px',
|
|
28
|
+
fontSize: '11px',
|
|
29
|
+
fontWeight: 600,
|
|
30
|
+
letterSpacing: '0.3px'
|
|
31
|
+
}, children: totalCount }) }) }), values.slice(0, MAX_VISIBLE_ITEMS).map((v, index) => (_jsx(React.Fragment, { children: _jsxs("span", { style: { display: 'inline-flex', alignItems: 'center' }, children: [_jsx(TMDataListItemViewer, { dataListId: dataListId, value: v, width: 'auto', showTooltip: false }), index < Math.min(values.length, MAX_VISIBLE_ITEMS) - 1 && _jsx("span", { style: { marginLeft: 0 }, children: "," })] }) }, index)))] }), values && values.length > MAX_VISIBLE_ITEMS &&
|
|
32
|
+
_jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: (() => {
|
|
33
|
+
const remainingValues = values.slice(MAX_VISIBLE_ITEMS);
|
|
34
|
+
return remainingValues.length > MAX_TOOLTIP_ITEMS
|
|
35
|
+
? remainingValues.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${remainingValues.length - MAX_TOOLTIP_ITEMS})`
|
|
36
|
+
: remainingValues.join(', ');
|
|
37
|
+
})() }), children: _jsx("p", { style: { marginLeft: '10px' }, children: `(+${remainingCount} ${remainingCount === 1 ? 'altro' : 'altri'})` }) })] }));
|
|
15
38
|
};
|
|
16
39
|
const summaryInputRef = useRef(null);
|
|
17
40
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { ref: summaryInputRef, placeHolder: placeHolder, labelColor: labelColor, width: width, icon: icon, buttons: buttons, readOnly: readOnly, backgroundColor: backgroundColor, showBorder: showBorder, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
@@ -39,4 +39,4 @@ interface ITMDynDataListItemChooserFormProps extends ITMChooserFormProps<DataLis
|
|
|
39
39
|
dynDL?: DynamicDataListDescriptor;
|
|
40
40
|
searchResult?: SearchResultDescriptor;
|
|
41
41
|
}
|
|
42
|
-
export declare const TMDynDataListItemChooserForm:
|
|
42
|
+
export declare const TMDynDataListItemChooserForm: (props: ITMDynDataListItemChooserFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -53,17 +53,20 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
53
53
|
return await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, md?.id, layoutMode, queryParamsDynDataList ?? [])
|
|
54
54
|
.catch((err) => { throw err; });
|
|
55
55
|
};
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
58
|
-
return "";
|
|
59
|
-
if (!values || values.length <= 0)
|
|
60
|
-
return "";
|
|
61
|
-
if (!values[0])
|
|
56
|
+
const getValueDescription = (value) => {
|
|
57
|
+
if (!value)
|
|
62
58
|
return "";
|
|
63
59
|
if (!dynDl)
|
|
64
|
-
return
|
|
65
|
-
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0] ==
|
|
66
|
-
return description ??
|
|
60
|
+
return value;
|
|
61
|
+
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0] == value)?.[0]?.[dynDl.selectItemForDescription ?? 0];
|
|
62
|
+
return description ?? value;
|
|
63
|
+
};
|
|
64
|
+
const getDescriptions = (maxItems = 3) => {
|
|
65
|
+
if (!Array.isArray(values))
|
|
66
|
+
return [];
|
|
67
|
+
if (!values || values.length <= 0)
|
|
68
|
+
return [];
|
|
69
|
+
return values.slice(0, maxItems).map(v => getValueDescription(v)).filter(d => d !== "");
|
|
67
70
|
};
|
|
68
71
|
const getIcon = () => {
|
|
69
72
|
if (!Array.isArray(values))
|
|
@@ -75,14 +78,37 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
75
78
|
if (FormulaHelper.isFormula(values?.[0]))
|
|
76
79
|
return null;
|
|
77
80
|
if (!dynDl)
|
|
78
|
-
return
|
|
79
|
-
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0]
|
|
80
|
-
return description ?
|
|
81
|
+
return null;
|
|
82
|
+
let description = dataSource?.dtdResult?.rows?.filter(o => o[dynDl.selectItemForValue ?? 0]?.toString().toLowerCase() === values?.[0]?.toString().toLowerCase())?.[0]?.[dynDl.selectItemForDescription ?? 0];
|
|
83
|
+
return description ? null :
|
|
81
84
|
_jsx(TMTooltip, { content: SDKUI_Localizator.ValueNotPresent, children: _jsx(IconWarning, { color: TMColors.warning }) });
|
|
82
85
|
};
|
|
83
86
|
const renderTemplate = () => {
|
|
87
|
+
const MAX_VISIBLE_ITEMS = 3;
|
|
88
|
+
const MAX_TOOLTIP_ITEMS = 50;
|
|
84
89
|
const isPlaceholder = values?.[0] === placeHolder;
|
|
85
|
-
|
|
90
|
+
const descriptions = getDescriptions(MAX_VISIBLE_ITEMS);
|
|
91
|
+
const remainingCount = (values?.length ?? 0) - MAX_VISIBLE_ITEMS;
|
|
92
|
+
const totalCount = values?.length ?? 0;
|
|
93
|
+
const allDescriptionsArray = values?.map(v => getValueDescription(v)).filter(d => d !== "") ?? [];
|
|
94
|
+
const allDescriptions = allDescriptionsArray.length > MAX_TOOLTIP_ITEMS
|
|
95
|
+
? allDescriptionsArray.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${allDescriptionsArray.length - MAX_TOOLTIP_ITEMS})`
|
|
96
|
+
: allDescriptionsArray.join(', ');
|
|
97
|
+
return (_jsxs(StyledDivHorizontal, { style: { width: '100%', color: isPlaceholder ? '#a9a9a9' : 'inherit', alignItems: 'center' }, children: [dataSource && descriptions.length > 0 && _jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: '8px' }, children: [totalCount > MAX_VISIBLE_ITEMS && _jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: allDescriptions }), children: _jsx(StyledDivHorizontal, { style: { alignItems: 'center', gap: '4px' }, children: _jsx("span", { style: {
|
|
98
|
+
backgroundColor: TMColors.primary + '15',
|
|
99
|
+
color: TMColors.primary,
|
|
100
|
+
borderRadius: '4px',
|
|
101
|
+
padding: '2px 6px',
|
|
102
|
+
fontSize: '11px',
|
|
103
|
+
fontWeight: 600,
|
|
104
|
+
letterSpacing: '0.3px'
|
|
105
|
+
}, children: totalCount }) }) }), getIcon(), _jsx("p", { children: descriptions.join(', ') })] }), values && values.length > MAX_VISIBLE_ITEMS &&
|
|
106
|
+
_jsx(TMTooltip, { content: _jsx("div", { style: { maxWidth: '300px', wordWrap: 'break-word', whiteSpace: 'pre-wrap' }, children: (() => {
|
|
107
|
+
const remainingArray = values.slice(MAX_VISIBLE_ITEMS).map(v => getValueDescription(v));
|
|
108
|
+
return remainingArray.length > MAX_TOOLTIP_ITEMS
|
|
109
|
+
? remainingArray.slice(0, MAX_TOOLTIP_ITEMS).join(', ') + ` ... (+${remainingArray.length - MAX_TOOLTIP_ITEMS})`
|
|
110
|
+
: remainingArray.join(', ');
|
|
111
|
+
})() }), children: _jsx("p", { style: { marginLeft: '10px' }, children: `(+${remainingCount} ${remainingCount === 1 ? 'altro' : 'altri'})` }) })] }));
|
|
86
112
|
};
|
|
87
113
|
return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { placeHolder: placeHolder, width: width, icon: icon, labelColor: labelColor, backgroundColor: backgroundColor, buttons: buttons, showBorder: showBorder, readOnly: readOnly, hasValue: values && values.length > 0, showClearButton: showClearButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), onEditorClick: () => {
|
|
88
114
|
if (!readOnly) {
|
|
@@ -135,9 +161,10 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
|
|
|
135
161
|
export default TMDynDataListItemChooser;
|
|
136
162
|
const cellRenderIcon = () => _jsx(IconDetails, {});
|
|
137
163
|
export const TMDynDataListItemChooserForm = (props) => {
|
|
164
|
+
const { TID, MID, layoutMode, dynDL, searchResult, selectedIDs, title, width, height, onChoose } = props;
|
|
138
165
|
// Generate unique keys for all columns
|
|
139
|
-
const uniqueKeys = generateUniqueColumnKeys(
|
|
140
|
-
const dataColumns =
|
|
166
|
+
const uniqueKeys = generateUniqueColumnKeys(searchResult?.dtdResult?.columns, searchResult?.fromTID);
|
|
167
|
+
const dataColumns = searchResult?.dtdResult?.columns?.map((col, index) => {
|
|
141
168
|
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
|
142
169
|
const dataType = () => {
|
|
143
170
|
switch (col.dataType) {
|
|
@@ -149,23 +176,23 @@ export const TMDynDataListItemChooserForm = (props) => {
|
|
|
149
176
|
};
|
|
150
177
|
return { dataField: uniqueKeys[index], caption: col.caption, visible: isVisible, dataType: dataType(), format: col.dataType === DataColumnTypes.DateTime ? Globalization.getDateDisplayFormat() : "" };
|
|
151
178
|
});
|
|
152
|
-
const keyValue = uniqueKeys[
|
|
179
|
+
const keyValue = uniqueKeys[dynDL?.selectItemForValue ?? 0] ?? '';
|
|
153
180
|
const getItems = async (refreshCache) => {
|
|
154
|
-
if (!
|
|
181
|
+
if (!searchResult)
|
|
155
182
|
return [];
|
|
156
183
|
if (refreshCache)
|
|
157
184
|
DataListCacheService.RemoveAll();
|
|
158
185
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DataList} ...` });
|
|
159
|
-
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(
|
|
186
|
+
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(TID, MID, layoutMode, [])
|
|
160
187
|
.catch((err) => { TMSpinner.hide(); TMExceptionBoxManager.show({ exception: err }); });
|
|
161
188
|
TMSpinner.hide();
|
|
162
189
|
return result ? searchResultDescriptorToSimpleArray(result) ?? [] : [];
|
|
163
190
|
};
|
|
164
191
|
const getTitle = () => {
|
|
165
|
-
let
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
return
|
|
192
|
+
let titleDataList = SDK_Localizator.DataList;
|
|
193
|
+
if (title)
|
|
194
|
+
titleDataList += `: ${title}`;
|
|
195
|
+
return titleDataList;
|
|
169
196
|
};
|
|
170
|
-
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: props.allowMultipleSelection, width:
|
|
197
|
+
return (_jsx(TMChooserForm, { title: getTitle(), allowMultipleSelection: props.allowMultipleSelection, width: width, height: height, keyName: keyValue ?? '', showDefaultColumns: false, hasShowId: false, columns: dataColumns, selectedIDs: selectedIDs, cellRenderIcon: cellRenderIcon, dataSource: searchResultDescriptorToSimpleArray(searchResult) ?? [], getItems: getItems, onClose: props.onClose, onChoose: (IDs) => onChoose?.(IDs) }));
|
|
171
198
|
};
|
|
@@ -37,7 +37,9 @@ export const TMUserChooserForm = ({ allowMultipleSelection, columns, hideRefresh
|
|
|
37
37
|
const dataColumns = useMemo(() => {
|
|
38
38
|
return [
|
|
39
39
|
{ dataField: 'domain', caption: SDKUI_Localizator.Domain, dataType: 'string' },
|
|
40
|
-
{ dataField: 'name', caption: SDKUI_Localizator.UserName, dataType: 'string' }
|
|
40
|
+
{ dataField: 'name', caption: SDKUI_Localizator.UserName, dataType: 'string' },
|
|
41
|
+
{ dataField: 'fn', caption: SDKUI_Localizator.User_FirstName, dataType: 'string' },
|
|
42
|
+
{ dataField: 'ln', caption: SDKUI_Localizator.User_LastName, dataType: 'string' }
|
|
41
43
|
];
|
|
42
44
|
}, []);
|
|
43
45
|
const getItems = async (refreshCache) => {
|
|
@@ -132,12 +132,24 @@ const TMFormulaEditor = (props) => {
|
|
|
132
132
|
const renderTreeViewItem = useCallback((item) => {
|
|
133
133
|
return (_jsxs(StyledDivHorizontal, { style: { display: 'flex', gap: '5px', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: [renderFormulaIcon(item.icon, item.tid, item.md), _jsx("p", { style: { verticalAlign: 'middle', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: item.text })] }));
|
|
134
134
|
}, []);
|
|
135
|
+
const translateDescInFormula = (text) => {
|
|
136
|
+
switch (text) {
|
|
137
|
+
case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithoutLogin})`:
|
|
138
|
+
return `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`;
|
|
139
|
+
case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithLogin})`:
|
|
140
|
+
return `[dbo].[TM_GetViewLink](NULL, 'ASKLOGIN', NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`;
|
|
141
|
+
case `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithDate})`:
|
|
142
|
+
return `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, CONVERT(VARCHAR, {@CreationTime}+30, 126), 0)`;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
return text;
|
|
146
|
+
};
|
|
135
147
|
const handleTreeViewItemClick = (e) => {
|
|
136
148
|
if (!e)
|
|
137
149
|
return;
|
|
138
150
|
if (e.itemData?.hasItems)
|
|
139
151
|
return;
|
|
140
|
-
insertText(e.itemData?.text);
|
|
152
|
+
insertText(translateDescInFormula(e.itemData?.text));
|
|
141
153
|
};
|
|
142
154
|
return (_jsx(TMApplyForm, { isModal: props.isModal, formMode: props.formMode, isModified: formData.expression !== formDataOrig.expression, exception: exception, validationItems: validationItems, title: SDKUI_Localizator.Formula, hasNavigation: false, showBack: props.showBack, height: '600px', width: '800px', onApply: () => applyData(), onClose: props.onClose, onUndo: () => {
|
|
143
155
|
setFormData(formDataOrig);
|
|
@@ -705,13 +717,13 @@ export class FormulaHelper {
|
|
|
705
717
|
static jsonItems_LoadFunctions_Link() {
|
|
706
718
|
let items = [{
|
|
707
719
|
id: '3_4_1',
|
|
708
|
-
text: `TM_GetViewLink (${SDKUI_Localizator.
|
|
720
|
+
text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithoutLogin})`,
|
|
709
721
|
icon: FormulaIconTypes.Function,
|
|
710
722
|
expanded: false,
|
|
711
723
|
hasItems: false,
|
|
712
724
|
}, {
|
|
713
725
|
id: '3_4_2',
|
|
714
|
-
text: `TM_GetViewLink (${SDKUI_Localizator.
|
|
726
|
+
text: `TM_GetViewLink (${SDKUI_Localizator.FormulaEditor_Function_TM_GetViewLink_WithLogin})`,
|
|
715
727
|
icon: FormulaIconTypes.Function,
|
|
716
728
|
expanded: false,
|
|
717
729
|
hasItems: false,
|
|
@@ -79,11 +79,12 @@ const TMMetadataEditor = ({ isSelected = false, customLabel, isReadOnly, isLexPr
|
|
|
79
79
|
if (value?.startsWith("{@QueryParam") || value == "{@UserName}" || value == "{@UserID}" || queryOperator == QueryOperators.Custom || isEditable)
|
|
80
80
|
return _jsx(TMTextBox, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', isModifiedWhen: isModifiedWhenInternal(), readOnly: isReadOnlyResult, label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, type: 'text', maxLength: isEditable ? undefined : maxLength, autoFocus: autoFocus, value: value ?? '', onValueChanged: (e) => onValueChange?.(e.target.value), onBlur: (newValue) => onValueChanged?.(newValue) });
|
|
81
81
|
if (md?.dataDomain == MetadataDataDomains.DynamicDataList)
|
|
82
|
-
return _jsx(TMDynDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, layoutMode: layoutMode, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, openChooserBySingleClick: openChooserBySingleClick, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, onCascadeUpdateMIDs: onCascadeUpdateMIDs, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ?
|
|
83
|
-
|
|
82
|
+
return _jsx(TMDynDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, layoutMode: layoutMode, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, md: md, tid: tid, openChooserBySingleClick: openChooserBySingleClick, queryParamsDynDataList: queryParamsDynDataList, onCascadeRefreshDynDataLists: onCascadeRefreshDynDataLists, onCascadeUpdateMIDs: onCascadeUpdateMIDs, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, allowMultipleSelection: multipleSelectionIsenabled, values: value ? value.split(',').filter(v => v.trim() !== '') : [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
83
|
+
const filteredIDs = IDs?.filter(id => id.trim() !== '');
|
|
84
|
+
if (!filteredIDs || filteredIDs.length <= 0)
|
|
84
85
|
onValueChanged?.(undefined);
|
|
85
86
|
else
|
|
86
|
-
onValueChanged?.(
|
|
87
|
+
onValueChanged?.(filteredIDs.join(","));
|
|
87
88
|
}, updateIsModalOpen: updateIsModalOpen });
|
|
88
89
|
if (md?.dataDomain == MetadataDataDomains.DataList)
|
|
89
90
|
return _jsx(TMDataListItemChooser, { placeHolder: layoutMode === LayoutModes.Ark ? md?.defaultValue ?? '' : '', titleForm: md.nameLoc, readOnly: isReadOnlyResult, isModifiedWhen: isModifiedWhenInternal(), label: (modulesWithLabelTop || showLabelTop) ? (customLabel ?? md?.nameLoc) : undefined, icon: showLabelTop ? icon : undefined, validationItems: validationItems, disabled: disabled, elementStyle: { width: '100%' }, backgroundColor: TMColors.default_background, dataListId: md.dataListID, openChooserBySingleClick: openChooserBySingleClick, allowMultipleSelection: multipleSelectionIsenabled, values: value?.split(',').map((item) => !item.startsWith("'") ? item : item.slice(1, -1)) ?? [], showClearButton: !isReadOnlyResult, onValueChanged: (IDs) => {
|
|
@@ -769,5 +769,5 @@ const TMLayoutTabPanel = React.memo(({ tabItems }) => {
|
|
|
769
769
|
fontSize: '0.85em',
|
|
770
770
|
color: '#7f1d1d',
|
|
771
771
|
lineHeight: 1.4
|
|
772
|
-
}, children: error.message })] }, idx))) })] }), children: _jsx(StyledErrorBadge, { children: tabItem.errorCount > 99 ? '99+' : tabItem.errorCount }) }))] })), children: _jsx("div", { style: { width: '100%' }, children: tabItem.content }) }, `tab-${tabItem.layoutItemID}`))) }));
|
|
772
|
+
}, children: error.message })] }, idx))) })] }), children: _jsx(StyledErrorBadge, { children: tabItem.errorCount > 99 ? '99+' : tabItem.errorCount }) }))] })), children: _jsx("div", { style: { width: '100%', overflowX: 'auto' }, children: _jsx("div", { style: { minWidth: 'max-content' }, children: tabItem.content }) }) }, `tab-${tabItem.layoutItemID}`))) }));
|
|
773
773
|
});
|
|
@@ -77,7 +77,7 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
77
77
|
if (onDcmtTypeSelect)
|
|
78
78
|
onDcmtTypeSelect(tidToUse);
|
|
79
79
|
passToSearch(tidToUse, outputMids);
|
|
80
|
-
} : undefined, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, currentTID, currentTID === inputTID ? inputDID : undefined), openFileUploaderPdfEditor: openFileUploaderPdfEditor, onScanRequest: onScanRequest }, currentTID)
|
|
80
|
+
} : undefined, showBackButton: false, isSharedDcmt: isSharedArchive, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, currentTID, currentTID === inputTID ? inputDID : undefined), openFileUploaderPdfEditor: openFileUploaderPdfEditor, onScanRequest: onScanRequest }, currentTID)
|
|
81
81
|
:
|
|
82
82
|
_jsx(TMPanel, { title: 'Archiviazione', allowMaximize: false, children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsx(StyledToppyTextContainer, { children: _jsx(StyledToppyText, { children: SDKUI_Localizator.DcmtTypeSelect }) }), _jsx(StyledToppyImage, { src: Logo, alt: 'Toppy' })] }) }), [currentTID, deviceType, mruTIDs, inputFile, currentInputMids, enableDragDropOverlay, isSharedArchive, allTasks]);
|
|
83
83
|
const allInitialPanelVisibility = {
|
|
@@ -6,6 +6,7 @@ interface ITMDcmtBlogProps {
|
|
|
6
6
|
isVisible?: boolean;
|
|
7
7
|
fetchBlogDataTrigger?: number;
|
|
8
8
|
onRefreshBlogDatagrid?: () => Promise<void>;
|
|
9
|
+
showFloatingCommentButton?: boolean;
|
|
9
10
|
allTasks?: Array<TaskDescriptor>;
|
|
10
11
|
getAllTasks?: () => Promise<void>;
|
|
11
12
|
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
@@ -8,7 +8,7 @@ import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
|
8
8
|
import TMBlogsPost from '../../grids/TMBlogsPost';
|
|
9
9
|
import TMSpinner from '../../base/TMSpinner';
|
|
10
10
|
import { TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
11
|
-
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
11
|
+
const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDatagrid, showFloatingCommentButton = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers }) => {
|
|
12
12
|
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
13
13
|
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
14
14
|
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
@@ -74,7 +74,7 @@ const TMDcmtBlog = ({ tid, did, isVisible, fetchBlogDataTrigger, onRefreshBlogDa
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
return (_jsxs("div", { style: { width: '100%', height: '100%' }, children: [_jsx(StyledContainer, { children: _jsx(StyledSectionContainer, { style: { position: 'relative' }, children: _jsx(StyledBoardContainer, { children: !did ? _jsx(TMNothingToShow, { text: `${SDKUI_Localizator.NoDcmtSelected}.`, secondText: `${SDKUI_Localizator.BlogCase} - ${SDKUI_Localizator.NotAvailable}`, icon: _jsx(IconBoard, { fontSize: 96 }) }) :
|
|
77
|
-
_jsx(TMBlogsPost, { context: { engine: 'SearchEngine', object: { tid, did } }, id: "dcmt-blog", displayMode: 'chat', scrollToSelected: true, posts: blogsDatasource, showExtendedAttachments: false, showFloatingCommentButton:
|
|
77
|
+
_jsx(TMBlogsPost, { context: { engine: 'SearchEngine', object: { tid, did } }, id: "dcmt-blog", displayMode: 'chat', scrollToSelected: true, posts: blogsDatasource, showExtendedAttachments: false, showFloatingCommentButton: showFloatingCommentButton, showCommentFormCallback: showCommentFormCallback, refreshCallback: refreshCallback, contextMenuParams: {
|
|
78
78
|
isShowHideFilterEnabled: true,
|
|
79
79
|
isShowHideIDEnaled: true,
|
|
80
80
|
isCommentEnabled: true,
|
|
@@ -1018,8 +1018,8 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1018
1018
|
}
|
|
1019
1019
|
}, [TID, DID, triggerBlogRefresh, onRefreshBlogDatagrid]);
|
|
1020
1020
|
const checkoutBadge = useMemo(() => {
|
|
1021
|
-
const {
|
|
1022
|
-
if (!
|
|
1021
|
+
const { checkoutStatus } = getDcmtCicoStatus(formData, allUsers, fromDTD);
|
|
1022
|
+
if (!checkoutStatus.isCheckedOut)
|
|
1023
1023
|
return null;
|
|
1024
1024
|
return (_jsx(Ribbon, { "$isMobile": isMobile, children: _jsx(TMTooltip, { content: checkoutStatus.editLockTooltipText, position: "right", children: _jsx("span", { children: checkoutStatus.mode === 'editMode' ? SDKUI_Localizator.CheckOut : 'Locked' }) }) }));
|
|
1025
1025
|
}, [formData, fromDTD, isMobile]);
|
|
@@ -1238,7 +1238,7 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1238
1238
|
},
|
|
1239
1239
|
{
|
|
1240
1240
|
id: 'tmDcmtPreview',
|
|
1241
|
-
name: SDKUI_Localizator.PreviewDocument,
|
|
1241
|
+
name: layoutMode === LayoutModes.Update ? SDKUI_Localizator.PreviewDocument : SDKUI_Localizator.UploadFile,
|
|
1242
1242
|
contentOptions: { component: tmDcmtPreview },
|
|
1243
1243
|
toolbarOptions: {
|
|
1244
1244
|
icon: _jsx(IconShow, { fontSize: 24 }),
|
|
@@ -1421,8 +1421,8 @@ const TMDcmtForm = ({ TID, DID, groupId, layoutMode = LayoutModes.Update, formMo
|
|
|
1421
1421
|
position: 'relative',
|
|
1422
1422
|
overflow: 'hidden'
|
|
1423
1423
|
}, children: [_jsxs("div", { style: { width: '100%', height: '100%', display: isOpenDetails || isOpenMaster ? 'none' : 'flex' }, children: [isNavigating && _jsx(Spinner, { description: SDKUI_Localizator.Loading, flat: false }), (fromDTD) && _jsx(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: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showCicoWaitPanel, showWaitPanelPrimary: showCicoPrimaryProgress, waitPanelTitle: cicoWaitPanelTitle, waitPanelTextPrimary: cicoPrimaryProgressText, waitPanelValuePrimary: cicoPrimaryProgressValue, waitPanelMaxValuePrimary: cicoPrimaryProgressMax, isCancelable: true, abortController: abortControllerLocal, children: [(groupId && groupId.length > 0)
|
|
1424
|
-
? _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })
|
|
1425
|
-
: _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(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1424
|
+
? _jsxs(_Fragment, { children: [_jsx(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] })
|
|
1425
|
+
: _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(PanelDisabledStateHandler, { isWFDisabled: isWFDisabled, isSysMetadataDisabled: isSysMetadataDisabled, isBoardDisabled: isBoardDisabled, isDcmtTasksDisabled: isDcmtTasksDisabled, isPreviewDisabled: isPreviewDisabled }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })] }), isOpenDistinctValues &&
|
|
1426
1426
|
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onClosePanelCallback: () => setIsOpenDistinctValues(false), onSelectionChanged: (e) => {
|
|
1427
1427
|
if (!e)
|
|
1428
1428
|
return;
|
|
@@ -1512,7 +1512,7 @@ const validateMaxLength = (mvd, value, validationItems) => {
|
|
|
1512
1512
|
};
|
|
1513
1513
|
//#endregion Validation
|
|
1514
1514
|
// Synchronizes panel visibility and toolbar button disabled states when panels become disabled
|
|
1515
|
-
const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoardDisabled, isDcmtTasksDisabled }) => {
|
|
1515
|
+
const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoardDisabled, isDcmtTasksDisabled, isPreviewDisabled }) => {
|
|
1516
1516
|
const { setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility } = useTMPanelManagerContext();
|
|
1517
1517
|
useEffect(() => {
|
|
1518
1518
|
// Aggiorna lo stato disabled del bottone toolbar
|
|
@@ -1520,6 +1520,7 @@ const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoar
|
|
|
1520
1520
|
setToolbarButtonDisabled('tmBlog', isBoardDisabled);
|
|
1521
1521
|
setToolbarButtonDisabled('tmWF', isWFDisabled);
|
|
1522
1522
|
setToolbarButtonDisabled('tmDcmtTasks', isDcmtTasksDisabled);
|
|
1523
|
+
setToolbarButtonDisabled('tmDcmtPreview', isPreviewDisabled);
|
|
1523
1524
|
// Chiude il pannello solo se è attualmente visibile e deve essere disabilitato
|
|
1524
1525
|
if (isSysMetadataDisabled && panelVisibility['tmSysMetadata']) {
|
|
1525
1526
|
setPanelVisibilityById('tmSysMetadata', false);
|
|
@@ -1533,7 +1534,10 @@ const PanelDisabledStateHandler = ({ isWFDisabled, isSysMetadataDisabled, isBoar
|
|
|
1533
1534
|
if (isDcmtTasksDisabled && panelVisibility['tmDcmtTasks']) {
|
|
1534
1535
|
setPanelVisibilityById('tmDcmtTasks', false);
|
|
1535
1536
|
}
|
|
1536
|
-
|
|
1537
|
+
if (isPreviewDisabled && panelVisibility['tmDcmtPreview']) {
|
|
1538
|
+
setPanelVisibilityById('tmDcmtPreview', false);
|
|
1539
|
+
}
|
|
1540
|
+
}, [isSysMetadataDisabled, isBoardDisabled, isWFDisabled, isDcmtTasksDisabled, isPreviewDisabled, setPanelVisibilityById, setToolbarButtonDisabled, panelVisibility]);
|
|
1537
1541
|
return null;
|
|
1538
1542
|
};
|
|
1539
1543
|
const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, layoutMode, dcmtFile, deviceType, isVisible, onFileUpload, openFileUploaderPdfEditor, enableDragDropOverlay = false, onScanRequest }) => {
|
|
@@ -8,7 +8,10 @@ const TMDragDropOverlay = (props) => {
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
const handleWindowDragEnter = (e) => {
|
|
10
10
|
e.preventDefault();
|
|
11
|
-
|
|
11
|
+
// Attiva solo se si trascina un file
|
|
12
|
+
if (e.dataTransfer?.types.includes('Files')) {
|
|
13
|
+
setDragOver(true);
|
|
14
|
+
}
|
|
12
15
|
};
|
|
13
16
|
const handleWindowDragOver = (e) => {
|
|
14
17
|
e.preventDefault();
|
|
@@ -60,7 +63,9 @@ const TMDragDropOverlay = (props) => {
|
|
|
60
63
|
boxShadow: '0 8px 20px rgba(0,0,0,0.3)',
|
|
61
64
|
backdropFilter: 'blur(5px)',
|
|
62
65
|
transition: 'opacity 0.2s, transform 0.2s, background 0.2s',
|
|
63
|
-
}, onDragEnter: (e) => { e.preventDefault(); e.stopPropagation();
|
|
66
|
+
}, onDragEnter: (e) => { e.preventDefault(); e.stopPropagation(); if (e.dataTransfer?.types.includes('Files'))
|
|
67
|
+
setDragOver(true); }, onDragOver: (e) => { e.preventDefault(); e.stopPropagation(); if (e.dataTransfer?.types.includes('Files'))
|
|
68
|
+
setDragOver(true); }, onDragLeave: (e) => {
|
|
64
69
|
e.preventDefault();
|
|
65
70
|
e.stopPropagation();
|
|
66
71
|
// Solo se il cursore ha lasciato il div principale
|