@topconsultnpm/sdkui-react 6.19.0-dev2.2 → 6.19.0-dev2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/base/TMCustomButton.js +2 -2
- package/lib/components/base/TMDataGridExportForm.d.ts +1 -1
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMFileManager.js +12 -3
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +11 -2
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMTooltip.d.ts +1 -1
- package/lib/components/base/TMTooltip.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +14 -6
- package/lib/components/editors/TMDateBox.d.ts +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +41 -38
- package/lib/components/features/documents/TMRelationViewer.js +56 -23
- package/lib/components/features/search/TMSavedQuerySelector.js +1 -1
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +8 -25
- package/lib/components/features/search/TMSearchResult.js +91 -10
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +97 -51
- package/lib/components/features/tasks/TMTaskForm.js +1 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +3 -3
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksHeader.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +1 -1
- package/lib/components/features/tasks/TMTasksUtils.js +1 -1
- package/lib/components/features/tasks/TMTasksUtilsView.js +2 -1
- package/lib/components/features/tasks/TMTasksView.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +1 -1
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +11 -6
- package/lib/components/features/workflow/diagram/RecipientList.js +1 -1
- package/lib/components/features/workflow/diagram/WFDiagram.js +20 -6
- package/lib/components/forms/TMResultDialog.js +8 -2
- package/lib/components/grids/TMBlogsPost.d.ts +1 -0
- package/lib/components/grids/TMBlogsPost.js +20 -4
- package/lib/components/grids/TMBlogsPostUtils.js +1 -1
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/pages/TMPage.js +1 -1
- package/lib/components/query/TMQuerySummary.d.ts +1 -0
- package/lib/components/query/TMQuerySummary.js +3 -3
- package/lib/components/settings/SettingsAppearance.js +5 -5
- package/lib/components/viewers/TMDataListItemViewer.d.ts +1 -1
- package/lib/components/viewers/TMMidViewer.d.ts +1 -1
- package/lib/components/viewers/TMTidViewer.d.ts +1 -1
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/SDKUI_Localizator.d.ts +35 -2
- package/lib/helper/SDKUI_Localizator.js +352 -22
- package/lib/helper/TMCustomSearchBar.js +1 -1
- package/lib/helper/TMIcons.d.ts +1 -0
- package/lib/helper/TMIcons.js +3 -0
- package/lib/helper/TMUtils.d.ts +1 -4
- package/lib/helper/TMUtils.js +13 -9
- package/lib/helper/helpers.js +2 -1
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useRelatedDocuments.js +24 -24
- package/lib/ts/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,11 +1,61 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
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, IconSharedDcmt } from '../../../helper';
|
|
2
|
+
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService, LicenseModuleStatus, CICO_MetadataNames } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { IconActivity, IconArchiveDoc, IconBatchUpdate, IconCheckFile, IconCheckIn, IconCircleInfo, IconCloseCircle, IconConvertFilePdf, IconDelete, IconDotsVerticalCircleOutline, IconDownload, IconEdit, IconExportTo, IconFileDots, IconHide, IconInfo, IconMenuCAArchive, IconPlatform, IconPreview, IconRelation, IconSearch, IconShow, IconStar, IconSubstFile, IconUndo, IconUserGroupOutline, SDKUI_Localizator, svgToString, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, isPdfEditorEnabled, IconPair, IconUnpair, IconSharedDcmt, IconShare, IconCopy, IconMoveToFolder } from '../../../helper';
|
|
4
4
|
import ShowAlert from '../../base/TMAlert';
|
|
5
5
|
import { TMMessageBoxManager, ButtonNames, TMExceptionBoxManager } from '../../base/TMPopUp';
|
|
6
6
|
import TMSpinner from '../../base/TMSpinner';
|
|
7
7
|
import { DcmtOperationTypes, DownloadTypes, SearchResultContext } from '../../../ts';
|
|
8
8
|
import { isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
9
|
+
const getCicoInfo = (dtd) => {
|
|
10
|
+
const cico = {
|
|
11
|
+
CICO: 0,
|
|
12
|
+
CanCICO: AccessLevels.No,
|
|
13
|
+
CanDelChronology: AccessLevels.No,
|
|
14
|
+
UserID_MID: 0,
|
|
15
|
+
Date_MID: 0,
|
|
16
|
+
Ver_MID: 0,
|
|
17
|
+
UserID_CanViewOrUpdate: AccessLevels.No,
|
|
18
|
+
Date_CanViewOrUpdate: AccessLevels.No,
|
|
19
|
+
Ver_CanViewOrUpdate: AccessLevels.No,
|
|
20
|
+
};
|
|
21
|
+
if (dtd === undefined)
|
|
22
|
+
return cico;
|
|
23
|
+
cico.CICO = dtd.cico ?? 0;
|
|
24
|
+
cico.CanCICO = dtd.perm?.canCICO ?? AccessLevels.No;
|
|
25
|
+
cico.CanDelChronology = dtd.perm?.canDelChron ?? AccessLevels.No;
|
|
26
|
+
const mdCheckout = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID);
|
|
27
|
+
if (mdCheckout) {
|
|
28
|
+
cico.UserID_MID = mdCheckout.fromMID;
|
|
29
|
+
cico.UserID_CanViewOrUpdate = (mdCheckout.perm?.canView == AccessLevels.Yes || mdCheckout.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
|
|
30
|
+
}
|
|
31
|
+
const mdDate = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutDate);
|
|
32
|
+
if (mdDate) {
|
|
33
|
+
cico.Date_MID = mdDate.fromMID;
|
|
34
|
+
cico.Date_CanViewOrUpdate = (mdDate.perm?.canView == AccessLevels.Yes || mdDate.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
|
|
35
|
+
}
|
|
36
|
+
const mdVer = dtd.metadata?.find(md => md.name === CICO_MetadataNames.CICO_Version);
|
|
37
|
+
if (mdVer) {
|
|
38
|
+
cico.Ver_MID = mdVer.fromMID;
|
|
39
|
+
cico.Ver_CanViewOrUpdate = (mdVer.perm?.canView == AccessLevels.Yes || mdVer.perm?.canUpdate == AccessLevels.Yes) ? AccessLevels.Yes : AccessLevels.No;
|
|
40
|
+
}
|
|
41
|
+
return cico;
|
|
42
|
+
};
|
|
43
|
+
const cicoIsEnabled = (dcmt, dtd) => {
|
|
44
|
+
const cicoInfo = getCicoInfo(dtd);
|
|
45
|
+
let isCheckout = false;
|
|
46
|
+
const CICO_CheckoutUserID = dtd?.metadata?.find(md => md.name === CICO_MetadataNames.CICO_CheckoutUserID)?.id;
|
|
47
|
+
if (dcmt && CICO_CheckoutUserID) {
|
|
48
|
+
const key = dcmt.TID + "_" + CICO_CheckoutUserID;
|
|
49
|
+
const value = dcmt[key];
|
|
50
|
+
if (value && value > 0) {
|
|
51
|
+
isCheckout = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
cicoEnabled: cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes,
|
|
56
|
+
isCheckout: isCheckout
|
|
57
|
+
};
|
|
58
|
+
};
|
|
9
59
|
const disabledForSingleRow = (selectedItems, focusedItem) => {
|
|
10
60
|
return selectedItems.length > 1 || focusedItem === undefined;
|
|
11
61
|
};
|
|
@@ -24,6 +74,17 @@ export const getSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat
|
|
|
24
74
|
}
|
|
25
75
|
return [];
|
|
26
76
|
};
|
|
77
|
+
export const getAllFieldSelectedDcmtsOrFocused = (selectedItems, focusedItem, fileFormat) => {
|
|
78
|
+
if (selectedItems.length <= 0 && !focusedItem)
|
|
79
|
+
return [];
|
|
80
|
+
if (selectedItems.length > 0) {
|
|
81
|
+
return selectedItems;
|
|
82
|
+
}
|
|
83
|
+
else if (focusedItem !== undefined) {
|
|
84
|
+
return [focusedItem];
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
};
|
|
27
88
|
export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
28
89
|
try {
|
|
29
90
|
if (!inputDcmts || inputDcmts.length === 0) {
|
|
@@ -75,7 +136,7 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
|
75
136
|
TMExceptionBoxManager.show({ exception: error });
|
|
76
137
|
}
|
|
77
138
|
};
|
|
78
|
-
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
139
|
+
export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, handleCheckOutOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation) => {
|
|
79
140
|
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
80
141
|
let pdfEditorAvailable = false;
|
|
81
142
|
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
@@ -295,49 +356,34 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
295
356
|
]
|
|
296
357
|
};
|
|
297
358
|
};
|
|
298
|
-
|
|
359
|
+
const checkinMenuItem = () => {
|
|
360
|
+
// Get the currently selected or focused documents
|
|
361
|
+
const selectedDocs = getAllFieldSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
362
|
+
// Take the first document (used for validation checks)
|
|
363
|
+
const firstDoc = selectedDocs?.[0];
|
|
364
|
+
const { cicoEnabled, isCheckout } = cicoIsEnabled(firstDoc, dtd);
|
|
299
365
|
return {
|
|
300
|
-
icon: svgToString(
|
|
301
|
-
text: "Check in",
|
|
302
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem),
|
|
366
|
+
icon: svgToString(_jsx(IconFileDots, {})),
|
|
367
|
+
text: "Check in/Check out",
|
|
368
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
303
369
|
items: [
|
|
304
370
|
{
|
|
305
|
-
icon:
|
|
306
|
-
|
|
307
|
-
disabled:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
{
|
|
311
|
-
icon: svgToString(<IconCheckIn />),
|
|
312
|
-
text: "Modifica file",
|
|
313
|
-
operationType: 'singleRow',
|
|
314
|
-
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
315
|
-
onClick: () => ShowAlert({ message: "TODO Modifica file", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
icon: svgToString(<IconCheckIn />),
|
|
319
|
-
text: "Annulla check out",
|
|
320
|
-
operationType: 'singleRow',
|
|
321
|
-
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
322
|
-
onClick: () => ShowAlert({ message: "TODO Annulla check out", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
371
|
+
icon: "edit",
|
|
372
|
+
text: 'Check out',
|
|
373
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
374
|
+
// disabled: isNotSingleFile || isGroupLocked || isFileCheckedOut,
|
|
375
|
+
onClick: () => handleCheckOutOperationCallback(true),
|
|
323
376
|
},
|
|
324
377
|
{
|
|
325
|
-
icon:
|
|
326
|
-
text:
|
|
327
|
-
|
|
328
|
-
disabled:
|
|
329
|
-
onClick: () =>
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
icon: svgToString(<IconCheckIn />),
|
|
333
|
-
text: "Cronologia",
|
|
334
|
-
operationType: 'singleRow',
|
|
335
|
-
disabled: fromDatagrid ? false : disabledForSingleRow(selectedItems, focusedItem),
|
|
336
|
-
onClick: () => ShowAlert({ message: "TODO Cronologia", mode: 'info', title: `${"TODO"}`, duration: 3000 })
|
|
378
|
+
icon: "remove",
|
|
379
|
+
text: SDKUI_Localizator.CancelCheckOut,
|
|
380
|
+
disabled: !cicoEnabled || (disabledForSingleRow(selectedItems, focusedItem) && disabledForMultiRow(selectedItems, focusedItem)),
|
|
381
|
+
// disabled: isNotSingleFile || isGroupLocked || isFileNotCheckedOut || isNotCheckedOutByCurrentUser,
|
|
382
|
+
onClick: () => handleCheckOutOperationCallback(false),
|
|
337
383
|
},
|
|
338
384
|
]
|
|
339
|
-
}
|
|
340
|
-
}
|
|
385
|
+
};
|
|
386
|
+
};
|
|
341
387
|
const relationsMenuItem = () => {
|
|
342
388
|
return {
|
|
343
389
|
icon: svgToString(_jsx(IconRelation, {})),
|
|
@@ -347,21 +393,21 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
347
393
|
items: [
|
|
348
394
|
{
|
|
349
395
|
icon: svgToString(_jsx(IconPair, {})),
|
|
350
|
-
text:
|
|
396
|
+
text: SDKUI_Localizator.MatchManyDocumentsManyToMany,
|
|
351
397
|
operationType: 'multiRow',
|
|
352
398
|
disabled: !hasManyToManyRelation || disabledForMultiRow(selectedItems, focusedItem),
|
|
353
399
|
onClick: async () => await pairManyToManyDocuments?.(true)
|
|
354
400
|
},
|
|
355
401
|
{
|
|
356
402
|
icon: svgToString(_jsx(IconUnpair, {})),
|
|
357
|
-
text:
|
|
403
|
+
text: SDKUI_Localizator.UnmatchManyDocumentsManyToMany,
|
|
358
404
|
operationType: 'multiRow',
|
|
359
405
|
disabled: !hasManyToManyRelation || disabledForMultiRow(selectedItems, focusedItem),
|
|
360
406
|
onClick: async () => await pairManyToManyDocuments?.(false)
|
|
361
407
|
},
|
|
362
408
|
{
|
|
363
409
|
icon: svgToString(_jsx(IconArchiveMaster, {})),
|
|
364
|
-
text:
|
|
410
|
+
text: SDKUI_Localizator.ArchiveMasterDocument,
|
|
365
411
|
operationType: 'multiRow',
|
|
366
412
|
beginGroup: true,
|
|
367
413
|
disabled: canArchiveMasterRelation !== true,
|
|
@@ -369,7 +415,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
369
415
|
},
|
|
370
416
|
{
|
|
371
417
|
icon: svgToString(_jsx(IconArchiveDetail, {})),
|
|
372
|
-
text:
|
|
418
|
+
text: SDKUI_Localizator.ArchiveDetailDocument,
|
|
373
419
|
operationType: 'multiRow',
|
|
374
420
|
disabled: canArchiveDetailRelation !== true,
|
|
375
421
|
onClick: async () => await archiveDetailDocuments?.(focusedItem?.TID)
|
|
@@ -397,22 +443,22 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
397
443
|
const sharedDcmtsMenuItem = () => {
|
|
398
444
|
return {
|
|
399
445
|
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
400
|
-
text:
|
|
446
|
+
text: SDKUI_Localizator.SharedDocuments,
|
|
401
447
|
operationType: 'multiRow',
|
|
402
448
|
disabled: disabledForMultiRow(selectedItems, focusedItem),
|
|
403
449
|
items: [
|
|
404
450
|
{
|
|
405
451
|
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
406
|
-
text:
|
|
452
|
+
text: SDKUI_Localizator.SharedArchiving,
|
|
407
453
|
operationType: 'singleRow',
|
|
408
454
|
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
409
455
|
onClick: async () => { await openSharedArchiveHandler(); }
|
|
410
456
|
},
|
|
411
457
|
{
|
|
412
458
|
icon: svgToString(_jsx(IconSharedDcmt, {})),
|
|
413
|
-
text:
|
|
459
|
+
text: SDKUI_Localizator.ShowSharedDocuments,
|
|
414
460
|
operationType: 'multiRow',
|
|
415
|
-
disabled:
|
|
461
|
+
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
416
462
|
onClick: async () => { await showSharedDcmtsHandler(); }
|
|
417
463
|
}
|
|
418
464
|
]
|
|
@@ -555,7 +601,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
555
601
|
};
|
|
556
602
|
const shareFromWgMenuItem = () => {
|
|
557
603
|
return {
|
|
558
|
-
icon:
|
|
604
|
+
icon: svgToString(_jsx(IconShare, {})),
|
|
559
605
|
text: SDKUI_Localizator.Share,
|
|
560
606
|
visible: workingGroupContext !== undefined && openAddDocumentForm !== undefined,
|
|
561
607
|
disabled: workingGroupContext === undefined,
|
|
@@ -564,7 +610,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
564
610
|
};
|
|
565
611
|
const copyFromWgMenuItem = () => {
|
|
566
612
|
return {
|
|
567
|
-
icon:
|
|
613
|
+
icon: svgToString(_jsx(IconCopy, {})),
|
|
568
614
|
text: SDKUI_Localizator.CopyToDrafts,
|
|
569
615
|
operationType: 'multiRow',
|
|
570
616
|
visible: openWGsCopyMoveForm !== undefined,
|
|
@@ -574,7 +620,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
574
620
|
};
|
|
575
621
|
const movetofolderFromWgMenuItem = () => {
|
|
576
622
|
return {
|
|
577
|
-
icon:
|
|
623
|
+
icon: svgToString(_jsx(IconMoveToFolder, {})),
|
|
578
624
|
text: !isMobile ? SDKUI_Localizator.CopyToArchivedDocuments : SDKUI_Localizator.CopyToArchived,
|
|
579
625
|
operationType: 'multiRow',
|
|
580
626
|
visible: openWGsCopyMoveForm !== undefined,
|
|
@@ -649,7 +695,7 @@ export const getCommandsMenuItems = (isMobile, dtd, selectedItems, focusedItem,
|
|
|
649
695
|
]
|
|
650
696
|
},
|
|
651
697
|
signatureMenuItem(),
|
|
652
|
-
// checkinMenuItem()
|
|
698
|
+
// checkinMenuItem(),
|
|
653
699
|
relationsMenuItem(),
|
|
654
700
|
sharedDcmtsMenuItem(),
|
|
655
701
|
// shareMenuItem(),
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { ObjectClasses, TaskDescriptor, Priorities, PdGs, SDK_Globals, UserListCacheService, SDK_Localizator, Task_States } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { areDifferentIDs, formatDate, getOriginLabel, getPriorityLocalizatorValue, getPriorityLocalizatorValues, getStatusLocalizatorValues, gotoPDGExtendedLabel, taskValidatorAsync } from './TMTasksUtils';
|
|
5
|
-
import ScrollView from 'devextreme-react/
|
|
5
|
+
import ScrollView from 'devextreme-react/scroll-view';
|
|
6
6
|
import TMLayoutContainer from '../../base/TMLayout';
|
|
7
7
|
import { FormModes } from '../../../ts';
|
|
8
8
|
import { useWorkflowApprove } from '../../../hooks/useWorkflowApprove';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useState } from "react";
|
|
3
3
|
import ArrayStore from "devextreme/data/array_store";
|
|
4
|
-
import Scheduler from "devextreme-react/
|
|
4
|
+
import Scheduler from "devextreme-react/scheduler";
|
|
5
5
|
import { calculateNumberOfDays, highlightTaskText, priorityLegend, renderTaskIcons } from "./TMTasksUtilsView";
|
|
6
6
|
import { Priorities, Task_States } from "@topconsultnpm/sdk-ts";
|
|
7
7
|
import { checkIfNew, convertToSchedulerAppointments, findTasksBySearch, formatDate, getPriorityColor, getStatusLocalizatorValue } from "./TMTasksUtils";
|
|
8
|
-
import ScrollView from "devextreme-react/
|
|
9
|
-
import LoadIndicator from "devextreme-react/
|
|
8
|
+
import ScrollView from "devextreme-react/scroll-view";
|
|
9
|
+
import LoadIndicator from "devextreme-react/load-indicator";
|
|
10
10
|
import { FormModes } from "../../../ts";
|
|
11
11
|
import { SDKUI_Localizator } from "../../../helper";
|
|
12
12
|
import TMCustomSearchBar from "../../../helper/TMCustomSearchBar";
|
|
@@ -5,7 +5,7 @@ import { Priorities, Task_States } from "@topconsultnpm/sdk-ts";
|
|
|
5
5
|
import Scheduler, { Resource } from 'devextreme-react/scheduler';
|
|
6
6
|
import { calculateNumberOfDays, highlightTaskText, priorityLegend, renderTaskIcons, taskStateIconMap, TMActionCalendar } from './TMTasksUtilsView';
|
|
7
7
|
import { checkIfNew, convertToSchedulerAppointments, findTasksBySearch, formatDate, getPriorityColor, getPriorityLocalizatorValue, getStatusLocalizatorValue, prioritiesResourceData } from './TMTasksUtils';
|
|
8
|
-
import LoadIndicator from 'devextreme-react/
|
|
8
|
+
import LoadIndicator from 'devextreme-react/load-indicator';
|
|
9
9
|
import { FormModes } from '../../../ts';
|
|
10
10
|
import { SDKUI_Localizator } from '../../../helper';
|
|
11
11
|
import TMTooltip from '../../base/TMTooltip';
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { treeFilterDataSource } from './TMTasksUtilsView';
|
|
4
4
|
import { FilterCategoryId, TaskView } from './TMTasksUtils';
|
|
5
5
|
import { useEffect, useRef, useState } from 'react';
|
|
6
|
-
import ScrollView from 'devextreme-react/
|
|
6
|
+
import ScrollView from 'devextreme-react/scroll-view';
|
|
7
7
|
import TMTooltip from '../../base/TMTooltip';
|
|
8
8
|
import { SDKUI_Localizator } from '../../../helper';
|
|
9
9
|
import TMDropDown from '../../editors/TMDropDown';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Appointment } from 'devextreme/ui/scheduler';
|
|
2
|
-
import { ContextMenuTypes } from 'devextreme-react/
|
|
2
|
+
import { ContextMenuTypes } from 'devextreme-react/context-menu';
|
|
3
3
|
import { TaskDescriptor, Task_States, PdGs, Priorities, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { FormModes, TaskContext } from '../../../ts';
|
|
5
5
|
import { TMDataGridContextMenuItem } from '../../base/TMDataGrid';
|
|
@@ -318,7 +318,7 @@ const getPDGExtended = (pdg) => {
|
|
|
318
318
|
case PdGs.WG:
|
|
319
319
|
return SDKUI_Localizator.WorkGroup;
|
|
320
320
|
case PdGs.CF:
|
|
321
|
-
return SDKUI_Localizator.
|
|
321
|
+
return SDKUI_Localizator.Dossier;
|
|
322
322
|
case PdGs.DT:
|
|
323
323
|
return SDKUI_Localizator.Document;
|
|
324
324
|
case PdGs.WF:
|
|
@@ -72,7 +72,8 @@ export const priorityLegend = () => _jsx("div", { style: { display: 'flex', alig
|
|
|
72
72
|
export const highlightTaskText = (text, search, taskId) => {
|
|
73
73
|
if (!search)
|
|
74
74
|
return text;
|
|
75
|
-
const
|
|
75
|
+
const escapedSearchText = search.trim().replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
76
|
+
const regex = new RegExp(`(${escapedSearchText})`, 'gi');
|
|
76
77
|
const parts = text.split(regex);
|
|
77
78
|
return parts.map((part, index) => part.toLowerCase() === search.toLowerCase() ? (_jsx("span", { style: { color: "#fff", backgroundColor: '#0f6cbd' }, children: part }, taskId + "-" + index)) : (part));
|
|
78
79
|
};
|
|
@@ -5,7 +5,7 @@ import { TabPanel, Item } from 'devextreme-react/tab-panel';
|
|
|
5
5
|
import { Priorities, ResultTypes, SDK_Globals, Task_States } from "@topconsultnpm/sdk-ts";
|
|
6
6
|
import { calculateNumberOfDays, renderTaskIcons } from "./TMTasksUtilsView";
|
|
7
7
|
import { getPriorityLocalizatorValue } from "../tasks/TMTasksUtils";
|
|
8
|
-
import ContextMenu from 'devextreme-react/
|
|
8
|
+
import ContextMenu from 'devextreme-react/context-menu';
|
|
9
9
|
import { calcResponsiveSizes, getExceptionMessage, SDKUI_Localizator, StyledTabItem, TMCountBadge } from "../../../helper";
|
|
10
10
|
import { useDeviceType } from "../../base/TMDeviceProvider";
|
|
11
11
|
import { FormModes } from "../../../ts";
|
|
@@ -80,7 +80,7 @@ export const WorkFlowOperationButtons = (props) => {
|
|
|
80
80
|
setIsSignWorkflow(false);
|
|
81
81
|
}
|
|
82
82
|
}, [dtd]);
|
|
83
|
-
return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), advancedColor:
|
|
83
|
+
return (_jsx(StyledWorkFlowOperationButtonsContainer, { "$isMobile": isMobile, children: isSignWorkflow ? (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconSignaturePencil, {}), caption: SDKUI_Localizator.SignatureAndApprove, width: "160px", disabled: signApproveDisable, onClick: () => !signApproveDisable && onSignApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" })] })) : (_jsxs(_Fragment, { children: [_jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: approveDisable, onClick: () => !approveDisable && onApprove?.(), advancedColor: "#1a9a49", color: "success" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: rejectDisable, onClick: () => !rejectDisable && onReject?.(), advancedColor: TMColors.error, color: "error" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: reassignDisable, onClick: () => !reassignDisable && onReAssign?.(), advancedColor: TMColors.tertiary, color: "tertiary" }), _jsx(TMButton, { btnStyle: isMobile ? 'toolbar' : 'advanced', showTooltip: isMobile, icon: _jsx(IconInfo, { fontSize: 16 }), caption: SDKUI_Localizator.MoreInformation, width: "180px", disabled: infoDisable, onClick: () => !infoDisable && onMoreInfo?.(), advancedColor: TMColors.info, color: "info" })] })) }));
|
|
84
84
|
};
|
|
85
85
|
export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = DeviceType.DESKTOP, isReject, selectedItems = [], onClose, onCompleted }) => {
|
|
86
86
|
const [commentValue, setCommentValue] = useState('');
|
|
@@ -107,7 +107,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
107
107
|
case DiagramItemTypes.Approval:
|
|
108
108
|
case DiagramItemTypes.DataEntry:
|
|
109
109
|
width = '700px';
|
|
110
|
-
height = '
|
|
110
|
+
height = '530px';
|
|
111
111
|
break;
|
|
112
112
|
case DiagramItemTypes.ExecTask:
|
|
113
113
|
width = '700px';
|
|
@@ -130,6 +130,11 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
130
130
|
width = '700px';
|
|
131
131
|
height = '700px';
|
|
132
132
|
break;
|
|
133
|
+
case DiagramItemTypes.WorkGroup_AddParts:
|
|
134
|
+
case DiagramItemTypes.CaseFlow_AddParts:
|
|
135
|
+
width = '700px';
|
|
136
|
+
height = '530px';
|
|
137
|
+
break;
|
|
133
138
|
default:
|
|
134
139
|
width = '50%';
|
|
135
140
|
height = '50%';
|
|
@@ -383,7 +388,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
383
388
|
};
|
|
384
389
|
// Function to render Condition-specific fields
|
|
385
390
|
const renderConditionFields = () => {
|
|
386
|
-
return (_jsx(TMQuerySummary, { qd: localItem.QD, validateSelect: true, validateOrderBy: false, validationItems: validationItems.filter(v => v.PropertyScopes.includes(DiagramItemProps.QD)), onValueChanged: handleQDChange }));
|
|
391
|
+
return (_jsx(TMQuerySummary, { qd: localItem.QD, showDistinct: true, validateSelect: true, validateOrderBy: false, validationItems: validationItems.filter(v => v.PropertyScopes.includes(DiagramItemProps.QD)), onValueChanged: handleQDChange }));
|
|
387
392
|
};
|
|
388
393
|
// Function to render Status-specific fields
|
|
389
394
|
const renderStatusFields = () => {
|
|
@@ -404,7 +409,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
404
409
|
return qd;
|
|
405
410
|
};
|
|
406
411
|
const qdForRecipientsEditor = localItem.QD ?? newQD();
|
|
407
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMLocalizedTextBox, { label: SDKUI_Localizator.Description, value: localItem.Description, value_IT: localItem.Description_IT, value_EN: localItem.Description_EN, value_FR: localItem.Description_FR, value_PT: localItem.Description_PT, value_ES: localItem.Description_ES, value_DE: localItem.Description_DE, isModifiedWhen: localItem.Description !== localItemOrig.Description, validationItems: validationItems.filter(v => v.PropertyName === DiagramItemProps.Description), onValueChanged: handleLocalizedDescriptionChange }), _jsx(WorkitemRecipientsEditor, { tos: localItem.Tos ?? '', mTID: wf?.MTID, qd: qdForRecipientsEditor, onTosChange: handleTosChange, onQDChange: handleSetRuleQDChange }), _jsx(TMVilViewer, { vil: validationItems.filter(v => v.PropertyName === DiagramItemProps.Tos) }), _jsxs(FlexContainer, { children: [_jsx(TMDropDown, { label: SDKUI_Localizator.WorkflowRecipientSetRule, elementStyle: { width: '320px' }, dataSource: SET_RULE_DATASOURCE, value: localItem.SetRule, isModifiedWhen: localItem.SetRule !== localItemOrig.SetRule, onValueChanged: (e) => { handleSetRuleChange(e.target.value); } }), _jsx(TMCheckBox, { value: localItem.AllowZeroTos ?? 0, label: SDKUI_Localizator.WorkflowAllowZeroTos, isModifiedWhen: localItem.AllowZeroTos !== localItemOrig.AllowZeroTos, onValueChanged: handleAllowZeroTosChange })] }), localItem.Type === DiagramItemTypes.ExecTask &&
|
|
412
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMLocalizedTextBox, { label: SDKUI_Localizator.Description, value: localItem.Description, value_IT: localItem.Description_IT, value_EN: localItem.Description_EN, value_FR: localItem.Description_FR, value_PT: localItem.Description_PT, value_ES: localItem.Description_ES, value_DE: localItem.Description_DE, isModifiedWhen: localItem.Description !== localItemOrig.Description, validationItems: validationItems.filter(v => v.PropertyName === DiagramItemProps.Description), onValueChanged: handleLocalizedDescriptionChange }), _jsx(TMTextBox, { label: "SetID", value: localItem.ID ?? '', readOnly: true }), _jsx(WorkitemRecipientsEditor, { tos: localItem.Tos ?? '', mTID: wf?.MTID, qd: qdForRecipientsEditor, onTosChange: handleTosChange, onQDChange: handleSetRuleQDChange }), _jsx(TMVilViewer, { vil: validationItems.filter(v => v.PropertyName === DiagramItemProps.Tos) }), _jsxs(FlexContainer, { children: [_jsx(TMDropDown, { label: SDKUI_Localizator.WorkflowRecipientSetRule, elementStyle: { width: '320px' }, dataSource: SET_RULE_DATASOURCE, value: localItem.SetRule, isModifiedWhen: localItem.SetRule !== localItemOrig.SetRule, onValueChanged: (e) => { handleSetRuleChange(e.target.value); } }), _jsx(TMCheckBox, { value: localItem.AllowZeroTos ?? 0, label: SDKUI_Localizator.WorkflowAllowZeroTos, isModifiedWhen: localItem.AllowZeroTos !== localItemOrig.AllowZeroTos, onValueChanged: handleAllowZeroTosChange })] }), localItem.Type === DiagramItemTypes.ExecTask &&
|
|
408
413
|
_jsxs(BoxContainer, { children: [_jsx(HeaderContainer, { children: _jsx("span", { children: SDKUI_Localizator.Application }) }), renderAppFields()] })] }));
|
|
409
414
|
};
|
|
410
415
|
// Function to render UpdateDcmt-specific fields
|
|
@@ -562,7 +567,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
562
567
|
const newTos = actorsToTos(updatedRecipients);
|
|
563
568
|
handleTos2Change(newTos);
|
|
564
569
|
}, [localItem.Tos2, handleTos2Change]);
|
|
565
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.
|
|
570
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjDescr, valueOrig: localItemOrig.PlatformObjDescr, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjDescr ?? '') !== (localItemOrig.PlatformObjDescr ?? ''), onValueChanged: handlePlatformObjDescrChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.CommentText} (${SDKUI_Localizator.BlogCase})`, placeHolder: 'Inserisci il valore', rows: 2, value: localItem.Value1asString, valueOrig: localItemOrig.Value1asString, tid: wf?.MTID, isModifiedWhen: (localItem.Value1asString ?? '') !== (localItemOrig.Value1asString ?? ''), onValueChanged: handleValue1asStringChange }), _jsx(TMCheckBox, { value: localItem.Value1asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDraftToWg, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(TMCheckBox, { value: localItem.Value2asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtToWg, isModifiedWhen: localItem.Value2asInt !== localItemOrig.Value2asInt, onValueChanged: handleValue2asIntChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsxs(RecipientsContainer, { children: [_jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient }), _jsx(RecipientList, { recipients: tos2Recipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTos2Recipients(newRecipients, 0), onRemove: handleRemoveTos2Recipient })] })] }));
|
|
566
571
|
};
|
|
567
572
|
const renderCaseFlowCreateFields = () => {
|
|
568
573
|
const [dossierTypes, setDossierTypes] = useState([]);
|
|
@@ -606,7 +611,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
606
611
|
const newTos = actorsToTos(updatedRecipients);
|
|
607
612
|
handleTos2Change(newTos);
|
|
608
613
|
}, [localItem.Tos2, handleTos2Change]);
|
|
609
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.
|
|
614
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMDropDown, { dataSource: dossierTypes, label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.Value3asInt, isModifiedWhen: (localItem.Value3asInt ?? 0) !== (localItemOrig.Value3asInt ?? 0), onValueChanged: (e) => { handleValue3asIntChange(e.target.value); } }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.Description} (${SDKUI_Localizator.Dossier})`, value: localItem.PlatformObjDescr, valueOrig: localItemOrig.PlatformObjDescr, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjDescr ?? '') !== (localItemOrig.PlatformObjDescr ?? ''), onValueChanged: handlePlatformObjDescrChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMTextExpression, { label: `${SDKUI_Localizator.CommentText} (${SDKUI_Localizator.BlogCase})`, placeHolder: 'Inserisci il valore', rows: 2, value: localItem.Value1asString, valueOrig: localItemOrig.Value1asString, tid: wf?.MTID, isModifiedWhen: (localItem.Value1asString ?? '') !== (localItemOrig.Value1asString ?? ''), onValueChanged: handleValue1asStringChange }), _jsx(TMCheckBox, { value: localItem.Value1asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtAsAttachment, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(TMCheckBox, { value: localItem.Value2asInt ?? 0, label: SDKUI_Localizator.WorkflowAddDcmtToDossier, isModifiedWhen: localItem.Value2asInt !== localItemOrig.Value2asInt, onValueChanged: handleValue2asIntChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsxs(RecipientsContainer, { children: [_jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient }), _jsx(RecipientList, { recipients: tos2Recipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTos2Recipients(newRecipients, 0), onRemove: handleRemoveTos2Recipient })] })] }));
|
|
610
615
|
};
|
|
611
616
|
const renderAddPartsFields = () => {
|
|
612
617
|
const { andRecipients: tosRecipients } = useMemo(() => {
|
|
@@ -624,7 +629,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
624
629
|
const newTos = actorsToTos(updatedRecipients);
|
|
625
630
|
handleTosChange(newTos);
|
|
626
631
|
}, [localItem.Tos, handleTosChange]);
|
|
627
|
-
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${localItem.Type === DiagramItemTypes.CaseFlow_AddParts ? SDKUI_Localizator.
|
|
632
|
+
return (_jsxs(_Fragment, { children: [_jsx(TMTextExpression, { label: `${SDKUI_Localizator.Name} (${localItem.Type === DiagramItemTypes.CaseFlow_AddParts ? SDKUI_Localizator.Dossier : SDKUI_Localizator.WorkGroup})`, value: localItem.PlatformObjName, valueOrig: localItemOrig.PlatformObjName, tid: wf?.MTID, isModifiedWhen: (localItem.PlatformObjName ?? '') !== (localItemOrig.PlatformObjName ?? ''), onValueChanged: handlePlatformObjNameChange }), _jsx(TMCultureIDPicker, { label: SDKUI_Localizator.Format, selectedValue: localItem.FormatCultureID, isModifiedWhen: localItem.FormatCultureID !== localItemOrig.FormatCultureID, openChooserBySingleClick: true, onSelectCultureID: handleFormatCultureIDChange }), _jsx(TMCheckBox, { value: localItem.Trunc ?? 0, label: SDKUI_Localizator.TruncateString, isModifiedWhen: localItem.Trunc !== localItemOrig.Trunc, onValueChanged: handleTruncChange }), _jsx(TMRadioButton, { label: SDKUI_Localizator.OperationType, dataSource: [
|
|
628
633
|
{ value: 1, display: SDKUI_Localizator.Add },
|
|
629
634
|
{ value: 0, display: SDKUI_Localizator.Remove },
|
|
630
635
|
], value: localItem.Value1asInt, isModifiedWhen: localItem.Value1asInt !== localItemOrig.Value1asInt, onValueChanged: handleValue1asIntChange }), _jsx(RecipientList, { recipients: tosRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, onAdd: (newRecipients) => handleAddTosRecipients(newRecipients, 0), onRemove: handleRemoveTosRecipient })] }));
|
|
@@ -199,6 +199,6 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
|
|
|
199
199
|
onRemove(recipient);
|
|
200
200
|
setUiState(prevState => ({ ...prevState, selectedRecipientIndex: null })); // Resetta la selezione
|
|
201
201
|
} }), renderActorViewer(recipient)] }, index))) }), uiState.showUserChooser && _jsx(TMUserChooserForm, { allowMultipleSelection: true, allowSorting: true, onClose: () => setUiState(prevState => ({ ...prevState, showUserChooser: false })), onChoose: (IDs) => handleUserChosen(IDs) }), uiState.showGroupChooser && _jsx(TMGroupChooserForm, { allowMultipleSelection: true, allowSorting: true, onClose: () => setUiState(prevState => ({ ...prevState, showGroupChooser: false })), onChoose: (IDs) => handleGroupChosen(IDs) }), uiState.showMetadataChooser && tid && _jsx(TMMetadataChooserForm, { allowMultipleSelection: true, allowSorting: true, tids: [tid], onClose: () => setUiState(prevState => ({ ...prevState, showMetadataChooser: false })), onChoose: (IDs) => handleMetadataChosen(IDs) }), uiState.showQdEditor &&
|
|
202
|
-
_jsx(TMModal, { title: SDKUI_Localizator.QueryDefine, onClose: () => setUiState(prevState => ({ ...prevState, showQdEditor: false })), children: _jsx(TMQueryEditor, { inputData: qd, formMode: FormModes.Update, onApplied: handleQdChosen, onClose: () => setUiState(prevState => ({ ...prevState, showQdEditor: false })) }) })] }));
|
|
202
|
+
_jsx(TMModal, { title: SDKUI_Localizator.QueryDefine, onClose: () => setUiState(prevState => ({ ...prevState, showQdEditor: false })), children: _jsx(TMQueryEditor, { inputData: qd, formMode: FormModes.Update, showDistinct: true, onApplied: handleQdChosen, onClose: () => setUiState(prevState => ({ ...prevState, showQdEditor: false })) }) })] }));
|
|
203
203
|
};
|
|
204
204
|
export default RecipientList;
|
|
@@ -981,11 +981,20 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
981
981
|
const handleRestore = useCallback(() => {
|
|
982
982
|
if (isReadOnly)
|
|
983
983
|
return;
|
|
984
|
-
if (initialDiagramRef.current)
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
984
|
+
if (!initialDiagramRef.current)
|
|
985
|
+
return;
|
|
986
|
+
TMMessageBoxManager.show({
|
|
987
|
+
title: SDKUI_Localizator.WorkflowRestoreDiagram,
|
|
988
|
+
message: SDKUI_Localizator.WorkflowRestoreDiagramMessage,
|
|
989
|
+
buttons: [ButtonNames.YES, ButtonNames.NO],
|
|
990
|
+
onButtonClick: async (e) => {
|
|
991
|
+
if (e === ButtonNames.YES) {
|
|
992
|
+
setWfDiagram(initialDiagramRef.current);
|
|
993
|
+
setWfDiagramHistory([initialDiagramRef.current]);
|
|
994
|
+
setHistoryIndex(0);
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
});
|
|
989
998
|
}, [isReadOnly]);
|
|
990
999
|
const autoAdjustDiagram = (diagram) => {
|
|
991
1000
|
if (!diagram)
|
|
@@ -1646,7 +1655,12 @@ const WFDiagram = ({ xmlDiagramString, currentSetID, allowEdit = true, onDiagram
|
|
|
1646
1655
|
isUndoingRedoing.current = false;
|
|
1647
1656
|
}
|
|
1648
1657
|
}, [wfDiagram]);
|
|
1649
|
-
const
|
|
1658
|
+
const handleCanvasDoubleClick = useCallback((event) => {
|
|
1659
|
+
if (isReadOnly) {
|
|
1660
|
+
toggleReadOnlyMode();
|
|
1661
|
+
}
|
|
1662
|
+
}, [isReadOnly, toggleReadOnlyMode]);
|
|
1663
|
+
const diagramContent = (_jsxs(CanvasContainer, { onDoubleClick: handleCanvasDoubleClick, children: [_jsx("input", { ref: fileInputRef, type: "file", accept: ".xml" // Filtra per file XML
|
|
1650
1664
|
, onChange: handleFileChange, style: { display: 'none' } }), _jsxs(ToolbarContainer, { "$isCollapsed": isToolbarCollapsed, "$isFloating": isToolbarFloating, "$isToolboxVisible": isToolboxVisible, "$isReadOnly": isReadOnly, children: [allowEdit && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: toggleReadOnlyMode, title: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly, children: [isReadOnly ? _jsx(IconPencil, {}) : _jsx(IconLock, {}), !isToolbarCollapsed && _jsx("span", { children: isReadOnly ? SDKUI_Localizator.Design : SDKUI_Localizator.ReadOnly })] }) }), allowEdit && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [!isReadOnly && _jsxs("button", { onClick: handleToggleToolboxVisibility, title: SDKUI_Localizator.ShowToolbox, children: [_jsx(IconFlowChart, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowToolboxToggle })] }), _jsxs("button", { onClick: toggleFullScreenMode, title: SDKUI_Localizator.ShowFullScreen, children: [isFullScreen ? _jsx(IconWindowMinimize, {}) : _jsx(IconWindowMaximize, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ShowFullScreen })] })] }), _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleZoomIn, title: SDKUI_Localizator.ZoomIn, children: [_jsx(IconZoomIn, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomIn })] }), _jsxs("button", { onClick: handleZoomOut, title: SDKUI_Localizator.ZoomOut, children: [_jsx(IconZoomOut, {}), !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.ZoomOut })] }), _jsx(ZoomLevelText, { "$isFloating": isToolbarFloating, "$isCollapsed": isToolbarCollapsed, children: formattedZoomLevel })] }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleUndo, disabled: historyIndex === 0, title: SDKUI_Localizator.Undo, children: [_jsx(IconUndo, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Undo })] }), _jsxs("button", { onClick: handleRedo, disabled: historyIndex === wfDiagramHistory.length - 1, title: SDKUI_Localizator.Redo, children: [_jsx(IconUndo, { style: { transform: 'scaleX(-1)' } }), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Redo })] }), _jsxs("button", { onClick: handleRestore, title: SDKUI_Localizator.Restore, children: [_jsx(IconRestore, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Restore })] }), _jsxs("button", { onClick: handleNew, title: SDKUI_Localizator.DiagramNew, disabled: isReadOnly, children: [_jsx(IconNew, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.DiagramNew })] }), _jsxs("button", { onClick: handleExportDiagram, disabled: isReadOnly || !wfDiagram, title: SDKUI_Localizator.Export, children: [_jsx(IconExport, {}), _jsx("span", { children: SDKUI_Localizator.Export })] }), _jsxs("button", { onClick: handleImportDiagramClick, disabled: isReadOnly, title: SDKUI_Localizator.Import, children: [_jsx(IconImport, {}), _jsx("span", { children: SDKUI_Localizator.Import })] })] }), !isReadOnly && _jsx(ButtonGroup, { "$isFloating": isToolbarFloating, children: _jsxs("button", { onClick: handleAutoAdjust, title: SDKUI_Localizator.AutoAdjust, children: [_jsx(IconAdjust, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.AutoAdjust })] }) }), !isReadOnly && _jsxs(ButtonGroup, { "$isFloating": isToolbarFloating, children: [_jsxs("button", { onClick: handleCopy, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Copy, children: [_jsx(IconCopy, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Copy })] }), _jsxs("button", { onClick: handleCut, disabled: selectedItems.size === 0, title: SDKUI_Localizator.Cut, children: [_jsx(IconCut, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Cut })] }), _jsxs("button", { onClick: handlePaste, disabled: copiedItems.length === 0 && copiedConnections.length === 0, title: SDKUI_Localizator.Paste, children: [_jsx(IconPaste, {}), " ", !isToolbarCollapsed && _jsx("span", { children: SDKUI_Localizator.Paste })] })] }), allowEdit && _jsxs("button", { onClick: handleToggleToolbarMode, title: isToolbarFloating ? SDKUI_Localizator.ToolbarDock : SDKUI_Localizator.ToolbarFloat, children: [isToolbarFloating ? _jsx(IconPin, {}) : _jsx(IconUnpin, {}), !isToolbarCollapsed && !isToolbarFloating && _jsx("span", { children: SDKUI_Localizator.ToggleMode })] }), !isToolbarFloating && _jsx(ToolbarToggle, { onClick: () => setIsToolbarCollapsed(!isToolbarCollapsed), title: isToolbarCollapsed ? SDKUI_Localizator.ToolbarExpand : SDKUI_Localizator.ToolbarCollapse, children: isToolbarCollapsed ? _jsx(IconChevronRight, {}) : _jsx(IconCloseOutline, {}) })] }), !isReadOnly && (_jsx(ToolboxContainer, { "$isVisible": isToolboxVisible, children: isToolboxVisible && availableItemTypes.map(type => (_jsxs(ToolboxItem, { draggable: true, onDragStart: (e) => handleToolboxDragStart(e, type), onDragEnd: handleToolboxDragEnd, children: [_jsx(ToolboxIconWrapper, { children: _jsx(DiagramItemSvgContent, { itemType: type, width: 38, height: 38, isToolboxPreview: true }) }), _jsx("span", { children: LocalizeDiagramItemType(type) })] }, type))) })), _jsx(SvgScrollContainer, { children: isLoading ?
|
|
1651
1665
|
(_jsxs(StyledLoadingContainer, { children: [_jsx(StyledSpinner, {}), _jsx("span", { children: `${'Caricamento diagramma'}...` })] })) : wfDiagram ? (_jsx(StyledSvg, { ref: svgRef, tabIndex: 0, onKeyDownCapture: handleKeyDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onMouseDown: handleMouseDown, onDrop: handleDropOnCanvas, onDragOver: handleDragOver, width: svgWidth, height: svgHeight, children: _jsxs(ScalableGroup, { "$scale": zoomLevel, "$translateX": translateX, "$translateY": translateY, children: [wfDiagram?.DiagramItems.map(item => (_jsx(DiagramItemComponent, { wf: wfDiagram?.Info, readOnly: isReadOnly, item: item, isSelected: selectedItems.has(item.ID), isCurrent: item.ID === currentSetID, onClick: handleDiagramItemClick, onDrag: handleDrag, onDragEnd: handleDragEnd, onConnectorMouseDown: handleConnectorMouseDown, onConnectorMouseUp: handleConnectorMouseUp, onDimensionsChange: handleItemDimensionsChange, onDoubleClick: handleDoubleClickItem }, item.ID))), calculatedConnections.map(connection => {
|
|
1652
1666
|
const sourceItem = wfDiagram?.DiagramItems.find(item => item.ID === connection.Source.ParentDiagramItem.ID);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ResultTypes } from '@topconsultnpm/sdk-ts';
|
|
3
|
-
import DataGrid, { Column, HeaderFilter, Pager, Paging, Scrolling } from 'devextreme-react/
|
|
3
|
+
import DataGrid, { Column, HeaderFilter, Pager, Paging, Scrolling } from 'devextreme-react/data-grid';
|
|
4
4
|
import ReactDOM from 'react-dom/client';
|
|
5
5
|
import { IconSuccessCirlce, IconWarning, IconCloseCircle, IconInfo, SDKUI_Globals, SDKUI_Localizator } from '../../helper';
|
|
6
6
|
import { TMColors } from '../../utils/theme';
|
|
@@ -8,6 +8,7 @@ import ShowAlert from '../base/TMAlert';
|
|
|
8
8
|
import { TMDeviceProvider } from '../base/TMDeviceProvider';
|
|
9
9
|
import TMLayoutContainer from '../base/TMLayout';
|
|
10
10
|
import TMModal from '../base/TMModal';
|
|
11
|
+
import { TMExceptionBoxManager } from '../base/TMPopUp';
|
|
11
12
|
const cellRender = (cellData) => {
|
|
12
13
|
const resultType = cellData.data.resultType;
|
|
13
14
|
switch (resultType) {
|
|
@@ -19,7 +20,12 @@ const cellRender = (cellData) => {
|
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
22
|
const TMResultDialog = ({ title, result, id1Caption, id2Caption }) => {
|
|
22
|
-
|
|
23
|
+
const handleRowDblClick = (e) => {
|
|
24
|
+
if (e.data && e.data.description) {
|
|
25
|
+
TMExceptionBoxManager.show({ exception: e.data.description });
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
return (_jsx(TMModal, { height: '65%', width: '75%', title: `${SDKUI_Localizator.OperationResult} - ${title}`, children: _jsxs(TMLayoutContainer, { children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'row', gap: '5px', padding: '5px', justifyContent: 'center', alignItems: 'center' }, children: [_jsx("p", { children: `${SDKUI_Localizator.ProcessedItems}: ${result.length}` }), _jsx(IconSuccessCirlce, { fontSize: 22, color: TMColors.success }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.SUCCESS).length ?? 0 }), _jsx(IconWarning, { fontSize: 22, color: TMColors.warning }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.WARNING).length ?? 0 }), _jsx(IconCloseCircle, { fontSize: 22, color: TMColors.error }), _jsx("p", { children: result.filter(o => o.resultType == ResultTypes.ERROR).length ?? 0 })] }), _jsxs(DataGrid, { dataSource: result.filter(o => o.resultType != ResultTypes.SUCCESS), showColumnLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showRowLines) === 1, showRowLines: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.showColumnLines) === 1, keyExpr: "rowIndex", width: "100%", height: "100%", columnResizingMode: "widget", allowColumnResizing: true, focusedRowEnabled: true, hoverStateEnabled: true, rowAlternationEnabled: true, onRowDblClick: handleRowDblClick, children: [_jsx(Column, { dataField: 'resultType', caption: '', width: "5%", allowResizing: true, allowSorting: true, cellRender: cellRender }), _jsx(Column, { dataField: 'id1', caption: id1Caption, width: "10%" }), id2Caption && _jsx(Column, { dataField: 'id2', caption: id2Caption, width: "10%" }), _jsx(Column, { dataField: 'description', allowResizing: true, caption: SDKUI_Localizator.Description, allowSorting: true, width: id2Caption ? "75%" : "85%" }), _jsx(HeaderFilter, { visible: true }), _jsx(Paging, { enabled: true, pageSize: 30 }), _jsx(Pager, { visible: true, showInfo: true, showNavigationButtons: true }), _jsx(Scrolling, { mode: 'standard', useNative: Number(SDKUI_Globals.userSettings?.themeSettings.gridSettings.useNativeScrollbar) === 1 })] })] }) }));
|
|
23
29
|
};
|
|
24
30
|
export default TMResultDialog;
|
|
25
31
|
export class TMResultManager {
|
|
@@ -74,6 +74,7 @@ interface TMBlogsPostProps {
|
|
|
74
74
|
externalBlogPost?: BlogPost;
|
|
75
75
|
/** Optional function to reset the external blog post */
|
|
76
76
|
resetExternalBlogPost?: () => void;
|
|
77
|
+
visible?: boolean;
|
|
77
78
|
allTasks?: Array<TaskDescriptor>;
|
|
78
79
|
getAllTasks?: () => Promise<void>;
|
|
79
80
|
deleteTaskByIdsCallback?: (deletedTaskIds: Array<number>) => Promise<void>;
|