@topconsultnpm/sdkui-react 6.19.0-dev1.15 → 6.19.0-dev1.16
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.
|
@@ -990,7 +990,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
990
990
|
value: FormulaHelper.addFormulaTag(newFormula.expression)
|
|
991
991
|
}));
|
|
992
992
|
} }), 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 ?
|
|
993
|
-
_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true)
|
|
993
|
+
_jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), onMoreInfo: () => setShowMoreInfoPopup(true) }) })
|
|
994
994
|
:
|
|
995
995
|
_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: () => {
|
|
996
996
|
setShowCommentForm(true);
|
|
@@ -109,11 +109,11 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
109
109
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync } = useDcmtOperations();
|
|
110
110
|
const deviceType = useDeviceType();
|
|
111
111
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
112
|
-
const
|
|
112
|
+
const disable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 0;
|
|
113
113
|
// Disable the "Sign/Approve" button if:
|
|
114
114
|
// 1. No document or multiple documents are selected, OR
|
|
115
115
|
// 2. Exactly one document is selected but its FILEEXT property is null
|
|
116
|
-
const disableSignApproveDisable =
|
|
116
|
+
const disableSignApproveDisable = getSelectedDcmtsOrFocused(selectedItems, focusedItem).length !== 1 || (getSelectedDcmtsOrFocused(selectedItems, focusedItem).length === 1 && getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].FILEEXT === null);
|
|
117
117
|
const dcmtsReturned = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsReturned : searchResults[0]?.dcmtsReturned ?? 0);
|
|
118
118
|
const dcmtsFound = (searchResults?.length > 1 ? selectedSearchResult?.dcmtsFound : searchResults[0]?.dcmtsFound ?? 0);
|
|
119
119
|
useEffect(() => { setID(genUniqueId()); }, []);
|
|
@@ -432,19 +432,15 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
432
432
|
type: 'multi',
|
|
433
433
|
onClick: async (selected) => {
|
|
434
434
|
if (!selectedManyToManyRelation || !focusedItem?.TID || !focusedItem?.DID) {
|
|
435
|
-
console.log('Missing required data');
|
|
436
435
|
return;
|
|
437
436
|
}
|
|
438
437
|
const isMaster = currentSearchResults[0].fromTID === selectedManyToManyRelation.masterTID;
|
|
439
438
|
const isDetail = currentSearchResults[0].fromTID === selectedManyToManyRelation.detailTID;
|
|
440
|
-
console.log('isMaster:', isMaster, 'isDetail:', isDetail);
|
|
441
439
|
if (!isMaster && !isDetail) {
|
|
442
|
-
console.log('TID does not match');
|
|
443
440
|
return;
|
|
444
441
|
}
|
|
445
442
|
const tms = SDK_Globals.tmSession;
|
|
446
443
|
if (!tms) {
|
|
447
|
-
console.log('No session');
|
|
448
444
|
return;
|
|
449
445
|
}
|
|
450
446
|
const se = new SearchEngine(tms);
|
|
@@ -660,51 +656,48 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
660
656
|
const archiveMasterDocuments = async (tid) => {
|
|
661
657
|
await archiveRelatedDocuments(tid, 'master');
|
|
662
658
|
};
|
|
663
|
-
const
|
|
659
|
+
const getPairedDocuments = async (relation, currentTID, currentDID, searchEngine) => {
|
|
664
660
|
if (!relation || !currentDID)
|
|
665
|
-
return
|
|
661
|
+
return null;
|
|
666
662
|
try {
|
|
667
|
-
const tmSession = SDK_Globals.tmSession;
|
|
668
|
-
if (!tmSession)
|
|
669
|
-
return [];
|
|
670
|
-
const searchEngine = tmSession.NewSearchEngine();
|
|
671
|
-
if (!searchEngine)
|
|
672
|
-
return [];
|
|
673
663
|
const isMaster = currentTID === relation.masterTID;
|
|
674
664
|
const pairedResults = isMaster
|
|
675
665
|
? await searchEngine.GetAllDetailDcmtsAsync(currentTID, currentDID)
|
|
676
666
|
: await searchEngine.GetAllMasterDcmtsAsync(currentTID, currentDID);
|
|
677
667
|
if (!pairedResults || pairedResults.length === 0)
|
|
678
|
-
return
|
|
668
|
+
return null;
|
|
679
669
|
const relationResult = pairedResults.find(r => r.relationID === relation.id);
|
|
680
670
|
if (!relationResult?.dtdResult)
|
|
681
|
-
return
|
|
682
|
-
|
|
683
|
-
const rows = relationResult.dtdResult.rows ?? [];
|
|
684
|
-
const columns = relationResult.dtdResult.columns ?? [];
|
|
685
|
-
const didColumnIndex = columns.findIndex(col => {
|
|
686
|
-
const caption = col.caption?.toUpperCase();
|
|
687
|
-
const mid = col.extendedProperties?.["MID"];
|
|
688
|
-
const midNum = typeof mid === 'string' ? Number.parseInt(mid, 10) : mid;
|
|
689
|
-
return caption === 'DID' || midNum === 5;
|
|
690
|
-
});
|
|
691
|
-
if (didColumnIndex === -1)
|
|
692
|
-
return [];
|
|
693
|
-
for (const row of rows) {
|
|
694
|
-
const did = row[didColumnIndex];
|
|
695
|
-
if (did) {
|
|
696
|
-
const didNumber = typeof did === 'string' ? Number.parseInt(did, 10) : did;
|
|
697
|
-
if (!Number.isNaN(didNumber)) {
|
|
698
|
-
pairedDIDs.push(didNumber);
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
return pairedDIDs;
|
|
671
|
+
return null;
|
|
672
|
+
return relationResult;
|
|
703
673
|
}
|
|
704
674
|
catch (error) {
|
|
705
|
-
console.error('
|
|
675
|
+
console.error('getPairedDocuments - Error:', error);
|
|
676
|
+
return null;
|
|
677
|
+
}
|
|
678
|
+
};
|
|
679
|
+
const extractPairedDIDs = (relationResult) => {
|
|
680
|
+
const pairedDIDs = [];
|
|
681
|
+
const rows = relationResult.dtdResult?.rows ?? [];
|
|
682
|
+
const columns = relationResult.dtdResult?.columns ?? [];
|
|
683
|
+
const didColumnIndex = columns.findIndex(col => {
|
|
684
|
+
const caption = col.caption?.toUpperCase();
|
|
685
|
+
const mid = col.extendedProperties?.["MID"];
|
|
686
|
+
const midNum = typeof mid === 'string' ? Number.parseInt(mid, 10) : mid;
|
|
687
|
+
return caption === 'DID' || midNum === 5;
|
|
688
|
+
});
|
|
689
|
+
if (didColumnIndex === -1)
|
|
706
690
|
return [];
|
|
691
|
+
for (const row of rows) {
|
|
692
|
+
const did = row[didColumnIndex];
|
|
693
|
+
if (did) {
|
|
694
|
+
const didNumber = typeof did === 'string' ? Number.parseInt(did, 10) : did;
|
|
695
|
+
if (!Number.isNaN(didNumber)) {
|
|
696
|
+
pairedDIDs.push(didNumber);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
707
699
|
}
|
|
700
|
+
return pairedDIDs;
|
|
708
701
|
};
|
|
709
702
|
const executeManyToManyPairing = async (relation, isPairing) => {
|
|
710
703
|
const searchEngine = SDK_Globals.tmSession?.NewSearchEngine();
|
|
@@ -777,6 +770,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
777
770
|
}
|
|
778
771
|
}
|
|
779
772
|
if (notMappedMIDs && qdRetrieveParamsValue.select && qdRetrieveParamsValue.select.length > 0) {
|
|
773
|
+
//HERE -> Fetch missing parameter values from the current document to use in the main query
|
|
780
774
|
const paramMetadata = await searchEngine.SearchByIDAsync(qdRetrieveParamsValue);
|
|
781
775
|
if (paramMetadata?.dtdResult?.rows?.[0]) {
|
|
782
776
|
for (const param of qd.params) {
|
|
@@ -810,7 +804,6 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
810
804
|
const targetTID = relation.detailTID === selectedSearchResult?.fromTID
|
|
811
805
|
? relation.masterTID
|
|
812
806
|
: relation.detailTID;
|
|
813
|
-
const qdWithSystemMIDs = structuredClone(qd);
|
|
814
807
|
const systemSelects = [
|
|
815
808
|
{ tid: targetTID, mid: SystemMIDsAsNumber.DID, visibility: 0 },
|
|
816
809
|
{ tid: targetTID, mid: SystemMIDsAsNumber.TID, visibility: 0 },
|
|
@@ -823,13 +816,39 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
823
816
|
{ tid: targetTID, mid: SystemMIDsAsNumber.FileSize, visibility: 0 },
|
|
824
817
|
{ tid: targetTID, mid: SystemMIDsAsNumber.PageCount, visibility: 0 },
|
|
825
818
|
];
|
|
826
|
-
if (
|
|
827
|
-
|
|
819
|
+
if (qd.select) {
|
|
820
|
+
qd.select = [...systemSelects, ...qd.select];
|
|
828
821
|
}
|
|
829
822
|
else {
|
|
830
|
-
|
|
823
|
+
qd.select = systemSelects;
|
|
831
824
|
}
|
|
832
|
-
const
|
|
825
|
+
const pairedDocumentsResult = await getPairedDocuments(relation, focusedItem.TID, focusedItem.DID, searchEngine);
|
|
826
|
+
if (!isPairing) {
|
|
827
|
+
if (!pairedDocumentsResult?.dtdResult?.rows || pairedDocumentsResult.dtdResult.rows.length === 0) {
|
|
828
|
+
ShowAlert({
|
|
829
|
+
message: "Nessun documento abbinato trovato.",
|
|
830
|
+
mode: 'warning',
|
|
831
|
+
title: 'Operazione molti-a-molti',
|
|
832
|
+
duration: 5000
|
|
833
|
+
});
|
|
834
|
+
return;
|
|
835
|
+
}
|
|
836
|
+
const pairedSq = {
|
|
837
|
+
fromTID: targetTID,
|
|
838
|
+
fromName: await DcmtTypeListCacheService.GetAsync(targetTID).then(d => d?.name ?? ''),
|
|
839
|
+
dtdResult: pairedDocumentsResult.dtdResult,
|
|
840
|
+
selectMIDs: pairedDocumentsResult.selectMIDs,
|
|
841
|
+
relationID: relation.id,
|
|
842
|
+
dcmtsReturned: pairedDocumentsResult.dtdResult.rows.length,
|
|
843
|
+
dcmtsFound: pairedDocumentsResult.dtdResult.rows.length
|
|
844
|
+
};
|
|
845
|
+
setPairedSearchResults([pairedSq]);
|
|
846
|
+
setIsPairingManyToMany(isPairing);
|
|
847
|
+
setShowPairDcmtsModal(true);
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
//HERE -> For pair mode, execute the query and filter out already paired documents
|
|
851
|
+
const sq = await searchEngine.SearchByIDAsync(qd);
|
|
833
852
|
if (!sq?.dtdResult?.rows || sq.dtdResult.rows.length === 0) {
|
|
834
853
|
ShowAlert({
|
|
835
854
|
message: "Nessun documento trovato.",
|
|
@@ -839,16 +858,11 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
839
858
|
});
|
|
840
859
|
return;
|
|
841
860
|
}
|
|
842
|
-
const pairedDIDs =
|
|
861
|
+
const pairedDIDs = pairedDocumentsResult ? extractPairedDIDs(pairedDocumentsResult) : [];
|
|
843
862
|
const filteredRows = sq.dtdResult.rows.filter(row => {
|
|
844
863
|
const did = row[0];
|
|
845
|
-
const didNum = typeof did === 'string' ? parseInt(did, 10) : did;
|
|
846
|
-
|
|
847
|
-
return !pairedDIDs.includes(didNum);
|
|
848
|
-
}
|
|
849
|
-
else {
|
|
850
|
-
return pairedDIDs.includes(didNum);
|
|
851
|
-
}
|
|
864
|
+
const didNum = typeof did === 'string' ? Number.parseInt(did, 10) : did;
|
|
865
|
+
return !pairedDIDs.includes(didNum);
|
|
852
866
|
});
|
|
853
867
|
const filteredSq = {
|
|
854
868
|
...sq,
|
|
@@ -861,14 +875,13 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
861
875
|
};
|
|
862
876
|
if (filteredRows.length === 0) {
|
|
863
877
|
ShowAlert({
|
|
864
|
-
message:
|
|
878
|
+
message: "Nessun documento da abbinare. Tutti i documenti risultanti dalla query sono già abbinati.",
|
|
865
879
|
mode: 'warning',
|
|
866
880
|
title: 'Operazione molti-a-molti',
|
|
867
881
|
duration: 5000
|
|
868
882
|
});
|
|
869
883
|
return;
|
|
870
884
|
}
|
|
871
|
-
console.log(filteredSq);
|
|
872
885
|
setPairedSearchResults([filteredSq]);
|
|
873
886
|
setIsPairingManyToMany(isPairing);
|
|
874
887
|
setShowPairDcmtsModal(true);
|
|
@@ -948,17 +961,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
948
961
|
setIsModifiedBatchUpdate(false);
|
|
949
962
|
await refreshSelectionDataRowsAsync();
|
|
950
963
|
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm) &&
|
|
951
|
-
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => {
|
|
952
|
-
setShowApprovePopup(true);
|
|
953
|
-
}, onSignApprove: () => {
|
|
954
|
-
handleSignApprove();
|
|
955
|
-
}, onReject: () => {
|
|
956
|
-
setShowRejectPopup(true);
|
|
957
|
-
}, onReAssign: () => {
|
|
958
|
-
setShowReAssignPopup(true);
|
|
959
|
-
}, onMoreInfo: () => {
|
|
960
|
-
setShowMoreInfoPopup(true);
|
|
961
|
-
}, approveDisable: selectedDocs.length === 0, signApproveDisable: disableSignApproveDisable, rejectDisable: selectedDocs.length === 0, reassignDisable: selectedDocs.length === 0, infoDisable: selectedDocs.length !== 1, dtd: fromDTD }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), showRelatedDcmtsChooser &&
|
|
964
|
+
_jsx(ToppyHelpCenter, { deviceType: deviceType, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => setShowApprovePopup(true), onSignApprove: handleSignApprove, 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, {}), showRelatedDcmtsChooser &&
|
|
962
965
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
963
966
|
try {
|
|
964
967
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { DcmtTypeDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
1
|
import { DeviceType } from "../../base/TMDeviceProvider";
|
|
3
2
|
interface IWorkflowOperationButtonsProps {
|
|
4
|
-
dtd: DcmtTypeDescriptor | undefined;
|
|
5
3
|
approveDisable?: boolean;
|
|
6
4
|
signApproveDisable?: boolean;
|
|
7
5
|
rejectDisable?: boolean;
|
|
@@ -14,7 +12,7 @@ interface IWorkflowOperationButtonsProps {
|
|
|
14
12
|
onReAssign?: () => void;
|
|
15
13
|
onMoreInfo?: () => void;
|
|
16
14
|
}
|
|
17
|
-
export declare const WorkFlowOperationButtons: (
|
|
15
|
+
export declare const WorkFlowOperationButtons: ({ deviceType, approveDisable, signApproveDisable, reassignDisable, rejectDisable, infoDisable, onApprove, onSignApprove, onReAssign, onReject, onMoreInfo }: IWorkflowOperationButtonsProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
16
|
export declare const WorkFlowApproveRejectPopUp: ({ TID, DID, deviceType, isReject, selectedItems, onClose, onCompleted }: {
|
|
19
17
|
TID?: number;
|
|
20
18
|
DID?: number;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Priorities, ResultTypes, SDK_Globals, SDK_Localizator, TaskEngine, UserListCacheService, ValidationItem, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from "styled-components";
|
|
5
|
-
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, DateDisplayTypes, TASK_MORE_INFO_PREFIX_NAME, IconSignaturePencil
|
|
5
|
+
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, DateDisplayTypes, TASK_MORE_INFO_PREFIX_NAME, IconSignaturePencil } from "../../../helper";
|
|
6
6
|
import { TMColors } from "../../../utils/theme";
|
|
7
7
|
import TMButton from "../../base/TMButton";
|
|
8
8
|
import { DeviceType } from "../../base/TMDeviceProvider";
|
|
@@ -65,22 +65,9 @@ const StyledHorizontalContainer = styled.div `
|
|
|
65
65
|
gap: 10px;
|
|
66
66
|
/* align-items: flex-end; */
|
|
67
67
|
`;
|
|
68
|
-
export const WorkFlowOperationButtons = (
|
|
69
|
-
const { dtd = undefined, deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, rejectDisable = false, reassignDisable = false, infoDisable = false, onApprove, onSignApprove, onReject, onReAssign, onMoreInfo } = props;
|
|
68
|
+
export const WorkFlowOperationButtons = ({ deviceType = DeviceType.DESKTOP, approveDisable = false, signApproveDisable = false, reassignDisable = false, rejectDisable = false, infoDisable = false, onApprove, onSignApprove, onReAssign, onReject, onMoreInfo }) => {
|
|
70
69
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
71
|
-
|
|
72
|
-
const [isSignWorkflow, setIsSignWorkflow] = useState(false);
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
// Controlla se il documento ha dei widget definiti, se il documento ha il widget SIGN4_TOP abilitato, allora è un workflow di firma
|
|
75
|
-
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
76
|
-
setIsSignWorkflow(isSign4TopEnabled(dtd.widgets));
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
// Se non ci sono widget o non è SIGN4_TOP, imposta il workflow di default (approvazione senza firma)
|
|
80
|
-
setIsSignWorkflow(false);
|
|
81
|
-
}
|
|
82
|
-
}, [dtd]);
|
|
83
|
-
return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), 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(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" })] })) : (_jsxs(_Fragment, { 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(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" })] })) }));
|
|
70
|
+
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(IconSignaturePencil, {}), 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' })] }));
|
|
84
71
|
};
|
|
85
72
|
export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = DeviceType.DESKTOP, isReject, selectedItems = [], onClose, onCompleted }) => {
|
|
86
73
|
const [commentValue, setCommentValue] = useState('');
|