@topconsultnpm/sdkui-react-beta 6.15.89 → 6.15.90
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/TMDcmtForm.d.ts +3 -1
- package/lib/components/features/documents/TMDcmtForm.js +3 -3
- package/lib/components/features/search/TMSearch.d.ts +4 -0
- package/lib/components/features/search/TMSearch.js +3 -3
- package/lib/components/features/search/TMSearchResult.d.ts +1 -0
- package/lib/components/features/search/TMSearchResult.js +5 -4
- package/lib/components/forms/TMChooserForm.js +2 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { LayoutModes, TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
|
-
import { FormModes, TaskContext } from '../../../ts';
|
|
3
|
+
import { DcmtInfo, FormModes, TaskContext } from '../../../ts';
|
|
4
4
|
interface ITMDcmtFormProps {
|
|
5
5
|
TID?: number;
|
|
6
6
|
DID?: number;
|
|
@@ -38,6 +38,8 @@ interface ITMDcmtFormProps {
|
|
|
38
38
|
mid: number;
|
|
39
39
|
value: string;
|
|
40
40
|
}>;
|
|
41
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>) => void;
|
|
42
|
+
s4TViewerDialogComponent?: React.ReactNode;
|
|
41
43
|
}
|
|
42
44
|
declare const TMDcmtForm: React.FC<ITMDcmtFormProps>;
|
|
43
45
|
export default TMDcmtForm;
|
|
@@ -36,7 +36,7 @@ import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
|
36
36
|
import WFDiagram from '../workflow/diagram/WFDiagram';
|
|
37
37
|
let abortControllerLocal = new AbortController();
|
|
38
38
|
//#endregion
|
|
39
|
-
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], }) => {
|
|
39
|
+
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], onOpenS4TViewerRequest, s4TViewerDialogComponent }) => {
|
|
40
40
|
const [id, setID] = useState('');
|
|
41
41
|
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
42
42
|
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
@@ -701,7 +701,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
701
701
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
702
702
|
}));
|
|
703
703
|
} }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, TID: approvalVID, DID: DID, onClose: () => setShowMoreInfoPopup(false) }), (isModal && onClose) && _jsx("div", { id: "TMDcmtFormShowConfirmForClose-" + id })] }), showToppyForApprove && (_jsx(ToppyHelpCenter, { deviceType: deviceType, usePortal: false, content: workItems.length === 1 ?
|
|
704
|
-
_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () =>
|
|
704
|
+
_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: (onOpenS4TViewerRequest && TID && DID) ? () => onOpenS4TViewerRequest([{ TID, DID }]) : undefined, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true) }) })
|
|
705
705
|
:
|
|
706
706
|
_jsxs("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: [`Devi approvare ${workItems.length} workitem(s) per questo documento.`, `Vai alla sezione di approvazione.`] }) })), showToppyForCompleteMoreInfo && (_jsx(ToppyHelpCenter, { deviceType: deviceType, usePortal: false, content: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: 10 }, children: [_jsx("div", { style: { padding: 10, color: 'white', maxWidth: '180px', borderRadius: 10, background: '#1B1464 0% 0% no-repeat padding-box', border: '1px solid #FFFFFF' }, children: `${SDKUI_Localizator.MoreInfoCompleteRequestSentBy} ${taskMoreInfo?.fromName}!` }), _jsx(TMButton, { caption: SDKUI_Localizator.CommentAndComplete, color: 'success', showTooltip: false, onClick: () => {
|
|
707
707
|
setShowCommentForm(true);
|
|
@@ -710,7 +710,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
710
710
|
_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenDetails(false) }) }), isOpenMaster &&
|
|
711
711
|
_jsxs(StyledModalContainer, { style: { backgroundColor: 'white' }, children: [_jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: allowNavigation, canNext: canNext, canPrev: canPrev, onNext: onNext, onPrev: onPrev, onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
|
|
712
712
|
return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem }) }, `${index}-${dcmt.DID}`));
|
|
713
|
-
})] }), taskFormDialogComponent] }));
|
|
713
|
+
})] }), taskFormDialogComponent, s4TViewerDialogComponent] }));
|
|
714
714
|
};
|
|
715
715
|
return (_jsx(_Fragment, { children: (isModal && onClose)
|
|
716
716
|
? _jsx(TMModal, { title: titleModal, onClose: handleClose, width: widthModal ?? '100%', height: heightModal ?? '100%', hidePopup: false, askClosingConfirm: true, children: _jsx("div", { style: { width: "100%", height: "100%", display: 'block', padding: "4px", position: 'relative' }, children: renderDcmtForm() }) })
|
|
@@ -3,6 +3,7 @@ import { DcmtTypeDescriptor, TaskDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
|
3
3
|
import { DcmtInfo, TaskContext } from '../../../ts';
|
|
4
4
|
import { TMSearchResultFloatingActionConfig } from './TMSearchResultFloatingActionButton';
|
|
5
5
|
interface ITMSearchProps {
|
|
6
|
+
isVisible?: boolean;
|
|
6
7
|
inputTID?: number;
|
|
7
8
|
inputSqdID?: number;
|
|
8
9
|
isExpertMode?: boolean;
|
|
@@ -11,6 +12,9 @@ interface ITMSearchProps {
|
|
|
11
12
|
onFileOpened?: (dcmtFile: File | undefined) => void;
|
|
12
13
|
onTaskCreateRequest?: (taskContext: TaskContext, onTaskCreated?: (task?: TaskDescriptor) => void) => void;
|
|
13
14
|
openWGsCopyMoveForm?: (mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void;
|
|
15
|
+
openS4TViewer?: boolean;
|
|
16
|
+
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>) => void;
|
|
17
|
+
showTodoDcmtForm?: boolean;
|
|
14
18
|
}
|
|
15
19
|
declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
|
|
16
20
|
export default TMSearch;
|
|
@@ -18,7 +18,7 @@ var TMSearchViews;
|
|
|
18
18
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
19
19
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
20
20
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
21
|
-
const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm }) => {
|
|
21
|
+
const TMSearch = ({ isVisible, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm }) => {
|
|
22
22
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
23
23
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
24
24
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -196,13 +196,13 @@ const TMSearch = ({ inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSetti
|
|
|
196
196
|
toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
|
|
197
197
|
}
|
|
198
198
|
], [tmTreeSelectorElement, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs]);
|
|
199
|
-
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), _jsx(TMSearchResult, { isVisible: currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
|
199
|
+
return (_jsxs(_Fragment, { children: [_jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }) }), _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync: async () => {
|
|
200
200
|
let newResult = await refreshLastSearch(lastQdSearched) ?? [];
|
|
201
201
|
setSearchResult(newResult);
|
|
202
202
|
if (newResult.length <= 0) {
|
|
203
203
|
setCurrentSearchView(TMSearchViews.Search);
|
|
204
204
|
}
|
|
205
|
-
}, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm })] }));
|
|
205
|
+
}, onClose: () => { setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, showTodoDcmtForm: showTodoDcmtForm })] }));
|
|
206
206
|
};
|
|
207
207
|
export default TMSearch;
|
|
208
208
|
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
@@ -32,6 +32,7 @@ interface ITMSearchResultProps {
|
|
|
32
32
|
openAddDocumentForm?: () => void;
|
|
33
33
|
openS4TViewer?: boolean;
|
|
34
34
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>) => void;
|
|
35
|
+
showTodoDcmtForm?: boolean;
|
|
35
36
|
}
|
|
36
37
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
37
38
|
export default TMSearchResult;
|
|
@@ -53,7 +53,7 @@ const orderByName = (array) => {
|
|
|
53
53
|
return 1;
|
|
54
54
|
} return 0; });
|
|
55
55
|
};
|
|
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 }) => {
|
|
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, showTodoDcmtForm = false }) => {
|
|
57
57
|
const [id, setID] = useState('');
|
|
58
58
|
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
59
59
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
@@ -377,8 +377,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
377
377
|
setIsOpenBatchUpdate(false);
|
|
378
378
|
setIsModifiedBatchUpdate(false);
|
|
379
379
|
await refreshSelectionDataRowsAsync();
|
|
380
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer) &&
|
|
381
|
-
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: () => onOpenS4TViewerRequest
|
|
380
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm) &&
|
|
381
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: onOpenS4TViewerRequest ? () => onOpenS4TViewerRequest(getSelectedDcmtsOrFocused(selectedItems, focusedItem)) : undefined, 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 })] }), [
|
|
382
382
|
searchResults,
|
|
383
383
|
selectedSearchResult,
|
|
384
384
|
lastUpdateSearchTime,
|
|
@@ -398,7 +398,8 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
398
398
|
showToppyForApprove,
|
|
399
399
|
floatingActionConfig,
|
|
400
400
|
disableAccordionIfSingleCategory,
|
|
401
|
-
getTitleHeader
|
|
401
|
+
getTitleHeader,
|
|
402
|
+
openS4TViewer
|
|
402
403
|
]);
|
|
403
404
|
const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID }), [focusedItem]);
|
|
404
405
|
const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [focusedItem, currentMetadataValues, deviceType]);
|
|
@@ -86,8 +86,8 @@ const TMChooserForm = ({ children, title, allowMultipleSelection = false, allowA
|
|
|
86
86
|
...summaryItems ?? {}
|
|
87
87
|
});
|
|
88
88
|
}, [manageUseLocalizedName, summaryItems]);
|
|
89
|
-
return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: children ??
|
|
90
|
-
filteredItems.length > 0
|
|
89
|
+
return (_jsx(TMModal, { title: renderTitle(), width: width ?? '550px', height: height ?? '600px', toolbar: _jsx(ToolbarButtons, {}), onClose: onClose, children: (children ??
|
|
90
|
+
filteredItems.length > 0)
|
|
91
91
|
? _jsx(TMDataGrid, { dataSource: filteredItems, keyExpr: keyName, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selectedRowKeys: selectedRowKeys, headerFilter: { visible: true }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single', showCheckBoxesMode: 'always', selectAllMode: 'allPages' }, grouping: allowGrouping ? { autoExpandAll: false, expandMode: 'rowClick' } : undefined, summary: customSummary, onFocusedRowChanged: handleFocusedRowChange, onSelectionChanged: handleSelectionChanged, onRowDblClick: handleRowDoubleClick })
|
|
92
92
|
: _jsx(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: _jsx(TMLayoutItem, { children: _jsx("p", { style: { height: "100%", color: TMColors.primaryColor, fontSize: "1.5rem", display: 'flex', alignItems: 'center', justifyContent: 'center' }, children: SDKUI_Localizator.NoDataToDisplay }) }) }) }));
|
|
93
93
|
};
|