@topconsultnpm/sdkui-react-beta 6.12.37 → 6.12.38
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/Styled.d.ts +12 -0
- package/lib/components/base/Styled.js +49 -3
- package/lib/components/base/TMFloatingToolbar.d.ts +9 -0
- package/lib/components/base/TMFloatingToolbar.js +99 -0
- package/lib/components/base/TMRightSidebar.d.ts +0 -4
- package/lib/components/base/TMRightSidebar.js +2 -10
- package/lib/components/base/TMShowAllOrMaxItemsButton.d.ts +8 -0
- package/lib/components/base/TMShowAllOrMaxItemsButton.js +14 -0
- package/lib/components/base/TMTreeView.d.ts +27 -0
- package/lib/components/base/TMTreeView.js +199 -0
- package/lib/components/grids/TMBlogs.d.ts +84 -0
- package/lib/components/grids/TMBlogs.js +566 -0
- package/lib/components/grids/TMBlogsUtils.d.ts +83 -0
- package/lib/components/grids/TMBlogsUtils.js +258 -0
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/query/TMBatchUpdateForm.d.ts +12 -0
- package/lib/components/query/TMBatchUpdateForm.js +149 -0
- package/lib/components/query/TMDcmtBlog.d.ts +7 -0
- package/lib/components/query/TMDcmtBlog.js +33 -0
- package/lib/components/query/TMDcmtForm.d.ts +32 -0
- package/lib/components/query/TMDcmtForm.js +544 -0
- package/lib/components/query/TMDcmtIcon.d.ts +10 -0
- package/lib/components/query/TMDcmtIcon.js +52 -0
- package/lib/components/query/TMDcmtPreview.d.ts +26 -0
- package/lib/components/query/TMDcmtPreview.js +200 -0
- package/lib/components/query/TMFileUploader.d.ts +11 -0
- package/lib/components/query/TMFileUploader.js +101 -0
- package/lib/components/query/TMMasterDetailDcmts.d.ts +23 -0
- package/lib/components/query/TMMasterDetailDcmts.js +475 -0
- package/lib/components/query/TMQueryEditor.js +2 -2
- package/lib/components/query/TMQueryResultForm.d.ts +1 -7
- package/lib/components/query/TMQueryResultForm.js +1 -9
- package/lib/components/query/TMWorkflowPopup.d.ts +29 -0
- package/lib/components/query/TMWorkflowPopup.js +131 -0
- package/lib/components/search/TMSearchResult.d.ts +31 -0
- package/lib/components/search/TMSearchResult.js +727 -0
- package/lib/components/search/TMSearchResultsMenuItems.d.ts +6 -0
- package/lib/components/search/TMSearchResultsMenuItems.js +376 -0
- package/lib/helper/Enum_Localizator.d.ts +2 -1
- package/lib/helper/Enum_Localizator.js +20 -1
- package/lib/helper/SDKUI_Localizator.d.ts +24 -0
- package/lib/helper/SDKUI_Localizator.js +240 -0
- package/lib/helper/dcmtsHelper.d.ts +4 -0
- package/lib/helper/dcmtsHelper.js +15 -0
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +74 -1
- package/lib/helper/queryHelper.d.ts +7 -1
- package/lib/helper/queryHelper.js +105 -1
- package/lib/hooks/useDcmtOperations.d.ts +24 -0
- package/lib/hooks/useDcmtOperations.js +387 -0
- package/lib/hooks/useInputDialog.d.ts +5 -0
- package/lib/hooks/useInputDialog.js +73 -0
- package/lib/hooks/usePreventFileDrop.d.ts +3 -0
- package/lib/hooks/usePreventFileDrop.js +37 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -1
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/ts/types.d.ts +54 -1
- package/lib/ts/types.js +34 -0
- package/package.json +1 -1
@@ -0,0 +1,475 @@
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
3
|
+
import { DataColumnTypes, DcmtTypeListCacheService, MetadataDataDomains, MetadataFormats, RelationCacheService, RelationTypes, ResultTypes, SDK_Globals, SystemMIDs } from '@topconsultnpm/sdk-ts-beta';
|
4
|
+
import TMDcmtIcon from './TMDcmtIcon';
|
5
|
+
import { ContextMenu } from 'devextreme-react';
|
6
|
+
import { TMNothingToShow } from './TMDcmtPreview';
|
7
|
+
import TMDcmtForm from './TMDcmtForm';
|
8
|
+
import TMSearchResult from '../search/TMSearchResult';
|
9
|
+
import { genUniqueId, getExceptionMessage, IconFolder, IconShow, IconPreview, IconBoard, IconDcmtTypeSys, IconCheckFile, IconDetailDcmts, SDKUI_Localizator, svgToString, IconMail, IconDcmtTypeOnlyMetadata, IconCopy, IconMultipleSelection, IconMenuVertical } from '../../helper';
|
10
|
+
import { hasDetailRelations } from '../../helper/dcmtsHelper';
|
11
|
+
import { FormModes, SearchResultContext } from '../../ts';
|
12
|
+
import { TMColors } from '../../utils/theme';
|
13
|
+
import { StyledDivHorizontal, StyledBadge } from '../base/Styled';
|
14
|
+
import ShowAlert from '../base/TMAlert';
|
15
|
+
import TMButton from '../base/TMButton';
|
16
|
+
import { DeviceType } from '../base/TMDeviceProvider';
|
17
|
+
import { TMSplitterLayout, TMLayoutItem } from '../base/TMLayout';
|
18
|
+
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
19
|
+
import TMSpinner from '../base/TMSpinner';
|
20
|
+
import TMToolbarCard from '../base/TMToolbarCard';
|
21
|
+
import { TMLayoutWaitingContainer } from '../base/TMWaitPanel';
|
22
|
+
import { TMUserIdViewer } from '../choosers/TMUserChooser';
|
23
|
+
import { TMResultManager } from '../forms/TMResultDialog';
|
24
|
+
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../forms/TMSaveForm';
|
25
|
+
import TMDataListItemViewer from '../viewers/TMDataListItemViewer';
|
26
|
+
import { TMDcmtTypeTooltip } from '../viewers/TMTidViewer';
|
27
|
+
import TMTreeView from '../base/TMTreeView';
|
28
|
+
let abortController = new AbortController();
|
29
|
+
const TMMasterDetailDcmts = ({ deviceType, inputDcmts, isForMaster, showCurrentDcmtIndicator = true, allowNavigation, canNext, canPrev, onNext, onPrev, onBack, appendMasterDcmts, onTaskCreateRequest }) => {
|
30
|
+
const [id, setID] = useState('');
|
31
|
+
const [data, setData] = useState([]);
|
32
|
+
const [focusedItem, setFocusedItem] = useState();
|
33
|
+
const [selectedItems, setSelectedItems] = useState([]);
|
34
|
+
const [showPreview, setShowPreview] = useState(false);
|
35
|
+
const [showBoard, setShowBoard] = useState(false);
|
36
|
+
const [showSysMetadata, setShowSysMetadata] = useState(false);
|
37
|
+
const [showDcmtForm, setShowDcmtForm] = useState(true);
|
38
|
+
const [showZeroDcmts, setShowZeroDcmts] = useState(false);
|
39
|
+
const [isLoading, setIsLoading] = useState(false);
|
40
|
+
const [allowMultipleSelection, setAllowMultipleSelection] = useState(false);
|
41
|
+
const [dtdMaster, setDtdMaster] = useState();
|
42
|
+
const [showWaitPanel, setShowWaitPanel] = useState(false);
|
43
|
+
const [waitPanelTitle, setWaitPanelTitle] = useState('');
|
44
|
+
const [showPrimary, setShowPrimary] = useState(false);
|
45
|
+
const [waitPanelTextPrimary, setWaitPanelTextPrimary] = useState('');
|
46
|
+
const [waitPanelValuePrimary, setWaitPanelValuePrimary] = useState(0);
|
47
|
+
const [waitPanelMaxValuePrimary, setWaitPanelMaxValuePrimary] = useState(0);
|
48
|
+
useEffect(() => { setID(genUniqueId()); }, []);
|
49
|
+
useEffect(() => {
|
50
|
+
if (!inputDcmts || inputDcmts.length <= 0)
|
51
|
+
return;
|
52
|
+
setIsLoading(true);
|
53
|
+
loadDataAsync(inputDcmts, isForMaster).then(() => {
|
54
|
+
setIsLoading(false);
|
55
|
+
});
|
56
|
+
}, [JSON.stringify(inputDcmts), isForMaster]);
|
57
|
+
useEffect(() => {
|
58
|
+
setData(prevData => updateHiddenProperty(prevData));
|
59
|
+
}, [showZeroDcmts]);
|
60
|
+
const updateHiddenProperty = (nodes) => {
|
61
|
+
return nodes.map(node => {
|
62
|
+
const updatedNode = { ...node, hidden: !showZeroDcmts && node.isZero };
|
63
|
+
if (node.items) {
|
64
|
+
updatedNode.items = updateHiddenProperty(node.items);
|
65
|
+
}
|
66
|
+
return updatedNode;
|
67
|
+
});
|
68
|
+
};
|
69
|
+
/** Load initial detail documents (1 level) */
|
70
|
+
const loadDataAsync = async (dcmts, calcMaster) => {
|
71
|
+
// TMSpinner.show({ description: 'Caricamento documenti ...' });
|
72
|
+
let operationTitle = "Caricamento documenti dettaglio";
|
73
|
+
setWaitPanelTitle(operationTitle);
|
74
|
+
setShowWaitPanel(true);
|
75
|
+
setShowPrimary(true);
|
76
|
+
abortController = new AbortController();
|
77
|
+
setWaitPanelMaxValuePrimary(dcmts.length);
|
78
|
+
let data = [];
|
79
|
+
// try {
|
80
|
+
let mDcmts = dcmts;
|
81
|
+
if (calcMaster) {
|
82
|
+
setDtdMaster(await DcmtTypeListCacheService.GetAsync(dcmts[0].TID));
|
83
|
+
let mResults = await SDK_Globals.tmSession?.NewSearchEngine().GetAllMasterDcmtsAsync(dcmts[0].TID, dcmts[0].DID) ?? [];
|
84
|
+
mDcmts = [];
|
85
|
+
for (const searchResult of mResults) {
|
86
|
+
let source = await searchResultToDataSource(searchResult);
|
87
|
+
for (const row of source) {
|
88
|
+
mDcmts.push({ TID: row?.TID?.value, DID: row?.DID?.value });
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
let operationResult = [];
|
93
|
+
let i = 0;
|
94
|
+
for (const dcmt of mDcmts) {
|
95
|
+
try {
|
96
|
+
if (abortController.signal.aborted) {
|
97
|
+
operationResult.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.WARNING, description: `Operazione interrotta. Elaborati ${i + 1} documenti` });
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
setWaitPanelTextPrimary(`Caricamento correlazione ${i + 1} di ${mDcmts.length}`);
|
101
|
+
let result = await SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(dcmt.TID, dcmt.DID, false);
|
102
|
+
for (const dc of result?.dtdResult?.columns ?? []) {
|
103
|
+
if (!dc.extendedProperties)
|
104
|
+
continue;
|
105
|
+
let mid = Number(dc.extendedProperties["MID"] ?? "0");
|
106
|
+
if (mid > 100)
|
107
|
+
continue;
|
108
|
+
dc.extendedProperties["Visibility"] = "Hidden";
|
109
|
+
}
|
110
|
+
let dtd = await DcmtTypeListCacheService.GetAsync(dcmt.TID);
|
111
|
+
let mValues = await searchResultToDataSource(result);
|
112
|
+
let details = await getDetailDcmtsAsync(dcmt.TID, dcmt.DID, 1, false);
|
113
|
+
let masterDcmt = { tid: dcmt.TID, did: dcmt.DID, key: `${dcmt.TID}_${dcmt.DID}_root`, expanded: data.length <= 0, isDcmt: true, isContainer: false, values: mValues?.[0], items: details, itemsCount: details.length };
|
114
|
+
let masterDcmtTypeContainer = data.find(o => o.tid === dcmt.TID);
|
115
|
+
if (masterDcmtTypeContainer) {
|
116
|
+
result?.dtdResult?.rows && masterDcmtTypeContainer.searchResult?.[0].dtdResult?.rows?.push(result?.dtdResult?.rows[0]);
|
117
|
+
masterDcmtTypeContainer.items?.push(masterDcmt);
|
118
|
+
masterDcmtTypeContainer.itemsCount++;
|
119
|
+
}
|
120
|
+
else {
|
121
|
+
let newMasterDcmtTypeContainer = {
|
122
|
+
tid: dcmt.TID,
|
123
|
+
dtd: dtd,
|
124
|
+
did: undefined,
|
125
|
+
name: result?.fromName,
|
126
|
+
key: `${dcmt.TID}_${0}`,
|
127
|
+
isContainer: true,
|
128
|
+
isLoaded: true,
|
129
|
+
isRoot: true,
|
130
|
+
searchResult: result ? [result] : [],
|
131
|
+
items: [masterDcmt],
|
132
|
+
itemsCount: 1,
|
133
|
+
expanded: data.length <= 0
|
134
|
+
};
|
135
|
+
data.push(newMasterDcmtTypeContainer);
|
136
|
+
}
|
137
|
+
i++;
|
138
|
+
setWaitPanelValuePrimary(i);
|
139
|
+
operationResult.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.SUCCESS });
|
140
|
+
}
|
141
|
+
catch (ex) {
|
142
|
+
operationResult.push({ rowIndex: i, id1: dcmt.TID, id2: dcmt.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(ex) });
|
143
|
+
const err = ex;
|
144
|
+
if (err.name === 'CanceledError') {
|
145
|
+
ShowAlert({ message: err.message, mode: 'warning', duration: 3000, title: 'Abort' });
|
146
|
+
}
|
147
|
+
}
|
148
|
+
}
|
149
|
+
deviceType !== DeviceType.MOBILE && setFocusedItem(data[0]);
|
150
|
+
setData(updateHiddenProperty(data));
|
151
|
+
setWaitPanelTextPrimary('');
|
152
|
+
setWaitPanelMaxValuePrimary(0);
|
153
|
+
setWaitPanelValuePrimary(0);
|
154
|
+
setShowWaitPanel(false);
|
155
|
+
TMResultManager.show(operationResult, operationTitle, "TID", "DID");
|
156
|
+
// }
|
157
|
+
// catch (e: any) { TMExceptionBoxManager.show({ exception: e }) }
|
158
|
+
// finally { TMSpinner.hide() }
|
159
|
+
};
|
160
|
+
/** check if relation (relationID) is ManyToMany */
|
161
|
+
const isManyToManyRelation = async (relationID) => {
|
162
|
+
let allRelations = await RelationCacheService.GetAllAsync();
|
163
|
+
let rdlManyToMany = allRelations.filter(o => o.relationType == RelationTypes.ManyToMany && o.id === relationID) ?? [];
|
164
|
+
return rdlManyToMany.length > 0;
|
165
|
+
};
|
166
|
+
/** Retrieve all detail dcmts of masterTID and masterDID */
|
167
|
+
const getDetailDcmtsAsync = async (mTID, mDID, maxLevel, showSpinner) => {
|
168
|
+
let items = [];
|
169
|
+
if (!mTID)
|
170
|
+
return [];
|
171
|
+
if (!mDID)
|
172
|
+
return [];
|
173
|
+
if (maxLevel <= 0)
|
174
|
+
return [];
|
175
|
+
let dcmtTypeHasRel = await hasDetailRelations(mTID);
|
176
|
+
if (!dcmtTypeHasRel)
|
177
|
+
return [];
|
178
|
+
try {
|
179
|
+
showSpinner && TMSpinner.show({ description: 'Caricamento documenti ...' });
|
180
|
+
let results = await SDK_Globals.tmSession?.NewSearchEngine().GetAllDetailDcmtsAsync(mTID, mDID) ?? [];
|
181
|
+
for (const searchResult of results) {
|
182
|
+
let containerGUID = genUniqueId();
|
183
|
+
let dtd = await DcmtTypeListCacheService.GetAsync(searchResult.fromTID);
|
184
|
+
let newDcmtTypeContainer = {
|
185
|
+
tid: searchResult.fromTID,
|
186
|
+
dtd: dtd,
|
187
|
+
did: undefined,
|
188
|
+
key: `${searchResult.fromTID}_${searchResult.relationID}_${mTID}_${mDID}_${containerGUID}`,
|
189
|
+
name: searchResult.fromName,
|
190
|
+
isContainer: true,
|
191
|
+
relationId: searchResult.relationID,
|
192
|
+
isManyToMany: await isManyToManyRelation(searchResult.relationID),
|
193
|
+
searchResult: [searchResult],
|
194
|
+
isZero: (searchResult.dcmtsFound ?? 0) <= 0,
|
195
|
+
itemsCount: (searchResult.dcmtsFound ?? 0)
|
196
|
+
};
|
197
|
+
let source = await searchResultToDataSource(searchResult);
|
198
|
+
if (source && source.length > 0) {
|
199
|
+
let dcmtDetails = [];
|
200
|
+
for (const row of source) {
|
201
|
+
let rowGUID = genUniqueId();
|
202
|
+
dcmtDetails.push({
|
203
|
+
tid: row?.TID?.value,
|
204
|
+
did: row?.DID?.value,
|
205
|
+
key: `${row?.TID?.value}_${row?.DID?.value}_${searchResult.relationID}_${mTID}_${mDID}_${rowGUID}`,
|
206
|
+
isDcmt: true,
|
207
|
+
isContainer: false,
|
208
|
+
values: row,
|
209
|
+
searchResult: [searchResult],
|
210
|
+
itemsCount: 0
|
211
|
+
// items: await getDetailDcmtsAsync(row?.TID, row?.DID, maxLevel - 1)
|
212
|
+
});
|
213
|
+
}
|
214
|
+
newDcmtTypeContainer.items = dcmtDetails;
|
215
|
+
}
|
216
|
+
items.push(newDcmtTypeContainer);
|
217
|
+
}
|
218
|
+
}
|
219
|
+
catch (e) {
|
220
|
+
TMExceptionBoxManager.show({ exception: e });
|
221
|
+
}
|
222
|
+
finally {
|
223
|
+
showSpinner && TMSpinner.hide();
|
224
|
+
}
|
225
|
+
return items;
|
226
|
+
};
|
227
|
+
/** Render each TreeView item with custom styling/icons */
|
228
|
+
const renderItem = useCallback((itemData) => {
|
229
|
+
return (!itemData ? _jsx(_Fragment, {}) :
|
230
|
+
_jsxs("div", { style: { minWidth: '90px', width: '100%', display: 'flex', marginLeft: itemData.did ? '5px' : '0px', gap: itemData.did ? '15px' : '10px', alignItems: 'center', opacity: !itemData.isDcmt && (itemData.items?.length ?? 0) <= 0 ? 0.5 : 1 }, children: [itemData.did && showCurrentDcmtIndicator && itemData.did === inputDcmts?.[0].DID ? _jsx(IconBackhandIndexPointingRight, { fontSize: 22, overflow: 'visible' }) : _jsx(_Fragment, {}), itemData.did
|
231
|
+
? _jsx(TMDcmtIcon, { fileExtension: itemData.values?.FILEEXT?.value, fileCount: itemData.values?.FILECOUNT?.value, isLexProt: itemData.values?.IsLexProt?.value, isMail: itemData.values?.ISMAIL?.value, isShared: itemData.values?.ISSHARED?.value, isSigned: itemData.values?.ISSIGNED?.value })
|
232
|
+
: itemData.dtd && _jsx(TMDcmtTypeTooltip, { dtd: itemData.dtd, children: _jsx("div", { style: { position: 'relative' }, children: _jsx(IconFolder, { color: itemData.isManyToMany ? '#ff8f44' : '#e6c200', fontSize: 28 }) }) }), itemData.did
|
233
|
+
?
|
234
|
+
// <TMTooltip content={
|
235
|
+
// <StyledTooltipContainer style={{ gap: '3px' }}>
|
236
|
+
// <TMTidViewer tid={itemData.tid} showIcon showId />
|
237
|
+
// <StyledTooltipSeparatorItem />
|
238
|
+
// {
|
239
|
+
// getMetadataKeys(itemData.values).map((key, index) => {
|
240
|
+
// let md = itemData.values?.[key].md as MetadataDescriptor;
|
241
|
+
// let value = itemData.values?.[key].value;
|
242
|
+
// return (
|
243
|
+
// <StyledDivHorizontal key={`${key}_${index}`} style={{ gap: '3px' }} >
|
244
|
+
// <p style={{ fontSize: '1rem' }}>{`${key}: `}</p>
|
245
|
+
// {
|
246
|
+
// md.dataDomain == MetadataDataDomains.DataList ?
|
247
|
+
// <TMDataListItemViewer dataListId={md.dataListID} viewMode={md.dataListViewMode} value={value} />
|
248
|
+
// : md.dataDomain == MetadataDataDomains.UserID ?
|
249
|
+
// <TMUserIdViewer userId={value as number} showIcon noneSelectionText='' />
|
250
|
+
// :
|
251
|
+
// <p style={{ fontSize: '1rem', fontWeight: 600 }}>{value}</p>
|
252
|
+
// }
|
253
|
+
// </StyledDivHorizontal>
|
254
|
+
// )
|
255
|
+
// })
|
256
|
+
// }
|
257
|
+
// </StyledTooltipContainer>
|
258
|
+
// }>
|
259
|
+
_jsx(StyledDivHorizontal, { style: { whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: getDcmtDisplayValue(itemData.values).map((key, index) => {
|
260
|
+
let md = itemData.values?.[key].md;
|
261
|
+
let value = itemData.values?.[key].value;
|
262
|
+
return (_jsxs(StyledDivHorizontal, { children: [index > 0 && _jsx("p", { style: { marginRight: '2px' }, children: ";" }), md.dataDomain == MetadataDataDomains.DataList ?
|
263
|
+
_jsx(TMDataListItemViewer, { dataListId: md.dataListID, viewMode: md.dataListViewMode, value: value })
|
264
|
+
: md.dataDomain == MetadataDataDomains.UserID ?
|
265
|
+
_jsx(TMUserIdViewer, { userId: value, showIcon: true, noneSelectionText: '' })
|
266
|
+
:
|
267
|
+
_jsx("p", { style: { fontSize: '1rem' }, children: value })] }, `${key}_${index}`));
|
268
|
+
}) })
|
269
|
+
// </TMTooltip>
|
270
|
+
: _jsxs(StyledDivHorizontal, { style: { gap: 5, overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: [_jsx("p", { style: { whiteSpace: 'nowrap', textOverflow: 'ellipsis' }, children: itemData.name }), _jsx(StyledBadge, { "$backgroundColor": TMColors.info, children: itemData.items?.length })] })] }));
|
271
|
+
}, []);
|
272
|
+
/** Function for calculate related documents */
|
273
|
+
const calculateItemsForNode = async (node) => {
|
274
|
+
if (node.isDcmt)
|
275
|
+
return node.items;
|
276
|
+
let newItems = [];
|
277
|
+
for (const dcmt of node.items ?? []) {
|
278
|
+
dcmt.items = await getDetailDcmtsAsync(dcmt.tid, dcmt.did, 1, true);
|
279
|
+
newItems.push(dcmt);
|
280
|
+
}
|
281
|
+
node.isLoaded = true;
|
282
|
+
return newItems;
|
283
|
+
};
|
284
|
+
const handleFocusedItemChanged = useCallback((item) => {
|
285
|
+
setFocusedItem(item);
|
286
|
+
}, []);
|
287
|
+
const handleSelectedItemsChanged = useCallback((items) => {
|
288
|
+
setSelectedItems(items);
|
289
|
+
}, []);
|
290
|
+
const sideBarItems = [
|
291
|
+
{ icon: _jsx(IconShow, {}), id: 'Preview', visibleName: 'Anteprima', isActive: showPreview, onClick: () => { setShowPreview(!showPreview); } },
|
292
|
+
{ icon: _jsx(IconPreview, {}), id: 'DcmtForm', visibleName: 'Form', isActive: showDcmtForm, onClick: () => { setShowDcmtForm(!showDcmtForm); } },
|
293
|
+
{ icon: _jsx(IconBoard, {}), id: 'Board', visibleName: 'Bacheca', beginGroup: true, isActive: showBoard, onClick: () => { setShowSysMetadata(false); setShowBoard(!showBoard); } },
|
294
|
+
{ icon: _jsx(IconDcmtTypeSys, {}), id: 'SystemMetadata', visibleName: 'Metadati di sistema', isActive: showSysMetadata, onClick: () => { setShowBoard(false); setShowSysMetadata(!showSysMetadata); } },
|
295
|
+
{ icon: _jsx(IconCheckFile, {}), id: 'allowZeroRelations', visibleName: 'Consenti dettagli con 0 documenti', beginGroup: true, isActive: showZeroDcmts, onClick: () => { setShowZeroDcmts(!showZeroDcmts); } },
|
296
|
+
{ icon: _jsx(IconDetailDcmts, { fontSize: 20, transform: 'scale(-1, 1)' }), id: 'Master', beginGroup: true, visible: isForMaster, disabled: !focusedItem?.isDcmt, visibleName: SDKUI_Localizator.DcmtsMaster, onClick: () => { appendMasterDcmts?.(focusedItem?.tid, focusedItem?.did); } }
|
297
|
+
];
|
298
|
+
const commandsMenuItems = [
|
299
|
+
{
|
300
|
+
icon: svgToString(_jsx(IconMail, {})),
|
301
|
+
text: "Invia per posta",
|
302
|
+
operationType: 'multiRow',
|
303
|
+
disabled: false,
|
304
|
+
items: [
|
305
|
+
{
|
306
|
+
icon: svgToString(_jsx(IconMail, {})),
|
307
|
+
text: "I documenti selezionati",
|
308
|
+
operationType: 'multiRow',
|
309
|
+
disabled: false,
|
310
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
311
|
+
},
|
312
|
+
{
|
313
|
+
icon: svgToString(_jsx(IconMail, {})),
|
314
|
+
text: "I documenti di primo livello e tutti i documenti correlati",
|
315
|
+
operationType: 'multiRow',
|
316
|
+
disabled: false,
|
317
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
318
|
+
},
|
319
|
+
{
|
320
|
+
icon: svgToString(_jsx(IconMail, {})),
|
321
|
+
text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
|
322
|
+
operationType: 'multiRow',
|
323
|
+
disabled: false,
|
324
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
325
|
+
},
|
326
|
+
]
|
327
|
+
},
|
328
|
+
{
|
329
|
+
icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
|
330
|
+
text: "Unisci in un file PDF",
|
331
|
+
operationType: 'multiRow',
|
332
|
+
disabled: false,
|
333
|
+
items: [
|
334
|
+
{
|
335
|
+
icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
|
336
|
+
text: "I documenti selezionati",
|
337
|
+
operationType: 'multiRow',
|
338
|
+
disabled: false,
|
339
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
340
|
+
},
|
341
|
+
{
|
342
|
+
icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
|
343
|
+
text: "I documenti di primo livello e tutti i documenti correlati",
|
344
|
+
operationType: 'multiRow',
|
345
|
+
disabled: false,
|
346
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
347
|
+
},
|
348
|
+
{
|
349
|
+
icon: svgToString(_jsx(IconDcmtTypeOnlyMetadata, {})),
|
350
|
+
text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
|
351
|
+
operationType: 'multiRow',
|
352
|
+
disabled: false,
|
353
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
354
|
+
},
|
355
|
+
]
|
356
|
+
},
|
357
|
+
{
|
358
|
+
icon: svgToString(_jsx(IconCopy, {})),
|
359
|
+
text: "Copia in una cartella",
|
360
|
+
operationType: 'multiRow',
|
361
|
+
disabled: false,
|
362
|
+
items: [
|
363
|
+
{
|
364
|
+
icon: svgToString(_jsx(IconCopy, {})),
|
365
|
+
text: "I documenti selezionati",
|
366
|
+
operationType: 'multiRow',
|
367
|
+
disabled: false,
|
368
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
369
|
+
},
|
370
|
+
{
|
371
|
+
icon: svgToString(_jsx(IconCopy, {})),
|
372
|
+
text: "I documenti di primo livello e tutti i documenti correlati",
|
373
|
+
operationType: 'multiRow',
|
374
|
+
disabled: false,
|
375
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
376
|
+
},
|
377
|
+
{
|
378
|
+
icon: svgToString(_jsx(IconCopy, {})),
|
379
|
+
text: "I documenti di primo livello e i documenti correlati personalizzando l'operazione",
|
380
|
+
operationType: 'multiRow',
|
381
|
+
disabled: false,
|
382
|
+
onClick: () => ShowAlert({ message: "TODO", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
383
|
+
},
|
384
|
+
]
|
385
|
+
}
|
386
|
+
];
|
387
|
+
const toolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowMultipleSelection && _jsx("p", { style: { color: TMColors.colorHeader, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${selectedItems.length} selezionati` }), _jsx(TMButton, { btnStyle: 'icon', caption: 'Selezione multipla', icon: _jsx(IconMultipleSelection, { fontSize: 16, color: allowMultipleSelection ? TMColors.tertiary : 'white' }), onClick: () => setAllowMultipleSelection(!allowMultipleSelection) }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: false, formMode: FormModes.ReadOnly, canNext: canNext, onNext: onNext }), _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` })] });
|
388
|
+
const getTitle = () => isForMaster ? `${SDKUI_Localizator.DcmtsMaster} - ${dtdMaster?.nameLoc}` : SDKUI_Localizator.DcmtsDetail;
|
389
|
+
return (_jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, isCancelable: true, abortController: abortController, children: _jsxs(TMSplitterLayout, { direction: 'horizontal', showSeparator: focusedItem != undefined, separatorColor: 'transparent', separatorActiveColor: 'transparent', min: ['0', '0'], start: focusedItem && (showDcmtForm || showPreview || showBoard || showSysMetadata) ? deviceType != DeviceType.MOBILE ? ["40%", "60%"] : ["0%", "100%"] : ["100%", "0%"], children: [_jsx(TMToolbarCard, { title: getTitle(), toolbar: toolbar, items: sideBarItems, onBack: onBack, children: isLoading ? _jsx(_Fragment, {}) :
|
390
|
+
data.length <= 0
|
391
|
+
?
|
392
|
+
_jsx(TMNothingToShow, { text: getTitle(), secondText: SDKUI_Localizator.NoDataToDisplay, icon: isForMaster ? _jsx(IconDetailDcmts, { fontSize: 96, transform: 'scale(-1, 1)' }) : _jsx(IconDetailDcmts, { fontSize: 96 }) })
|
393
|
+
:
|
394
|
+
_jsx(TMTreeView, { dataSource: data, allowMultipleSelection: allowMultipleSelection, calculateItemsForNode: calculateItemsForNode, itemRender: renderItem, focusedItem: focusedItem, selectedItems: selectedItems, onFocusedItemChanged: handleFocusedItemChanged, onSelectionChanged: handleSelectedItemsChanged, onDataChanged: (items) => setData(updateHiddenProperty(items)) }) }), _jsx(TMLayoutItem, { children: focusedItem?.isDcmt ?
|
395
|
+
_jsx(TMDcmtForm, { TID: focusedItem?.tid, DID: focusedItem.did, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: deviceType === DeviceType.MOBILE, showPreview: showPreview, showBoard: showBoard, showSysMetadata: showSysMetadata, showDcmtForm: showDcmtForm, onClose: () => { setShowDcmtForm(false); }, onClosePreview: () => { setShowPreview(false); } }) :
|
396
|
+
_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onClose: () => { setShowDcmtForm(false); }, onClosePreview: () => { setShowPreview(false); }, onTaskCreateRequest: onTaskCreateRequest }) })] }, "TMDetails-panel") }));
|
397
|
+
};
|
398
|
+
export default TMMasterDetailDcmts;
|
399
|
+
function getMetadataKeys(obj) {
|
400
|
+
if (!obj)
|
401
|
+
return [];
|
402
|
+
let keys = Object.keys(obj);
|
403
|
+
let sysMIDs = Object.values(SystemMIDs).map(o => o.toUpperCase());
|
404
|
+
return keys.filter(k => obj?.[k].value && !sysMIDs.includes(k)).filter(o => o !== "rowIndex" && o !== "ISLEXPROT");
|
405
|
+
}
|
406
|
+
function getDcmtDisplayValue(obj) {
|
407
|
+
let mdKeys = getMetadataKeys(obj);
|
408
|
+
if (mdKeys.includes("SYS_Abstract"))
|
409
|
+
return ["SYS_Abstract"];
|
410
|
+
return mdKeys.slice(0, 5);
|
411
|
+
}
|
412
|
+
const searchResultToDataSource = async (searchResult, hideSysMetadata) => {
|
413
|
+
let rows = searchResult?.dtdResult?.rows ?? [];
|
414
|
+
let tid = searchResult?.fromTID;
|
415
|
+
let dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
416
|
+
let output = [];
|
417
|
+
for (let index = 0; index < rows.length; index++) {
|
418
|
+
let item = { rowIndex: index };
|
419
|
+
let row = rows[index];
|
420
|
+
for (let i = 0; i < row.length; i++) {
|
421
|
+
let mid = Number(searchResult?.dtdResult?.columns?.[i]?.extendedProperties?.["MID"] ?? "0");
|
422
|
+
if (hideSysMetadata && mid < 100)
|
423
|
+
continue;
|
424
|
+
let key = searchResult?.dtdResult?.columns?.[i].caption ?? '';
|
425
|
+
if (mid <= 100)
|
426
|
+
key = key.toUpperCase();
|
427
|
+
let value = row[i];
|
428
|
+
let md = dtd?.metadata?.find(o => o.id == mid);
|
429
|
+
item[key] = { md: md, value: getDisplayValueByColumn(searchResult?.dtdResult?.columns?.[i], value) };
|
430
|
+
}
|
431
|
+
output.push(item);
|
432
|
+
}
|
433
|
+
return output;
|
434
|
+
};
|
435
|
+
const getDisplayValueByColumn = (col, value) => {
|
436
|
+
if (!value)
|
437
|
+
return value;
|
438
|
+
if (!col)
|
439
|
+
return value;
|
440
|
+
if (col.dataType === DataColumnTypes.Text)
|
441
|
+
return value;
|
442
|
+
const format = MetadataFormats[(col.extendedProperties?.["Format"] ?? "None")];
|
443
|
+
const formatCulture = col.extendedProperties?.["FormatCulture"] ?? window.navigator.language;
|
444
|
+
if (col.dataType === DataColumnTypes.DateTime) {
|
445
|
+
let date = new Date(value);
|
446
|
+
switch (format) {
|
447
|
+
case MetadataFormats.ShortDate: return date.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
|
448
|
+
case MetadataFormats.ShortTime: return date.toLocaleString(formatCulture, { timeStyle: 'short' });
|
449
|
+
case MetadataFormats.ShortDateLongTime: return date.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit', second: '2-digit' } : { dateStyle: 'short', timeStyle: 'medium' }).replace(',', '');
|
450
|
+
case MetadataFormats.ShortDateShortTime: return date.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit", hour: '2-digit', minute: '2-digit' } : { dateStyle: 'short', timeStyle: 'short' }).replace(',', '');
|
451
|
+
case MetadataFormats.LongDate: return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric" });
|
452
|
+
case MetadataFormats.LongTime: return date.toLocaleString(formatCulture, { timeStyle: 'medium' });
|
453
|
+
case MetadataFormats.LongDateLongTime: return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
454
|
+
case MetadataFormats.LongDateShortTime: return date.toLocaleString(formatCulture, { weekday: "long", year: "numeric", month: "long", day: "numeric", hour: '2-digit', minute: '2-digit' });
|
455
|
+
default: return date.toLocaleString(formatCulture, formatCulture == "it-IT" ? { year: "numeric", month: "2-digit", day: "2-digit" } : { dateStyle: 'short' });
|
456
|
+
}
|
457
|
+
}
|
458
|
+
if (col.dataType === DataColumnTypes.Number) {
|
459
|
+
return value.toLocaleString(formatCulture, { useGrouping: format == MetadataFormats.NumberWithThousandsSeparator });
|
460
|
+
}
|
461
|
+
if (format == MetadataFormats.None)
|
462
|
+
return value;
|
463
|
+
if (format == MetadataFormats.CurrencyEuro)
|
464
|
+
return value.toLocaleString({ type: 'currency', precision: 2, currency: "EUR" });
|
465
|
+
if (format == MetadataFormats.CurrencyDollar)
|
466
|
+
return value.toLocaleString({ type: 'currency', precision: 2, currency: "USD" });
|
467
|
+
if (format == MetadataFormats.CurrencyPound)
|
468
|
+
return value.toLocaleString({ type: 'currency', precision: 2, currency: "GBP" });
|
469
|
+
if (format == MetadataFormats.CurrencyYen)
|
470
|
+
return value.toLocaleString({ type: 'currency', currency: "JPY" });
|
471
|
+
return value;
|
472
|
+
};
|
473
|
+
export function IconBackhandIndexPointingRight(props) {
|
474
|
+
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 128 128", width: "1em", height: "1em", ...props, children: [_jsx("path", { fill: "#E0BB95", d: "M58.7 41.1c10.8.1 53.3.4 54.9.4c12.8.3 12.7 16.7.7 16.9c-1.5 0-25 1.1-32.2 1.3c5.2 2 7.5 11.9-3.1 14.9c5 2.6 6.4 12.9-4.2 14.7c3.8 2.5 4.3 10.9-6 14.2c-8.4 2.7-28.2 2-40.3-2.3c-9.1-3.3-8.4-5.8-16.7-5.6c-1.4 0-2.1-1.1-2.4-2.4c-1.3-5.9-1.9-26.3-.3-33.8c.4-1.6 1.7-1.8 2.2-1.9c2.1-.4 4.2-2.5 5-4.3c3.2-6.4 12.8-12.8 23.4-18.2c5.5-2.8 9.2-8.8 10.4-18.3c.8-6.3 8.6-7.7 11.8-2.5c2.2 3.6 2.9 7 2.9 10.4c.2 6.2-1.6 10.1-6.1 16.5" }), _jsx("defs", { children: _jsx("path", { id: "notoBackhandIndexPointingRightMediumLightSkinTone0", d: "M58.7 41.1c10.8.1 53.3.4 54.9.4c12.8.3 12.7 16.7.7 16.9c-1.5 0-25 1.1-32.2 1.3c5.2 2 7.5 11.9-3.1 14.9c5 2.6 6.4 12.9-4.2 14.7c3.8 2.5 4.3 10.9-6 14.2c-8.4 2.7-28.2 2-40.3-2.3c-9.1-3.3-8.4-5.8-16.7-5.6c-1.4 0-2.1-1.1-2.4-2.4c-1.3-5.9-1.9-26.3-.3-33.8c.4-1.6 1.7-1.8 2.2-1.9c2.1-.4 4.2-2.5 5-4.3c3.2-6.4 12.8-12.8 23.4-18.2c5.5-2.8 9.2-8.8 10.4-18.3c.8-6.3 8.6-7.7 11.8-2.5c2.2 3.6 2.9 7 2.9 10.4c.2 6.2-1.6 10.1-6.1 16.5" }) }), _jsx("clipPath", { id: "notoBackhandIndexPointingRightMediumLightSkinTone1", children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone0" }) }), _jsx("g", { fill: "#D19661", clipPath: "url(#notoBackhandIndexPointingRightMediumLightSkinTone1)", children: _jsx("path", { d: "M73.3 59.5c.1 1.6 2.8 2.9 2.8 6.4c0 3.7-3 4.7-3.1 7.5c-.1 2.7 2 3.8 1.5 7.7c-.6 4.5-4.1 4-4.2 7.1c0 2.7 1.8 3.2 1.8 6.6c0 3.1-3 5.8-5.5 7s-1.2 3.4 0 3.4s11.9-1.3 14.5-8.2c3-8 11-29.6 8.8-36.9c-7.1-1-11.5-1.6-13.7-1.8c-.7-.1-2.9-.6-2.9 1.2M60.1 40.7c0 .9.1 1.5 1 1.5c1 0 43.6 2.1 51.6 2.3c9.2.2 8.7 7.6 5.9 10.1c-1.9 1.7.6 4 2.2 2.6s4.4-3.4 4.3-8.4s-4.4-8.6-8.4-8.9c-3.8-.3-56.6.8-56.6.8m-51.9 21c15.9 0 14.1-11.7 25.2-18.9c15.4-10.1 16.3-11.1 19.7-25.2c1.2-4.9 5.7-4.4 7.7-2.1s4.9-1.3 3.6-2.7s-7.8-7.7-14.8-1.1s-42 46.2-42 46.2z" }) }), _jsx("defs", { children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone0", id: "notoBackhandIndexPointingRightMediumLightSkinTone2" }) }), _jsx("clipPath", { id: "notoBackhandIndexPointingRightMediumLightSkinTone3", children: _jsx("use", { href: "#notoBackhandIndexPointingRightMediumLightSkinTone2" }) }), _jsx("g", { fill: "#8D542E", clipPath: "url(#notoBackhandIndexPointingRightMediumLightSkinTone3)", children: _jsx("path", { d: "M58.7 41.1h-1.9c-.4 0-.8-.4-.2-1.3s5.8-8 5.8-15c0-3.2-.5-7.7-3.4-12.4c-.6-.9.2-1.4.9-1c.7.5 6.4 3.2 6.5 13.4s-7.7 16.3-7.7 16.3m65.1 8.8c-.5 0-1.1-.2-1.7 1c-.7 1.5-3.1 4.4-8.4 4.7s-38.1 2.5-38.9 2.5c-1.1 0-1.2 1.9.1 1.8c1.7-.1 7.2-.2 7.2-.2s30.9 1.8 36.9-.6c6.1-2.4 4.8-9.2 4.8-9.2M86.6 68.5c-.3-.1-.7-.1-1 .3c-1.5 2-4.6 3.5-10.6 3.3c-1.4 0-1.6 2.7.1 2.7c.7 0 4-.1 4-.1l6.6-.2zm-3.6 15c-.3-.1-.7-.1-1.1.4c-1.5 2-3.5 2.8-9.7 3c-1.5.1-1.4 2.6.2 2.6c1.1 0 2.4-.1 2.4-.1l7-.6zm-5.4 12.7c-.3-.1-.8-.2-1.2.4c-.8 1.1-2.9 3-7.5 4.4c-3.7 1.1-21.3 1.9-32.5-.7c-2.3-.5-9.9-3-13.6-5.3s-7.3-1.6-8.3-1.4s-6.3.7-6.3.7l2.5 3.7l27 8.6l38.5-.6z" }) })] }));
|
475
|
+
}
|
@@ -6,7 +6,7 @@ import Accordion, { Item } from 'devextreme-react/accordion';
|
|
6
6
|
import { SDKUI_Localizator, IconSearch, IconCount, getQueryCountAsync, calcIsModified, IconClear, IconAddCircleOutline, IconDotsVerticalCircleOutline, IconHide, IconShow, IconDraggabledots, genUniqueId, LocalizeQueryOperators, LocalizeQueryFunctions, LocalizeQueryJoinTypes, IconArchiveDoc, IconArrowRight, svgToString } from '../../helper';
|
7
7
|
import { displayMetadataValue, getDcmtTypesByQdAsync, getTIDsByQd, IsParametricQuery, prepareQdForSearchAsync } from '../../helper/queryHelper';
|
8
8
|
import { useOutsideClick } from '../../hooks/useOutsideClick';
|
9
|
-
import { FormModes } from '../../ts';
|
9
|
+
import { FormModes, SearchResultContext } from '../../ts';
|
10
10
|
import { TMColors } from '../../utils/theme';
|
11
11
|
import { StyledDivHorizontal, StyledDraggableDiv, StyledModalContainer } from '../base/Styled';
|
12
12
|
import TMButton from '../base/TMButton';
|
@@ -26,7 +26,7 @@ import { getDisplayAlias } from '../viewers/TMMidViewer';
|
|
26
26
|
import { useApplyForm } from '../../hooks/useForm';
|
27
27
|
import ShowAlert from '../base/TMAlert';
|
28
28
|
import { TMDynDataListItemChooserForm } from '../choosers/TMDynDataListItemChooser';
|
29
|
-
import TMQueryResultForm
|
29
|
+
import TMQueryResultForm from './TMQueryResultForm';
|
30
30
|
import TMMetadataEditor from '../editors/TMMetadataEditor';
|
31
31
|
import { ContextMenu } from 'devextreme-react';
|
32
32
|
import { useQueryParametersDialog } from '../../hooks/useQueryParametersDialog';
|
@@ -1,11 +1,5 @@
|
|
1
1
|
import { SearchResultDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
2
|
-
|
3
|
-
METADATA_SEARCH = "metadataSearch",
|
4
|
-
WORKFLOW_APPROVE = "workflowApprove",
|
5
|
-
FAVORITES = "favorites",
|
6
|
-
RECENT = "recent",
|
7
|
-
FREE_SEARCH = "freeSearch"
|
8
|
-
}
|
2
|
+
import { SearchResultContext } from '../../ts';
|
9
3
|
declare const TMQueryResultForm: ({ onUpdate, isModal, onClose, context, result1, result2, elapsedTime, searchText, tabIcon1, tabIcon2, tabTitle1, tabTitle2 }: {
|
10
4
|
tabTitle1?: string;
|
11
5
|
tabTitle2?: string;
|
@@ -4,7 +4,7 @@ import { SDK_Globals, AppModules } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import TMQueryResult from './TMQueryResult';
|
5
5
|
import styled from 'styled-components';
|
6
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 } from '../../ts';
|
7
|
+
import { FormModes, SearchResultContext } from '../../ts';
|
8
8
|
import { TMColors } from '../../utils/theme';
|
9
9
|
import { StyledBadge } from '../base/Styled';
|
10
10
|
import ShowAlert from '../base/TMAlert';
|
@@ -20,14 +20,6 @@ import TMApplyForm from '../forms/TMApplyForm';
|
|
20
20
|
import TMTidViewer from '../viewers/TMTidViewer';
|
21
21
|
import TMListView from '../base/TMListView';
|
22
22
|
import { DeviceType, useDeviceType } from '../base/TMDeviceProvider';
|
23
|
-
export var SearchResultContext;
|
24
|
-
(function (SearchResultContext) {
|
25
|
-
SearchResultContext["METADATA_SEARCH"] = "metadataSearch";
|
26
|
-
SearchResultContext["WORKFLOW_APPROVE"] = "workflowApprove";
|
27
|
-
SearchResultContext["FAVORITES"] = "favorites";
|
28
|
-
SearchResultContext["RECENT"] = "recent";
|
29
|
-
SearchResultContext["FREE_SEARCH"] = "freeSearch";
|
30
|
-
})(SearchResultContext || (SearchResultContext = {}));
|
31
23
|
const StyledWorkFlowOperationButtonsContainer = styled.div `
|
32
24
|
display: flex;
|
33
25
|
align-items: center;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { DeviceType } from "../base/TMDeviceProvider";
|
2
|
+
export declare const WorkFlowOperationButtons: ({ isInDcmtForm, deviceType, onApprove, onReAssign, onReject, approveDisable, reassignDisable, rejectDisable, infoDisable }: {
|
3
|
+
isInDcmtForm?: boolean;
|
4
|
+
onApprove?: () => void;
|
5
|
+
onReject?: () => void;
|
6
|
+
onReAssign?: () => void;
|
7
|
+
approveDisable?: boolean;
|
8
|
+
rejectDisable?: boolean;
|
9
|
+
reassignDisable?: boolean;
|
10
|
+
infoDisable?: boolean;
|
11
|
+
deviceType?: DeviceType;
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
export declare const WorkFlowApproveRejectPopUp: ({ TID, DID, deviceType, op, onClose, selectedItems, onUpdate }: {
|
14
|
+
TID?: number;
|
15
|
+
DID?: number;
|
16
|
+
deviceType?: DeviceType;
|
17
|
+
selectedItems?: any[];
|
18
|
+
onClose?: () => void;
|
19
|
+
op: number;
|
20
|
+
onUpdate?: () => Promise<void>;
|
21
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
22
|
+
export declare const WorkFlowReAssignPopUp: ({ DID, TID, deviceType, onClose, selectedItems, onUpdate }: {
|
23
|
+
TID?: number;
|
24
|
+
DID?: number;
|
25
|
+
deviceType?: DeviceType;
|
26
|
+
onClose?: () => void;
|
27
|
+
selectedItems?: any[];
|
28
|
+
onUpdate?: () => Promise<void>;
|
29
|
+
}) => import("react/jsx-runtime").JSX.Element;
|