@topconsultnpm/sdkui-react-beta 6.14.55 → 6.14.56
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/features/search/TMSearchResult.js +12 -5
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +60 -32
- package/lib/components/features/wg/TMWGsCopyMoveForm.d.ts +19 -6
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +138 -49
- package/lib/components/forms/TMSaveForm.js +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +26 -1
- package/lib/helper/SDKUI_Localizator.js +250 -0
- package/lib/ts/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -35,6 +35,7 @@ import TMDcmtIcon from '../documents/TMDcmtIcon';
|
|
|
35
35
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
36
36
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
37
37
|
import ShowAlert from '../../base/TMAlert';
|
|
38
|
+
import TMWGsCopyMoveForm from '../wg/TMWGsCopyMoveForm';
|
|
38
39
|
//#region Internal Components
|
|
39
40
|
const CommandsContextMenu = React.memo(({ target, menuItems, allowPin }) => {
|
|
40
41
|
return (_jsx(ContextMenu, { showEvent: 'click', dataSource: menuItems, target: `${target}` }));
|
|
@@ -81,6 +82,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
81
82
|
let disable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 0;
|
|
82
83
|
let dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
|
|
83
84
|
let dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
|
|
85
|
+
// State to manage the visibility and mode ("copy" or "move") of the Copy/Move Draft form
|
|
86
|
+
const [copyMoveDraftForm, setCopyMoveDraftForm] = useState({ show: false, mode: undefined, });
|
|
84
87
|
useEffect(() => { setID(genUniqueId()); }, []);
|
|
85
88
|
useEffect(() => {
|
|
86
89
|
setSelectedItems([]);
|
|
@@ -126,6 +129,9 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
126
129
|
fileExt: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
|
127
130
|
});
|
|
128
131
|
}, [currentMetadataValues]);
|
|
132
|
+
const showCopyMoveFormCallback = (mode) => {
|
|
133
|
+
setCopyMoveDraftForm({ show: true, mode });
|
|
134
|
+
};
|
|
129
135
|
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
|
130
136
|
const openTaskFormHandler = (onTaskCreated) => {
|
|
131
137
|
if (selectedItems.length > 1)
|
|
@@ -199,7 +205,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
199
205
|
return;
|
|
200
206
|
if (e.target === 'content') {
|
|
201
207
|
e.items = e.items || [];
|
|
202
|
-
const menuItems = getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler);
|
|
208
|
+
const menuItems = getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback);
|
|
203
209
|
e.items.push(...menuItems);
|
|
204
210
|
}
|
|
205
211
|
};
|
|
@@ -326,7 +332,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
326
332
|
}
|
|
327
333
|
};
|
|
328
334
|
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
329
|
-
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] });
|
|
335
|
+
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-header-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) })] });
|
|
330
336
|
const middlePanelToolbar = _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [_jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canPrev: canNavigateHandler('prev'), onPrev: () => onNavigateHandler('prev') }), _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canNext: canNavigateHandler('next'), onNext: () => onNavigateHandler('next') })] });
|
|
331
337
|
const handleAddItem = (tid, did) => {
|
|
332
338
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
@@ -343,7 +349,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
343
349
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
344
350
|
:
|
|
345
351
|
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments) }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
346
|
-
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
352
|
+
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(CommandsContextMenu, { target: `#commands-floating-${id}`, menuItems: getCommandsMenuItems(fromDTD, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: SDKUI_Localizator.BatchUpdate, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
347
353
|
setIsOpenBatchUpdate(false);
|
|
348
354
|
}, onSavedCallbackAsync: async () => {
|
|
349
355
|
setIsOpenBatchUpdate(false);
|
|
@@ -359,7 +365,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
359
365
|
SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(vid, did, task?.id ?? 0)
|
|
360
366
|
.catch(err => TMExceptionBoxManager.show({ exception: err }));
|
|
361
367
|
});
|
|
362
|
-
}, approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }), [
|
|
368
|
+
}, approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), (copyMoveDraftForm.show && copyMoveDraftForm.mode && getSelectedDcmtsOrFocused(selectedItems, focusedItem)) && _jsx(TMWGsCopyMoveForm, { context: { engine: 'SearchEngine', object: fromDTD, selectedDrafts: getSelectedDcmtsOrFocused(selectedItems, focusedItem) }, mode: copyMoveDraftForm.mode, onClose: () => { setCopyMoveDraftForm({ show: false, mode: undefined }); } })] }), [
|
|
363
369
|
searchResults,
|
|
364
370
|
selectedSearchResult,
|
|
365
371
|
lastUpdateSearchTime,
|
|
@@ -375,7 +381,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
375
381
|
isOpenBatchUpdate,
|
|
376
382
|
isOpenDetails,
|
|
377
383
|
isOpenMaster,
|
|
378
|
-
isOpenDcmtForm
|
|
384
|
+
isOpenDcmtForm,
|
|
385
|
+
copyMoveDraftForm
|
|
379
386
|
]);
|
|
380
387
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), [focusedItem]);
|
|
381
388
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [focusedItem, currentMetadataValues, deviceType]);
|
|
@@ -3,4 +3,4 @@ import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes } from '@t
|
|
|
3
3
|
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
4
4
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
|
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
6
|
-
export declare const getCommandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void) => Array<TMDataGridContextMenuItem>;
|
|
6
|
+
export declare const getCommandsMenuItems: (dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, showCopyMoveFormCallback: (mode: "copyToWgDraft" | "copyToWgArchivedDoc") => void) => Array<TMDataGridContextMenuItem>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconExportTo, IconFileDots, IconHide, IconInfo, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, SDKUI_Localizator, svgToString } from '../../../helper';
|
|
3
|
+
import { IconActivity, IconAdd, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconExportTo, IconFileDots, IconFolder, IconHide, IconInfo, IconPlatform, IconPreview, IconRefresh, IconRelation, IconSearch, IconShow, IconSignature, IconStar, IconSubstFile, IconUndo, SDKUI_Localizator, svgToString } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
@@ -24,44 +24,66 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
|
24
24
|
}
|
|
25
25
|
return [];
|
|
26
26
|
};
|
|
27
|
-
export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler) => {
|
|
27
|
+
export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, showFloatingBar, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, showCopyMoveFormCallback) => {
|
|
28
28
|
// let ftExplanations = focusedItem?.FTExplanations;
|
|
29
29
|
return [
|
|
30
30
|
{
|
|
31
31
|
icon: svgToString(_jsx(IconFileDots, {})),
|
|
32
|
-
text:
|
|
32
|
+
text: SDKUI_Localizator.DocumentOperations,
|
|
33
33
|
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
34
34
|
items: [
|
|
35
35
|
{
|
|
36
|
-
icon: svgToString(_jsx(
|
|
37
|
-
text:
|
|
36
|
+
icon: svgToString(_jsx(IconAdd, {})),
|
|
37
|
+
text: SDKUI_Localizator.AddTo,
|
|
38
38
|
operationType: 'multiRow',
|
|
39
39
|
disabled: context === SearchResultContext.FAVORITES_AND_RECENTS || disabledForMultiRow(selectedItems, focusedItem),
|
|
40
|
-
|
|
40
|
+
items: [
|
|
41
|
+
{
|
|
42
|
+
icon: svgToString(_jsx(IconStar, {})),
|
|
43
|
+
text: SDKUI_Localizator.Favorites,
|
|
44
|
+
operationType: 'multiRow',
|
|
45
|
+
disabled: context === SearchResultContext.FAVORITES_AND_RECENTS || disabledForMultiRow(selectedItems, focusedItem),
|
|
46
|
+
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.AddToFavs); onRefreshAfterAddDcmtToFavs?.(); },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
icon: svgToString(_jsx(IconFolder, {})),
|
|
50
|
+
text: SDKUI_Localizator.WorkgroupDrafts,
|
|
51
|
+
operationType: 'multiRow',
|
|
52
|
+
disabled: context === SearchResultContext.FAVORITES_AND_RECENTS || disabledForMultiRow(selectedItems, focusedItem),
|
|
53
|
+
onClick: () => { showCopyMoveFormCallback('copyToWgDraft'); },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
icon: svgToString(_jsx(IconArchiveDoc, {})),
|
|
57
|
+
text: SDKUI_Localizator.WorkgroupArchivedDocuments,
|
|
58
|
+
operationType: 'multiRow',
|
|
59
|
+
disabled: context === SearchResultContext.FAVORITES_AND_RECENTS || disabledForMultiRow(selectedItems, focusedItem),
|
|
60
|
+
onClick: () => { showCopyMoveFormCallback('copyToWgArchivedDoc'); },
|
|
61
|
+
},
|
|
62
|
+
]
|
|
41
63
|
},
|
|
42
64
|
{
|
|
43
65
|
icon: svgToString(_jsx(IconSubstFile, {})),
|
|
44
|
-
text:
|
|
66
|
+
text: SDKUI_Localizator.AddReplaceFile,
|
|
45
67
|
operationType: 'singleRow',
|
|
46
68
|
disabled: dtd?.perm?.canSubstFile !== AccessLevels.Yes ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
47
69
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.SubstituteFile, onRefreshDataRowsAsync); }
|
|
48
70
|
},
|
|
49
71
|
{
|
|
50
72
|
icon: svgToString(_jsx(IconPreview, {})),
|
|
51
|
-
text:
|
|
73
|
+
text: SDKUI_Localizator.OpenForm,
|
|
52
74
|
operationType: 'singleRow',
|
|
53
75
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
54
76
|
onClick: () => openFormHandler?.(LayoutModes.Update)
|
|
55
77
|
},
|
|
56
78
|
{
|
|
57
79
|
icon: svgToString(_jsx(IconDelete, {})),
|
|
58
|
-
text:
|
|
80
|
+
text: SDKUI_Localizator.Deletion,
|
|
59
81
|
operationType: 'multiRow',
|
|
60
82
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
61
83
|
items: [
|
|
62
84
|
{
|
|
63
85
|
icon: svgToString(_jsx(IconDelete, {})),
|
|
64
|
-
text:
|
|
86
|
+
text: SDKUI_Localizator.LogDelete,
|
|
65
87
|
operationType: 'multiRow',
|
|
66
88
|
disabled: dtd?.perm?.canLogicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
67
89
|
onClick: async () => {
|
|
@@ -71,7 +93,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
71
93
|
},
|
|
72
94
|
{
|
|
73
95
|
icon: svgToString(_jsx(IconUndo, {})),
|
|
74
|
-
text:
|
|
96
|
+
text: SDKUI_Localizator.Restore,
|
|
75
97
|
operationType: 'multiRow',
|
|
76
98
|
disabled: dtd?.perm?.canLogicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
77
99
|
onClick: async () => {
|
|
@@ -81,7 +103,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
81
103
|
},
|
|
82
104
|
{
|
|
83
105
|
icon: svgToString(_jsx(IconCloseCircle, {})),
|
|
84
|
-
text:
|
|
106
|
+
text: SDKUI_Localizator.PhysDelete,
|
|
85
107
|
operationType: 'multiRow',
|
|
86
108
|
disabled: dtd?.perm?.canPhysicalDelete !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
87
109
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.PhysDelete, onRefreshSearchAsync); }
|
|
@@ -90,14 +112,14 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
90
112
|
},
|
|
91
113
|
{
|
|
92
114
|
icon: svgToString(_jsx(IconCheckFile, {})),
|
|
93
|
-
text:
|
|
115
|
+
text: SDKUI_Localizator.FileCheck,
|
|
94
116
|
operationType: 'multiRow',
|
|
95
117
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
96
118
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.CheckFile); }
|
|
97
119
|
},
|
|
98
120
|
{
|
|
99
121
|
icon: svgToString(_jsx(IconConvertFilePdf, {})),
|
|
100
|
-
text:
|
|
122
|
+
text: SDKUI_Localizator.FileConversion,
|
|
101
123
|
operationType: 'multiRow',
|
|
102
124
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
103
125
|
onClick: async () => {
|
|
@@ -120,24 +142,24 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
120
142
|
icon: svgToString(_jsx(IconDownload, {})),
|
|
121
143
|
operationType: 'multiRow',
|
|
122
144
|
disabled: dtd?.perm?.canRetrieveFile !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
123
|
-
text:
|
|
145
|
+
text: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download")
|
|
124
146
|
},
|
|
125
147
|
{
|
|
126
148
|
icon: svgToString(_jsx(IconDownload, {})),
|
|
127
149
|
operationType: 'singleRow',
|
|
128
150
|
disabled: !isXMLFileExt(getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT) ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
129
|
-
text:
|
|
151
|
+
text: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Attachment, "download", undefined, confirmAttachments)
|
|
130
152
|
},
|
|
131
153
|
{
|
|
132
154
|
icon: svgToString(_jsx(IconArchiveDoc, {})),
|
|
133
|
-
text:
|
|
155
|
+
text: SDKUI_Localizator.DuplicateDocument,
|
|
134
156
|
operationType: 'singleRow',
|
|
135
157
|
disabled: dtd?.perm?.canArchive !== AccessLevelsEx.Yes && dtd?.perm?.canArchive !== AccessLevelsEx.Mixed ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
136
158
|
onClick: () => { openFormHandler?.(LayoutModes.Ark); }
|
|
137
159
|
},
|
|
138
160
|
{
|
|
139
161
|
icon: svgToString(_jsx(IconBatchUpdate, {})),
|
|
140
|
-
text:
|
|
162
|
+
text: SDKUI_Localizator.BatchUpdate,
|
|
141
163
|
operationType: 'multiRow',
|
|
142
164
|
disabled: dtd?.perm?.canUpdate !== AccessLevelsEx.Yes && dtd?.perm?.canUpdate !== AccessLevelsEx.Mixed ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
143
165
|
onClick: () => openBatchUpdateFormHandler?.(true)
|
|
@@ -146,19 +168,19 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
146
168
|
},
|
|
147
169
|
{
|
|
148
170
|
icon: svgToString(_jsx(IconSignature, {})),
|
|
149
|
-
text:
|
|
171
|
+
text: SDKUI_Localizator.Signature,
|
|
150
172
|
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
151
173
|
items: [
|
|
152
174
|
{
|
|
153
175
|
icon: svgToString(_jsx(IconSignature, {})),
|
|
154
|
-
text:
|
|
176
|
+
text: SDKUI_Localizator.SignatureInformation,
|
|
155
177
|
operationType: 'singleRow',
|
|
156
178
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
157
179
|
onClick: () => ShowAlert({ message: "TODO Informazioni di firma", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
158
180
|
},
|
|
159
181
|
{
|
|
160
182
|
icon: svgToString(_jsx(IconSignature, {})),
|
|
161
|
-
text:
|
|
183
|
+
text: SDKUI_Localizator.VerifySignature,
|
|
162
184
|
operationType: 'multiRow',
|
|
163
185
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
164
186
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.VerifySign); }
|
|
@@ -167,7 +189,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
167
189
|
icon: svgToString(_jsx(IconSignature, {})),
|
|
168
190
|
operationType: 'multiRow',
|
|
169
191
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
170
|
-
text:
|
|
192
|
+
text: SDKUI_Localizator.SignatureAndTimestamp, onClick: () => ShowAlert({ message: "TODO Firma e marca", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
171
193
|
},
|
|
172
194
|
]
|
|
173
195
|
},
|
|
@@ -214,7 +236,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
214
236
|
// },
|
|
215
237
|
{
|
|
216
238
|
icon: svgToString(_jsx(IconRelation, {})),
|
|
217
|
-
text:
|
|
239
|
+
text: SDKUI_Localizator.Relations,
|
|
218
240
|
operationType: 'multiRow',
|
|
219
241
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
220
242
|
items: [
|
|
@@ -290,13 +312,13 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
290
312
|
// },
|
|
291
313
|
{
|
|
292
314
|
icon: svgToString(_jsx(IconSearch, {})),
|
|
293
|
-
text:
|
|
315
|
+
text: SDKUI_Localizator.FullTextSearch,
|
|
294
316
|
operationType: 'multiRow',
|
|
295
317
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
296
318
|
items: [
|
|
297
319
|
{
|
|
298
320
|
icon: svgToString(_jsx(IconInfo, {})),
|
|
299
|
-
text:
|
|
321
|
+
text: SDKUI_Localizator.IndexingInformation,
|
|
300
322
|
operationType: 'singleRow',
|
|
301
323
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
302
324
|
onClick: async () => {
|
|
@@ -304,7 +326,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
304
326
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading}...` });
|
|
305
327
|
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
306
328
|
const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(dcmts[0].TID, dcmts[0].DID);
|
|
307
|
-
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], message: msg, title:
|
|
329
|
+
TMMessageBoxManager.show({ buttons: [ButtonNames.OK], message: msg, title: SDKUI_Localizator.IndexingInformation });
|
|
308
330
|
}
|
|
309
331
|
catch (e) {
|
|
310
332
|
TMExceptionBoxManager.show({ exception: e });
|
|
@@ -316,14 +338,14 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
316
338
|
},
|
|
317
339
|
{
|
|
318
340
|
icon: svgToString(_jsx(IconArchiveDoc, {})),
|
|
319
|
-
text:
|
|
341
|
+
text: SDKUI_Localizator.IndexOrReindex,
|
|
320
342
|
operationType: 'multiRow',
|
|
321
343
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
322
344
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.FreeSearchReindex); }
|
|
323
345
|
},
|
|
324
346
|
{
|
|
325
347
|
icon: svgToString(_jsx(IconDelete, {})),
|
|
326
|
-
text:
|
|
348
|
+
text: SDKUI_Localizator.IndexingDelete,
|
|
327
349
|
operationType: 'multiRow',
|
|
328
350
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
329
351
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.FreeSearchPurge); }
|
|
@@ -331,7 +353,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
331
353
|
...(focusedItem?.FTExplanations !== undefined
|
|
332
354
|
? [{
|
|
333
355
|
icon: svgToString(_jsx(IconPlatform, {})),
|
|
334
|
-
text:
|
|
356
|
+
text: SDKUI_Localizator.ResultDetails,
|
|
335
357
|
operationType: 'singleRow',
|
|
336
358
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
337
359
|
onClick: () => {
|
|
@@ -342,11 +364,11 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
342
364
|
},
|
|
343
365
|
{
|
|
344
366
|
icon: svgToString(_jsx(IconDotsVerticalCircleOutline, {})),
|
|
345
|
-
text:
|
|
367
|
+
text: SDKUI_Localizator.Other,
|
|
346
368
|
items: [
|
|
347
369
|
{
|
|
348
370
|
icon: svgToString(_jsx(IconExportTo, {})),
|
|
349
|
-
text:
|
|
371
|
+
text: SDKUI_Localizator.ExportTo,
|
|
350
372
|
operationType: 'multiRow',
|
|
351
373
|
disabled: false,
|
|
352
374
|
onClick: () => ShowAlert({ message: "TODO Esporta in", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
@@ -359,10 +381,16 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
359
381
|
// },
|
|
360
382
|
{
|
|
361
383
|
icon: svgToString(showFloatingBar ? _jsx(IconHide, {}) : _jsx(IconShow, {})),
|
|
362
|
-
text: showFloatingBar ?
|
|
384
|
+
text: showFloatingBar ? SDKUI_Localizator.HideFloatingBar : SDKUI_Localizator.ShowFloatingBar,
|
|
363
385
|
disabled: false,
|
|
364
386
|
onClick: () => setShowFloatingBar(!showFloatingBar)
|
|
365
387
|
},
|
|
388
|
+
{
|
|
389
|
+
icon: svgToString(_jsx(IconRefresh, {})),
|
|
390
|
+
text: SDKUI_Localizator.Refresh,
|
|
391
|
+
disabled: false,
|
|
392
|
+
onClick: async () => onRefreshSearchAsync && await onRefreshSearchAsync()
|
|
393
|
+
},
|
|
366
394
|
// {
|
|
367
395
|
// icon: svgToString(<IconSave />),
|
|
368
396
|
// text: "Salva layout",
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import { WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts-beta";
|
|
1
|
+
import { DcmtTypeDescriptor, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts-beta";
|
|
2
2
|
import { FileItem } from '../../base/TMFileManager';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/** Context descriptor for copy/move operations using different engines */
|
|
4
|
+
export type TMWgsCopyMoveContextDescriptor = {
|
|
5
|
+
engine: 'WorkingGroupEngine';
|
|
6
|
+
object?: WorkingGroupDescriptor;
|
|
7
7
|
selectedDrafts: Array<FileItem>;
|
|
8
|
+
} | {
|
|
9
|
+
engine: 'SearchEngine';
|
|
10
|
+
object?: DcmtTypeDescriptor;
|
|
11
|
+
selectedDrafts: Array<any>;
|
|
12
|
+
};
|
|
13
|
+
export declare const getDocumentDisplayInfo: (descriptor: DcmtTypeDescriptor, item: any) => {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
17
|
+
interface TMWGsCopyMoveFormProps {
|
|
18
|
+
context: TMWgsCopyMoveContextDescriptor;
|
|
19
|
+
mode: 'copy' | 'move' | 'copyToWgDraft' | 'copyToWgArchivedDoc';
|
|
8
20
|
onClose: () => void;
|
|
9
|
-
refreshCallback: () => void;
|
|
10
21
|
workingGroups?: Array<WorkingGroupDescriptor>;
|
|
22
|
+
folder?: FileItem;
|
|
23
|
+
refreshCallback?: () => void;
|
|
11
24
|
}
|
|
12
25
|
declare const TMWGsCopyMoveForm: (props: TMWGsCopyMoveFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
26
|
export default TMWGsCopyMoveForm;
|