@topconsultnpm/sdkui-react-beta 6.15.98 → 6.15.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/assets/icomoon.svg +96 -96
- package/lib/assets/italy.svg +16 -16
- package/lib/assets/topmedia-six.svg +65 -65
- package/lib/assets/topmeida-six-bianco.svg +65 -65
- package/lib/components/features/documents/TMDcmtForm.js +80 -48
- package/lib/components/features/workflow/diagram/WFDiagram.js +0 -1
- package/lib/components/sidebar/TMHeader.js +2 -2
- package/lib/helper/SDKUI_Localizator.d.ts +1 -0
- package/lib/helper/SDKUI_Localizator.js +10 -0
- package/lib/helper/queryHelper.d.ts +1 -0
- package/lib/helper/queryHelper.js +31 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationBut
|
|
|
7
7
|
import { DownloadTypes, FormModes } from '../../../ts';
|
|
8
8
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
9
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
10
|
-
import { handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
10
|
+
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
11
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, IconZoomIn, IconZoomOut } from '../../../helper';
|
|
12
12
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
13
13
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
@@ -207,38 +207,69 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
207
207
|
setFocusedMetadataValue(undefined);
|
|
208
208
|
}, [fromDTD, layoutMode]);
|
|
209
209
|
useEffect(() => {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
210
|
+
const loadAllWfData = async () => {
|
|
211
|
+
if (layoutMode !== LayoutModes.Update || !DID) {
|
|
212
|
+
setWorkItems([]);
|
|
213
|
+
setWorkflows([]);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
setIsWFDataLoading(true);
|
|
217
|
+
try {
|
|
218
|
+
// 1. item da processare in modo sincrono
|
|
219
|
+
const itemsToProcess = [];
|
|
220
|
+
for (const workflow of workflowApproveData) {
|
|
221
|
+
for (const dataRow of workflow.dtdResult?.rows ?? []) {
|
|
222
|
+
const did = Number(dataRow?.[1]);
|
|
223
|
+
if (did === Number(DID)) {
|
|
224
|
+
const tid = Number(dataRow?.[0]);
|
|
225
|
+
itemsToProcess.push({ tid, did });
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
if (itemsToProcess.length === 0) {
|
|
230
|
+
setWorkItems([]);
|
|
231
|
+
setWorkflows([]);
|
|
232
|
+
setIsWFDataLoading(false);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
// promises per i setID in modo condizionale
|
|
236
|
+
const setIDFromFormData = formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value;
|
|
237
|
+
let setIDPromises;
|
|
238
|
+
if (setIDFromFormData !== undefined) {
|
|
239
|
+
// Se abbiamo il setID dal form, non facciamo chiamate di rete.
|
|
240
|
+
setIDPromises = itemsToProcess.map(() => Promise.resolve(setIDFromFormData));
|
|
228
241
|
}
|
|
242
|
+
else {
|
|
243
|
+
// Altrimenti, procediamo con le chiamate di rete come prima.
|
|
244
|
+
setIDPromises = itemsToProcess.map(item => getWorkItemSetIDAsync(item.tid, item.did));
|
|
245
|
+
}
|
|
246
|
+
// Crea un array di Promise per tutte le chiamate a GetWFInfoAsync
|
|
247
|
+
const workflowInfoPromises = itemsToProcess.map(item => WorkflowCacheService.GetWFInfoAsync(item.tid));
|
|
248
|
+
// Esegui tutte le chiamate in parallelo e attendi i risultati
|
|
249
|
+
const setIDResults = await Promise.all(setIDPromises);
|
|
250
|
+
const workflowInfoResults = await Promise.all(workflowInfoPromises);
|
|
251
|
+
// Combina i risultati
|
|
252
|
+
const finalWorkItems = itemsToProcess.map((item, index) => ({
|
|
253
|
+
...item,
|
|
254
|
+
setID: setIDResults[index],
|
|
255
|
+
}));
|
|
256
|
+
const validWorkflows = workflowInfoResults.filter(Boolean);
|
|
257
|
+
// Aggiorna lo stato una sola volta con i dati finali
|
|
258
|
+
setWorkItems(finalWorkItems);
|
|
259
|
+
setWorkflows(validWorkflows);
|
|
229
260
|
}
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
}, [workflowApproveData, DID, layoutMode]);
|
|
261
|
+
catch (error) {
|
|
262
|
+
console.error("Errore durante il caricamento dei dati del workflow:", error);
|
|
263
|
+
setWorkItems([]);
|
|
264
|
+
setWorkflows([]);
|
|
265
|
+
}
|
|
266
|
+
finally {
|
|
267
|
+
setIsWFDataLoading(false);
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
if (formData.length > 0)
|
|
271
|
+
loadAllWfData();
|
|
272
|
+
}, [formData, workflowApproveData, DID, layoutMode]);
|
|
242
273
|
const getSelectionDcmtInfo = () => {
|
|
243
274
|
let dcmts = [];
|
|
244
275
|
dcmts.push({ TID: TID ?? 0, DID: DID ?? 0 });
|
|
@@ -252,13 +283,16 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
252
283
|
setSecondaryMasterDcmts((prevItems) => prevItems.filter(item => item.TID !== tid && item.DID !== did));
|
|
253
284
|
};
|
|
254
285
|
const isPreviewDisabled = layoutMode === LayoutModes.Ark && fromDTD?.archiveConstraint === ArchiveConstraints.OnlyMetadata;
|
|
255
|
-
|
|
286
|
+
const isBoardDisabled = layoutMode !== LayoutModes.Update || fromDTD?.hasBlog !== 1;
|
|
256
287
|
const isSysMetadataDisabled = layoutMode !== LayoutModes.Update;
|
|
257
288
|
const isDetailsDisabled = layoutMode !== LayoutModes.Update || !DID;
|
|
258
289
|
const isMasterDisabled = layoutMode !== LayoutModes.Update || !DID;
|
|
259
290
|
const isWFDisabled = layoutMode !== LayoutModes.Update || fetchError || workItems.length <= 0;
|
|
260
291
|
const showToppyForApprove = layoutMode === LayoutModes.Update && !fetchError && workItems.length > 0 && !isOpenDetails && !isOpenMaster;
|
|
261
292
|
const showToppyForCompleteMoreInfo = layoutMode === LayoutModes.Update && isTaskMoreInfo(taskMoreInfo?.name) && taskMoreInfo?.state !== Task_States.Completed;
|
|
293
|
+
const isMobile = deviceType === DeviceType.MOBILE;
|
|
294
|
+
const isApprView = fromDTD?.templateTID === TemplateTIDs.WF_WIApprView;
|
|
295
|
+
const workitemSetID = workItems.find(o => o.did === Number(DID))?.setID || formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value;
|
|
262
296
|
const approvalVID = workItems.length > 0
|
|
263
297
|
? Number(workItems[0].tid) : -1;
|
|
264
298
|
const commandsMenuItems = [
|
|
@@ -484,9 +518,6 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
484
518
|
await onWFOperationCompleted?.();
|
|
485
519
|
onClose?.();
|
|
486
520
|
};
|
|
487
|
-
const isMobile = deviceType === DeviceType.MOBILE;
|
|
488
|
-
const isApprView = fromDTD?.templateTID === TemplateTIDs.WF_WIApprView;
|
|
489
|
-
const WIsetIdValue = workItems.find(o => o.did === Number(DID))?.setID || formData.find(o => o.md?.name === WorkItemMetadataNames.WI_SetID)?.value;
|
|
490
521
|
useEffect(() => {
|
|
491
522
|
if ((isApprView || TID === SystemTIDs.Drafts) && !showAll)
|
|
492
523
|
setShowAll(true);
|
|
@@ -525,7 +556,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
525
556
|
}, children: _jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento dati workflow'}...` })] }) }));
|
|
526
557
|
}
|
|
527
558
|
return (_jsxs("div", { style: { position: 'relative', width: '100%', height: '100%', display: 'flex', flexDirection: 'column', gap: 3 }, children: [workItems.length > 0
|
|
528
|
-
? _jsx(WFDiagram, { xmlDiagramString: workflows?.[0]?.diagram || '', currentSetID:
|
|
559
|
+
? _jsx(WFDiagram, { xmlDiagramString: workflows?.[0]?.diagram || '', currentSetID: workitemSetID, readOnly: true, zoomLevel: zoomLevel, translateX: 0, translateY: 0 })
|
|
529
560
|
: _jsx("div", { style: {
|
|
530
561
|
position: 'absolute',
|
|
531
562
|
top: '50%',
|
|
@@ -534,10 +565,10 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
534
565
|
fontSize: '1.1rem',
|
|
535
566
|
color: TMColors.primaryColor,
|
|
536
567
|
textAlign: 'center',
|
|
537
|
-
}, children: SDKUI_Localizator.
|
|
568
|
+
}, children: SDKUI_Localizator.WorkitemsToApproveNone }), workItems.length > 0 && _jsxs("div", { style: {
|
|
538
569
|
position: 'absolute',
|
|
539
570
|
left: 16,
|
|
540
|
-
bottom:
|
|
571
|
+
bottom: workitemSetID || workItems.length <= 0 ? 16 : 64,
|
|
541
572
|
display: 'flex',
|
|
542
573
|
flexDirection: 'row',
|
|
543
574
|
background: 'transparent linear-gradient(180deg, #E03A8B 9%, #C2388B 34%, #A63B8D 60%, #943C8D 83%, #8F3C8D 100%) 0% 0% no-repeat padding-box',
|
|
@@ -556,13 +587,13 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
556
587
|
alignItems: 'center',
|
|
557
588
|
padding: '0 8px',
|
|
558
589
|
borderRadius: 4
|
|
559
|
-
}, children: formattedZoomLevel })] }), !
|
|
590
|
+
}, children: formattedZoomLevel })] }), !workitemSetID && workItems.length > 0 &&
|
|
560
591
|
_jsx("div", { style: {
|
|
561
592
|
padding: 5,
|
|
562
593
|
backgroundColor: 'khaki',
|
|
563
594
|
borderRadius: 8
|
|
564
595
|
}, children: SDKUI_Localizator.WorkItemTechnicalNote_SetID })] }));
|
|
565
|
-
}, [workflows, formData,
|
|
596
|
+
}, [workflows, formData, workitemSetID, isWFDisabled, workItems, zoomLevel, handleZoomIn, handleZoomOut]);
|
|
566
597
|
const normalizedTID = TID !== undefined ? Number(TID) : undefined;
|
|
567
598
|
const defaultPanelDimensions = {
|
|
568
599
|
'tmDcmtForm': { width: '20%', height: '100%' },
|
|
@@ -605,7 +636,13 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
605
636
|
id: 'tmBlog',
|
|
606
637
|
name: SDKUI_Localizator.BlogCase,
|
|
607
638
|
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
|
608
|
-
toolbarOptions: {
|
|
639
|
+
toolbarOptions: {
|
|
640
|
+
icon: _jsx(IconBoard, { fontSize: 24 }),
|
|
641
|
+
visible: true,
|
|
642
|
+
disabled: isBoardDisabled,
|
|
643
|
+
orderNumber: 2,
|
|
644
|
+
isActive: allInitialPanelVisibility['tmBlog']
|
|
645
|
+
}
|
|
609
646
|
},
|
|
610
647
|
{
|
|
611
648
|
id: 'tmSysMetadata',
|
|
@@ -636,7 +673,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
636
673
|
isActive: allInitialPanelVisibility['tmWF']
|
|
637
674
|
}
|
|
638
675
|
},
|
|
639
|
-
], [tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, isPreviewDisabled, isSysMetadataDisabled, isWFDisabled, inputFile, isClosable]);
|
|
676
|
+
], [fromDTD, tmDcmtForm, tmBlog, tmSysMetadata, tmDcmtPreview, tmWF, isPreviewDisabled, isSysMetadataDisabled, isBoardDisabled, isWFDisabled, inputFile, isClosable]);
|
|
640
677
|
// Retrieves the current document form setting based on the normalized TID
|
|
641
678
|
const getCurrentDcmtFormSetting = () => {
|
|
642
679
|
const settings = SDKUI_Globals.userSettings.dcmtFormSettings;
|
|
@@ -728,7 +765,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
728
765
|
height: '100%',
|
|
729
766
|
position: 'relative',
|
|
730
767
|
overflow: 'hidden'
|
|
731
|
-
}, children: [_jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [(groupId && groupId.length > 0)
|
|
768
|
+
}, children: [fromDTD && _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: useWaitPanelLocalState ? showWaitPanelLocal : showWaitPanel, showWaitPanelPrimary: useWaitPanelLocalState ? showPrimaryLocal : showPrimary, showWaitPanelSecondary: useWaitPanelLocalState ? showSecondaryLocal : showSecondary, waitPanelTitle: useWaitPanelLocalState ? waitPanelTitleLocal : waitPanelTitle, waitPanelTextPrimary: useWaitPanelLocalState ? waitPanelTextPrimaryLocal : waitPanelTextPrimary, waitPanelValuePrimary: useWaitPanelLocalState ? waitPanelValuePrimaryLocal : waitPanelValuePrimary, waitPanelMaxValuePrimary: useWaitPanelLocalState ? waitPanelMaxValuePrimaryLocal : waitPanelMaxValuePrimary, waitPanelTextSecondary: useWaitPanelLocalState ? waitPanelTextSecondaryLocal : waitPanelTextSecondary, waitPanelValueSecondary: useWaitPanelLocalState ? waitPanelValueSecondaryLocal : waitPanelValueSecondary, waitPanelMaxValueSecondary: useWaitPanelLocalState ? waitPanelMaxValueSecondaryLocal : waitPanelMaxValueSecondary, isCancelable: useWaitPanelLocalState ? dcmtFile ? dcmtFile.size >= 1000000 : false : true, abortController: useWaitPanelLocalState ? abortControllerLocal : abortController, children: [(groupId && groupId.length > 0)
|
|
732
769
|
? _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar })
|
|
733
770
|
: _jsx(TMPanelManagerWithPersistenceProvider, { panels: initialPanels, initialVisibility: allInitialPanelVisibility, defaultDimensions: defaultPanelDimensions, initialDimensions: defaultPanelDimensions, initialMobilePanelId: 'tmDcmtForm', isPersistenceEnabled: !isMobile ? hasSavedLayout() : false, persistPanelStates: !isMobile ? (state) => persistPanelStates(state) : undefined, persistedPanelStates: getPersistedPanelStates(), children: _jsx(TMPanelManagerContainer, { panels: initialPanels, direction: "horizontal", parentId: groupId, showToolbar: showDcmtFormSidebar }) }), isOpenDistinctValues &&
|
|
734
771
|
_jsx(TMDistinctValues, { tid: TID, mid: focusedMetadataValue?.mid, isModal: true, showHeader: false, layoutMode: layoutMode, onSelectionChanged: (e) => {
|
|
@@ -811,11 +848,6 @@ const validateMaxLength = (mvd, value, validationItems) => {
|
|
|
811
848
|
const TMDcmtPreviewWrapper = ({ currentDcmt, layoutMode, fromDTD, dcmtFile, deviceType, isVisible, onFileUpload }) => {
|
|
812
849
|
const { setPanelVisibilityById, toggleMaximize, isResizingActive, countVisibleLeafPanels, setToolbarButtonDisabled } = useTMPanelManagerContext();
|
|
813
850
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
814
|
-
useEffect(() => {
|
|
815
|
-
if (layoutMode !== LayoutModes.Update || fromDTD?.hasBlog !== 1) {
|
|
816
|
-
setToolbarButtonDisabled('tmBlog', true);
|
|
817
|
-
}
|
|
818
|
-
}, [fromDTD, layoutMode]);
|
|
819
851
|
return (layoutMode === LayoutModes.Update ?
|
|
820
852
|
_jsx(TMDcmtPreview, { isVisible: isVisible, onClosePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, allowMaximize: !isMobile && countVisibleLeafPanels() > 1, onMaximizePanel: (!isMobile && countVisibleLeafPanels() > 1) ? () => toggleMaximize("tmDcmtPreview") : undefined, dcmtData: currentDcmt, isResizingActive: isResizingActive }) :
|
|
821
853
|
_jsx(TMFileUploader, { onFileUpload: onFileUpload, onClose: (!isMobile && countVisibleLeafPanels() > 1) ? () => setPanelVisibilityById('tmDcmtPreview', false) : undefined, isRequired: fromDTD?.archiveConstraint === ArchiveConstraints.ContentCompulsory && dcmtFile === null, defaultBlob: dcmtFile, deviceType: deviceType, isResizingActive: isResizingActive }));
|
|
@@ -511,7 +511,6 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, readOnly = false, zoomLevel
|
|
|
511
511
|
if (itemFound) {
|
|
512
512
|
setItemToEdit(itemFound);
|
|
513
513
|
setIsModalOpen(true);
|
|
514
|
-
console.log('handleDoubleClickItem itemFound', itemFound);
|
|
515
514
|
}
|
|
516
515
|
}, [wfDiagram]);
|
|
517
516
|
const handleCloseModal = useCallback(() => {
|
|
@@ -124,7 +124,7 @@ const TMHeader = ({ onMenusOpen, showSettingsMenu = true, showSearchBar = true,
|
|
|
124
124
|
case AppModules.POWERPOINT_CONNECTOR: return 'POWERPOINT CONNECTOR';
|
|
125
125
|
default: return SDK_Globals.appModule;
|
|
126
126
|
}
|
|
127
|
-
}, [SDK_Globals.appModule]);
|
|
127
|
+
}, [SDK_Globals.appModule, AppModules]);
|
|
128
128
|
useEffect(() => { clearSearchJobValue && setSearchJobsValue(''); }, [clearSearchJobValue]);
|
|
129
129
|
useEffect(() => { clearSearchQEValue && setSearchQEValue(''); }, [clearSearchQEValue]);
|
|
130
130
|
useEffect(() => {
|
|
@@ -241,7 +241,7 @@ const TMHeader = ({ onMenusOpen, showSettingsMenu = true, showSearchBar = true,
|
|
|
241
241
|
return SDK_Globals.appModule === AppModules.WORD_CONNECTOR || SDK_Globals.appModule === AppModules.EXCEL_CONNECTOR || SDK_Globals.appModule === AppModules.POWERPOINT_CONNECTOR;
|
|
242
242
|
}, [SDK_Globals.appModule]);
|
|
243
243
|
return (_jsxs(StyledHeaderContainer, { "$appName": SDK_Globals.appModule, children: [(isAdministrativeLevel && !isOfficeConnector) &&
|
|
244
|
-
_jsx(TMResizableMenu, { ref: appMenuRef, isVisible: showAppMenu, top: 58, left: 10, resizable: false, maxWidth: 215, minWidth: 215, maxHeight: 180, minHeight: 180, onClose: () => { }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [_jsx("h5", { style: { color: TMColors.primary }, children: "Accessi ad altre applicazioni " }), _jsx("hr", {}), _jsxs("div", { style: { display: 'flex', gap: '10px', alignItems: 'center', width: '100%' }, children: [_jsxs(AppMenuButton, { onClick: () => openAppsHandler(appModuleHandler.app_1, tmSession, appRoutes), "$bgColor": '#482234', children: [_jsx("img", { src: six, alt: appModuleHandler.app_1, width: 30, height: 30 }), " ", appModuleHandler.app_1.toUpperCase()] }), _jsxs(AppMenuButton, { onClick: () => openAppsHandler(appModuleHandler.app_2, tmSession, appRoutes), "$bgColor": '#1d6f42', children: [_jsx("img", { src: six, alt: appModuleHandler.app_2, width: 30, height: 30 }), " ", appModuleHandler.app_2.toUpperCase()] })] })] }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%', gap: isMobile ? 5 : 15 }, children: [_jsxs("div", { style: { height: '50px', display: 'flex', alignItems: 'center', gap: 20, justifyContent: 'center' }, children: [_jsx(StyledLogo, { ref: logoRef, style: { cursor: (isAdministrativeLevel &&
|
|
244
|
+
_jsx(TMResizableMenu, { ref: appMenuRef, isVisible: showAppMenu, top: 58, left: 10, resizable: false, maxWidth: 215, minWidth: 215, maxHeight: 180, minHeight: 180, onClose: () => { }, children: _jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '10px' }, children: [_jsx("h5", { style: { color: TMColors.primary }, children: "Accessi ad altre applicazioni " }), _jsx("hr", {}), _jsxs("div", { style: { display: 'flex', gap: '10px', alignItems: 'center', width: '100%' }, children: [_jsxs(AppMenuButton, { onClick: () => openAppsHandler(appModuleHandler.app_1, tmSession, appRoutes), "$bgColor": '#482234', children: [_jsx("img", { src: six, alt: appModuleHandler.app_1, width: 30, height: 30 }), " ", appModuleHandler.app_1.toUpperCase()] }), _jsxs(AppMenuButton, { onClick: () => openAppsHandler(appModuleHandler.app_2, tmSession, appRoutes), "$bgColor": '#1d6f42', children: [_jsx("img", { src: six, alt: appModuleHandler.app_2, width: 30, height: 30 }), " ", appModuleHandler.app_2.toUpperCase()] })] })] }) }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start', width: '100%', gap: isMobile ? 5 : 15 }, children: [_jsxs("div", { style: { height: '50px', display: 'flex', alignItems: 'center', gap: 20, justifyContent: 'center' }, children: [_jsx(StyledLogo, { ref: logoRef, style: { cursor: (isAdministrativeLevel && !isOfficeConnector) ? 'pointer' : 'default' }, onMouseEnter: () => {
|
|
245
245
|
if (openMenuTimer.current)
|
|
246
246
|
clearTimeout(openMenuTimer.current);
|
|
247
247
|
openMenuTimer.current = setTimeout(() => { setShowAppMenu(true); onMenusOpen?.(); }, 200);
|
|
@@ -529,6 +529,7 @@ export declare class SDKUI_Localizator {
|
|
|
529
529
|
static get WorkitemApprove(): string;
|
|
530
530
|
static get WorkitemReject(): string;
|
|
531
531
|
static get WorkitemReassign(): string;
|
|
532
|
+
static get WorkitemsToApproveNone(): "Kein Workitem für dieses Dokument zur Genehmigung vorhanden" | "No workitems to approve for this document" | "No hay workitems para aprobar para este documento" | "Aucun workitem à approuver pour ce document" | "Nenhum workitem para aprovar para este documento" | "Nessun workitem da approvare per questo documento";
|
|
532
533
|
static get WrittenOn(): "Geschrieben am" | "Written on" | "Escrito el" | "Écrit le" | "Escrito em" | "Scritto il";
|
|
533
534
|
static get Yes(): "Ja" | "Yes" | "Sí" | "Oui" | "Sim" | "Sì";
|
|
534
535
|
}
|
|
@@ -5255,6 +5255,16 @@ export class SDKUI_Localizator {
|
|
|
5255
5255
|
default: return "Riassegna workitem";
|
|
5256
5256
|
}
|
|
5257
5257
|
}
|
|
5258
|
+
static get WorkitemsToApproveNone() {
|
|
5259
|
+
switch (this._cultureID) {
|
|
5260
|
+
case CultureIDs.De_DE: return "Kein Workitem für dieses Dokument zur Genehmigung vorhanden";
|
|
5261
|
+
case CultureIDs.En_US: return "No workitems to approve for this document";
|
|
5262
|
+
case CultureIDs.Es_ES: return "No hay workitems para aprobar para este documento";
|
|
5263
|
+
case CultureIDs.Fr_FR: return "Aucun workitem à approuver pour ce document";
|
|
5264
|
+
case CultureIDs.Pt_PT: return "Nenhum workitem para aprovar para este documento";
|
|
5265
|
+
default: return "Nessun workitem da approvare per questo documento";
|
|
5266
|
+
}
|
|
5267
|
+
}
|
|
5258
5268
|
static get WrittenOn() {
|
|
5259
5269
|
switch (this._cultureID) {
|
|
5260
5270
|
case CultureIDs.De_DE: return "Geschrieben am";
|
|
@@ -12,6 +12,7 @@ export declare const addHiddenSelectItem: (select: SelectItem[], tid: number | u
|
|
|
12
12
|
export declare const prepareQdForSearchAsync: (qdInput?: QueryDescriptor) => Promise<QueryDescriptor>;
|
|
13
13
|
export declare function getDefaultOperator(dataDomain: MetadataDataDomains | undefined, dataType: MetadataDataTypes | undefined): QueryOperators.Equal | QueryOperators.Contain | QueryOperators.In;
|
|
14
14
|
export declare const getQD: (tid: number | undefined, easyOr: boolean) => Promise<QueryDescriptor | undefined>;
|
|
15
|
+
export declare const getWorkItemSetIDAsync: (vid: number, did: number) => Promise<string | undefined>;
|
|
15
16
|
export declare const getSysAllDcmtsSQD: (tid: number | undefined, easyOr: boolean) => Promise<SavedQueryDescriptor>;
|
|
16
17
|
export declare const searchResultToMetadataValues: (tid: number | undefined, dtd: DataTableDescriptor | undefined, rows: string[], mids: number[], metadata: MetadataDescriptor[], layoutMode: LayoutModes) => MetadataValueDescriptorEx[];
|
|
17
18
|
export declare const handleArchiveVisibility: (md: MetadataDescriptor) => boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDsAsNumber, MetadataDataTypes, QueryDescriptor, QueryFunctions, SelectItem, SelectItemVisibilities, FromItem, LayoutModes, QueryOperators, SavedQueryDescriptor, SearchEngine, WhereItem, OrderByItem, SDK_Globals, AppModules, SystemTIDs } from '@topconsultnpm/sdk-ts-beta';
|
|
1
|
+
import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDsAsNumber, MetadataDataTypes, QueryDescriptor, QueryFunctions, SelectItem, SelectItemVisibilities, FromItem, LayoutModes, QueryOperators, SavedQueryDescriptor, SearchEngine, WhereItem, OrderByItem, SDK_Globals, AppModules, SystemTIDs, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts-beta';
|
|
2
2
|
import { DateDisplayTypes, Globalization } from './Globalization';
|
|
3
3
|
import { DraftsMIDs, MetadataValueDescriptorEx } from '../ts';
|
|
4
4
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
@@ -198,6 +198,36 @@ export const getQD = async (tid, easyOr) => {
|
|
|
198
198
|
}
|
|
199
199
|
return qd;
|
|
200
200
|
};
|
|
201
|
+
export const getWorkItemSetIDAsync = async (vid, did) => {
|
|
202
|
+
let dtd = await DcmtTypeListCacheService.GetAsync(vid);
|
|
203
|
+
if (!dtd?.metadata)
|
|
204
|
+
return undefined;
|
|
205
|
+
let mdSetID = dtd.metadata.find(o => o.name === WorkItemMetadataNames.WI_SetID);
|
|
206
|
+
if (!mdSetID)
|
|
207
|
+
return undefined;
|
|
208
|
+
let qd = SearchEngine.NewQueryDescriptor();
|
|
209
|
+
if (!qd.from)
|
|
210
|
+
return undefined;
|
|
211
|
+
qd.from.tid = vid;
|
|
212
|
+
qd.select = [];
|
|
213
|
+
let si = new SelectItem();
|
|
214
|
+
si.tid = vid;
|
|
215
|
+
si.mid = mdSetID.id;
|
|
216
|
+
si.visibility = SelectItemVisibilities.Visible;
|
|
217
|
+
qd.select.push(si);
|
|
218
|
+
qd.where = [];
|
|
219
|
+
let wiDID = new WhereItem();
|
|
220
|
+
wiDID.tid = vid;
|
|
221
|
+
wiDID.mid = SystemMIDsAsNumber.DID;
|
|
222
|
+
wiDID.operator = QueryOperators.Equal;
|
|
223
|
+
wiDID.value1 = did.toString();
|
|
224
|
+
wiDID.or = false;
|
|
225
|
+
wiDID.leftBrackets = '(';
|
|
226
|
+
wiDID.rightBrackets = ')';
|
|
227
|
+
qd.where.push(wiDID);
|
|
228
|
+
let result = await SDK_Globals.tmSession?.NewSearchEngine().SearchByIDAsync(qd);
|
|
229
|
+
return result?.dtdResult?.rows?.[0]?.[0];
|
|
230
|
+
};
|
|
201
231
|
export const getSysAllDcmtsSQD = async (tid, easyOr) => {
|
|
202
232
|
let sqd = new SavedQueryDescriptor();
|
|
203
233
|
sqd.id = 1;
|