@topconsultnpm/sdkui-react 6.19.0-test2 → 6.19.0

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.
Files changed (27) hide show
  1. package/lib/components/choosers/TMDynDataListItemChooser.js +5 -4
  2. package/lib/components/editors/TMMetadataValues.js +18 -10
  3. package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +74 -63
  4. package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
  5. package/lib/components/features/documents/TMDcmtForm.js +12 -5
  6. package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
  7. package/lib/components/features/search/TMSearchQueryPanel.js +1 -1
  8. package/lib/components/features/search/TMSearchResult.js +106 -26
  9. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +8 -0
  10. package/lib/components/features/search/TMSearchResultCheckoutInfoForm.js +134 -0
  11. package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -2
  12. package/lib/components/features/search/TMSearchResultsMenuItems.js +40 -62
  13. package/lib/components/features/search/TMTreeSelector.js +1 -1
  14. package/lib/components/features/search/TMViewHistoryDcmtForm.d.ts +18 -0
  15. package/lib/components/features/search/TMViewHistoryDcmtForm.js +215 -0
  16. package/lib/components/grids/TMRecentsManager.js +1 -1
  17. package/lib/helper/SDKUI_Globals.d.ts +7 -0
  18. package/lib/helper/SDKUI_Globals.js +1 -0
  19. package/lib/helper/SDKUI_Localizator.d.ts +9 -0
  20. package/lib/helper/SDKUI_Localizator.js +121 -6
  21. package/lib/helper/TMIcons.d.ts +3 -1
  22. package/lib/helper/TMIcons.js +9 -1
  23. package/lib/helper/cicoHelper.d.ts +31 -0
  24. package/lib/helper/cicoHelper.js +155 -0
  25. package/lib/helper/helpers.d.ts +7 -0
  26. package/lib/helper/helpers.js +31 -4
  27. package/package.json +2 -2
@@ -1,75 +1,31 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService, LicenseModuleStatus, CICO_MetadataNames } from '@topconsultnpm/sdk-ts';
2
+ import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService, LicenseModuleStatus } from '@topconsultnpm/sdk-ts';
3
3
  import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled, IconPair, IconUnpair, IconSharedDcmt, IconShare, IconCopy, IconMoveToFolder } from '../../../helper';
4
4
  import ShowAlert from '../../base/TMAlert';
5
5
  import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
6
6
  import TMSpinner from '../../base/TMSpinner';
7
7
  import { DcmtOperationTypes, DownloadTypes, SearchResultContext } from '../../../ts';
8
8
  import { isXMLFileExt } from '../../../helper/dcmtsHelper';
9
- const getCicoInfo = (dtd) => {
10
- const cico = {
11
- CICO: 0,
12
- CanCICO: AccessLevels.No,
13
- CanDelChronology: AccessLevels.No,
14
- UserID_MID: 0,
15
- Date_MID: 0,
16
- Ver_MID: 0,
17
- UserID_CanViewOrUpdate: AccessLevels.No,
18
- Date_CanViewOrUpdate: AccessLevels.No,
19
- Ver_CanViewOrUpdate: AccessLevels.No,
20
- };
21
- if (dtd === undefined)
22
- return cico;
23
- cico.CICO = dtd.cico ?? 0;
24
- cico.CanCICO = dtd.perm?.canCICO ?? AccessLevels.No;
25
- cico.CanDelChronology = dtd.perm?.canDelChron ?? AccessLevels.No;
26
- const mdCheckout = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID);
27
- if (mdCheckout) {
28
- cico.UserID_MID = mdCheckout.fromMID;
29
- cico.UserID_CanViewOrUpdate = (mdCheckout.perm?.canView == AccessLevels.Yes || mdCheckout.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
30
- }
31
- const mdDate = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutDate);
32
- if (mdDate) {
33
- cico.Date_MID = mdDate.fromMID;
34
- cico.Date_CanViewOrUpdate = (mdDate.perm?.canView == AccessLevels.Yes || mdDate.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
35
- }
36
- const mdVer = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_Version);
37
- if (mdVer) {
38
- cico.Ver_MID = mdVer.fromMID;
39
- cico.Ver_CanViewOrUpdate = (mdVer.perm?.canView == AccessLevels.Yes || mdVer.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
40
- }
41
- return cico;
42
- };
43
- const cicoIsEnabled = (dcmt, dtd) => {
44
- const cicoInfo = getCicoInfo(dtd);
45
- let isCheckout = false;
46
- const CICO_CheckoutUserID = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID)?.id;
47
- if (dcmt && CICO_CheckoutUserID) {
48
- const key = dcmt.TID + "_" + CICO_CheckoutUserID;
49
- const value = dcmt[key];
50
- if (value && value > 0) {
51
- isCheckout = true;
52
- }
53
- }
54
- return {
55
- cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes,
56
- isCheckout: isCheckout
57
- };
58
- };
9
+ import { cicoIsEnabled } from '../../../helper/cicoHelper';
59
10
  const disabledForSingleRow = (selectedItems, focusedItem) => {
60
- return selectedItems.length > 1 || focusedItem === undefined;
11
+ // Disabilita se ci sono più item selezionati o se focusedItem non ha TID/DID validi
12
+ return selectedItems.length > 1 || focusedItem === undefined || focusedItem.TID === undefined || focusedItem.DID === undefined;
61
13
  };
62
14
  const disabledForMultiRow = (selectedItems, focusedItem) => {
63
- return selectedItems.length === 0 && focusedItem === undefined;
15
+ // Disabilita se non ci sono selectedItems e focusedItem non ha TID/DID validi
16
+ return selectedItems.length === 0 && (focusedItem === undefined || focusedItem.TID === undefined || focusedItem.DID === undefined);
64
17
  };
65
18
  const MAX_DCMTS_FOR_SELECTION_REFRESH = 100;
66
19
  export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat) => {
67
20
  if (selectedItems.length <= 0 && !focusedItem)
68
21
  return [];
69
22
  if (selectedItems.length > 0) {
70
- return selectedItems.map((item) => { return { TID: item.TID, DID: item.DID, FILEEXT: item.FILEEXT, ISSIGNED: Number(item.ISSIGNED ?? 0), fileFormat: fileFormat, rowIndex: item.rowIndex }; });
23
+ // Filtra solo gli item che hanno TID e DID validi
24
+ return selectedItems
25
+ .filter((item) => item.TID !== undefined && item.DID !== undefined)
26
+ .map((item) => { return { TID: item.TID, DID: item.DID, FILEEXT: item.FILEEXT, ISSIGNED: Number(item.ISSIGNED ?? 0), fileFormat: fileFormat, rowIndex: item.rowIndex }; });
71
27
  }
72
- else if (focusedItem !== undefined) {
28
+ else if (focusedItem !== undefined && focusedItem.TID !== undefined && focusedItem.DID !== undefined) {
73
29
  return [{ TID: focusedItem.TID, DID: focusedItem.DID, FILEEXT: focusedItem.FILEEXT, ISSIGNED: Number(focusedItem.ISSIGNED ?? 0), fileFormat: fileFormat, rowIndex: focusedItem.rowIndex }];
74
30
  }
75
31
  return [];
@@ -140,7 +96,7 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
140
96
  TMSpinner.hide();
141
97
  }
142
98
  };
143
- export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
99
+ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
144
100
  const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
145
101
  let pdfEditorAvailable = false;
146
102
  if (dtd && dtd.widgets && dtd.widgets.length > 0) {
@@ -372,26 +328,48 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
372
328
  const selectedDocs = getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem);
373
329
  // Take the first document (used for validation checks)
374
330
  const firstDoc = selectedDocs?.[0];
375
- const { cicoEnabled, isCheckout } = cicoIsEnabled(firstDoc, dtd);
331
+ const { cicoEnabled, checkoutStatus } = cicoIsEnabled(firstDoc, allUsers, dtd);
376
332
  return {
377
333
  icon: svgToString(_jsx(IconFileDots, {})),
378
334
  text: "Check in/Check out",
379
- disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
335
+ disabled: firstDoc === undefined || disabledForSingleRow(selectedItems, focusedItem),
380
336
  items: [
381
337
  {
382
338
  icon: "edit",
383
339
  text: 'Check out',
384
- disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
385
- // disabled: isNotSingleFile || isGroupLocked || isFileCheckedOut,
340
+ disabled: !cicoEnabled || checkoutStatus.isCheckedOut || disabledForSingleRow(selectedItems, focusedItem),
386
341
  onClick: () => handleCheckOutOperationCallback(true),
387
342
  },
343
+ /* {
344
+ icon: "unlock",
345
+ text: 'Check in',
346
+ // onClick: () => handleCheckInOperationCallback(),
347
+ disabled: !cicoEnabled || !checkoutStatus.isCheckedOut || checkoutStatus.mode === 'lockMode' || disabledForSingleRow(selectedItems, focusedItem)
348
+ }, */
388
349
  {
389
350
  icon: "remove",
390
351
  text: SDKUI_Localizator.CancelCheckOut,
391
- disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
392
- // disabled: isNotSingleFile || isGroupLocked || isFileNotCheckedOut || isNotCheckedOutByCurrentUser,
352
+ disabled: !cicoEnabled || !checkoutStatus.isCheckedOut || checkoutStatus.mode === 'lockMode' || disabledForSingleRow(selectedItems, focusedItem),
393
353
  onClick: () => handleCheckOutOperationCallback(false),
394
354
  },
355
+ {
356
+ icon: "clock",
357
+ text: SDKUI_Localizator.History,
358
+ disabled: checkoutStatus.version === 1 || disabledForSingleRow(selectedItems, focusedItem),
359
+ onClick: viewHistoryCallback,
360
+ },
361
+ {
362
+ icon: "info",
363
+ text: SDKUI_Localizator.CheckoutInfo,
364
+ onClick: showCheckoutInformationFormCallback,
365
+ disabled: !checkoutStatus.isCheckedOut || disabledForSingleRow(selectedItems, focusedItem)
366
+ },
367
+ /* {
368
+ icon: "copy",
369
+ text: SDKUI_Localizator.CopyCheckoutPath,
370
+ // onClick: infoCheckCopyToClipboard,
371
+ disabled: !checkoutStatus.isCheckedOut || disabledForSingleRow(selectedItems, focusedItem)
372
+ }, */
395
373
  ]
396
374
  };
397
375
  };
@@ -178,7 +178,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
178
178
  }
179
179
  } }), children: trees.length > 0
180
180
  ?
181
- _jsxs("div", { style: {
181
+ _jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: {
182
182
  display: 'flex',
183
183
  flexDirection: 'column',
184
184
  height: '100%',
@@ -0,0 +1,18 @@
1
+ import { DcmtInfo } from "../../../ts/types";
2
+ import { DeviceType } from "../../base/TMDeviceProvider";
3
+ import { DcmtTypeDescriptor, HomeBlogPost, TaskDescriptor } from "@topconsultnpm/sdk-ts";
4
+ interface TMViewHistoryDcmtFormProps {
5
+ fromDTD: DcmtTypeDescriptor;
6
+ deviceType: DeviceType | undefined;
7
+ inputDcmt: DcmtInfo;
8
+ onClose: () => void;
9
+ allTasks?: Array<TaskDescriptor>;
10
+ getAllTasks?: () => Promise<void>;
11
+ deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
12
+ addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
13
+ editTaskCallback?: (task: TaskDescriptor) => Promise<void>;
14
+ handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
15
+ handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
16
+ }
17
+ declare const TMViewHistoryDcmtForm: (props: TMViewHistoryDcmtFormProps) => import("react/jsx-runtime").JSX.Element;
18
+ export default TMViewHistoryDcmtForm;
@@ -0,0 +1,215 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useMemo, useState } from "react";
3
+ import { FormModes } from "../../../ts/types";
4
+ import { associateColumnsToRows, calcResponsiveSizes, formatBytes, Globalization, SDKUI_Localizator } from "../../../helper";
5
+ import TMModal from "../../base/TMModal";
6
+ import { SDK_Globals, UpdateEngineByID, UserListCacheService } from "@topconsultnpm/sdk-ts";
7
+ import TMSpinner from "../../base/TMSpinner";
8
+ import { TMExceptionBoxManager } from "../../base/TMPopUp";
9
+ import TMDcmtIcon from "../documents/TMDcmtIcon";
10
+ import TMDataGrid from "../../base/TMDataGrid";
11
+ import TMDcmtForm from "../documents/TMDcmtForm";
12
+ const TMViewHistoryDcmtForm = (props) => {
13
+ const { deviceType, inputDcmt, onClose, fromDTD, allTasks, getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers } = props;
14
+ const [dcmtHistory, setDcmtHistory] = useState([]);
15
+ // showId is a state variable that determines whether an ID-related component or feature should be displayed
16
+ const [showId, setShowId] = useState(false);
17
+ // State to store when show search panel inside datagrid
18
+ const [showSearch, setShowSearch] = useState(true);
19
+ // Memoized configuration for DataGrid selection mode: single selection without checkboxes
20
+ const selection = useMemo(() => {
21
+ return { mode: 'single', showCheckBoxesMode: 'none' };
22
+ }, []);
23
+ // State to store the currently focused row key, initially set to undefined
24
+ const [focusedRowKey, setFocusedRowKey] = useState(undefined);
25
+ // State to store the currently focused row index, initially set to -1
26
+ const [selectedIndex, setSelectedIndex] = useState(-1);
27
+ // State to manage show selected file
28
+ const [showDcmtForm, setShowDcmtForm] = useState(false);
29
+ // Memoized value to get the selected draft based on the focused row key
30
+ const selectedDcmt = useMemo(() => dcmtHistory.find(dcmt => dcmt.id === focusedRowKey), [focusedRowKey, dcmtHistory]);
31
+ const getParticipantById = (id, users) => {
32
+ if (users.length === 0)
33
+ return null;
34
+ return users.find(participant => participant.id === id) || null;
35
+ };
36
+ const getHistory = async (users) => {
37
+ try {
38
+ // Show a spinner with a loading message
39
+ TMSpinner.show({ description: SDKUI_Localizator.Loading });
40
+ // Initialize the working group engine
41
+ const ue = new UpdateEngineByID(SDK_Globals.tmSession);
42
+ ue.DID = inputDcmt.DID;
43
+ ue.TID = inputDcmt.TID;
44
+ ue.Metadata_ClearAll();
45
+ const dcmtGetHistory = await ue.GetChronologyAsync();
46
+ if (dcmtGetHistory && dcmtGetHistory.dtdResult) {
47
+ const data = associateColumnsToRows(dcmtGetHistory.dtdResult.columns ?? [], dcmtGetHistory.dtdResult.rows ?? []);
48
+ const historyFileItems = data.map((row) => {
49
+ const updaterID = Number(row.UpdaterID);
50
+ const user = getParticipantById(updaterID, users);
51
+ return {
52
+ id: Number(row.DID),
53
+ TID: row.TID,
54
+ DID: row.DID,
55
+ FileCount: row.FileCount,
56
+ FileExt: row.FileExt,
57
+ FileSize: row.FileSize,
58
+ FileSizeDisplay: formatBytes(Number(row.FileSize) ?? 0),
59
+ UpdaterID: row.UpdaterID,
60
+ UpdaterDisplayName: user?.name ?? updaterID.toString(),
61
+ CreationTime: row.CreationTime,
62
+ LastUpdateTime: row.LastUpdateTime,
63
+ LastUpdateTimeDisplay: row.LastUpdateTime ? Globalization.getDateTimeDisplayValue(new Date(row.LastUpdateTime)) : '-',
64
+ Version: row.Version,
65
+ CheckInTime: row.CheckInTime,
66
+ IsLex: row.IsLex ? row.IsLex.toString() === '1' : false,
67
+ IsLogDel: row.IsLogDel ? row.IsLogDel.toString() === '1' : false,
68
+ IsMail: row.IsMail ? row.IsMail.toString() === '1' : false,
69
+ IsShared: row.IsShared ? row.IsShared.toString() === '1' : false,
70
+ IsSigned: row.IsSigned ? row.IsSigned.toString() === '1' : false,
71
+ };
72
+ });
73
+ return historyFileItems;
74
+ }
75
+ return [];
76
+ }
77
+ catch (error) {
78
+ // Show error if something goes wrong
79
+ TMExceptionBoxManager.show({ exception: error });
80
+ return [];
81
+ }
82
+ finally {
83
+ // Hide spinner when done
84
+ TMSpinner.hide();
85
+ }
86
+ };
87
+ // Define an asynchronous function to fetch draft history
88
+ const fetchDcmtHistory = async (users) => {
89
+ // Await the result of the getHistory() function, which likely retrieves draft history data
90
+ const historyFileItems = await getHistory(users);
91
+ // Update the state with the fetched history data
92
+ setDcmtHistory(historyFileItems);
93
+ };
94
+ // Load users and history data
95
+ const loadData = async () => {
96
+ const users = await UserListCacheService.GetAllAsync();
97
+ await fetchDcmtHistory(users ?? []);
98
+ };
99
+ useEffect(() => {
100
+ loadData();
101
+ }, []);
102
+ // Handles focus change in the data grid
103
+ const onFocusedRowChanged = useCallback((e) => {
104
+ const key = e.row?.key;
105
+ setFocusedRowKey(key);
106
+ if (key !== undefined) {
107
+ const index = dcmtHistory.findIndex(item => item.id === key);
108
+ setSelectedIndex(index);
109
+ }
110
+ else {
111
+ setSelectedIndex(-1);
112
+ }
113
+ }, [dcmtHistory]);
114
+ const cellExtRender = useCallback((cellData) => {
115
+ const data = cellData.data;
116
+ const tooltipContent = (_jsxs("div", { style: { textAlign: 'left' }, children: [_jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "ID:" }), " ", data.id ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "DID:" }), " ", data.DID ?? '-'] }), _jsxs("div", { children: [_jsx("span", { style: { fontWeight: 'bold' }, children: "TID:" }), " ", data.TID ?? '-'] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Author, ":"] }), " ", data.UpdaterDisplayName ?? '-'] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Version, ":"] }), " ", data.Version] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.Size, ":"] }), " ", formatBytes(Number(data.FileSize ?? 0))] }), _jsx("hr", {}), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.CreationTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(data.CreationTime)] }), _jsxs("div", { children: [_jsxs("span", { style: { fontWeight: 'bold' }, children: [SDKUI_Localizator.LastUpdateTime, ":"] }), " ", Globalization.getDateTimeDisplayValue(data.LastUpdateTime)] })] }));
117
+ return _jsx("div", { style: { display: 'flex', justifyContent: 'center', alignItems: 'center' }, children: _jsx(TMDcmtIcon, { tid: Number(data.TID), did: Number(data.DID), fileExtension: data.FileExt, downloadMode: 'openInNewWindow', tooltipContent: tooltipContent }) });
118
+ }, []);
119
+ const onContextMenuPreparing = (e) => {
120
+ if (e === undefined)
121
+ return;
122
+ if (e.target === 'content') {
123
+ e.items = e.items || [];
124
+ e.items = [
125
+ {
126
+ icon: "datafield",
127
+ text: SDKUI_Localizator.OpenForm,
128
+ disabled: focusedRowKey === undefined,
129
+ onClick: () => setShowDcmtForm(true),
130
+ },
131
+ /* {
132
+ icon: "download",
133
+ text: 'Download',
134
+ tooltip: SURFER_Localizator.DownloadSelectedDraftFile,
135
+ disabled: focusedRowKey === undefined,
136
+ onClick: () => downloadFilesCallback(),
137
+ },
138
+ {
139
+ icon: "trash",
140
+ text: SDKUI_Localizator.Delete,
141
+ disabled: isGroupArchived || focusedRowKey === undefined,
142
+ onClick: deleteFilesCallback,
143
+ beginGroup: true
144
+ }, */
145
+ {
146
+ icon: showSearch ? "eyeclose" : "eyeopen",
147
+ onClick: () => setShowSearch(prevShowSearch => !prevShowSearch),
148
+ text: showSearch ? SDKUI_Localizator.HideSearch : SDKUI_Localizator.ShowSearch,
149
+ visible: true,
150
+ disabled: false,
151
+ beginGroup: true
152
+ },
153
+ {
154
+ icon: showId ? 'eyeclose' : 'eyeopen',
155
+ onClick: () => setShowId(prevShowId => !prevShowId),
156
+ text: showId ? SDKUI_Localizator.ID_Hide : SDKUI_Localizator.ID_Show,
157
+ visible: true,
158
+ disabled: false,
159
+ },
160
+ {
161
+ icon: "refresh",
162
+ text: SDKUI_Localizator.Refresh,
163
+ disabled: false,
164
+ onClick: loadData,
165
+ },
166
+ ];
167
+ }
168
+ };
169
+ // Handler for double-click cell event
170
+ const onCellDblClick = useCallback((e) => {
171
+ if (e.column.dataField === "FileExt")
172
+ return;
173
+ setFocusedRowKey(e.data.id);
174
+ setShowDcmtForm(true);
175
+ }, []);
176
+ // Checks if navigation is possible in the given direction
177
+ const canNavigateHandler = (dir) => {
178
+ if (focusedRowKey === undefined)
179
+ return false;
180
+ const index = dcmtHistory.findIndex(item => item.id === focusedRowKey);
181
+ if (index === -1)
182
+ return false;
183
+ return dir === 'next' ? index < dcmtHistory.length - 1 : index > 0;
184
+ };
185
+ // Navigates to the next or previous item in the draft history, if possible.
186
+ const onNavigateHandler = (dir) => {
187
+ if (selectedIndex === -1)
188
+ return;
189
+ let newIndex = selectedIndex;
190
+ if (dir === 'next' && selectedIndex < dcmtHistory.length - 1) {
191
+ newIndex = selectedIndex + 1;
192
+ }
193
+ else if (dir === 'prev' && selectedIndex > 0) {
194
+ newIndex = selectedIndex - 1;
195
+ }
196
+ const newFocusedId = dcmtHistory[newIndex]?.id;
197
+ if (newFocusedId !== undefined) {
198
+ setFocusedRowKey(newFocusedId);
199
+ setSelectedIndex(newIndex);
200
+ }
201
+ };
202
+ const dataColumns = useMemo(() => {
203
+ return ([
204
+ { dataField: "id", caption: "ID", dataType: 'string', visible: showId },
205
+ { dataField: "FileExt", caption: "", cellRender: cellExtRender },
206
+ { dataField: "Version", caption: "V." },
207
+ { dataField: "FileSizeDisplay", caption: SDKUI_Localizator.Size },
208
+ { dataField: "UpdaterDisplayName", caption: SDKUI_Localizator.Author },
209
+ { dataField: "LastUpdateTimeDisplay", caption: SDKUI_Localizator.LastUpdateTime },
210
+ ]);
211
+ }, [showId]);
212
+ return _jsxs(TMModal, { title: `${SDKUI_Localizator.SearchResult} \u2014 ${SDKUI_Localizator.History + ": " + (fromDTD.nameLoc ?? SDKUI_Localizator.Document) + " (DID:" + inputDcmt.DID})`, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '80%', '80%', '95%'), onClose: onClose, children: [_jsx(TMDataGrid, { dataSource: dcmtHistory, dataColumns: dataColumns, focusedRowKey: focusedRowKey, selection: selection, onContextMenuPreparing: onContextMenuPreparing, onFocusedRowChanged: onFocusedRowChanged, onCellDblClick: onCellDblClick, noDataText: SDKUI_Localizator.NoDataToDisplay, showSearchPanel: showSearch }), (showDcmtForm && selectedDcmt !== undefined) &&
213
+ _jsx(TMDcmtForm, { TID: Number(selectedDcmt.TID), DID: Number(selectedDcmt.DID), formMode: FormModes.ReadOnly, isModal: true, widthModal: "95%", heightModal: "95%", titleModal: fromDTD.name ?? SDKUI_Localizator.SearchResult, allowNavigation: dcmtHistory.length > 0, itemIndex: selectedIndex + 1, count: dcmtHistory.length, onClose: () => { setShowDcmtForm(false); }, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback })] });
214
+ };
215
+ export default TMViewHistoryDcmtForm;
@@ -105,7 +105,7 @@ const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, accessFilter = '
105
105
  setInfoDTD(undefined);
106
106
  });
107
107
  const isMobile = deviceType === DeviceType.MOBILE;
108
- return (_jsxs(_Fragment, { children: [_jsxs("div", { style: { overflowY: isMobile ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px', width: '100%' }, children: [_jsx(StyledRecentTidItem, { id: `tid-${0}`, "$isMobile": isMobile, onClick: () => { setShowDcmtTypeChooser(true); }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%' }, children: _jsx("p", { style: {
108
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { onContextMenu: (e) => e.preventDefault(), style: { overflowY: isMobile ? 'auto' : undefined, display: 'flex', flexDirection: 'column', padding: '5px', width: '100%' }, children: [_jsx(StyledRecentTidItem, { id: `tid-${0}`, "$isMobile": isMobile, onClick: () => { setShowDcmtTypeChooser(true); }, children: _jsx("div", { style: { display: 'flex', alignItems: 'center', justifyContent: 'center', width: '100%' }, children: _jsx("p", { style: {
109
109
  color: TMColors.primaryColor,
110
110
  fontSize: '1rem',
111
111
  fontWeight: 600,
@@ -17,6 +17,7 @@ export declare class UserSettings {
17
17
  themeSettings: ThemeSettings;
18
18
  dcmtFormSettings: DcmtFormSettings[];
19
19
  wgDraftCheckoutInfo: WgDraftCheckoutInfo[];
20
+ dcmtCheckoutInfo: DcmtCheckoutInfo[];
20
21
  defaultCheckInOutFolder: string;
21
22
  constructor(skipCssUpdate?: boolean);
22
23
  /** Load settings from local storage or other sources */
@@ -91,6 +92,12 @@ export interface WgDraftCheckoutInfo {
91
92
  checkoutFolder: string;
92
93
  checkoutName: string;
93
94
  }
95
+ export interface DcmtCheckoutInfo {
96
+ DID: string;
97
+ TID: string;
98
+ checkoutFolder: string;
99
+ checkoutName: string;
100
+ }
94
101
  export declare class SDKUI_Globals {
95
102
  static userSettings: UserSettings;
96
103
  }
@@ -20,6 +20,7 @@ export class UserSettings {
20
20
  this.themeSettings = new ThemeSettings(true);
21
21
  this.dcmtFormSettings = [];
22
22
  this.wgDraftCheckoutInfo = [];
23
+ this.dcmtCheckoutInfo = [];
23
24
  this.defaultCheckInOutFolder = DEFAULT_CHECK_IN_OUT_FOLDER;
24
25
  this.themeSettings = new ThemeSettings(skipCssUpdate);
25
26
  }
@@ -88,8 +88,10 @@ export declare class SDKUI_Localizator {
88
88
  static get ChangePassword(): "Kennwort ändern" | "Change password" | "Cambiar la contraseña" | "Changer le mot de passe" | "Alterar a senha" | "Cambia password";
89
89
  static get CharactersRemaining(): "verbleibende Zeichen" | "characters remaining" | "caracteres restantes" | "caractères restants" | "caratteri rimanenti";
90
90
  static get CheckIn(): "Check in" | "Enregistrement";
91
+ static get CheckInOutSettingsNotice(): string;
91
92
  static get Checkmark(): "Häkchen" | "Checkmark" | "Marca de verificación" | "Coche" | "Marca de verificação" | "Spunta";
92
93
  static get CheckOut(): "Check out" | "Extraction";
94
+ static get CheckoutInfo(): string;
93
95
  static get ChooseFolder(): string;
94
96
  static get ChooseGroup(): string;
95
97
  static get ChronologyDelete(): "Physische Löschung der Chronologie" | "Physical deletion of chronology" | "Eliminación física de la cronología" | "Suppression physique de la chronologie" | "Exclusão física da cronologia" | "Cancellazione fisica della cronologia";
@@ -117,6 +119,7 @@ export declare class SDKUI_Localizator {
117
119
  static get ContinueOperation(): "Fortfahren?" | "Continue ?" | "¿Continuar?" | "Continuer?" | "Continuar?" | "Continuare?";
118
120
  static get CopiedSuccessfully(): "In die Zwischenablage kopieren" | "Copied in clipboard successfully" | "Copiado en el portapapeles con éxito" | "Copié dans le presse-papiers avec succès" | "CCopiado na área de transferência com sucesso" | "Copiato negli appunti con successo";
119
121
  static get Copy(): string;
122
+ static get CopyCheckoutPath(): string;
120
123
  static get CopyToArchived(): string;
121
124
  static get CopyToArchivedDocuments(): string;
122
125
  static get CopyToClipboard(): "Erfolgreich in die Zwischenablage kopiert" | "Copy in clipboard" | "Copiar en portapapeles" | "Copier dans le presse-papier" | "Copiar na área de transferência" | "Copia negli appunti";
@@ -140,6 +143,7 @@ export declare class SDKUI_Localizator {
140
143
  static get DcmtTypeSelect(): "Wählen Sie einen Dokumenttyp aus" | "Select a document type" | "Seleccione un tipo de documento" | "Sélectionnez un type de document" | "Selecione um tipo de documento" | "Selezionare un tipo documento";
141
144
  static get DcmtTypeSelectOrQuickSearch(): "Wählen Sie einen Dokumenttyp oder eine Schnellsuche aus" | "Select a document type or quick search" | "Seleccione un tipo de documento o búsqueda rápida" | "Sélectionnez un type de document ou une recherche rapide" | "Selecione um tipo de documento ou pesquisa rápida" | "Selezionare un tipo documento o ricerca rapida";
142
145
  static get Default(): "Standard" | "Default" | "Predeterminado" | "Defaultão";
146
+ static get DefaultFolder(): string;
143
147
  static get Details(): "Einzelheiten" | "Details" | "Detalles" | "Détails" | "detalhes" | "Dettagli";
144
148
  static get Delete(): "Löschen" | "Delete" | "Borrar" | "Supprimer" | "Excluir" | "Elimina";
145
149
  static get Delete_ConfirmFor1(): "Löschen Sie '{{0}}'?" | "Delete '{{0}}'?" | "¿Eliminar '{{0}}'?" | "Voulez-vous éliminer '{{0}}'?" | "Eliminar '{{0}}'?" | "Eliminare '{{0}}'?";
@@ -258,6 +262,7 @@ export declare class SDKUI_Localizator {
258
262
  static get FileManager_QuestionAlreadyExistsFile(): "Ziel enthält bereits eine Datei mit der Bezeichnung {{0}}, ersetzen durch die neue Datei?" | "The destination already contains a file called {{0}}, replace with the new file?" | "El destino ya contiene un archivo llamado {{0}}, ¿sustituir con el nuevo archivo?" | "La destination contient déjà un fichier appelé {{0}}, remplacer avec le nouveau fichier?" | "O destino já contém um ficheiro chamado {{0}}, substitua com o novo arquivo?" | "La destinazione contiene già un file denominato {{0}}, sostituire con il nuovo file?";
259
263
  static get FileManager_QuestionAlreadyExistsFiles(): "Ziel enthält {{0}} Datei mit dem gleichen Namen, ersetzen durch neue Dateien?" | "Destination contains {{0}} files with the same name, replace with new files?" | "El destino contiene {{0}} archivos con el mismo nombre, ¿sustituir con los nuevos archivos?" | "La destination contient {{0}} fichier portant le même nom, remplacer avec les nouveaux fichiers?" | "O destino contém ficheiros {{0}} com o mesmo nome, substitua por novos arquivos?" | "La destinazione contiene {{0}} file con lo stesso nome, sostituire con i nuovi file?";
260
264
  static get FileUpload(): "Datei hochladen" | "File upload" | "Carga de archivo" | "Téléchargement de fichier" | "Carregamento de arquivo" | "Caricamento File";
265
+ static get Folder(): string;
261
266
  static get FolderExist(): "Ordner existiert bereits. Bitte versuchen Sie einen anderen Namen" | "Folder already exists. Please try another name" | "La carpeta ya existe. Intente con otro nombre." | "Le dossier existe déjà. Veuillez essayer un autre nom" | "A pasta já existe. Por favor tente outro nome" | "La cartella esiste già. Prova un altro nome";
262
267
  static get FolderIsEmpty(): string;
263
268
  static get ForgetPassword(): "Passwort vergessen" | "Forgot password" | "Has olvidado tu contraseña" | "Mot de passe oublié" | "Esqueceu sua senha" | "Password dimenticata";
@@ -297,6 +302,7 @@ export declare class SDKUI_Localizator {
297
302
  static get HideMetadata(): string;
298
303
  static get HideSearch(): "Suche ausblenden" | "Hide search" | "Ocultar búsqueda" | "Masquer la recherche" | "Ocultar pesquisa" | "Nascondi ricerca";
299
304
  static get High(): "Hoch" | "High" | "Alta" | "Élevée";
305
+ static get History(): string;
300
306
  static get HistoryActionLabel(): string;
301
307
  static get HistoryLabel(): string;
302
308
  static get ID_Hide(): "Ausblenden ID" | "Hide ID" | "Ocultar ID" | "Masquer ID" | "Nascondi ID";
@@ -316,6 +322,7 @@ export declare class SDKUI_Localizator {
316
322
  static get Interrupt(): "Unterbrechen" | "Interrupt" | "interrumpir" | "Interrompre" | "Interromper" | "Interrompere";
317
323
  static get Interval(): "Intervall" | "Interval" | "Intervalo" | "Intervalle" | "Intervallo";
318
324
  static get Invalid_File(): "Ungültige datei" | "Invalid file" | "Archivo inválido" | "Fichier non valide" | "Arquivo inválido" | "File non valido";
325
+ static get InvalidDcmt(): "Ungültiges Dokument" | "Invalid document" | "Documento inválido" | "Document non valide" | "Documento non valido";
319
326
  static get InvoiceRetrieveFormat(): "Exportieren Sie die Rechnung im folgenden Format" | "Export invoice in the following format" | "Exportar la factura en el siguiente formato" | "Exportez la facture au format suivant" | "Exporte a fatura no seguinte formato" | "Esporta la fattura nel seguente formato";
320
327
  static get LandingPage(): string;
321
328
  static get LastRead(): string;
@@ -643,6 +650,7 @@ export declare class SDKUI_Localizator {
643
650
  static get UBLViewFormats_NSO_HTML(): "NSO Style Sheet (HTML)" | "Hoja de estilo NSO (HTML)" | "Feuille de style NSO (HTML)" | "Folha de estilo NSO (HTML)" | "Foglio di stile NSO (HTML)";
644
651
  static get UBLViewFormats_NSO_PDF(): "NSO Style Sheet (PDF)" | "Hoja de estilo NSO (PDF)" | "Feuille de style NSO (PDF)" | "Folha de estilo NSO (PDF)" | "Foglio di stile NSO (PDF)";
645
652
  static get UnableToGetUpdatedDocumentContent(): "Aktualisierter Dokumentinhalt kann nicht abgerufen werden" | "Unable to get updated document content" | "No se puede obtener el contenido actualizado del documento" | "Impossible d'obtenir le contenu mis à jour du document" | "Não é possível obter o conteúdo atualizado do documento" | "Impossibile ottenere il contenuto aggiornato del documento";
653
+ static get UndefinedText(): string;
646
654
  static get Undo(): "Änderungen rückgängig machen" | "Undo" | "Anular modificaciones" | "Annule les modifications" | "Anular alterações" | "Annulla modifiche";
647
655
  static get Unfollow(): "Nicht mehr folgen" | "Unfollow" | "Dejar de seguir" | "Ne plus suivre" | "Deixar de seguir" | "Non seguire più";
648
656
  static get Unmatch(): "Zuordnung aufheben" | "Unmatch" | "Desemparejar" | "Dissocier" | "Descorresponder" | "Disabbina";
@@ -697,6 +705,7 @@ export declare class SDKUI_Localizator {
697
705
  static get WorkflowAppName(): "Name der Anwendung" | "Application name" | "Nombre de aplicación" | "Nom de l'application" | "Nome da aplicação" | "Nome applicazione";
698
706
  static get WorkflowAppType(): "Anwendungsart" | "Application type" | "Tipo de aplicación" | "Type d'application" | "Tipo de aplicação" | "Tipo applicazione";
699
707
  static get WorkflowConnectionEdit(): "Verbindung bearbeiten" | "Edit Connection" | "Editar conexión" | "Modifier la connexion" | "Editar ligação" | "Modifica Connessione";
708
+ static get WorkflowCtrl(): "Workflow-Kontrolle" | "Workflow control" | "Control de flujo de trabajo" | "Contrôle de workflow" | "Controle de fluxo de trabalho" | "Controllo workflow";
700
709
  static get WorkflowDiagramConnectionInvalidNodes(): "Ungültige Verbindung: Quell- oder Zielknoten nicht gefunden." | "Invalid connection: source or sink node not found." | "Conexión no válida: nodo origen o destino no encontrado." | "Connexion invalide : nœud source ou destination introuvable." | "Conexão inválida: nó de origem ou destino não encontrado." | "Connessione non valida: nodo sorgente o destinazione non trovato.";
701
710
  static get WorkflowRestoreDiagram(): "Diagramm wiederherstellen" | "Restore diagram" | "Restaurar diagrama" | "Restaurer le diagramme" | "Ripristina diagramma";
702
711
  static get WorkflowRestoreDiagramMessage(): "Möchten Sie das ursprüngliche Diagramm wiederherstellen? Alle nicht gespeicherten Änderungen gehen verloren." | "Are you sure you want to restore the initial diagram? All unsaved changes will be lost." | "¿Está seguro de que desea restaurar el diagrama inicial? Se perderán todos los cambios no guardados." | "Êtes-vous sûr de vouloir restaurer le diagramme initial ? Toutes les modifications non enregistrées seront perdues." | "Tem certeza de que deseja restaurar o diagrama inicial? Todas as alterações não salvas serão perdidas." | "Sei sicuro di voler ripristinare il diagramma iniziale? Tutte le modifiche non salvate andranno perse.";