@topconsultnpm/sdkui-react 6.20.0 → 6.21.0-dev1.3
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/FloatingMenuBar/TMFloatingMenuBar.js +7 -1
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +8 -3
- package/lib/components/base/TMWaitPanel.js +6 -5
- package/lib/components/features/archive/TMArchive.d.ts +1 -1
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +42 -34
- package/lib/components/features/documents/TMDcmtForm.js +280 -639
- package/lib/components/features/documents/TMDcmtFormActionButtons.d.ts +34 -0
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +124 -0
- package/lib/components/features/documents/TMMasterDetailDcmts.d.ts +27 -2
- package/lib/components/features/documents/TMMasterDetailDcmts.js +160 -18
- package/lib/components/features/documents/TMRelationViewer.d.ts +6 -0
- package/lib/components/features/documents/TMRelationViewer.js +7 -5
- package/lib/components/features/search/TMSearch.d.ts +2 -2
- package/lib/components/features/search/TMSearch.js +3 -3
- package/lib/components/features/search/TMSearchResult.d.ts +27 -26
- package/lib/components/features/search/TMSearchResult.js +349 -486
- package/lib/components/features/tasks/TMTaskForm.d.ts +2 -1
- package/lib/components/features/tasks/TMTaskForm.js +2 -2
- package/lib/helper/checkinCheckoutManager.js +6 -2
- package/lib/hooks/useCheckInOutOperations.d.ts +7 -6
- package/lib/hooks/useCheckInOutOperations.js +9 -16
- package/lib/hooks/useDcmtOperations.d.ts +3 -2
- package/lib/hooks/useDcmtOperations.js +2 -2
- package/lib/hooks/useDocumentOperations.d.ts +139 -0
- package/lib/hooks/useDocumentOperations.js +1309 -0
- package/lib/hooks/useRelatedDocuments.d.ts +1 -1
- package/lib/ts/types.d.ts +2 -1
- package/lib/ts/types.js +1 -0
- package/package.json +55 -55
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +0 -11
- package/lib/components/features/search/TMSearchResultsMenuItems.js +0 -758
|
@@ -32,7 +32,8 @@ export interface TMTaskFormProps {
|
|
|
32
32
|
width?: string;
|
|
33
33
|
height?: string;
|
|
34
34
|
usersList?: Array<UserDescriptor>;
|
|
35
|
-
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>,
|
|
35
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: (() => Promise<void>)) => void;
|
|
36
|
+
onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
36
37
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
37
38
|
}
|
|
38
39
|
declare const TMTaskForm: (props: TMTaskFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,7 +18,7 @@ const TMTaskForm = (props) => {
|
|
|
18
18
|
const { refreshWorkflowApprove } = useWorkflowApprove();
|
|
19
19
|
const validator = async (taskDescriptor) => { return await taskValidatorAsync(taskDescriptor, requestMoreInfo); };
|
|
20
20
|
// Destructure the props object to extract individual properties
|
|
21
|
-
const { id, title, isModal, formMode, requestMoreInfo = false, visualizedTasks, editTaskCallback, currentTask, setCurrentTask, isContextualCreate = false, selectedRowKeys, handleFocusedRowKeyChange, onStatusChanged, onSaved, onClose, onCancel, taskContext, startDate, endDate, showBackButton = true, hasNavigation = true, width = "100%", height = "100%", usersList, onOpenS4TViewerRequest, s4TViewerDialogComponent, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
21
|
+
const { id, title, isModal, formMode, requestMoreInfo = false, visualizedTasks, editTaskCallback, currentTask, setCurrentTask, isContextualCreate = false, selectedRowKeys, handleFocusedRowKeyChange, onStatusChanged, onSaved, onClose, onCancel, taskContext, startDate, endDate, showBackButton = true, hasNavigation = true, width = "100%", height = "100%", usersList, onOpenS4TViewerRequest, onOpenPdfEditorRequest, s4TViewerDialogComponent, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
|
|
22
22
|
const sfo = new SaveFormOptions();
|
|
23
23
|
sfo.objClass = ObjectClasses.Task;
|
|
24
24
|
const customizeFormData = (task) => {
|
|
@@ -305,6 +305,6 @@ const TMTaskForm = (props) => {
|
|
|
305
305
|
justifyContent: 'flex-end',
|
|
306
306
|
alignItems: 'center'
|
|
307
307
|
}, children: _jsx(TaskFormAssignmentNoticeBadge, { task: formData, users: users, requestMoreInfo: requestMoreInfo }) })), (showDcmtForm && formData?.iD1 && formData?.iD2) &&
|
|
308
|
-
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, formData?.iD1, formData?.iD2), onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })] }), formData && showChangeStateForm && _jsx(TMChangeStateForm, { formData: formData, formDataOrig: formDataOrig, handleShowChangeStateForm: handleShowChangeStateForm, setFormData: setFormData })] }) }));
|
|
308
|
+
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, formData?.iD1, formData?.iD2), onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })] }), formData && showChangeStateForm && _jsx(TMChangeStateForm, { formData: formData, formDataOrig: formDataOrig, handleShowChangeStateForm: handleShowChangeStateForm, setFormData: setFormData })] }) }));
|
|
309
309
|
};
|
|
310
310
|
export default TMTaskForm;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, CICO_MetadataNames, SDK_Globals, SystemMIDsAsNumber } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import TMTooltip from "../components/base/TMTooltip";
|
|
4
|
-
import { Globalization, SDKUI_Globals, SDKUI_Localizator } from "./index";
|
|
4
|
+
import { dcmtsFileCachePreview, Globalization, removeDcmtsFileCache, SDKUI_Globals, SDKUI_Localizator } from "./index";
|
|
5
5
|
import { DownloadTypes } from "../ts/types";
|
|
6
6
|
const findCheckOutUserName = (users, checkoutUserId) => {
|
|
7
7
|
let checkOutUser = users.find(user => user.id === checkoutUserId);
|
|
@@ -67,11 +67,15 @@ export const cicoDownloadFilesCallback = async (sources, checkout, downloadDcmts
|
|
|
67
67
|
const newItem = { TID: tid.toString(), DID: did.toString(), checkoutFolder: "", checkoutName: fileName };
|
|
68
68
|
updateCicoCheckoutStorageItem(newItem, source.type, "addOrUpdate");
|
|
69
69
|
}
|
|
70
|
+
const cacheKey = `${tid}-${did}`;
|
|
71
|
+
if (dcmtsFileCachePreview.has(cacheKey))
|
|
72
|
+
removeDcmtsFileCache(cacheKey);
|
|
70
73
|
files.push({ TID: tid, DID: did, FILEEXT: ext, fileName });
|
|
71
74
|
}
|
|
72
75
|
});
|
|
73
|
-
if (files.length > 0)
|
|
76
|
+
if (files.length > 0) {
|
|
74
77
|
await downloadDcmtsAsync(files, DownloadTypes.Dcmt, "download");
|
|
78
|
+
}
|
|
75
79
|
};
|
|
76
80
|
export const updateCicoCheckoutStorageItem = (item, type, action = "addOrUpdate") => {
|
|
77
81
|
// Select the appropriate array based on type
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DcmtInfo, DownloadModes, DownloadTypes } from '../ts';
|
|
2
2
|
import { FileDescriptor, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
interface
|
|
3
|
+
export interface UseCheckInOutOperationsProps {
|
|
4
|
+
onRefreshPreview: () => Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export interface UseCheckInOutOperationsReturn {
|
|
4
7
|
showHistory: boolean;
|
|
5
8
|
showHistoryCallback: () => void;
|
|
6
9
|
hideHistoryCallback: () => void;
|
|
@@ -14,9 +17,8 @@ interface UseCheckInOutOperationsReturn {
|
|
|
14
17
|
};
|
|
15
18
|
hideCommentFormCallback: () => void;
|
|
16
19
|
copyCheckoutPathToClipboardCallback: (dcmt: DcmtInfo, filename: string) => void;
|
|
17
|
-
handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>,
|
|
18
|
-
handleCheckInCallback: (dcmt: DcmtInfo,
|
|
19
|
-
refreshPreviewTrigger: number;
|
|
20
|
+
handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
21
|
+
handleCheckInCallback: (dcmt: DcmtInfo, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
20
22
|
showCicoWaitPanel: boolean;
|
|
21
23
|
cicoWaitPanelTitle: string;
|
|
22
24
|
showCicoPrimaryProgress: boolean;
|
|
@@ -24,5 +26,4 @@ interface UseCheckInOutOperationsReturn {
|
|
|
24
26
|
cicoPrimaryProgressValue: number;
|
|
25
27
|
cicoPrimaryProgressMax: number;
|
|
26
28
|
}
|
|
27
|
-
export declare const useCheckInOutOperations: () => UseCheckInOutOperationsReturn;
|
|
28
|
-
export {};
|
|
29
|
+
export declare const useCheckInOutOperations: (props: UseCheckInOutOperationsProps) => UseCheckInOutOperationsReturn;
|
|
@@ -3,12 +3,11 @@ import { cicoDownloadFilesCallback, dcmtsFileCachePreview, getCicoDownloadFileNa
|
|
|
3
3
|
import { ButtonNames, ShowAlert, TMMessageBoxManager, TMResultManager } from '../components';
|
|
4
4
|
import { ResultTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
let abortController = new AbortController();
|
|
6
|
-
export const useCheckInOutOperations = () => {
|
|
6
|
+
export const useCheckInOutOperations = (props) => {
|
|
7
|
+
const { onRefreshPreview } = props;
|
|
7
8
|
const [showHistory, setShowHistory] = useState(false);
|
|
8
9
|
// State to manage show history selected file
|
|
9
10
|
const [showCheckoutInformationForm, setShowCheckoutInformationForm] = useState(false);
|
|
10
|
-
// Stato per triggerare il refresh della preview dall'esterno
|
|
11
|
-
const [refreshPreviewTrigger, setRefreshPreviewTrigger] = useState(0);
|
|
12
11
|
// State to manage comment form
|
|
13
12
|
const [commentFormState, setCommentFormState] = useState({
|
|
14
13
|
removeAndEditAttachment: true,
|
|
@@ -39,9 +38,6 @@ export const useCheckInOutOperations = () => {
|
|
|
39
38
|
const hideCheckoutInformationFormCallback = useCallback(() => {
|
|
40
39
|
setShowCheckoutInformationForm(false);
|
|
41
40
|
}, []);
|
|
42
|
-
const triggerPreviewRefresh = useCallback(() => {
|
|
43
|
-
setRefreshPreviewTrigger(prev => prev + 1);
|
|
44
|
-
}, []);
|
|
45
41
|
const hideCommentFormCallback = useCallback(() => {
|
|
46
42
|
setCommentFormState(prev => ({ ...prev, show: false }));
|
|
47
43
|
}, []);
|
|
@@ -60,7 +56,7 @@ export const useCheckInOutOperations = () => {
|
|
|
60
56
|
ShowAlert({ message: err, mode: 'error', duration: 5000, title: SDKUI_Localizator.OperationResult });
|
|
61
57
|
});
|
|
62
58
|
};
|
|
63
|
-
const handleCheckOutCallback = async (dcmt, checkout, filename, downloadDcmtsAsync,
|
|
59
|
+
const handleCheckOutCallback = async (dcmt, checkout, filename, downloadDcmtsAsync, onRefreshAsync) => {
|
|
64
60
|
if (!dcmt)
|
|
65
61
|
throw new Error("Document info is required");
|
|
66
62
|
const title = checkout ? 'Check out' : SDKUI_Localizator.CancelCheckOut;
|
|
@@ -88,8 +84,7 @@ export const useCheckInOutOperations = () => {
|
|
|
88
84
|
.then(async () => {
|
|
89
85
|
await cicoDownloadFilesCallback([{ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: filename }], true, downloadDcmtsAsync);
|
|
90
86
|
result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
91
|
-
await
|
|
92
|
-
await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
|
|
87
|
+
await onRefreshAsync?.(dcmt.TID, dcmt.DID, true);
|
|
93
88
|
})
|
|
94
89
|
.catch((error) => {
|
|
95
90
|
result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
@@ -102,8 +97,7 @@ export const useCheckInOutOperations = () => {
|
|
|
102
97
|
result.push({ rowIndex: 1, id1: dcmt.TID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
103
98
|
// Remove the corresponding draft checkout item
|
|
104
99
|
updateCicoCheckoutStorageItem({ TID: dcmt.TID.toString(), DID: dcmt.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
|
|
105
|
-
await
|
|
106
|
-
await refreshFocusedDataRowAsync?.(dcmt.TID, dcmt.DID, true);
|
|
100
|
+
await onRefreshAsync?.(dcmt.TID, dcmt.DID, true);
|
|
107
101
|
})
|
|
108
102
|
.catch((error) => {
|
|
109
103
|
result.push({ rowIndex: 0, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
@@ -133,7 +127,7 @@ export const useCheckInOutOperations = () => {
|
|
|
133
127
|
});
|
|
134
128
|
}
|
|
135
129
|
};
|
|
136
|
-
const handleCheckInCallback = async (dcmt,
|
|
130
|
+
const handleCheckInCallback = async (dcmt, onRefreshAsync) => {
|
|
137
131
|
if (!dcmt)
|
|
138
132
|
throw new Error("Document info is required");
|
|
139
133
|
// Create a new file input element
|
|
@@ -175,12 +169,12 @@ export const useCheckInOutOperations = () => {
|
|
|
175
169
|
// Remove the corresponding draft checkout item
|
|
176
170
|
updateCicoCheckoutStorageItem({ TID: dcmt.TID.toString(), DID: dcmt.DID.toString(), checkoutFolder: "", checkoutName: "" }, "dcmtInfo", "remove");
|
|
177
171
|
result.push({ rowIndex: i, id1: dcmt.DID, id2: dcmt.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
178
|
-
await
|
|
179
|
-
|
|
172
|
+
await onRefreshAsync?.(dcmt.TID, dcmt.DID, true);
|
|
173
|
+
// remove file from preview cache to force refresh with the new checked-in file
|
|
180
174
|
const cacheKey = `${dcmt.TID}-${dcmt.DID}`;
|
|
181
175
|
if (dcmtsFileCachePreview.has(cacheKey))
|
|
182
176
|
removeDcmtsFileCache(cacheKey);
|
|
183
|
-
|
|
177
|
+
await onRefreshPreview();
|
|
184
178
|
triggerCommentOnFileAdd([dcmt.DID]);
|
|
185
179
|
}
|
|
186
180
|
}
|
|
@@ -212,7 +206,6 @@ export const useCheckInOutOperations = () => {
|
|
|
212
206
|
copyCheckoutPathToClipboardCallback,
|
|
213
207
|
handleCheckOutCallback,
|
|
214
208
|
handleCheckInCallback,
|
|
215
|
-
refreshPreviewTrigger,
|
|
216
209
|
showCicoWaitPanel,
|
|
217
210
|
cicoWaitPanelTitle,
|
|
218
211
|
showCicoPrimaryProgress,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RetrieveFileOptions, FileDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
2
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes } from '../ts';
|
|
3
|
-
export
|
|
3
|
+
export interface UseDcmtOperationsReturn {
|
|
4
4
|
abortController: AbortController;
|
|
5
5
|
showWaitPanel: boolean;
|
|
6
6
|
showPrimary: boolean;
|
|
@@ -21,4 +21,5 @@ export declare function useDcmtOperations(): {
|
|
|
21
21
|
removeDcmtsFileCache: (key: string) => void;
|
|
22
22
|
isDcmtFileInCache: (key: string) => boolean;
|
|
23
23
|
runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
|
+
export declare const useDcmtOperations: () => UseDcmtOperationsReturn;
|
|
@@ -20,7 +20,7 @@ const getDownloadFileName = (fileName) => {
|
|
|
20
20
|
return fileName;
|
|
21
21
|
return `${fileName.slice(0, firstDot)}(${count})${fileName.slice(firstDot)}`;
|
|
22
22
|
};
|
|
23
|
-
export
|
|
23
|
+
export const useDcmtOperations = () => {
|
|
24
24
|
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
|
25
25
|
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
|
26
26
|
const [showPrimary, setShowPrimary] = useState(false);
|
|
@@ -495,4 +495,4 @@ export function useDcmtOperations() {
|
|
|
495
495
|
abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary,
|
|
496
496
|
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync
|
|
497
497
|
};
|
|
498
|
-
}
|
|
498
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import React, { RefObject } from "react";
|
|
2
|
+
import { DcmtTypeDescriptor, FileFormats, HomeBlogPost, LayoutDescriptor, LayoutModes, ObjectRef, SearchResultDescriptor, TaskDescriptor, UserDescriptor, WorkingGroupDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { IColumnProps } from "devextreme-react/cjs/data-grid";
|
|
4
|
+
import { TMContextMenuItemProps } from '../components/NewComponents/ContextMenu/types';
|
|
5
|
+
import { DcmtInfo, MetadataValueDescriptorEx, SearchResultContext, TaskContext } from "../ts";
|
|
6
|
+
import { UseCheckInOutOperationsReturn } from "./useCheckInOutOperations";
|
|
7
|
+
import { UseDcmtOperationsReturn } from "./useDcmtOperations";
|
|
8
|
+
import { UseRelatedDocumentsReturn } from "./useRelatedDocuments";
|
|
9
|
+
export interface DocumentDataProps {
|
|
10
|
+
dtd: DcmtTypeDescriptor | undefined;
|
|
11
|
+
selectedItems: Array<any>;
|
|
12
|
+
focusedItem: any;
|
|
13
|
+
currentSearchResults: Array<SearchResultDescriptor>;
|
|
14
|
+
currentMetadataValues: Array<MetadataValueDescriptorEx>;
|
|
15
|
+
allUsers?: Array<UserDescriptor>;
|
|
16
|
+
searchResult?: SearchResultDescriptor;
|
|
17
|
+
datagridUtility?: {
|
|
18
|
+
visibleItems?: any[];
|
|
19
|
+
onRefreshSearchAsyncDatagrid?: () => Promise<void>;
|
|
20
|
+
onRefreshDataRowsAsync?: (() => Promise<void>);
|
|
21
|
+
refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>;
|
|
22
|
+
onRefreshBlogDatagrid?: () => Promise<void>;
|
|
23
|
+
onRefreshPreviewDatagrid?: () => Promise<void>;
|
|
24
|
+
refreshOperationsTrigger?: number;
|
|
25
|
+
onRefreshOperationsDatagrid?: () => Promise<void>;
|
|
26
|
+
};
|
|
27
|
+
dcmtUtility?: {
|
|
28
|
+
approvalVID?: number;
|
|
29
|
+
dcmtDataRowForCicoStatus?: Array<MetadataValueDescriptorEx> | any;
|
|
30
|
+
selectedDcmtSearchResultRelations?: SearchResultDescriptor;
|
|
31
|
+
dcmtTIDHasDetailRelations?: boolean;
|
|
32
|
+
dcmtTIDHasMasterRelations?: boolean;
|
|
33
|
+
updateCurrentDcmt?: () => Promise<void>;
|
|
34
|
+
onCloseDcmtForm?: () => void;
|
|
35
|
+
onRefreshBlogForm?: () => Promise<void>;
|
|
36
|
+
onRefreshPreviewForm?: () => Promise<void>;
|
|
37
|
+
taskFormDialogComponent?: React.ReactNode;
|
|
38
|
+
s4TViewerDialogComponent?: React.ReactNode;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export interface ExportDataProps {
|
|
42
|
+
dataColumns?: Array<IColumnProps>;
|
|
43
|
+
dataSource?: Array<any>;
|
|
44
|
+
selectedRowKeys?: Array<number>;
|
|
45
|
+
}
|
|
46
|
+
export interface UIConfigProps {
|
|
47
|
+
floatingBarContainerRef?: RefObject<HTMLElement | null>;
|
|
48
|
+
customButtonsLayout?: LayoutDescriptor;
|
|
49
|
+
workingGroupContext?: WorkingGroupDescriptor;
|
|
50
|
+
allowFloatingBar?: boolean;
|
|
51
|
+
enablePinIcons?: boolean;
|
|
52
|
+
openDcmtFormAsModal?: boolean;
|
|
53
|
+
showDcmtFormSidebar?: boolean;
|
|
54
|
+
allowRelations?: boolean;
|
|
55
|
+
openS4TViewer?: boolean;
|
|
56
|
+
editPdfForm?: boolean;
|
|
57
|
+
showTodoDcmtForm?: boolean;
|
|
58
|
+
showToppyDraggableHelpCenter?: boolean;
|
|
59
|
+
toppyHelpCenterUsePortal?: boolean;
|
|
60
|
+
inputDcmtFormLayoutMode?: LayoutModes;
|
|
61
|
+
}
|
|
62
|
+
export interface TasksProps {
|
|
63
|
+
allTasks?: Array<TaskDescriptor>;
|
|
64
|
+
getAllTasks?: () => Promise<void>;
|
|
65
|
+
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|
|
66
|
+
addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
67
|
+
editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
export interface OperationCallbacks {
|
|
70
|
+
onRefreshSearchAsync?: (() => Promise<void>);
|
|
71
|
+
onSavedAsyncCallback?: (tid: number | undefined, did: number | undefined, metadataResult?: SearchResultDescriptor | null) => Promise<void>;
|
|
72
|
+
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
73
|
+
onWFOperationCompleted?: () => Promise<void>;
|
|
74
|
+
canNavigateHandler?: (dir: "next" | "prev") => boolean;
|
|
75
|
+
onNavigateHandler?: (dir: "next" | "prev") => void;
|
|
76
|
+
handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
|
|
77
|
+
handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
|
|
78
|
+
onReferenceClick?: (ref: ObjectRef) => void;
|
|
79
|
+
openAddDocumentForm?: () => void;
|
|
80
|
+
openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void);
|
|
81
|
+
onFileOpened?: (blob: File | undefined) => void;
|
|
82
|
+
passToArchiveCallback?: (outputMids: Array<{
|
|
83
|
+
mid: number;
|
|
84
|
+
value: string;
|
|
85
|
+
}>, tid?: number) => void;
|
|
86
|
+
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
87
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
88
|
+
onOpenPdfEditorRequest?: (dcmtInfo: Array<DcmtInfo>, refreshDocumentPreview?: () => Promise<void>) => void;
|
|
89
|
+
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
90
|
+
openTaskFormHandler?: (onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
91
|
+
}
|
|
92
|
+
interface UseDocumentOperationsProps {
|
|
93
|
+
context: SearchResultContext;
|
|
94
|
+
documentData: DocumentDataProps;
|
|
95
|
+
uiConfig: UIConfigProps;
|
|
96
|
+
tasks: TasksProps;
|
|
97
|
+
callbacks: OperationCallbacks;
|
|
98
|
+
exportData?: ExportDataProps;
|
|
99
|
+
}
|
|
100
|
+
export interface UseDocumentOperationsResult {
|
|
101
|
+
operationItems: Array<TMContextMenuItemProps>;
|
|
102
|
+
renderFloatingBar: React.ReactNode;
|
|
103
|
+
renderDcmtOperations: React.ReactNode;
|
|
104
|
+
features: {
|
|
105
|
+
isOpenDcmtForm: boolean;
|
|
106
|
+
openFormHandler: (layoutMode: LayoutModes) => void;
|
|
107
|
+
dcmtFormLayoutMode: LayoutModes;
|
|
108
|
+
onDcmtFormOpenChange: (isOpen: boolean, layoutMode: LayoutModes) => void;
|
|
109
|
+
isOpenBatchUpdate: boolean;
|
|
110
|
+
isModifiedBatchUpdate: boolean;
|
|
111
|
+
updateBatchUpdateForm: (value: boolean) => void;
|
|
112
|
+
handleSignApprove: () => void;
|
|
113
|
+
showSearchTMDatagrid: boolean;
|
|
114
|
+
showExportForm: boolean;
|
|
115
|
+
checkoutInfo: UseCheckInOutOperationsReturn;
|
|
116
|
+
relatedDocumentsInfo: UseRelatedDocumentsReturn;
|
|
117
|
+
dcmtOperations: UseDcmtOperationsReturn;
|
|
118
|
+
toppyOperations: {
|
|
119
|
+
showApprovePopup: boolean;
|
|
120
|
+
showRejectPopup: boolean;
|
|
121
|
+
showReAssignPopup: boolean;
|
|
122
|
+
showMoreInfoPopup: boolean;
|
|
123
|
+
updateShowApprovePopup: (value: boolean) => void;
|
|
124
|
+
updateShowRejectPopup: (value: boolean) => void;
|
|
125
|
+
updateShowReAssignPopup: (value: boolean) => void;
|
|
126
|
+
updateShowMoreInfoPopup: (value: boolean) => void;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export interface ExportData {
|
|
131
|
+
dataColumns?: Array<IColumnProps>;
|
|
132
|
+
dataSource?: Array<any>;
|
|
133
|
+
selectedRowKeys?: Array<number>;
|
|
134
|
+
searchResult?: SearchResultDescriptor;
|
|
135
|
+
}
|
|
136
|
+
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
137
|
+
export declare const getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
|
|
138
|
+
export declare const useDocumentOperations: (props: UseDocumentOperationsProps) => UseDocumentOperationsResult;
|
|
139
|
+
export {};
|