@topconsultnpm/sdkui-react 6.20.0-dev2.2 → 6.20.0-dev2.21

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.
@@ -9,6 +9,7 @@ import TMChooserForm from '../forms/TMChooserForm';
9
9
  import { TMColors } from '../../utils/theme';
10
10
  import TMTooltip from '../base/TMTooltip';
11
11
  import { FormulaHelper } from '../editors/TMFormulaEditor';
12
+ import { TMExceptionBoxManager } from '../base/TMPopUp';
12
13
  const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChooserBySingleClick, readOnly, layoutMode = LayoutModes.None, queryParamsDynDataList, buttons = [], backgroundColor, showBorder = true, elementStyle, allowMultipleSelection, values, isModifiedWhen, label, placeHolder, validationItems = [], icon, labelColor, showClearButton, onValueChanged, onCascadeRefreshDynDataLists, onCascadeUpdateMIDs, updateIsModalOpen }) => {
13
14
  const [showChooser, setShowChooser] = useState(false);
14
15
  const [dynDl, setDynDl] = useState();
@@ -30,7 +31,9 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
30
31
  setDynDl(d);
31
32
  if (!IsParametricQuery(d?.qd) && !dataSource) {
32
33
  setDataSource(undefined);
33
- loadData().then((result) => { setDataSource(result); });
34
+ loadData()
35
+ .then((result) => { setDataSource(result); })
36
+ .catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
34
37
  }
35
38
  }, [md]);
36
39
  useEffect(() => {
@@ -42,12 +45,13 @@ const TMDynDataListItemChooser = ({ tid, md, width = '100%', titleForm, openChoo
42
45
  setDataSource(undefined);
43
46
  return;
44
47
  }
45
- loadData().then((result) => {
46
- setDataSource(result);
47
- });
48
+ loadData()
49
+ .then((result) => { setDataSource(result); })
50
+ .catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
48
51
  }, [queryParamsDynDataList, dynDl]);
49
52
  const loadData = async () => {
50
- return await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, md?.id, layoutMode, queryParamsDynDataList ?? []);
53
+ return await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, md?.id, layoutMode, queryParamsDynDataList ?? [])
54
+ .catch((err) => { throw err; });
51
55
  };
52
56
  const getDescription = () => {
53
57
  if (!Array.isArray(values))
@@ -152,7 +156,8 @@ export const TMDynDataListItemChooserForm = (props) => {
152
156
  if (refreshCache)
153
157
  DataListCacheService.RemoveAll();
154
158
  TMSpinner.show({ description: `${SDKUI_Localizator.Loading} - ${SDK_Localizator.DataList} ...` });
155
- let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(props.TID, props.MID, props.layoutMode, []);
159
+ let result = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(props.TID, props.MID, props.layoutMode, [])
160
+ .catch((err) => { TMSpinner.hide(); TMExceptionBoxManager.show({ exception: err }); });
156
161
  TMSpinner.hide();
157
162
  return result ? searchResultDescriptorToSimpleArray(result) ?? [] : [];
158
163
  };
@@ -21,7 +21,7 @@ const TMMetadataChooser = ({ tmSession, dataSource, showEditButton = true, butto
21
21
  return undefined;
22
22
  };
23
23
  const renderTemplate = useMemo(() => {
24
- return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder })] }));
24
+ return (_jsxs(StyledDivHorizontal, { style: { width: 'max-content', height: '100%' }, children: [values && values.length > 0 && values[0].mid && values[0].mid > 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 0 && values[0].mid && values[0].mid < 0 && _jsx(TMMidViewer, { tmSession: tmSession, tid_mid: values[0], inputMd: getinputMd(), showIcon: true, showId: showId, showCompleteName: showCompleteMetadataName }), values && values.length > 1 && _jsx("p", { style: { marginLeft: '10px' }, children: `(+${values.length - 1} ${values.length == 2 ? 'altro' : 'altri'})` }), (values == undefined || values.length == 0) && _jsx("p", { children: placeHolder ?? SDKUI_Localizator.SelectMetadata })] }));
25
25
  }, [values, tmSession, showId, showCompleteMetadataName, placeHolder]);
26
26
  return (_jsxs(_Fragment, { children: [_jsx(TMSummary, { label: label, width: width, height: height, disabled: disabled, validationItems: validationItems, backgroundColor: backgroundColor, buttons: buttons, placeHolder: placeHolder, fontSize: fontSize, showBorder: showBorder, borderRadius: borderRadius, hasValue: values && values.length > 0, showClearButton: showClearButton, showEditButton: showEditButton, iconEditButton: _jsx(IconSearch, { fontSize: 16 }), openEditorOnSummaryClick: openEditorOnSummaryClick, onEditorClick: () => {
27
27
  if (!disabled) {
@@ -14,6 +14,7 @@ import { ChronologyMIDs, DraftsMIDs, DSAttachsMIDs } from "../../ts";
14
14
  import { TMNothingToShow } from "../features/documents/TMDcmtPreview";
15
15
  import TMAccordion from "../base/TMAccordion";
16
16
  import TabPanel, { Item } from 'devextreme-react/tab-panel';
17
+ import { TMExceptionBoxManager } from "../base/TMPopUp";
17
18
  export var ShowCheckBoxesMode;
18
19
  (function (ShowCheckBoxesMode) {
19
20
  ShowCheckBoxesMode[ShowCheckBoxesMode["Never"] = 0] = "Never";
@@ -165,7 +166,8 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
165
166
  if (!d)
166
167
  return;
167
168
  let toBeRefreshed = [];
168
- let dynDlDataSource = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, mid, layoutMode, qParams);
169
+ let dynDlDataSource = await SDK_Globals.tmSession?.NewSearchEngine().GetDynDataListValuesAsync(tid, mid, layoutMode, qParams)
170
+ .catch((err) => { TMExceptionBoxManager.show({ exception: err }); });
169
171
  if (!d.onValueChanged_DynDataListsToBeRefreshed)
170
172
  return;
171
173
  let row = dynDlDataSource?.dtdResult?.rows?.filter(o => o[d.selectItemForValue ?? 0] == value);
@@ -1,14 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
3
  import TMDcmtPreview from './TMDcmtPreview';
4
- import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
4
+ import { AccessLevels, AppModules, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
5
5
  import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
6
6
  import { DownloadTypes, FormModes, DcmtOperationTypes } from '../../../ts';
7
7
  import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
8
8
  import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
9
9
  import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
10
10
  import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
11
- import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getExceptionMessage, isApprovalWorkflowView, getDcmtCicoStatus, IconFileDots, IconCustom, buildWorkItemsFromWFCtrl, IconLock } from '../../../helper';
11
+ import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getExceptionMessage, isApprovalWorkflowView, getDcmtCicoStatus, IconFileDots, IconCustom, buildWorkItemsFromWFCtrl, IconLock, getDcmtFormToolbarVisibility } from '../../../helper';
12
12
  import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
13
13
  import { Gutters, TMColors } from '../../../utils/theme';
14
14
  import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
@@ -123,6 +123,10 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
123
123
  const [refreshBlogTrigger, setRefreshBlogTrigger] = useState(0);
124
124
  const [wfError, setWfError] = useState(null);
125
125
  const [metadataDcmtOrigin, setMetadataDcmtOrigin] = useState(null);
126
+ const isReadOnlyOriginCallback = useCallback((fromTID) => {
127
+ return layoutMode !== LayoutModes.Ark && layoutMode !== LayoutModes.ArkFromBasket && layoutMode !== LayoutModes.ArkFromFile && layoutMode !== LayoutModes.ArkFromMail
128
+ && fromTID?.toString() !== TID?.toString();
129
+ }, [layoutMode, TID]);
126
130
  const triggerBlogRefresh = useCallback(async () => {
127
131
  setRefreshBlogTrigger(prev => prev + 1);
128
132
  }, []);
@@ -194,7 +198,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
194
198
  let dtd = res?.dtdResult;
195
199
  let rows = dtd.rows ? dtd.rows[0] : [];
196
200
  let mids = res?.selectMIDs;
197
- let metadataList = searchResultToMetadataValues(TID, dtd, rows, mids, mdList, layoutMode, origin.fromTID?.toString() !== TID?.toString());
201
+ let metadataList = searchResultToMetadataValues(TID, dtd, rows, mids, mdList, layoutMode, isReadOnlyOriginCallback(origin.fromTID));
198
202
  if (archived) {
199
203
  // Usa setFormData con funzione callback per accedere allo stato precedente
200
204
  // invece di dipendere da formDataOrig nell'array di dipendenze
@@ -282,7 +286,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
282
286
  }
283
287
  else {
284
288
  const renderedMetadata = dtd?.metadata?.filter((metadata) => handleArchiveVisibility(metadata)) ?? [];
285
- const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode, metadataDcmtOrigin?.fromTID?.toString() !== TID?.toString());
289
+ const metadataList = searchResultToMetadataValues(dtd?.id, undefined, [], [], renderedMetadata, layoutMode, isReadOnlyOriginCallback(metadataDcmtOrigin?.fromTID));
286
290
  setFormDataOrig(structuredClone(metadataList));
287
291
  setFormData(structuredClone(metadataList));
288
292
  formDataOrigRef.current = structuredClone(metadataList);
@@ -297,7 +301,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
297
301
  setIsInitialLoading(false);
298
302
  setIsNavigating(false);
299
303
  }
300
- }, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs, metadataDcmtOrigin?.fromTID]);
304
+ }, [TID, DID, layoutMode, inputFile, setMetadataList, handleReset, allowButtonsRefs, isReadOnlyOriginCallback, metadataDcmtOrigin?.fromTID]);
301
305
  const createChange = useCallback((mid, metadataType, modifiedValue) => {
302
306
  return { mid, metadataType, modifiedValue };
303
307
  }, []);
@@ -1216,7 +1220,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1216
1220
  }, [formData, fromDTD, isMobile]);
1217
1221
  const tmDcmtForm = useMemo(() => {
1218
1222
  return _jsxs(_Fragment, { children: [checkoutBadge && _jsx("div", { style: { padding: '10px', display: 'flex', justifyContent: 'center' }, children: checkoutBadge }), metadataValuesSource.length > 0 &&
1219
- _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, isReadOnlyOrigin: metadataDcmtOrigin?.fromTID?.toString() !== TID?.toString(), onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
1223
+ _jsxs(StyledToolbarCardContainer, { children: [_jsx(TMMetadataValues, { TID: TID, metadataValues: metadataValuesSource, metadataValuesOrig: metadataValuesSourceOrig, isExpertMode: isExpertMode, isOpenDistinctValues: isOpenDistinctValues, openChooserBySingleClick: !isOpenDistinctValues, selectedMID: focusedMetadataValue?.mid, isReadOnly: formMode === FormModes.ReadOnly, layoutMode: layoutMode, deviceType: deviceType, validationItems: validationItems, inputMids: inputMids, layout: layout, isReadOnlyOrigin: isReadOnlyOriginCallback(metadataDcmtOrigin?.fromTID), onFocusedItemChanged: (item) => { (item?.mid !== focusedMetadataValue?.mid) && setFocusedMetadataValue(item); }, onValueChanged: (newItems) => {
1220
1224
  setFormData((prevItems) => prevItems.map((item) => {
1221
1225
  const newItem = newItems.find((newItem) => newItem.tid === item.tid && newItem.mid === item.mid);
1222
1226
  return newItem ? { ...item, ...newItem } : item;
@@ -1262,7 +1266,8 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1262
1266
  handleConfirmAction,
1263
1267
  handleUndo,
1264
1268
  handleClearForm,
1265
- metadataDcmtOrigin
1269
+ isReadOnlyOriginCallback,
1270
+ metadataDcmtOrigin?.fromTID,
1266
1271
  ]);
1267
1272
  const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: TID, did: DID, allTasks: allTasks, fetchBlogDataTrigger: refreshBlogTrigger, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [TID, DID, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers]);
1268
1273
  const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: layoutMode, openChooserBySingleClick: !isOpenDistinctValues, TID: TID, isReadOnly: true, deviceType: deviceType, metadataValues: formData.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: formData.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [], inputMids: inputMids }), [TID, layoutMode, formData, deviceType, inputMids]);
@@ -1384,7 +1389,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1384
1389
  const { assignedToMe, assignedByMe } = getDcmtTasksCounter(TID, DID, allTasks);
1385
1390
  let titleDcmtFormPanel = fromDTD?.nameLoc ?? "";
1386
1391
  // Caso: Il documento proviene da un'origine esterna
1387
- if (metadataDcmtOrigin?.fromTID?.toString() !== TID?.toString()) {
1392
+ if (isReadOnlyOriginCallback(metadataDcmtOrigin?.fromTID)) {
1388
1393
  titleDcmtFormPanel = (_jsxs("div", { style: { display: 'inline-flex', alignItems: 'center', gap: '4px' }, children: [_jsx(TMTooltip, { content: _jsxs("div", { style: { textAlign: 'left' }, children: [_jsx("p", { children: "Questo documento proviene da un'altra origine e non pu\u00F2 essere modificato." }), _jsx("hr", {}), _jsxs("p", { children: [_jsx("strong", { children: "TID corrente:" }), " ", TID?.toString()] }), _jsxs("p", { children: [_jsx("strong", { children: "Nome corrente:" }), " ", fromDTD?.nameLoc] }), _jsx("hr", {}), _jsxs("p", { children: [_jsx("strong", { children: "TID origine:" }), " ", metadataDcmtOrigin?.fromTID?.toString()] }), _jsxs("p", { children: [_jsx("strong", { children: "Nome origine:" }), " ", metadataDcmtOrigin?.fromName] })] }), children: _jsx(IconLock, { fontSize: 16, style: { alignSelf: 'center' } }) }), metadataDcmtOrigin?.fromName] }));
1389
1394
  }
1390
1395
  const panels = [
@@ -1405,7 +1410,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1405
1410
  },
1406
1411
  toolbarOptions: {
1407
1412
  icon: _jsx(IconPreview, { fontSize: 24 }),
1408
- visible: true,
1413
+ visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtForm,
1409
1414
  orderNumber: 1,
1410
1415
  isActive: allInitialPanelVisibility['tmDcmtForm']
1411
1416
  }
@@ -1416,7 +1421,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1416
1421
  contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
1417
1422
  toolbarOptions: {
1418
1423
  icon: _jsx(IconBoard, { fontSize: 24 }),
1419
- visible: true,
1424
+ visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog,
1420
1425
  disabled: isBoardDisabled,
1421
1426
  orderNumber: 2,
1422
1427
  isActive: allInitialPanelVisibility['tmBlog']
@@ -1426,13 +1431,13 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1426
1431
  id: 'tmSysMetadata',
1427
1432
  name: SDKUI_Localizator.MetadataSystem,
1428
1433
  contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
1429
- toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
1434
+ toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
1430
1435
  },
1431
1436
  {
1432
1437
  id: 'tmDcmtPreview',
1433
1438
  name: SDKUI_Localizator.PreviewDocument,
1434
1439
  contentOptions: { component: tmDcmtPreview },
1435
- toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
1440
+ toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
1436
1441
  },
1437
1442
  {
1438
1443
  id: 'tmWF',
@@ -1445,7 +1450,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1445
1450
  },
1446
1451
  toolbarOptions: {
1447
1452
  icon: _jsx(IconWorkflow, { fontSize: 24 }),
1448
- visible: true,
1453
+ visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmWF,
1449
1454
  disabled: isWFDisabled,
1450
1455
  orderNumber: 5,
1451
1456
  isActive: allInitialPanelVisibility['tmWF']
@@ -1459,7 +1464,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1459
1464
  },
1460
1465
  toolbarOptions: {
1461
1466
  icon: _jsx(IconActivity, { fontSize: 24 }),
1462
- visible: layoutMode !== LayoutModes.Ark,
1467
+ visible: layoutMode !== LayoutModes.Ark && getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtTasks,
1463
1468
  orderNumber: 6,
1464
1469
  isActive: allInitialPanelVisibility['tmDcmtTasks'],
1465
1470
  count: assignedToMe + assignedByMe,
@@ -1468,7 +1473,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
1468
1473
  },
1469
1474
  ];
1470
1475
  return panels;
1471
- }, [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID, metadataDcmtOrigin?.fromTID]);
1476
+ }, [fromDTD, showBackButton, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, tmDcmtTasks, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable, allTasks, DID, TID, isReadOnlyOriginCallback, metadataDcmtOrigin?.fromTID]);
1472
1477
  // Retrieves the current document form setting based on the normalized TID
1473
1478
  const getCurrentDcmtFormSetting = () => {
1474
1479
  const settings = SDKUI_Globals.userSettings.dcmtFormSettings;
@@ -87,7 +87,8 @@ const TMDcmtPreview = ({ dcmtData, isResizingActive, isVisible, canNext, canPrev
87
87
  }
88
88
  await sleep(300);
89
89
  const basketEngine = SDK_Globals.tmSession?.NewBasketEngine();
90
- const file = await basketEngine?.RetrieveFileAsync(dcmtData?.btid, dcmtData?.bid, dcmtData?.bfid, abortController.signal);
90
+ const cvtFormat = extensionHandler(dcmtData?.fileExt) === FileExtensionHandler.CONVERTIBLE ? FileFormats.PDF : FileFormats.None;
91
+ const file = await basketEngine?.RetrieveFileAsync(dcmtData?.btid, dcmtData?.bid, dcmtData?.bfid, cvtFormat, abortController.signal);
91
92
  // Store in cache
92
93
  if (file) {
93
94
  if (dcmtsFileCachePreview.size >= CACHE_SIZE_LIMIT) {
@@ -267,7 +267,7 @@ const TMFormOrResultWrapper = ({ deviceType, focusedItem, onTaskCreateRequest, a
267
267
  _jsx(TMDcmtForm, { groupId: 'tmFormOrResult', TID: focusedItem?.tid, DID: focusedItem.did, allowButtonsRefs: true, isClosable: deviceType !== DeviceType.MOBILE, allowNavigation: false, allowRelations: deviceType !== DeviceType.MOBILE, showDcmtFormSidebar: false, onClose: () => {
268
268
  setPanelVisibilityById('tmTreeView', true);
269
269
  }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.tid, focusedItem?.did) }) :
270
- _jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => {
270
+ _jsx(TMSearchResult, { groupId: 'tmFormOrResult', isClosable: deviceType !== DeviceType.MOBILE, context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, allowRelations: false, openDcmtFormAsModal: true, searchResults: focusedItem?.searchResult ?? [], showSearchResultSidebar: false, showDcmtFormSidebar: false, onTaskCreateRequest: onTaskCreateRequest, onClose: () => {
271
271
  setPanelVisibilityById('tmTreeView', true);
272
272
  }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }));
273
273
  };
@@ -20,6 +20,7 @@ interface ITMSearchResultProps {
20
20
  isVisible?: boolean;
21
21
  openDcmtFormAsModal?: boolean;
22
22
  showSearchResultSidebar?: boolean;
23
+ showDcmtFormSidebar?: boolean;
23
24
  showSelector?: boolean;
24
25
  showToolbarHeader?: boolean;
25
26
  showBackButton?: boolean;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
- import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService } from '@topconsultnpm/sdk-ts';
3
+ import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService, AppModules } from '@topconsultnpm/sdk-ts';
4
4
  import styled from 'styled-components';
5
5
  import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
6
- import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconInfo, IconCache } from '../../../helper';
6
+ import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconCache, IconPlatform, getSearchToolbarVisibility } from '../../../helper';
7
7
  import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
8
8
  import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
9
9
  import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
@@ -69,7 +69,7 @@ const orderByName = (array) => {
69
69
  return 1;
70
70
  } return 0; });
71
71
  };
72
- const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
72
+ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, context = SearchResultContext.METADATA_SEARCH, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, searchResults = [], showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, groupId, title, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, selectedSearchResultTID, workingGroupContext = undefined, disableAccordionIfSingleCategory = false, floatingActionConfig, openInOffice, onRefreshAfterAddDcmtToFavs, onRefreshSearchAsync, onSelectedTIDChanged, onWFOperationCompleted, onClose, onFileOpened, onTaskCreateRequest, openWGsCopyMoveForm, editPdfForm = false, openEditPdf, openCommentFormCallback, openAddDocumentForm, openS4TViewer = false, onOpenS4TViewerRequest, passToArchiveCallback, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, onReferenceClick, }) => {
73
73
  const [id, setID] = useState('');
74
74
  const [showApprovePopup, setShowApprovePopup] = useState(false);
75
75
  const [showRejectPopup, setShowRejectPopup] = useState(false);
@@ -736,23 +736,58 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
736
736
  const tmBlog = useMemo(() => _jsx(TMDcmtBlog, { tid: focusedItem?.TID, did: focusedItem?.DID, fetchBlogDataTrigger: refreshBlogTrigger, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), [focusedItem, allTasks, refreshBlogTrigger, handleNavigateToWGs, handleNavigateToDossiers]);
737
737
  const tmSysMetadata = useMemo(() => _jsx(TMMetadataValues, { layoutMode: LayoutModes.Update, openChooserBySingleClick: true, TID: focusedItem?.TID, isReadOnly: true, deviceType: deviceType, metadataValues: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), metadataValuesOrig: currentMetadataValues.filter(o => (o.mid != undefined && o.mid <= 100)), validationItems: [] }), [focusedItem, currentMetadataValues, deviceType]);
738
738
  const tmDcmtPreview = useMemo(() => _jsx(TMDcmtPreviewWrapper, { currentDcmt: currentDcmt }, refreshPreviewTrigger), [currentDcmt, refreshPreviewTrigger]);
739
+ // Auto-fetch indexing info when drawer is open and focusedItem changes
740
+ useEffect(() => {
741
+ if (!focusedItem || !showIndexingInfo)
742
+ return;
743
+ const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
744
+ if (!indexingInfoCache.has(cacheKey)) {
745
+ const fetchData = async () => {
746
+ try {
747
+ setLoadingIndexingInfo(true);
748
+ const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
749
+ setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
750
+ }
751
+ catch (e) {
752
+ TMExceptionBoxManager.show({ exception: e });
753
+ }
754
+ finally {
755
+ setLoadingIndexingInfo(false);
756
+ }
757
+ };
758
+ fetchData();
759
+ }
760
+ }, [focusedItem, showIndexingInfo]);
739
761
  const handleToggleIndexingInfo = async () => {
740
762
  if (!focusedItem)
741
763
  return;
742
- if (showIndexingInfo) {
743
- setShowIndexingInfo(false);
744
- return;
764
+ const newShowState = !showIndexingInfo;
765
+ setShowIndexingInfo(newShowState);
766
+ if (newShowState) {
767
+ const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
768
+ if (!indexingInfoCache.has(cacheKey)) {
769
+ try {
770
+ setLoadingIndexingInfo(true);
771
+ const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
772
+ setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
773
+ }
774
+ catch (e) {
775
+ TMExceptionBoxManager.show({ exception: e });
776
+ }
777
+ finally {
778
+ setLoadingIndexingInfo(false);
779
+ }
780
+ }
745
781
  }
746
- const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
747
- if (indexingInfoCache.has(cacheKey)) {
748
- setShowIndexingInfo(true);
782
+ };
783
+ const handleRefreshIndexingInfo = async () => {
784
+ if (!focusedItem)
749
785
  return;
750
- }
786
+ const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
751
787
  try {
752
788
  setLoadingIndexingInfo(true);
753
789
  const msg = await SDK_Globals.tmSession?.NewSearchEngine().FreeSearchGetDcmtInfoAsync(focusedItem.TID, focusedItem.DID);
754
790
  setIndexingInfoCache(prev => new Map(prev).set(cacheKey, msg ?? ''));
755
- setShowIndexingInfo(true);
756
791
  }
757
792
  catch (e) {
758
793
  TMExceptionBoxManager.show({ exception: e });
@@ -765,8 +800,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
765
800
  if (!focusedItem) {
766
801
  return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Seleziona un documento per visualizzare i dettagli della ricerca full-text" }), " "] }));
767
802
  }
768
- // const ftExplanationsColumnIndex = selectedSearchResult?.dtdResult?.columns?.findIndex( col => col.caption === 'FTExplanations' );
769
- const ftExplanationsColumnIndex = selectedSearchResult?.selectMIDs?.findIndex(mid => mid === 0); //nosonar
803
+ const ftExplanationsColumnIndex = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'FTExplanations');
770
804
  if (ftExplanationsColumnIndex === undefined || ftExplanationsColumnIndex < 0) {
771
805
  return (_jsxs(StyledPlaceholder, { children: [" ", _jsx("p", { children: "Nessuna info full-text disponibile" }), " "] }));
772
806
  }
@@ -780,21 +814,21 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
780
814
  }
781
815
  const cacheKey = `${focusedItem.TID}-${focusedItem.DID}`;
782
816
  const cachedInfo = indexingInfoCache.get(cacheKey);
783
- return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsxs(StyledLeftContent, { children: [_jsx(IconInfo, {}), _jsx("span", { children: showIndexingInfo ? 'Nascondi info' : SDKUI_Localizator.IndexingInformation })] }), _jsxs(StyledRightContent, { children: [cachedInfo && (_jsx(TMTooltip, { content: "Da cache", children: _jsx(StyledCachedIcon, { children: _jsx(IconCache, {}) }) })), _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" })] })] }), loadingIndexingInfo && (_jsxs("div", { style: { marginTop: '10px', color: '#666' }, children: [SDKUI_Localizator.Loading, "..."] })), showIndexingInfo && cachedInfo && !loadingIndexingInfo && (_jsx(StyledIndexingInfoBox, { children: _jsx("div", { dangerouslySetInnerHTML: { __html: cachedInfo } }) }))] })] }));
784
- }, [selectedSearchResult, focusedItem, indexingInfoCache, showIndexingInfo, loadingIndexingInfo]);
817
+ return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', height: '100%', overflow: 'hidden', width: '100%' }, children: [_jsx("div", { style: { padding: '10px', overflow: 'auto', flex: 1 }, children: _jsx("div", { dangerouslySetInnerHTML: { __html: ftExplanation } }) }), _jsxs(StyledIndexingInfoSection, { children: [_jsxs(StyledIndexingToggle, { onClick: handleToggleIndexingInfo, disabled: loadingIndexingInfo, children: [_jsxs(StyledLeftContent, { children: [_jsx("span", { children: SDKUI_Localizator.IndexingInformation }), cachedInfo && (_jsx(TMTooltip, { content: "Da cache", children: _jsx(StyledCachedIcon, { children: _jsx(IconCache, { fontSize: 13 }) }) }))] }), _jsxs(StyledRightContent, { children: [cachedInfo && (_jsx(TMTooltip, { content: "Aggiorna", children: _jsx(StyledRefreshIcon, { onClick: (e) => { e.stopPropagation(); handleRefreshIndexingInfo(); }, children: _jsx(IconRefresh, {}) }) })), _jsx(StyledChevron, { "$isOpen": showIndexingInfo, children: "\u25BC" })] })] }), loadingIndexingInfo && !cachedInfo && (_jsxs("div", { style: { marginTop: '10px', color: '#666' }, children: [SDKUI_Localizator.Loading, "..."] })), showIndexingInfo && cachedInfo && (_jsxs(StyledIndexingInfoBox, { children: [_jsx("div", { dangerouslySetInnerHTML: { __html: cachedInfo } }), loadingIndexingInfo && (_jsxs("div", { style: { position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)', background: 'rgba(255, 255, 255, 0.9)', padding: '10px', borderRadius: '4px', boxShadow: '0 2px 8px rgba(0,0,0,0.15)' }, children: [SDKUI_Localizator.Loading, "..."] }))] }))] })] }));
818
+ }, [selectedSearchResult, focusedItem, indexingInfoCache, showIndexingInfo, loadingIndexingInfo, handleRefreshIndexingInfo]);
785
819
  const allInitialPanelVisibility = {
786
820
  'tmSearchResult': true,
787
821
  'tmBlog': false,
788
822
  'tmSysMetadata': false,
823
+ 'tmFullTextSearch': false,
789
824
  'tmDcmtPreview': false,
790
- // 'tmFullTextSearch': false,
791
825
  };
792
826
  const initialPanelDimensions = {
793
827
  'tmSearchResult': { width: '25%', height: '100%' },
794
828
  'tmBlog': { width: '25%', height: '100%' },
795
829
  'tmSysMetadata': { width: '25%', height: '100%' },
830
+ 'tmFullTextSearch': { width: '25%', height: '100%' },
796
831
  'tmDcmtPreview': { width: '25%', height: '100%' },
797
- // 'tmFullTextSearch': { width: '25%', height: '100%' },
798
832
  };
799
833
  const initialPanels = useMemo(() => [
800
834
  {
@@ -813,34 +847,34 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
813
847
  toolbar: searchResutlToolbar
814
848
  },
815
849
  },
816
- toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: true, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
850
+ toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSearchResult, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
817
851
  },
818
852
  {
819
853
  id: 'tmBlog',
820
854
  name: SDKUI_Localizator.BlogCase,
821
855
  contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
822
- toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: true, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
856
+ toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
823
857
  },
824
858
  {
825
859
  id: 'tmSysMetadata',
826
860
  name: SDKUI_Localizator.MetadataSystem,
827
861
  contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
828
- toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: true, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
862
+ toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
829
863
  },
830
864
  {
831
865
  id: 'tmDcmtPreview',
832
866
  name: SDKUI_Localizator.PreviewDocument,
833
867
  contentOptions: { component: tmDcmtPreview },
834
- toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
868
+ toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: context === SearchResultContext.FREE_SEARCH ? 5 : 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
835
869
  },
836
- // ...(context === SearchResultContext.FREE_SEARCH ? [
837
- // {
838
- // id: 'tmFullTextSearch',
839
- // name: 'Ricerca FullText',
840
- // contentOptions: { component: tmFullTextSearch, panelContainer: { title: 'Ricerca FullText', allowMaximize: !isMobile } },
841
- // toolbarOptions: { icon: <IconMenuFullTextSearch fontSize={24} />, visible: true, orderNumber: 5, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
842
- // }
843
- // ] : [])
870
+ ...(context === SearchResultContext.FREE_SEARCH ? [
871
+ {
872
+ id: 'tmFullTextSearch',
873
+ name: SDKUI_Localizator.ResultDetails,
874
+ contentOptions: { component: tmFullTextSearch, panelContainer: { title: SDKUI_Localizator.ResultDetails, allowMaximize: !isMobile } },
875
+ toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 4, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
876
+ }
877
+ ] : [])
844
878
  ], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
845
879
  return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": !isOpenDcmtForm && !isOpenDetails && !isOpenMaster, style: {
846
880
  display: 'flex',
@@ -854,7 +888,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
854
888
  :
855
889
  _jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmSearchResult', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar }) }) }) }) }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDetails, children: isOpenDetails && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, isForMaster: false, inputDcmts: getSelectionDcmtInfo(), allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenDetails(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), _jsxs(StyledMultiViewPanel, { "$isVisible": isOpenMaster, children: [isOpenMaster && _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: getSelectionDcmtInfo(), isForMaster: true, allowNavigation: focusedItem && selectedItems.length <= 0, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onBack: () => setIsOpenMaster(false), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), secondaryMasterDcmts.length > 0 && secondaryMasterDcmts.map((dcmt, index) => {
856
890
  return (_jsx(StyledModalContainer, { style: { backgroundColor: 'white' }, children: _jsx(TMMasterDetailDcmts, { deviceType: deviceType, inputDcmts: [dcmt], isForMaster: true, allowNavigation: false, onBack: () => handleRemoveItem(dcmt.TID, dcmt.DID), appendMasterDcmts: handleAddItem, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }, `${index}-${dcmt.DID}`));
857
- })] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: handleSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, moreInfoTasks: getMoreInfoTasksForDocument(allTasks, focusedItem?.TID, focusedItem?.DID), showDcmtFormSidebar: showSearchResultSidebar }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
891
+ })] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && focusedItem?.TID !== undefined && focusedItem?.DID !== undefined && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem.TID, DID: focusedItem.DID, allowButtonsRefs: true, layoutMode: dcmtFormLayoutMode, count: visibleItems.length, itemIndex: visibleItems.findIndex(o => o.rowIndex === focusedItem?.rowIndex) + 1, canNext: canNavigateHandler('next'), canPrev: canNavigateHandler('prev'), onNext: () => onNavigateHandler('next'), onPrev: () => onNavigateHandler('prev'), onClose: () => { setIsOpenDcmtForm(false); }, onWFOperationCompleted: onWFOperationCompleted, onTaskCreateRequest: onTaskCreateRequest, onSavedAsyncCallback: handleSavedAsyncCallback, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, 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 }) }), isOpenArchiveRelationForm && _jsx(TMDcmtForm, { isModal: true, titleModal: SDKUI_Localizator.Archive + ' - ' + (archiveType === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster), TID: archiveRelatedDcmtFormTID, layoutMode: LayoutModes.Ark, inputMids: archiveRelatedDcmtFormMids, showBackButton: false, allowButtonsRefs: false, onClose: () => {
858
892
  setIsOpenArchiveRelationForm(false);
859
893
  setArchiveType(undefined);
860
894
  setArchiveRelatedDcmtFormTID(undefined);
@@ -865,7 +899,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
865
899
  setArchiveRelatedDcmtFormTID(undefined);
866
900
  setArchiveRelatedDcmtFormMids([]);
867
901
  await onRefreshSearchAsync?.();
868
- }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showSearchResultSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
902
+ }, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
869
903
  };
870
904
  export default TMSearchResult;
871
905
  const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
@@ -1386,11 +1420,6 @@ const StyledIndexingToggle = styled.button `
1386
1420
  transform: translateY(1px);
1387
1421
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
1388
1422
  }
1389
-
1390
- svg {
1391
- color: #2196F3;
1392
- font-size: 18px;
1393
- }
1394
1423
  `;
1395
1424
  const StyledLeftContent = styled.div `
1396
1425
  display: flex;
@@ -1406,12 +1435,15 @@ const StyledCachedIcon = styled.div `
1406
1435
  display: flex;
1407
1436
  align-items: center;
1408
1437
  justify-content: center;
1409
- color: #4CAF50;
1410
1438
  font-size: 16px;
1411
-
1412
- svg {
1413
- color: #4CAF50;
1414
- }
1439
+ `;
1440
+ const StyledRefreshIcon = styled.div `
1441
+ display: flex;
1442
+ align-items: center;
1443
+ justify-content: center;
1444
+ font-size: 16px;
1445
+ cursor: pointer;
1446
+ transition: transform 0.2s ease;
1415
1447
  `;
1416
1448
  const StyledChevron = styled.span `
1417
1449
  transition: transform 0.2s ease;
@@ -1420,6 +1452,7 @@ const StyledChevron = styled.span `
1420
1452
  font-size: 12px;
1421
1453
  `;
1422
1454
  const StyledIndexingInfoBox = styled.div `
1455
+ position: relative;
1423
1456
  background: white;
1424
1457
  border: 1px solid #e0e0e0;
1425
1458
  border-radius: 6px;
@@ -4,9 +4,10 @@ import styled from 'styled-components';
4
4
  import { useTMPanelManagerContext } from './TMPanelManagerContext';
5
5
  import TMPanelWrapper from './TMPanelWrapper';
6
6
  import TMPanelManagerToolbar from './TMPanelManagerToolbar';
7
- import { IconInfo, SDKUI_Localizator } from '../../../helper';
7
+ import { getPanelManagerToolbarColor, IconInfo, SDKUI_Localizator } from '../../../helper';
8
8
  import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
9
9
  import { Gutters } from '../../../utils/theme';
10
+ import { AppModules, SDK_Globals } from '@topconsultnpm/sdk-ts';
10
11
  // Styled Component per il contenitore principale di PanelContainer
11
12
  const StyledPanelContainerWrapper = styled.div `
12
13
  display: ${props => (props.$hasVisiblePanels ? 'flex' : 'none')};
@@ -206,7 +207,7 @@ const TMPanelManagerContainer = (props) => {
206
207
  alignItems: 'center',
207
208
  width: isMobile ? '100%' : '50px',
208
209
  height: isMobile ? '50px' : 'max-content',
209
- background: 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box',
210
+ background: getPanelManagerToolbarColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER),
210
211
  borderRadius: isMobile ? '10px' : '10px 0px 0px 10px',
211
212
  padding: '10px',
212
213
  gap: '10px'
@@ -48,6 +48,7 @@ interface ITMQueryEditor extends ITMApplyFormProps<QueryDescriptor> {
48
48
  ShowOnlySAP?: boolean;
49
49
  updateIsModalOpen?: (isOpen: boolean) => void;
50
50
  showSearchResultSidebar?: boolean;
51
+ showDcmtFormSidebar?: boolean;
51
52
  showToppyDraggableHelpCenter?: boolean;
52
53
  toppyHelpCenterUsePortal?: boolean;
53
54
  }
@@ -62,7 +62,7 @@ export function useQueryApplyForm(d, formMode, inputData, onApplied, parameters)
62
62
  const [validationItems, setValidationItems] = useState([]);
63
63
  return { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData };
64
64
  }
65
- const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged, ShowOnlySAP, updateIsModalOpen, showSearchResultSidebar = true, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false }) => {
65
+ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDistinct = false, showToolbar = true, validateSelect = true, validateOrderBy = true, raiseWarningForOnlyMetadataDcmtTypes = false, onApplied, onClose, height = 'auto', borderRadius = '4px', searchText, showApply, showUndo, showBack, onFromTIDChanged, ShowOnlySAP, updateIsModalOpen, showSearchResultSidebar = true, showDcmtFormSidebar = true, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false }) => {
66
66
  const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
67
67
  const { formData, setFormData, formDataOrig, validationItems, setValidationItems, exception, applyData } = useQueryApplyForm(Descriptors.Query, formMode, inputData, onApplied);
68
68
  const [dcmtTypesList, setDcmtTypesList] = useState([]);
@@ -598,7 +598,7 @@ const TMQueryEditor = ({ formMode, inputData, onQDChanged, isExpertMode, showDis
598
598
  // #region Ricerca
599
599
  const renderResultSearchForm = (_jsx(TMSearchResult, { context: SearchResultContext.METADATA_SEARCH, allowFloatingBar: false, onClose: () => {
600
600
  setShowResultSearch(false);
601
- }, searchResults: resultSearch, showSearchResultSidebar: showSearchResultSidebar, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal }));
601
+ }, searchResults: resultSearch, showSearchResultSidebar: showSearchResultSidebar, showDcmtFormSidebar: showDcmtFormSidebar, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal }));
602
602
  const onSearchAsync = async (qdInput) => {
603
603
  try {
604
604
  let qdSearch = await prepareQdForSearchAsync(qdInput);
@@ -6,5 +6,8 @@ const GlobalStyle = createGlobalStyle `
6
6
  * {
7
7
  font-family: var(--base-font-family, "Inter"), sans-serif;
8
8
  }
9
+ .dx-filemanager-dirs-tree-item-text{
10
+ font-size: var(--base-font-size, 13px);
11
+ }
9
12
  `;
10
13
  export default GlobalStyle;
@@ -569,6 +569,7 @@ export declare class SDKUI_Localizator {
569
569
  static get SelectArchiveToStart(): "Klicken Sie auf Archivieren, um zu beginnen." | "Click on Archive button to start." | "Haz clic en el botón Archivar para comenzar." | "Cliquez sur le bouton Archiver pour commencer." | "Clique no botão Arquivar para iniciar." | "Clicca sul pulsante Archivia per iniziare.";
570
570
  static get SelectAttachToStart(): "Sie können Dateien zu Ihrer E-Mail hinzufügen, klicken Sie auf Anhängen, um zu beginnen." | "You can attach files to your email, click on Attach button to start." | "Puedes adjuntar archivos a tu correo electrónico, haz clic en el botón Adjuntar para comenzar." | "Vous pouvez joindre des fichiers à votre e-mail, cliquez sur le bouton Joindre pour commencer." | "Você pode anexar arquivos ao seu e-mail, clique no botão Anexar para iniciar." | "Puoi allegare file alla tua email, clicca sul pulsante Allega per iniziare.";
571
571
  static get SelectFromAttachments(): "Aus Anhängen auswählen" | "Select from attachments" | "Seleccionar de archivos adjuntos" | "Sélectionner parmi les pièces jointes" | "Selecionar dos anexos" | "Seleziona dagli allegati";
572
+ static get SelectMetadata(): "Metadaten auswählen" | "Select metadata" | "Seleccionar metadatos" | "Sélectionner les métadonnées" | "Selecionar metadados" | "Seleziona metadato";
572
573
  static get SelectSupportAreaMessage(): "Wählen Sie einen Ablagebereich aus" | "Select a support area" | "Seleccione un área de apoyo" | "Sélectionnez une zone de support" | "Selecione uma área de apoio" | "Selezionare un'area di appoggio";
573
574
  static get SelectedSingular(): string;
574
575
  static get Selected(): "Ausgewählt" | "Selected" | "Sélectionné" | "Selecionado" | "Seleccionados" | "Selezionati";
@@ -5661,6 +5661,16 @@ export class SDKUI_Localizator {
5661
5661
  default: return "Seleziona dagli allegati";
5662
5662
  }
5663
5663
  }
5664
+ static get SelectMetadata() {
5665
+ switch (this._cultureID) {
5666
+ case CultureIDs.De_DE: return "Metadaten auswählen";
5667
+ case CultureIDs.En_US: return "Select metadata";
5668
+ case CultureIDs.Es_ES: return "Seleccionar metadatos";
5669
+ case CultureIDs.Fr_FR: return "Sélectionner les métadonnées";
5670
+ case CultureIDs.Pt_PT: return "Selecionar metadados";
5671
+ default: return "Seleziona metadato";
5672
+ }
5673
+ }
5664
5674
  static get SelectSupportAreaMessage() {
5665
5675
  switch (this._cultureID) {
5666
5676
  case CultureIDs.De_DE: return "Wählen Sie einen Ablagebereich aus";
@@ -67,4 +67,22 @@ export declare const parseSignatureConfiguration: (did: number, informationSign:
67
67
  };
68
68
  export declare const convertSearchResultDescriptorToFileItems: (documents: Array<SearchResultDescriptor>) => Array<FileItem>;
69
69
  export declare const getAppModuleGradient: (appModuleID: AppModules) => string;
70
+ export declare const getPanelManagerToolbarColor: (appModuleID: AppModules) => string;
71
+ type SearchToolbarVisibility = {
72
+ tmSearchResult: boolean;
73
+ tmBlog: boolean;
74
+ tmSysMetadata: boolean;
75
+ tmDcmtPreview: boolean;
76
+ tmFullTextSearch: boolean;
77
+ };
78
+ export declare const getSearchToolbarVisibility: (appModuleID: AppModules) => SearchToolbarVisibility;
79
+ type DcmtFormToolbarVisibility = {
80
+ tmDcmtForm: boolean;
81
+ tmBlog: boolean;
82
+ tmSysMetadata: boolean;
83
+ tmDcmtPreview: boolean;
84
+ tmWF: boolean;
85
+ tmDcmtTasks: boolean;
86
+ };
87
+ export declare const getDcmtFormToolbarVisibility: (appModuleID: AppModules) => DcmtFormToolbarVisibility;
70
88
  export {};
@@ -445,3 +445,61 @@ export const getAppModuleGradient = (appModuleID) => {
445
445
  return 'linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)';
446
446
  }
447
447
  };
448
+ export const getPanelManagerToolbarColor = (appModuleID) => {
449
+ switch (appModuleID) {
450
+ case AppModules.SURFER:
451
+ return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
452
+ case AppModules.DESIGNER:
453
+ return '#482234';
454
+ case AppModules.ORCHESTRATOR:
455
+ return '#1d6f42';
456
+ default:
457
+ return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
458
+ }
459
+ };
460
+ export const getSearchToolbarVisibility = (appModuleID) => {
461
+ switch (appModuleID) {
462
+ case AppModules.SURFER:
463
+ return {
464
+ tmSearchResult: true,
465
+ tmBlog: true,
466
+ tmSysMetadata: true,
467
+ tmDcmtPreview: true,
468
+ tmFullTextSearch: true,
469
+ };
470
+ case AppModules.DESIGNER:
471
+ case AppModules.ORCHESTRATOR:
472
+ default:
473
+ return {
474
+ tmSearchResult: true,
475
+ tmBlog: false,
476
+ tmSysMetadata: false,
477
+ tmDcmtPreview: false,
478
+ tmFullTextSearch: false,
479
+ };
480
+ }
481
+ };
482
+ export const getDcmtFormToolbarVisibility = (appModuleID) => {
483
+ switch (appModuleID) {
484
+ case AppModules.SURFER:
485
+ return {
486
+ tmDcmtForm: true,
487
+ tmBlog: true,
488
+ tmSysMetadata: true,
489
+ tmDcmtPreview: true,
490
+ tmWF: true,
491
+ tmDcmtTasks: true,
492
+ };
493
+ case AppModules.DESIGNER:
494
+ case AppModules.ORCHESTRATOR:
495
+ default:
496
+ return {
497
+ tmDcmtForm: true,
498
+ tmBlog: false,
499
+ tmSysMetadata: true,
500
+ tmDcmtPreview: true,
501
+ tmWF: false,
502
+ tmDcmtTasks: false,
503
+ };
504
+ }
505
+ };
@@ -49,7 +49,7 @@ export const IsParametricQuery = (qd) => {
49
49
  return false;
50
50
  };
51
51
  export const addHiddenSelectItem = (select, tid, mid) => {
52
- if (select.findIndex(o => o.mid == mid) >= 0)
52
+ if (select.findIndex(o => o.tid == tid && o.mid == mid) >= 0)
53
53
  return;
54
54
  let si = new SelectItem();
55
55
  si.tid = tid;
@@ -8,6 +8,18 @@ import { useFileDialog } from './useInputDialog';
8
8
  import { isXMLFileExt } from '../helper/dcmtsHelper';
9
9
  import { ShowConfirm } from '../components/base/TMConfirm';
10
10
  let abortController = new AbortController();
11
+ const downloadCountMap = new Map();
12
+ const getDownloadFileName = (fileName) => {
13
+ const firstDot = fileName.indexOf('.');
14
+ const lastDot = fileName.lastIndexOf('.');
15
+ if (firstDot === -1 || firstDot === lastDot)
16
+ return fileName;
17
+ const count = downloadCountMap.get(fileName) ?? 0;
18
+ downloadCountMap.set(fileName, count + 1);
19
+ if (count === 0)
20
+ return fileName;
21
+ return `${fileName.slice(0, firstDot)}(${count})${fileName.slice(firstDot)}`;
22
+ };
11
23
  export function useDcmtOperations() {
12
24
  const [showWaitPanel, setShowWaitPanel] = useState(false);
13
25
  const [waitPanelTitle, setWaitPanelTitle] = useState('');
@@ -96,8 +108,8 @@ export function useDcmtOperations() {
96
108
  else {
97
109
  const alink2 = document.createElement('a');
98
110
  alink2.href = fileURL;
99
- const downloadFileName = inputDcmts[i].fileName ?? (inputDcmts[i].FILEEXT ? `${inputDcmts[i].DID}.${inputDcmts[i].FILEEXT}` : file?.name);
100
- alink2.download = downloadFileName;
111
+ const baseFileName = inputDcmts[i].fileName ?? (inputDcmts[i].FILEEXT ? `${inputDcmts[i].DID}.${inputDcmts[i].FILEEXT}` : file?.name);
112
+ alink2.download = getDownloadFileName(baseFileName);
101
113
  alink2.target = "_blank";
102
114
  alink2.rel = "noreferrer";
103
115
  alink2.click();
@@ -225,9 +225,6 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
225
225
  const filterRelationsWithAssociations = (relations) => {
226
226
  return relations.filter(rel => rel.associations && rel.associations.length > 0);
227
227
  };
228
- const getRelatedDcmt = async (relation, type) => {
229
- return await DcmtTypeListCacheService.GetAsync(type === 'detail' ? relation.detailTID : relation.masterTID);
230
- };
231
228
  const showNoRelationsAlert = (type) => {
232
229
  ShowAlert({
233
230
  message: type === 'detail'
@@ -282,6 +279,26 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
282
279
  TMExceptionBoxManager.show({ exception: error });
283
280
  }
284
281
  }, [mapAssociationsToMids]);
282
+ const filterRelationsByPermission = async (relations, type) => {
283
+ const dataSourcePromises = relations.map(async (rel) => {
284
+ const targetTID = type === 'detail' ? rel.detailTID : rel.masterTID;
285
+ const dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(targetTID, undefined);
286
+ const hasPermission = dtd?.perm?.canArchive === AccessLevelsEx.Yes || dtd?.perm?.canArchive === AccessLevelsEx.Mixed;
287
+ return { id: rel?.id, name: dtd?.name, hasPermission, relation: rel };
288
+ });
289
+ const allResults = await Promise.all(dataSourcePromises);
290
+ return allResults.filter(r => r.hasPermission);
291
+ };
292
+ const showNoPermissionAlert = (type) => {
293
+ ShowAlert({
294
+ message: type === 'detail'
295
+ ? SDKUI_Localizator.YouDoNotHavePermissionsToArchiveDetailDocumentsOfThisType
296
+ : SDKUI_Localizator.YouDoNotHavePermissionsToArchiveMasterDocumentsOfThisType,
297
+ mode: 'warning',
298
+ title: type === 'detail' ? SDKUI_Localizator.DcmtsDetail : SDKUI_Localizator.DcmtsMaster,
299
+ duration: 5000
300
+ });
301
+ };
285
302
  const archiveRelatedDocuments = useCallback(async (tid, type) => {
286
303
  try {
287
304
  TMSpinner.show({ description: SDKUI_Localizator.Loading });
@@ -300,14 +317,20 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
300
317
  }
301
318
  setRelatedDcmts(withAssociations);
302
319
  if (withAssociations.length > 1) {
303
- const dataSourcePromises = withAssociations.map(async (rel) => {
304
- const relatedDcmt = await getRelatedDcmt(rel, type);
305
- return { id: rel?.id, name: relatedDcmt?.name };
306
- });
307
- const dataSource = await Promise.all(dataSourcePromises);
308
- setRelatedDcmtsChooserDataSource(dataSource);
309
- setArchiveType(type);
310
- setShowRelatedDcmtsChooser(true);
320
+ const permittedResults = await filterRelationsByPermission(withAssociations, type);
321
+ if (permittedResults.length === 0) {
322
+ showNoPermissionAlert(type);
323
+ return;
324
+ }
325
+ if (permittedResults.length === 1) {
326
+ await archiveRelatedDcmtHandler(permittedResults[0].relation, type);
327
+ }
328
+ else {
329
+ const dataSource = permittedResults.map(r => ({ id: r.id, name: r.name }));
330
+ setRelatedDcmtsChooserDataSource(dataSource);
331
+ setArchiveType(type);
332
+ setShowRelatedDcmtsChooser(true);
333
+ }
311
334
  }
312
335
  else {
313
336
  await archiveRelatedDcmtHandler(withAssociations[0], type);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.20.0-dev2.2",
3
+ "version": "6.20.0-dev2.21",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",
@@ -40,7 +40,7 @@
40
40
  "lib"
41
41
  ],
42
42
  "dependencies": {
43
- "@topconsultnpm/sdk-ts": "6.20.0-test1",
43
+ "@topconsultnpm/sdk-ts": "6.20.0-dev2.5",
44
44
  "buffer": "^6.0.3",
45
45
  "devextreme": "25.2.4",
46
46
  "devextreme-react": "25.2.4",