@topconsultnpm/sdkui-react 6.21.0-dev1.2 → 6.21.0-dev1.21
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/TMAreaManager.js +18 -3
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +8 -3
- package/lib/components/choosers/TMUserChooser.js +3 -1
- package/lib/components/editors/TMFormulaEditor.js +3 -3
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +12 -8
- package/lib/components/features/documents/TMFileUploader.d.ts +1 -1
- package/lib/components/features/documents/TMFileUploader.js +3 -3
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +27 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +215 -20
- package/lib/components/features/documents/TMRelationViewer.d.ts +12 -1
- package/lib/components/features/documents/TMRelationViewer.js +49 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.d.ts +1 -0
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchResult.d.ts +1 -0
- package/lib/components/features/search/TMSearchResult.js +18 -4
- 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/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryEditor.js +20 -1
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/checkinCheckoutManager.d.ts +1 -1
- package/lib/helper/checkinCheckoutManager.js +18 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +75 -4
- package/lib/hooks/useDocumentOperations.d.ts +1 -0
- package/lib/hooks/useDocumentOperations.js +46 -12
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +34 -0
- package/package.json +55 -55
|
@@ -390,7 +390,9 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
390
390
|
const deleteItem = async (item) => {
|
|
391
391
|
const ad = item.dataItem.dataItem;
|
|
392
392
|
const aid = ad.id;
|
|
393
|
-
const
|
|
393
|
+
const subFolderOld = item.parentPath === ad.name ? '' : item.parentPath.replace(ad.name + '/', '');
|
|
394
|
+
const subFolder = getSubFolder(item.parentPath, ad.name);
|
|
395
|
+
console.log("Delete item with subfolder: ", subFolder, " old subfolder: ", subFolderOld);
|
|
394
396
|
const tms = props.tmSession ?? SDK_Globals.tmSession;
|
|
395
397
|
if (item.isDirectory) {
|
|
396
398
|
await tms?.NewAreaEngine().DeleteFoldersAsync(aid, subFolder, [item.name]).catch((err) => { throw new FileSystemError(5, item, err.message ?? SDKUI_Localizator.GetFolderDeletionErrorMessage); });
|
|
@@ -594,16 +596,29 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
594
596
|
throw new FileSystemError(5, undefined, error.message ?? SDKUI_Localizator.Error);
|
|
595
597
|
}
|
|
596
598
|
};
|
|
599
|
+
const getSubFolder = (dir, startStr) => {
|
|
600
|
+
//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)
|
|
601
|
+
if (startStr && !dir.startsWith(startStr)) {
|
|
602
|
+
return dir;
|
|
603
|
+
}
|
|
604
|
+
//In tutti gli altri casi rimuovo la prima cartella del percorso (che corrisponde al nome dell'area) e la restituisco come subfolder
|
|
605
|
+
const parts = dir.split("/");
|
|
606
|
+
console.log(parts);
|
|
607
|
+
let subFolder = parts.slice(1).join("/");
|
|
608
|
+
console.log(subFolder);
|
|
609
|
+
return subFolder;
|
|
610
|
+
};
|
|
597
611
|
const onCurrentDirectoryChanged = (e) => {
|
|
598
612
|
setCurrentRoute(e.directory.path);
|
|
599
613
|
setFocusedFileSystemItem(e.directory);
|
|
614
|
+
console.log("Current directory changed: ", e.directory);
|
|
600
615
|
if (e.directory.path === '' && e.directory.name === '')
|
|
601
616
|
return;
|
|
602
617
|
let ad = e.directory.dataItem.dataItem;
|
|
603
618
|
if (!ad)
|
|
604
619
|
return;
|
|
605
620
|
let aid = ad.id;
|
|
606
|
-
let subFolder = e.directory.path
|
|
621
|
+
let subFolder = getSubFolder(e.directory.path);
|
|
607
622
|
setAreaFolder(getAreaPath(aid, subFolder));
|
|
608
623
|
e.component.option("fileSystemProvider").getItems(e.directory).then((items) => {
|
|
609
624
|
setParentDirectoryFileSystemItems(items);
|
|
@@ -728,6 +743,6 @@ const TMAreaManager = (props = { selectionMode: 'multiple', isPathChooser: false
|
|
|
728
743
|
onItemCopied={() => setCounter(counter => counter + 1)}
|
|
729
744
|
onItemDeleted={() => setCounter(counter => counter - 1)}
|
|
730
745
|
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 !== "" &&
|
|
746
|
+
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"] }), "const primo = areasRoots.values().next().value;", _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
747
|
};
|
|
733
748
|
export default TMAreaManager;
|
|
@@ -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 `
|
|
@@ -23,11 +23,12 @@ interface ITMTreeViewProps<T extends ITMTreeItem> {
|
|
|
23
23
|
onNodeUpdate?: (updatedNode: T) => void;
|
|
24
24
|
onDataChanged?: (items: T[]) => void;
|
|
25
25
|
shouldDelayFocusOnEvent?: (node: T, event: React.MouseEvent) => boolean;
|
|
26
|
+
onItemContextMenu?: (item: T, e: React.MouseEvent) => void;
|
|
26
27
|
autoSelectChildren?: boolean;
|
|
27
28
|
itemsPerPage?: number;
|
|
28
29
|
showLoadMoreButton?: boolean;
|
|
29
30
|
}
|
|
30
|
-
declare const TMTreeView: <T extends ITMTreeItem>({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, autoSelectChildren, itemsPerPage, showLoadMoreButton }: ITMTreeViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
declare const TMTreeView: <T extends ITMTreeItem>({ dataSource, focusedItem, selectedItems, allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren, itemsPerPage, showLoadMoreButton }: ITMTreeViewProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export default TMTreeView;
|
|
32
33
|
export declare const StyledTreeNode: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
33
34
|
$isSelected?: boolean;
|
|
@@ -3,7 +3,7 @@ import { useCallback, useEffect, useRef } from 'react';
|
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
import { IconArrowLeft, IconArrowRight, IconChevronDown, IconChevronRight, SDKUI_Localizator } from '../../helper';
|
|
5
5
|
import TMButton from './TMButton';
|
|
6
|
-
const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, autoSelectChildren = true, itemsPerPage = 100, showLoadMoreButton = true }) => {
|
|
6
|
+
const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMultipleSelection, onDataChanged, calculateItemsForNode, itemRender, onNodeUpdate, onFocusedItemChanged, onSelectionChanged, shouldDelayFocusOnEvent, onItemContextMenu, autoSelectChildren = true, itemsPerPage = 100, showLoadMoreButton = true }) => {
|
|
7
7
|
useEffect(() => {
|
|
8
8
|
const handleKeyDown = (event) => {
|
|
9
9
|
if (!focusedItem)
|
|
@@ -350,8 +350,13 @@ const TMTreeView = ({ dataSource = [], focusedItem, selectedItems = [], allowMul
|
|
|
350
350
|
if (input) {
|
|
351
351
|
input.indeterminate = isIndeterminate(node);
|
|
352
352
|
}
|
|
353
|
-
} })), _jsx("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, onClick: (e) => { handleNodeClick(node, e); },
|
|
354
|
-
|
|
353
|
+
} })), _jsx("div", { style: { display: 'flex', alignItems: 'center', flex: 1, minWidth: 0 }, onClick: (e) => { handleNodeClick(node, e); }, onContextMenu: (e) => {
|
|
354
|
+
if (onItemContextMenu) {
|
|
355
|
+
e.preventDefault();
|
|
356
|
+
onItemContextMenu(node, e);
|
|
357
|
+
}
|
|
358
|
+
}, children: itemRender(node) })] }), node.expanded && node.items && (_jsxs("div", { style: { paddingLeft: 20, width: '100%' }, children: [renderTree(getVisibleItems(node)), needsPagination(node) && (_jsxs(StyledStickyPaginator, { children: [_jsx(TMButton, { btnStyle: 'icon', onClick: () => handlePageChange(node.key, (node.currentPage ?? 0) - 1), showTooltip: false, caption: "\u25C4", icon: _jsx(IconArrowLeft, { color: 'white' }), disabled: (node.currentPage ?? 0) <= 0 }), _jsx("span", { style: { fontSize: '11px', whiteSpace: 'nowrap', fontWeight: 500, overflow: 'hidden', textOverflow: 'ellipsis', minWidth: 0, color: 'white' }, children: SDKUI_Localizator.PaginationInfo.replaceParams((node.currentPage ?? 0) + 1, getTotalPages(node), node.items?.length ?? 0) }), _jsx(TMButton, { btnStyle: 'icon', onClick: () => handlePageChange(node.key, (node.currentPage ?? 0) + 1), showTooltip: false, caption: "\u25BA", icon: _jsx(IconArrowRight, { color: 'white' }), disabled: (node.currentPage ?? 0) >= getTotalPages(node) - 1 })] }))] }))] }, node.key)));
|
|
359
|
+
}, [handleNodeClick, handleNodeToggle, handleCheckboxChange, focusedItem, selectedItems, allowMultipleSelection, getVisibleItems, needsPagination, handlePageChange, getTotalPages, onItemContextMenu]);
|
|
355
360
|
return (_jsx("div", { style: { height: '100%', width: '100%', overflowY: 'auto', overflowX: 'hidden', padding: '0px 5px 2px 2px' }, children: renderTree(dataSource) }));
|
|
356
361
|
};
|
|
357
362
|
export default TMTreeView;
|
|
@@ -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) => {
|
|
@@ -705,19 +705,19 @@ export class FormulaHelper {
|
|
|
705
705
|
static jsonItems_LoadFunctions_Link() {
|
|
706
706
|
let items = [{
|
|
707
707
|
id: '3_4_1',
|
|
708
|
-
text: `TM_GetViewLink
|
|
708
|
+
text: `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`,
|
|
709
709
|
icon: FormulaIconTypes.Function,
|
|
710
710
|
expanded: false,
|
|
711
711
|
hasItems: false,
|
|
712
712
|
}, {
|
|
713
713
|
id: '3_4_2',
|
|
714
|
-
text: `TM_GetViewLink
|
|
714
|
+
text: `[dbo].[TM_GetViewLink](NULL, 'ASKLOGIN', NULL, 0, {@TID}, {@DID}, 1, NULL, 0)`,
|
|
715
715
|
icon: FormulaIconTypes.Function,
|
|
716
716
|
expanded: false,
|
|
717
717
|
hasItems: false,
|
|
718
718
|
}, {
|
|
719
719
|
id: '3_4_3',
|
|
720
|
-
text: `TM_GetViewLink (
|
|
720
|
+
text: `[dbo].[TM_GetViewLink](NULL, NULL, NULL, 0, {@TID}, {@DID}, 1, CONVERT(VARCHAR, {@CreationTime}+30, 126), 0)`,
|
|
721
721
|
icon: FormulaIconTypes.Function,
|
|
722
722
|
expanded: false,
|
|
723
723
|
hasItems: false,
|
|
@@ -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 = {
|
|
@@ -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 }) => {
|
|
@@ -1541,7 +1545,7 @@ const TMDcmtPreviewWrapper = ({ refreshPreviewTrigger, fromDTD, currentDcmt, lay
|
|
|
1541
1545
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
1542
1546
|
return (layoutMode === LayoutModes.Update ?
|
|
1543
1547
|
_jsx(TMDcmtPreview, { dcmtData: currentDcmt, isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, isResizingActive: isResizingActive }, refreshPreviewTrigger) :
|
|
1544
|
-
_jsx(TMFileUploader, { fromDTD: fromDTD, onFileUpload: onFileUpload,
|
|
1548
|
+
_jsx(TMFileUploader, { fromDTD: fromDTD, onFileUpload: onFileUpload, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onClose: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType, isResizingActive: isResizingActive, enableDragDropOverlay: panelVisibility['tmDcmtPreview'] && enableDragDropOverlay, onScanRequest: onScanRequest }));
|
|
1545
1549
|
};
|
|
1546
1550
|
const Ribbon = styled.div `
|
|
1547
1551
|
font-size: 0.85rem;
|
|
@@ -4,7 +4,7 @@ import { DcmtTypeDescriptor } from '@topconsultnpm/sdk-ts';
|
|
|
4
4
|
interface ITMFileUploader {
|
|
5
5
|
fromDTD?: DcmtTypeDescriptor;
|
|
6
6
|
onFileUpload?: (file: File | null) => void;
|
|
7
|
-
|
|
7
|
+
openFileUploaderPdfEditor?: (fromDTD?: DcmtTypeDescriptor, file?: File | null, handleFile?: (file: File) => void) => void;
|
|
8
8
|
onClose?: () => void;
|
|
9
9
|
onScanRequest?: (onFileScanned: (file: File) => void) => void;
|
|
10
10
|
isRequired?: boolean;
|
|
@@ -23,7 +23,7 @@ const isScannerLicenseConfigured = () => {
|
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onFileUpload,
|
|
26
|
+
const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onFileUpload, openFileUploaderPdfEditor, onScanRequest, isRequired = false, defaultBlob = null, isResizingActive, showTMPanel = true, enableDragDropOverlay = false, showScannerIcon = true }) => {
|
|
27
27
|
const isBetaFeaturesEnabled = useBetaFeatures();
|
|
28
28
|
const [dragOver, setDragOver] = useState(false);
|
|
29
29
|
const [uploadedFile, setUploadedFile] = useState(defaultBlob);
|
|
@@ -101,11 +101,11 @@ const TMFileUploader = ({ fromDTD, deviceType = DeviceType.DESKTOP, onClose, onF
|
|
|
101
101
|
_jsx("div", { style: { backgroundColor: '#f6dbdb', padding: '5px 10px', borderRadius: 8, display: 'flex', alignItems: 'center', justifyContent: 'space-between', color: TMColors.error }, children: _jsxs("div", { children: [" ", 'Anteprima non disponibile.', fileExt && _jsx("b", { children: ` (*.${fileExt})` })] }) })] });
|
|
102
102
|
const innerContent = (_jsxs("div", { style: { width: '100%', height: '100%', padding: '2px', display: 'flex', flexDirection: 'column', gap: 10 }, children: [enableDragDropOverlay && _jsx(TMDragDropOverlay, { handleFile: handleFile, refocusAfterFileInput: refocusAfterFileInput }), content] }));
|
|
103
103
|
const toolbar = useMemo(() => {
|
|
104
|
-
return (_jsxs(_Fragment, { children: [(isPdfEditorAvailable(fromDTD, fileExt) &&
|
|
104
|
+
return (_jsxs(_Fragment, { children: [(isPdfEditorAvailable(fromDTD, fileExt) && openFileUploaderPdfEditor) && (_jsx(TMCommandsContextMenu, { target: "#TMPanel-FileUploader-Commands-Header", menuItems: [
|
|
105
105
|
{
|
|
106
106
|
icon: _jsx(IconEdit, {}),
|
|
107
107
|
text: 'PDF Editor',
|
|
108
|
-
onClick: () =>
|
|
108
|
+
onClick: () => openFileUploaderPdfEditor(fromDTD, uploadedFile, handleFile)
|
|
109
109
|
}
|
|
110
110
|
], showEvent: "click", children: _jsx(IconMenuVertical, { id: "TMPanel-FileUploader-Commands-Header", color: "white", cursor: "pointer" }) })), deviceType !== DeviceType.MOBILE && (_jsx(StyledHeaderIcon, { onClick: onClose, "$color": "white", children: _jsx(TMTooltip, { content: SDKUI_Localizator.Close, children: _jsx(IconCloseOutline, {}) }) }))] }));
|
|
111
111
|
}, [deviceType, fromDTD, onClose]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HomeBlogPost, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
2
|
+
import { HomeBlogPost, SearchResultDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { DcmtInfo, TaskContext, MetadataValueDescriptorEx } from '../../../ts';
|
|
4
4
|
import { DeviceContextProps } from '../../base/TMDeviceProvider';
|
|
5
5
|
interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
6
6
|
allTasks?: Array<TaskDescriptor>;
|
|
@@ -21,6 +21,31 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
|
21
21
|
onBack?: () => void;
|
|
22
22
|
appendMasterDcmts?: (tid: number | undefined, did: number | undefined) => void;
|
|
23
23
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
24
|
+
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
25
|
+
editPdfForm?: boolean;
|
|
26
|
+
openS4TViewer?: boolean;
|
|
27
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
|
|
28
|
+
onOpenPdfEditorRequest?: ((dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void);
|
|
29
|
+
datagridUtility?: {
|
|
30
|
+
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
31
|
+
onRefreshDataRowsAsync?: (() => Promise<void>);
|
|
32
|
+
refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>;
|
|
33
|
+
onRefreshBlogDatagrid?: () => Promise<void>;
|
|
34
|
+
onRefreshPreviewDatagrid?: () => Promise<void>;
|
|
35
|
+
};
|
|
36
|
+
dcmtUtility?: {
|
|
37
|
+
approvalVID?: number;
|
|
38
|
+
dcmtDataRowForCicoStatus?: Array<MetadataValueDescriptorEx> | any;
|
|
39
|
+
selectedDcmtSearchResultRelations?: SearchResultDescriptor;
|
|
40
|
+
dcmtTIDHasDetailRelations?: boolean;
|
|
41
|
+
dcmtTIDHasMasterRelations?: boolean;
|
|
42
|
+
updateCurrentDcmt?: () => Promise<void>;
|
|
43
|
+
onCloseDcmtForm?: () => void;
|
|
44
|
+
onRefreshBlogForm?: () => Promise<void>;
|
|
45
|
+
onRefreshPreviewForm?: () => Promise<void>;
|
|
46
|
+
taskFormDialogComponent?: React.ReactNode;
|
|
47
|
+
s4TViewerDialogComponent?: React.ReactNode;
|
|
48
|
+
};
|
|
24
49
|
}
|
|
25
50
|
declare const TMMasterDetailDcmts: React.FC<ITMMasterDetailDcmtsProps>;
|
|
26
51
|
export default TMMasterDetailDcmts;
|