@topconsultnpm/sdkui-react 6.21.0-dev1.9 → 6.21.0-dev2.2
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/NewComponents/ContextMenu/TMContextMenu.js +2 -2
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +43 -19
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +1 -1
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +79 -27
- package/lib/components/base/Styled.d.ts +76 -40
- package/lib/components/base/TMAreaManager.js +28 -11
- package/lib/components/base/TMFileManagerDataGridView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.d.ts +6 -2
- package/lib/components/base/TMPanel.js +1 -0
- package/lib/components/base/TMTreeView.d.ts +5 -3
- package/lib/components/choosers/TMDataListItemChooser.js +56 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +1 -1
- package/lib/components/choosers/TMDynDataListItemChooser.js +51 -23
- package/lib/components/editors/TMDropDown.js +2 -2
- package/lib/components/editors/TMEditorStyled.d.ts +42 -10
- package/lib/components/editors/TMFormulaEditor.js +15 -3
- package/lib/components/editors/TMMetadataEditor.js +4 -3
- package/lib/components/editors/TMMetadataValues.js +1 -1
- package/lib/components/features/archive/TMArchive.js +1 -1
- package/lib/components/features/documents/TMDcmtBlog.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtBlog.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.js +49 -21
- package/lib/components/features/documents/TMDcmtFormActionButtons.js +244 -60
- package/lib/components/features/documents/TMDcmtPreview.d.ts +5 -3
- package/lib/components/features/documents/TMDragDropOverlay.js +7 -2
- package/lib/components/features/documents/TMFileUploader.js +5 -4
- package/lib/components/features/documents/TMMasterDetailDcmts.js +25 -51
- package/lib/components/features/documents/TMRelationViewer.js +1 -0
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +13 -1
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +3 -3
- package/lib/components/features/search/TMSearchResult.js +15 -2
- package/lib/components/features/search/TMViewHistoryDcmt.js +6 -0
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +5 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +7 -1
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.d.ts +1 -1
- package/lib/components/features/workflow/diagram/xmlParser.js +13 -14
- package/lib/components/forms/Login/ChangePasswordInputs.d.ts +1 -1
- package/lib/components/forms/Login/TMLoginForm.js +15 -5
- package/lib/components/forms/TMChooserForm.js +25 -2
- package/lib/components/grids/TMBlogsPost.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.d.ts +5 -2
- package/lib/components/pages/TMPage.js +4 -2
- package/lib/components/query/TMQueryCountButton.d.ts +11 -0
- package/lib/components/query/TMQueryCountButton.js +32 -0
- package/lib/components/query/TMQueryEditor.d.ts +10 -6
- package/lib/components/query/TMQueryEditor.js +42 -5
- package/lib/components/query/TMQuerySummary.js +3 -2
- package/lib/components/sidebar/TMCommandsPanel.d.ts +4 -2
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +2 -2
- package/lib/components/viewers/TMTidViewer.js +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +2 -0
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/TMPdfViewer.js +143 -86
- package/lib/helper/TMUtils.d.ts +4 -9
- package/lib/helper/TMUtils.js +12 -74
- package/lib/helper/checkinCheckoutManager.d.ts +6 -1
- package/lib/helper/checkinCheckoutManager.js +203 -9
- package/lib/helper/helpers.js +8 -6
- package/lib/hooks/useCheckInOutOperations.d.ts +1 -1
- package/lib/hooks/useCheckInOutOperations.js +9 -4
- package/lib/hooks/useDcmtOperations.d.ts +1 -0
- package/lib/hooks/useDcmtOperations.js +75 -5
- package/lib/hooks/useDocumentOperations.js +17 -4
- package/lib/hooks/useForm.js +20 -14
- package/lib/hooks/useInputDialog.d.ts +2 -0
- package/lib/hooks/useInputDialog.js +37 -0
- package/lib/hooks/useQueryParametersDialog.js +5 -5
- package/lib/services/platform_services.d.ts +1 -1
- package/lib/services/platform_services.js +8 -0
- package/lib/ts/types.d.ts +1 -0
- package/package.json +54 -55
|
@@ -105,7 +105,7 @@ export const updateCicoCheckoutStorageItem = (item, type, action = "addOrUpdate"
|
|
|
105
105
|
SDKUI_Globals.userSettings.wgDraftCheckoutInfo = currentItems;
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
|
-
export const validateCicoFileName = (source, fileName) => {
|
|
108
|
+
export const validateCicoFileName = (source, fileName, checkoutDate) => {
|
|
109
109
|
const archiveID = SDK_Globals.tmSession?.SessionDescr?.archiveID;
|
|
110
110
|
let baseName;
|
|
111
111
|
let tid;
|
|
@@ -152,6 +152,7 @@ export const validateCicoFileName = (source, fileName) => {
|
|
|
152
152
|
const nameCheck = parts[1];
|
|
153
153
|
const tidCheck = parts[2];
|
|
154
154
|
const didCheck = parts[3];
|
|
155
|
+
const timestampCheck = parts[4]; // Timestamp from filename: YYYYMMDDHHmmss
|
|
155
156
|
// Validation checks
|
|
156
157
|
const expectedFullName = `${nameCheck}.${fileExtensionCheck}`.toLowerCase();
|
|
157
158
|
const isValidName = expectedFullName === name.toLowerCase();
|
|
@@ -159,9 +160,53 @@ export const validateCicoFileName = (source, fileName) => {
|
|
|
159
160
|
const isValidTid = tidCheck ? tid.toString() === parseInt(tidCheck, 10).toString() : false;
|
|
160
161
|
const isValidArchive = archiveCheck ? archiveCheck === archiveID : false;
|
|
161
162
|
const isValidExt = ext ? ext.toLowerCase() === fileExtensionCheck.toLowerCase() : false;
|
|
163
|
+
// First phase validation result
|
|
164
|
+
const isFirstPhaseValid = !!(isValidName && isValidArchive && isValidDid && isValidTid && isValidExt);
|
|
165
|
+
// Second phase: validate checkoutDate timestamp (only if first phase passed and checkoutDate is a valid string)
|
|
166
|
+
let checkoutDateValidation;
|
|
167
|
+
let isSecondPhaseValid = true;
|
|
168
|
+
if (isFirstPhaseValid && checkoutDate && typeof checkoutDate === "string") {
|
|
169
|
+
try {
|
|
170
|
+
// Convert checkoutDate to timestamp format YYYYMMDDHHmmss
|
|
171
|
+
const dt = new Date(checkoutDate);
|
|
172
|
+
// Check if date is valid
|
|
173
|
+
if (isNaN(dt.getTime())) {
|
|
174
|
+
// Skip second phase validation if date is invalid
|
|
175
|
+
console.warn("validateCicoFileName: invalid checkoutDate, skipping timestamp validation");
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
const pad = (n) => n.toString().padStart(2, '0');
|
|
179
|
+
const expectedTimestamp = `${dt.getFullYear()}${pad(dt.getMonth() + 1)}${pad(dt.getDate())}${pad(dt.getHours())}${pad(dt.getMinutes())}${pad(dt.getSeconds())}`;
|
|
180
|
+
isSecondPhaseValid = timestampCheck === expectedTimestamp;
|
|
181
|
+
// Format dates for display: readable date + (raw timestamp)
|
|
182
|
+
const expectedDisplayDate = Globalization.getDateTimeDisplayValue(dt);
|
|
183
|
+
// Parse timestampCheck to readable format (YYYYMMDDHHmmss -> Date)
|
|
184
|
+
let currentDisplayDate = timestampCheck;
|
|
185
|
+
if (timestampCheck && timestampCheck.length === 14) {
|
|
186
|
+
const year = parseInt(timestampCheck.substring(0, 4), 10);
|
|
187
|
+
const month = parseInt(timestampCheck.substring(4, 6), 10) - 1;
|
|
188
|
+
const day = parseInt(timestampCheck.substring(6, 8), 10);
|
|
189
|
+
const hours = parseInt(timestampCheck.substring(8, 10), 10);
|
|
190
|
+
const minutes = parseInt(timestampCheck.substring(10, 12), 10);
|
|
191
|
+
const seconds = parseInt(timestampCheck.substring(12, 14), 10);
|
|
192
|
+
const parsedDate = new Date(year, month, day, hours, minutes, seconds);
|
|
193
|
+
currentDisplayDate = Globalization.getDateTimeDisplayValue(parsedDate);
|
|
194
|
+
}
|
|
195
|
+
checkoutDateValidation = {
|
|
196
|
+
expected: `${expectedDisplayDate} (${expectedTimestamp})`,
|
|
197
|
+
current: `${currentDisplayDate} (${timestampCheck})`,
|
|
198
|
+
isValid: isSecondPhaseValid
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
// If anything goes wrong, skip second phase validation
|
|
204
|
+
console.warn("validateCicoFileName: error processing checkoutDate, skipping timestamp validation", error);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
162
207
|
// Return validation results as an object
|
|
163
208
|
return {
|
|
164
|
-
isValid:
|
|
209
|
+
isValid: isFirstPhaseValid && isSecondPhaseValid,
|
|
165
210
|
validationResults: {
|
|
166
211
|
archiveID: {
|
|
167
212
|
expected: archiveID,
|
|
@@ -187,13 +232,155 @@ export const validateCicoFileName = (source, fileName) => {
|
|
|
187
232
|
expected: ext?.toLowerCase(),
|
|
188
233
|
current: fileExtensionCheck.toLowerCase(),
|
|
189
234
|
isValid: isValidExt
|
|
190
|
-
}
|
|
235
|
+
},
|
|
236
|
+
...(checkoutDateValidation && { checkoutDate: checkoutDateValidation })
|
|
191
237
|
}
|
|
192
238
|
};
|
|
193
239
|
};
|
|
240
|
+
/**
|
|
241
|
+
* Rimuove il timestamp di checkout e l'estensione dal nome file se presenti.
|
|
242
|
+
* Es: checkout~Z1~(CP) CICO A~10683~9894334~20260420090234.TXT -> checkout~Z1~(CP) CICO A~10683~9894334
|
|
243
|
+
* Non lancia mai errori, ritorna il nome originale in caso di problemi.
|
|
244
|
+
*/
|
|
245
|
+
const stripCheckoutTimestamp = (filename) => {
|
|
246
|
+
try {
|
|
247
|
+
if (!filename || typeof filename !== 'string')
|
|
248
|
+
return filename;
|
|
249
|
+
// Check if it's a checkout filename (starts with 'checkout~')
|
|
250
|
+
if (!filename.startsWith('checkout~'))
|
|
251
|
+
return filename;
|
|
252
|
+
// Remove extension if present
|
|
253
|
+
const lastDotIndex = filename.lastIndexOf('.');
|
|
254
|
+
const nameWithoutExt = lastDotIndex !== -1 ? filename.substring(0, lastDotIndex) : filename;
|
|
255
|
+
// Check if the last part is a 14-digit timestamp
|
|
256
|
+
const lastTildeIndex = nameWithoutExt.lastIndexOf('~');
|
|
257
|
+
if (lastTildeIndex === -1)
|
|
258
|
+
return nameWithoutExt;
|
|
259
|
+
const potentialTimestamp = nameWithoutExt.substring(lastTildeIndex + 1);
|
|
260
|
+
// Validate it's a 14-digit number (YYYYMMDDHHmmss)
|
|
261
|
+
if (potentialTimestamp.length === 14 && /^\d{14}$/.test(potentialTimestamp)) {
|
|
262
|
+
// Remove the timestamp part
|
|
263
|
+
return nameWithoutExt.substring(0, lastTildeIndex);
|
|
264
|
+
}
|
|
265
|
+
return nameWithoutExt;
|
|
266
|
+
}
|
|
267
|
+
catch {
|
|
268
|
+
// Never throw, return original
|
|
269
|
+
return filename;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
194
272
|
export const renderCicoCheckInContent = (source, selectedFilename, isValid, validationItems, color = "#996300") => {
|
|
195
273
|
const fileName = source.type === 'fileItem' ? source.fileItem.name : (source.dcmtInfo.fileName ?? SDKUI_Localizator.SearchResult);
|
|
196
|
-
|
|
274
|
+
const warningBgColor = "#fff8e6";
|
|
275
|
+
const warningBorderColor = "#f5c518";
|
|
276
|
+
return (_jsxs("div", { style: { width: "100%", padding: "8px 0", userSelect: 'text' }, children: [_jsx("div", { style: {
|
|
277
|
+
fontSize: '1rem',
|
|
278
|
+
marginBottom: isValid ? 0 : '16px',
|
|
279
|
+
lineHeight: 1.5
|
|
280
|
+
}, children: SDKUI_Localizator.CheckInElementConfirm.replaceParams(fileName) }), !isValid && (_jsxs("div", { style: {
|
|
281
|
+
background: warningBgColor,
|
|
282
|
+
border: `1px solid ${warningBorderColor}`,
|
|
283
|
+
borderRadius: '8px',
|
|
284
|
+
padding: '16px',
|
|
285
|
+
marginTop: '8px'
|
|
286
|
+
}, children: [_jsxs("div", { style: {
|
|
287
|
+
display: 'flex',
|
|
288
|
+
alignItems: 'center',
|
|
289
|
+
gap: '8px',
|
|
290
|
+
marginBottom: '16px'
|
|
291
|
+
}, children: [_jsx("i", { className: "dx-icon-warning", style: { fontSize: '20px', color } }), _jsx("span", { style: { fontSize: '1rem', fontWeight: 600, color }, children: SDKUI_Localizator.ElementNameConventionError })] }), _jsxs("div", { style: {
|
|
292
|
+
display: 'flex',
|
|
293
|
+
flexDirection: 'column',
|
|
294
|
+
gap: '12px',
|
|
295
|
+
background: '#fff',
|
|
296
|
+
borderRadius: '6px',
|
|
297
|
+
padding: '12px',
|
|
298
|
+
marginBottom: '16px'
|
|
299
|
+
}, children: [_jsxs("div", { style: { display: 'flex', alignItems: 'flex-start', gap: '8px' }, children: [_jsxs("span", { style: {
|
|
300
|
+
minWidth: '80px',
|
|
301
|
+
fontWeight: 600,
|
|
302
|
+
color: '#555',
|
|
303
|
+
fontSize: '0.875rem'
|
|
304
|
+
}, children: [SDKUI_Localizator.Expected, ":"] }), _jsx("code", { style: {
|
|
305
|
+
fontFamily: 'monospace',
|
|
306
|
+
fontSize: '0.875rem',
|
|
307
|
+
background: '#e8f5e9',
|
|
308
|
+
padding: '2px 8px',
|
|
309
|
+
borderRadius: '4px',
|
|
310
|
+
color: '#2e7d32',
|
|
311
|
+
wordBreak: 'break-all'
|
|
312
|
+
}, children: getCicoDownloadFileName(source, true, false) })] }), _jsxs("div", { style: { display: 'flex', alignItems: 'flex-start', gap: '8px' }, children: [_jsxs("span", { style: {
|
|
313
|
+
minWidth: '80px',
|
|
314
|
+
fontWeight: 600,
|
|
315
|
+
color: '#555',
|
|
316
|
+
fontSize: '0.875rem'
|
|
317
|
+
}, children: [SDKUI_Localizator.SelectedSingular, ":"] }), _jsx("code", { style: {
|
|
318
|
+
fontFamily: 'monospace',
|
|
319
|
+
fontSize: '0.875rem',
|
|
320
|
+
background: '#ffebee',
|
|
321
|
+
padding: '2px 8px',
|
|
322
|
+
borderRadius: '4px',
|
|
323
|
+
color: '#c62828',
|
|
324
|
+
wordBreak: 'break-all'
|
|
325
|
+
}, children: stripCheckoutTimestamp(selectedFilename.name) })] })] }), validationItems && Object.entries(validationItems).filter(([_, value]) => !value.isValid).length > 0 && (_jsxs("div", { style: {
|
|
326
|
+
background: '#fff',
|
|
327
|
+
borderRadius: '6px',
|
|
328
|
+
padding: '12px',
|
|
329
|
+
marginBottom: '16px'
|
|
330
|
+
}, children: [_jsx("div", { style: {
|
|
331
|
+
fontWeight: 600,
|
|
332
|
+
marginBottom: '12px',
|
|
333
|
+
color: '#555',
|
|
334
|
+
fontSize: '0.875rem',
|
|
335
|
+
textTransform: 'uppercase',
|
|
336
|
+
letterSpacing: '0.5px'
|
|
337
|
+
}, children: SDKUI_Localizator.Anomalies }), _jsxs("table", { style: {
|
|
338
|
+
width: "100%",
|
|
339
|
+
borderCollapse: "separate",
|
|
340
|
+
borderSpacing: 0,
|
|
341
|
+
fontSize: '0.875rem'
|
|
342
|
+
}, children: [_jsx("thead", { children: _jsxs("tr", { style: { background: '#f5f5f5' }, children: [_jsx("th", { style: {
|
|
343
|
+
textAlign: "left",
|
|
344
|
+
padding: '10px 12px',
|
|
345
|
+
borderBottom: "2px solid #ddd",
|
|
346
|
+
fontWeight: 600,
|
|
347
|
+
color: '#333'
|
|
348
|
+
}, children: SDKUI_Localizator.Value }), _jsx("th", { style: {
|
|
349
|
+
textAlign: "left",
|
|
350
|
+
padding: '10px 12px',
|
|
351
|
+
borderBottom: "2px solid #ddd",
|
|
352
|
+
fontWeight: 600,
|
|
353
|
+
color: '#2e7d32'
|
|
354
|
+
}, children: SDKUI_Localizator.Expected }), _jsx("th", { style: {
|
|
355
|
+
textAlign: "left",
|
|
356
|
+
padding: '10px 12px',
|
|
357
|
+
borderBottom: "2px solid #ddd",
|
|
358
|
+
fontWeight: 600,
|
|
359
|
+
color: '#c62828'
|
|
360
|
+
}, children: SDKUI_Localizator.Current })] }) }), _jsx("tbody", { children: Object.entries(validationItems)
|
|
361
|
+
.filter(([_, value]) => !value.isValid)
|
|
362
|
+
.map(([key, result], index, arr) => (_jsxs("tr", { style: {
|
|
363
|
+
background: index % 2 === 0 ? '#fafafa' : '#fff'
|
|
364
|
+
}, children: [_jsx("td", { style: {
|
|
365
|
+
padding: '10px 12px',
|
|
366
|
+
borderBottom: index === arr.length - 1 ? 'none' : "1px solid #eee",
|
|
367
|
+
fontWeight: 500,
|
|
368
|
+
textTransform: "capitalize"
|
|
369
|
+
}, children: key.toUpperCase() }), _jsx("td", { style: {
|
|
370
|
+
padding: '10px 12px',
|
|
371
|
+
borderBottom: index === arr.length - 1 ? 'none' : "1px solid #eee",
|
|
372
|
+
color: '#2e7d32',
|
|
373
|
+
fontFamily: 'monospace'
|
|
374
|
+
}, children: result.expected || "-" }), _jsx("td", { style: {
|
|
375
|
+
padding: '10px 12px',
|
|
376
|
+
borderBottom: index === arr.length - 1 ? 'none' : "1px solid #eee",
|
|
377
|
+
color: '#c62828',
|
|
378
|
+
fontFamily: 'monospace'
|
|
379
|
+
}, children: result.current || "-" })] }, key))) })] })] }))] })), !isValid && (_jsx("div", { style: {
|
|
380
|
+
fontSize: '1rem',
|
|
381
|
+
lineHeight: 1.5,
|
|
382
|
+
marginTop: '16px'
|
|
383
|
+
}, children: SDKUI_Localizator.ProceedAnyway }))] }));
|
|
197
384
|
};
|
|
198
385
|
export const getDcmtCicoInfo = (dtd) => {
|
|
199
386
|
const cico = {
|
|
@@ -245,7 +432,7 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
|
|
|
245
432
|
if (dcmt === undefined || dtd === undefined) {
|
|
246
433
|
return {
|
|
247
434
|
cicoEnabled: false,
|
|
248
|
-
checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null, editLockTooltipText: null }
|
|
435
|
+
checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null, editLockTooltipText: null, checkoutUserId: undefined, checkoutDate: undefined, fileExt: null, isMetadata: false }
|
|
249
436
|
};
|
|
250
437
|
}
|
|
251
438
|
// ========================================================================
|
|
@@ -267,7 +454,6 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
|
|
|
267
454
|
// o liste dove ogni metadato è un oggetto separato con proprietà 'md' e 'value'
|
|
268
455
|
if (Array.isArray(dcmt) && dcmt.length > 0 && dcmt[0]?.md !== undefined) {
|
|
269
456
|
const dcmtsArray = dcmt;
|
|
270
|
-
console.log("dcmtsArray:", dcmtsArray);
|
|
271
457
|
// Estrai l'ID dell'utente che ha effettuato il checkout
|
|
272
458
|
const checkoutUserIdProperty = dcmtsArray.find((item) => item.md?.name === CICO_MetadataNames.CICO_CheckoutUserID);
|
|
273
459
|
const checkoutUserIdValue = checkoutUserIdProperty?.value;
|
|
@@ -321,7 +507,7 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
|
|
|
321
507
|
if (isMetadata) {
|
|
322
508
|
return {
|
|
323
509
|
cicoEnabled: false,
|
|
324
|
-
checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null, editLockTooltipText: null }
|
|
510
|
+
checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null, editLockTooltipText: null, checkoutUserId: undefined, checkoutDate: undefined, fileExt: fileExt, isMetadata: true }
|
|
325
511
|
};
|
|
326
512
|
}
|
|
327
513
|
// ========================================================================
|
|
@@ -332,7 +518,11 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
|
|
|
332
518
|
mode: '',
|
|
333
519
|
version: version,
|
|
334
520
|
icon: null,
|
|
335
|
-
editLockTooltipText: null
|
|
521
|
+
editLockTooltipText: null,
|
|
522
|
+
checkoutUserId: checkoutUserId,
|
|
523
|
+
checkoutDate: checkoutDate,
|
|
524
|
+
fileExt: fileExt,
|
|
525
|
+
isMetadata: isMetadata
|
|
336
526
|
};
|
|
337
527
|
// Verifica se il documento è effettivamente in stato di checkout
|
|
338
528
|
if (userID && checkoutUserId && !isNaN(checkoutUserId) && checkoutUserId > 0) {
|
|
@@ -353,7 +543,11 @@ export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
|
|
|
353
543
|
mode: mode,
|
|
354
544
|
icon: icon,
|
|
355
545
|
version: version,
|
|
356
|
-
editLockTooltipText: editLockTooltipText
|
|
546
|
+
editLockTooltipText: editLockTooltipText,
|
|
547
|
+
checkoutUserId: checkoutUserId,
|
|
548
|
+
checkoutDate: checkoutDate,
|
|
549
|
+
fileExt: fileExt,
|
|
550
|
+
isMetadata: isMetadata
|
|
357
551
|
};
|
|
358
552
|
}
|
|
359
553
|
// ========================================================================
|
package/lib/helper/helpers.js
CHANGED
|
@@ -561,7 +561,7 @@ export const getMoreInfoTasksForDocument = (allTasks, TID, DID) => {
|
|
|
561
561
|
};
|
|
562
562
|
//#region Form, Page Helpers
|
|
563
563
|
export const canNext = (visibleItems, selectedItems) => {
|
|
564
|
-
if (!visibleItems)
|
|
564
|
+
if (!visibleItems || visibleItems.length === 0)
|
|
565
565
|
return false;
|
|
566
566
|
if (visibleItems.length == 1)
|
|
567
567
|
return false;
|
|
@@ -569,10 +569,11 @@ export const canNext = (visibleItems, selectedItems) => {
|
|
|
569
569
|
return false;
|
|
570
570
|
if (selectedItems.length != 1)
|
|
571
571
|
return false;
|
|
572
|
-
|
|
572
|
+
let index = visibleItems.findIndex(o => o.id == selectedItems[0].id);
|
|
573
|
+
return index < visibleItems.length - 1;
|
|
573
574
|
};
|
|
574
575
|
export const getNext = (visibleItems, selectedItems) => {
|
|
575
|
-
if (!visibleItems)
|
|
576
|
+
if (!visibleItems || visibleItems.length === 0)
|
|
576
577
|
return;
|
|
577
578
|
if (!selectedItems[0])
|
|
578
579
|
return;
|
|
@@ -582,7 +583,7 @@ export const getNext = (visibleItems, selectedItems) => {
|
|
|
582
583
|
return visibleItems[index + 1];
|
|
583
584
|
};
|
|
584
585
|
export const canPrev = (visibleItems, selectedItems) => {
|
|
585
|
-
if (!visibleItems)
|
|
586
|
+
if (!visibleItems || visibleItems.length === 0)
|
|
586
587
|
return false;
|
|
587
588
|
if (visibleItems.length == 1)
|
|
588
589
|
return false;
|
|
@@ -590,10 +591,11 @@ export const canPrev = (visibleItems, selectedItems) => {
|
|
|
590
591
|
return false;
|
|
591
592
|
if (selectedItems.length != 1)
|
|
592
593
|
return false;
|
|
593
|
-
|
|
594
|
+
let index = visibleItems.findIndex(o => o.id == selectedItems[0].id);
|
|
595
|
+
return index > 0;
|
|
594
596
|
};
|
|
595
597
|
export const getPrev = (visibleItems, selectedItems) => {
|
|
596
|
-
if (!visibleItems)
|
|
598
|
+
if (!visibleItems || visibleItems.length === 0)
|
|
597
599
|
return;
|
|
598
600
|
if (!selectedItems[0])
|
|
599
601
|
return;
|
|
@@ -18,7 +18,7 @@ export interface UseCheckInOutOperationsReturn {
|
|
|
18
18
|
hideCommentFormCallback: () => void;
|
|
19
19
|
copyCheckoutPathToClipboardCallback: (dcmt: DcmtInfo, filename: string) => void;
|
|
20
20
|
handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
21
|
-
handleCheckInCallback: (dcmt: DcmtInfo, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
21
|
+
handleCheckInCallback: (dcmt: DcmtInfo, checkoutDate?: string | null, onRefreshAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
22
22
|
showCicoWaitPanel: boolean;
|
|
23
23
|
cicoWaitPanelTitle: string;
|
|
24
24
|
showCicoPrimaryProgress: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
1
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
2
2
|
import { cicoDownloadFilesCallback, dcmtsFileCachePreview, getCicoDownloadFileName, getExceptionMessage, removeDcmtsFileCache, renderCicoCheckInContent, SDKUI_Globals, SDKUI_Localizator, updateCicoCheckoutStorageItem, validateCicoFileName } from '../helper';
|
|
3
|
-
import { ButtonNames, ShowAlert, TMMessageBoxManager, TMResultManager } from '../components';
|
|
3
|
+
import { ButtonNames, DeviceType, ShowAlert, TMMessageBoxManager, TMResultManager, useDeviceType } from '../components';
|
|
4
4
|
import { ResultTypes, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
let abortController = new AbortController();
|
|
6
6
|
export const useCheckInOutOperations = (props) => {
|
|
@@ -14,6 +14,10 @@ export const useCheckInOutOperations = (props) => {
|
|
|
14
14
|
show: false,
|
|
15
15
|
isRequired: false
|
|
16
16
|
});
|
|
17
|
+
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
18
|
+
const deviceType = useDeviceType();
|
|
19
|
+
// This avoids unnecessary re-renders by only recalculating when deviceType changes.
|
|
20
|
+
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
17
21
|
// State variable to control the visibility of the wait panel
|
|
18
22
|
const [showCicoWaitPanel, setShowCicoWaitPanel] = useState(false);
|
|
19
23
|
// State variable to store the title of the wait panel
|
|
@@ -127,7 +131,7 @@ export const useCheckInOutOperations = (props) => {
|
|
|
127
131
|
});
|
|
128
132
|
}
|
|
129
133
|
};
|
|
130
|
-
const handleCheckInCallback = async (dcmt, onRefreshAsync) => {
|
|
134
|
+
const handleCheckInCallback = async (dcmt, checkoutDate, onRefreshAsync) => {
|
|
131
135
|
if (!dcmt)
|
|
132
136
|
throw new Error("Document info is required");
|
|
133
137
|
// Create a new file input element
|
|
@@ -144,12 +148,13 @@ export const useCheckInOutOperations = (props) => {
|
|
|
144
148
|
if (!fileInput.files || fileInput.files.length === 0)
|
|
145
149
|
return;
|
|
146
150
|
const file = fileInput.files[0];
|
|
147
|
-
const validateFileName = validateCicoFileName({ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: dcmt.fileName ?? SDKUI_Localizator.SearchResult }, file.name);
|
|
151
|
+
const validateFileName = validateCicoFileName({ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: dcmt.fileName ?? SDKUI_Localizator.SearchResult }, file.name, checkoutDate);
|
|
148
152
|
TMMessageBoxManager.show({
|
|
149
153
|
resizable: true,
|
|
150
154
|
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
151
155
|
message: renderCicoCheckInContent({ type: 'dcmtInfo', dcmtInfo: dcmt, originalFileName: dcmt.fileName ?? SDKUI_Localizator.SearchResult }, file, validateFileName.isValid, validateFileName.validationResults),
|
|
152
156
|
title: "Check in",
|
|
157
|
+
initialWidth: !validateFileName.isValid && !isMobile ? '800px' : undefined,
|
|
153
158
|
onButtonClick: async (e) => {
|
|
154
159
|
if (e !== ButtonNames.YES)
|
|
155
160
|
return;
|
|
@@ -21,5 +21,6 @@ export interface UseDcmtOperationsReturn {
|
|
|
21
21
|
removeDcmtsFileCache: (key: string) => void;
|
|
22
22
|
isDcmtFileInCache: (key: string) => boolean;
|
|
23
23
|
runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>;
|
|
24
|
+
FileSourceDialog: () => JSX.Element;
|
|
24
25
|
}
|
|
25
26
|
export declare const useDcmtOperations: () => UseDcmtOperationsReturn;
|
|
@@ -4,9 +4,18 @@ import { SDK_Globals, RetrieveFileOptions, DcmtOpers, ResultTypes, RecentCategor
|
|
|
4
4
|
import { ShowAlert, TMResultManager, FormulaHelper, TMExceptionBoxManager, TMSpinner } from '../components';
|
|
5
5
|
import { Globalization, getExceptionMessage, dialogConfirmOperation, extensionHandler, downloadBase64File, SDKUI_Globals, dcmtsFileCacheDownload, CACHE_SIZE_LIMIT, clearDcmtsFileCache, dcmtsFileCachePreview, isDcmtFileInCache, removeDcmtsFileCache, SDKUI_Localizator } from '../helper';
|
|
6
6
|
import { DcmtOperationTypes, DownloadTypes, FileExtensionHandler } from '../ts';
|
|
7
|
-
import { useFileDialog } from './useInputDialog';
|
|
7
|
+
import { useFileDialog, useFileSourceDialog } from './useInputDialog';
|
|
8
8
|
import { isXMLFileExt } from '../helper/dcmtsHelper';
|
|
9
9
|
import { ShowConfirm } from '../components/base/TMConfirm';
|
|
10
|
+
const isScannerLicenseConfigured = () => {
|
|
11
|
+
try {
|
|
12
|
+
const scannerLicense = SDKUI_Globals.userSettings.advancedSettings.scannerLicense;
|
|
13
|
+
return scannerLicense && scannerLicense.trim() !== '';
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
10
19
|
let abortController = new AbortController();
|
|
11
20
|
const downloadCountMap = new Map();
|
|
12
21
|
const getDownloadFileName = (fileName) => {
|
|
@@ -32,6 +41,7 @@ export const useDcmtOperations = () => {
|
|
|
32
41
|
const [waitPanelValueSecondary, setWaitPanelValueSecondary] = useState(0);
|
|
33
42
|
const [waitPanelMaxValueSecondary, setWaitPanelMaxValueSecondary] = useState(0);
|
|
34
43
|
const { OpenFileDialog } = useFileDialog();
|
|
44
|
+
const [selectFileSource, FileSourceDialog] = useFileSourceDialog();
|
|
35
45
|
const _downloadDcmtsAsync = async (inputDcmts, downloadMode = "download", onFileDownloaded, skipConfirmation = false) => {
|
|
36
46
|
if (inputDcmts === undefined)
|
|
37
47
|
return;
|
|
@@ -101,7 +111,7 @@ export const useDcmtOperations = () => {
|
|
|
101
111
|
setWaitPanelValuePrimary(i + 1);
|
|
102
112
|
const fileURL = window.URL.createObjectURL(file);
|
|
103
113
|
if (downloadMode === "openInNewWindow") {
|
|
104
|
-
onFileDownloaded
|
|
114
|
+
(onFileDownloaded && file)
|
|
105
115
|
? onFileDownloaded(file)
|
|
106
116
|
: window.open(fileURL, '_blank', 'noopener');
|
|
107
117
|
}
|
|
@@ -210,7 +220,61 @@ export const useDcmtOperations = () => {
|
|
|
210
220
|
return;
|
|
211
221
|
if (inputDcmts.length <= 0)
|
|
212
222
|
return;
|
|
213
|
-
let file = inputDcmts[0].FILE
|
|
223
|
+
let file = inputDcmts[0].FILE;
|
|
224
|
+
if (!file) {
|
|
225
|
+
if (isScannerLicenseConfigured()) {
|
|
226
|
+
const hasExistingFile = !!inputDcmts[0].FILEEXT;
|
|
227
|
+
const source = await selectFileSource(hasExistingFile);
|
|
228
|
+
if (!source)
|
|
229
|
+
return;
|
|
230
|
+
switch (source) {
|
|
231
|
+
case 'filesystem':
|
|
232
|
+
file = await OpenFileDialog();
|
|
233
|
+
break;
|
|
234
|
+
case 'scanner-new':
|
|
235
|
+
if (SDKUI_Globals.scanRequestHandler) {
|
|
236
|
+
file = await new Promise((resolve) => {
|
|
237
|
+
SDKUI_Globals.scanRequestHandler('new', (scannedFile) => resolve(scannedFile), () => resolve(undefined));
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' });
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
case 'scanner-edit':
|
|
246
|
+
if (SDKUI_Globals.scanRequestHandler) {
|
|
247
|
+
// Download the existing file from the document
|
|
248
|
+
let existingFile;
|
|
249
|
+
try {
|
|
250
|
+
const rfo = new RetrieveFileOptions();
|
|
251
|
+
rfo.retrieveReason = DcmtOpers.None;
|
|
252
|
+
const retrievedFile = await SDK_Globals.tmSession?.NewSearchEngine().RetrieveFileAsync(inputDcmts[0].TID, inputDcmts[0].DID, rfo);
|
|
253
|
+
existingFile = retrievedFile;
|
|
254
|
+
}
|
|
255
|
+
catch (ex) {
|
|
256
|
+
TMExceptionBoxManager.show({ exception: getExceptionMessage(ex) });
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (!existingFile) {
|
|
260
|
+
ShowAlert({ message: 'Impossibile recuperare il file del documento.', mode: 'warning', duration: 3000, title: 'Scanner' });
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
file = await new Promise((resolve) => {
|
|
264
|
+
SDKUI_Globals.scanRequestHandler('edit', (scannedFile) => resolve(scannedFile), () => resolve(undefined), existingFile);
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
ShowAlert({ message: SDKUI_Localizator.ScanFeatureUnavailableInThisContext, mode: 'info', duration: 3000, title: 'Scanner' });
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
file = await OpenFileDialog();
|
|
276
|
+
}
|
|
277
|
+
}
|
|
214
278
|
if (!file)
|
|
215
279
|
return;
|
|
216
280
|
setShowWaitPanel(true);
|
|
@@ -489,10 +553,16 @@ export const useDcmtOperations = () => {
|
|
|
489
553
|
actionAfterOperationAsync?.();
|
|
490
554
|
TMResultManager.show(result, operationTitle, "TID", "DID");
|
|
491
555
|
};
|
|
492
|
-
|
|
556
|
+
// Per SubstituteFile con beta features e scanner, non mostrare conferma
|
|
557
|
+
if (dcmtOperationType === DcmtOperationTypes.SubstituteFile && isScannerLicenseConfigured()) {
|
|
558
|
+
await doOperationAsync();
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
dialogConfirmOperation(operationTitle, msg, doOperationAsync);
|
|
562
|
+
}
|
|
493
563
|
};
|
|
494
564
|
return {
|
|
495
565
|
abortController, showWaitPanel, showPrimary, waitPanelTitle, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary,
|
|
496
|
-
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync
|
|
566
|
+
downloadDcmtsAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, runOperationAsync, FileSourceDialog
|
|
497
567
|
};
|
|
498
568
|
};
|
|
@@ -109,7 +109,7 @@ export const useDocumentOperations = (props) => {
|
|
|
109
109
|
const { showHistory, showHistoryCallback, hideHistoryCallback, showCheckoutInformationForm, commentFormState, hideCommentFormCallback, showCheckoutInformationFormCallback, hideCheckoutInformationFormCallback, copyCheckoutPathToClipboardCallback, handleCheckOutCallback, handleCheckInCallback, showCicoWaitPanel, cicoWaitPanelTitle, showCicoPrimaryProgress, cicoPrimaryProgressText, cicoPrimaryProgressValue, cicoPrimaryProgressMax, } = useCheckInOutOperations({
|
|
110
110
|
onRefreshPreview: onRefreshPreviewCallback
|
|
111
111
|
});
|
|
112
|
-
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache } = useDcmtOperations();
|
|
112
|
+
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync, clearDcmtsFileCache, removeDcmtsFileCache, isDcmtFileInCache, FileSourceDialog } = useDcmtOperations();
|
|
113
113
|
const {
|
|
114
114
|
// Data
|
|
115
115
|
relatedDcmts, pairedSearchResults, manyToManyRelations, selectedManyToManyRelation, manyToManyChooserDataSource, relatedDcmtsChooserDataSource,
|
|
@@ -617,12 +617,18 @@ export const useDocumentOperations = (props) => {
|
|
|
617
617
|
const firstDoc = selectedDcmtInfos?.[0];
|
|
618
618
|
if (!firstDoc)
|
|
619
619
|
return;
|
|
620
|
+
// Take the first document (used for validation checks)
|
|
621
|
+
let dcmt = focusedItem;
|
|
622
|
+
if (isDcmtFormContext || isMasterDetailContext) {
|
|
623
|
+
dcmt = dcmtDataRowForCicoStatus;
|
|
624
|
+
}
|
|
625
|
+
const { checkoutStatus } = getDcmtCicoStatus(dcmt, allUsers, dtd);
|
|
620
626
|
firstDoc.fileName = dtd?.name ?? SDKUI_Localizator.SearchResult;
|
|
621
627
|
const onRefreshAsync = async () => {
|
|
622
628
|
await updateCurrentDcmt?.();
|
|
623
629
|
await refreshFocusedDataRowAsync?.(firstDoc.TID, firstDoc.DID, true);
|
|
624
630
|
};
|
|
625
|
-
await handleCheckInCallback(firstDoc, onRefreshAsync);
|
|
631
|
+
await handleCheckInCallback(firstDoc, checkoutStatus.checkoutDate, onRefreshAsync);
|
|
626
632
|
};
|
|
627
633
|
const copyCheckoutPathToClipboardOperationCallback = () => {
|
|
628
634
|
const firstDoc = selectedDcmtInfos?.[0];
|
|
@@ -1060,8 +1066,13 @@ export const useDocumentOperations = (props) => {
|
|
|
1060
1066
|
disabled: isDisabledForSingleRow() && isDisabledForMultiRow(),
|
|
1061
1067
|
submenu: [
|
|
1062
1068
|
addToFavoriteOperation(),
|
|
1069
|
+
addReplaceFileOperation(),
|
|
1070
|
+
fileCheckMenuItem(),
|
|
1071
|
+
fileConversionsMenuItem(),
|
|
1072
|
+
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
1063
1073
|
downloadFileMenuItem(),
|
|
1064
1074
|
downloadXMLAttachmentsMenuItem(),
|
|
1075
|
+
...(selectedDcmtInfos.length > 0 && isPdfEditorAvailable(dtd, selectedDcmtInfos[0]?.FILEEXT) && onOpenPdfEditorRequest ? [pdfEditorMenuItem(onOpenPdfEditorRequest)] : []),
|
|
1065
1076
|
]
|
|
1066
1077
|
},
|
|
1067
1078
|
signatureMenuItem(),
|
|
@@ -1081,6 +1092,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1081
1092
|
...(inputDcmtFormLayoutMode === LayoutModes.Update ? [addToFavoriteOperation()] : []),
|
|
1082
1093
|
addReplaceFileOperation(),
|
|
1083
1094
|
openFormOperation(),
|
|
1095
|
+
deletetionMenuItem(),
|
|
1084
1096
|
fileCheckMenuItem(),
|
|
1085
1097
|
fileConversionsMenuItem(),
|
|
1086
1098
|
...(SDK_Globals.tmSession?.SessionDescr?.appModuleID === AppModules.SURFER ? [createContextualTaskMenuItem()] : []),
|
|
@@ -1116,7 +1128,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1116
1128
|
};
|
|
1117
1129
|
const renderFloatingBar = (floatingBarContainerRef && floatingBarContainerRef.current && allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE) ? (_jsx(TMFloatingMenuBar, { containerRef: floatingBarContainerRef, contextMenuItems: operationItems(), isConstrained: true, defaultPosition: { x: 1, y: 88 }, defaultPinnedItems: ['rel-det', 'rel-mst', 'dl'], defaultOrientation: 'horizontal', hasContextMenu: false, pinnedItemIds: pinnedItemIds, onPinChange: setPinnedItemIds })) : null;
|
|
1118
1130
|
const renderDcmtOperations = (_jsxs(_Fragment, { children: [(showExportForm && searchResult && dataColumns && dataSource && selectedRowKeys) && (_jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: () => setShowExportForm(false), searchResult: searchResult })), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: ((isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined) &&
|
|
1119
|
-
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems?.length, itemIndex: visibleItems ? visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1 : undefined, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onClose: () => { (false); onDcmtFormOpenChange(false, LayoutModes.Update); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: onSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar, datagridUtility: {
|
|
1131
|
+
_jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID !== undefined), titleModal: dtd?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems?.length, itemIndex: visibleItems ? visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1 : undefined, canNext: canNavigateHandler ? canNavigateHandler('next') : false, canPrev: canNavigateHandler ? canNavigateHandler('prev') : false, onNext: () => onNavigateHandler && onNavigateHandler('next'), onPrev: () => onNavigateHandler && onNavigateHandler('prev'), onClose: () => { (false); onDcmtFormOpenChange(false, LayoutModes.Update); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: onSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showDcmtFormSidebar, datagridUtility: {
|
|
1120
1132
|
onRefreshSearchAsyncDatagrid,
|
|
1121
1133
|
onRefreshDataRowsAsync,
|
|
1122
1134
|
refreshFocusedDataRowAsync,
|
|
@@ -1182,7 +1194,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1182
1194
|
updateBatchUpdateForm(false);
|
|
1183
1195
|
setIsModifiedBatchUpdate(false);
|
|
1184
1196
|
await onRefreshDataRowsAsync?.();
|
|
1185
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })] }));
|
|
1197
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 0, onClose: () => updateShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, isReject: 1, onClose: () => updateShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: handleWFOperationCompleted, selectedItems: approvalVID ? selectedDcmtInfos.map(item => ({ ...item, TID: approvalVID })) : selectedDcmtInfos, onClose: () => updateShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { fromDTD: dtd, TID: contextConfig.approvalTID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: handleWFOperationCompleted, onClose: () => updateShowMoreInfoPopup(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, triggerBlogRefresh: onRefreshBlogDatagrid }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), _jsx(FileSourceDialog, {}), taskFormDialogComponent, s4TViewerDialogComponent, currentCustomButton && _jsx(TMCustomButton, { button: currentCustomButton, formData: currentMetadataValues, selectedItems: selectedItemsFull, onClose: () => setCurrentCustomButton(undefined) })] }));
|
|
1186
1198
|
return {
|
|
1187
1199
|
operationItems: operationItems(),
|
|
1188
1200
|
renderFloatingBar,
|
|
@@ -1235,6 +1247,7 @@ export const useDocumentOperations = (props) => {
|
|
|
1235
1247
|
removeDcmtsFileCache,
|
|
1236
1248
|
isDcmtFileInCache,
|
|
1237
1249
|
runOperationAsync,
|
|
1250
|
+
FileSourceDialog,
|
|
1238
1251
|
},
|
|
1239
1252
|
relatedDocumentsInfo: {
|
|
1240
1253
|
// Data
|