@topconsultnpm/sdkui-react-beta 6.17.2 → 6.17.4
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/features/archive/TMArchive.d.ts +4 -0
- package/lib/components/features/archive/TMArchive.js +8 -4
- package/lib/components/features/documents/TMDcmtForm.d.ts +4 -0
- package/lib/components/features/documents/TMDcmtForm.js +56 -4
- package/lib/components/features/search/TMSearch.d.ts +8 -1
- package/lib/components/features/search/TMSearch.js +6 -6
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +8 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +44 -3
- package/lib/components/features/search/TMSearchResult.d.ts +4 -1
- package/lib/components/features/search/TMSearchResult.js +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +5 -2
- package/lib/components/features/search/TMSearchResultsMenuItems.js +7 -2
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/package.json +1 -1
|
@@ -10,6 +10,10 @@ interface ITMArchiveProps {
|
|
|
10
10
|
connectorFileSave?: () => Promise<File>;
|
|
11
11
|
onSavedAsyncCallback?: (tid: number | undefined, did: number | undefined) => Promise<void>;
|
|
12
12
|
enableDragDropOverlay?: boolean;
|
|
13
|
+
passToSearch?: (tid: number | undefined, outputMids: Array<{
|
|
14
|
+
mid: number;
|
|
15
|
+
value: string;
|
|
16
|
+
}>) => void;
|
|
13
17
|
}
|
|
14
18
|
declare const TMArchive: React.FunctionComponent<ITMArchiveProps>;
|
|
15
19
|
export default TMArchive;
|
|
@@ -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 }) => {
|
|
15
|
+
const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, connectorFileSave = undefined, onSavedAsyncCallback, inputMids = [], enableDragDropOverlay = false, passToSearch }) => {
|
|
16
16
|
const [currentTID, setCurrentTID] = useState(inputTID ?? 0);
|
|
17
17
|
const [mruTIDs, setMruTIDs] = useState([]);
|
|
18
18
|
const [currentMruTID, setCurrentMruTID] = useState(0);
|
|
@@ -29,12 +29,12 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
29
29
|
if (!currentTID || currentTID <= 0) {
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
if (onDcmtTypeSelect
|
|
32
|
+
if (onDcmtTypeSelect)
|
|
33
33
|
onDcmtTypeSelect(currentTID);
|
|
34
34
|
DcmtTypeListCacheService.GetAsync(currentTID).then(async (dtd) => {
|
|
35
35
|
setFromDTD(dtd);
|
|
36
36
|
});
|
|
37
|
-
}, [currentTID, onDcmtTypeSelect
|
|
37
|
+
}, [currentTID, onDcmtTypeSelect]);
|
|
38
38
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
39
39
|
const tmTreeSelectorElement = useMemo(() => _jsx(TMTreeSelectorWrapper, { isMobile: isMobile, onSelectedTIDChanged: (tid) => {
|
|
40
40
|
setCurrentTID(tid);
|
|
@@ -52,7 +52,11 @@ const TMArchive = ({ onDcmtTypeSelect = undefined, inputTID, inputFile = null, c
|
|
|
52
52
|
setMruTIDs(newMruTIDS);
|
|
53
53
|
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
54
54
|
const tmFormElement = useMemo(() => currentTID ?
|
|
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
|
|
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
|
+
if (onDcmtTypeSelect)
|
|
57
|
+
onDcmtTypeSelect(currentTID);
|
|
58
|
+
passToSearch(currentTID, outputMids);
|
|
59
|
+
} : undefined })
|
|
56
60
|
:
|
|
57
61
|
_jsx(TMPanel, { title: 'Archiviazione', allowMaximize: false, children: _jsxs(TMLayoutContainer, { gap: 30, alignItems: 'center', justifyContent: 'center', children: [_jsx(StyledToppyTextContainer, { children: _jsx(StyledToppyText, { children: SDKUI_Localizator.DcmtTypeSelect }) }), _jsx(StyledToppyImage, { src: Logo, alt: 'Toppy' })] }) }), [currentTID, deviceType, mruTIDs, inputFile, inputMids]);
|
|
58
62
|
const allInitialPanelVisibility = {
|
|
@@ -41,6 +41,10 @@ interface ITMDcmtFormProps {
|
|
|
41
41
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
42
42
|
s4TViewerDialogComponent?: React.ReactNode;
|
|
43
43
|
enableDragDropOverlay?: boolean;
|
|
44
|
+
passToSearch?: (outputMids: Array<{
|
|
45
|
+
mid: number;
|
|
46
|
+
value: string;
|
|
47
|
+
}>) => void;
|
|
44
48
|
}
|
|
45
49
|
declare const TMDcmtForm: React.FC<ITMDcmtFormProps>;
|
|
46
50
|
export default TMDcmtForm;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
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-beta';
|
|
5
5
|
import { ContextMenu } from 'devextreme-react';
|
|
@@ -8,7 +8,7 @@ import { DownloadTypes, FormModes } from '../../../ts';
|
|
|
8
8
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
9
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
10
|
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
11
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow } from '../../../helper';
|
|
11
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, svgToString, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare } from '../../../helper';
|
|
12
12
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
13
13
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
14
14
|
import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
@@ -34,9 +34,10 @@ import { useWorkflowApprove } from '../../../hooks/useWorkflowApprove';
|
|
|
34
34
|
import ToppyHelpCenter from '../assistant/ToppyHelpCenter';
|
|
35
35
|
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
36
36
|
import WFDiagram from '../workflow/diagram/WFDiagram';
|
|
37
|
+
import TMTooltip from '../../base/TMTooltip';
|
|
37
38
|
let abortControllerLocal = new AbortController();
|
|
38
39
|
//#endregion
|
|
39
|
-
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false }) => {
|
|
40
|
+
const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes.Update, onClose, onSavedAsyncCallback, TID, DID, formMode = FormModes.Update, canNext, canPrev, count, itemIndex, onNext, onPrev, allowNavigation = true, allowRelations = true, isClosable = false, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, showDcmtFormSidebar = true, invokedByTodo = false, titleModal, isModal = false, widthModal = "100%", heightModal = "100%", groupId, onWFOperationCompleted, onTaskCompleted, inputFile = null, taskFormDialogComponent, taskMoreInfo, connectorFileSave = undefined, inputMids = [], onOpenS4TViewerRequest, s4TViewerDialogComponent, enableDragDropOverlay = false, passToSearch }) => {
|
|
40
41
|
const [id, setID] = useState('');
|
|
41
42
|
const [showWaitPanelLocal, setShowWaitPanelLocal] = useState(false);
|
|
42
43
|
const [waitPanelTitleLocal, setWaitPanelTitleLocal] = useState('');
|
|
@@ -58,6 +59,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
58
59
|
const [showRejectPopup, setShowRejectPopup] = useState(false);
|
|
59
60
|
const [showReAssignPopup, setShowReAssignPopup] = useState(false);
|
|
60
61
|
const [showMoreInfoPopup, setShowMoreInfoPopup] = useState(false);
|
|
62
|
+
const appliedInputMidsRef = useRef(null);
|
|
61
63
|
const [isOpenDetails, setIsOpenDetails] = useState(false);
|
|
62
64
|
const [isOpenMaster, setIsOpenMaster] = useState(false);
|
|
63
65
|
const [secondaryMasterDcmts, setSecondaryMasterDcmts] = useState([]);
|
|
@@ -202,6 +204,47 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
202
204
|
return;
|
|
203
205
|
setFocusedMetadataValue(undefined);
|
|
204
206
|
}, [fromDTD, layoutMode]);
|
|
207
|
+
useEffect(() => {
|
|
208
|
+
if (!inputMids || inputMids.length === 0)
|
|
209
|
+
return;
|
|
210
|
+
if (layoutMode !== LayoutModes.Ark)
|
|
211
|
+
return;
|
|
212
|
+
if (!formData || formData.length === 0)
|
|
213
|
+
return;
|
|
214
|
+
if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, inputMids))
|
|
215
|
+
return;
|
|
216
|
+
appliedInputMidsRef.current = inputMids;
|
|
217
|
+
let data = structuredClone(formData);
|
|
218
|
+
for (let md of data) {
|
|
219
|
+
if (!md.mid)
|
|
220
|
+
continue;
|
|
221
|
+
if (md.mid > 99) {
|
|
222
|
+
const defaultValue = md.md?.defaultValue;
|
|
223
|
+
if (defaultValue) {
|
|
224
|
+
if (FormulaHelper.isFormula(defaultValue)) {
|
|
225
|
+
md.value = undefined;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
md.value = defaultValue;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else if (formDataOrig.find(metadata => metadata.mid === md.mid)?.value === undefined) {
|
|
232
|
+
if (md.value)
|
|
233
|
+
md.value = undefined;
|
|
234
|
+
}
|
|
235
|
+
else if (md.value && md.value.length > 0) {
|
|
236
|
+
md.value = '';
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
inputMids.forEach(inputMid => {
|
|
241
|
+
const md = data.find(m => m.mid === inputMid.mid);
|
|
242
|
+
if (md) {
|
|
243
|
+
md.value = inputMid.value;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
setFormData(data);
|
|
247
|
+
}, [inputMids, layoutMode, formData, formDataOrig]);
|
|
205
248
|
useEffect(() => {
|
|
206
249
|
const loadAllWfData = async () => {
|
|
207
250
|
if (layoutMode !== LayoutModes.Update || !DID) {
|
|
@@ -278,6 +321,14 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
278
321
|
const handleRemoveItem = (tid, did) => {
|
|
279
322
|
setSecondaryMasterDcmts((prevItems) => prevItems.filter(item => item.TID !== tid && item.DID !== did));
|
|
280
323
|
};
|
|
324
|
+
const handlePassToSearch = () => {
|
|
325
|
+
if (!passToSearch)
|
|
326
|
+
return;
|
|
327
|
+
const outputMids = formData
|
|
328
|
+
.filter(md => md.mid && md.mid > 100 && md.value && md.value.length > 0)
|
|
329
|
+
.map(md => ({ mid: md.mid, value: md.value }));
|
|
330
|
+
passToSearch(outputMids);
|
|
331
|
+
};
|
|
281
332
|
const isPreviewDisabled = layoutMode === LayoutModes.Ark && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata;
|
|
282
333
|
const isBoardDisabled = layoutMode !== LayoutModes.Update || fromDTD?.hasBlog !== 1;
|
|
283
334
|
const isSysMetadataDisabled = layoutMode !== LayoutModes.Update;
|
|
@@ -298,7 +349,8 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
298
349
|
...(allowRelations && currentTIDHasDetailRelations ? [{ icon: svgToString(_jsx(IconDetailDcmts, {})), operationType: 'singleRow', disabled: isDetailsDisabled, text: SDKUI_Localizator.DcmtsDetail, onClick: () => { if (!isDetailsDisabled)
|
|
299
350
|
setIsOpenDetails(!isOpenDetails); } }] : []),
|
|
300
351
|
];
|
|
301
|
-
const formToolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowNavigation && canPrev != undefined && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', display: 'flex' }, children: `${itemIndex}/${count}` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: calcIsModified(formData, formDataOrig), formMode: formMode, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: calcIsModified(formData, formDataOrig), formMode: formMode, canNext: canNext, onNext: onNext }), layoutMode === LayoutModes.Update && _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), layoutMode === LayoutModes.Update && _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` })
|
|
352
|
+
const formToolbar = _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: '10px' }, children: [allowNavigation && canPrev != undefined && _jsx("p", { style: { textAlign: 'center', padding: '1px 4px', display: 'flex' }, children: `${itemIndex}/${count}` }), allowNavigation && canPrev != undefined && _jsx(TMSaveFormButtonPrevious, { btnStyle: 'icon', iconColor: 'white', isModified: calcIsModified(formData, formDataOrig), formMode: formMode, canPrev: canPrev, onPrev: onPrev }), allowNavigation && canNext != undefined && _jsx(TMSaveFormButtonNext, { btnStyle: 'icon', iconColor: 'white', isModified: calcIsModified(formData, formDataOrig), formMode: formMode, canNext: canNext, onNext: onNext }), layoutMode === LayoutModes.Update && _jsx(IconMenuVertical, { id: `commands-detail-${id}`, color: 'white', cursor: 'pointer' }), layoutMode === LayoutModes.Update && _jsx(ContextMenu, { showEvent: 'click', dataSource: commandsMenuItems, target: `#commands-detail-${id}` }), layoutMode === LayoutModes.Ark &&
|
|
353
|
+
_jsx(TMTooltip, { content: SDKUI_Localizator.PassToSearch, position: 'bottom', children: _jsx(IconSearch, { style: { cursor: 'pointer' }, onClick: handlePassToSearch }) })] });
|
|
302
354
|
function createChange(mid, metadataType, modifiedValue) {
|
|
303
355
|
return { mid, metadataType, modifiedValue };
|
|
304
356
|
}
|
|
@@ -6,6 +6,10 @@ interface ITMSearchProps {
|
|
|
6
6
|
isVisible?: boolean;
|
|
7
7
|
inputTID?: number;
|
|
8
8
|
inputSqdID?: number;
|
|
9
|
+
inputMids?: Array<{
|
|
10
|
+
mid: number;
|
|
11
|
+
value: string;
|
|
12
|
+
}>;
|
|
9
13
|
isExpertMode?: boolean;
|
|
10
14
|
floatingActionConfig?: TMSearchResultFloatingActionConfig;
|
|
11
15
|
onRefreshAfterAddDcmtToFavs?: () => void;
|
|
@@ -17,7 +21,10 @@ interface ITMSearchProps {
|
|
|
17
21
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
18
22
|
showTodoDcmtForm?: boolean;
|
|
19
23
|
openInOffice?: (selectedDcmtsOrFocused: Array<DcmtInfo>) => Promise<void>;
|
|
20
|
-
passToArchiveCallback?: (
|
|
24
|
+
passToArchiveCallback?: (outputMids: Array<{
|
|
25
|
+
mid: number;
|
|
26
|
+
value: string;
|
|
27
|
+
}>) => void;
|
|
21
28
|
onCurrentTIDChangedCallback?: (tid: number | undefined) => void;
|
|
22
29
|
}
|
|
23
30
|
declare const TMSearch: React.FunctionComponent<ITMSearchProps>;
|
|
@@ -18,7 +18,7 @@ var TMSearchViews;
|
|
|
18
18
|
TMSearchViews[TMSearchViews["Search"] = 0] = "Search";
|
|
19
19
|
TMSearchViews[TMSearchViews["Result"] = 1] = "Result";
|
|
20
20
|
})(TMSearchViews || (TMSearchViews = {}));
|
|
21
|
-
const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm, passToArchiveCallback, onCurrentTIDChangedCallback }) => {
|
|
21
|
+
const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, inputMids, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, floatingActionConfig, onFileOpened, onRefreshAfterAddDcmtToFavs, onTaskCreateRequest, openWGsCopyMoveForm, openEditPdf, openS4TViewer, onOpenS4TViewerRequest, showTodoDcmtForm, passToArchiveCallback, onCurrentTIDChangedCallback }) => {
|
|
22
22
|
const [allSQDs, setAllSQDs] = useState([]);
|
|
23
23
|
const [filteredByTIDSQDs, setFilteredByTIDSQDs] = useState([]);
|
|
24
24
|
const [currentSQD, setCurrentSQD] = useState();
|
|
@@ -35,7 +35,7 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, isExpertMode
|
|
|
35
35
|
if (onCurrentTIDChangedCallback) {
|
|
36
36
|
onCurrentTIDChangedCallback(currentTID);
|
|
37
37
|
}
|
|
38
|
-
}, [currentTID]);
|
|
38
|
+
}, [currentTID, onCurrentTIDChangedCallback]);
|
|
39
39
|
useEffect(() => {
|
|
40
40
|
setMruTIDs(SDKUI_Globals.userSettings.searchSettings.mruTIDs);
|
|
41
41
|
loadDataSQDsAsync(false);
|
|
@@ -153,7 +153,7 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, isExpertMode
|
|
|
153
153
|
SDKUI_Globals.userSettings.searchSettings.mruTIDs = newMruTIDS;
|
|
154
154
|
setMruTIDs(newMruTIDS);
|
|
155
155
|
} }), [mruTIDs, currentMruTID, deviceType]);
|
|
156
|
-
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, onBackToResult: () => { setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: (searchResult, qd) => {
|
|
156
|
+
const tmSearchQueryPanelElement = useMemo(() => _jsx(TMSearchQueryPanelWrapper, { passToArchiveCallback: passToArchiveCallback, isExpertMode: isExpertMode, showBackToResultButton: searchResult.length > 0, fromDTD: fromDTD, SQD: currentSQD, inputMids: inputMids, onBackToResult: () => { setCurrentSearchView(TMSearchViews.Result); }, onSearchCompleted: (searchResult, qd) => {
|
|
157
157
|
setSearchResult(searchResult);
|
|
158
158
|
if (searchResult.length <= 0)
|
|
159
159
|
return;
|
|
@@ -168,7 +168,7 @@ const TMSearch = ({ openInOffice, isVisible, inputTID, inputSqdID, isExpertMode
|
|
|
168
168
|
}, onSqdSaved: async (newSqd) => {
|
|
169
169
|
await loadDataSQDsAsync(true, newSqd.masterTID);
|
|
170
170
|
await setSQDAsync(newSqd);
|
|
171
|
-
} }), [fromDTD, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback]);
|
|
171
|
+
} }), [fromDTD, currentSQD, isExpertMode, mruTIDs, searchResult, passToArchiveCallback, inputMids]);
|
|
172
172
|
const tmSavedQuerySelectorElement = useMemo(() => _jsxs(TabPanel, { width: "100%", height: "100%", showNavButtons: true, repaintChangesOnly: true, selectedIndex: currentSQDMode, onSelectedIndexChange: (index) => setCurrentSQDMode(index), children: [(currentTID || currentSQD) ? _jsx(Item, { title: fromDTD?.nameLoc, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: false, items: filteredByTIDSQDs, selectedId: currentSQD?.id, onRefreshData: () => { loadDataSQDsAsync(true); }, onItemClick: (sqd) => {
|
|
173
173
|
onSQDItemClick(sqd, setSQDAsync);
|
|
174
174
|
}, onDeleted: (sqd) => onSQDDeleted(sqd, sqd.id == currentSQD?.id ? filteredByTIDSQDs.find(o => o.id == 1) : currentSQD, setSQDAsync) }) }) : _jsx(_Fragment, {}), _jsx(Item, { title: SDKUI_Localizator.Alls2, children: _jsx(TMSavedQuerySelectorWrapper, { allowShowSearch: true, items: allSQDs, manageDefault: false, onItemClick: (sqd) => {
|
|
@@ -232,11 +232,11 @@ const TMRecentsManagerWrapper = ({ mruTIDs, currentMruTID, deviceType, onSelecte
|
|
|
232
232
|
onDeletedTID?.(tid);
|
|
233
233
|
} }));
|
|
234
234
|
};
|
|
235
|
-
const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, showBackToResultButton, onSearchCompleted, onSqdSaved, onBackToResult, passToArchiveCallback }) => {
|
|
235
|
+
const TMSearchQueryPanelWrapper = ({ fromDTD, SQD, isExpertMode, showBackToResultButton, onSearchCompleted, onSqdSaved, onBackToResult, passToArchiveCallback, inputMids }) => {
|
|
236
236
|
const { setPanelVisibilityById, toggleMaximize, countVisibleLeafPanels } = useTMPanelManagerContext();
|
|
237
237
|
const deviceType = useDeviceType();
|
|
238
238
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
239
|
-
return (_jsx(TMSearchQueryPanel, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback }));
|
|
239
|
+
return (_jsx(TMSearchQueryPanel, { onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('TMSearchQueryPanel', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("TMSearchQueryPanel") : undefined, isExpertMode: isExpertMode, fromDTD: fromDTD, SQD: SQD, inputMids: inputMids, onSearchCompleted: onSearchCompleted, onSqdSaved: onSqdSaved, showBackToResultButton: showBackToResultButton, onBackToResult: onBackToResult, passToArchiveCallback: passToArchiveCallback }));
|
|
240
240
|
};
|
|
241
241
|
const TMSavedQuerySelectorWrapper = ({ items, selectedId, allowShowSearch, manageDefault, onRefreshData, onItemClick, onDeleted }) => {
|
|
242
242
|
const { setPanelVisibilityById } = useTMPanelManagerContext();
|
|
@@ -5,6 +5,10 @@ interface ITMSearchQueryPanelProps {
|
|
|
5
5
|
SQD?: SavedQueryDescriptor;
|
|
6
6
|
isExpertMode?: boolean;
|
|
7
7
|
showBackToResultButton?: boolean;
|
|
8
|
+
inputMids?: Array<{
|
|
9
|
+
mid: number;
|
|
10
|
+
value: string;
|
|
11
|
+
}>;
|
|
8
12
|
onBack?: () => void;
|
|
9
13
|
onBackToResult?: () => void;
|
|
10
14
|
onSqdSaved?: (newSqd: SavedQueryDescriptor) => void;
|
|
@@ -12,7 +16,10 @@ interface ITMSearchQueryPanelProps {
|
|
|
12
16
|
onClosePanel?: () => void;
|
|
13
17
|
allowMaximize?: boolean;
|
|
14
18
|
onMaximizePanel?: () => void;
|
|
15
|
-
passToArchiveCallback?: (
|
|
19
|
+
passToArchiveCallback?: (outputMids: Array<{
|
|
20
|
+
mid: number;
|
|
21
|
+
value: string;
|
|
22
|
+
}>) => void;
|
|
16
23
|
}
|
|
17
24
|
declare const TMSearchQueryPanel: React.FunctionComponent<ITMSearchQueryPanelProps>;
|
|
18
25
|
export default TMSearchQueryPanel;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { PlatformObjectValidator, WhereItem, SDK_Localizator, OrderByItem, SelectItem, SelectItemVisibilities, SDK_Globals, SavedQueryCacheService, SearchEngine, QueryOperators } from '@topconsultnpm/sdk-ts-beta';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import TMSearchQueryEditor from './TMSearchQueryEditor';
|
|
@@ -23,7 +23,7 @@ import TMQueryEditor from '../../query/TMQueryEditor';
|
|
|
23
23
|
import TMSavedQueryForm from './TMSavedQueryForm';
|
|
24
24
|
import { AdvancedMenuButtons } from '../../editors/TMMetadataValues';
|
|
25
25
|
import TMShowAllOrMaxItemsButton from '../../base/TMShowAllOrMaxItemsButton';
|
|
26
|
-
const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, onSearchCompleted, onSqdSaved, onBack, onClosePanel, allowMaximize = true, onMaximizePanel, onBackToResult, passToArchiveCallback }) => {
|
|
26
|
+
const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SDKUI_Globals.userSettings.advancedSettings.expertMode === 1, SQD, inputMids, onSearchCompleted, onSqdSaved, onBack, onClosePanel, allowMaximize = true, onMaximizePanel, onBackToResult, passToArchiveCallback }) => {
|
|
27
27
|
const [confirmQueryParams, ConfirmQueryParamsDialog] = useQueryParametersDialog();
|
|
28
28
|
const [qd, setQd] = useState();
|
|
29
29
|
const [shouldSearch, setShouldSearch] = useState(false);
|
|
@@ -42,11 +42,44 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
42
42
|
const deviceType = useDeviceType();
|
|
43
43
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
44
44
|
let initialMaxItems = deviceType === DeviceType.MOBILE ? 8 : 12;
|
|
45
|
+
const appliedInputMidsRef = useRef(null);
|
|
45
46
|
useEffect(() => {
|
|
46
47
|
if (!SQD)
|
|
47
48
|
return;
|
|
48
49
|
setDataAsync(SQD);
|
|
49
50
|
}, [SQD]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!inputMids || inputMids.length === 0 || !qd || !fromDTD)
|
|
53
|
+
return;
|
|
54
|
+
if (appliedInputMidsRef.current && deepCompare(appliedInputMidsRef.current, inputMids))
|
|
55
|
+
return;
|
|
56
|
+
appliedInputMidsRef.current = inputMids;
|
|
57
|
+
const newWhere = qd.where?.map((curItem) => {
|
|
58
|
+
let newWi = new WhereItem();
|
|
59
|
+
newWi.init({ ...curItem, value1: undefined, value2: undefined });
|
|
60
|
+
return newWi;
|
|
61
|
+
}) || [];
|
|
62
|
+
inputMids.forEach(im => {
|
|
63
|
+
const md = fromDTD.metadata?.find(m => m.id === im.mid);
|
|
64
|
+
const defaultOperator = getDefaultOperator(md?.dataDomain, md?.dataType);
|
|
65
|
+
let existingWi = newWhere.find(wi => wi.mid === im.mid);
|
|
66
|
+
if (existingWi) {
|
|
67
|
+
existingWi.value1 = im.value;
|
|
68
|
+
existingWi.operator = defaultOperator;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const wi = new WhereItem();
|
|
72
|
+
wi.tid = fromDTD.id;
|
|
73
|
+
wi.mid = im.mid;
|
|
74
|
+
wi.value1 = im.value;
|
|
75
|
+
wi.operator = defaultOperator;
|
|
76
|
+
wi.or = false;
|
|
77
|
+
newWhere.push(wi);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
setQd({ ...qd, where: newWhere });
|
|
81
|
+
setShowAllMdWhere(true);
|
|
82
|
+
}, [inputMids, qd, fromDTD]);
|
|
50
83
|
// Eseguire la ricerca quando shouldSearch è true e qd è definito
|
|
51
84
|
useEffect(() => {
|
|
52
85
|
if (shouldSearch && qd) {
|
|
@@ -155,6 +188,14 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
155
188
|
setShowDistinctValuesPanel(true);
|
|
156
189
|
}
|
|
157
190
|
}, []);
|
|
191
|
+
const handlePassToArchive = useCallback(() => {
|
|
192
|
+
if (!passToArchiveCallback || !qd?.where)
|
|
193
|
+
return;
|
|
194
|
+
const outputMids = qd.where
|
|
195
|
+
.filter(wi => wi.mid && wi.value1 && wi.value1.length > 0)
|
|
196
|
+
.map(wi => ({ mid: wi.mid, value: wi.value1 }));
|
|
197
|
+
passToArchiveCallback(outputMids);
|
|
198
|
+
}, [passToArchiveCallback, qd?.where]);
|
|
158
199
|
const handleCloseFiltersConfig = useCallback(() => setShowFiltersConfig(false), []);
|
|
159
200
|
const handleChooseFilters = useCallback((tid_mids) => {
|
|
160
201
|
if (!fromDTD?.metadata)
|
|
@@ -240,7 +281,7 @@ const TMSearchQueryPanel = ({ fromDTD, showBackToResultButton, isExpertMode = SD
|
|
|
240
281
|
{ icon: _jsx(IconEdit, {}), beginGroup: true, text: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryWhere}`, onClick: () => { setShowFiltersConfig(true); } },
|
|
241
282
|
{ icon: _jsx(IconEdit, {}), text: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QuerySelect}`, onClick: () => { setShowOutputConfig(true); } },
|
|
242
283
|
{ icon: _jsx(IconEdit, {}), text: `${SDKUI_Localizator.Configure} - ${SDK_Localizator.QueryOrderBy}`, onClick: () => { setShowOrderByConfig(true); } },
|
|
243
|
-
{ icon: _jsx(IconMenuCAArchive, { fontSize: 24 }), beginGroup: true, text: SDKUI_Localizator.PassToArchive, onClick:
|
|
284
|
+
{ icon: _jsx(IconMenuCAArchive, { fontSize: 24 }), beginGroup: true, text: SDKUI_Localizator.PassToArchive, onClick: handlePassToArchive }
|
|
244
285
|
] })
|
|
245
286
|
: _jsx(_Fragment, {}) }), children: [_jsx(ConfirmQueryParamsDialog, {}), SQD
|
|
246
287
|
? _jsxs("div", { style: { height: '100%', width: '100%', position: 'relative', display: 'flex', flexDirection: 'column', gap: 5 }, children: [showAdvancedSearch
|
|
@@ -34,7 +34,10 @@ interface ITMSearchResultProps {
|
|
|
34
34
|
openAddDocumentForm?: () => void;
|
|
35
35
|
openS4TViewer?: boolean;
|
|
36
36
|
onOpenS4TViewerRequest?: (dcmtInfo: Array<DcmtInfo>, onRefreshSearchAsync?: (() => Promise<void>)) => void;
|
|
37
|
-
passToArchiveCallback?: (
|
|
37
|
+
passToArchiveCallback?: (outputMids: Array<{
|
|
38
|
+
mid: number;
|
|
39
|
+
value: string;
|
|
40
|
+
}>) => void;
|
|
38
41
|
showTodoDcmtForm?: boolean;
|
|
39
42
|
}
|
|
40
43
|
declare const TMSearchResult: React.FC<ITMSearchResultProps>;
|
|
@@ -241,7 +241,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
241
241
|
return;
|
|
242
242
|
if (e.target === 'content') {
|
|
243
243
|
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);
|
|
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, currentMetadataValues);
|
|
245
245
|
e.items.push(...menuItems);
|
|
246
246
|
}
|
|
247
247
|
};
|
|
@@ -368,7 +368,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
368
368
|
}
|
|
369
369
|
};
|
|
370
370
|
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 &&
|
|
371
|
-
_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) })] });
|
|
371
|
+
_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, currentMetadataValues) })] });
|
|
372
372
|
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') })] });
|
|
373
373
|
const handleAddItem = (tid, did) => {
|
|
374
374
|
let newItem = { TID: tid ?? 0, DID: did ?? 0 };
|
|
@@ -385,7 +385,7 @@ const TMSearchResult = ({ context = SearchResultContext.METADATA_SEARCH, isVisib
|
|
|
385
385
|
_jsx(TMLayoutItem, { children: _jsx(TMSearchResultSelector, { searchResults: currentSearchResults, disableAccordionIfSingleCategory: disableAccordionIfSingleCategory, selectedTID: selectedSearchResultTID, onSelectionChanged: onSearchResultSelectionChanged }) })
|
|
386
386
|
:
|
|
387
387
|
_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 &&
|
|
388
|
-
_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) })] })] })] }), 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: () => {
|
|
388
|
+
_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, currentMetadataValues) })] })] })] }), 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: () => {
|
|
389
389
|
setIsOpenBatchUpdate(false);
|
|
390
390
|
}, onSavedCallbackAsync: async () => {
|
|
391
391
|
setIsOpenBatchUpdate(false);
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DcmtTypeDescriptor, FileDescriptor, FileFormats, LayoutModes, WorkingGroupDescriptor } from '@topconsultnpm/sdk-ts-beta';
|
|
3
3
|
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
4
|
-
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResultContext } from '../../../ts';
|
|
4
|
+
import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, MetadataValueDescriptorEx, 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?: (
|
|
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<{
|
|
8
|
+
mid: number;
|
|
9
|
+
value: string;
|
|
10
|
+
}>) => void, currentMetadataValues?: MetadataValueDescriptorEx[]) => Array<TMDataGridContextMenuItem>;
|
|
@@ -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) => {
|
|
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, currentMetadataValues) => {
|
|
79
79
|
const addToFavoriteMenuItem = () => {
|
|
80
80
|
return {
|
|
81
81
|
icon: svgToString(_jsx(IconStar, {})),
|
|
@@ -214,7 +214,12 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
214
214
|
text: SDKUI_Localizator.PassToArchive,
|
|
215
215
|
operationType: 'singleRow',
|
|
216
216
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
217
|
-
onClick: async () => {
|
|
217
|
+
onClick: async () => {
|
|
218
|
+
const outputMids = currentMetadataValues
|
|
219
|
+
?.filter(md => md.mid && md.mid > 100 && md.value && md.value.length > 0)
|
|
220
|
+
.map(md => ({ mid: md.mid, value: md.value })) || [];
|
|
221
|
+
passToArchiveCallback?.(outputMids);
|
|
222
|
+
}
|
|
218
223
|
};
|
|
219
224
|
};
|
|
220
225
|
const pdfEditorMenuItem = (openEditPdfCallback) => {
|
|
@@ -380,6 +380,7 @@ export declare class SDKUI_Localizator {
|
|
|
380
380
|
static get Participants(): "Teilnehmer" | "Participants" | "Participantes" | "Partecipanti";
|
|
381
381
|
static get Password(): "Passwort" | "Password" | "Contraseña" | "Mot de passe" | "Senha";
|
|
382
382
|
static get PassToArchive(): "Zur Archivierung übergeben" | "Pass to archive" | "Pasar a archivo" | "Passer à l'archivage" | "Passar para arquivo" | "Passa ad archiviazione";
|
|
383
|
+
static get PassToSearch(): "Zur Suche übergeben" | "Pass to search" | "Pasar a búsqueda" | "Passer à la recherche" | "Passar para pesquisa" | "Passa a ricerca";
|
|
383
384
|
static get PasswordMustContain(): "Das Passwort muss enthalten" | "The password must contain" | "La contraseña debe contener" | "Le mot de passe doit contenir" | "A palavra-passe deve conter" | "La password deve contenere";
|
|
384
385
|
static get PasswordChangedSuccessfully(): "Das Passwort wurde erfolgreich geändert." | "Password changed successfully." | "Contraseña cambiada con éxito." | "Le mot de passe a été changé avec succès." | "Senha alterada com sucesso." | "Password cambiata con successo.";
|
|
385
386
|
static get PasswordContainsUsernameError(): "Das Passwort darf den Benutzernamen nicht enthalten" | "The password cannot contain the username" | "La contraseña no puede contener el nombre de usuario" | "Le mot de passe ne peut pas contenir le nom d'utilisateur" | "A senha não pode conter o nome de usuário" | "La password non può contenere il nome utente";
|
|
@@ -3708,6 +3708,16 @@ export class SDKUI_Localizator {
|
|
|
3708
3708
|
default: return "Passa ad archiviazione";
|
|
3709
3709
|
}
|
|
3710
3710
|
}
|
|
3711
|
+
static get PassToSearch() {
|
|
3712
|
+
switch (this._cultureID) {
|
|
3713
|
+
case CultureIDs.De_DE: return "Zur Suche übergeben";
|
|
3714
|
+
case CultureIDs.En_US: return "Pass to search";
|
|
3715
|
+
case CultureIDs.Es_ES: return "Pasar a búsqueda";
|
|
3716
|
+
case CultureIDs.Fr_FR: return "Passer à la recherche";
|
|
3717
|
+
case CultureIDs.Pt_PT: return "Passar para pesquisa";
|
|
3718
|
+
default: return "Passa a ricerca";
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3711
3721
|
static get PasswordMustContain() {
|
|
3712
3722
|
switch (this._cultureID) {
|
|
3713
3723
|
case CultureIDs.De_DE: return "Das Passwort muss enthalten";
|