@topconsultnpm/sdkui-react 6.19.0-dev2.9 → 6.19.0-test2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/base/TMAccordionNew.d.ts +28 -0
- package/lib/components/base/TMAccordionNew.js +326 -0
- package/lib/components/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +6 -6
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +83 -28
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMFileManager.js +11 -2
- 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/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +48 -3
- package/lib/components/base/TMPopUp.js +74 -5
- package/lib/components/base/TMWaitPanel.js +8 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- 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/TMMetadataValues.js +45 -4
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +44 -10
- package/lib/components/editors/TMTextBox.js +34 -4
- 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 +471 -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 +18 -6
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +290 -31
- package/lib/components/features/documents/TMDcmtIcon.js +9 -4
- package/lib/components/features/documents/TMDcmtPreview.js +45 -8
- package/lib/components/features/documents/TMRelationViewer.js +55 -22
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +10 -28
- package/lib/components/features/search/TMSearchResult.js +102 -33
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +67 -28
- package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
- package/lib/components/features/search/TMSignSettingsForm.js +621 -0
- package/lib/components/features/tasks/TMTaskForm.js +10 -4
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +1 -0
- package/lib/components/features/tasks/TMTasksUtils.js +17 -2
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +11 -5
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
- package/lib/components/features/workflow/diagram/WFDiagram.js +19 -1
- 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 +27 -6
- 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 +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/settings/SettingsAppearance.js +5 -5
- 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_Localizator.d.ts +41 -1
- package/lib/helper/SDKUI_Localizator.js +410 -10
- package/lib/helper/TMIcons.d.ts +4 -1
- package/lib/helper/TMIcons.js +13 -1
- package/lib/helper/TMToppyMessage.d.ts +1 -0
- package/lib/helper/TMToppyMessage.js +4 -3
- package/lib/helper/TMUtils.d.ts +42 -4
- package/lib/helper/TMUtils.js +190 -23
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +12 -17
- 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 +2 -0
- package/package.json +8 -8
- 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, ResultTypes } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, TemplateTIDs, DcmtTypeListCacheService, AccessLevels, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, ResultTypes, LayoutCacheService } 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, getDataColumnName, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMCommandsContextMenu, getExceptionMessage } from '../../../helper';
|
|
5
|
+
import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, IconDetailDcmts, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, IconDownload, deepCompare, getDataColumnName, 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';
|
|
@@ -43,6 +40,9 @@ import TMModal from '../../base/TMModal';
|
|
|
43
40
|
import TMSearch from './TMSearch';
|
|
44
41
|
import TMArchive from '../archive/TMArchive';
|
|
45
42
|
import { TMResultManager } from '../../forms/TMResultDialog';
|
|
43
|
+
import TMCustomButton from '../../base/TMCustomButton';
|
|
44
|
+
import ToppyDraggableHelpCenter from '../assistant/ToppyDraggableHelpCenter';
|
|
45
|
+
import TMSignSettingsForm from './TMSignSettingsForm';
|
|
46
46
|
//#region Helper Methods
|
|
47
47
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
48
48
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -88,14 +88,18 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
88
88
|
const [sharedDcmtFile, setSharedDcmtFile] = useState(undefined);
|
|
89
89
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
90
90
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
91
|
+
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
91
92
|
const [confirmFormat, ConfirmFormatDialog] = useInputCvtFormatDialog();
|
|
92
93
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
93
94
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync, runOperationAsync, getDcmtFileAsync } = useDcmtOperations();
|
|
94
95
|
const relatedDocuments = useRelatedDocuments({ selectedSearchResult, focusedItem, currentSearchResults });
|
|
95
96
|
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;
|
|
97
|
+
const [customButtonsLayout, setCustomButtonsLayout] = useState();
|
|
98
|
+
const [customButton, setCustomButton] = useState();
|
|
96
99
|
const deviceType = useDeviceType();
|
|
97
100
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
98
101
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
102
|
+
const allFieldSelectedDocs = useMemo(() => getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem), [selectedItems, focusedItem]);
|
|
99
103
|
// Disable the "Sign/Approve" button if:
|
|
100
104
|
// 1. No document or multiple documents are selected, OR
|
|
101
105
|
// 2. Exactly one document is selected but its FILEEXT property is null
|
|
@@ -154,6 +158,13 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
154
158
|
fileSize: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileSize)?.value,
|
|
155
159
|
fileExt: currentMetadataValues.find(o => o.mid == SystemMIDsAsNumber.FileExt)?.value
|
|
156
160
|
});
|
|
161
|
+
const fetchLayout = async () => {
|
|
162
|
+
if (currentDcmt?.tid && dcmtFormLayoutMode === LayoutModes.Update) {
|
|
163
|
+
const layoutDescriptor = await LayoutCacheService.GetAsync(currentDcmt?.tid, LayoutModes.None);
|
|
164
|
+
setCustomButtonsLayout(layoutDescriptor);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
fetchLayout();
|
|
157
168
|
}, [currentMetadataValues]);
|
|
158
169
|
const openFormHandler = (layoutMode) => {
|
|
159
170
|
setIsOpenDcmtForm(true);
|
|
@@ -243,6 +254,12 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
243
254
|
const handleToggleSearch = () => {
|
|
244
255
|
setShowSearch(prev => !prev);
|
|
245
256
|
};
|
|
257
|
+
const openSignSettingsForm = () => {
|
|
258
|
+
setShowSignSettingsForm(true);
|
|
259
|
+
};
|
|
260
|
+
const closeSignSettingsForm = useCallback(() => {
|
|
261
|
+
setShowSignSettingsForm(false);
|
|
262
|
+
}, []);
|
|
246
263
|
const getTitleHeader = () => {
|
|
247
264
|
let counters = (showSelector && disableAccordionIfSingleCategory && searchResults.length > 1) ? getSearchResultCountersSingleCategory(searchResults) : "";
|
|
248
265
|
if (title)
|
|
@@ -297,13 +314,28 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
297
314
|
onClose?.();
|
|
298
315
|
}
|
|
299
316
|
};
|
|
317
|
+
const customButtonMenuItems = () => {
|
|
318
|
+
const customButtonsItems = customButtonsLayout?.customButtons?.filter((customButton) => customButton.isForSearchResult && customButton.isForSearchResult > 0)
|
|
319
|
+
.map((customButton) => ({
|
|
320
|
+
icon: svgToString(TMImageLibrary({ imageID: customButton.glyphID, showPath: true })),
|
|
321
|
+
text: customButton.title || 'Bottone personalizzato',
|
|
322
|
+
onClick: () => setCustomButton(customButton)
|
|
323
|
+
}));
|
|
324
|
+
return {
|
|
325
|
+
icon: svgToString(_jsx(IconCheck, {})),
|
|
326
|
+
text: SDKUI_Localizator.CustomButtons,
|
|
327
|
+
items: customButtonsItems
|
|
328
|
+
};
|
|
329
|
+
};
|
|
300
330
|
const onContextMenuPreparing = (e) => {
|
|
301
331
|
if (e === undefined)
|
|
302
332
|
return;
|
|
303
333
|
if (e.target === 'content') {
|
|
304
334
|
e.items = e.items || [];
|
|
305
|
-
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, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
335
|
+
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, openSignSettingsForm, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation);
|
|
306
336
|
e.items.push(...menuItems);
|
|
337
|
+
//disabilitato per ora
|
|
338
|
+
//e.items.push(customButtonMenuItems());
|
|
307
339
|
}
|
|
308
340
|
};
|
|
309
341
|
const handleCheckOutOperationCallback = async (checkout) => {
|
|
@@ -331,7 +363,8 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
331
363
|
.then(async () => {
|
|
332
364
|
await downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download");
|
|
333
365
|
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
334
|
-
await refreshSelectionDataRowsAsync();
|
|
366
|
+
// await refreshSelectionDataRowsAsync();
|
|
367
|
+
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
335
368
|
})
|
|
336
369
|
.catch((error) => {
|
|
337
370
|
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
@@ -341,7 +374,9 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
341
374
|
else {
|
|
342
375
|
await ue.UndoCheckOutAsync()
|
|
343
376
|
.then(async () => {
|
|
344
|
-
|
|
377
|
+
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, description: SDKUI_Localizator.UpdateCompletedSuccessfully, resultType: ResultTypes.SUCCESS });
|
|
378
|
+
// await refreshSelectionDataRowsAsync();
|
|
379
|
+
await refreshFocusedDataRowAsync(firstDoc.TID, firstDoc.DID, true);
|
|
345
380
|
})
|
|
346
381
|
.catch((error) => {
|
|
347
382
|
result.push({ rowIndex: 0, id1: firstDoc.TID, id2: firstDoc.DID, resultType: ResultTypes.ERROR, description: getExceptionMessage(error) });
|
|
@@ -472,6 +507,23 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
472
507
|
}
|
|
473
508
|
}
|
|
474
509
|
}
|
|
510
|
+
// Aggiorna focusedItem e selectedItems con i nuovi dati
|
|
511
|
+
if (focusedItem?.TID === tid && focusedItem?.DID === did) {
|
|
512
|
+
const updatedFocusedItem = searchResultDescriptorToSimpleArray(currentResult)?.find(item => item.TID === tid && item.DID === did);
|
|
513
|
+
if (updatedFocusedItem) {
|
|
514
|
+
setFocusedItem(updatedFocusedItem);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
if (selectedItems.length > 0) {
|
|
518
|
+
const updatedSelectedItems = selectedItems.map(item => {
|
|
519
|
+
if (item.TID === tid && item.DID === did) {
|
|
520
|
+
const updatedItem = searchResultDescriptorToSimpleArray(currentResult)?.find(dataItem => dataItem.TID === tid && dataItem.DID === did);
|
|
521
|
+
return updatedItem || item;
|
|
522
|
+
}
|
|
523
|
+
return item;
|
|
524
|
+
});
|
|
525
|
+
setSelectedItems(updatedSelectedItems);
|
|
526
|
+
}
|
|
475
527
|
if (refreshUI)
|
|
476
528
|
setLastUpdateSearchTime(new Date(Date.now()));
|
|
477
529
|
};
|
|
@@ -520,8 +572,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
520
572
|
}
|
|
521
573
|
};
|
|
522
574
|
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 &&
|
|
523
|
-
_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, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation) })] });
|
|
524
|
-
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') })] });
|
|
575
|
+
_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, openSignSettingsForm, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation).concat([customButtonMenuItems()]) })] });
|
|
525
576
|
const handleAddItem = (tid, did) => {
|
|
526
577
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
527
578
|
setSecondaryMasterDcmts((prevItems) => [...prevItems, newItem]);
|
|
@@ -545,6 +596,9 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
545
596
|
TMSpinner.hide();
|
|
546
597
|
}
|
|
547
598
|
}, []);
|
|
599
|
+
const handleSavedAsyncCallback = useCallback(async (tid, did, metadataResult) => {
|
|
600
|
+
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
601
|
+
}, []);
|
|
548
602
|
const showToppyForApprove = (isVisible && fromDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isOpenDcmtForm && !isOpenDetails && !isOpenMaster);
|
|
549
603
|
const tmSearchResult = useMemo(() => (!searchResults || searchResults.length <= 0)
|
|
550
604
|
? _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 }) })] })
|
|
@@ -553,24 +607,23 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
553
607
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
554
608
|
:
|
|
555
609
|
_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 &&
|
|
556
|
-
_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, handleCheckOutOperationCallback, 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: () => {
|
|
610
|
+
_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, openSignSettingsForm, handleCheckOutOperationCallback, 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: () => {
|
|
557
611
|
setIsOpenBatchUpdate(false);
|
|
558
612
|
}, onSavedCallbackAsync: async () => {
|
|
559
613
|
setIsOpenBatchUpdate(false);
|
|
560
614
|
setIsModifiedBatchUpdate(false);
|
|
561
615
|
await refreshSelectionDataRowsAsync();
|
|
562
|
-
}, onStatusChanged: (isModified) => { setIsModifiedBatchUpdate(isModified); } }), (showToppyForApprove && !showApprovePopup && !showRejectPopup && !showReAssignPopup && !showMoreInfoPopup && !openS4TViewer && !showTodoDcmtForm)
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
}, 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 &&
|
|
616
|
+
}, 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: () => {
|
|
617
|
+
setShowApprovePopup(true);
|
|
618
|
+
}, onSignApprove: () => {
|
|
619
|
+
handleSignApprove();
|
|
620
|
+
}, onReject: () => {
|
|
621
|
+
setShowRejectPopup(true);
|
|
622
|
+
}, onReAssign: () => {
|
|
623
|
+
setShowReAssignPopup(true);
|
|
624
|
+
}, onMoreInfo: () => {
|
|
625
|
+
setShowMoreInfoPopup(true);
|
|
626
|
+
}, 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 &&
|
|
574
627
|
_jsx(TMChooserForm, { dataSource: relatedDcmtsChooserDataSource, onChoose: async (selectedRelation) => {
|
|
575
628
|
try {
|
|
576
629
|
setShowRelatedDcmtsChooser(false);
|
|
@@ -730,9 +783,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
730
783
|
:
|
|
731
784
|
_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) => {
|
|
732
785
|
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}`));
|
|
733
|
-
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _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:
|
|
734
|
-
await refreshFocusedDataRowAsync(tid, did, true, metadataResult);
|
|
735
|
-
}, 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: () => {
|
|
786
|
+
})] }), _jsx(StyledMultiViewPanel, { "$isVisible": isOpenDcmtForm, children: isOpenDcmtForm && _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, 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: () => {
|
|
736
787
|
setIsOpenArchiveRelationForm(false);
|
|
737
788
|
setArchiveType(undefined);
|
|
738
789
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
@@ -743,7 +794,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
743
794
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
744
795
|
setArchiveRelatedDcmtFormMids([]);
|
|
745
796
|
await onRefreshSearchAsync?.();
|
|
746
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }));
|
|
797
|
+
}, 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 })] }));
|
|
747
798
|
};
|
|
748
799
|
export default TMSearchResult;
|
|
749
800
|
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => {
|
|
@@ -962,7 +1013,7 @@ const TMSearchResultGrid = ({ openInOffice, inputFocusedItem, showSearch, allowM
|
|
|
962
1013
|
width: 50,
|
|
963
1014
|
cellRender: (cellData) => renderDcmtIcon(cellData, onDownloadDcmtsAsync, openInOffice),
|
|
964
1015
|
allowResizing: false,
|
|
965
|
-
filterOperations: ['=']
|
|
1016
|
+
filterOperations: ['=', "anyof"]
|
|
966
1017
|
},
|
|
967
1018
|
...columns.filter(col => col.dataField !== 'FILEEXT')
|
|
968
1019
|
];
|
|
@@ -1051,12 +1102,30 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1051
1102
|
}
|
|
1052
1103
|
};
|
|
1053
1104
|
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 })] })), []);
|
|
1105
|
+
const accordionGroups = useMemo(() => sortedCategories.map((category, index) => ({
|
|
1106
|
+
id: category,
|
|
1107
|
+
title: getHeaderTitle(category),
|
|
1108
|
+
dataSource: groupedResults[category],
|
|
1109
|
+
isExpanded: index === 0,
|
|
1110
|
+
badges: [
|
|
1111
|
+
{
|
|
1112
|
+
badge: searchResults.length > 1 ? searchResults?.filter(data => data.category === category || (data?.category === undefined && category === "Uncategorized")).length : 0,
|
|
1113
|
+
tooltip: 'Numero di tipi documento'
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
badge: resultDcmtCounter(category),
|
|
1117
|
+
tooltip: 'Numero di tutti documenti'
|
|
1118
|
+
}
|
|
1119
|
+
],
|
|
1120
|
+
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 })] })),
|
|
1121
|
+
itemHeight: 40
|
|
1122
|
+
})), [sortedCategories, groupedResults, searchResults]);
|
|
1054
1123
|
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))) }));
|
|
1055
1124
|
if (disableAccordionIfSingleCategory && sortedCategories.length === 1) {
|
|
1056
1125
|
const category = sortedCategories[0];
|
|
1057
1126
|
return renderCategoryItems(category);
|
|
1058
1127
|
}
|
|
1059
|
-
return (_jsx(
|
|
1128
|
+
return (_jsx(TMAccordionNew, { groups: accordionGroups, selectedItem: selectedResult, onSelectedItemChange: (result) => handleSelect(result) }));
|
|
1060
1129
|
};
|
|
1061
1130
|
//#endregion TMSearchResultSelector
|
|
1062
1131
|
const TMDcmtPreviewWrapper = ({ currentDcmt, isVisible }) => {
|
|
@@ -3,8 +3,9 @@ import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes, WorkingGr
|
|
|
3
3
|
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
4
4
|
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
|
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
6
|
+
export declare const getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
|
|
6
7
|
export declare const signatureInformationCallback: (isMobile: boolean, inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
|
|
7
|
-
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined
|
|
8
|
+
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, openSignSettingsForm: () => void, handleCheckOutOperationCallback: (checkout: boolean) => Promise<void>, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void, passToArchiveCallback?: (outputMids: Array<{
|
|
8
9
|
mid: number;
|
|
9
10
|
value: string;
|
|
10
11
|
}>, tid?: number) => void, archiveMasterDocuments?: (tid: number | undefined) => Promise<void>, archiveDetailDocuments?: (tid: number | undefined) => Promise<void>, hasMasterRelation?: boolean, hasDetailRelation?: boolean, canArchiveMasterRelation?: boolean, canArchiveDetailRelation?: boolean, pairManyToManyDocuments?: (isPairing: boolean) => Promise<void>, hasManyToManyRelation?: boolean) => Array<TMDataGridContextMenuItem>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService, LicenseModuleStatus, CICO_MetadataNames } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled, IconPair, IconUnpair, IconSharedDcmt } from '../../../helper';
|
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled, IconPair, IconUnpair, IconSharedDcmt, IconShare, IconCopy, IconMoveToFolder } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
@@ -40,8 +40,21 @@ const getCicoInfo = (dtd) => {
|
|
|
40
40
|
}
|
|
41
41
|
return cico;
|
|
42
42
|
};
|
|
43
|
-
const cicoIsEnabled = (
|
|
44
|
-
|
|
43
|
+
const cicoIsEnabled = (dcmt, dtd) => {
|
|
44
|
+
const cicoInfo = getCicoInfo(dtd);
|
|
45
|
+
let isCheckout = false;
|
|
46
|
+
const CICO_CheckoutUserID = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID)?.id;
|
|
47
|
+
if (dcmt && CICO_CheckoutUserID) {
|
|
48
|
+
const key = dcmt.TID + "_" + CICO_CheckoutUserID;
|
|
49
|
+
const value = dcmt[key];
|
|
50
|
+
if (value && value > 0) {
|
|
51
|
+
isCheckout = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes,
|
|
56
|
+
isCheckout: isCheckout
|
|
57
|
+
};
|
|
45
58
|
};
|
|
46
59
|
const disabledForSingleRow = (selectedItems, focusedItem) => {
|
|
47
60
|
return selectedItems.length > 1 || focusedItem === undefined;
|
|
@@ -61,8 +74,20 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
|
61
74
|
}
|
|
62
75
|
return [];
|
|
63
76
|
};
|
|
77
|
+
export const getAllFieldSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat) => {
|
|
78
|
+
if (selectedItems.length <= 0 && !focusedItem)
|
|
79
|
+
return [];
|
|
80
|
+
if (selectedItems.length > 0) {
|
|
81
|
+
return selectedItems;
|
|
82
|
+
}
|
|
83
|
+
else if (focusedItem !== undefined) {
|
|
84
|
+
return [focusedItem];
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
};
|
|
64
88
|
export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
65
89
|
try {
|
|
90
|
+
TMSpinner.show({ description: SDKUI_Localizator.Loading });
|
|
66
91
|
if (!inputDcmts || inputDcmts.length === 0) {
|
|
67
92
|
ShowAlert({
|
|
68
93
|
message: SDKUI_Localizator.NoDcmtSelected,
|
|
@@ -111,8 +136,11 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
|
111
136
|
console.error(error);
|
|
112
137
|
TMExceptionBoxManager.show({ exception: error });
|
|
113
138
|
}
|
|
139
|
+
finally {
|
|
140
|
+
TMSpinner.hide();
|
|
141
|
+
}
|
|
114
142
|
};
|
|
115
|
-
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
143
|
+
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openSignSettingsForm, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
116
144
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
117
145
|
let pdfEditorAvailable = false;
|
|
118
146
|
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
@@ -221,7 +249,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
221
249
|
icon: svgToString(_jsx(IconDownload, {})),
|
|
222
250
|
operationType: 'multiRow',
|
|
223
251
|
disabled: dtd?.perm?.canRetrieveFile !== AccessLevels.Yes ? true : disabledForMultiRow(selectedItems, focusedItem),
|
|
224
|
-
text: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download")
|
|
252
|
+
text: SDKUI_Localizator.DownloadFile, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Dcmt, "download", undefined, undefined, true)
|
|
225
253
|
};
|
|
226
254
|
};
|
|
227
255
|
const downloadXMLAttachmentsMenuItem = () => {
|
|
@@ -229,7 +257,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
229
257
|
icon: svgToString(_jsx(IconDownload, {})),
|
|
230
258
|
operationType: 'singleRow',
|
|
231
259
|
disabled: !isXMLFileExt(getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT) ? true : disabledForSingleRow(selectedItems, focusedItem),
|
|
232
|
-
text: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Attachment, "download", undefined, confirmAttachments)
|
|
260
|
+
text: SDKUI_Localizator.DownloadXMLAttachments, onClick: () => downloadDcmtsAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DownloadTypes.Attachment, "download", undefined, confirmAttachments, true)
|
|
233
261
|
};
|
|
234
262
|
};
|
|
235
263
|
const duplicateDocumentMenuItem = () => {
|
|
@@ -308,6 +336,20 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
308
336
|
text: SDKUI_Localizator.Signature,
|
|
309
337
|
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
310
338
|
items: [
|
|
339
|
+
{
|
|
340
|
+
icon: svgToString(_jsx(IconSignaturePencil, {})),
|
|
341
|
+
operationType: 'singleRow',
|
|
342
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
343
|
+
text: SDKUI_Localizator.Signature,
|
|
344
|
+
onClick: handleSignApprove
|
|
345
|
+
},
|
|
346
|
+
/* {
|
|
347
|
+
icon: svgToString(<IconSettings />),
|
|
348
|
+
operationType: 'singleRow',
|
|
349
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
350
|
+
text: SDKUI_Localizator.SignatureSettings,
|
|
351
|
+
onClick: openSignSettingsForm
|
|
352
|
+
}, */
|
|
311
353
|
{
|
|
312
354
|
icon: svgToString(_jsx(IconCircleInfo, {})),
|
|
313
355
|
text: SDKUI_Localizator.SignatureInformation,
|
|
@@ -322,34 +364,31 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
322
364
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
323
365
|
onClick: async () => { await runOperationAsync(getSelectedDcmtsOrFocused(selectedItems, focusedItem), DcmtOperationTypes.VerifySign); }
|
|
324
366
|
},
|
|
325
|
-
{
|
|
326
|
-
icon: svgToString(_jsx(IconSignaturePencil, {})),
|
|
327
|
-
operationType: 'singleRow',
|
|
328
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
329
|
-
text: SDKUI_Localizator.Signature,
|
|
330
|
-
onClick: handleSignApprove
|
|
331
|
-
},
|
|
332
367
|
]
|
|
333
368
|
};
|
|
334
369
|
};
|
|
335
370
|
const checkinMenuItem = () => {
|
|
336
|
-
|
|
371
|
+
// Get the currently selected or focused documents
|
|
372
|
+
const selectedDocs = getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
373
|
+
// Take the first document (used for validation checks)
|
|
374
|
+
const firstDoc = selectedDocs?.[0];
|
|
375
|
+
const { cicoEnabled, isCheckout } = cicoIsEnabled(firstDoc, dtd);
|
|
337
376
|
return {
|
|
338
377
|
icon: svgToString(_jsx(IconFileDots, {})),
|
|
339
378
|
text: "Check in/Check out",
|
|
340
|
-
disabled: !
|
|
379
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
341
380
|
items: [
|
|
342
381
|
{
|
|
343
382
|
icon: "edit",
|
|
344
383
|
text: 'Check out',
|
|
345
|
-
disabled: !
|
|
384
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
346
385
|
// disabled: isNotSingleFile || isGroupLocked || isFileCheckedOut,
|
|
347
386
|
onClick: () => handleCheckOutOperationCallback(true),
|
|
348
387
|
},
|
|
349
388
|
{
|
|
350
389
|
icon: "remove",
|
|
351
390
|
text: SDKUI_Localizator.CancelCheckOut,
|
|
352
|
-
disabled: !
|
|
391
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
353
392
|
// disabled: isNotSingleFile || isGroupLocked || isFileNotCheckedOut || isNotCheckedOutByCurrentUser,
|
|
354
393
|
onClick: () => handleCheckOutOperationCallback(false),
|
|
355
394
|
},
|
|
@@ -365,21 +404,21 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
365
404
|
items: [
|
|
366
405
|
{
|
|
367
406
|
icon: svgToString(_jsx(IconPair, {})),
|
|
368
|
-
text:
|
|
407
|
+
text: SDKUI_Localizator.MatchManyDocumentsManyToMany,
|
|
369
408
|
operationType: 'multiRow',
|
|
370
409
|
disabled: !hasManyToManyRelation || disabledForMultiRow(selectedItems, focusedItem),
|
|
371
410
|
onClick: async () => await pairManyToManyDocuments?.(true)
|
|
372
411
|
},
|
|
373
412
|
{
|
|
374
413
|
icon: svgToString(_jsx(IconUnpair, {})),
|
|
375
|
-
text:
|
|
414
|
+
text: SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
|
|
376
415
|
operationType: 'multiRow',
|
|
377
416
|
disabled: !hasManyToManyRelation || disabledForMultiRow(selectedItems, focusedItem),
|
|
378
417
|
onClick: async () => await pairManyToManyDocuments?.(false)
|
|
379
418
|
},
|
|
380
419
|
{
|
|
381
420
|
icon: svgToString(_jsx(IconArchiveMaster, {})),
|
|
382
|
-
text:
|
|
421
|
+
text: SDKUI_Localizator.ArchiveMasterDocument,
|
|
383
422
|
operationType: 'multiRow',
|
|
384
423
|
beginGroup: true,
|
|
385
424
|
disabled: canArchiveMasterRelation !== true,
|
|
@@ -387,7 +426,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
387
426
|
},
|
|
388
427
|
{
|
|
389
428
|
icon: svgToString(_jsx(IconArchiveDetail, {})),
|
|
390
|
-
text:
|
|
429
|
+
text: SDKUI_Localizator.ArchiveDetailDocument,
|
|
391
430
|
operationType: 'multiRow',
|
|
392
431
|
disabled: canArchiveDetailRelation !== true,
|
|
393
432
|
onClick: async () => await archiveDetailDocuments?.(focusedItem?.TID)
|
|
@@ -415,22 +454,22 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
415
454
|
const sharedDcmtsMenuItem = () => {
|
|
416
455
|
return {
|
|
417
456
|
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
418
|
-
text:
|
|
457
|
+
text: SDKUI_Localizator.SharedDocuments,
|
|
419
458
|
operationType: 'multiRow',
|
|
420
459
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
421
460
|
items: [
|
|
422
461
|
{
|
|
423
462
|
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
424
|
-
text:
|
|
463
|
+
text: SDKUI_Localizator.SharedArchiving,
|
|
425
464
|
operationType: 'singleRow',
|
|
426
465
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
427
466
|
onClick: async () => { await openSharedArchiveHandler(); }
|
|
428
467
|
},
|
|
429
468
|
{
|
|
430
469
|
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
431
|
-
text:
|
|
470
|
+
text: SDKUI_Localizator.ShowSharedDocuments,
|
|
432
471
|
operationType: 'multiRow',
|
|
433
|
-
disabled:
|
|
472
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
434
473
|
onClick: async () => { await showSharedDcmtsHandler(); }
|
|
435
474
|
}
|
|
436
475
|
]
|
|
@@ -573,7 +612,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
573
612
|
};
|
|
574
613
|
const shareFromWgMenuItem = () => {
|
|
575
614
|
return {
|
|
576
|
-
icon:
|
|
615
|
+
icon: svgToString(_jsx(IconShare, {})),
|
|
577
616
|
text: SDKUI_Localizator.Share,
|
|
578
617
|
visible: workingGroupContext !== undefined && openAddDocumentForm !== undefined,
|
|
579
618
|
disabled: workingGroupContext === undefined,
|
|
@@ -582,7 +621,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
582
621
|
};
|
|
583
622
|
const copyFromWgMenuItem = () => {
|
|
584
623
|
return {
|
|
585
|
-
icon:
|
|
624
|
+
icon: svgToString(_jsx(IconCopy, {})),
|
|
586
625
|
text: SDKUI_Localizator.CopyToDrafts,
|
|
587
626
|
operationType: 'multiRow',
|
|
588
627
|
visible: openWGsCopyMoveForm !== undefined,
|
|
@@ -592,7 +631,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
592
631
|
};
|
|
593
632
|
const movetofolderFromWgMenuItem = () => {
|
|
594
633
|
return {
|
|
595
|
-
icon:
|
|
634
|
+
icon: svgToString(_jsx(IconMoveToFolder, {})),
|
|
596
635
|
text: !isMobile ? SDKUI_Localizator.CopyToArchivedDocuments : SDKUI_Localizator.CopyToArchived,
|
|
597
636
|
operationType: 'multiRow',
|
|
598
637
|
visible: openWGsCopyMoveForm !== undefined,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DcmtTypeDescriptor, SearchResultDescriptor } from "@topconsultnpm/sdk-ts";
|
|
2
|
+
interface TMSignSettingsFormProps {
|
|
3
|
+
fromDTD: DcmtTypeDescriptor;
|
|
4
|
+
inputDcmts: any[];
|
|
5
|
+
onCloseSignSettingsForm: () => void;
|
|
6
|
+
onSavedAsyncCallback: ((tid: number | undefined, did: number | undefined, metadataResult?: SearchResultDescriptor | null) => Promise<void>);
|
|
7
|
+
}
|
|
8
|
+
declare const TMSignSettingsForm: (props: TMSignSettingsFormProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export default TMSignSettingsForm;
|