@topconsultnpm/sdkui-react 6.19.0-test.1 → 6.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/IconsS4t/add.svg +12 -12
- package/lib/assets/IconsS4t/aggiorna.svg +18 -18
- package/lib/assets/IconsS4t/bookmark.svg +42 -42
- package/lib/assets/IconsS4t/cancella.svg +15 -15
- package/lib/assets/IconsS4t/check-box.svg +19 -19
- package/lib/assets/IconsS4t/down-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/down.svg +28 -28
- package/lib/assets/IconsS4t/edit-file.svg +19 -19
- package/lib/assets/IconsS4t/edita.svg +32 -32
- package/lib/assets/IconsS4t/firma.svg +19 -19
- package/lib/assets/IconsS4t/icona_download.svg +16 -16
- package/lib/assets/IconsS4t/info.svg +51 -51
- package/lib/assets/IconsS4t/left.svg +20 -20
- package/lib/assets/IconsS4t/line.svg +40 -40
- package/lib/assets/IconsS4t/more.svg +19 -19
- package/lib/assets/IconsS4t/plus.svg +23 -23
- package/lib/assets/IconsS4t/printer.svg +49 -49
- package/lib/assets/IconsS4t/radio-on-button.svg +25 -25
- package/lib/assets/IconsS4t/rectangle.svg +41 -41
- package/lib/assets/IconsS4t/redo.svg +19 -19
- package/lib/assets/IconsS4t/right-arrow-signBook-finish.svg +40 -40
- package/lib/assets/IconsS4t/right-arrow-signBook.svg +40 -40
- package/lib/assets/IconsS4t/right.svg +22 -22
- package/lib/assets/IconsS4t/searchbar.svg +21 -21
- package/lib/assets/IconsS4t/text-box.svg +36 -36
- package/lib/assets/IconsS4t/tick.svg +8 -8
- package/lib/assets/IconsS4t/trash-white.svg +10 -10
- package/lib/assets/IconsS4t/undo.svg +19 -19
- package/lib/assets/IconsS4t/up.svg +32 -32
- package/lib/assets/IconsS4t/video-streaming.svg +2 -2
- package/lib/assets/IconsS4t/zoom-in.svg +58 -58
- package/lib/assets/IconsS4t/zoom-out.svg +56 -56
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/six.svg +3 -3
- package/lib/assets/thumbnails/index.ts +39 -39
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/base/Styled.js +302 -302
- package/lib/components/base/TMAccordion.js +43 -43
- package/lib/components/base/TMAccordionNew.d.ts +28 -0
- package/lib/components/base/TMAccordionNew.js +326 -0
- package/lib/components/base/TMAreaManager.js +23 -23
- package/lib/components/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +136 -136
- package/lib/components/base/TMClosableList.js +46 -46
- package/lib/components/base/TMConfirm.js +20 -20
- package/lib/components/base/TMContextMenu.js +4 -4
- package/lib/components/base/TMContextMenuOLD.js +25 -25
- package/lib/components/base/TMCounterBar.js +32 -32
- package/lib/components/base/TMCounterContainer.js +30 -30
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +90 -35
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMDropDownMenu.js +24 -24
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMFileManagerUtils.js +19 -19
- package/lib/components/base/TMFloatingToolbar.js +34 -34
- package/lib/components/base/TMLayout.js +44 -44
- package/lib/components/base/TMList.js +34 -34
- package/lib/components/base/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +79 -34
- package/lib/components/base/TMPanel.js +57 -57
- package/lib/components/base/TMPopUp.js +186 -117
- package/lib/components/base/TMProgressBar.js +20 -20
- package/lib/components/base/TMResizableMenu.js +28 -28
- package/lib/components/base/TMRightSidebar.js +40 -40
- package/lib/components/base/TMSpinner.js +121 -121
- package/lib/components/base/TMTab.js +11 -11
- package/lib/components/base/TMToggleButton.js +36 -36
- package/lib/components/base/TMToolbarCard.js +35 -35
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/base/TMTreeView.js +16 -16
- package/lib/components/base/TMUserAvatar.js +7 -7
- package/lib/components/base/TMWaitPanel.js +30 -24
- package/lib/components/choosers/TMCultureIDPicker.js +35 -35
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.js +54 -54
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.js +5 -4
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +31 -8
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +21 -5
- package/lib/components/editors/TMCheckBox.js +24 -24
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/editors/TMDropDown.js +43 -43
- package/lib/components/editors/TMEditorStyled.js +71 -71
- package/lib/components/editors/TMHtmlContentDisplay.js +16 -16
- package/lib/components/editors/TMLocalizedTextBox.js +31 -31
- package/lib/components/editors/TMMetadataValues.js +71 -22
- package/lib/components/editors/TMRadioButton.js +39 -39
- package/lib/components/editors/TMSummary.js +39 -39
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +56 -22
- package/lib/components/editors/TMTextBox.js +53 -23
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +482 -0
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
- package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +21 -9
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +331 -65
- package/lib/components/features/documents/TMDcmtIcon.js +17 -12
- package/lib/components/features/documents/TMDcmtPreview.js +75 -38
- package/lib/components/features/documents/TMFileUploader.js +21 -21
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +53 -53
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +14 -14
- package/lib/components/features/search/TMSearchQueryPanel.js +41 -59
- package/lib/components/features/search/TMSearchResult.js +256 -51
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.js +134 -0
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +94 -59
- package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
- package/lib/components/features/search/TMSignSettingsForm.js +621 -0
- package/lib/components/features/search/TMTreeSelector.js +67 -67
- package/lib/components/features/search/TMViewHistoryDcmtForm.d.ts +18 -0
- package/lib/components/features/search/TMViewHistoryDcmtForm.js +215 -0
- package/lib/components/features/tasks/TMTaskForm.js +42 -36
- package/lib/components/features/tasks/TMTasksAgenda.js +4 -4
- package/lib/components/features/tasks/TMTasksCalendar.js +2 -2
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -1
- package/lib/components/features/tasks/TMTasksUtils.js +18 -3
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +12 -6
- package/lib/components/features/wg/TMWGsCopyMoveForm.js +9 -9
- package/lib/components/features/workflow/TMWorkflowPopup.js +44 -44
- package/lib/components/features/workflow/diagram/ConnectionComponent.js +29 -29
- package/lib/components/features/workflow/diagram/ConnectionForm.js +10 -10
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +57 -57
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +40 -35
- package/lib/components/features/workflow/diagram/DiagramItemSvgContent.js +12 -12
- package/lib/components/features/workflow/diagram/RecipientList.js +39 -39
- package/lib/components/features/workflow/diagram/WFDiagram.js +317 -285
- package/lib/components/features/workflow/diagram/WorkitemRecipientsEditor.js +4 -4
- package/lib/components/forms/Login/Chooser.js +35 -35
- package/lib/components/forms/Login/Menu.js +22 -22
- package/lib/components/forms/Login/SelectBox.js +46 -46
- package/lib/components/forms/Login/TMLoginForm.js +14 -14
- package/lib/components/forms/Login/TextBox.js +57 -57
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/forms/TMSaveForm.js +3 -11
- package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
- package/lib/components/grids/TMBlogAttachments.js +10 -5
- package/lib/components/grids/TMBlogsPost.d.ts +8 -3
- package/lib/components/grids/TMBlogsPost.js +100 -39
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +32 -11
- package/lib/components/grids/TMRecentsManager.js +52 -52
- package/lib/components/grids/TMValidationItemsList.js +48 -48
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +14 -14
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +36 -35
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQueryEditor.js +17 -17
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +15 -15
- package/lib/components/settings/SettingsAppearance.js +9 -1
- package/lib/components/sidebar/TMCommandsPanel.js +10 -10
- package/lib/components/sidebar/TMHeader.js +307 -307
- package/lib/components/sidebar/TMSidebar.js +24 -24
- package/lib/components/sidebar/TMSidebarItem.js +21 -21
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/components/wizard/TMStepIndicator.js +102 -102
- package/lib/components/wizard/TMWizard.js +29 -29
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +1 -0
- package/lib/helper/Globalization.js +30 -0
- package/lib/helper/SDKUI_Globals.d.ts +9 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +59 -2
- package/lib/helper/SDKUI_Localizator.js +617 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +6 -1
- package/lib/helper/TMIcons.js +22 -2
- package/lib/helper/TMToppyMessage.d.ts +1 -0
- package/lib/helper/TMToppyMessage.js +33 -32
- package/lib/helper/TMUtils.d.ts +42 -4
- package/lib/helper/TMUtils.js +227 -60
- package/lib/helper/cicoHelper.d.ts +31 -0
- package/lib/helper/cicoHelper.js +155 -0
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.d.ts +8 -1
- package/lib/helper/helpers.js +43 -21
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +10 -6
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +3 -1
- package/package.json +54 -54
- package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
- package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
|
-
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, ResultTypes, LayoutCacheService, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
|
-
import { getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare,
|
|
5
|
+
import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMCommandsContextMenu, getExceptionMessage, IconCheck, svgToString, TMImageLibrary } from '../../../helper';
|
|
7
7
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
8
8
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
10
|
-
import { DcmtOperationTypes,
|
|
10
|
+
import { DcmtOperationTypes, SearchResultContext, DownloadTypes } from '../../../ts';
|
|
11
11
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
12
|
-
import { StyledModalContainer,
|
|
12
|
+
import { StyledModalContainer, StyledMultiViewPanel } from '../../base/Styled';
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
15
15
|
import { useDeviceType, DeviceType } from '../../base/TMDeviceProvider';
|
|
16
16
|
import { TMSplitterLayout, TMLayoutItem } from '../../base/TMLayout';
|
|
17
17
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
18
|
-
import TMTooltip from '../../base/TMTooltip';
|
|
19
18
|
import { TMLayoutWaitingContainer } from '../../base/TMWaitPanel';
|
|
20
19
|
import { TMUserIdViewer } from '../../choosers/TMUserChooser';
|
|
21
20
|
import TMMetadataValues from '../../editors/TMMetadataValues';
|
|
22
|
-
import { TMSaveFormButtonPrevious, TMSaveFormButtonNext } from '../../forms/TMSaveForm';
|
|
23
21
|
import TMDataListItemViewer from '../../viewers/TMDataListItemViewer';
|
|
24
22
|
import TMTidViewer from '../../viewers/TMTidViewer';
|
|
25
23
|
import TMDcmtPreview from '../documents/TMDcmtPreview';
|
|
@@ -32,8 +30,7 @@ import TMDcmtBlog from '../documents/TMDcmtBlog';
|
|
|
32
30
|
import TMDcmtIcon from '../documents/TMDcmtIcon';
|
|
33
31
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
34
32
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
35
|
-
import
|
|
36
|
-
import TMAccordion from '../../base/TMAccordion';
|
|
33
|
+
import TMAccordionNew from '../../base/TMAccordionNew';
|
|
37
34
|
import TMDataGridExportForm from '../../base/TMDataGridExportForm';
|
|
38
35
|
import TMSearchResultFloatingActionButton from './TMSearchResultFloatingActionButton';
|
|
39
36
|
import ShowAlert from '../../base/TMAlert';
|
|
@@ -42,6 +39,13 @@ import TMChooserForm from '../../forms/TMChooserForm';
|
|
|
42
39
|
import TMModal from '../../base/TMModal';
|
|
43
40
|
import TMSearch from './TMSearch';
|
|
44
41
|
import TMArchive from '../archive/TMArchive';
|
|
42
|
+
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
43
|
+
import TMCustomButton from '../../base/TMCustomButton';
|
|
44
|
+
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
|
+
import TMSignSettingsForm from './TMSignSettingsForm';
|
|
46
|
+
import { cicoIsEnabled, downloadFilesCallback, updateDcmtCheckoutItem } from '../../../helper/cicoHelper';
|
|
47
|
+
import TMViewHistoryDcmtForm from './TMViewHistoryDcmtForm';
|
|
48
|
+
import TMSearchResultCheckoutInfoForm from './TMSearchResultCheckoutInfoForm';
|
|
45
49
|
//#region Helper Methods
|
|
46
50
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
47
51
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -87,14 +91,18 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
87
91
|
const [sharedDcmtFile, setSharedDcmtFile] = useState(undefined);
|
|
88
92
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
89
93
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
94
|
+
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
90
95
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
91
96
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
92
97
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync } = useDcmtOperations();
|
|
93
98
|
const relatedDocuments = useRelatedDocuments({ selectedSearchResult, focusedItem, currentSearchResults });
|
|
94
99
|
const { relatedDcmts, showRelatedDcmtsChooser, archiveType, isOpenDetails, isOpenMaster, isOpenArchiveRelationForm, archiveRelatedDcmtFormTID, archiveRelatedDcmtFormMids, relatedDcmtsChooserDataSource, showPairDcmtsModal, isPairingManyToMany, pairedSearchResults, manyToManyRelations, selectedManyToManyRelation, showManyToManyChooser, manyToManyChooserDataSource, showPairSearchModal, pairSearchModalTargetTID, pairSearchModalParentTID, pairSearchModalParentDID, pairSearchModalRelation, pairSearchModalInputMids, currentTIDHasDetailRelations, currentTIDHasMasterRelations, canArchiveMasterRelation, canArchiveDetailRelation, hasManyToManyRelation, setIsOpenDetails, setIsOpenMaster, setShowRelatedDcmtsChooser, setShowManyToManyChooser, setShowPairDcmtsModal, setShowPairSearchModal, setIsOpenArchiveRelationForm, setArchiveType, setArchiveRelatedDcmtFormTID, setArchiveRelatedDcmtFormMids, pairFloatingActionConfig, pairSearchModalFloatingActionConfig, archiveMasterDocuments, archiveDetailDocuments, pairManyToMany, checkRelatedDcmtsArchiveCapability, checkManyToManyCapability, archiveRelatedDcmtHandler, executeManyToManyPairing, } = relatedDocuments;
|
|
100
|
+
const [customButtonsLayout, setCustomButtonsLayout] = useState();
|
|
101
|
+
const [customButton, setCustomButton] = useState();
|
|
95
102
|
const deviceType = useDeviceType();
|
|
96
103
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
97
104
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
105
|
+
const allFieldSelectedDocs = useMemo(() => getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem), [selectedItems, focusedItem]);
|
|
98
106
|
// Disable the "Sign/Approve" button if:
|
|
99
107
|
// 1. No document or multiple documents are selected, OR
|
|
100
108
|
// 2. Exactly one document is selected but its FILEEXT property is null
|
|
@@ -105,23 +113,42 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
105
113
|
const [blogsDatasource, setBlogsDatasource] = useState([]);
|
|
106
114
|
const [hasLoadedDataOnce, setHasLoadedDataOnce] = useState(false); //traccia se *qualsiasi* dato è stato caricato per la prima volta
|
|
107
115
|
const [lastLoadedDid, setLastLoadedDid] = useState(undefined); // `lastLoadedDid` tiene traccia dell'ultimo `did` per cui abbiamo caricato i dati
|
|
116
|
+
// State to manage show history selected file
|
|
117
|
+
const [showHistory, setShowHistory] = useState(false);
|
|
118
|
+
const [allUsers, setAllUsers] = useState([]);
|
|
119
|
+
// State to manage show history selected file
|
|
120
|
+
const [showCheckoutInformationForm, setShowCheckoutInformationForm] = useState(false);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
const fetchAllUsers = async () => {
|
|
123
|
+
const users = await UserListCacheService.GetAllAsync();
|
|
124
|
+
setAllUsers(users ?? []);
|
|
125
|
+
};
|
|
126
|
+
fetchAllUsers();
|
|
127
|
+
}, []);
|
|
108
128
|
useEffect(() => { setID(genUniqueId()); }, []);
|
|
109
129
|
useEffect(() => {
|
|
110
130
|
setSelectedItems([]);
|
|
111
|
-
setFocusedItem(undefined);
|
|
112
131
|
setIsOpenBatchUpdate(false);
|
|
113
132
|
setCurrentSearchResults(searchResults);
|
|
114
|
-
if (searchResults.length <= 0)
|
|
133
|
+
if (searchResults.length <= 0) {
|
|
134
|
+
setSelectedSearchResult(undefined);
|
|
115
135
|
return;
|
|
136
|
+
}
|
|
116
137
|
if (searchResults.length === 1) {
|
|
117
138
|
setSelectedSearchResult(searchResults[0]);
|
|
118
139
|
return;
|
|
119
140
|
}
|
|
141
|
+
// Seleziona sempre il primo risultato ordinato, sia su mobile che desktop
|
|
120
142
|
setSelectedSearchResult(orderByName(searchResults)[0]);
|
|
121
143
|
}, [searchResults]);
|
|
122
144
|
useEffect(() => {
|
|
123
|
-
setFocusedItem(undefined);
|
|
124
145
|
setSelectedItems([]);
|
|
146
|
+
// Se non c'è un selectedSearchResult, resetta tutto
|
|
147
|
+
if (!selectedSearchResult) {
|
|
148
|
+
setFocusedItem(undefined);
|
|
149
|
+
setFromDTD(undefined);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
125
152
|
DcmtTypeListCacheService.GetWithNotGrantedAsync(selectedSearchResult?.fromTID, Number(selectedSearchResult?.dtdResult?.rows?.[0]?.[1])).then((dtd) => {
|
|
126
153
|
setFromDTD(dtd);
|
|
127
154
|
});
|
|
@@ -153,8 +180,25 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
153
180
|
fileSize: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileSize)?.value,
|
|
154
181
|
fileExt: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
|
155
182
|
});
|
|
183
|
+
const fetchLayout = async () => {
|
|
184
|
+
if (currentDcmt?.tid && dcmtFormLayoutMode === LayoutModes.Update) {
|
|
185
|
+
const layoutDescriptor = await LayoutCacheService.GetAsync(currentDcmt?.tid, LayoutModes.None);
|
|
186
|
+
setCustomButtonsLayout(layoutDescriptor);
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
fetchLayout();
|
|
156
190
|
}, [currentMetadataValues]);
|
|
157
191
|
const openFormHandler = (layoutMode) => {
|
|
192
|
+
// Verifica che ci sia un documento selezionato con TID e DID validi
|
|
193
|
+
if (!focusedItem || focusedItem.TID === undefined || focusedItem.DID === undefined) {
|
|
194
|
+
ShowAlert({
|
|
195
|
+
message: SDKUI_Localizator.InvalidDcmt,
|
|
196
|
+
mode: "warning",
|
|
197
|
+
title: layoutMode === LayoutModes.Ark ? SDKUI_Localizator.Archive : SDKUI_Localizator.OpenTheDocument,
|
|
198
|
+
duration: 3000
|
|
199
|
+
});
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
158
202
|
setIsOpenDcmtForm(true);
|
|
159
203
|
setDcmtFormLayoutMode(layoutMode);
|
|
160
204
|
};
|
|
@@ -193,7 +237,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
193
237
|
const se = SDK_Globals.tmSession?.NewSearchEngine();
|
|
194
238
|
const sharedDcmts = await se?.GetSharedDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID);
|
|
195
239
|
if (sharedDcmts && sharedDcmts.length > 0) {
|
|
196
|
-
console.log(sharedDcmts);
|
|
197
240
|
setSharedDcmtSearchResults(sharedDcmts);
|
|
198
241
|
}
|
|
199
242
|
else {
|
|
@@ -242,6 +285,18 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
242
285
|
const handleToggleSearch = () => {
|
|
243
286
|
setShowSearch(prev => !prev);
|
|
244
287
|
};
|
|
288
|
+
const openSignSettingsForm = () => {
|
|
289
|
+
setShowSignSettingsForm(true);
|
|
290
|
+
};
|
|
291
|
+
const closeSignSettingsForm = useCallback(() => {
|
|
292
|
+
setShowSignSettingsForm(false);
|
|
293
|
+
}, []);
|
|
294
|
+
const viewHistoryCallback = useCallback(() => {
|
|
295
|
+
setShowHistory(true);
|
|
296
|
+
}, []);
|
|
297
|
+
const showCheckoutInformationFormCallback = useCallback(() => {
|
|
298
|
+
setShowCheckoutInformationForm(true);
|
|
299
|
+
}, []);
|
|
245
300
|
const getTitleHeader = () => {
|
|
246
301
|
let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
|
|
247
302
|
if (title)
|
|
@@ -292,19 +347,99 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
292
347
|
setIsOpenDcmtForm(false);
|
|
293
348
|
}
|
|
294
349
|
else {
|
|
350
|
+
if (isMobile && currentSearchResults.length > 1) {
|
|
351
|
+
setSelectedSearchResult(undefined);
|
|
352
|
+
}
|
|
295
353
|
setSplitterSize(['100%', '0']);
|
|
296
354
|
onClose?.();
|
|
297
355
|
}
|
|
298
356
|
};
|
|
357
|
+
const customButtonMenuItems = () => {
|
|
358
|
+
const customButtonsItems = customButtonsLayout?.customButtons?.filter((customButton) => customButton.isForSearchResult && customButton.isForSearchResult > 0)
|
|
359
|
+
.map((customButton) => ({
|
|
360
|
+
icon: svgToString(TMImageLibrary({ imageID: customButton.glyphID, showPath: true })),
|
|
361
|
+
text: customButton.title || 'Bottone personalizzato',
|
|
362
|
+
onClick: () => setCustomButton(customButton)
|
|
363
|
+
}));
|
|
364
|
+
return {
|
|
365
|
+
icon: svgToString(_jsx(IconCheck, {})),
|
|
366
|
+
text: SDKUI_Localizator.CustomButtons,
|
|
367
|
+
items: customButtonsItems
|
|
368
|
+
};
|
|
369
|
+
};
|
|
299
370
|
const onContextMenuPreparing = (e) => {
|
|
300
371
|
if (e === undefined)
|
|
301
372
|
return;
|
|
302
373
|
if (e.target === 'content') {
|
|
303
374
|
e.items = e.items || [];
|
|
304
|
-
const menuItems = getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
375
|
+
const menuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
305
376
|
e.items.push(...menuItems);
|
|
377
|
+
//disabilitato per ora
|
|
378
|
+
//e.items.push(customButtonMenuItems());
|
|
306
379
|
}
|
|
307
380
|
};
|
|
381
|
+
const handleCheckOutOperationCallback = async (checkout) => {
|
|
382
|
+
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
383
|
+
const firstDoc = selectedDocs?.[0];
|
|
384
|
+
if (!firstDoc)
|
|
385
|
+
return;
|
|
386
|
+
const title = checkout ? 'Check out' : SDKUI_Localizator.CancelCheckOut;
|
|
387
|
+
const msg = checkout ? SDKUI_Localizator.ExecuteCheckOutQuestion : SDKUI_Localizator.ExecuteCancelCheckOutQuestion;
|
|
388
|
+
TMMessageBoxManager.show({
|
|
389
|
+
title: title,
|
|
390
|
+
message: msg,
|
|
391
|
+
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
392
|
+
onButtonClick: async (e) => {
|
|
393
|
+
let result = [];
|
|
394
|
+
if (e !== ButtonNames.YES)
|
|
395
|
+
return;
|
|
396
|
+
try {
|
|
397
|
+
const ue = SDK_Globals.tmSession?.NewUpdateEngineByID();
|
|
398
|
+
if (ue) {
|
|
399
|
+
ue.TID = firstDoc.TID;
|
|
400
|
+
ue.DID = firstDoc.DID;
|
|
401
|
+
if (checkout) {
|
|
402
|
+
await ue.CheckOutAsync()
|
|
403
|
+
.then(async () => {
|
|
404
|
+
const filename = fromDTD?.nameLoc || SDKUI_Localizator.SearchResult;
|
|
405
|
+
await downloadFilesCallback(filename, [firstDoc], true, downloadDcmtsAsync);
|
|
406
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
407
|
+
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
408
|
+
})
|
|
409
|
+
.catch((error) => {
|
|
410
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
411
|
+
throw error;
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
await ue.UndoCheckOutAsync()
|
|
416
|
+
.then(async () => {
|
|
417
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
418
|
+
// Remove the corresponding draft checkout item
|
|
419
|
+
updateDcmtCheckoutItem({
|
|
420
|
+
TID: firstDoc.TID.toString(),
|
|
421
|
+
DID: firstDoc.DID.toString(),
|
|
422
|
+
checkoutFolder: "",
|
|
423
|
+
checkoutName: ""
|
|
424
|
+
}, "remove");
|
|
425
|
+
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
426
|
+
})
|
|
427
|
+
.catch((error) => {
|
|
428
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
429
|
+
throw error;
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
catch (error) {
|
|
435
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
436
|
+
}
|
|
437
|
+
finally {
|
|
438
|
+
TMResultManager.show(result, title, "ID", undefined);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
};
|
|
308
443
|
const refreshDataGridAfterRemoveAsync = async () => {
|
|
309
444
|
let index = selectedSearchResult?.dtdResult?.columns?.findIndex(col => col.caption === 'DID');
|
|
310
445
|
let selectedRows = [];
|
|
@@ -418,6 +553,23 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
418
553
|
}
|
|
419
554
|
}
|
|
420
555
|
}
|
|
556
|
+
// Aggiorna focusedItem e selectedItems con i nuovi dati
|
|
557
|
+
if (focusedItem?.TID === tid && focusedItem?.DID === did) {
|
|
558
|
+
const updatedFocusedItem = searchResultDescriptorToSimpleArray(currentResult)?.find(item => item.TID === tid && item.DID === did);
|
|
559
|
+
if (updatedFocusedItem) {
|
|
560
|
+
setFocusedItem(updatedFocusedItem);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
if (selectedItems.length > 0) {
|
|
564
|
+
const updatedSelectedItems = selectedItems.map(item => {
|
|
565
|
+
if (item.TID === tid && item.DID === did) {
|
|
566
|
+
const updatedItem = searchResultDescriptorToSimpleArray(currentResult)?.find(dataItem => dataItem.TID === tid && dataItem.DID === did);
|
|
567
|
+
return updatedItem || item;
|
|
568
|
+
}
|
|
569
|
+
return item;
|
|
570
|
+
});
|
|
571
|
+
setSelectedItems(updatedSelectedItems);
|
|
572
|
+
}
|
|
421
573
|
if (refreshUI)
|
|
422
574
|
setLastUpdateSearchTime(new Date(Date.now()));
|
|
423
575
|
};
|
|
@@ -466,8 +618,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
466
618
|
}
|
|
467
619
|
};
|
|
468
620
|
const searchResutlToolbar = _jsxs(_Fragment, { children: [(dcmtsReturned != dcmtsFound) && _jsx("p", { style: { backgroundColor: `white`, color: TMColors.primaryColor, textAlign: 'center', padding: '1px 4px', borderRadius: '3px', display: 'flex' }, children: `${dcmtsReturned}/${dcmtsFound} restituiti` }), context === SearchResultContext.FAVORITES_AND_RECENTS &&
|
|
469
|
-
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] });
|
|
470
|
-
const middlePanelToolbar = _jsxs("div", { style: { width: 'max-content', display: 'flex', alignItems: 'center', gap: '10px' }, children: [_jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canPrev: canNavigateHandler('prev'), onPrev: () => onNavigateHandler('prev') }), _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', isModified: false, iconColor: TMColors.default_background, formMode: FormModes.ReadOnly, canNext: canNavigateHandler('next'), onNext: () => onNavigateHandler('next') })] });
|
|
621
|
+
_jsx("div", { style: { display: 'flex', alignItems: 'center', gap: '5px' }, children: _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconDelete, { color: 'white' }), caption: "Rimuovi da " + (selectedSearchResult?.category === "Favorites" ? '"Preferiti"' : '"Recenti"'), disabled: getSelectedDcmtsOrFocused(selectedItems, focusedItem).length <= 0, onClick: removeDcmtFromFavsOrRecents }) }), _jsx(TMButton, { btnStyle: 'icon', icon: _jsx(IconRefresh, { color: 'white' }), caption: SDKUI_Localizator.Refresh, onClick: onRefreshSearchAsync }), _jsx(IconMenuVertical, { id: `commands-header-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-header-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) /*.concat([customButtonMenuItems()])*/ })] });
|
|
471
622
|
const handleAddItem = (tid, did) => {
|
|
472
623
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
473
624
|
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
@@ -491,32 +642,34 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
491
642
|
TMSpinner.hide();
|
|
492
643
|
}
|
|
493
644
|
}, []);
|
|
645
|
+
const handleSavedAsyncCallback = useCallback(async (tid, did, metadataResult) => {
|
|
646
|
+
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
647
|
+
}, []);
|
|
494
648
|
const showToppyForApprove = (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster);
|
|
495
649
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
496
650
|
? _jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), _jsx("div", { style: { fontSize: "15px", marginTop: "10px" }, children: SDKUI_Localizator.NoDcmtFound }), openAddDocumentForm && _jsx("div", { style: { marginTop: "10px" }, children: _jsx(TMButton, { fontSize: "15px", icon: _jsx("i", { className: 'dx-icon-share' }), caption: SDKUI_Localizator.Share, onClick: openAddDocumentForm }) })] })
|
|
497
651
|
:
|
|
498
652
|
_jsxs(_Fragment, { children: [_jsxs(TMLayoutItem, { height: '100%', children: [_jsxs(TMSplitterLayout, { direction: 'horizontal', overflow: 'visible', separatorSize: Gutters.getGutters(), separatorActiveColor: 'transparent', separatorColor: 'transparent', min: ['0', '0'], showSeparator: showSelector && deviceType !== DeviceType.MOBILE, start: showSelector ? deviceType !== DeviceType.MOBILE ? ['30%', '70%'] : splitterSize : ['0%', '100%'], children: [showSelector ?
|
|
499
|
-
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
653
|
+
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, selectedSearchResult: selectedSearchResult, autoSelectFirst: !isMobile || currentSearchResults.length === 1, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
500
654
|
:
|
|
501
|
-
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { showSearch: showSearch, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, openInOffice: openInOffice, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
502
|
-
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-floating-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
655
|
+
_jsx(_Fragment, {}), _jsxs(TMLayoutItem, { children: [_jsx(TMSearchResultGrid, { showSearch: showSearch, fromDTD: fromDTD, allUsers: allUsers, inputFocusedItem: focusedItem, inputSelectedItems: selectedItems, searchResult: searchResults.length > 1 ? selectedSearchResult : searchResults[0], lastUpdateSearchTime: lastUpdateSearchTime, openInOffice: openInOffice, onDblClick: () => openFormHandler(LayoutModes.Update), onContextMenuPreparing: onContextMenuPreparing, onSelectionChanged: (items) => { setSelectedItems(items); }, onVisibleItemChanged: setVisibleItems, onFocusedItemChanged: setFocusedItem, onDownloadDcmtsAsync: async (inputDcmts, downloadType, downloadMode, _y, confirmAttachments) => await downloadDcmtsAsync(inputDcmts, downloadType, downloadMode, onFileOpened, confirmAttachments), showExportForm: showExportForm, onCloseExportForm: onCloseExportForm }), allowFloatingBar && showFloatingBar && deviceType !== DeviceType.MOBILE &&
|
|
656
|
+
_jsxs(TMFloatingToolbar, { backgroundColor: TMColors.primaryColor, initialLeft: '10px', initialTop: 'calc(100% - 75px)', children: [fromDTD?.perm?.canRetrieveFile === AccessLevels.Yes && _jsx(TMButton, { btnStyle: 'icon', caption: "Download file", disabled: fromDTD?.perm?.canRetrieveFile !== AccessLevels.Yes || !focusedItem?.DID, icon: _jsx(IconDownload, { color: 'white' }), onClick: () => { downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download"); } }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasDetailRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white' }), caption: SDKUI_Localizator.DcmtsDetail, onClick: () => setIsOpenDetails(true) }), allowRelations && _jsx(TMButton, { btnStyle: 'icon', disabled: !currentTIDHasMasterRelations || !focusedItem?.DID, icon: _jsx(IconDetailDcmts, { color: 'white', transform: 'scale(-1, 1)' }), caption: SDKUI_Localizator.DcmtsMaster, onClick: () => setIsOpenMaster(true) }), _jsx(IconMenuVertical, { id: `commands-floating-${id}`, color: 'white', cursor: 'pointer' }), _jsx(TMCommandsContextMenu, { target: `#commands-floating-${id}`, showEvent: "click", menuItems: getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) /*.concat([customButtonMenuItems()])*/ })] })] })] }), showApprovePopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 0, onClose: () => setShowApprovePopup(false) }), showRejectPopup && _jsx(WorkFlowApproveRejectPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), isReject: 1, onClose: () => setShowRejectPopup(false) }), showReAssignPopup && _jsx(WorkFlowReAssignPopUp, { deviceType: deviceType, onCompleted: onWFOperationCompleted, selectedItems: getSelectedDcmtsOrFocused(selectedItems, focusedItem), onClose: () => setShowReAssignPopup(false) }), showMoreInfoPopup && _jsx(WorkFlowMoreInfoPopUp, { TID: focusedItem?.TID, DID: focusedItem?.DID, deviceType: deviceType, onCompleted: onWFOperationCompleted, onClose: () => setShowMoreInfoPopup(false) }), isOpenBatchUpdate && _jsx(TMBatchUpdateForm, { isModal: true, titleModal: `${SDKUI_Localizator.BatchUpdate} (${getSelectionDcmtInfo().length} documenti selezionati)`, inputDcmts: getSelectionDcmtInfo(), TID: focusedItem ? focusedItem?.TID : selectedItems[0]?.TID, DID: focusedItem ? focusedItem?.DID : selectedItems[0]?.DID, onBack: () => {
|
|
503
657
|
setIsOpenBatchUpdate(false);
|
|
504
658
|
}, onSavedCallbackAsync: async () => {
|
|
505
659
|
setIsOpenBatchUpdate(false);
|
|
506
660
|
setIsModifiedBatchUpdate(false);
|
|
507
661
|
await refreshSelectionDataRowsAsync();
|
|
508
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm)
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}, approveDisable: selectedDocs.length === 0, signApproveDisable: disableSignApproveDisable, rejectDisable: selectedDocs.length === 0, reassignDisable: selectedDocs.length === 0, infoDisable: selectedDocs.length !== 1, dtd: fromDTD }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), showRelatedDcmtsChooser &&
|
|
662
|
+
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), _jsx(ToppyDraggableHelpCenter, { initialIsCollapsed: false, deviceType: deviceType, usePortal: true, isVisible: showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm, content: _jsx("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: _jsx(WorkFlowOperationButtons, { deviceType: deviceType, onApprove: () => {
|
|
663
|
+
setShowApprovePopup(true);
|
|
664
|
+
}, onSignApprove: () => {
|
|
665
|
+
handleSignApprove();
|
|
666
|
+
}, onReject: () => {
|
|
667
|
+
setShowRejectPopup(true);
|
|
668
|
+
}, onReAssign: () => {
|
|
669
|
+
setShowReAssignPopup(true);
|
|
670
|
+
}, onMoreInfo: () => {
|
|
671
|
+
setShowMoreInfoPopup(true);
|
|
672
|
+
}, approveDisable: selectedDocs.length === 0, signApproveDisable: disableSignApproveDisable, rejectDisable: selectedDocs.length === 0, reassignDisable: selectedDocs.length === 0, infoDisable: selectedDocs.length !== 1, dtd: fromDTD }) }) })] }), _jsx(ConfirmFormatDialog, {}), _jsx(ConfirmAttachmentsDialog, {}), customButton && _jsx(TMCustomButton, { button: customButton, formData: currentMetadataValues, selectedItems: selectedItems, onClose: () => setCustomButton(undefined) }), showRelatedDcmtsChooser &&
|
|
520
673
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
521
674
|
try {
|
|
522
675
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -558,7 +711,8 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
558
711
|
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), sharedDcmtSearchResults.length > 0 &&
|
|
559
712
|
_jsx(TMModal, { title: "Documenti condivisi", onClose: () => {
|
|
560
713
|
setSharedDcmtSearchResults([]);
|
|
561
|
-
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, showBackButton:
|
|
714
|
+
}, width: isMobile ? '90%' : '60%', height: isMobile ? '90%' : '80%', children: _jsx(TMSearchResult, { searchResults: sharedDcmtSearchResults, allowFloatingBar: false, showSelector: true, disableAccordionIfSingleCategory: true, showBackButton: isMobile, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), (showCheckoutInformationForm && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) &&
|
|
715
|
+
_jsx(TMSearchResultCheckoutInfoForm, { dtdName: fromDTD.name ?? SDKUI_Localizator.SearchResult, selectedDcmtOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: () => setShowCheckoutInformationForm(false) }), (floatingActionConfig && floatingActionConfig.isVisible) && _jsx(TMSearchResultFloatingActionButton, { selectedDcmtsOrFocused: getSelectedDcmtsOrFocused(selectedItems, focusedItem), config: floatingActionConfig })] }), [
|
|
562
716
|
searchResults,
|
|
563
717
|
selectedSearchResult,
|
|
564
718
|
lastUpdateSearchTime,
|
|
@@ -676,9 +830,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
676
830
|
:
|
|
677
831
|
_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) => {
|
|
678
832
|
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}`));
|
|
679
|
-
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _jsx(TMDcmtForm, { isModal: openDcmtFormAsModal || (dcmtFormLayoutMode === LayoutModes.Ark && focusedItem?.DID), titleModal: fromDTD?.name ?? '', TID: focusedItem
|
|
680
|
-
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
681
|
-
}, onOpenS4TViewerRequest: onOpenS4TViewerRequest, onReferenceClick: onReferenceClick, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }), 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: () => {
|
|
833
|
+
})] }), _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 }) }), 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: () => {
|
|
682
834
|
setIsOpenArchiveRelationForm(false);
|
|
683
835
|
setArchiveType(undefined);
|
|
684
836
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -689,11 +841,13 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
689
841
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
690
842
|
setArchiveRelatedDcmtFormMids([]);
|
|
691
843
|
await onRefreshSearchAsync?.();
|
|
692
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
|
|
844
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showSignSettingsForm && fromDTD) && _jsx(TMSignSettingsForm, { fromDTD: fromDTD, inputDcmts: allFieldSelectedDocs, onCloseSignSettingsForm: closeSignSettingsForm, onSavedAsyncCallback: handleSavedAsyncCallback }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmtForm, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: () => setShowHistory(false), allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
|
|
693
845
|
};
|
|
694
846
|
export default TMSearchResult;
|
|
695
|
-
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) =>
|
|
696
|
-
|
|
847
|
+
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => {
|
|
848
|
+
return _jsx(TMDcmtIcon, { tid: cellData.data.TID, did: cellData.data.DID, fileExtension: cellData.data.FILEEXT, fileCount: cellData.data.FILECOUNT, isLexProt: cellData.data.IsLexProt, isMail: cellData.data.ISMAIL, isShared: cellData.data.ISSHARED, isSigned: cellData.data.ISSIGNED, downloadMode: 'openInNewWindow', onDownloadDcmtsAsync: onDownloadDcmtsAsync, openInOffice: openInOffice });
|
|
849
|
+
};
|
|
850
|
+
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, onContextMenuPreparing, onSelectionChanged, onDblClick }) => {
|
|
697
851
|
const [dataSource, setDataSource] = useState();
|
|
698
852
|
const [columns, setColumns] = useState([]);
|
|
699
853
|
// State to store selected row keys
|
|
@@ -773,12 +927,20 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
773
927
|
return null;
|
|
774
928
|
const isLogDel = cellData.data.ISLOGDEL == 1;
|
|
775
929
|
const isLexProt = cellData.data.IsLexProt == 1;
|
|
930
|
+
// Prima colonna: la colonna numero 2 (dopo icona e selezione)
|
|
931
|
+
const isFirstColumn = cellData.columnIndex === 2;
|
|
932
|
+
const { checkoutStatus } = cicoIsEnabled(cellData.data, allUsers, fromDTD);
|
|
933
|
+
const shouldShowCheckoutIcon = isFirstColumn && checkoutStatus.isCheckedOut && checkoutStatus.icon;
|
|
776
934
|
let style = {};
|
|
777
935
|
if (isLogDel) {
|
|
778
936
|
style = { color: 'gray', textDecoration: 'line-through' };
|
|
779
937
|
}
|
|
780
|
-
else if (isLexProt)
|
|
938
|
+
else if (isLexProt) {
|
|
781
939
|
style = { color: 'blue' };
|
|
940
|
+
}
|
|
941
|
+
if (shouldShowCheckoutIcon) {
|
|
942
|
+
style = { ...style, display: 'flex', gap: '4px', whiteSpace: 'nowrap' };
|
|
943
|
+
}
|
|
782
944
|
let child = _jsx("div", { children: cellData.text });
|
|
783
945
|
if (dataDomain === MetadataDataDomains.DataList) {
|
|
784
946
|
child = _jsx(TMDataListItemViewer, { dataListId: dataListID, viewMode: dataListViewMode, value: cellData.value });
|
|
@@ -786,8 +948,8 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
786
948
|
if (dataDomain === MetadataDataDomains.UserID) {
|
|
787
949
|
child = _jsx(TMUserIdViewer, { userId: cellData.value, showIcon: true, noneSelectionText: '' });
|
|
788
950
|
}
|
|
789
|
-
return
|
|
790
|
-
}, []);
|
|
951
|
+
return (_jsxs("div", { style: style, children: [shouldShowCheckoutIcon && checkoutStatus.icon, child] }));
|
|
952
|
+
}, [fromDTD, allUsers]);
|
|
791
953
|
const dataType = useCallback((col) => {
|
|
792
954
|
switch (col.dataType) {
|
|
793
955
|
case DataColumnTypes.DateTime: return "datetime";
|
|
@@ -838,16 +1000,19 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
838
1000
|
return undefined;
|
|
839
1001
|
}, []);
|
|
840
1002
|
useEffect(() => {
|
|
1003
|
+
if (fromDTD === undefined || searchResult === undefined)
|
|
1004
|
+
return;
|
|
841
1005
|
setFocusedItem(undefined); // resetta sempre prima
|
|
842
1006
|
let cols = [];
|
|
1007
|
+
// Generate unique keys for all columns
|
|
1008
|
+
const uniqueKeys = generateUniqueColumnKeys(searchResult?.dtdResult?.columns, searchResult?.fromTID);
|
|
843
1009
|
searchResult?.dtdResult?.columns?.map((col, index) => {
|
|
844
|
-
let keyField = getDataColumnName(searchResult?.fromTID, col);
|
|
845
1010
|
const isVisible = col.extendedProperties?.["Visibility"] != "Hidden";
|
|
846
1011
|
const dataDomain = MetadataDataDomains[(col.extendedProperties?.["DataDomain"] ?? "None")];
|
|
847
1012
|
const dataListID = Number(col.extendedProperties?.["DataListID"]);
|
|
848
1013
|
const dataListViewMode = DataListViewModes[(col.extendedProperties?.["DataListViewMode"] ?? "None")];
|
|
849
1014
|
cols.push({
|
|
850
|
-
dataField:
|
|
1015
|
+
dataField: uniqueKeys[index],
|
|
851
1016
|
dataType: dataType(col),
|
|
852
1017
|
visible: isVisible,
|
|
853
1018
|
cellRender: (cellData) => cellRender(cellData, dataDomain, dataListID, dataListViewMode),
|
|
@@ -859,7 +1024,7 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
859
1024
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
860
1025
|
setDataSource(newDataSource);
|
|
861
1026
|
// setFocusedItem(newDataSource && newDataSource.length > 0 ? newDataSource[0] : undefined);
|
|
862
|
-
}, [searchResult]);
|
|
1027
|
+
}, [searchResult, fromDTD, allUsers]);
|
|
863
1028
|
useEffect(() => {
|
|
864
1029
|
let newDataSource = searchResultDescriptorToSimpleArray(searchResult);
|
|
865
1030
|
setDataSource(newDataSource);
|
|
@@ -892,6 +1057,16 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
892
1057
|
// Era sull'icona, non fare nulla
|
|
893
1058
|
return;
|
|
894
1059
|
}
|
|
1060
|
+
// Verifica che il documento abbia TID e DID validi prima di procedere
|
|
1061
|
+
if (!e.data.TID || !e.data.DID) {
|
|
1062
|
+
ShowAlert({
|
|
1063
|
+
message: SDKUI_Localizator.InvalidDcmt,
|
|
1064
|
+
mode: "warning",
|
|
1065
|
+
title: SDKUI_Localizator.OpenForm,
|
|
1066
|
+
duration: 3000
|
|
1067
|
+
});
|
|
1068
|
+
return;
|
|
1069
|
+
}
|
|
895
1070
|
// setFocusedItem(e.data);
|
|
896
1071
|
onFocusedItemChanged?.(e.data);
|
|
897
1072
|
onDblClick();
|
|
@@ -906,7 +1081,7 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
906
1081
|
width: 50,
|
|
907
1082
|
cellRender: (cellData) => renderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
908
1083
|
allowResizing: false,
|
|
909
|
-
filterOperations: ['=']
|
|
1084
|
+
filterOperations: ['=', "anyof"]
|
|
910
1085
|
},
|
|
911
1086
|
...columns.filter(col => col.dataField !== 'FILEEXT')
|
|
912
1087
|
];
|
|
@@ -923,12 +1098,12 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
923
1098
|
return _jsxs("div", { style: { width: "100%", height: "100%" }, children: [_jsx(TMDataGrid, { id: "tm-search-result", keyExpr: "rowIndex", dataColumns: dataColumns, dataSource: dataSource, repaintChangesOnly: true, selectedRowKeys: selectedRowKeys, focusedRowKey: Number(focusedItem?.rowIndex ?? 0), showSearchPanel: showSearch, showFilterPanel: true, sorting: { mode: "multiple" }, selection: { mode: allowMultipleSelection ? 'multiple' : 'single' }, pageSize: TMDataGridPageSize.Small, onSelectionChanged: handleSelectionChange, onFocusedRowChanged: handleFocusedRowChange, onRowDblClick: onRowDblClick, onContentReady: onContentReady, onContextMenuPreparing: onContextMenuPreparing, onKeyDown: onKeyDown, counterConfig: { show: true } }), (showExportForm && searchResult && onCloseExportForm) && _jsx(TMDataGridExportForm, { dataColumns: dataColumns, dataSource: dataSource, selectedRowKeys: selectedRowKeys, onCloseExportForm: onCloseExportForm, searchResult: searchResult })] });
|
|
924
1099
|
};
|
|
925
1100
|
//#region TMSearchResultSelector
|
|
926
|
-
const StyledItemTemplate = styled.div `
|
|
927
|
-
background: ${(props) => props.$isSelected ? 'oklch(from var(--dx-color-primary) l c h / .2) !important' : 'transparent'};
|
|
928
|
-
cursor: pointer;
|
|
1101
|
+
const StyledItemTemplate = styled.div `
|
|
1102
|
+
background: ${(props) => props.$isSelected ? 'oklch(from var(--dx-color-primary) l c h / .2) !important' : 'transparent'};
|
|
1103
|
+
cursor: pointer;
|
|
929
1104
|
`;
|
|
930
1105
|
const MemoizedStyledItemTemplate = React.memo(StyledItemTemplate);
|
|
931
|
-
const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCategory = false, selectedTID, onSelectionChanged }) => {
|
|
1106
|
+
const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCategory = false, selectedTID, selectedSearchResult, autoSelectFirst = true, onSelectionChanged }) => {
|
|
932
1107
|
const [selectedResult, setSelectedResult] = useState(undefined);
|
|
933
1108
|
/** Group results by category */
|
|
934
1109
|
const groupedResults = useMemo(() => {
|
|
@@ -952,7 +1127,19 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
952
1127
|
sortedCategories.forEach((category) => {
|
|
953
1128
|
groupedResults[category].sort((a, b) => (a.fromName ?? '').localeCompare(b.fromName ?? ''));
|
|
954
1129
|
});
|
|
1130
|
+
// Reset internal selection when parent sets selectedSearchResult to undefined
|
|
1131
|
+
// (this happens on mobile when clicking back to return to the list)
|
|
1132
|
+
useEffect(() => {
|
|
1133
|
+
if (selectedSearchResult === undefined) {
|
|
1134
|
+
setSelectedResult(undefined);
|
|
1135
|
+
}
|
|
1136
|
+
}, [selectedSearchResult]);
|
|
1137
|
+
// Auto-seleziona il primo risultato di ricerca solo se autoSelectFirst è true.
|
|
1138
|
+
// Su mobile con più risultati, autoSelectFirst è false per permettere all'utente
|
|
1139
|
+
// di vedere prima la lista dei tipi documento e scegliere manualmente.
|
|
955
1140
|
useEffect(() => {
|
|
1141
|
+
if (!autoSelectFirst)
|
|
1142
|
+
return;
|
|
956
1143
|
if (sortedCategories.length > 0) {
|
|
957
1144
|
const firstCategory = sortedCategories[0];
|
|
958
1145
|
if (groupedResults[firstCategory].length > 0) {
|
|
@@ -960,7 +1147,7 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
960
1147
|
onSelectionChanged?.(groupedResults[firstCategory][0]);
|
|
961
1148
|
}
|
|
962
1149
|
}
|
|
963
|
-
}, [sortedCategories.length]);
|
|
1150
|
+
}, [sortedCategories.length, autoSelectFirst]);
|
|
964
1151
|
useEffect(() => {
|
|
965
1152
|
if (selectedTID !== undefined) {
|
|
966
1153
|
const found = searchResults.find(r => Number(r.fromTID) === selectedTID);
|
|
@@ -995,12 +1182,30 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
995
1182
|
}
|
|
996
1183
|
};
|
|
997
1184
|
const renderItemTemplate = useCallback((data) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, did: Number(data.dtdResult?.rows?.[0]?.[1]), showIcon: true, color: TMColors.primary }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: data.dcmtsReturned })] })), []);
|
|
1185
|
+
const accordionGroups = useMemo(() => sortedCategories.map((category, index) => ({
|
|
1186
|
+
id: category,
|
|
1187
|
+
title: getHeaderTitle(category),
|
|
1188
|
+
dataSource: groupedResults[category],
|
|
1189
|
+
isExpanded: index === 0,
|
|
1190
|
+
badges: [
|
|
1191
|
+
{
|
|
1192
|
+
badge: searchResults.length > 1 ? searchResults?.filter(data => data.category === category || (data?.category === undefined && category === "Uncategorized")).length : 0,
|
|
1193
|
+
tooltip: 'Numero di tipi documento'
|
|
1194
|
+
},
|
|
1195
|
+
{
|
|
1196
|
+
badge: resultDcmtCounter(category),
|
|
1197
|
+
tooltip: 'Numero di tutti documenti'
|
|
1198
|
+
}
|
|
1199
|
+
],
|
|
1200
|
+
renderItem: (result, isSelected) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: result.fromTID, did: Number(result.dtdResult?.rows?.[0]?.[1]), showIcon: true, color: TMColors.primary }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: result.dcmtsReturned })] })),
|
|
1201
|
+
itemHeight: 40
|
|
1202
|
+
})), [sortedCategories, groupedResults, searchResults]);
|
|
998
1203
|
const renderCategoryItems = (category) => (_jsx("div", { style: { padding: '5px' }, children: groupedResults[category].map((result, index) => (_jsx(MemoizedStyledItemTemplate, { "$isSelected": selectedResult === result, onClick: () => handleSelect(result), children: renderItemTemplate(result) }, index))) }));
|
|
999
1204
|
if (disableAccordionIfSingleCategory && sortedCategories.length === 1) {
|
|
1000
1205
|
const category = sortedCategories[0];
|
|
1001
1206
|
return renderCategoryItems(category);
|
|
1002
1207
|
}
|
|
1003
|
-
return (_jsx(
|
|
1208
|
+
return (_jsx(TMAccordionNew, { groups: accordionGroups, selectedItem: selectedResult, onSelectedItemChange: (result) => handleSelect(result) }));
|
|
1004
1209
|
};
|
|
1005
1210
|
//#endregion TMSearchResultSelector
|
|
1006
1211
|
const TMDcmtPreviewWrapper = ({ currentDcmt, isVisible }) => {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DcmtInfo } from "../../../ts";
|
|
2
|
+
interface TMSearchResultCheckoutInfoFormProps {
|
|
3
|
+
dtdName: string;
|
|
4
|
+
selectedDcmtOrFocused: DcmtInfo;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
}
|
|
7
|
+
declare const TMSearchResultCheckoutInfoForm: (props: TMSearchResultCheckoutInfoFormProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default TMSearchResultCheckoutInfoForm;
|