@topconsultnpm/sdkui-react-beta 6.15.19 → 6.15.20
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/TMFileManager.js +8 -12
- package/lib/components/choosers/TMDiskChooser.js +1 -1
- package/lib/components/features/search/TMSearchResult.js +2 -2
- package/lib/components/features/search/TMSearchResultFloatingActionButton.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultFloatingActionButton.js +5 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +2 -2
- package/package.json +1 -1
|
@@ -206,20 +206,17 @@ const highlightText = (text, searchText, isSelected) => {
|
|
|
206
206
|
};
|
|
207
207
|
const DetailsView = (props) => {
|
|
208
208
|
const { userID, items, focusedFile, selectedFiles, searchText = '', handleFocusedFile, handleSelectedFiles, onDoubleClickHandler, fileContextMenuItems = [] } = props;
|
|
209
|
-
const
|
|
210
|
-
return _jsx("div", { children: highlightText(cellData.value, searchText, false) });
|
|
211
|
-
}, [searchText]);
|
|
212
|
-
const cellExtRender = (cellData) => {
|
|
213
|
-
const data = cellData.data;
|
|
214
|
-
return _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, children: getFileIcon(data.ext, data.version) });
|
|
215
|
-
};
|
|
216
|
-
const cellEditOrLockRender = (cellData) => {
|
|
209
|
+
const cellNameRender = useCallback((cellData) => {
|
|
217
210
|
const { checkoutDate, checkOutUserID, checkOutUserName, version, ext, creationTime, lastUpdateTime } = cellData.data;
|
|
218
211
|
const checkoutUsedId = checkOutUserID;
|
|
219
212
|
const editMode = checkoutDate && checkoutUsedId && userID && userID === checkoutUsedId;
|
|
220
213
|
const lockMode = checkoutDate && checkoutUsedId && userID && userID !== checkoutUsedId;
|
|
221
214
|
const editLockTooltipText = _jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [editMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), lockMode && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", checkOutUserName ?? '-', " (ID: ", checkOutUserID, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version ?? 1] }) }), _jsx("hr", {}), _jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Type }), ": ", ext] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.CreationTime }), ": ", Globalization.getDateTimeDisplayValue(creationTime?.toString())] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.LastUpdateTime }), ": ", Globalization.getDateTimeDisplayValue(lastUpdateTime?.toString())] })] })] })] });
|
|
222
|
-
return _jsxs(
|
|
215
|
+
return _jsxs("div", { style: { display: "inline-flex", alignItems: "center", gap: "4px" }, children: [editMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-edit" }) }), lockMode && _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: "#28a745", fontWeight: "bold" }, className: "dx-icon-lock" }) }), highlightText(cellData.value, searchText, false)] });
|
|
216
|
+
}, [searchText]);
|
|
217
|
+
const cellExtRender = (cellData) => {
|
|
218
|
+
const data = cellData.data;
|
|
219
|
+
return _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, children: getFileIcon(data.ext, data.version) });
|
|
223
220
|
};
|
|
224
221
|
const cellDatetimeRender = useCallback((cellData) => {
|
|
225
222
|
const { value } = cellData;
|
|
@@ -229,9 +226,8 @@ const DetailsView = (props) => {
|
|
|
229
226
|
const dataColumns = useMemo(() => {
|
|
230
227
|
return [
|
|
231
228
|
{ dataField: "id", caption: "ID", dataType: 'string', visible: false },
|
|
232
|
-
{ dataField: "ext", caption:
|
|
233
|
-
{ dataField: "
|
|
234
|
-
{ dataField: "name", caption: SDKUI_Localizator.Name, cellRender: cellDefaultRender },
|
|
229
|
+
{ dataField: "ext", caption: "", cellRender: cellExtRender },
|
|
230
|
+
{ dataField: "name", caption: SDKUI_Localizator.Name, cellRender: cellNameRender },
|
|
235
231
|
{ dataField: "version", caption: SDKUI_Localizator.Version },
|
|
236
232
|
{ dataField: "size", caption: SDKUI_Localizator.Size, cellRender: (cellData) => formatBytes(cellData.data.size ?? 0) },
|
|
237
233
|
{ dataField: "updaterName", caption: SDKUI_Localizator.Author },
|
|
@@ -28,7 +28,7 @@ const cellRenderIcon = () => _jsx(IconDisk, { color: '#767676' });
|
|
|
28
28
|
export const TMDiskChooserForm = (props) => {
|
|
29
29
|
const getItems = async (refreshCache) => {
|
|
30
30
|
TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.Disks} ...` });
|
|
31
|
-
let items = await SDK_Globals.tmSession?.NewDiskEngine().RetrieveAllAdminAsync();
|
|
31
|
+
let items = await SDK_Globals.tmSession?.NewDiskEngine().RetrieveAllAdminAsync(true);
|
|
32
32
|
TMSpinner.hide();
|
|
33
33
|
return items ?? [];
|
|
34
34
|
};
|
|
@@ -370,13 +370,13 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
370
370
|
};
|
|
371
371
|
const showToppyForApprove = (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster);
|
|
372
372
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
373
|
-
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound })] })
|
|
373
|
+
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
374
374
|
:
|
|
375
375
|
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: SDKUI_Globals.userSettings.themeSettings.gutters, separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
|
376
376
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
377
377
|
:
|
|
378
378
|
_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), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
379
|
-
_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(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm) })] })] })
|
|
379
|
+
_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(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm) })] })] })] }), 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) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
380
380
|
setIsOpenBatchUpdate(false);
|
|
381
381
|
}, onSavedCallbackAsync: async () => {
|
|
382
382
|
setIsOpenBatchUpdate(false);
|
|
@@ -6,7 +6,7 @@ export interface TMSearchResultFloatingActionConfig {
|
|
|
6
6
|
type?: 'single' | 'multi';
|
|
7
7
|
tooltip?: React.ReactNode;
|
|
8
8
|
iconElement?: React.ReactNode;
|
|
9
|
-
onClick?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => void
|
|
9
|
+
onClick?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => void | Promise<void>;
|
|
10
10
|
}
|
|
11
11
|
interface TMSearchResultFloatingActionButtonProps {
|
|
12
12
|
selectedDcmtsOrFocused: Array<DcmtInfo>;
|
|
@@ -41,6 +41,10 @@ export const TMSearchResultFloatingActionButton = (props) => {
|
|
|
41
41
|
e.currentTarget.style.transform = 'scale(1)';
|
|
42
42
|
e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
|
|
43
43
|
}
|
|
44
|
-
}, onClick: () =>
|
|
44
|
+
}, onClick: async () => {
|
|
45
|
+
if (config.onClick) {
|
|
46
|
+
await config.onClick(selectedDcmtsOrFocused);
|
|
47
|
+
}
|
|
48
|
+
}, children: _jsx(TMTooltip, { content: tooltip, children: iconElement || _jsx("i", { className: "dx-icon-add", style: { fontSize: '25px' } }) }) });
|
|
45
49
|
};
|
|
46
50
|
export default TMSearchResultFloatingActionButton;
|
|
@@ -426,7 +426,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
426
426
|
text: SDKUI_Localizator.Comment,
|
|
427
427
|
operationType: 'multiRow',
|
|
428
428
|
visible: workingGroupContext !== undefined && openCommentFormCallback !== undefined,
|
|
429
|
-
disabled: workingGroupContext === undefined,
|
|
429
|
+
disabled: workingGroupContext === undefined || disabledForMultiRow(selectedItems, focusedItem),
|
|
430
430
|
onClick: () => openCommentFormCallback && openCommentFormCallback(getSelectedDcmtsOrFocused(selectedItems, focusedItem)),
|
|
431
431
|
beginGroup: true,
|
|
432
432
|
},
|
|
@@ -435,7 +435,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
435
435
|
text: SDKUI_Localizator.Remove,
|
|
436
436
|
operationType: 'multiRow',
|
|
437
437
|
visible: workingGroupContext !== undefined,
|
|
438
|
-
disabled: workingGroupContext === undefined,
|
|
438
|
+
disabled: workingGroupContext === undefined || disabledForMultiRow(selectedItems, focusedItem),
|
|
439
439
|
onClick: async () => {
|
|
440
440
|
let dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
441
441
|
if (workingGroupContext)
|