@topconsultnpm/sdkui-react 6.20.0-dev1.6 → 6.20.0-dev1.60
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.d.ts +4 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +416 -0
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +13 -0
- package/lib/components/NewComponents/ContextMenu/hooks.js +61 -0
- package/lib/components/NewComponents/ContextMenu/index.d.ts +5 -0
- package/lib/components/NewComponents/ContextMenu/index.js +3 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +31 -0
- package/lib/components/NewComponents/ContextMenu/styles.js +336 -0
- package/lib/components/NewComponents/ContextMenu/types.d.ts +39 -0
- package/lib/components/NewComponents/ContextMenu/types.js +1 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.d.ts +4 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +745 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.d.ts +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/index.js +2 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +51 -0
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +385 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +29 -0
- package/lib/components/NewComponents/FloatingMenuBar/types.js +1 -0
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +142 -11
- package/lib/components/choosers/TMMetadataChooser.js +8 -1
- package/lib/components/editors/TMMetadataValues.js +23 -5
- package/lib/components/editors/TMTextBox.js +6 -3
- package/lib/components/features/documents/TMDcmtForm.d.ts +13 -1
- package/lib/components/features/documents/TMDcmtForm.js +386 -194
- package/lib/components/features/documents/TMDcmtPreview.js +40 -69
- package/lib/components/features/documents/TMMasterDetailDcmts.js +37 -52
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +5 -10
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.js +30 -5
- package/lib/components/features/search/TMSearchQueryPanel.js +13 -12
- package/lib/components/features/search/TMSearchResult.js +57 -216
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +205 -169
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +1 -1
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +62 -52
- package/lib/components/features/tasks/TMTasksView.js +6 -6
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +32 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +112 -14
- package/lib/components/features/workflow/diagram/WFDiagram.js +2 -2
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +34 -6
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +55 -30
- package/lib/components/index.d.ts +2 -0
- package/lib/components/index.js +2 -0
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +12 -11
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +17 -0
- package/lib/helper/SDKUI_Globals.js +9 -0
- package/lib/helper/SDKUI_Localizator.d.ts +9 -1
- package/lib/helper/SDKUI_Localizator.js +87 -1
- package/lib/helper/TMIcons.d.ts +2 -0
- package/lib/helper/TMIcons.js +6 -0
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +368 -0
- package/lib/helper/checkinCheckoutManager.d.ts +32 -2
- package/lib/helper/checkinCheckoutManager.js +115 -38
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +2 -1
- package/lib/helper/helpers.js +14 -3
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/helper/queryHelper.js +29 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/ts/types.d.ts +56 -1
- package/package.json +5 -2
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { AccessLevels, CICO_MetadataNames, SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
import { AccessLevels, CICO_MetadataNames, SDK_Globals, SystemMIDsAsNumber } from "@topconsultnpm/sdk-ts";
|
|
3
3
|
import TMTooltip from "../components/base/TMTooltip";
|
|
4
4
|
import { Globalization, SDKUI_Globals, SDKUI_Localizator } from "./index";
|
|
5
5
|
import { DownloadTypes } from "../ts/types";
|
|
@@ -64,13 +64,8 @@ export const cicoDownloadFilesCallback = async (sources, checkout, downloadDcmts
|
|
|
64
64
|
if (tid && did && ext) {
|
|
65
65
|
let fileName = getCicoDownloadFileName(source, checkout, true);
|
|
66
66
|
if (checkout) {
|
|
67
|
-
const newItem = {
|
|
68
|
-
|
|
69
|
-
DID: did.toString(),
|
|
70
|
-
checkoutFolder: "",
|
|
71
|
-
checkoutName: fileName
|
|
72
|
-
};
|
|
73
|
-
updateCheckoutItem(newItem, source.type, "addOrUpdate");
|
|
67
|
+
const newItem = { TID: tid.toString(), DID: did.toString(), checkoutFolder: "", checkoutName: fileName };
|
|
68
|
+
updateCicoCheckoutStorageItem(newItem, source.type, "addOrUpdate");
|
|
74
69
|
}
|
|
75
70
|
files.push({ TID: tid, DID: did, FILEEXT: ext, fileName });
|
|
76
71
|
}
|
|
@@ -78,7 +73,7 @@ export const cicoDownloadFilesCallback = async (sources, checkout, downloadDcmts
|
|
|
78
73
|
if (files.length > 0)
|
|
79
74
|
await downloadDcmtsAsync(files, DownloadTypes.Dcmt, "download");
|
|
80
75
|
};
|
|
81
|
-
export const
|
|
76
|
+
export const updateCicoCheckoutStorageItem = (item, type, action = "addOrUpdate") => {
|
|
82
77
|
// Select the appropriate array based on type
|
|
83
78
|
const currentItems = type === 'dcmtInfo' ? [...SDKUI_Globals.userSettings.dcmtCheckoutInfo] : [...SDKUI_Globals.userSettings.wgDraftCheckoutInfo];
|
|
84
79
|
// Find the index of an existing item that has the same TID and DID as the new item
|
|
@@ -196,7 +191,7 @@ export const renderCicoCheckInContent = (source, selectedFilename, isValid, vali
|
|
|
196
191
|
const fileName = source.type === 'fileItem' ? source.fileItem.name : (source.dcmtInfo.fileName ?? SDKUI_Localizator.SearchResult);
|
|
197
192
|
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [SDKUI_Localizator.CheckInElementConfirm.replaceParams(fileName), !isValid && _jsxs("div", { style: { width: "100%", height: "100%", marginTop: '15px' }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column' }, children: [_jsx("div", { style: { fontSize: '12px', color, marginBottom: '12px' }, children: SDKUI_Localizator.ElementNameConventionError }), _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '6px' }, children: [_jsxs("div", { style: { color }, children: [_jsx("strong", { style: { color }, children: SDKUI_Localizator.Expected }), ":", ' ', _jsx("span", { style: { fontStyle: 'italic' }, children: getCicoDownloadFileName(source, true, false) })] }), _jsxs("div", { style: { color }, children: [_jsx("strong", { style: { color }, children: SDKUI_Localizator.SelectedSingular }), ":", ' ', _jsx("span", { style: { fontStyle: 'italic' }, children: selectedFilename.name })] })] })] }), validationItems && Object.entries(validationItems).filter(([_, value]) => !value.isValid).length > 0 && (_jsxs("div", { style: { width: "100%", height: "100%", marginTop: '15px' }, children: [_jsx("hr", {}), _jsxs("table", { style: { width: "100%", borderCollapse: "collapse", color }, children: [_jsx("caption", { style: { textAlign: "center", fontWeight: "bold", marginBottom: "5px" }, children: SDKUI_Localizator.Anomalies }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { style: { textAlign: "left", borderBottom: "1px solid #eee" }, children: SDKUI_Localizator.Value }), _jsx("th", { style: { textAlign: "left", borderBottom: "1px solid #eee" }, children: SDKUI_Localizator.Expected }), _jsx("th", { style: { textAlign: "left", borderBottom: "1px solid #eee" }, children: SDKUI_Localizator.Current })] }) }), _jsx("tbody", { children: Object.entries(validationItems).filter(([_, value]) => !value.isValid).map(([key, result]) => (_jsxs("tr", { children: [_jsx("td", { style: { borderBottom: "1px solid #eee" }, children: _jsx("strong", { style: { textTransform: "capitalize" }, children: key }) }), _jsxs("td", { style: { borderBottom: "1px solid #eee" }, children: [" ", result.expected || "-"] }), _jsxs("td", { style: { borderBottom: "1px solid #eee" }, children: [" ", result.current || "-"] })] }, key))) })] }), _jsx("hr", {})] })), _jsx("div", { style: { fontSize: '12px', marginTop: '15px', marginBottom: '15px' }, children: SDKUI_Localizator.ProceedAnyway })] })] });
|
|
198
193
|
};
|
|
199
|
-
const getDcmtCicoInfo = (dtd) => {
|
|
194
|
+
export const getDcmtCicoInfo = (dtd) => {
|
|
200
195
|
const cico = {
|
|
201
196
|
CICO: 0,
|
|
202
197
|
CanCICO: AccessLevels.No,
|
|
@@ -215,57 +210,139 @@ const getDcmtCicoInfo = (dtd) => {
|
|
|
215
210
|
cico.CanDelChronology = dtd.perm?.canDelChron ?? AccessLevels.No;
|
|
216
211
|
const mdCheckout = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID);
|
|
217
212
|
if (mdCheckout) {
|
|
218
|
-
cico.UserID_MID = mdCheckout.
|
|
213
|
+
cico.UserID_MID = mdCheckout.id;
|
|
219
214
|
cico.UserID_CanViewOrUpdate = (mdCheckout.perm?.canView == AccessLevels.Yes || mdCheckout.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
|
|
220
215
|
}
|
|
221
216
|
const mdDate = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutDate);
|
|
222
217
|
if (mdDate) {
|
|
223
|
-
cico.Date_MID = mdDate.
|
|
218
|
+
cico.Date_MID = mdDate.id;
|
|
224
219
|
cico.Date_CanViewOrUpdate = (mdDate.perm?.canView == AccessLevels.Yes || mdDate.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
|
|
225
220
|
}
|
|
226
221
|
const mdVer = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_Version);
|
|
227
222
|
if (mdVer) {
|
|
228
|
-
cico.Ver_MID = mdVer.
|
|
223
|
+
cico.Ver_MID = mdVer.id;
|
|
229
224
|
cico.Ver_CanViewOrUpdate = (mdVer.perm?.canView == AccessLevels.Yes || mdVer.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
|
|
230
225
|
}
|
|
231
226
|
return cico;
|
|
232
227
|
};
|
|
228
|
+
/**
|
|
229
|
+
* Determina lo stato di check-in/check-out di un documento
|
|
230
|
+
*
|
|
231
|
+
* @param dcmt - Il documento in formato array (MetadataValueDescriptorEx[]) o oggetto piatto
|
|
232
|
+
* @param allUsers - Lista di tutti gli utenti per risolvere i nomi
|
|
233
|
+
* @param dtd - Descrittore del tipo documento contenente le definizioni dei metadati CICO
|
|
234
|
+
* @returns Oggetto con cicoEnabled (se CICO è abilitato) e checkoutStatus (dettagli dello stato)
|
|
235
|
+
*/
|
|
233
236
|
export const getDcmtCicoStatus = (dcmt, allUsers, dtd) => {
|
|
237
|
+
// ========================================================================
|
|
238
|
+
// VALIDAZIONE PARAMETRI
|
|
239
|
+
// ========================================================================
|
|
240
|
+
// Se i parametri essenziali non sono forniti, ritorna stato di default
|
|
234
241
|
if (dcmt === undefined || dtd === undefined) {
|
|
235
242
|
return {
|
|
236
243
|
cicoEnabled: false,
|
|
237
|
-
checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null }
|
|
244
|
+
checkoutStatus: { isCheckedOut: false, mode: '', version: 1, icon: null, editLockTooltipText: null }
|
|
238
245
|
};
|
|
239
246
|
}
|
|
247
|
+
// ========================================================================
|
|
248
|
+
// ESTRAZIONE INFORMAZIONI CICO DAL DTD
|
|
249
|
+
// ========================================================================
|
|
250
|
+
// Recupera le configurazioni e permessi CICO dal tipo documento
|
|
240
251
|
const cicoInfo = getDcmtCicoInfo(dtd);
|
|
241
|
-
const CICO_CheckoutUserID_Meta = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID);
|
|
242
|
-
const CICO_CheckoutDate_Meta = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutDate);
|
|
243
|
-
const CICO_Version_Meta = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_Version);
|
|
244
|
-
const keyVersion = dcmt.TID + "_" + (CICO_Version_Meta?.id ?? 0);
|
|
245
|
-
const versionRaw = CICO_Version_Meta?.id ? dcmt[keyVersion] : undefined;
|
|
246
|
-
const version = (versionRaw != null && !isNaN(Number(versionRaw))) ? Number(versionRaw) : 1;
|
|
247
|
-
let checkoutStatus = { isCheckedOut: false, mode: '', version: version, icon: null, };
|
|
248
252
|
const userID = SDK_Globals.tmSession?.SessionDescr?.userID;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
253
|
+
// Variabili comuni per entrambi i formati di documento
|
|
254
|
+
let checkoutUserId;
|
|
255
|
+
let checkoutDate;
|
|
256
|
+
let version = 1;
|
|
257
|
+
let fileExt;
|
|
258
|
+
// ========================================================================
|
|
259
|
+
// CASO 1: Documento come Array di MetadataValueDescriptorEx
|
|
260
|
+
// ========================================================================
|
|
261
|
+
// Questo formato viene utilizzato quando il documento proviene da query
|
|
262
|
+
// o liste dove ogni metadato è un oggetto separato con proprietà 'md' e 'value'
|
|
263
|
+
if (Array.isArray(dcmt) && dcmt.length > 0 && dcmt[0]?.md !== undefined) {
|
|
264
|
+
const dcmtsArray = dcmt;
|
|
265
|
+
// Estrai l'ID dell'utente che ha effettuato il checkout
|
|
266
|
+
const checkoutUserIdProperty = dcmtsArray.find((item) => item.md?.name === CICO_MetadataNames.CICO_CheckoutUserID);
|
|
267
|
+
const checkoutUserIdValue = checkoutUserIdProperty?.value;
|
|
268
|
+
checkoutUserId = checkoutUserIdValue ? Number(checkoutUserIdValue) : undefined;
|
|
269
|
+
// Estrai la data di checkout
|
|
270
|
+
const checkoutDateProperty = dcmtsArray.find((item) => item.md?.name === CICO_MetadataNames.CICO_CheckoutDate);
|
|
271
|
+
checkoutDate = checkoutDateProperty?.value;
|
|
272
|
+
// Estrai la versione del documento
|
|
273
|
+
const versionProperty = dcmtsArray.find((item) => item.md?.name === CICO_MetadataNames.CICO_Version);
|
|
274
|
+
const versionRaw = versionProperty?.value;
|
|
275
|
+
version = (versionRaw != null && !isNaN(Number(versionRaw))) ? Number(versionRaw) : 1;
|
|
276
|
+
const fileExtProperty = dcmtsArray.find((item) => item.mid === SystemMIDsAsNumber.FileExt);
|
|
277
|
+
fileExt = fileExtProperty?.value ? fileExtProperty.value.toString() : null;
|
|
278
|
+
}
|
|
279
|
+
// ========================================================================
|
|
280
|
+
// CASO 2: Documento come Oggetto Piatto (formato standard)
|
|
281
|
+
// ========================================================================
|
|
282
|
+
// Questo formato viene utilizzato quando il documento ha proprietà dirette
|
|
283
|
+
// nel formato chiave-valore: TID, DID, e "TID_MetadataID" per i metadati
|
|
284
|
+
else {
|
|
285
|
+
// Trova i metadati CICO nel descrittore del tipo documento
|
|
286
|
+
const CICO_CheckoutUserID_Meta = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID);
|
|
287
|
+
const CICO_CheckoutDate_Meta = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutDate);
|
|
288
|
+
const CICO_Version_Meta = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_Version);
|
|
289
|
+
fileExt = dcmt.FILEEXT ? dcmt.FILEEXT.toString() : null;
|
|
290
|
+
// Estrai l'ID dell'utente che ha effettuato il checkout
|
|
291
|
+
if (CICO_CheckoutUserID_Meta?.id) {
|
|
292
|
+
const keyUserID = dcmt.TID + "_" + CICO_CheckoutUserID_Meta.id;
|
|
293
|
+
const checkoutUserIdValue = dcmt[keyUserID];
|
|
294
|
+
checkoutUserId = checkoutUserIdValue ? Number(checkoutUserIdValue) : undefined;
|
|
295
|
+
}
|
|
296
|
+
// Estrai la data di checkout
|
|
297
|
+
if (CICO_CheckoutDate_Meta?.id) {
|
|
298
|
+
const keyDate = dcmt.TID + "_" + CICO_CheckoutDate_Meta.id;
|
|
299
|
+
checkoutDate = dcmt[keyDate];
|
|
300
|
+
}
|
|
301
|
+
// Estrai la versione del documento
|
|
302
|
+
if (CICO_Version_Meta?.id) {
|
|
303
|
+
const keyVersion = dcmt.TID + "_" + CICO_Version_Meta.id;
|
|
304
|
+
const versionRaw = dcmt[keyVersion];
|
|
305
|
+
version = (versionRaw != null && !isNaN(Number(versionRaw))) ? Number(versionRaw) : 1;
|
|
265
306
|
}
|
|
266
307
|
}
|
|
308
|
+
// ========================================================================
|
|
309
|
+
// COSTRUZIONE DELLO STATO DI CHECKOUT
|
|
310
|
+
// ========================================================================
|
|
311
|
+
let checkoutStatus = {
|
|
312
|
+
isCheckedOut: false,
|
|
313
|
+
mode: '',
|
|
314
|
+
version: version,
|
|
315
|
+
icon: null,
|
|
316
|
+
editLockTooltipText: null
|
|
317
|
+
};
|
|
318
|
+
// Verifica se il documento è effettivamente in stato di checkout
|
|
319
|
+
if (userID && checkoutUserId && !isNaN(checkoutUserId) && checkoutUserId > 0) {
|
|
320
|
+
// Determina la modalità in base all'utente:
|
|
321
|
+
// - editMode: l'utente corrente può modificare (è lui che ha fatto il checkout)
|
|
322
|
+
// - lockMode: il documento è bloccato da un altro utente
|
|
323
|
+
const mode = (userID === checkoutUserId) ? 'editMode' : 'lockMode';
|
|
324
|
+
// ====================================================================
|
|
325
|
+
// COSTRUZIONE DEL TOOLTIP INFORMATIVO
|
|
326
|
+
// ====================================================================
|
|
327
|
+
const editLockTooltipText = (_jsxs(_Fragment, { children: [_jsxs("div", { style: { textAlign: "center" }, children: [mode === 'editMode' && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }), SDKUI_Localizator.CurrentUserExtract] })), mode === 'lockMode' && (_jsxs(_Fragment, { children: [_jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }), SDKUI_Localizator.ExtractedFromOtherUser] }))] }), _jsx("hr", {}), _jsxs("div", { style: { textAlign: "left" }, children: [_jsxs("ul", { children: [_jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedBy }), ": ", findCheckOutUserName(allUsers, checkoutUserId), " (ID: ", checkoutUserId, ")"] }), _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.ExtractedOn }), ": ", Globalization.getDateTimeDisplayValue(checkoutDate?.toString())] })] }), _jsx("hr", {}), _jsx("ul", { children: _jsxs("li", { children: ["- ", _jsx("span", { style: { fontWeight: 'bold' }, children: SDKUI_Localizator.Version }), ": ", version] }) })] })] }));
|
|
328
|
+
// Crea l'icona con tooltip appropriata alla modalità
|
|
329
|
+
const icon = mode === 'editMode'
|
|
330
|
+
? _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-edit" }) })
|
|
331
|
+
: _jsx(TMTooltip, { content: editLockTooltipText, children: _jsx("i", { style: { fontSize: "18px", color: colors.MEDIUM_GREEN, fontWeight: "bold" }, className: "dx-icon-lock" }) });
|
|
332
|
+
checkoutStatus = {
|
|
333
|
+
isCheckedOut: true,
|
|
334
|
+
mode: mode,
|
|
335
|
+
icon: icon,
|
|
336
|
+
version: version,
|
|
337
|
+
editLockTooltipText: editLockTooltipText
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
// ========================================================================
|
|
341
|
+
// RESTITUZIONE RISULTATO FINALE
|
|
342
|
+
// ========================================================================
|
|
267
343
|
return {
|
|
268
|
-
|
|
344
|
+
// CICO è abilitato se configurato nel DTD e l'utente ha i permessi
|
|
345
|
+
cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes && fileExt !== null && fileExt !== '',
|
|
269
346
|
checkoutStatus: checkoutStatus
|
|
270
347
|
};
|
|
271
348
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom DevExtreme localization messages
|
|
3
|
+
* Contains missing translations for DevExtreme components
|
|
4
|
+
*/
|
|
5
|
+
export declare const devextremeCustomMessages: {
|
|
6
|
+
de: {
|
|
7
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
8
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
9
|
+
};
|
|
10
|
+
en: {
|
|
11
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
12
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
13
|
+
};
|
|
14
|
+
es: {
|
|
15
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
16
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
17
|
+
};
|
|
18
|
+
fr: {
|
|
19
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
20
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
21
|
+
};
|
|
22
|
+
it: {
|
|
23
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
24
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
25
|
+
};
|
|
26
|
+
pt: {
|
|
27
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
28
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom DevExtreme localization messages
|
|
3
|
+
* Contains missing translations for DevExtreme components
|
|
4
|
+
*/
|
|
5
|
+
export const devextremeCustomMessages = {
|
|
6
|
+
"de": {
|
|
7
|
+
"dxDataGrid-moveColumnToTheRight": "Nach rechts verschieben",
|
|
8
|
+
"dxDataGrid-moveColumnToTheLeft": "Nach links verschieben"
|
|
9
|
+
},
|
|
10
|
+
"en": {
|
|
11
|
+
"dxDataGrid-moveColumnToTheRight": "Move to the right",
|
|
12
|
+
"dxDataGrid-moveColumnToTheLeft": "Move to the left"
|
|
13
|
+
},
|
|
14
|
+
"es": {
|
|
15
|
+
"dxDataGrid-moveColumnToTheRight": "Mover a la derecha",
|
|
16
|
+
"dxDataGrid-moveColumnToTheLeft": "Mover a la izquierda"
|
|
17
|
+
},
|
|
18
|
+
"fr": {
|
|
19
|
+
"dxDataGrid-moveColumnToTheRight": "Déplacer vers la droite",
|
|
20
|
+
"dxDataGrid-moveColumnToTheLeft": "Déplacer vers la gauche"
|
|
21
|
+
},
|
|
22
|
+
"it": {
|
|
23
|
+
"dxDataGrid-moveColumnToTheRight": "Sposta a destra",
|
|
24
|
+
"dxDataGrid-moveColumnToTheLeft": "Sposta a sinistra"
|
|
25
|
+
},
|
|
26
|
+
"pt": {
|
|
27
|
+
"dxDataGrid-moveColumnToTheRight": "Mover para a direita",
|
|
28
|
+
"dxDataGrid-moveColumnToTheLeft": "Mover para a esquerda"
|
|
29
|
+
}
|
|
30
|
+
};
|
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Colors as ColorsType } from "../components/base/TMEditorBase";
|
|
2
2
|
import { DeviceType } from "../components";
|
|
3
|
-
import { AppModules, DataColumnDescriptor, ITopMediaSession, MetadataDescriptor, QueryDescriptor, SearchResultDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, ITopMediaSession, MetadataDescriptor, QueryDescriptor, SearchResultDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { FileExtensionHandler, FormModes, moduleTypes } from "../ts";
|
|
5
5
|
declare const TABLET_WIDTH = 1024;
|
|
6
6
|
declare const MOBILE_WIDTH = 640;
|
|
@@ -89,3 +89,4 @@ export declare class AreaHelper {
|
|
|
89
89
|
static ExtractAreaInfo_1(areaPath: string): AreaValues;
|
|
90
90
|
static ExtractAreaInfo_2(areaPath: string, extractFileName: boolean): AreaValues;
|
|
91
91
|
}
|
|
92
|
+
export declare const isApprovalWorkflowView: (dtd: DcmtTypeDescriptor) => boolean;
|
package/lib/helper/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Colors } from "../utils/theme";
|
|
3
3
|
import { ButtonNames, DeviceType, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
|
|
4
|
-
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SetGlobalsInfoAsync, SystemMIDs, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SetGlobalsInfoAsync, SystemMIDs, SystemMIDsAsNumber, TopMediaServer, WorkItemMetadataNames } from "@topconsultnpm/sdk-ts";
|
|
5
5
|
import { Buffer } from 'buffer';
|
|
6
6
|
import { buildTypes, FileExtensionHandler, FormModes, moduleTypes } from "../ts";
|
|
7
7
|
import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
|
@@ -505,7 +505,8 @@ export const extensionHandler = (fileExt) => {
|
|
|
505
505
|
case 'txt': return FileExtensionHandler.READY_TO_SHOW;
|
|
506
506
|
case 'config':
|
|
507
507
|
case 'cfg':
|
|
508
|
-
case 'json':
|
|
508
|
+
case 'json':
|
|
509
|
+
case 'sql': return FileExtensionHandler.READY_TO_SHOW;
|
|
509
510
|
default: return FileExtensionHandler.NONE;
|
|
510
511
|
}
|
|
511
512
|
};
|
|
@@ -664,7 +665,13 @@ export const renderHighlightedText = (text, searchText, isSelected) => {
|
|
|
664
665
|
return text.split(regex).map((part, index) => regex.test(part) ? (_jsx("span", { style: { backgroundColor: isSelected ? '#6c9023' : 'yellow' }, children: part }, index)) : (part));
|
|
665
666
|
};
|
|
666
667
|
export function versionAndBuildtypeInfo(module) {
|
|
667
|
-
|
|
668
|
+
switch (module) {
|
|
669
|
+
case moduleTypes.SDK:
|
|
670
|
+
case moduleTypes.SDKUI:
|
|
671
|
+
return moduleVersion(module).replace("-hotfix.", "+hotfix").replace("-hotfix", "+hotfix");
|
|
672
|
+
default:
|
|
673
|
+
return moduleVersion(module);
|
|
674
|
+
}
|
|
668
675
|
}
|
|
669
676
|
export const getListMaxItems = (deviceType) => { return deviceType === DeviceType.MOBILE ? 8 : 12; };
|
|
670
677
|
export const svgToString = (icon) => {
|
|
@@ -850,3 +857,7 @@ export class AreaHelper {
|
|
|
850
857
|
}
|
|
851
858
|
AreaHelper.AreaPathPrefix = "tmarea:\\\\";
|
|
852
859
|
AreaHelper.AreaFolderNamePrefix = "AID_";
|
|
860
|
+
export const isApprovalWorkflowView = (dtd) => {
|
|
861
|
+
return Boolean(dtd?.isView &&
|
|
862
|
+
dtd.metadata?.some(data => data.name === WorkItemMetadataNames.WI_DID));
|
|
863
|
+
};
|
package/lib/helper/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from './queryHelper';
|
|
|
9
9
|
export * from './TMUtils';
|
|
10
10
|
export * from './TMCommandsContextMenu';
|
|
11
11
|
export * from './TMConditionalWrapper';
|
|
12
|
+
export * from './TMPdfViewer';
|
|
12
13
|
export * from './TMToppyMessage';
|
|
13
14
|
export * from './GlobalStyles';
|
|
14
15
|
export * from './checkinCheckoutManager';
|
package/lib/helper/index.js
CHANGED
|
@@ -9,6 +9,7 @@ export * from './queryHelper';
|
|
|
9
9
|
export * from './TMUtils';
|
|
10
10
|
export * from './TMCommandsContextMenu';
|
|
11
11
|
export * from './TMConditionalWrapper';
|
|
12
|
+
export * from './TMPdfViewer';
|
|
12
13
|
export * from './TMToppyMessage';
|
|
13
14
|
export * from './GlobalStyles';
|
|
14
15
|
export * from './checkinCheckoutManager';
|
|
@@ -2,6 +2,7 @@ import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDs
|
|
|
2
2
|
import { DateDisplayTypes, Globalization } from './Globalization';
|
|
3
3
|
import { ChronologyMIDs, DraftsMIDs, MetadataValueDescriptorEx } from '../ts';
|
|
4
4
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
5
|
+
import { getDcmtCicoInfo } from './checkinCheckoutManager';
|
|
5
6
|
export const getTIDsByQd = (qd) => {
|
|
6
7
|
let tids = [];
|
|
7
8
|
qd?.from?.tid && tids.push({ tid: qd.from?.tid, alias: undefined });
|
|
@@ -82,6 +83,22 @@ export const prepareQdForSearchAsync = async (qdInput, removeWhereItemNoValue) =
|
|
|
82
83
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsMail);
|
|
83
84
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsSigned);
|
|
84
85
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsShared);
|
|
86
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(fromTID);
|
|
87
|
+
if (dtd) {
|
|
88
|
+
const cicoInfo = getDcmtCicoInfo(dtd);
|
|
89
|
+
const canCICO = cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes;
|
|
90
|
+
if (canCICO) {
|
|
91
|
+
if (!qd.select.find(o => o.mid == cicoInfo.UserID_MID) && cicoInfo.UserID_CanViewOrUpdate == AccessLevels.Yes) {
|
|
92
|
+
addHiddenSelectItem(qd.select, fromTID, cicoInfo.UserID_MID);
|
|
93
|
+
}
|
|
94
|
+
if (!qd.select.find(o => o.mid == cicoInfo.Date_MID) && cicoInfo.Date_CanViewOrUpdate == AccessLevels.Yes) {
|
|
95
|
+
addHiddenSelectItem(qd.select, fromTID, cicoInfo.Date_MID);
|
|
96
|
+
}
|
|
97
|
+
if (!qd.select.find(o => o.mid == cicoInfo.Ver_MID) && cicoInfo.Ver_CanViewOrUpdate == AccessLevels.Yes) {
|
|
98
|
+
addHiddenSelectItem(qd.select, fromTID, cicoInfo.Ver_MID);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
85
102
|
if (qd.orderBy && qd.orderBy.length <= 0) {
|
|
86
103
|
let obi = new OrderByItem();
|
|
87
104
|
obi.tid = fromTID;
|
|
@@ -311,6 +328,18 @@ export const searchResultToMetadataValues = (tid, dtd, rows, mids, metadata, lay
|
|
|
311
328
|
mvd.customName = SDKUI_Localizator.Author;
|
|
312
329
|
mvd.isReadOnly = true;
|
|
313
330
|
break;
|
|
331
|
+
case ChronologyMIDs.CheckInTime:
|
|
332
|
+
mvd.customName = SDKUI_Localizator.LastUpdateTime;
|
|
333
|
+
mvd.isReadOnly = true;
|
|
334
|
+
break;
|
|
335
|
+
case SystemMIDsAsNumber.FileExt:
|
|
336
|
+
mvd.customName = SDKUI_Localizator.Extension;
|
|
337
|
+
mvd.isReadOnly = true;
|
|
338
|
+
break;
|
|
339
|
+
case SystemMIDsAsNumber.FileSize:
|
|
340
|
+
mvd.customName = SDKUI_Localizator.File_Size;
|
|
341
|
+
mvd.isReadOnly = true;
|
|
342
|
+
break;
|
|
314
343
|
}
|
|
315
344
|
}
|
|
316
345
|
return mvd;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DcmtInfo, DownloadModes, DownloadTypes } from '../ts';
|
|
2
|
+
import { FileDescriptor, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
interface UseCheckInOutOperationsReturn {
|
|
4
|
+
showHistory: boolean;
|
|
5
|
+
showHistoryCallback: () => void;
|
|
6
|
+
hideHistoryCallback: () => void;
|
|
7
|
+
showCheckoutInformationForm: boolean;
|
|
8
|
+
showCheckoutInformationFormCallback: () => void;
|
|
9
|
+
hideCheckoutInformationFormCallback: () => void;
|
|
10
|
+
commentFormState: {
|
|
11
|
+
removeAndEditAttachment: boolean;
|
|
12
|
+
show: boolean;
|
|
13
|
+
isRequired: boolean;
|
|
14
|
+
};
|
|
15
|
+
hideCommentFormCallback: () => void;
|
|
16
|
+
copyCheckoutPathToClipboardCallback: (dcmt: DcmtInfo, filename: string) => void;
|
|
17
|
+
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>, refreshCurrentDcmt?: () => Promise<void>, refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
18
|
+
handleCheckInCallback: (dcmt: DcmtInfo, refreshCurrentDcmt?: () => Promise<void>, refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
19
|
+
refreshPreviewTrigger: number;
|
|
20
|
+
showCicoWaitPanel: boolean;
|
|
21
|
+
cicoWaitPanelTitle: string;
|
|
22
|
+
showCicoPrimaryProgress: boolean;
|
|
23
|
+
cicoPrimaryProgressText: string;
|
|
24
|
+
cicoPrimaryProgressValue: number;
|
|
25
|
+
cicoPrimaryProgressMax: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const useCheckInOutOperations: () => UseCheckInOutOperationsReturn;
|
|
28
|
+
export {};
|