@topconsultnpm/sdkui-react-beta 6.14.34 → 6.14.36
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/documents/TMMasterDetailDcmts.d.ts +2 -1
- package/lib/components/features/search/TMSearch.d.ts +2 -1
- package/lib/components/features/search/TMSearchResult.d.ts +2 -2
- package/lib/components/features/search/TMSearchResult.js +8 -4
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +1 -3
- package/lib/components/grids/TMBlogs.js +6 -3
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
2
3
|
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
3
4
|
import { DeviceContextProps } from '../../base/TMDeviceProvider';
|
|
4
5
|
interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
@@ -12,7 +13,7 @@ interface ITMMasterDetailDcmtsProps extends DeviceContextProps {
|
|
|
12
13
|
onPrev?: () => void;
|
|
13
14
|
onBack?: () => void;
|
|
14
15
|
appendMasterDcmts?: (tid: number | undefined, did: number | undefined) => void;
|
|
15
|
-
onTaskCreateRequest?: (taskContext: TaskContext) => void;
|
|
16
|
+
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
16
17
|
}
|
|
17
18
|
declare const TMMasterDetailDcmts: React.FC<ITMMasterDetailDcmtsProps>;
|
|
18
19
|
export default TMMasterDetailDcmts;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
2
3
|
import { TaskContext } from '../../../ts';
|
|
3
4
|
interface ITMSearchProps {
|
|
4
5
|
inputTID?: number;
|
|
@@ -6,7 +7,7 @@ interface ITMSearchProps {
|
|
|
6
7
|
isExpertMode?: boolean;
|
|
7
8
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
8
9
|
onFileOpened?: (dcmtFile: File | undefined) => void;
|
|
9
|
-
onTaskCreateRequest?: (taskContext: TaskContext) => void;
|
|
10
|
+
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
10
11
|
}
|
|
11
12
|
declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
|
|
12
13
|
export default TMSearch;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { SearchResultDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
2
|
+
import { SearchResultDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
3
|
import { SearchResultContext, TaskContext } from '../../../ts';
|
|
4
4
|
interface ITMSearchResultProps {
|
|
5
5
|
context?: SearchResultContext;
|
|
@@ -20,7 +20,7 @@ interface ITMSearchResultProps {
|
|
|
20
20
|
onSelectedTIDChanged?: (TID: number) => void;
|
|
21
21
|
onRefreshSearchAsync?: () => Promise<void>;
|
|
22
22
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
23
|
-
onTaskCreateRequest?: (taskContext: TaskContext) => void;
|
|
23
|
+
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
24
24
|
onFileOpened?: (blob: File | undefined) => void;
|
|
25
25
|
}
|
|
26
26
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
@@ -126,7 +126,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
126
126
|
});
|
|
127
127
|
}, [currentMetadataValues]);
|
|
128
128
|
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
|
129
|
-
const openTaskFormHandler = (
|
|
129
|
+
const openTaskFormHandler = (onTaskCreated) => {
|
|
130
130
|
if (selectedItems.length > 1)
|
|
131
131
|
return;
|
|
132
132
|
const item = selectedItems.length === 1 ? selectedItems[0] : focusedItem;
|
|
@@ -149,7 +149,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
149
149
|
}
|
|
150
150
|
onTaskCreateRequest?.(isWorkItem
|
|
151
151
|
? { workItem: { tid: item.TID, did: item.DID, name, wfParticipants: participantUsers } }
|
|
152
|
-
: { document: { tid: item.TID, did: item.DID, name } });
|
|
152
|
+
: { document: { tid: item.TID, did: item.DID, name } }, onTaskCreated);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
catch (error) {
|
|
@@ -362,8 +362,12 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
362
362
|
_jsx(ToppyHelpCenter, { deviceType: deviceType,
|
|
363
363
|
// onClick={() => isMobile ? openConfigureMode?.() : undefined}
|
|
364
364
|
content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => {
|
|
365
|
-
|
|
366
|
-
|
|
365
|
+
const vid = focusedItem ? focusedItem?.TID : selectedItems[0]?.TID;
|
|
366
|
+
const did = focusedItem ? focusedItem?.DID : selectedItems[0]?.DID;
|
|
367
|
+
openTaskFormHandler((task) => {
|
|
368
|
+
task?.id &&
|
|
369
|
+
SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_MoreInfoAsync(vid, did, task.id);
|
|
370
|
+
});
|
|
367
371
|
}, approveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {})] }), [
|
|
368
372
|
searchResults,
|
|
369
373
|
selectedSearchResult,
|
|
@@ -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: (
|
|
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>;
|
|
@@ -114,9 +114,7 @@ export const getCommandsMenuItems = (dtd, selectedItems, focusedItem, context, s
|
|
|
114
114
|
text: SDKUI_Localizator.CreateContextualTask,
|
|
115
115
|
operationType: 'singleRow',
|
|
116
116
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
117
|
-
onClick:
|
|
118
|
-
openTaskFormHandler(true);
|
|
119
|
-
}
|
|
117
|
+
onClick: () => { openTaskFormHandler(); }
|
|
120
118
|
}] : []),
|
|
121
119
|
{
|
|
122
120
|
icon: svgToString(_jsx(IconDownload, {})),
|
|
@@ -496,16 +496,19 @@ const TMBlogs = (props) => {
|
|
|
496
496
|
color: isSelected ? "#fff" : !blogPost.isSys ? TMColors.primary : colors.RED
|
|
497
497
|
}, children: highlightText(blogPost.ownerName ?? '', searchText, isSelected) }), (blogPost?.newPosts ?? 0) > 0 && (_jsx("div", { style: {
|
|
498
498
|
marginLeft: "5px",
|
|
499
|
-
|
|
499
|
+
minWidth: "20px",
|
|
500
500
|
height: "20px",
|
|
501
|
+
padding: "0 6px",
|
|
501
502
|
display: "flex",
|
|
502
503
|
alignItems: "center",
|
|
503
504
|
justifyContent: "center",
|
|
504
|
-
backgroundColor: color,
|
|
505
|
-
color: "
|
|
505
|
+
backgroundColor: isSelected ? '#fff' : color,
|
|
506
|
+
color: isSelected ? color : "#fff",
|
|
506
507
|
boxShadow: "1px 1px 2px #00000020",
|
|
507
508
|
borderRadius: "30px",
|
|
508
509
|
fontWeight: "bold",
|
|
510
|
+
fontSize: "12px",
|
|
511
|
+
whiteSpace: "nowrap",
|
|
509
512
|
}, children: blogPost.newPosts }))] }), _jsxs("div", { style: { fontSize: 'calc(1rem - 1px)', color: isSelected ? "#fff" : !blogPost.isSys ? TMColors.primary : colors.RED }, children: [(showIconHeader && (blogPost.header && blogPost.classID)) && _jsxs("span", { style: { marginLeft: showIconHeader ? "5px" : "0" }, children: [blogPost.ownerName, _jsx("span", { style: { margin: "0 5px" }, children: "\u2501" })] }), blogPost.creationTime
|
|
510
513
|
? highlightText(SDKUI_Localizator.WrittenOn + " " + `${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString() ? "(" + SDKUI_Localizator.Today + ")" : ''}`, searchText, isSelected)
|
|
511
514
|
: '', localShowId && _jsxs("span", { children: [_jsx("span", { style: { margin: "0 5px" }, children: "\u2501" }), _jsxs("span", { children: ["(ID: ", blogPost.id, ")"] })] })] })] }), (blogPost.attachments && showExtendedAttachments === false) &&
|