@topconsultnpm/sdkui-react-beta 6.12.42 → 6.12.44
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/archive/TMArchive.d.ts +6 -0
- package/lib/components/features/archive/TMArchive.js +57 -0
- package/lib/components/{query → features/documents}/TMBatchUpdateForm.d.ts +1 -1
- package/lib/components/{query → features/documents}/TMBatchUpdateForm.js +18 -18
- package/lib/components/{query → features/documents}/TMDcmtBlog.js +4 -4
- package/lib/components/{query → features/documents}/TMDcmtForm.d.ts +2 -2
- package/lib/components/{query → features/documents}/TMDcmtForm.js +22 -22
- package/lib/components/{query → features/documents}/TMDcmtIcon.js +2 -2
- package/lib/components/{query → features/documents}/TMDcmtPreview.d.ts +1 -1
- package/lib/components/{query → features/documents}/TMDcmtPreview.js +14 -14
- package/lib/components/{query → features/documents}/TMFileUploader.d.ts +1 -1
- package/lib/components/{query → features/documents}/TMFileUploader.js +10 -10
- package/lib/components/{query → features/documents}/TMMasterDetailDcmts.d.ts +3 -7
- package/lib/components/{query → features/documents}/TMMasterDetailDcmts.js +20 -20
- package/lib/components/features/search/TMSavedQueryForm.d.ts +9 -0
- package/lib/components/features/search/TMSavedQueryForm.js +41 -0
- package/lib/components/features/search/TMSavedQuerySelector.d.ts +16 -0
- package/lib/components/features/search/TMSavedQuerySelector.js +143 -0
- package/lib/components/features/search/TMSearch.d.ts +10 -0
- package/lib/components/features/search/TMSearch.js +188 -0
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +15 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +365 -0
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +20 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +296 -0
- package/lib/components/{search → features/search}/TMSearchResult.d.ts +2 -6
- package/lib/components/{search → features/search}/TMSearchResult.js +31 -31
- package/lib/components/{search → features/search}/TMSearchResultsMenuItems.d.ts +2 -2
- package/lib/components/{search → features/search}/TMSearchResultsMenuItems.js +5 -5
- package/lib/components/features/search/TMTreeSelector.d.ts +9 -0
- package/lib/components/features/search/TMTreeSelector.js +125 -0
- package/lib/components/{query → features/workflow}/TMWorkflowPopup.d.ts +1 -1
- package/lib/components/{query → features/workflow}/TMWorkflowPopup.js +8 -8
- package/lib/components/grids/TMBlogsUtils.d.ts +2 -1
- package/lib/components/grids/TMRecentsManager.d.ts +11 -0
- package/lib/components/grids/TMRecentsManager.js +45 -0
- package/lib/components/index.d.ts +5 -2
- package/lib/components/index.js +8 -2
- package/lib/components/query/TMQueryEditor.js +5 -8
- package/lib/helper/Enum_Localizator.d.ts +2 -1
- package/lib/helper/Enum_Localizator.js +9 -1
- package/lib/helper/SDKUI_Localizator.d.ts +9 -0
- package/lib/helper/SDKUI_Localizator.js +90 -0
- package/lib/ts/types.d.ts +11 -0
- package/package.json +2 -2
- package/lib/components/query/TMQueryResult.d.ts +0 -10
- package/lib/components/query/TMQueryResult.js +0 -42
- package/lib/components/query/TMQueryResultForm.d.ts +0 -17
- package/lib/components/query/TMQueryResultForm.js +0 -318
- /package/lib/components/{query → features/documents}/TMDcmtBlog.d.ts +0 -0
- /package/lib/components/{query → features/documents}/TMDcmtIcon.d.ts +0 -0
|
@@ -1,318 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from 'react';
|
|
3
|
-
import { SDK_Globals, AppModules } from '@topconsultnpm/sdk-ts-beta';
|
|
4
|
-
import TMQueryResult from './TMQueryResult';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import { IconApply, IconCloseOutline, IconUser, IconInfo, IconRefresh, IconSync, IconDownload, IconPreview, IconPrinter, IconCheckIn, IconEdit, IconStar, IconRecursiveOps, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconRelation, IconSignature, IconDelete, IconUndo, IconCloseCircle, IconMenuVertical, IconArchiveDoc, IconDuplicate, IconSubstFile, IconConvertFilePdf, IconCheckFile, IconBatchUpdate, IconShare, IconSharedDcmt, IconSearch, IconExportTo, IconShow, IconSettings, IconActivityLog, SDKUI_Localizator, IconArrowLeft } from '../../helper';
|
|
7
|
-
import { FormModes, SearchResultContext } from '../../ts';
|
|
8
|
-
import { TMColors } from '../../utils/theme';
|
|
9
|
-
import { StyledBadge } from '../base/Styled';
|
|
10
|
-
import ShowAlert from '../base/TMAlert';
|
|
11
|
-
import TMButton from '../base/TMButton';
|
|
12
|
-
import TMDropDownMenu from '../base/TMDropDownMenu';
|
|
13
|
-
import { TMSplitterLayout, TMLayoutItem } from '../base/TMLayout';
|
|
14
|
-
import TMModal from '../base/TMModal';
|
|
15
|
-
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
16
|
-
import TMSpinner from '../base/TMSpinner';
|
|
17
|
-
import TMTooltip from '../base/TMTooltip';
|
|
18
|
-
import TMUserChooser from '../choosers/TMUserChooser';
|
|
19
|
-
import TMApplyForm from '../forms/TMApplyForm';
|
|
20
|
-
import TMTidViewer from '../viewers/TMTidViewer';
|
|
21
|
-
import TMListView from '../base/TMListView';
|
|
22
|
-
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
|
23
|
-
const StyledWorkFlowOperationButtonsContainer = styled.div `
|
|
24
|
-
display: flex;
|
|
25
|
-
align-items: center;
|
|
26
|
-
gap: 15px;
|
|
27
|
-
margin-left: 50px;
|
|
28
|
-
`;
|
|
29
|
-
const StyledTextArea = styled.textarea `
|
|
30
|
-
width: 100%;
|
|
31
|
-
height: 100%;
|
|
32
|
-
border: 1px solid ${props => props.$isValid ? '#b4b4b4' : TMColors.error};
|
|
33
|
-
border-radius: 10px;
|
|
34
|
-
padding: 10px;
|
|
35
|
-
&:focus{
|
|
36
|
-
outline: none;
|
|
37
|
-
border-bottom: 4px solid ${props => props.$isValid ? TMColors.primary : TMColors.error};
|
|
38
|
-
}
|
|
39
|
-
`;
|
|
40
|
-
const StyledTitleContainer = styled.div ` width: max-content; height: max-content; font-weight:bold; border-radius: 5px; padding: 5px; background-color: #fff; color: #0e7418; margin-right: 10px; display: flex; align-items: center; gap: 2px; `;
|
|
41
|
-
const WorfflowListItem = ({ data }) => {
|
|
42
|
-
return (_jsxs("div", { style: { width: '100%', padding: '2px 5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between', userSelect: 'none' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: data.dcmtsReturned })] }));
|
|
43
|
-
};
|
|
44
|
-
const WorkFlowOperationButtons = ({ onApprove, onReAssign, onReject, approveDisable = false, reassignDisable = false, rejectDisable = false }) => {
|
|
45
|
-
return (_jsxs(StyledWorkFlowOperationButtonsContainer, { children: [_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconApply, {}), caption: 'Approva', disabled: approveDisable, onClick: () => !approveDisable && onApprove && onApprove(), advancedColor: TMColors.success }), _jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconCloseOutline, {}), caption: 'Rifiuta', disabled: rejectDisable, onClick: () => !rejectDisable && onReject && onReject(), advancedColor: TMColors.error }), _jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconUser, { fontSize: 16 }), caption: 'Riassegna', disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign && onReAssign(), advancedColor: TMColors.tertiary }), _jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconInfo, { fontSize: 16 }), caption: 'Maggiori informazioni', width: '180px', disabled: approveDisable, onClick: () => alert('TODO!!!'), advancedColor: TMColors.info })] }));
|
|
46
|
-
};
|
|
47
|
-
const WorkFlowApproveRejectPopUp = ({ op, onClose, selectedItems = [], onUpdate }) => {
|
|
48
|
-
const [commentValue, setCommentValue] = useState('');
|
|
49
|
-
const disable = commentValue.length === 0;
|
|
50
|
-
const count = () => { return selectedItems.length.toString() + ' Workitem'; };
|
|
51
|
-
const completeWorkFlowAsync = async () => {
|
|
52
|
-
try {
|
|
53
|
-
TMSpinner.show();
|
|
54
|
-
for (let item of selectedItems) {
|
|
55
|
-
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_CompleteOrRejectAsync(item.TID, item.DID, commentValue, 0);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch (e) {
|
|
59
|
-
TMExceptionBoxManager.show({ exception: e });
|
|
60
|
-
}
|
|
61
|
-
finally {
|
|
62
|
-
onClose && onClose();
|
|
63
|
-
TMSpinner.hide();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const rejectWorkFlowAsync = async () => {
|
|
67
|
-
try {
|
|
68
|
-
TMSpinner.show();
|
|
69
|
-
for (let item of selectedItems) {
|
|
70
|
-
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_CompleteOrRejectAsync(item.TID, item.DID, commentValue, 1);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
TMExceptionBoxManager.show({ exception: e });
|
|
75
|
-
}
|
|
76
|
-
finally {
|
|
77
|
-
onUpdate && onUpdate();
|
|
78
|
-
onClose && onClose();
|
|
79
|
-
TMSpinner.hide();
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
return (_jsx(TMModal, { toolbar: op === 0 ?
|
|
83
|
-
_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconApply, {}), caption: 'Approva', disabled: false, onClick: completeWorkFlowAsync, advancedColor: TMColors.success }) :
|
|
84
|
-
_jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconCloseOutline, {}), caption: 'Rifiuta', disabled: disable, onClick: () => { !disable && rejectWorkFlowAsync(); }, advancedColor: TMColors.error }), onClose: onClose, width: '60%', height: '60%', isModal: true, title: (op === 0 ? 'Approva workflow ' + '(' + count() + ')' : 'Rifiuta workflow ' + '(' + count() + ')'), children: _jsxs("div", { style: { width: '100%', height: '100%', padding: '10px', display: 'flex', flexDirection: 'column', gap: 5 }, children: [_jsxs("p", { style: { color: (op === 1 && disable) ? TMColors.error : 'black' }, children: ["Commento ", op === 1 && disable && _jsx("span", { children: ' (Campo obbligatorio)' }), " "] }), _jsx(StyledTextArea, { "$isValid": op === 0 ? true : !disable, value: commentValue, onChange: (e) => setCommentValue(e.target.value) })] }) }));
|
|
85
|
-
};
|
|
86
|
-
const WorkFlowReAssignPopUp = ({ onClose, selectedItems = [], onUpdate }) => {
|
|
87
|
-
const [commentValue, setCommentValue] = useState('');
|
|
88
|
-
const [selectedUserID, setSelectedUserID] = useState();
|
|
89
|
-
const disable = commentValue.length === 0 || !selectedUserID;
|
|
90
|
-
const count = () => { return selectedItems.length.toString() + ' Workitem'; };
|
|
91
|
-
const reAssignWorkFlowAsync = async () => {
|
|
92
|
-
try {
|
|
93
|
-
TMSpinner.show();
|
|
94
|
-
for (let item of selectedItems) {
|
|
95
|
-
await SDK_Globals.tmSession?.NewWorkflowEngine().WorkItem_ReassignAsync(item.TID, item.DID, selectedUserID, commentValue);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
catch (e) {
|
|
99
|
-
TMExceptionBoxManager.show({ exception: e });
|
|
100
|
-
}
|
|
101
|
-
finally {
|
|
102
|
-
onUpdate && onUpdate();
|
|
103
|
-
onClose && onClose();
|
|
104
|
-
TMSpinner.hide();
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
return (_jsx(TMModal, { toolbar: _jsx(TMButton, { btnStyle: 'advanced', icon: _jsx(IconUser, { fontSize: 16 }), caption: 'Riassegna', disabled: disable, onClick: () => !disable && reAssignWorkFlowAsync(), advancedColor: TMColors.tertiary }), onClose: onClose, width: '60%', height: '60%', isModal: true, title: 'Riassegna workflow ' + '(' + count() + ')', children: _jsxs("div", { style: { width: '100%', height: '100%', padding: '10px', display: 'flex', flexDirection: 'column', gap: 5 }, children: [_jsx(TMUserChooser, { value: selectedUserID, onValueChanged: (e) => setSelectedUserID(e) }), _jsxs("p", { style: { color: commentValue.length === 0 ? TMColors.error : 'black' }, children: ["Commento ", commentValue.length === 0 && _jsx("span", { children: ' (Campo obbligatorio)' }), " "] }), _jsx(StyledTextArea, { "$isValid": commentValue.length !== 0, value: commentValue, onChange: (e) => setCommentValue(e.target.value) })] }) }));
|
|
108
|
-
};
|
|
109
|
-
const TabView = ({ title = '', onMouseOut, onMouseOver, onClick, clickable, selectedTabBorderColor, icon = _jsx(IconApply, {}), count = 0 }) => {
|
|
110
|
-
return (_jsx(TMTooltip, { content: title, children: _jsxs("div", { onMouseOut: onMouseOut, onMouseOver: onMouseOver, onClick: onClick, style: { userSelect: 'none', width: 'max-content', padding: 5, height: '40px', display: 'flex', alignItems: 'center', position: 'relative', cursor: clickable ? 'pointer' : 'default' }, children: [_jsx("div", { style: { position: 'absolute', top: 0, left: 0, width: '100%', height: '3px', backgroundColor: selectedTabBorderColor, transition: 'all ease 100ms' } }), _jsx("div", { style: { transform: 'translateY(2px)' }, children: icon }), _jsx(StyledBadge, { "$backgroundColor": '#679CE8', children: count })] }) }));
|
|
111
|
-
};
|
|
112
|
-
const TMQueryResultForm = ({ onUpdate, isModal, onClose, context = SearchResultContext.METADATA_SEARCH, result1, result2, elapsedTime, searchText, tabIcon1 = _jsx(IconApply, {}), tabIcon2 = _jsx(IconApply, {}), tabTitle1, tabTitle2 }) => {
|
|
113
|
-
const [currentSearchResult1, setCurrentSearchResult1] = useState();
|
|
114
|
-
const [currentSearchResult2, setCurrentSearchResult2] = useState();
|
|
115
|
-
const [selectedItems, setSelectedItems] = useState([]);
|
|
116
|
-
const [showApprovePopup, setShowApprovePopup] = useState(false);
|
|
117
|
-
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
118
|
-
const [showReAssignPopup, setShowReAssignPopup] = useState(false);
|
|
119
|
-
const [showHiddenSelectItems, setShowHiddenSelectItems] = useState(false);
|
|
120
|
-
const [selectedTabIndex, setSelectedTabIndex] = useState(0);
|
|
121
|
-
const [hoveredTab, setHoveredTab] = useState(undefined);
|
|
122
|
-
const [tabCount1, setTabCount1] = useState(0);
|
|
123
|
-
const [tabCount2, setTabCount2] = useState(0);
|
|
124
|
-
const [splitterSize, setSplitterSize] = useState(['100%', '0']);
|
|
125
|
-
const [hasBack, setHasBack] = useState(false);
|
|
126
|
-
let disable = selectedItems.length === 0;
|
|
127
|
-
const orderByName = (array) => {
|
|
128
|
-
let arr = [...array];
|
|
129
|
-
return arr.sort((a, b) => { if (a['fromName'] < b['fromName']) {
|
|
130
|
-
return -1;
|
|
131
|
-
} if (a['fromName'] > b['fromName']) {
|
|
132
|
-
return 1;
|
|
133
|
-
} return 0; });
|
|
134
|
-
};
|
|
135
|
-
let toolbarElements = [
|
|
136
|
-
_jsx(TMButton, { caption: "Aggiorna", icon: _jsx(IconRefresh, {}), btnStyle: 'toolbar', fontSize: '1.3rem', elementStyle: { marginRight: context === SearchResultContext.WORKFLOW_APPROVE ? '10px' : '0' }, onClick: () => context === SearchResultContext.WORKFLOW_APPROVE ? onUpdate && onUpdate() : alert('todo') }, "btn1"),
|
|
137
|
-
_jsx(TMButton, { caption: "Sincronizza elementi query", icon: _jsx(IconSync, {}), btnStyle: 'toolbar', fontSize: '1.3rem', elementStyle: { marginRight: '10px' }, onClick: () => { ShowAlert({ message: "TODO Sync Query", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }, "btn2"),
|
|
138
|
-
_jsx(TMButton, { caption: "Download documento", icon: _jsx(IconDownload, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Download documento", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }, "btn3"),
|
|
139
|
-
_jsx(TMButton, { caption: "Apri form", icon: _jsx(IconPreview, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO Apri form", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }, "btn4"),
|
|
140
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { icon: _jsx(IconPrinter, {}), caption: 'Stampa', btnStyle: 'toolbar', fontSize: '1.3rem' }), items: [
|
|
141
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Stampa con TopMedia", onClick: () => ShowAlert({ message: "TODO Stampa con TopMedia", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
142
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Stampa con Acrobat", onClick: () => ShowAlert({ message: "TODO Stampa con Acrobat", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
143
|
-
] }, "btn5"),
|
|
144
|
-
_jsx(TMButton, { caption: "Vizualizza/Modifica metadati", icon: _jsx(IconEdit, {}), btnStyle: 'toolbar', fontSize: '1.3rem', elementStyle: { marginRight: '10px' }, onClick: () => { ShowAlert({ message: "TODO Vizualizza/Modifica metadati", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }, "btn6"),
|
|
145
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { icon: _jsx(IconCheckIn, {}), caption: 'Check in', btnStyle: 'toolbar', fontSize: '1.3rem' }), items: [
|
|
146
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Check out", onClick: () => ShowAlert({ message: "TODO Check out", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
147
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Modifica file", onClick: () => ShowAlert({ message: "TODO Modifica file", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
148
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Annulla check out", onClick: () => ShowAlert({ message: "TODO Annulla check out", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
149
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Check in", onClick: () => ShowAlert({ message: "TODO Check in", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
150
|
-
{ icon: _jsx(IconCheckIn, {}), text: "Cronologia", onClick: () => ShowAlert({ message: "TODO Cronologia", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
151
|
-
] }, "btn7"),
|
|
152
|
-
_jsx(TMButton, { caption: "Aggiungi a preferiti", icon: _jsx(IconStar, {}), btnStyle: 'toolbar', fontSize: '1.3rem', onClick: () => { ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }); } }, "btn8"),
|
|
153
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'toolbar', caption: 'Operazioni ricorsive', icon: _jsx(IconRecursiveOps, {}) }), items: [
|
|
154
|
-
{
|
|
155
|
-
icon: _jsx(IconMail, {}), text: "Invia per posta", items: [
|
|
156
|
-
{ icon: _jsx(IconMail, {}), text: "I documenti selezionati", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
157
|
-
{ icon: _jsx(IconMail, {}), text: "I documenti di primo livello e tutti i documenti correlati", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
158
|
-
{ icon: _jsx(IconMail, {}), text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
159
|
-
]
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
icon: _jsx(IconDcmtTypeOnlyMetadata, {}), text: "Unisci in un file PDF", items: [
|
|
163
|
-
{ icon: _jsx(IconDcmtTypeOnlyMetadata, {}), text: "I documenti selezionati", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
164
|
-
{ icon: _jsx(IconDcmtTypeOnlyMetadata, {}), text: "I documenti di primo livello e tutti i documenti correlati", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
165
|
-
{ icon: _jsx(IconDcmtTypeOnlyMetadata, {}), text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
166
|
-
]
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
icon: _jsx(IconCopy, {}), text: "Copia in una cartella", items: [
|
|
170
|
-
{ icon: _jsx(IconCopy, {}), text: "I documenti selezionati", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
171
|
-
{ icon: _jsx(IconCopy, {}), text: "I documenti di primo livello e tutti i documenti correlati", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
172
|
-
{ icon: _jsx(IconCopy, {}), text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione", onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
173
|
-
]
|
|
174
|
-
},
|
|
175
|
-
] }, "btn9"),
|
|
176
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { icon: _jsx(IconRelation, {}), caption: 'Correlazioni', btnStyle: 'toolbar', fontSize: '1.3rem' }), items: [
|
|
177
|
-
{ icon: _jsx(IconRelation, {}), text: "Abbina documenti molti a molti", onClick: () => ShowAlert({ message: "TODO Abbina documenti molti a molti", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
178
|
-
{ icon: _jsx(IconRelation, {}), text: "Disabbina documenti molti a molti", onClick: () => ShowAlert({ message: "TODO Disabbina documenti molti a molti", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
179
|
-
{ icon: _jsx(IconRelation, {}), text: "Archivia documento dettaglio", beginGroup: true, onClick: () => ShowAlert({ message: "TODO Archivia documento dettaglio", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
180
|
-
{ icon: _jsx(IconRelation, {}), text: "Archivia documento master", onClick: () => ShowAlert({ message: "TODO Archivia documento master", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
181
|
-
{ icon: _jsx(IconRelation, {}), text: "Documenti master", beginGroup: true, onClick: () => ShowAlert({ message: "TODO Documenti master", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
182
|
-
] }, "btn10"),
|
|
183
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { icon: _jsx(IconSignature, {}), btnStyle: 'toolbar', caption: 'Firma', fontSize: '1.3rem' }), items: [
|
|
184
|
-
{ icon: _jsx(IconSignature, {}), text: "Informazioni di firma", onClick: () => ShowAlert({ message: "TODO Informazioni di firma", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
185
|
-
{ icon: _jsx(IconSignature, {}), text: "Verifica firma", onClick: () => ShowAlert({ message: "TODO Verifica firma", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
186
|
-
{ icon: _jsx(IconSignature, {}), text: "Firma e marca", onClick: () => ShowAlert({ message: "TODO Firma e marca", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
187
|
-
] }, "btn11"),
|
|
188
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'toolbar', caption: 'Cancellazione', icon: _jsx(IconDelete, {}) }), items: [
|
|
189
|
-
{ icon: _jsx(IconDelete, {}), text: "Cancellazione logica", onClick: () => ShowAlert({ message: "TODO Cancellazione logica", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
190
|
-
{ icon: _jsx(IconUndo, {}), text: "Ripristina", onClick: () => ShowAlert({ message: "TODO Ripristina", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
191
|
-
{ icon: _jsx(IconCloseCircle, {}), text: "Cancellazione fisica", onClick: () => ShowAlert({ message: "TODO Cancellazione fisica", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
192
|
-
] }, "btn12"),
|
|
193
|
-
_jsx(TMDropDownMenu, { backgroundColor: 'white', borderRadius: '3px', content: _jsx(TMButton, { btnStyle: 'toolbar', caption: 'Altro', icon: _jsx(IconMenuVertical, {}) }), items: [
|
|
194
|
-
{ icon: _jsx(IconArchiveDoc, {}), text: "Passa ad archiviazione", onClick: () => ShowAlert({ message: "TODO Passa ad archiviazione", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
195
|
-
{ icon: _jsx(IconDuplicate, {}), text: "Duplica documento", onClick: () => ShowAlert({ message: "TODO Duplica documento", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
196
|
-
{ icon: _jsx(IconSubstFile, { fontSize: 18 }), text: "Aggiungi/sostituisci file", onClick: () => ShowAlert({ message: "TODO Aggiungi/sostituisci file", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
197
|
-
{ icon: _jsx(IconConvertFilePdf, { fontSize: 18 }), text: "Conversione file", onClick: () => ShowAlert({ message: "TODO Conversione file", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
198
|
-
{ icon: _jsx(IconCheckFile, { fontSize: 18 }), text: "Controllo file", onClick: () => ShowAlert({ message: "TODO Controllo file", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
199
|
-
{ icon: _jsx(IconBatchUpdate, { fontSize: 18 }), text: "Modifica multipla", onClick: () => ShowAlert({ message: "TODO Modifica multipla", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
200
|
-
{ icon: _jsx(IconShare, { fontSize: 18 }), text: "Archiviazione condivisa", beginGroup: true, onClick: () => ShowAlert({ message: "TODO Archiviazione condivisa", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
201
|
-
{ icon: _jsx(IconSharedDcmt, { fontSize: 18 }), text: "Documenti condivisi", onClick: () => ShowAlert({ message: "TODO Documenti condivisi", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
202
|
-
{
|
|
203
|
-
icon: _jsx(IconSearch, {}), text: "Trova tutti i riferimenti", beginGroup: true, items: [
|
|
204
|
-
{ icon: _jsx(IconSearch, {}), text: "Trova tutti i riferimenti", onClick: () => ShowAlert({ message: "TODO Trova tutti i riferimenti", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
205
|
-
{ icon: _jsx(IconSearch, {}), text: "Trova tutti i riferimenti (anche nello storico)", onClick: () => ShowAlert({ message: "TODO Trova tutti i riferimenti (anche nello storico)", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
206
|
-
]
|
|
207
|
-
},
|
|
208
|
-
{ icon: _jsx(IconExportTo, { fontSize: 18 }), text: "Esporta in...", onClick: () => ShowAlert({ message: "TODO Esporta in", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
209
|
-
{ icon: _jsx(IconShow, {}), text: "Mostra footer", onClick: () => ShowAlert({ message: "TODO Mostra footer", mode: 'info', title: `${"TODO"}`, duration: 3000 }) },
|
|
210
|
-
{ icon: _jsx(IconSettings, {}), text: "Visualizza o nasconde i metadati nascosti", onClick: () => setShowHiddenSelectItems(!showHiddenSelectItems) },
|
|
211
|
-
] }, "btn13"),
|
|
212
|
-
_jsx(WorkFlowOperationButtons, { onApprove: () => setShowApprovePopup(true), onReject: () => setShowRejectPopup(true), onReAssign: () => setShowReAssignPopup(true), approveDisable: disable, rejectDisable: disable, reassignDisable: disable }, 'btn14')
|
|
213
|
-
];
|
|
214
|
-
let mobileHeaderTitle = [
|
|
215
|
-
_jsxs(StyledTitleContainer, { children: [context === SearchResultContext.WORKFLOW_APPROVE ? _jsx(IconActivityLog, { fontSize: 14 }) : context === SearchResultContext.FAVORITES ? _jsx(IconStar, {}) : context === SearchResultContext.RECENT ? _jsx(IconRefresh, {}) : '', context === SearchResultContext.WORKFLOW_APPROVE ? SDKUI_Localizator.WorkflowApproval : context === SearchResultContext.FAVORITES ? SDKUI_Localizator.Favorites : context === SearchResultContext.RECENT ? SDKUI_Localizator.RecentDcmts : ''] }, context === SearchResultContext.WORKFLOW_APPROVE ? 'title2' : context === SearchResultContext.FAVORITES ? 'title0' : context === SearchResultContext.RECENT ? 'title1' : '')
|
|
216
|
-
];
|
|
217
|
-
const [toolbar, setToolbar] = useState(toolbarElements);
|
|
218
|
-
const deviceType = useDeviceType();
|
|
219
|
-
let isMobile = deviceType === DeviceType.MOBILE;
|
|
220
|
-
useEffect(() => { if (isMobile) {
|
|
221
|
-
setCurrentSearchResult1(undefined);
|
|
222
|
-
setCurrentSearchResult2(undefined);
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
if (Array.isArray(result1)) {
|
|
226
|
-
setCurrentSearchResult1(orderByName(result1)[0]);
|
|
227
|
-
}
|
|
228
|
-
;
|
|
229
|
-
if (Array.isArray(result2)) {
|
|
230
|
-
setCurrentSearchResult2(orderByName(result2)[0]);
|
|
231
|
-
}
|
|
232
|
-
} }, [isMobile, result1, result2]);
|
|
233
|
-
useEffect(() => {
|
|
234
|
-
let arr = [...toolbarElements];
|
|
235
|
-
if (isMobile && hasBack) {
|
|
236
|
-
arr.unshift(_jsx(TMButton, { caption: SDKUI_Localizator.Back, icon: _jsx(IconArrowLeft, {}), btnStyle: 'toolbar', color: 'tertiary', fontSize: '1.3rem', onClick: () => { setSplitterSize(['100%', '0']); setHasBack(false); let arr = [...toolbar]; arr = arr.filter(item => item.key !== 'btn00'); } }, "btn00"));
|
|
237
|
-
}
|
|
238
|
-
if (!isMobile || !hasBack) {
|
|
239
|
-
arr = arr.filter(item => item.key !== 'btn00');
|
|
240
|
-
}
|
|
241
|
-
if (context === SearchResultContext.METADATA_SEARCH) {
|
|
242
|
-
arr = arr.filter(item => item.key !== 'btn14');
|
|
243
|
-
arr = arr.filter(item => item.key !== 'btn5');
|
|
244
|
-
arr = arr.filter(item => item.key !== 'btn6');
|
|
245
|
-
}
|
|
246
|
-
if (context === SearchResultContext.WORKFLOW_APPROVE) {
|
|
247
|
-
arr.unshift(_jsxs(StyledTitleContainer, { style: { gap: 5 }, children: [_jsx(IconActivityLog, { fontSize: 14 }), " ", SDKUI_Localizator.WorkflowApproval] }, 'title2'));
|
|
248
|
-
arr = arr.filter(item => item.key !== 'btn2');
|
|
249
|
-
arr = arr.filter(item => item.key !== 'btn4');
|
|
250
|
-
arr = arr.filter(item => item.key !== 'btn8');
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
arr = arr.filter(item => item.key !== 'title2');
|
|
254
|
-
}
|
|
255
|
-
if (context === SearchResultContext.FAVORITES) {
|
|
256
|
-
arr.unshift(_jsxs(StyledTitleContainer, { children: [_jsx(IconStar, {}), " ", SDKUI_Localizator.Favorites] }, 'title0'));
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
arr = arr.filter(item => item.key !== 'title0');
|
|
260
|
-
}
|
|
261
|
-
if (context === SearchResultContext.RECENT) {
|
|
262
|
-
arr.unshift(_jsxs(StyledTitleContainer, { children: [_jsx(IconRefresh, {}), " ", SDKUI_Localizator.RecentDcmts] }, 'title1'));
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
265
|
-
arr = arr.filter(item => item.key !== 'title1');
|
|
266
|
-
}
|
|
267
|
-
setToolbar(arr);
|
|
268
|
-
}, [context, selectedItems, isMobile, hasBack]);
|
|
269
|
-
useEffect(() => {
|
|
270
|
-
let c = 0;
|
|
271
|
-
if (Array.isArray(result1)) {
|
|
272
|
-
for (let res of result1) {
|
|
273
|
-
if (res.dcmtsFound)
|
|
274
|
-
c += res.dcmtsFound;
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
setTabCount1(c);
|
|
278
|
-
}, [result1]);
|
|
279
|
-
useEffect(() => {
|
|
280
|
-
let c = 0;
|
|
281
|
-
if (Array.isArray(result2)) {
|
|
282
|
-
for (let res of result2) {
|
|
283
|
-
if (res.dcmtsFound)
|
|
284
|
-
c += res.dcmtsFound;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
setTabCount2(c);
|
|
288
|
-
}, [result2]);
|
|
289
|
-
useEffect(() => { setSelectedItems([]); }, [currentSearchResult1, currentSearchResult2]);
|
|
290
|
-
// useEffect(() => {
|
|
291
|
-
// const handleTabChange = (e: any) => {
|
|
292
|
-
// if (e.key === 'ArrowLeft') {
|
|
293
|
-
// e.preventDefault();
|
|
294
|
-
// selectedTabIndex === 1 && setSelectedTabIndex(0)
|
|
295
|
-
// }
|
|
296
|
-
// if (e.key === 'ArrowRight') {
|
|
297
|
-
// e.preventDefault();
|
|
298
|
-
// selectedTabIndex === 0 && setSelectedTabIndex(1)
|
|
299
|
-
// }
|
|
300
|
-
// }
|
|
301
|
-
// window.addEventListener('keydown', handleTabChange)
|
|
302
|
-
// return () => window.removeEventListener('keydown', handleTabChange)
|
|
303
|
-
// }, [selectedTabIndex])
|
|
304
|
-
return (_jsxs(TMApplyForm, { isModal: isModal, formMode: FormModes.None, showApply: false, showUndo: false, hasNavigation: false, onClose: onClose, showBack: context === SearchResultContext.METADATA_SEARCH, customToolbarElements: SDK_Globals.tmSession?.SessionDescr?.appModuleID == AppModules.ORCHESTRATOR ? [] : isMobile && context !== SearchResultContext.METADATA_SEARCH && !hasBack ? mobileHeaderTitle : toolbar, children: [Array.isArray(result1)
|
|
305
|
-
?
|
|
306
|
-
_jsxs(TMSplitterLayout, { showSeparator: !isMobile, direction: 'horizontal', min: ['0', '0'], start: !isMobile ? ['20%', '80%'] : splitterSize, children: [_jsx(TMLayoutItem, { children: _jsxs("div", { style: { height: '100%', display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { width: '100%', height: 'calc(100% - 40px)' }, children: _jsx(TMListView, { orderBy: 'fromName', exprKey: 'fromTID', dataSource: selectedTabIndex === 0 ? result1 : result2 && Array.isArray(result2) ? result2 : [], customColor: '#0e7418', id: `workflow-approve-list-view${selectedTabIndex.toString()}`, itemTemplate: (data) => _jsx(WorfflowListItem, { data: data }), selectedItem: selectedTabIndex === 0 ? currentSearchResult1 : currentSearchResult2, onSelectionChanged: (e) => { if (selectedTabIndex === 0) {
|
|
307
|
-
setCurrentSearchResult1(e);
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
setCurrentSearchResult2(e);
|
|
311
|
-
} ; if (isMobile) {
|
|
312
|
-
setSplitterSize(['0', '100%']);
|
|
313
|
-
setHasBack(true);
|
|
314
|
-
} }, onItemDblClick: (e) => alert(e.fromName), searchKeys: ['fromTID', 'fromName'] }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: 10, alignItems: 'center', width: '100%', height: '40px', borderTop: '1px #e1e1e1 solid', borderBottom: '1px solid #e1e1e1' }, children: [_jsx(TabView, { clickable: result2 && Array.isArray(result2), count: tabCount1, icon: tabIcon1, onClick: () => setSelectedTabIndex(0), onMouseOut: () => setHoveredTab(undefined), onMouseOver: () => setHoveredTab(0), selectedTabBorderColor: selectedTabIndex === 0 ? '#0e7418' : hoveredTab === 0 ? '#c1c1c1' : 'transparent', title: tabTitle1 }), result2 && _jsx(TabView, { clickable: true, count: tabCount2, icon: tabIcon2, onClick: () => setSelectedTabIndex(1), onMouseOut: () => setHoveredTab(undefined), onMouseOver: () => setHoveredTab(1), selectedTabBorderColor: selectedTabIndex === 1 ? '#0e7418' : hoveredTab === 1 ? '#c1c1c1' : 'transparent', title: tabTitle2 })] })] }) }), _jsxs(TMLayoutItem, { children: [" ", _jsx(TMQueryResult, { onDblClick: () => alert('open form'), onSelectionChanged: (e) => setSelectedItems(e), result: selectedTabIndex === 0 ? currentSearchResult1 : currentSearchResult2, showHiddenSelectItems: showHiddenSelectItems, elapsedTime: elapsedTime, searchText: searchText })] })] })
|
|
315
|
-
:
|
|
316
|
-
_jsx(TMQueryResult, { onSelectionChanged: (e) => setSelectedItems(e), result: result1, showHiddenSelectItems: showHiddenSelectItems, elapsedTime: elapsedTime, searchText: searchText }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { onUpdate: onUpdate, selectedItems: selectedItems, op: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { onUpdate: onUpdate, selectedItems: selectedItems, op: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { onUpdate: onUpdate, selectedItems: selectedItems, onClose: () => setShowReAssignPopup(false) })] }));
|
|
317
|
-
};
|
|
318
|
-
export default TMQueryResultForm;
|
|
File without changes
|
|
File without changes
|