@topconsultnpm/sdkui-react 6.19.0-dev2.12 → 6.19.0-dev2.14
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/TMSearchQueryPanel.js +8 -25
- package/lib/components/features/search/TMSearchResult.js +5 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.js +34 -6
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -317,31 +317,14 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
317
317
|
: _jsx(_Fragment, {}) }), children: [_jsx(ConfirmQueryParamsDialog, {}), SQD
|
|
318
318
|
? _jsxs("div", { style: { height: '100%', width: '100%', position: 'relative', display: 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
|
|
319
319
|
? _jsx(TMQueryEditor, { formMode: FormModes.Update, showToolbar: false, inputData: qd, validateSelect: true, showApply: false, onQDChanged: handleQdChanged })
|
|
320
|
-
: _jsx(TMSearchQueryEditor, { qd: qd, dcmtTypesList: dcmtTypesList, isExpertMode: isExpertMode, showAllMdWhere: showAllMdWhere, onQdChanged: handleQdChanged, onFocusedMetadataChanged: setFocusedTidMid, onAdvancedMenuClick: handleAdvancedMenuClick }),
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
boxSizing: 'border-box'
|
|
329
|
-
}, children: [_jsxs("div", { style: {
|
|
330
|
-
display: 'flex',
|
|
331
|
-
justifyContent: 'center',
|
|
332
|
-
alignItems: 'center',
|
|
333
|
-
gap: '10px',
|
|
334
|
-
flex: '1 1 auto',
|
|
335
|
-
minWidth: 0,
|
|
336
|
-
}, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, width: '90px', caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: handleSearchButtonClick }), _jsx(TMButton, { width: '90px', btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters })] }), (!showAdvancedSearch && qd?.where && qd.where.length > initialMaxItems) && (_jsx("div", { style: { flex: '0 0 auto' }, children: _jsx(TMButton, { width: '120px', btnStyle: isMobile ? 'icon' : 'advanced', advancedColor: TMColors.button_primary, caption: captionText, showTooltip: false, icon: isMobile ? (_jsx("div", { style: {
|
|
337
|
-
backgroundColor: TMColors.button_primary,
|
|
338
|
-
minWidth: '30px',
|
|
339
|
-
minHeight: '30px',
|
|
340
|
-
borderRadius: '10px',
|
|
341
|
-
display: 'flex',
|
|
342
|
-
alignItems: 'center',
|
|
343
|
-
justifyContent: 'center',
|
|
344
|
-
}, children: _jsx("p", { style: { color: 'white', margin: 0 }, children: showAllMdWhere ? `-${diff}` : `+${diff}` }) })) : (_jsx("p", { style: { color: 'white', margin: 0 }, children: showAllMdWhere ? `-${diff}` : `+${diff}` })), onClick: () => setShowAllMdWhere(!showAllMdWhere) }) }))] }) }), showFiltersConfig &&
|
|
320
|
+
: _jsx(TMSearchQueryEditor, { qd: qd, dcmtTypesList: dcmtTypesList, isExpertMode: isExpertMode, showAllMdWhere: showAllMdWhere, onQdChanged: handleQdChanged, onFocusedMetadataChanged: setFocusedTidMid, onAdvancedMenuClick: handleAdvancedMenuClick }), _jsxs("div", { style: {
|
|
321
|
+
display: 'flex',
|
|
322
|
+
flexWrap: 'wrap',
|
|
323
|
+
justifyContent: 'center',
|
|
324
|
+
alignItems: 'center',
|
|
325
|
+
gap: '10px',
|
|
326
|
+
width: '100%'
|
|
327
|
+
}, children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconSearch, {}), showTooltip: false, width: '90px', caption: SDKUI_Localizator.Search, advancedColor: '#4A96D2', onClick: handleSearchButtonClick }), _jsx(TMButton, { width: '90px', btnStyle: 'advanced', advancedType: 'primary', showTooltip: false, caption: SDKUI_Localizator.Clear, icon: _jsx(IconClear, {}), advancedColor: 'white', color: 'primaryOutline', onClick: clearFilters }), (!showAdvancedSearch && qd?.where && qd.where.length > initialMaxItems) && (_jsx(TMButton, { width: '120px', btnStyle: isMobile ? 'icon' : 'advanced', advancedColor: TMColors.button_primary, caption: captionText, showTooltip: false, icon: isMobile ? (_jsx("div", { children: _jsx("p", { children: showAllMdWhere ? `-${diff}` : `+${diff}` }) })) : (_jsx("p", { children: showAllMdWhere ? `-${diff}` : `+${diff}` })), onClick: () => setShowAllMdWhere(!showAllMdWhere) }))] }), showFiltersConfig &&
|
|
345
328
|
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.where?.map((w) => ({ tid: w.tid, mid: w.mid })), onClose: handleCloseFiltersConfig, onChoose: handleChooseFilters }), showOutputConfig &&
|
|
346
329
|
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.select?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOutputConfig, onChoose: handleChooseOutput }), showOrderByConfig &&
|
|
347
330
|
_jsx(TMMetadataChooserForm, { allowMultipleSelection: true, height: '500px', width: '600px', allowSysMetadata: true, qd: qd, selectedIDs: qd?.orderBy?.map((item) => ({ tid: item.tid, mid: item.mid })), onClose: handleCloseOrderByConfig, onChoose: handleChooseOrderBy })] })
|
|
@@ -331,7 +331,8 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
331
331
|
.then(async () => {
|
|
332
332
|
await downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download");
|
|
333
333
|
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
334
|
-
await refreshSelectionDataRowsAsync();
|
|
334
|
+
// await refreshSelectionDataRowsAsync();
|
|
335
|
+
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
335
336
|
})
|
|
336
337
|
.catch((error) => {
|
|
337
338
|
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
@@ -341,7 +342,9 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
341
342
|
else {
|
|
342
343
|
await ue.UndoCheckOutAsync()
|
|
343
344
|
.then(async () => {
|
|
344
|
-
|
|
345
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
346
|
+
// await refreshSelectionDataRowsAsync();
|
|
347
|
+
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
345
348
|
})
|
|
346
349
|
.catch((error) => {
|
|
347
350
|
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
@@ -3,6 +3,7 @@ import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes, WorkingGr
|
|
|
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 getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
|
|
6
7
|
export declare const signatureInformationCallback: (isMobile: boolean, inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
|
|
7
8
|
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<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, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, handleCheckOutOperationCallback: (checkout: boolean) => Promise<void>, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void, passToArchiveCallback?: (outputMids: Array<{
|
|
8
9
|
mid: number;
|
|
@@ -40,8 +40,21 @@ const getCicoInfo = (dtd) => {
|
|
|
40
40
|
}
|
|
41
41
|
return cico;
|
|
42
42
|
};
|
|
43
|
-
const cicoIsEnabled = (
|
|
44
|
-
|
|
43
|
+
const cicoIsEnabled = (dcmt, dtd) => {
|
|
44
|
+
const cicoInfo = getCicoInfo(dtd);
|
|
45
|
+
let isCheckout = false;
|
|
46
|
+
const CICO_CheckoutUserID = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID)?.id;
|
|
47
|
+
if (dcmt && CICO_CheckoutUserID) {
|
|
48
|
+
const key = dcmt.TID + "_" + CICO_CheckoutUserID;
|
|
49
|
+
const value = dcmt[key];
|
|
50
|
+
if (value && value > 0) {
|
|
51
|
+
isCheckout = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes,
|
|
56
|
+
isCheckout: isCheckout
|
|
57
|
+
};
|
|
45
58
|
};
|
|
46
59
|
const disabledForSingleRow = (selectedItems, focusedItem) => {
|
|
47
60
|
return selectedItems.length > 1 || focusedItem === undefined;
|
|
@@ -61,6 +74,17 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
|
61
74
|
}
|
|
62
75
|
return [];
|
|
63
76
|
};
|
|
77
|
+
export const getAllFieldSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat) => {
|
|
78
|
+
if (selectedItems.length <= 0 && !focusedItem)
|
|
79
|
+
return [];
|
|
80
|
+
if (selectedItems.length > 0) {
|
|
81
|
+
return selectedItems;
|
|
82
|
+
}
|
|
83
|
+
else if (focusedItem !== undefined) {
|
|
84
|
+
return [focusedItem];
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
};
|
|
64
88
|
export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
65
89
|
try {
|
|
66
90
|
if (!inputDcmts || inputDcmts.length === 0) {
|
|
@@ -333,23 +357,27 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
333
357
|
};
|
|
334
358
|
};
|
|
335
359
|
const checkinMenuItem = () => {
|
|
336
|
-
|
|
360
|
+
// Get the currently selected or focused documents
|
|
361
|
+
const selectedDocs = getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
362
|
+
// Take the first document (used for validation checks)
|
|
363
|
+
const firstDoc = selectedDocs?.[0];
|
|
364
|
+
const { cicoEnabled, isCheckout } = cicoIsEnabled(firstDoc, dtd);
|
|
337
365
|
return {
|
|
338
366
|
icon: svgToString(_jsx(IconFileDots, {})),
|
|
339
367
|
text: "Check in/Check out",
|
|
340
|
-
disabled: !
|
|
368
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
341
369
|
items: [
|
|
342
370
|
{
|
|
343
371
|
icon: "edit",
|
|
344
372
|
text: 'Check out',
|
|
345
|
-
disabled: !
|
|
373
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
346
374
|
// disabled: isNotSingleFile || isGroupLocked || isFileCheckedOut,
|
|
347
375
|
onClick: () => handleCheckOutOperationCallback(true),
|
|
348
376
|
},
|
|
349
377
|
{
|
|
350
378
|
icon: "remove",
|
|
351
379
|
text: SDKUI_Localizator.CancelCheckOut,
|
|
352
|
-
disabled: !
|
|
380
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
353
381
|
// disabled: isNotSingleFile || isGroupLocked || isFileNotCheckedOut || isNotCheckedOutByCurrentUser,
|
|
354
382
|
onClick: () => handleCheckOutOperationCallback(false),
|
|
355
383
|
},
|
|
@@ -76,7 +76,8 @@ const TMPanelManagerToolbar = (props) => {
|
|
|
76
76
|
const isActive = panelVisibility[visibleLeafPanel.id];
|
|
77
77
|
const isDisabled = toolbarButtonsDisabled[visibleLeafPanel.id];
|
|
78
78
|
const count = visibleLeafPanel.toolbarOptions?.count ?? 0;
|
|
79
|
-
|
|
79
|
+
const tooltip = visibleLeafPanel.toolbarOptions?.tooltip ?? '';
|
|
80
|
+
return _jsx(TMTooltip, { content: tooltip || (visibleLeafPanel.name + (count > 0 ? ": " + count : '')), position: isMobile ? 'top' : 'left', children: _jsxs(StyledToolbarButton, { disabled: isDisabled, "$isDisabled": isDisabled, onClick: () => onClickCallback(visibleLeafPanel.id, isActive), "$isActive": isActive || visibleLeafPanel.toolbarOptions?.alwaysActiveColor, children: [typeof visibleLeafPanel.toolbarOptions?.icon === 'string' ? (_jsx("i", { className: `dx-icon dx-icon-${visibleLeafPanel.toolbarOptions?.icon}` })) : (visibleLeafPanel.toolbarOptions?.icon), (!isActive && count > 0) && _jsxs(Badge, { "$background": visibleLeafPanel.toolbarOptions?.countBackgroundColor, children: [" ", formatCount(count), " "] })] }, visibleLeafPanel.id) }, visibleLeafPanel.id);
|
|
80
81
|
}) }));
|
|
81
82
|
};
|
|
82
83
|
export default TMPanelManagerToolbar;
|