@topconsultnpm/sdkui-react-beta 6.15.74 → 6.15.75

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.
@@ -30,6 +30,8 @@ interface ITMSearchResultProps {
30
30
  openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
31
31
  openCommentFormCallback?: (documents: Array<DcmtInfo>) => void;
32
32
  openAddDocumentForm?: () => void;
33
+ openS4TViewer?: boolean;
34
+ onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>) => void;
33
35
  }
34
36
  declare const TMSearchResult: React.FC<ITMSearchResultProps>;
35
37
  export default TMSearchResult;
@@ -32,7 +32,6 @@ import TMDcmtBlog from '../documents/TMDcmtBlog';
32
32
  import TMDcmtIcon from '../documents/TMDcmtIcon';
33
33
  import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
34
34
  import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
35
- import ShowAlert from '../../base/TMAlert';
36
35
  import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
37
36
  import TMAccordion from '../../base/TMAccordion';
38
37
  import TMDataGridExportForm from '../../base/TMDataGridExportForm';
@@ -54,7 +53,7 @@ const orderByName = (array) => {
54
53
  return 1;
55
54
  } return 0; });
56
55
  };
57
- const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm }) => {
56
+ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest }) => {
58
57
  const [id, setID] = useState('');
59
58
  const [showApprovePopup, setShowApprovePopup] = useState(false);
60
59
  const [showRejectPopup, setShowRejectPopup] = useState(false);
@@ -87,9 +86,13 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
87
86
  const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync } = useDcmtOperations();
88
87
  const deviceType = useDeviceType();
89
88
  const isMobile = deviceType === DeviceType.MOBILE;
90
- let disable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 0;
91
- let dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
92
- let dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
89
+ const disable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 0;
90
+ // Disable the "Sign/Approve" button if:
91
+ // 1. No document or multiple documents are selected, OR
92
+ // 2. Exactly one document is selected but its FILEEXT property is null
93
+ const disableSignApproveDisable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 || (getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 1 && getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].FILEEXT === null);
94
+ const dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
95
+ const dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
93
96
  useEffect(() => { setID(genUniqueId()); }, []);
94
97
  useEffect(() => {
95
98
  setSelectedItems([]);
@@ -370,8 +373,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
370
373
  setIsOpenBatchUpdate(false);
371
374
  setIsModifiedBatchUpdate(false);
372
375
  await refreshSelectionDataRowsAsync();
373
- }, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup &&
374
- _jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => ShowAlert({ message: 'TODO', mode: 'info', title: SDKUI_Localizator.SignatureAndApprove, duration: 3000 }), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
376
+ }, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer) &&
377
+ _jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => onOpenS4TViewerRequest?.(getSelectedDcmtsOrFocused(selectedItems, focusedItem)), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true), approveDisable: disable, signApproveDisable: disableSignApproveDisable, rejectDisable: disable, reassignDisable: disable, infoDisable: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
375
378
  searchResults,
376
379
  selectedSearchResult,
377
380
  lastUpdateSearchTime,
@@ -59,7 +59,7 @@ const StyledHorizontalContainer = styled.div `
59
59
  `;
60
60
  export const WorkFlowOperationButtons = ({ deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, reassignDisable = false, rejectDisable = false, infoDisable = false, onApprove, onSignApprove, onReAssign, onReject, onMoreInfo }) => {
61
61
  const isMobile = deviceType === DeviceType.MOBILE;
62
- return (_jsxs(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: TMColors.success, color: 'success' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignature, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: '160px', disabled: approveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), advancedColor: TMColors.success, color: 'success' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: 'error' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: 'tertiary' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: '180px', disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: 'info' })] }));
62
+ return (_jsxs(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: TMColors.success, color: 'success' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignature, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: '160px', disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), advancedColor: TMColors.success, color: 'success' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: 'error' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: 'tertiary' }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: '180px', disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: 'info' })] }));
63
63
  };
64
64
  export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = DeviceType.DESKTOP, isReject, selectedItems = [], onClose, onCompleted }) => {
65
65
  const [commentValue, setCommentValue] = useState('');
@@ -76,7 +76,7 @@ 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
- return _jsx(StyledToolbarButton, { disabled: isDisabled, "$isDisabled": isDisabled, onClick: () => onClickCallback(visibleLeafPanel.id, isActive), "$isActive": isActive || visibleLeafPanel.toolbarOptions?.alwaysActiveColor, children: _jsxs(TMTooltip, { content: visibleLeafPanel.name + (count > 0 ? ": " + count : ''), position: isMobile ? 'top' : 'left', children: [typeof visibleLeafPanel.toolbarOptions?.icon === 'string' ? (_jsx("i", { className: `dx-icon dx-icon-${visibleLeafPanel.toolbarOptions?.icon}` })) : (visibleLeafPanel.toolbarOptions?.icon), (!isActive && count > 0) && _jsxs(Badge, { children: [" ", formatCount(count), " "] })] }, visibleLeafPanel.id) });
79
+ return _jsx(TMTooltip, { content: 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, { children: [" ", formatCount(count), " "] })] }, visibleLeafPanel.id) }, visibleLeafPanel.id);
80
80
  }) }));
81
81
  };
82
82
  export default TMPanelManagerToolbar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react-beta",
3
- "version": "6.15.74",
3
+ "version": "6.15.75",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",