@topconsultnpm/sdkui-react 6.22.0-dev2.49 → 6.22.0-dev2.50

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.
@@ -25,6 +25,7 @@ export interface ITMPanelProps {
25
25
  onActivate?: (panelID: string) => void;
26
26
  onActiveChanged?: (isActive: boolean) => void;
27
27
  onBack?: () => void;
28
+ backCaption?: string;
28
29
  onClose?: () => void;
29
30
  onHeaderDoubleClick?: () => void;
30
31
  onMaximize?: (isMaximized: boolean) => void;
@@ -210,7 +210,7 @@ const StyledPanelLoaderOverlay = styled.div `
210
210
  * - Se passata → Controlled: il parent gestisce lo stato tramite onActivate
211
211
  */
212
212
  const TMPanel = forwardRef(({ allowMaximize = true, color, backgroundColor, backgroundColorContainer, children, showHeader = true, title, enableTitleMarquee = false, totalItems, displayedItemsCount, toolbar, padding = '5px', isVisible = true, panelID = 'tmpanel', isActive, // Questa prop determinerà la modalità
213
- onRefresh, isRefreshing, onActivate, onBack, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged }, ref) => {
213
+ onRefresh, isRefreshing, onActivate, onBack, backCaption = SDKUI_Localizator.Back, onClose, onHeaderDoubleClick, onMaximize, onActiveChanged }, ref) => {
214
214
  const [isMaximized, setIsMaximized] = useState(false);
215
215
  const [isRefreshingInternal, setIsRefreshingInternal] = useState(false);
216
216
  // Il loader compare sia per il refresh dalla testata sia per i caricamenti segnalati dal contenuto
@@ -313,7 +313,7 @@ onRefresh, isRefreshing, onActivate, onBack, onClose, onHeaderDoubleClick, onMax
313
313
  flexDirection: 'row',
314
314
  alignItems: 'center',
315
315
  flexShrink: 0
316
- }, children: _jsxs(StyledBackButton, { "$isActive": currentIsActive, onClick: () => onBack ? onBack() : null, title: SDKUI_Localizator.Back, children: [_jsx(IconArrowLeft, {}), !isMobile && _jsx("span", { children: SDKUI_Localizator.Back })] }) }), _jsx(StyledPanelTitleViewport, { children: _jsx(StyledPanelTitleTrack, { "$marquee": enableTitleMarquee, children: _jsxs(StyledPanelTitle, { "$marquee": enableTitleMarquee, children: [title, isPositiveNumber(displayedItemsCount) && isPositiveNumber(totalItems)
316
+ }, children: _jsxs(StyledBackButton, { "$isActive": currentIsActive, onClick: () => onBack ? onBack() : null, title: backCaption, children: [_jsx(IconArrowLeft, {}), !isMobile && _jsx("span", { children: backCaption })] }) }), _jsx(StyledPanelTitleViewport, { children: _jsx(StyledPanelTitleTrack, { "$marquee": enableTitleMarquee, children: _jsxs(StyledPanelTitle, { "$marquee": enableTitleMarquee, children: [title, isPositiveNumber(displayedItemsCount) && isPositiveNumber(totalItems)
317
317
  ? ` (${displayedItemsCount} / ${totalItems})`
318
318
  : isPositiveNumber(totalItems)
319
319
  ? ` (${totalItems})`
@@ -11,7 +11,7 @@ import TMRecentsManager from '../../grids/TMRecentsManager';
11
11
  import { SearchResultContext } from '../../../ts';
12
12
  import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
13
13
  import { StyledMultiViewPanel } from '../../base/Styled';
14
- import { useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
14
+ import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
15
15
  import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
16
16
  import { TMPanelManagerWithPersistenceProvider } from '../../layout/panelManager/TMPanelManagerWithPersistenceProvider';
17
17
  import { TMExceptionBoxManager } from '../../base/TMPopUp';
@@ -32,7 +32,7 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
32
32
  const [currentSearchView, setCurrentSearchView] = useState(TMSearchViews.Search);
33
33
  const [currentSQDMode, setCurrentSQDMode] = useState(1);
34
34
  const [lastQdSearched, setLastQdSearched] = useState();
35
- const [showSearchResults, setShowSearchResults] = useState(true);
35
+ const [showSearchResults, setShowSearchResults] = useState(!onlyShowSearchQueryPanel);
36
36
  const [maxDcmtsToBeReturned, setMaxDcmtsToBeReturned] = useState(SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000);
37
37
  const deviceType = useDeviceType();
38
38
  useEffect(() => {
@@ -244,10 +244,11 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
244
244
  SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
245
245
  setMruTIDs(newMruTIDS);
246
246
  } }), [mruTIDs, currentMruTID, deviceType]);
247
- const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { isSearchViewOnScreen: currentSearchView === TMSearchViews.Search, passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, maxDcmtsToBeReturned: maxDcmtsToBeReturned, onBackToResult: () => { setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: handleSearchCompleted, onRefreshRequested: refreshSearchQueryPanelAsync, onDcmtTypeReloaded: handleDcmtTypeReloaded, onSqdSaved: async (newSqd) => {
247
+ const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { isSearchViewOnScreen: currentSearchView === TMSearchViews.Search, passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, maxDcmtsToBeReturned: maxDcmtsToBeReturned, onBackToResult: () => { if (onlyShowSearchQueryPanel)
248
+ setShowSearchResults(true); setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: handleSearchCompleted, onRefreshRequested: refreshSearchQueryPanelAsync, onDcmtTypeReloaded: handleDcmtTypeReloaded, onSqdSaved: async (newSqd) => {
248
249
  await loadDataSQDsAsync(true, newSqd.masterTID);
249
250
  await setSQDAsync(newSqd);
250
- } }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, currentSearchView, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned, handleSearchCompleted, refreshSearchQueryPanelAsync, handleDcmtTypeReloaded]);
251
+ } }), [fromDTD, showSearchResults, setShowSearchResults, currentSQD, currentSearchView, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids, maxDcmtsToBeReturned, handleSearchCompleted, refreshSearchQueryPanelAsync, handleDcmtTypeReloaded, onlyShowSearchQueryPanel]);
251
252
  const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
252
253
  onSQDItemClick(sqd, setSQDAsync);
253
254
  }, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync), refreshFavoriteSavedQueries: refreshFavoriteSavedQueries }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.AllFemale, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
@@ -328,7 +329,23 @@ const TMSearch = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTask
328
329
  toolbarOptions: { icon: _jsx(IconSavedQuery, { fontSize: 24 }), visible: true, orderNumber: 4, isActive: allInitialPanelVisibility['TMSavedQuerySelector'] }
329
330
  }
330
331
  ], [tmTreeSelectorElement, showSearchResults, tmRecentsManagerElement, tmSearchQueryPanelElement, tmSavedQuerySelectorElement, fromDTD, mruTIDs, refreshRecentsAsync, refreshSavedQueriesAsync]);
331
- return (_jsxs(_Fragment, { children: [showSearchResults ? _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }) : tmSearchQueryPanelElement, showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { onlyShowSearchQueryPanel ? setShowSearchResults(false) : setCurrentSearchView(TMSearchViews.Search); }, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, inputDID: inputDID, formAutoOpen: formAutoOpen, fetchRemoteCertificates: fetchRemoteCertificates, graphometricManager: graphometricManager })] }));
332
+ // Quando è visibile solo il pannello di ricerca (es. modale di abbinamento molti a molti) serve
333
+ const singlePanelVisibility = { 'TMSearchQueryPanel': true };
334
+ const singlePanelDimensions = { 'TMSearchQueryPanel': { width: '100%', height: '100%' } };
335
+ const singlePanelDefinition = useMemo(() => [
336
+ {
337
+ id: 'TMSearchQueryPanel',
338
+ name: fromDTD?.nameLoc ?? SDKUI_Localizator.Search_Metadata,
339
+ contentOptions: { component: tmSearchQueryPanelElement },
340
+ toolbarOptions: { icon: _jsx(IconFilter, { fontSize: 24 }), visible: false, orderNumber: 1, isActive: true }
341
+ }
342
+ ], [tmSearchQueryPanelElement, fromDTD]);
343
+ return (_jsxs(_Fragment, { children: [onlyShowSearchQueryPanel
344
+ // Il pannello di ricerca resta montato anche quando sono a schermo i risultati: tornando
345
+ // indietro si ritrova l'ultima ricerca impostata, senza rimontaggi che ne resettano i filtri
346
+ ? _jsx(StyledMultiViewPanel, { "$isVisible": !showSearchResults, children: _jsx(TMPanelManagerProvider, { panels: singlePanelDefinition, initialVisibility: singlePanelVisibility, defaultDimensions: singlePanelDimensions, initialDimensions: singlePanelDimensions, initialMobilePanelId: 'TMSearchQueryPanel', children: tmSearchQueryPanelElement }) })
347
+ : _jsx(StyledMultiViewPanel, { "$isVisible": currentSearchView === TMSearchViews.Search, children: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'TMRecentsManager', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true, minPanelSizePx: !isMobile ? 250 : 150 }) }) }), showSearchResults && _jsx(TMSearchResult, { isVisible: isVisible && currentSearchView === TMSearchViews.Result, context: SearchResultContext.METADATA_SEARCH, searchResults: searchResult, floatingActionConfig: floatingActionConfig, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, openInOffice: openInOffice, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onClose: () => { if (onlyShowSearchQueryPanel)
348
+ setShowSearchResults(false); setCurrentSearchView(TMSearchViews.Search); }, backCaption: onlyShowSearchQueryPanel ? SDKUI_Localizator.BackToSearch : undefined, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, onOpenPdfEditorRequest: onOpenPdfEditorRequest, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, openFileUploaderPdfEditor: openFileUploaderPdfEditor, passToArchiveCallback: passToArchiveCallback, onSelectedTIDChanged: onCurrentTIDChangedCallback, showTodoDcmtForm: showTodoDcmtForm, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, inputDID: inputDID, formAutoOpen: formAutoOpen, fetchRemoteCertificates: fetchRemoteCertificates, graphometricManager: graphometricManager })] }));
332
349
  };
333
350
  export default TMSearch;
334
351
  const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
@@ -534,205 +534,205 @@ export const refreshLastSearch = async (qd) => {
534
534
  // =============================================================================
535
535
  // STYLED COMPONENTS per i badge degli ordinamenti
536
536
  // =============================================================================
537
- const StyledOrderByBadgesContainer = styled.div `
538
- display: flex;
539
- flex-wrap: wrap;
540
- align-items: center;
541
- gap: 8px;
542
- padding: 6px 10px;
543
- margin: 1px 0;
544
- background: linear-gradient(135deg, rgba(74, 150, 210, 0.08) 0%, rgba(37, 89, 165, 0.08) 100%);
545
- border-radius: 8px;
546
- border: 1px solid rgba(74, 150, 210, 0.2);
537
+ const StyledOrderByBadgesContainer = styled.div `
538
+ display: flex;
539
+ flex-wrap: wrap;
540
+ align-items: center;
541
+ gap: 8px;
542
+ padding: 6px 10px;
543
+ margin: 1px 0;
544
+ background: linear-gradient(135deg, rgba(74, 150, 210, 0.08) 0%, rgba(37, 89, 165, 0.08) 100%);
545
+ border-radius: 8px;
546
+ border: 1px solid rgba(74, 150, 210, 0.2);
547
547
  `;
548
- const StyledOrderByLabel = styled.span `
549
- font-size: 0.82rem;
550
- font-weight: 600;
551
- color: #4A96D2;
552
- white-space: nowrap;
548
+ const StyledOrderByLabel = styled.span `
549
+ font-size: 0.82rem;
550
+ font-weight: 600;
551
+ color: #4A96D2;
552
+ white-space: nowrap;
553
553
  `;
554
- const StyledOrderByBadgesWrapper = styled.div `
555
- display: flex;
556
- flex-wrap: wrap;
557
- gap: 6px;
558
- align-items: center;
559
- flex: 1;
554
+ const StyledOrderByBadgesWrapper = styled.div `
555
+ display: flex;
556
+ flex-wrap: wrap;
557
+ gap: 6px;
558
+ align-items: center;
559
+ flex: 1;
560
560
  `;
561
- const StyledOrderByBadge = styled.div `
562
- display: inline-flex;
563
- align-items: center;
564
- gap: 4px;
565
- padding: 3px 8px;
566
- background: white;
567
- border: 1px solid #d1d9e6;
568
- border-radius: 16px;
569
- font-size: 0.82rem;
570
- color: #333;
571
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
572
-
573
- .badge-name {
574
- max-width: 120px;
575
- overflow: hidden;
576
- text-overflow: ellipsis;
577
- white-space: nowrap;
578
-
579
- @media (max-width: 600px) {
580
- max-width: 80px;
581
- }
582
- }
561
+ const StyledOrderByBadge = styled.div `
562
+ display: inline-flex;
563
+ align-items: center;
564
+ gap: 4px;
565
+ padding: 3px 8px;
566
+ background: white;
567
+ border: 1px solid #d1d9e6;
568
+ border-radius: 16px;
569
+ font-size: 0.82rem;
570
+ color: #333;
571
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
572
+
573
+ .badge-name {
574
+ max-width: 120px;
575
+ overflow: hidden;
576
+ text-overflow: ellipsis;
577
+ white-space: nowrap;
578
+
579
+ @media (max-width: 600px) {
580
+ max-width: 80px;
581
+ }
582
+ }
583
583
  `;
584
- const StyledOrderByBadgeMore = styled.div `
585
- display: inline-flex;
586
- align-items: center;
587
- justify-content: center;
588
- padding: 3px 10px;
589
- background: linear-gradient(135deg, #4A96D2 0%, #2559A5 100%);
590
- border: none;
591
- border-radius: 16px;
592
- font-size: 0.82rem;
593
- font-weight: 600;
594
- color: white;
595
- cursor: pointer;
596
- transition: all 0.2s ease;
597
-
598
- &:hover {
599
- transform: scale(1.05);
600
- box-shadow: 0 2px 6px rgba(74, 150, 210, 0.4);
601
- }
584
+ const StyledOrderByBadgeMore = styled.div `
585
+ display: inline-flex;
586
+ align-items: center;
587
+ justify-content: center;
588
+ padding: 3px 10px;
589
+ background: linear-gradient(135deg, #4A96D2 0%, #2559A5 100%);
590
+ border: none;
591
+ border-radius: 16px;
592
+ font-size: 0.82rem;
593
+ font-weight: 600;
594
+ color: white;
595
+ cursor: pointer;
596
+ transition: all 0.2s ease;
597
+
598
+ &:hover {
599
+ transform: scale(1.05);
600
+ box-shadow: 0 2px 6px rgba(74, 150, 210, 0.4);
601
+ }
602
602
  `;
603
- const StyledOrderByEditButton = styled.div `
604
- display: flex;
605
- align-items: center;
606
- justify-content: center;
607
- width: 28px;
608
- height: 28px;
609
- border-radius: 4px;
610
- color: #4A96D2;
611
- cursor: pointer;
612
- transition: all 0.2s ease;
613
-
614
- &:hover {
615
- background-color: rgba(74, 150, 210, 0.15);
616
- }
603
+ const StyledOrderByEditButton = styled.div `
604
+ display: flex;
605
+ align-items: center;
606
+ justify-content: center;
607
+ width: 28px;
608
+ height: 28px;
609
+ border-radius: 4px;
610
+ color: #4A96D2;
611
+ cursor: pointer;
612
+ transition: all 0.2s ease;
613
+
614
+ &:hover {
615
+ background-color: rgba(74, 150, 210, 0.15);
616
+ }
617
617
  `;
618
618
  // =============================================================================
619
619
  // STYLED COMPONENTS per i badge degli output (select) - colore verde/teal
620
620
  // =============================================================================
621
- const StyledSelectBadgesContainer = styled.div `
622
- display: flex;
623
- flex-wrap: wrap;
624
- align-items: center;
625
- gap: 8px;
626
- padding: 6px 10px;
627
- margin: 1px 0;
628
- background: linear-gradient(135deg, rgba(46, 125, 50, 0.08) 0%, rgba(27, 94, 32, 0.08) 100%);
629
- border-radius: 8px;
630
- border: 1px solid rgba(46, 125, 50, 0.2);
621
+ const StyledSelectBadgesContainer = styled.div `
622
+ display: flex;
623
+ flex-wrap: wrap;
624
+ align-items: center;
625
+ gap: 8px;
626
+ padding: 6px 10px;
627
+ margin: 1px 0;
628
+ background: linear-gradient(135deg, rgba(46, 125, 50, 0.08) 0%, rgba(27, 94, 32, 0.08) 100%);
629
+ border-radius: 8px;
630
+ border: 1px solid rgba(46, 125, 50, 0.2);
631
631
  `;
632
- const StyledSelectLabel = styled.span `
633
- font-size: 0.82rem;
634
- font-weight: 600;
635
- color: #2E7D32;
636
- white-space: nowrap;
632
+ const StyledSelectLabel = styled.span `
633
+ font-size: 0.82rem;
634
+ font-weight: 600;
635
+ color: #2E7D32;
636
+ white-space: nowrap;
637
637
  `;
638
- const StyledSelectBadgesWrapper = styled.div `
639
- display: flex;
640
- flex-wrap: wrap;
641
- gap: 6px;
642
- align-items: center;
643
- flex: 1;
638
+ const StyledSelectBadgesWrapper = styled.div `
639
+ display: flex;
640
+ flex-wrap: wrap;
641
+ gap: 6px;
642
+ align-items: center;
643
+ flex: 1;
644
644
  `;
645
- const StyledSelectBadge = styled.div `
646
- display: inline-flex;
647
- align-items: center;
648
- gap: 4px;
649
- padding: 3px 8px;
650
- background: white;
651
- border: 1px solid #c8e6c9;
652
- border-radius: 16px;
653
- font-size: 0.82rem;
654
- color: #333;
655
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
656
-
657
- .badge-name {
658
- max-width: 120px;
659
- overflow: hidden;
660
- text-overflow: ellipsis;
661
- white-space: nowrap;
662
-
663
- @media (max-width: 600px) {
664
- max-width: 80px;
665
- }
666
- }
645
+ const StyledSelectBadge = styled.div `
646
+ display: inline-flex;
647
+ align-items: center;
648
+ gap: 4px;
649
+ padding: 3px 8px;
650
+ background: white;
651
+ border: 1px solid #c8e6c9;
652
+ border-radius: 16px;
653
+ font-size: 0.82rem;
654
+ color: #333;
655
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
656
+
657
+ .badge-name {
658
+ max-width: 120px;
659
+ overflow: hidden;
660
+ text-overflow: ellipsis;
661
+ white-space: nowrap;
662
+
663
+ @media (max-width: 600px) {
664
+ max-width: 80px;
665
+ }
666
+ }
667
667
  `;
668
- const StyledSelectBadgeMore = styled.div `
669
- display: inline-flex;
670
- align-items: center;
671
- justify-content: center;
672
- padding: 3px 10px;
673
- background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
674
- border: none;
675
- border-radius: 16px;
676
- font-size: 0.82rem;
677
- font-weight: 600;
678
- color: white;
679
- cursor: pointer;
680
- transition: all 0.2s ease;
681
-
682
- &:hover {
683
- transform: scale(1.05);
684
- box-shadow: 0 2px 6px rgba(46, 125, 50, 0.4);
685
- }
668
+ const StyledSelectBadgeMore = styled.div `
669
+ display: inline-flex;
670
+ align-items: center;
671
+ justify-content: center;
672
+ padding: 3px 10px;
673
+ background: linear-gradient(135deg, #43A047 0%, #2E7D32 100%);
674
+ border: none;
675
+ border-radius: 16px;
676
+ font-size: 0.82rem;
677
+ font-weight: 600;
678
+ color: white;
679
+ cursor: pointer;
680
+ transition: all 0.2s ease;
681
+
682
+ &:hover {
683
+ transform: scale(1.05);
684
+ box-shadow: 0 2px 6px rgba(46, 125, 50, 0.4);
685
+ }
686
686
  `;
687
- const StyledSelectEditButton = styled.div `
688
- display: flex;
689
- align-items: center;
690
- justify-content: center;
691
- width: 28px;
692
- height: 28px;
693
- border-radius: 4px;
694
- color: #2E7D32;
695
- cursor: pointer;
696
- transition: all 0.2s ease;
697
-
698
- &:hover {
699
- background-color: rgba(46, 125, 50, 0.15);
700
- }
687
+ const StyledSelectEditButton = styled.div `
688
+ display: flex;
689
+ align-items: center;
690
+ justify-content: center;
691
+ width: 28px;
692
+ height: 28px;
693
+ border-radius: 4px;
694
+ color: #2E7D32;
695
+ cursor: pointer;
696
+ transition: all 0.2s ease;
697
+
698
+ &:hover {
699
+ background-color: rgba(46, 125, 50, 0.15);
700
+ }
701
701
  `;
702
- export const StyledToppyTextContainer = styled.div `
703
- padding: 22px 8px;
704
- width: 100%;
705
- max-width: 300px;
706
- border: 1px solid #2559A5;
707
- border-radius: 30px;
708
- display: flex;
709
- align-items: center;
710
- justify-content: center;
711
- box-sizing: border-box;
712
- min-height: 100px;
702
+ export const StyledToppyTextContainer = styled.div `
703
+ padding: 22px 8px;
704
+ width: 100%;
705
+ max-width: 300px;
706
+ border: 1px solid #2559A5;
707
+ border-radius: 30px;
708
+ display: flex;
709
+ align-items: center;
710
+ justify-content: center;
711
+ box-sizing: border-box;
712
+ min-height: 100px;
713
713
  `;
714
- export const StyledToppyText = styled.p `
715
- text-align: center;
716
- color: #2559A5;
717
- font-size: 1rem;
718
- user-select: none;
719
- -webkit-touch-callout: none;
720
- -webkit-user-select: none;
721
- -moz-user-select: none;
722
- -ms-user-select: none;
723
- margin: 0;
724
- display: -webkit-box;
725
- -webkit-box-orient: vertical;
726
- -webkit-line-clamp: 3;
727
- overflow: hidden;
728
- text-overflow: ellipsis;
729
- white-space: normal;
730
- word-break: break-word;
731
- line-height: 1.2;
714
+ export const StyledToppyText = styled.p `
715
+ text-align: center;
716
+ color: #2559A5;
717
+ font-size: 1rem;
718
+ user-select: none;
719
+ -webkit-touch-callout: none;
720
+ -webkit-user-select: none;
721
+ -moz-user-select: none;
722
+ -ms-user-select: none;
723
+ margin: 0;
724
+ display: -webkit-box;
725
+ -webkit-box-orient: vertical;
726
+ -webkit-line-clamp: 3;
727
+ overflow: hidden;
728
+ text-overflow: ellipsis;
729
+ white-space: normal;
730
+ word-break: break-word;
731
+ line-height: 1.2;
732
732
  `;
733
- export const StyledToppyImage = styled.img `
734
- width: 100%;
735
- max-width: 120px;
736
- height: auto;
737
- display: block;
733
+ export const StyledToppyImage = styled.img `
734
+ width: 100%;
735
+ max-width: 120px;
736
+ height: auto;
737
+ display: block;
738
738
  `;
@@ -26,6 +26,7 @@ interface ITMSearchResultProps {
26
26
  showSelector?: boolean;
27
27
  showToolbarHeader?: boolean;
28
28
  showBackButton?: boolean;
29
+ backCaption?: string;
29
30
  showToolbarCloseButton?: boolean;
30
31
  disableAccordionIfSingleCategory?: boolean;
31
32
  enablePinIcons?: boolean;
@@ -66,7 +66,7 @@ const TMSearchResult = ({
66
66
  // Data
67
67
  groupId, searchResults = [], context = SearchResultContext.METADATA_SEARCH, title, selectedSearchResultTID, floatingActionConfig, workingGroupContext = undefined, inputDID,
68
68
  // Boolean flags to enable/disable features
69
- autoFocusFirstRow = true, formAutoOpen, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, showToolbarCloseButton = false, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true, showCounterConfig = true, showActionsColumn = false, compactPager = false, onRowDuplicateRequest,
69
+ autoFocusFirstRow = true, formAutoOpen, isVisible = true, allowRelations = true, openDcmtFormAsModal = false, showSearchResultSidebar = true, showDcmtFormSidebar = true, showSelector = false, isClosable = false, allowFloatingBar = true, showToolbarHeader = true, showBackButton = true, backCaption, showToolbarCloseButton = false, disableAccordionIfSingleCategory = false, editPdfForm = false, openS4TViewer = false, showTodoDcmtForm = false, showToppyDraggableHelpCenter = true, toppyHelpCenterUsePortal = false, showNoDcmtFoundMessage = true, enablePinIcons = true, showCounterConfig = true, showActionsColumn = false, compactPager = false, onRowDuplicateRequest,
70
70
  // Counters
71
71
  counterConfig,
72
72
  // Callbacks (optional)
@@ -920,6 +920,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
920
920
  showHeader: showToolbarHeader,
921
921
  allowMaximize: !isMobile,
922
922
  onBack: backHandler,
923
+ backCaption: backCaption,
923
924
  onClose: isClosable ? onBack : undefined,
924
925
  toolbar: searchResutlToolbar
925
926
  },
@@ -975,7 +976,7 @@ handleNavigateToWGs, handleNavigateToDossiers, fetchRemoteCertificates, graphome
975
976
  },
976
977
  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'] }
977
978
  }
978
- ], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile, backHandler, backHandlerSecondary, isClosable, onBack]);
979
+ ], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile, backHandler, backHandlerSecondary, isClosable, onBack, backCaption]);
979
980
  /** Contenuto del panel manager: con groupId sta nel provider del contenitore, altrimenti in quello qui sotto */
980
981
  const panelManagerContent = (_jsxs(_Fragment, { children: [_jsx(PanelDisabledStateHandler, { isBoardDisabled: isBoardDisabled, savedBlogVisible: savedBlogVisible }), isLayoutPersisted && _jsx(SavedLayoutSyncHandler, { disabledPanelIds: disabledLayoutPanelIds }), _jsx(ShowMainPanelBridge, { showMainPanelRef: showMainPanelRef }), _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showSearchResultSidebar })] }));
981
982
  return (_jsxs(StyledMultiViewPanel, { "$isVisible": isVisible, children: [_jsx(StyledMultiViewPanel, { "$isVisible": (!isOpenDcmtForm || isDcmtFormModal) && !isOpenDetails && !isOpenMaster, style: {
@@ -86,6 +86,7 @@ export declare class SDKUI_Localizator {
86
86
  static get CustomButtonActions(): string;
87
87
  static get Back(): "Zurück" | "Back" | "Atrás" | "Dos" | "Voltar" | "Indietro";
88
88
  static get BackToResult(): "Zum Ergebnis" | "Go to result" | "Ir al resultado" | "Aller au résultat" | "Ir para o resultado" | "Vai a risultato";
89
+ static get BackToSearch(): "Zurück zur Suche" | "Back to search" | "Volver a la búsqueda" | "Retour à la recherche" | "Voltar à pesquisa" | "Torna a ricerca";
89
90
  static get BatchUpdate(): "Mehrfachbearbeitung" | "Multiple modification" | "Modificación múltiple" | "Modifie multiple" | "Editar múltipla" | "Modifica multipla";
90
91
  static get BlogCase(): "Anschlagbrett" | "Blog board" | "Tablón" | "Tableau d'affichage" | "Bakeca" | "Bacheca";
91
92
  static get Blog_Read(): "Anzeigebrett lesen" | "Reading blog board" | "Lectura tablón" | "Lire le tableau d'affichage" | "Quadro de avisos leitura" | "Lettura bacheca";
@@ -494,6 +495,7 @@ export declare class SDKUI_Localizator {
494
495
  static get Mark(): "Markierung" | "Mark" | "Marca" | "Marque" | "Segno";
495
496
  static get MarkAs(): "Als markieren" | "Mark as" | "Marcar como" | "Marquer comme" | "Segna come";
496
497
  static get Match(): "Übereinstimmen" | "Match" | "Emparejar" | "Associer" | "Corresponder" | "Abbina";
498
+ static get MatchDcmts(): "Dokumente zuordnen" | "Match documents" | "Emparejar documentos" | "Associer des documents" | "Corresponder documentos" | "Abbina documenti";
497
499
  static get MatchManyDocumentsManyToMany(): "Mehrere Dokumente mehrfach zuordnen" | "Match many documents many to many" | "Emparejar muchos documentos de muchos a muchos" | "Associer plusieurs documents plusieurs à plusieurs" | "Corresponder muitos documentos de muitos para muitos" | "Abbina documenti molti a molti";
498
500
  static get Max_Value(): "Der Maximalwert ist {{0}}" | "The maximum value is {{0}}" | "El valor máximo es {{0}}" | "La valeur maximale est {{0}}" | "O valor máximo é {{0}}" | "Il valore massimo è {{0}}";
499
501
  static get MaxLengthExceeded(): "\"{{0}}\" hat die maximale Länge von {{1}} Zeichen überschritten." | "\"{{0}}\" has exceeded the maximum length of {{1}} characters." | "\"{{0}}\" ha superado la longitud máxima de {{1}} caracteres." | "\"{{0}}\" a dépassé la longueur maximale de {{1}} caractères." | "\"{{0}}\" excedeu o comprimento máximo de {{1}} caracteres." | "\"{{0}}\" ha superato la lunghezza massima di {{1}} caratteri.";
@@ -749,6 +751,7 @@ export declare class SDKUI_Localizator {
749
751
  static get SearchAction(): "Search" | "Suche" | "Buscar" | "Chercher" | "Pesquisar" | "Cerca";
750
752
  static get SearchAndAppend(): "Suchen und anhängen" | "Search and append" | "Buscar y añadir" | "Rechercher et ajouter" | "Pesquisar e acrescentar" | "Ricerca e accoda";
751
753
  static get Search_Advanced(): "Erweiterte Suche" | "Advanced search" | "Búsqueda avanzada" | "Recherche avancée" | "Pesquisa Avançada" | "Ricerca avanzata";
754
+ static get Search_Dcmts(): "Dokumentensuche" | "Document search" | "Búsqueda de documentos" | "Recherche de documents" | "Pesquisa de documentos" | "Ricerca documenti";
752
755
  static get Search_Easy(): "Einfache Suche" | "Easy search" | "Búsqueda fácil" | "Recherche facile" | "Pesquisa fácil" | "Ricerca facilitata";
753
756
  static get Search_EnterValue(): "Geben Sie einen Wert ein, nach dem gesucht werden soll" | "Enter a value to search" | "Introducir un valor para buscar" | "Entrez une valeur à rechercher" | "Digite um valor para pesquisar" | "Inserire un valore da ricercare";
754
757
  static get Search_Free(): "Kostenlose Suche" | "Free search" | "Búsqueda libre" | "Recherche libre" | "Pesquisa livre" | "Ricerca libera";
@@ -877,6 +880,7 @@ export declare class SDKUI_Localizator {
877
880
  static get Undo(): "Änderungen rückgängig machen" | "Undo" | "Anular modificaciones" | "Annule les modifications" | "Anular alterações" | "Annulla modifiche";
878
881
  static get Unfollow(): "Nicht mehr folgen" | "Unfollow" | "Dejar de seguir" | "Ne plus suivre" | "Deixar de seguir" | "Non seguire più";
879
882
  static get Unmatch(): "Zuordnung aufheben" | "Unmatch" | "Desemparejar" | "Dissocier" | "Descorresponder" | "Disabbina";
883
+ static get UnmatchDcmts(): "Zuordnung von Dokumenten aufheben" | "Unmatch documents" | "Desemparejar documentos" | "Dissocier des documents" | "Descorresponder documentos" | "Disabbina documenti";
880
884
  static get UnmatchManyDocumentsManyToMany(): "Mehrfache Zuordnung von vielen Dokumenten aufheben" | "Unmatch many documents many to many" | "Desemparejar muchos documentos de muchos a muchos" | "Dissocier plusieurs documents plusieurs à plusieurs" | "Descorresponder muitos documentos de muitos para muitos" | "Disabbina documenti molti a molti";
881
885
  static get UnfollowSelectedItem(): string;
882
886
  static get Update(): "Bearbeiten" | "Update" | "Modificar" | "Modifie" | "Modificação" | "Modifica";
@@ -815,6 +815,16 @@ export class SDKUI_Localizator {
815
815
  default: return "Vai a risultato";
816
816
  }
817
817
  }
818
+ static get BackToSearch() {
819
+ switch (this._cultureID) {
820
+ case CultureIDs.De_DE: return "Zurück zur Suche";
821
+ case CultureIDs.En_US: return "Back to search";
822
+ case CultureIDs.Es_ES: return "Volver a la búsqueda";
823
+ case CultureIDs.Fr_FR: return "Retour à la recherche";
824
+ case CultureIDs.Pt_PT: return "Voltar à pesquisa";
825
+ default: return "Torna a ricerca";
826
+ }
827
+ }
818
828
  static get BatchUpdate() {
819
829
  switch (this._cultureID) {
820
830
  case CultureIDs.De_DE: return "Mehrfachbearbeitung";
@@ -4908,6 +4918,16 @@ export class SDKUI_Localizator {
4908
4918
  default: return "Abbina";
4909
4919
  }
4910
4920
  }
4921
+ static get MatchDcmts() {
4922
+ switch (this._cultureID) {
4923
+ case CultureIDs.De_DE: return "Dokumente zuordnen";
4924
+ case CultureIDs.En_US: return "Match documents";
4925
+ case CultureIDs.Es_ES: return "Emparejar documentos";
4926
+ case CultureIDs.Fr_FR: return "Associer des documents";
4927
+ case CultureIDs.Pt_PT: return "Corresponder documentos";
4928
+ default: return "Abbina documenti";
4929
+ }
4930
+ }
4911
4931
  static get MatchManyDocumentsManyToMany() {
4912
4932
  switch (this._cultureID) {
4913
4933
  case CultureIDs.De_DE: return "Mehrere Dokumente mehrfach zuordnen";
@@ -7469,6 +7489,16 @@ export class SDKUI_Localizator {
7469
7489
  default: return "Ricerca avanzata";
7470
7490
  }
7471
7491
  }
7492
+ static get Search_Dcmts() {
7493
+ switch (this._cultureID) {
7494
+ case CultureIDs.De_DE: return "Dokumentensuche";
7495
+ case CultureIDs.En_US: return "Document search";
7496
+ case CultureIDs.Es_ES: return "Búsqueda de documentos";
7497
+ case CultureIDs.Fr_FR: return "Recherche de documents";
7498
+ case CultureIDs.Pt_PT: return "Pesquisa de documentos";
7499
+ default: return "Ricerca documenti";
7500
+ }
7501
+ }
7472
7502
  static get Search_Easy() {
7473
7503
  switch (this._cultureID) {
7474
7504
  case CultureIDs.De_DE: return "Einfache Suche";
@@ -8756,6 +8786,16 @@ export class SDKUI_Localizator {
8756
8786
  default: return "Disabbina";
8757
8787
  }
8758
8788
  }
8789
+ static get UnmatchDcmts() {
8790
+ switch (this._cultureID) {
8791
+ case CultureIDs.De_DE: return "Zuordnung von Dokumenten aufheben";
8792
+ case CultureIDs.En_US: return "Unmatch documents";
8793
+ case CultureIDs.Es_ES: return "Desemparejar documentos";
8794
+ case CultureIDs.Fr_FR: return "Dissocier des documents";
8795
+ case CultureIDs.Pt_PT: return "Descorresponder documentos";
8796
+ default: return "Disabbina documenti";
8797
+ }
8798
+ }
8759
8799
  static get UnmatchManyDocumentsManyToMany() {
8760
8800
  switch (this._cultureID) {
8761
8801
  case CultureIDs.De_DE: return "Mehrfache Zuordnung von vielen Dokumenten aufheben";
@@ -117,7 +117,7 @@ export const useDocumentOperations = (props) => {
117
117
  // Data
118
118
  relatedDcmts, pairedSearchResults, manyToManyRelations, selectedManyToManyRelation, manyToManyChooserDataSource, relatedDcmtsChooserDataSource,
119
119
  // Flags / State booleans
120
- showRelatedDcmtsChooser, isOpenDetails, isOpenMaster, isOpenArchiveRelationForm, isPairingManyToMany, showManyToManyChooser, showPairSearchModal, currentTIDHasDetailRelations, currentTIDHasMasterRelations, canArchiveMasterRelation, canArchiveDetailRelation, hasManyToManyRelation, showPairDcmtsModal,
120
+ showRelatedDcmtsChooser, isOpenDetails, isOpenMaster, isOpenArchiveRelationForm, isPairingManyToMany, showManyToManyChooser, showPairSearchModal, currentTIDHasDetailRelations, currentTIDHasMasterRelations, canArchiveMasterRelation, canArchiveDetailRelation, hasManyToManyRelation, showPairDcmtsModal, backToPairSearchModal,
121
121
  // Pair search modal state
122
122
  pairSearchModalTargetTID, pairSearchModalParentTID, pairSearchModalParentDID, pairSearchModalRelation, pairSearchModalInputMids,
123
123
  // Config
@@ -1463,8 +1463,8 @@ export const useDocumentOperations = (props) => {
1463
1463
  TMSpinner.hide();
1464
1464
  }
1465
1465
  }, onClose: () => setShowManyToManyChooser(false), manageUseLocalizedName: false }), showPairDcmtsModal &&
1466
- _jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, fetchRemoteCertificates: fetchRemoteCertificates }) }), showPairSearchModal &&
1467
- _jsx(TMModal, { title: "Ricerca documenti", onClose: () => setShowPairSearchModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearch, { onlyShowSearchQueryPanel: true, inputTID: pairSearchModalTargetTID, inputMids: pairSearchModalInputMids, floatingActionConfig: pairSearchModalFloatingActionConfig, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenSharedArchive && _jsx(TMModal, { title: SDKUI_Localizator.SharedArchiving, onClose: () => {
1466
+ _jsx(TMModal, { title: isPairingManyToMany ? SDKUI_Localizator.MatchDcmts : SDKUI_Localizator.UnmatchDcmts, onClose: () => setShowPairDcmtsModal(false), width: '95%', height: '95%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshAfterAddDcmtToFavs: onRefreshAfterAddDcmtToFavs, onRefreshSearchAsyncDatagrid: onRefreshSearchAsyncDatagrid, onFileOpened: onFileOpened, onTaskCreateRequest: onTaskCreateRequest, openWGsCopyMoveForm: openWGsCopyMoveForm, editPdfForm: editPdfForm, openS4TViewer: openS4TViewer, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onOpenPdfEditorRequest: onOpenPdfEditorRequest, passToArchiveCallback: passToArchiveCallback, showTodoDcmtForm: showTodoDcmtForm, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: backToPairSearchModal !== undefined, onClose: backToPairSearchModal, backCaption: SDKUI_Localizator.BackToSearch, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, toppyHelpCenterUsePortal: toppyHelpCenterUsePortal, showToppyDraggableHelpCenter: showToppyDraggableHelpCenter, fetchRemoteCertificates: fetchRemoteCertificates }) }), showPairSearchModal &&
1467
+ _jsx(TMModal, { title: SDKUI_Localizator.Search_Dcmts, onClose: () => setShowPairSearchModal(false), width: '95%', height: '95%', children: _jsx(TMSearch, { onlyShowSearchQueryPanel: true, inputTID: pairSearchModalTargetTID, inputMids: pairSearchModalInputMids, floatingActionConfig: pairSearchModalFloatingActionConfig, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), isOpenSharedArchive && _jsx(TMModal, { title: SDKUI_Localizator.SharedArchiving, onClose: () => {
1468
1468
  setIsOpenSharedArchive(false);
1469
1469
  }, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputDID: selectedDcmtInfos?.[0].DID, inputTID: selectedDcmtInfos?.[0].TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, inputFile: sharedDcmtFile, onSavedAsyncCallback: async (tid, did) => {
1470
1470
  setIsOpenSharedArchive(false);
@@ -1560,6 +1560,7 @@ export const useDocumentOperations = (props) => {
1560
1560
  canArchiveDetailRelation,
1561
1561
  hasManyToManyRelation,
1562
1562
  showPairDcmtsModal,
1563
+ backToPairSearchModal,
1563
1564
  // Pair search modal state
1564
1565
  pairSearchModalTargetTID,
1565
1566
  pairSearchModalParentTID,
@@ -67,6 +67,7 @@ export interface UseRelatedDocumentsReturn {
67
67
  checkManyToManyCapability: () => Promise<void>;
68
68
  archiveRelatedDcmtHandler: (relation: RelationDescriptor, type: 'detail' | 'master') => Promise<void>;
69
69
  executeManyToManyPairing: (relation: RelationDescriptor, isPairing: boolean) => Promise<void>;
70
+ backToPairSearchModal: (() => void) | undefined;
70
71
  }
71
72
  export declare const useRelatedDocuments: ({ selectedSearchResult, focusedItem, currentSearchResults }: UseRelatedDocumentsProps) => UseRelatedDocumentsReturn;
72
73
  export {};
@@ -28,6 +28,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
28
28
  const [pairSearchModalParentDID, setPairSearchModalParentDID] = useState(undefined);
29
29
  const [pairSearchModalRelation, setPairSearchModalRelation] = useState(undefined);
30
30
  const [pairSearchModalInputMids, setPairSearchModalInputMids] = useState(undefined);
31
+ const [pairSearchContext, setPairSearchContext] = useState(undefined);
31
32
  const [currentTIDHasDetailRelations, setCurrentTIDHasDetailRelations] = useState();
32
33
  const [currentTIDHasMasterRelations, setCurrentTIDHasMasterRelations] = useState();
33
34
  const [canArchiveMasterRelation, setCanArchiveMasterRelation] = useState(false);
@@ -86,6 +87,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
86
87
  if (!tms)
87
88
  return;
88
89
  const se = new SearchEngine(tms);
90
+ const operationTitle = isPairing ? SDKUI_Localizator.MatchManyDocumentsManyToMany : SDKUI_Localizator.UnmatchManyDocumentsManyToMany;
89
91
  try {
90
92
  TMSpinner.show({ description: isPairing ? 'Abbinamento in corso...' : 'Disabbinamento in corso...' });
91
93
  for (const doc of selected) {
@@ -115,10 +117,16 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
115
117
  }
116
118
  }
117
119
  onCloseModal();
120
+ ShowAlert({
121
+ message: SDKUI_Localizator.OperationSuccess,
122
+ mode: 'success',
123
+ title: operationTitle,
124
+ duration: 3000
125
+ });
118
126
  }
119
127
  catch (error) {
120
128
  console.error('Error in onClick:', error);
121
- TMExceptionBoxManager.show({ exception: error });
129
+ TMExceptionBoxManager.show({ title: operationTitle, exception: error });
122
130
  }
123
131
  finally {
124
132
  TMSpinner.hide();
@@ -129,6 +137,14 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
129
137
  }), []);
130
138
  const pairFloatingActionConfig = useMemo(() => createPairFloatingActionConfig(selectedManyToManyRelation, focusedItem?.TID ? Number(focusedItem.TID) : undefined, focusedItem?.DID ? Number(focusedItem.DID) : undefined, isPairingManyToMany, () => setShowPairDcmtsModal(false)), [createPairFloatingActionConfig, selectedManyToManyRelation, focusedItem, isPairingManyToMany]);
131
139
  const pairSearchModalFloatingActionConfig = useMemo(() => createPairFloatingActionConfig(pairSearchModalRelation, pairSearchModalParentTID, pairSearchModalParentDID, true, () => setShowPairSearchModal(false)), [createPairFloatingActionConfig, pairSearchModalRelation, pairSearchModalParentTID, pairSearchModalParentDID]);
140
+ const backToPairSearchModal = useMemo(() => {
141
+ if (!pairSearchContext)
142
+ return undefined;
143
+ return () => {
144
+ setShowPairDcmtsModal(false);
145
+ openPairSearchModal(pairSearchContext.relation, pairSearchContext.targetTID, pairSearchContext.qd);
146
+ };
147
+ }, [pairSearchContext, openPairSearchModal]);
132
148
  const getAllRelationsAsync = async () => {
133
149
  const tmSession = SDK_Globals.tmSession;
134
150
  try {
@@ -513,6 +529,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
513
529
  dcmtsReturned: pairedDocumentsResult.dtdResult.rows.length,
514
530
  dcmtsFound: pairedDocumentsResult.dtdResult.rows.length
515
531
  };
532
+ setPairSearchContext(undefined);
516
533
  setPairedSearchResults([pairedSq]);
517
534
  setIsPairingManyToMany(isPairing);
518
535
  setShowPairDcmtsModal(true);
@@ -554,6 +571,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
554
571
  openPairSearchModal(relation, targetTID, qd);
555
572
  return;
556
573
  }
574
+ setPairSearchContext({ relation, targetTID, qd });
557
575
  setPairedSearchResults([filteredSq]);
558
576
  setIsPairingManyToMany(isPairing);
559
577
  setShowPairDcmtsModal(true);
@@ -628,6 +646,7 @@ export const useRelatedDocuments = ({ selectedSearchResult, focusedItem, current
628
646
  selectedManyToManyRelation,
629
647
  showManyToManyChooser,
630
648
  manyToManyChooserDataSource,
649
+ backToPairSearchModal,
631
650
  showPairSearchModal,
632
651
  pairSearchModalTargetTID,
633
652
  pairSearchModalParentTID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.22.0-dev2.49",
3
+ "version": "6.22.0-dev2.50",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",