@topconsultnpm/sdkui-react 6.19.0-dev1.32 → 6.19.0-dev1.34
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/editors/TMMetadataValues.js +24 -4
- package/lib/components/features/archive/TMArchive.d.ts +1 -0
- package/lib/components/features/archive/TMArchive.js +27 -17
- package/lib/components/features/documents/TMDcmtForm.js +11 -6
- package/lib/components/features/search/TMSearchResult.js +19 -4
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +27 -2
- package/lib/ts/types.d.ts +13 -0
- package/lib/ts/types.js +15 -0
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ import TMTooltip from "../base/TMTooltip";
|
|
|
10
10
|
import TMCheckBox from "./TMCheckBox";
|
|
11
11
|
import TMMetadataEditor, { useMetadataEditableList } from "./TMMetadataEditor";
|
|
12
12
|
import { FormulaHelper } from "./TMFormulaEditor";
|
|
13
|
-
import { DraftsMIDs } from "../../ts";
|
|
13
|
+
import { DraftsMIDs, DSAttachsMIDs } from "../../ts";
|
|
14
14
|
import { TMNothingToShow } from "../features/documents/TMDcmtPreview";
|
|
15
15
|
import TMAccordion from "../base/TMAccordion";
|
|
16
16
|
export var ShowCheckBoxesMode;
|
|
@@ -384,7 +384,22 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
|
384
384
|
checkOutData.push(tempCICODataMap[id]);
|
|
385
385
|
}
|
|
386
386
|
});
|
|
387
|
-
return (_jsxs("div", { style: { width: '100%' }, children: [draftData.length > 0 && _jsx(TMAccordion, { title: SDKUI_Localizator.Draft, children: draftData.map(item => renderMetadataItem(item)) }), checkOutData.length > 0 && _jsx(TMAccordion, { title: `${SDKUI_Localizator.CheckIn}/${SDKUI_Localizator.CheckOut}`, children: checkOutData.map(item => renderMetadataItem(item, true)) })] }));
|
|
387
|
+
return (_jsxs("div", { style: { width: '100%' }, children: [draftData.length > 0 && _jsx(TMAccordion, { title: SDKUI_Localizator.Draft, children: draftData.map(item => renderMetadataItem(item, isReadOnly)) }), checkOutData.length > 0 && _jsx(TMAccordion, { title: `${SDKUI_Localizator.CheckIn}/${SDKUI_Localizator.CheckOut}`, children: checkOutData.map(item => renderMetadataItem(item, true)) })] }));
|
|
388
|
+
};
|
|
389
|
+
const layoutDsAttachs = () => {
|
|
390
|
+
const dsAttachsData = [];
|
|
391
|
+
metadataValues.forEach(item => {
|
|
392
|
+
switch (item.md?.id) {
|
|
393
|
+
// case DSAttachsMIDs.DSID:
|
|
394
|
+
case DSAttachsMIDs.Name:
|
|
395
|
+
case DSAttachsMIDs.Description:
|
|
396
|
+
dsAttachsData.push(item);
|
|
397
|
+
break;
|
|
398
|
+
default:
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
return (_jsx("div", { style: { width: '100%' }, children: dsAttachsData.length > 0 && _jsx(TMAccordion, { title: SDKUI_Localizator.Attachment, children: dsAttachsData.map(item => renderMetadataItem(item, isReadOnly)) }) }));
|
|
388
403
|
};
|
|
389
404
|
const layoutCustom = () => {
|
|
390
405
|
if (!layout || !layout.items || layout.items.length === 0) {
|
|
@@ -437,13 +452,18 @@ const TMMetadataValues = ({ showCheckBoxes = ShowCheckBoxesMode.Never, checkPerm
|
|
|
437
452
|
return (_jsx("div", { style: { width: '100%' }, children: rootItems.map(item => renderLayoutItem(item, 0)) }));
|
|
438
453
|
};
|
|
439
454
|
const renderForm = () => {
|
|
455
|
+
// Se tutti i metadata sono di sistema, renderizziamo tutti in sola lettura senza layout
|
|
456
|
+
const allSystem = metadataValues.length > 0 && metadataValues.every(item => item.md?.isSystem === 1);
|
|
457
|
+
if (allSystem) {
|
|
458
|
+
return metadataValues.map((item) => renderMetadataItem(item, true));
|
|
459
|
+
}
|
|
440
460
|
if (currentDTD?.templateTID === TemplateTIDs.WF_WIApprView && !isReadOnly) {
|
|
441
461
|
return layoutWorkItem();
|
|
442
462
|
}
|
|
443
463
|
switch (currentDTD?.id) {
|
|
444
|
-
case SystemTIDs.Drafts: return
|
|
464
|
+
case SystemTIDs.Drafts: return layoutDraft();
|
|
445
465
|
// case SystemTIDs.Chronology: break;
|
|
446
|
-
|
|
466
|
+
case SystemTIDs.DSAttachs: return layoutDsAttachs();
|
|
447
467
|
default:
|
|
448
468
|
// Se è presente un layout personalizzato, usalo, altrimenti usa il rendering standard
|
|
449
469
|
if (layout && layout.items && layout.items.length > 0) {
|
|
@@ -12,7 +12,7 @@ import TMTreeSelector from '../search/TMTreeSelector';
|
|
|
12
12
|
import TMPanel from '../../base/TMPanel';
|
|
13
13
|
import { TMPanelManagerProvider, useTMPanelManagerContext } from '../../layout/panelManager/TMPanelManagerContext';
|
|
14
14
|
import TMPanelManagerContainer from '../../layout/panelManager/TMPanelManagerContainer';
|
|
15
|
-
const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback, inputMids = [], enableDragDropOverlay = false, passToSearch }) => {
|
|
15
|
+
const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback, inputMids = [], enableDragDropOverlay = false, passToSearch, isSharedArchive = false }) => {
|
|
16
16
|
const [currentTID, setCurrentTID] = useState(inputTID ?? 0);
|
|
17
17
|
const [mruTIDs, setMruTIDs] = useState([]);
|
|
18
18
|
const [currentMruTID, setCurrentMruTID] = useState(0);
|
|
@@ -36,21 +36,21 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
36
36
|
});
|
|
37
37
|
}, [currentTID, onDcmtTypeSelect]);
|
|
38
38
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
39
|
-
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, onSelectedTIDChanged: (tid) => {
|
|
39
|
+
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, isSharedArchive: isSharedArchive, onSelectedTIDChanged: (tid) => {
|
|
40
40
|
setCurrentTID(tid);
|
|
41
41
|
if (tid && mruTIDs.includes(tid))
|
|
42
42
|
setCurrentMruTID(tid);
|
|
43
43
|
else
|
|
44
44
|
setCurrentMruTID(0);
|
|
45
|
-
} }), [isMobile, currentTID]);
|
|
46
|
-
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentTID: currentTID, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
45
|
+
} }), [isMobile, currentTID, isSharedArchive]);
|
|
46
|
+
const tmRecentsManagerElement = useMemo(() => _jsx(TMRecentsManagerWrapper, { mruTIDs: mruTIDs, currentTID: currentTID, currentMruTID: currentMruTID, deviceType: deviceType, isSharedArchive: isSharedArchive, onSelectedTID: (tid) => {
|
|
47
47
|
setCurrentMruTID(tid);
|
|
48
48
|
setCurrentTID(tid);
|
|
49
49
|
}, onDeletedTID: (tid) => {
|
|
50
50
|
let newMruTIDS = removeMruTid(SDKUI_Globals.userSettings.archivingSettings.mruTIDs, tid);
|
|
51
51
|
SDKUI_Globals.userSettings.archivingSettings.mruTIDs = newMruTIDS;
|
|
52
52
|
setMruTIDs(newMruTIDS);
|
|
53
|
-
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
53
|
+
} }), [mruTIDs, currentMruTID, deviceType, isSharedArchive]);
|
|
54
54
|
const tmFormElement = useMemo(() => currentTID ?
|
|
55
55
|
_jsx(TMDcmtForm, { TID: currentTID, DID: undefined, groupId: 'tmForm', layoutMode: LayoutModes.Ark, onClose: deviceType === DeviceType.MOBILE ? () => setCurrentTID(undefined) : undefined, onSaveRecents: (TIDs) => setMruTIDs(TIDs), showDcmtFormSidebar: false, inputFile: inputFile, connectorFileSave: connectorFileSave, onSavedAsyncCallback: onSavedAsyncCallback, inputMids: inputMids, enableDragDropOverlay: enableDragDropOverlay, passToSearch: passToSearch ? (outputMids) => {
|
|
56
56
|
if (onDcmtTypeSelect)
|
|
@@ -66,13 +66,13 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
66
66
|
'tmDcmtForm': true,
|
|
67
67
|
'tmBlog': false,
|
|
68
68
|
'tmSysMetadata': false,
|
|
69
|
-
'tmDcmtPreview':
|
|
69
|
+
'tmDcmtPreview': !isSharedArchive,
|
|
70
70
|
};
|
|
71
71
|
const initialPanelDimensions = {
|
|
72
72
|
'tmTreeSelector': { width: '20%', height: '100%' },
|
|
73
73
|
'tmRecentsManager': { width: '20%', height: '100%' },
|
|
74
74
|
'tmForm': { width: '60%', height: '100%' },
|
|
75
|
-
'tmDcmtForm': { width: '25%', height: '100%' },
|
|
75
|
+
'tmDcmtForm': { width: isSharedArchive ? '50%' : '25%', height: '100%' },
|
|
76
76
|
'tmBlog': { width: '25%', height: '100%' },
|
|
77
77
|
'tmSysMetadata': { width: '25%', height: '100%' },
|
|
78
78
|
'tmDcmtPreview': { width: '25%', height: '100%' },
|
|
@@ -114,15 +114,15 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
114
114
|
{
|
|
115
115
|
id: 'tmDcmtPreview',
|
|
116
116
|
name: SDKUI_Localizator.PreviewDocument,
|
|
117
|
-
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: false, orderNumber: 7, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
117
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: false, disabled: isSharedArchive, orderNumber: 7, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
118
118
|
}
|
|
119
119
|
]
|
|
120
120
|
},
|
|
121
|
-
], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs]);
|
|
121
|
+
], [tmTreeSelectorElement, tmRecentsManagerElement, tmFormElement, currentTID, mruTIDs, isSharedArchive]);
|
|
122
122
|
return (_jsx(TMPanelManagerProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: initialPanelDimensions, initialDimensions: initialPanelDimensions, initialMobilePanelId: 'tmRecentsManager', children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", showToolbar: true }) }));
|
|
123
123
|
};
|
|
124
124
|
export default TMArchive;
|
|
125
|
-
const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
125
|
+
const TMTreeSelectorWrapper = ({ isMobile, isSharedArchive, onSelectedTIDChanged }) => {
|
|
126
126
|
const { setPanelVisibilityById, toggleMaximize, setToolbarButtonVisibility, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
127
127
|
return (_jsx(TMTreeSelector, { layoutMode: LayoutModes.Ark, onClosePanel: !isMobile && countVisibleLeafPanels() > 1 ? () => setPanelVisibilityById('tmTreeSelector', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: !isMobile && countVisibleLeafPanels() > 1 ? () => toggleMaximize("tmTreeSelector") : undefined, onSelectedTIDChanged: (tid) => {
|
|
128
128
|
onSelectedTIDChanged?.(tid);
|
|
@@ -130,21 +130,27 @@ const TMTreeSelectorWrapper = ({ isMobile, onSelectedTIDChanged }) => {
|
|
|
130
130
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
131
131
|
else {
|
|
132
132
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
133
|
-
|
|
133
|
+
if (!isSharedArchive) {
|
|
134
|
+
setPanelVisibilityById('tmDcmtPreview', true);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (!isSharedArchive) {
|
|
138
|
+
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
134
139
|
}
|
|
135
|
-
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
136
140
|
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
137
141
|
} }));
|
|
138
142
|
};
|
|
139
|
-
const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceType, onSelectedTID, onDeletedTID }) => {
|
|
143
|
+
const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceType, isSharedArchive, onSelectedTID, onDeletedTID }) => {
|
|
140
144
|
const { setPanelVisibilityById, setToolbarButtonVisibility } = useTMPanelManagerContext();
|
|
141
145
|
useEffect(() => {
|
|
142
146
|
if (currentTID) {
|
|
143
147
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
144
|
-
|
|
148
|
+
if (!isSharedArchive) {
|
|
149
|
+
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
150
|
+
}
|
|
145
151
|
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
146
152
|
}
|
|
147
|
-
}, [currentTID]);
|
|
153
|
+
}, [currentTID, isSharedArchive]);
|
|
148
154
|
return (_jsx(TMRecentsManager, { accessFilter: 'canArchive', mruTIDs: mruTIDs, currentMruTID: currentMruTID, deviceType: deviceType, onSelectedTID: (tid) => {
|
|
149
155
|
onSelectedTID?.(tid);
|
|
150
156
|
if (deviceType === DeviceType.MOBILE) {
|
|
@@ -152,9 +158,13 @@ const TMRecentsManagerWrapper = ({ mruTIDs, currentTID, currentMruTID, deviceTyp
|
|
|
152
158
|
}
|
|
153
159
|
else {
|
|
154
160
|
setPanelVisibilityById('tmDcmtForm', true);
|
|
155
|
-
|
|
161
|
+
if (!isSharedArchive) {
|
|
162
|
+
setPanelVisibilityById('tmDcmtPreview', true);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (!isSharedArchive) {
|
|
166
|
+
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
156
167
|
}
|
|
157
|
-
setToolbarButtonVisibility('tmDcmtPreview', true);
|
|
158
168
|
setToolbarButtonVisibility('tmDcmtForm', true);
|
|
159
169
|
}, onDeletedTID: (tid) => {
|
|
160
170
|
onDeletedTID?.(tid);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
|
-
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutModes, MetadataDataTypes, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TemplateTIDs, UpdateEngineByID, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TemplateTIDs, UpdateEngineByID, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { ContextMenu } from 'devextreme-react';
|
|
6
6
|
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
7
7
|
import { DownloadTypes, FormModes } from '../../../ts';
|
|
@@ -153,11 +153,18 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
153
153
|
return;
|
|
154
154
|
if (!DID && layoutMode === LayoutModes.Update)
|
|
155
155
|
return;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
// Esegui in parallelo GetMetadataAsync e LayoutCacheService.GetAsync
|
|
157
|
+
// poiché non dipendono l'uno dall'altro
|
|
158
|
+
const [getMetadataResult, resLayout] = await Promise.all([
|
|
159
|
+
layoutMode === LayoutModes.Update
|
|
160
|
+
? SDK_Globals.tmSession?.NewSearchEngine().GetMetadataAsync(TID, DID, true)
|
|
161
|
+
: Promise.resolve(undefined),
|
|
162
|
+
LayoutCacheService.GetAsync(TID, layoutMode)
|
|
163
|
+
]);
|
|
164
|
+
// DcmtTypeListCacheService dipende da getMetadataResult, quindi deve attendere
|
|
159
165
|
let dtd = await DcmtTypeListCacheService.GetWithNotGrantedAsync(TID, DID, getMetadataResult);
|
|
160
166
|
setFromDTD(dtd);
|
|
167
|
+
setLayout(resLayout);
|
|
161
168
|
if (layoutMode === LayoutModes.Update || (layoutMode === LayoutModes.Ark && DID)) {
|
|
162
169
|
await setMetadataList(dtd?.metadata ?? [], getMetadataResult);
|
|
163
170
|
}
|
|
@@ -168,8 +175,6 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
168
175
|
setFormData(structuredClone(metadataList));
|
|
169
176
|
formDataOrigRef.current = structuredClone(metadataList);
|
|
170
177
|
}
|
|
171
|
-
let resLayout = await SDK_Globals.tmSession?.NewDcmtTypeEngine().LayoutRetrieveAsync(TID, layoutMode);
|
|
172
|
-
setLayout(resLayout);
|
|
173
178
|
(layoutMode === LayoutModes.Ark && !inputFile) && handleReset();
|
|
174
179
|
}
|
|
175
180
|
catch (e) {
|
|
@@ -41,6 +41,7 @@ import TMSpinner from '../../base/TMSpinner';
|
|
|
41
41
|
import TMChooserForm from '../../forms/TMChooserForm';
|
|
42
42
|
import TMModal from '../../base/TMModal';
|
|
43
43
|
import TMSearch from './TMSearch';
|
|
44
|
+
import TMArchive from '../archive/TMArchive';
|
|
44
45
|
//#region Helper Methods
|
|
45
46
|
export const getSearchResultCountersSingleCategory = (searchResults) => {
|
|
46
47
|
// let totDcmtTypes = searchResults.length;
|
|
@@ -74,6 +75,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
74
75
|
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
75
76
|
const [isOpenDcmtForm, setIsOpenDcmtForm] = useState(false);
|
|
76
77
|
const [isOpenBatchUpdate, setIsOpenBatchUpdate] = useState(false);
|
|
78
|
+
const [isOpenSharedArchive, setIsOpenSharedArchive] = useState(false);
|
|
77
79
|
const [visibleItems, setVisibleItems] = useState([]);
|
|
78
80
|
const [focusedItem, setFocusedItem] = useState();
|
|
79
81
|
const [selectedItems, setSelectedItems] = useState([]);
|
|
@@ -147,6 +149,14 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
147
149
|
});
|
|
148
150
|
}, [currentMetadataValues]);
|
|
149
151
|
const openFormHandler = (layoutMode) => { setIsOpenDcmtForm(true); setDcmtFormLayoutMode(layoutMode); };
|
|
152
|
+
const openSharedArchiveHandler = () => {
|
|
153
|
+
const dcmts = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
154
|
+
if (dcmts.length === 0) {
|
|
155
|
+
ShowAlert({ message: "Nessun documento selezionato", mode: "warning", duration: 3000 });
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
setIsOpenSharedArchive(true);
|
|
159
|
+
};
|
|
150
160
|
const openTaskFormHandler = (onTaskCreated) => {
|
|
151
161
|
if (selectedItems.length > 1)
|
|
152
162
|
return;
|
|
@@ -241,7 +251,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
241
251
|
return;
|
|
242
252
|
if (e.target === 'content') {
|
|
243
253
|
e.items = e.items || [];
|
|
244
|
-
const menuItems = getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, 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);
|
|
254
|
+
const menuItems = getCommandsMenuItems(isMobile, fromDTD, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, 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);
|
|
245
255
|
e.items.push(...menuItems);
|
|
246
256
|
}
|
|
247
257
|
};
|
|
@@ -406,7 +416,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
406
416
|
}
|
|
407
417
|
};
|
|
408
418
|
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 &&
|
|
409
|
-
_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, 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) })] });
|
|
419
|
+
_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, 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) })] });
|
|
410
420
|
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') })] });
|
|
411
421
|
const handleAddItem = (tid, did) => {
|
|
412
422
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
@@ -423,7 +433,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
423
433
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
424
434
|
:
|
|
425
435
|
_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 &&
|
|
426
|
-
_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, 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: () => {
|
|
436
|
+
_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, 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: () => {
|
|
427
437
|
setIsOpenBatchUpdate(false);
|
|
428
438
|
}, onSavedCallbackAsync: async () => {
|
|
429
439
|
setIsOpenBatchUpdate(false);
|
|
@@ -596,7 +606,12 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
596
606
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
597
607
|
setArchiveRelatedDcmtFormMids([]);
|
|
598
608
|
await onRefreshSearchAsync?.();
|
|
599
|
-
} })
|
|
609
|
+
} }), isOpenSharedArchive && _jsx(TMModal, { title: "Archiviazione condivisa", onClose: () => {
|
|
610
|
+
setIsOpenSharedArchive(false);
|
|
611
|
+
}, width: isMobile ? '90%' : '80%', height: isMobile ? '90%' : '80%', children: _jsx(TMArchive, { inputTID: focusedItem?.TID, inputMids: currentMetadataValues.filter(md => md.mid && md.mid > 100).map(md => ({ mid: md.mid, value: md.value ?? '' })), isSharedArchive: true, onSavedAsyncCallback: async (tid, did) => {
|
|
612
|
+
setIsOpenSharedArchive(false);
|
|
613
|
+
await onRefreshSearchAsync?.();
|
|
614
|
+
} }) })] }));
|
|
600
615
|
};
|
|
601
616
|
export default TMSearchResult;
|
|
602
617
|
const renderDcmtIcon = (cellData, onDownloadDcmtsAsync, openInOffice) => _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 });
|
|
@@ -4,7 +4,7 @@ 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
6
|
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, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => 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, 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<{
|
|
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: () => void, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>) => 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, 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
8
|
mid: number;
|
|
9
9
|
value: string;
|
|
10
10
|
}>) => 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 } 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 } 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 } 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';
|
|
@@ -75,7 +75,7 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
|
75
75
|
TMExceptionBoxManager.show({ exception: error });
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
78
|
+
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
79
79
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
80
80
|
let pdfEditorAvailable = false;
|
|
81
81
|
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
@@ -394,6 +394,30 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
394
394
|
]
|
|
395
395
|
};
|
|
396
396
|
};
|
|
397
|
+
const sharedDcmtsMenuItem = () => {
|
|
398
|
+
return {
|
|
399
|
+
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
400
|
+
text: 'Documenti Condivisi',
|
|
401
|
+
operationType: 'multiRow',
|
|
402
|
+
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
403
|
+
items: [
|
|
404
|
+
{
|
|
405
|
+
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
406
|
+
text: "Archiviazione condivisa",
|
|
407
|
+
operationType: 'singleRow',
|
|
408
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
409
|
+
onClick: () => { openSharedArchiveHandler(); }
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
413
|
+
text: "Mostra documenti condivisi",
|
|
414
|
+
operationType: 'multiRow',
|
|
415
|
+
disabled: !hasManyToManyRelation || disabledForMultiRow(selectedItems, focusedItem),
|
|
416
|
+
onClick: () => ShowAlert({ message: "TODO Mostra documenti condivisi", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
417
|
+
}
|
|
418
|
+
]
|
|
419
|
+
};
|
|
420
|
+
};
|
|
397
421
|
/* const shareMenuItem = (): TMDataGridContextMenuItem => {
|
|
398
422
|
return {
|
|
399
423
|
icon: svgToString(<IconShare />),
|
|
@@ -627,6 +651,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
627
651
|
signatureMenuItem(),
|
|
628
652
|
// checkinMenuItem(),
|
|
629
653
|
relationsMenuItem(),
|
|
654
|
+
sharedDcmtsMenuItem(),
|
|
630
655
|
// shareMenuItem(),
|
|
631
656
|
fullTextSearchMenuItem(),
|
|
632
657
|
otherMenuItem(),
|
package/lib/ts/types.d.ts
CHANGED
|
@@ -61,6 +61,19 @@ export declare enum DraftsMIDs {
|
|
|
61
61
|
Ver = 6008,// N° di versione della bozza
|
|
62
62
|
LastVer = 6009
|
|
63
63
|
}
|
|
64
|
+
export declare enum DSAttachsMIDs {
|
|
65
|
+
DSID = 7001,
|
|
66
|
+
Name = 7002,
|
|
67
|
+
Description = 7003
|
|
68
|
+
}
|
|
69
|
+
export declare enum ChronologyMIDs {
|
|
70
|
+
RefRootTID = 15001,
|
|
71
|
+
RefDID = 15002,
|
|
72
|
+
Ver = 15003,
|
|
73
|
+
AuthorID = 15004,
|
|
74
|
+
CheckInTime = 15005,
|
|
75
|
+
Note = 15006
|
|
76
|
+
}
|
|
64
77
|
export type DownloadModes = "none" | "download" | "openInNewWindow";
|
|
65
78
|
export type TID_MID = {
|
|
66
79
|
tid: number | undefined;
|
package/lib/ts/types.js
CHANGED
|
@@ -66,6 +66,21 @@ export var DraftsMIDs;
|
|
|
66
66
|
DraftsMIDs[DraftsMIDs["Ver"] = 6008] = "Ver";
|
|
67
67
|
DraftsMIDs[DraftsMIDs["LastVer"] = 6009] = "LastVer"; // Ultima versione? (0 | 1)
|
|
68
68
|
})(DraftsMIDs || (DraftsMIDs = {}));
|
|
69
|
+
export var DSAttachsMIDs;
|
|
70
|
+
(function (DSAttachsMIDs) {
|
|
71
|
+
DSAttachsMIDs[DSAttachsMIDs["DSID"] = 7001] = "DSID";
|
|
72
|
+
DSAttachsMIDs[DSAttachsMIDs["Name"] = 7002] = "Name";
|
|
73
|
+
DSAttachsMIDs[DSAttachsMIDs["Description"] = 7003] = "Description";
|
|
74
|
+
})(DSAttachsMIDs || (DSAttachsMIDs = {}));
|
|
75
|
+
export var ChronologyMIDs;
|
|
76
|
+
(function (ChronologyMIDs) {
|
|
77
|
+
ChronologyMIDs[ChronologyMIDs["RefRootTID"] = 15001] = "RefRootTID";
|
|
78
|
+
ChronologyMIDs[ChronologyMIDs["RefDID"] = 15002] = "RefDID";
|
|
79
|
+
ChronologyMIDs[ChronologyMIDs["Ver"] = 15003] = "Ver";
|
|
80
|
+
ChronologyMIDs[ChronologyMIDs["AuthorID"] = 15004] = "AuthorID";
|
|
81
|
+
ChronologyMIDs[ChronologyMIDs["CheckInTime"] = 15005] = "CheckInTime";
|
|
82
|
+
ChronologyMIDs[ChronologyMIDs["Note"] = 15006] = "Note";
|
|
83
|
+
})(ChronologyMIDs || (ChronologyMIDs = {}));
|
|
69
84
|
export class MetadataValueDescriptorEx extends MetadataValueDescriptor {
|
|
70
85
|
}
|
|
71
86
|
export var moduleTypes;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react",
|
|
3
|
-
"version": "6.19.0-dev1.
|
|
3
|
+
"version": "6.19.0-dev1.34",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"lib"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@topconsultnpm/sdk-ts": "6.19.0-dev1.
|
|
42
|
+
"@topconsultnpm/sdk-ts": "6.19.0-dev1.6",
|
|
43
43
|
"buffer": "^6.0.3",
|
|
44
44
|
"devextreme": "25.1.4",
|
|
45
45
|
"devextreme-react": "25.1.4",
|