@topconsultnpm/sdkui-react 6.20.0-dev1.12 → 6.20.0-dev1.120
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/Toppy-help-center.png +0 -0
- package/lib/assets/headergradient.svg +87 -0
- package/lib/components/NewComponents/ContextMenu/TMContextMenu.js +322 -30
- package/lib/components/NewComponents/ContextMenu/hooks.d.ts +8 -1
- package/lib/components/NewComponents/ContextMenu/hooks.js +80 -8
- package/lib/components/NewComponents/ContextMenu/index.d.ts +3 -0
- package/lib/components/NewComponents/ContextMenu/index.js +2 -0
- package/lib/components/NewComponents/ContextMenu/styles.d.ts +9 -1
- package/lib/components/NewComponents/ContextMenu/styles.js +159 -37
- package/lib/components/NewComponents/ContextMenu/types.d.ts +22 -3
- package/lib/components/NewComponents/ContextMenu/useLongPress.d.ts +21 -0
- package/lib/components/NewComponents/ContextMenu/useLongPress.js +112 -0
- package/lib/components/NewComponents/FloatingMenuBar/TMFloatingMenuBar.js +803 -109
- package/lib/components/NewComponents/FloatingMenuBar/styles.d.ts +25 -5
- package/lib/components/NewComponents/FloatingMenuBar/styles.js +215 -59
- package/lib/components/NewComponents/FloatingMenuBar/types.d.ts +12 -2
- package/lib/components/base/TMAccordionNew.js +35 -14
- package/lib/components/base/TMButton.js +6 -0
- package/lib/components/base/TMClosableList.js +4 -0
- package/lib/components/base/TMCustomButton.js +61 -17
- package/lib/components/base/TMDataGrid.d.ts +7 -4
- package/lib/components/base/TMDataGrid.js +153 -11
- package/lib/components/base/TMDropDownMenu.js +21 -18
- package/lib/components/base/TMFileManager.d.ts +4 -3
- package/lib/components/base/TMFileManager.js +32 -24
- package/lib/components/base/TMFileManagerDataGridView.d.ts +3 -2
- package/lib/components/base/TMFileManagerDataGridView.js +1 -11
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +7 -1
- package/lib/components/base/TMFileManagerThumbnailItems.js +5 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +17 -4
- package/lib/components/base/TMFileManagerThumbnailsView.js +18 -6
- package/lib/components/base/TMFileManagerUtils.d.ts +0 -12
- package/lib/components/base/TMListView.js +33 -15
- package/lib/components/base/TMPanel.d.ts +1 -1
- package/lib/components/base/TMPanel.js +3 -1
- package/lib/components/base/TMPopUp.js +6 -0
- package/lib/components/base/TMToolbarCard.js +2 -0
- package/lib/components/base/TMTreeView.d.ts +2 -1
- package/lib/components/base/TMTreeView.js +33 -26
- package/lib/components/choosers/TMDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMDcmtTypeChooser.d.ts +1 -0
- package/lib/components/choosers/TMDcmtTypeChooser.js +11 -3
- package/lib/components/choosers/TMDistinctValues.js +2 -2
- package/lib/components/choosers/TMDynDataListItemChooser.d.ts +2 -0
- package/lib/components/choosers/TMDynDataListItemChooser.js +8 -2
- package/lib/components/choosers/TMInvoiceRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMMetadataChooser.d.ts +2 -0
- package/lib/components/choosers/TMMetadataChooser.js +19 -4
- package/lib/components/choosers/TMOrderRetrieveFormats.js +1 -1
- package/lib/components/choosers/TMUserChooser.d.ts +2 -5
- package/lib/components/choosers/TMUserChooser.js +33 -47
- package/lib/components/editors/TMCheckBox.js +2 -0
- package/lib/components/editors/TMDateBox.js +18 -9
- package/lib/components/editors/TMEditorStyled.js +7 -0
- package/lib/components/editors/TMLocalizedTextBox.d.ts +3 -1
- package/lib/components/editors/TMLocalizedTextBox.js +16 -14
- package/lib/components/editors/TMMetadataEditor.d.ts +1 -0
- package/lib/components/editors/TMMetadataEditor.js +4 -4
- package/lib/components/editors/TMMetadataTextBox.d.ts +9 -0
- package/lib/components/editors/TMMetadataTextBox.js +92 -0
- package/lib/components/editors/TMMetadataValues.d.ts +1 -0
- package/lib/components/editors/TMMetadataValues.js +25 -7
- package/lib/components/editors/TMRadioButton.js +2 -0
- package/lib/components/editors/TMTextArea.js +18 -30
- package/lib/components/editors/TMTextBox.d.ts +1 -1
- package/lib/components/editors/TMTextBox.js +29 -4
- package/lib/components/editors/TMTextExpression.js +6 -91
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +462 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.d.ts +14 -2
- package/lib/components/features/documents/TMDcmtForm.js +459 -208
- package/lib/components/features/documents/TMDcmtPreview.js +42 -155
- package/lib/components/features/documents/TMDcmtTasks.js +9 -9
- package/lib/components/features/documents/TMMasterDetailDcmts.js +38 -53
- package/lib/components/features/documents/TMRelationViewer.d.ts +1 -1
- package/lib/components/features/documents/TMRelationViewer.js +2 -2
- package/lib/components/features/search/TMDcmtCheckoutInfoForm.d.ts +8 -0
- package/lib/components/features/search/{TMSearchResultCheckoutInfoForm.js → TMDcmtCheckoutInfoForm.js} +2 -2
- package/lib/components/features/search/TMSavedQuerySelector.js +72 -67
- package/lib/components/features/search/TMSearch.d.ts +3 -0
- package/lib/components/features/search/TMSearch.js +50 -11
- package/lib/components/features/search/TMSearchQueryEditor.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryEditor.js +10 -10
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +40 -25
- package/lib/components/features/search/TMSearchResult.d.ts +3 -0
- package/lib/components/features/search/TMSearchResult.js +210 -250
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +3 -3
- package/lib/components/features/search/TMSearchResultsMenuItems.js +227 -171
- package/lib/components/features/search/TMSignSettingsForm.js +1 -1
- package/lib/components/features/search/TMSignatureInfoContent.d.ts +6 -0
- package/lib/components/features/search/TMSignatureInfoContent.js +140 -0
- package/lib/components/features/search/TMViewHistoryDcmt.js +2 -2
- package/lib/components/features/tasks/TMTaskForm.js +75 -25
- package/lib/components/features/tasks/TMTasksAgenda.d.ts +3 -1
- package/lib/components/features/tasks/TMTasksAgenda.js +48 -9
- package/lib/components/features/tasks/TMTasksCalendar.d.ts +2 -0
- package/lib/components/features/tasks/TMTasksCalendar.js +19 -7
- package/lib/components/features/tasks/TMTasksUtils.d.ts +2 -2
- package/lib/components/features/tasks/TMTasksUtils.js +57 -37
- package/lib/components/features/tasks/TMTasksView.js +28 -19
- package/lib/components/features/workflow/TMWorkflowPopup.d.ts +33 -2
- package/lib/components/features/workflow/TMWorkflowPopup.js +139 -34
- package/lib/components/features/workflow/diagram/DiagramItemComponent.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemComponent.js +14 -7
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +1 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +3 -2
- package/lib/components/features/workflow/diagram/WFDiagram.d.ts +4 -0
- package/lib/components/features/workflow/diagram/WFDiagram.js +164 -13
- package/lib/components/forms/Login/LoginValidatorService.d.ts +2 -0
- package/lib/components/forms/Login/LoginValidatorService.js +7 -2
- package/lib/components/forms/Login/TMLoginForm.js +35 -7
- package/lib/components/forms/TMChooserForm.js +1 -1
- package/lib/components/grids/TMBlogsPost.js +56 -31
- package/lib/components/grids/TMRecentsManager.js +20 -10
- package/lib/components/grids/TMValidationItemsList.js +6 -0
- package/lib/components/index.d.ts +6 -3
- package/lib/components/index.js +6 -3
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +13 -5
- package/lib/components/query/TMQueryEditor.d.ts +3 -1
- package/lib/components/query/TMQueryEditor.js +102 -100
- package/lib/components/settings/SettingsAppearance.d.ts +2 -1
- package/lib/components/settings/SettingsAppearance.js +99 -30
- package/lib/components/sidebar/TMHeader.js +11 -7
- package/lib/components/sidebar/TMSidebar.d.ts +0 -1
- package/lib/components/sidebar/TMSidebar.js +16 -44
- package/lib/components/sidebar/TMSidebarItem.js +36 -17
- package/lib/components/viewers/TMDataListItemViewer.d.ts +2 -1
- package/lib/components/viewers/TMDataListItemViewer.js +35 -71
- package/lib/components/viewers/TMDataUserIdItemViewer.d.ts +8 -0
- package/lib/components/viewers/TMDataUserIdItemViewer.js +39 -0
- package/lib/css/tm-sdkui.css +1 -1
- package/lib/helper/SDKUI_Globals.d.ts +22 -0
- package/lib/helper/SDKUI_Globals.js +10 -1
- package/lib/helper/SDKUI_Localizator.d.ts +20 -1
- package/lib/helper/SDKUI_Localizator.js +197 -1
- package/lib/helper/TMCommandsContextMenu.d.ts +4 -2
- package/lib/helper/TMCommandsContextMenu.js +15 -4
- package/lib/helper/TMIcons.d.ts +4 -0
- package/lib/helper/TMIcons.js +13 -3
- package/lib/helper/TMPdfViewer.d.ts +8 -0
- package/lib/helper/TMPdfViewer.js +373 -0
- package/lib/helper/TMToppyMessage.js +4 -0
- package/lib/helper/checkinCheckoutManager.d.ts +31 -1
- package/lib/helper/checkinCheckoutManager.js +112 -30
- package/lib/helper/devextremeCustomMessages.d.ts +30 -0
- package/lib/helper/devextremeCustomMessages.js +30 -0
- package/lib/helper/helpers.d.ts +30 -2
- package/lib/helper/helpers.js +131 -3
- package/lib/helper/index.d.ts +2 -0
- package/lib/helper/index.js +2 -0
- package/lib/helper/queryHelper.d.ts +1 -1
- package/lib/helper/queryHelper.js +33 -3
- package/lib/helper/workItemsHelper.d.ts +6 -0
- package/lib/helper/workItemsHelper.js +230 -0
- package/lib/hooks/useCheckInOutOperations.d.ts +28 -0
- package/lib/hooks/useCheckInOutOperations.js +223 -0
- package/lib/hooks/useDataListItem.d.ts +12 -0
- package/lib/hooks/useDataListItem.js +132 -0
- package/lib/hooks/useDataUserIdItem.d.ts +10 -0
- package/lib/hooks/useDataUserIdItem.js +96 -0
- package/lib/hooks/useFloatingBarPinnedItems.d.ts +11 -0
- package/lib/hooks/useFloatingBarPinnedItems.js +54 -0
- package/lib/hooks/useMetadataExpression.d.ts +19 -0
- package/lib/hooks/useMetadataExpression.js +99 -0
- package/lib/hooks/useSettingsFeedback.d.ts +11 -0
- package/lib/hooks/useSettingsFeedback.js +38 -0
- package/lib/hooks/useWorkflowApprove.d.ts +4 -0
- package/lib/hooks/useWorkflowApprove.js +14 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -2
- package/lib/services/platform_services.d.ts +3 -3
- package/lib/ts/types.d.ts +61 -1
- package/lib/utils/theme.d.ts +1 -1
- package/lib/utils/theme.js +1 -1
- package/package.json +7 -4
- package/lib/components/NewComponents/Notification/Notification.d.ts +0 -4
- package/lib/components/NewComponents/Notification/Notification.js +0 -60
- package/lib/components/NewComponents/Notification/NotificationContainer.d.ts +0 -8
- package/lib/components/NewComponents/Notification/NotificationContainer.js +0 -33
- package/lib/components/NewComponents/Notification/index.d.ts +0 -2
- package/lib/components/NewComponents/Notification/index.js +0 -2
- package/lib/components/NewComponents/Notification/styles.d.ts +0 -21
- package/lib/components/NewComponents/Notification/styles.js +0 -180
- package/lib/components/NewComponents/Notification/types.d.ts +0 -18
- package/lib/components/NewComponents/Notification/types.js +0 -1
- package/lib/components/base/TMContextMenu.d.ts +0 -25
- package/lib/components/base/TMContextMenu.js +0 -109
- package/lib/components/base/TMContextMenuOLD.d.ts +0 -26
- package/lib/components/base/TMContextMenuOLD.js +0 -56
- package/lib/components/base/TMFloatingToolbar.d.ts +0 -9
- package/lib/components/base/TMFloatingToolbar.js +0 -101
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
- package/lib/components/features/search/TMSearchResultCheckoutInfoForm.d.ts +0 -8
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom DevExtreme localization messages
|
|
3
|
+
* Contains missing translations for DevExtreme components
|
|
4
|
+
*/
|
|
5
|
+
export declare const devextremeCustomMessages: {
|
|
6
|
+
de: {
|
|
7
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
8
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
9
|
+
};
|
|
10
|
+
en: {
|
|
11
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
12
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
13
|
+
};
|
|
14
|
+
es: {
|
|
15
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
16
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
17
|
+
};
|
|
18
|
+
fr: {
|
|
19
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
20
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
21
|
+
};
|
|
22
|
+
it: {
|
|
23
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
24
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
25
|
+
};
|
|
26
|
+
pt: {
|
|
27
|
+
"dxDataGrid-moveColumnToTheRight": string;
|
|
28
|
+
"dxDataGrid-moveColumnToTheLeft": string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom DevExtreme localization messages
|
|
3
|
+
* Contains missing translations for DevExtreme components
|
|
4
|
+
*/
|
|
5
|
+
export const devextremeCustomMessages = {
|
|
6
|
+
"de": {
|
|
7
|
+
"dxDataGrid-moveColumnToTheRight": "Nach rechts verschieben",
|
|
8
|
+
"dxDataGrid-moveColumnToTheLeft": "Nach links verschieben"
|
|
9
|
+
},
|
|
10
|
+
"en": {
|
|
11
|
+
"dxDataGrid-moveColumnToTheRight": "Move to the right",
|
|
12
|
+
"dxDataGrid-moveColumnToTheLeft": "Move to the left"
|
|
13
|
+
},
|
|
14
|
+
"es": {
|
|
15
|
+
"dxDataGrid-moveColumnToTheRight": "Mover a la derecha",
|
|
16
|
+
"dxDataGrid-moveColumnToTheLeft": "Mover a la izquierda"
|
|
17
|
+
},
|
|
18
|
+
"fr": {
|
|
19
|
+
"dxDataGrid-moveColumnToTheRight": "Déplacer vers la droite",
|
|
20
|
+
"dxDataGrid-moveColumnToTheLeft": "Déplacer vers la gauche"
|
|
21
|
+
},
|
|
22
|
+
"it": {
|
|
23
|
+
"dxDataGrid-moveColumnToTheRight": "Sposta a destra",
|
|
24
|
+
"dxDataGrid-moveColumnToTheLeft": "Sposta a sinistra"
|
|
25
|
+
},
|
|
26
|
+
"pt": {
|
|
27
|
+
"dxDataGrid-moveColumnToTheRight": "Mover para a direita",
|
|
28
|
+
"dxDataGrid-moveColumnToTheLeft": "Mover para a esquerda"
|
|
29
|
+
}
|
|
30
|
+
};
|
package/lib/helper/helpers.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Colors as ColorsType } from "../components/base/TMEditorBase";
|
|
2
2
|
import { DeviceType } from "../components";
|
|
3
|
-
import { AppModules, DataColumnDescriptor, ITopMediaSession, MetadataDescriptor, QueryDescriptor, SearchResultDescriptor } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { AppModules, DataColumnDescriptor, DcmtTypeDescriptor, ITopMediaSession, MetadataDescriptor, QueryDescriptor, SearchResultDescriptor, TaskDescriptor } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { FileExtensionHandler, FormModes, moduleTypes } from "../ts";
|
|
5
5
|
declare const TABLET_WIDTH = 1024;
|
|
6
6
|
declare const MOBILE_WIDTH = 640;
|
|
@@ -37,6 +37,7 @@ export declare const extensionHandler: (fileExt: string | undefined) => FileExte
|
|
|
37
37
|
export declare const downloadBase64File: (base64Data: string, fileName: string) => void;
|
|
38
38
|
export declare const TASK_MORE_INFO_PREFIX_NAME: string;
|
|
39
39
|
export declare const isTaskMoreInfo: (taskName: string | undefined) => boolean | undefined;
|
|
40
|
+
export declare const getMoreInfoTasksForDocument: (allTasks: TaskDescriptor[], TID: number | null | undefined, DID: number | null | undefined) => TaskDescriptor[];
|
|
40
41
|
export declare const canNext: (visibleItems: any[], selectedItems: any[]) => boolean;
|
|
41
42
|
export declare const getNext: (visibleItems: any[], selectedItems: any[]) => any;
|
|
42
43
|
export declare const canPrev: (visibleItems: any[], selectedItems: any[]) => boolean;
|
|
@@ -66,7 +67,8 @@ export declare enum LandingPages {
|
|
|
66
67
|
RECENT = "recent",
|
|
67
68
|
AREA_MANAGER = "areaManager",
|
|
68
69
|
NOTIFICATIONS = "notifications",
|
|
69
|
-
ACTIVITIES = "activities"
|
|
70
|
+
ACTIVITIES = "activities",
|
|
71
|
+
WORKFLOW_CTRL = "workflowCtrl"
|
|
70
72
|
}
|
|
71
73
|
export declare function getExceptionMessage(ex: any): string;
|
|
72
74
|
export declare function getContrastColor(inputColor: string): {
|
|
@@ -89,3 +91,29 @@ export declare class AreaHelper {
|
|
|
89
91
|
static ExtractAreaInfo_1(areaPath: string): AreaValues;
|
|
90
92
|
static ExtractAreaInfo_2(areaPath: string, extractFileName: boolean): AreaValues;
|
|
91
93
|
}
|
|
94
|
+
export declare const isApprovalWorkflowView: (dtd: DcmtTypeDescriptor) => boolean;
|
|
95
|
+
export interface SessionIpInfo {
|
|
96
|
+
publicIp: string;
|
|
97
|
+
localIp: string;
|
|
98
|
+
forwardedFor: string;
|
|
99
|
+
}
|
|
100
|
+
export declare const getSessionIpInfo: () => SessionIpInfo;
|
|
101
|
+
interface BrowserAuditInfo {
|
|
102
|
+
name: string;
|
|
103
|
+
version: string;
|
|
104
|
+
os: string;
|
|
105
|
+
language: string;
|
|
106
|
+
screenWidth: number;
|
|
107
|
+
screenHeight: number;
|
|
108
|
+
viewportWidth: number;
|
|
109
|
+
viewportHeight: number;
|
|
110
|
+
colorDepth: number;
|
|
111
|
+
pixelRatio: number;
|
|
112
|
+
timezone: string;
|
|
113
|
+
cookiesEnabled: boolean;
|
|
114
|
+
onlineStatus: boolean;
|
|
115
|
+
touchSupport: boolean;
|
|
116
|
+
userAgent: string;
|
|
117
|
+
toString(): string;
|
|
118
|
+
}
|
|
119
|
+
export declare const getBrowserAuditInfo: () => BrowserAuditInfo;
|
package/lib/helper/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Colors } from "../utils/theme";
|
|
3
3
|
import { ButtonNames, DeviceType, TMExceptionBoxManager, TMMessageBoxManager, TMSpinner } from "../components";
|
|
4
|
-
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SetGlobalsInfoAsync, SystemMIDs, SystemMIDsAsNumber, TopMediaServer } from "@topconsultnpm/sdk-ts";
|
|
4
|
+
import { AccessLevels, MetadataDataDomains, MetadataDataTypes, MetadataDescriptor, MetadataFormatDescriptor, MetadataFormats, MetadataPermission, SDK_Globals, SetGlobalsInfoAsync, SystemMIDs, SystemMIDsAsNumber, Task_States, TopMediaServer, WorkItemMetadataNames } from "@topconsultnpm/sdk-ts";
|
|
5
5
|
import { Buffer } from 'buffer';
|
|
6
6
|
import { buildTypes, FileExtensionHandler, FormModes, moduleTypes } from "../ts";
|
|
7
7
|
import { SDKUI_Localizator } from "./SDKUI_Localizator";
|
|
@@ -505,7 +505,8 @@ export const extensionHandler = (fileExt) => {
|
|
|
505
505
|
case 'txt': return FileExtensionHandler.READY_TO_SHOW;
|
|
506
506
|
case 'config':
|
|
507
507
|
case 'cfg':
|
|
508
|
-
case 'json':
|
|
508
|
+
case 'json':
|
|
509
|
+
case 'sql': return FileExtensionHandler.READY_TO_SHOW;
|
|
509
510
|
default: return FileExtensionHandler.NONE;
|
|
510
511
|
}
|
|
511
512
|
};
|
|
@@ -531,6 +532,17 @@ export const downloadBase64File = (base64Data, fileName) => {
|
|
|
531
532
|
};
|
|
532
533
|
export const TASK_MORE_INFO_PREFIX_NAME = `${SDKUI_Localizator.MoreInformation} - `;
|
|
533
534
|
export const isTaskMoreInfo = (taskName) => taskName?.startsWith(TASK_MORE_INFO_PREFIX_NAME);
|
|
535
|
+
// Filtra i task di tipo "More Info" non completati associati a un documento specifico.
|
|
536
|
+
export const getMoreInfoTasksForDocument = (allTasks, TID, DID) => {
|
|
537
|
+
if (TID === null || DID === null)
|
|
538
|
+
return [];
|
|
539
|
+
if (TID === undefined || DID === undefined)
|
|
540
|
+
return [];
|
|
541
|
+
return allTasks.filter(task => isTaskMoreInfo(task.name) &&
|
|
542
|
+
task.state !== Task_States.Completed &&
|
|
543
|
+
task.iD1?.toString() === TID.toString() &&
|
|
544
|
+
task.iD2?.toString() === DID.toString());
|
|
545
|
+
};
|
|
534
546
|
//#region Form, Page Helpers
|
|
535
547
|
export const canNext = (visibleItems, selectedItems) => {
|
|
536
548
|
if (!visibleItems)
|
|
@@ -664,7 +676,13 @@ export const renderHighlightedText = (text, searchText, isSelected) => {
|
|
|
664
676
|
return text.split(regex).map((part, index) => regex.test(part) ? (_jsx("span", { style: { backgroundColor: isSelected ? '#6c9023' : 'yellow' }, children: part }, index)) : (part));
|
|
665
677
|
};
|
|
666
678
|
export function versionAndBuildtypeInfo(module) {
|
|
667
|
-
|
|
679
|
+
switch (module) {
|
|
680
|
+
case moduleTypes.SDK:
|
|
681
|
+
case moduleTypes.SDKUI:
|
|
682
|
+
return moduleVersion(module).replace("-hotfix.", "+hotfix").replace("-hotfix", "+hotfix");
|
|
683
|
+
default:
|
|
684
|
+
return moduleVersion(module);
|
|
685
|
+
}
|
|
668
686
|
}
|
|
669
687
|
export const getListMaxItems = (deviceType) => { return deviceType === DeviceType.MOBILE ? 8 : 12; };
|
|
670
688
|
export const svgToString = (icon) => {
|
|
@@ -710,6 +728,7 @@ export var LandingPages;
|
|
|
710
728
|
LandingPages["AREA_MANAGER"] = "areaManager";
|
|
711
729
|
LandingPages["NOTIFICATIONS"] = "notifications";
|
|
712
730
|
LandingPages["ACTIVITIES"] = "activities";
|
|
731
|
+
LandingPages["WORKFLOW_CTRL"] = "workflowCtrl";
|
|
713
732
|
})(LandingPages || (LandingPages = {}));
|
|
714
733
|
// #endregion
|
|
715
734
|
// #region Exception
|
|
@@ -850,3 +869,112 @@ export class AreaHelper {
|
|
|
850
869
|
}
|
|
851
870
|
AreaHelper.AreaPathPrefix = "tmarea:\\\\";
|
|
852
871
|
AreaHelper.AreaFolderNamePrefix = "AID_";
|
|
872
|
+
export const isApprovalWorkflowView = (dtd) => {
|
|
873
|
+
return Boolean(dtd?.isView &&
|
|
874
|
+
dtd.metadata?.some(data => data.name === WorkItemMetadataNames.WI_DID));
|
|
875
|
+
};
|
|
876
|
+
// Recupera e normalizza le informazioni IP dalla sessione corrente
|
|
877
|
+
export const getSessionIpInfo = () => {
|
|
878
|
+
// Lettura sicura del valore globale
|
|
879
|
+
const raw = SDK_Globals.tmSession?.SessionDescr?.customData2;
|
|
880
|
+
// Se non esiste, ritorna struttura vuota
|
|
881
|
+
if (!raw) {
|
|
882
|
+
return {
|
|
883
|
+
publicIp: "",
|
|
884
|
+
localIp: "",
|
|
885
|
+
forwardedFor: ""
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
try {
|
|
889
|
+
// Se è stringa, effettua il parse JSON
|
|
890
|
+
const parsed = typeof raw === "string" ? JSON.parse(raw) : raw;
|
|
891
|
+
// Normalizza i campi garantendo sempre stringhe
|
|
892
|
+
return {
|
|
893
|
+
publicIp: parsed?.publicIp ?? "",
|
|
894
|
+
localIp: parsed?.localIp ?? "",
|
|
895
|
+
forwardedFor: parsed?.forwardedFor ?? ""
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
catch {
|
|
899
|
+
// In caso di errore JSON, ritorna valori vuoti
|
|
900
|
+
return {
|
|
901
|
+
publicIp: "",
|
|
902
|
+
localIp: "",
|
|
903
|
+
forwardedFor: ""
|
|
904
|
+
};
|
|
905
|
+
}
|
|
906
|
+
};
|
|
907
|
+
export const getBrowserAuditInfo = () => {
|
|
908
|
+
// Funzione per rilevare browser e versione
|
|
909
|
+
const detectBrowser = () => {
|
|
910
|
+
const ua = navigator.userAgent;
|
|
911
|
+
if (ua.includes("Chrome") && !ua.includes("Edg")) {
|
|
912
|
+
const match = ua.match(/Chrome\/([\d.]+)/);
|
|
913
|
+
return { name: "Chrome", version: match?.[1] ?? "unknown" };
|
|
914
|
+
}
|
|
915
|
+
if (ua.includes("Edg")) {
|
|
916
|
+
const match = ua.match(/Edg\/([\d.]+)/);
|
|
917
|
+
return { name: "Edge", version: match?.[1] ?? "unknown" };
|
|
918
|
+
}
|
|
919
|
+
if (ua.includes("Firefox")) {
|
|
920
|
+
const match = ua.match(/Firefox\/([\d.]+)/);
|
|
921
|
+
return { name: "Firefox", version: match?.[1] ?? "unknown" };
|
|
922
|
+
}
|
|
923
|
+
if (ua.includes("Safari") && !ua.includes("Chrome")) {
|
|
924
|
+
const match = ua.match(/Version\/([\d.]+)/);
|
|
925
|
+
return { name: "Safari", version: match?.[1] ?? "unknown" };
|
|
926
|
+
}
|
|
927
|
+
return { name: "Unknown", version: "unknown" };
|
|
928
|
+
};
|
|
929
|
+
// Funzione per rilevare il sistema operativo (sostituisce navigator.platform deprecato)
|
|
930
|
+
const detectOS = () => {
|
|
931
|
+
const ua = navigator.userAgent;
|
|
932
|
+
if (ua.includes("Win"))
|
|
933
|
+
return "Windows";
|
|
934
|
+
if (ua.includes("Mac"))
|
|
935
|
+
return "macOS";
|
|
936
|
+
if (ua.includes("Linux"))
|
|
937
|
+
return "Linux";
|
|
938
|
+
if (ua.includes("Android"))
|
|
939
|
+
return "Android";
|
|
940
|
+
if (ua.includes("iOS") || ua.includes("iPhone") || ua.includes("iPad"))
|
|
941
|
+
return "iOS";
|
|
942
|
+
return "Unknown";
|
|
943
|
+
};
|
|
944
|
+
// Rileva supporto touch
|
|
945
|
+
const hasTouchSupport = () => {
|
|
946
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
947
|
+
};
|
|
948
|
+
const browser = detectBrowser();
|
|
949
|
+
const os = detectOS();
|
|
950
|
+
const info = {
|
|
951
|
+
name: browser.name,
|
|
952
|
+
version: browser.version,
|
|
953
|
+
os: os,
|
|
954
|
+
language: navigator.language,
|
|
955
|
+
screenWidth: screen.width,
|
|
956
|
+
screenHeight: screen.height,
|
|
957
|
+
viewportWidth: window.innerWidth,
|
|
958
|
+
viewportHeight: window.innerHeight,
|
|
959
|
+
colorDepth: screen.colorDepth,
|
|
960
|
+
pixelRatio: window.devicePixelRatio || 1,
|
|
961
|
+
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
962
|
+
cookiesEnabled: navigator.cookieEnabled,
|
|
963
|
+
onlineStatus: navigator.onLine,
|
|
964
|
+
touchSupport: hasTouchSupport(),
|
|
965
|
+
userAgent: navigator.userAgent,
|
|
966
|
+
toString() {
|
|
967
|
+
return [
|
|
968
|
+
`Browser: ${this.name} ${this.version}`,
|
|
969
|
+
`OS: ${this.os}`,
|
|
970
|
+
`Language: ${this.language}`,
|
|
971
|
+
`Timezone: ${this.timezone}`,
|
|
972
|
+
`Screen: ${this.screenWidth}x${this.screenHeight} (${this.colorDepth}bit, ${this.pixelRatio}x)`,
|
|
973
|
+
`Viewport: ${this.viewportWidth}x${this.viewportHeight}`,
|
|
974
|
+
// `Features: Cookies=${this.cookiesEnabled}, Online=${this.onlineStatus}, Touch=${this.touchSupport}`,
|
|
975
|
+
`UserAgent: ${this.userAgent}`
|
|
976
|
+
].join(' | ');
|
|
977
|
+
},
|
|
978
|
+
};
|
|
979
|
+
return info;
|
|
980
|
+
};
|
package/lib/helper/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export * from './queryHelper';
|
|
|
9
9
|
export * from './TMUtils';
|
|
10
10
|
export * from './TMCommandsContextMenu';
|
|
11
11
|
export * from './TMConditionalWrapper';
|
|
12
|
+
export * from './TMPdfViewer';
|
|
12
13
|
export * from './TMToppyMessage';
|
|
13
14
|
export * from './GlobalStyles';
|
|
14
15
|
export * from './checkinCheckoutManager';
|
|
16
|
+
export * from './workItemsHelper';
|
package/lib/helper/index.js
CHANGED
|
@@ -9,6 +9,8 @@ export * from './queryHelper';
|
|
|
9
9
|
export * from './TMUtils';
|
|
10
10
|
export * from './TMCommandsContextMenu';
|
|
11
11
|
export * from './TMConditionalWrapper';
|
|
12
|
+
export * from './TMPdfViewer';
|
|
12
13
|
export * from './TMToppyMessage';
|
|
13
14
|
export * from './GlobalStyles';
|
|
14
15
|
export * from './checkinCheckoutManager';
|
|
16
|
+
export * from './workItemsHelper';
|
|
@@ -12,7 +12,7 @@ export declare const addHiddenSelectItem: (select: SelectItem[], tid: number | u
|
|
|
12
12
|
export declare const prepareQdForSearchAsync: (qdInput?: QueryDescriptor, removeWhereItemNoValue?: boolean) => Promise<QueryDescriptor>;
|
|
13
13
|
export declare function addWhereClausesForConnect(qd: QueryDescriptor): void;
|
|
14
14
|
export declare function getDefaultOperator(dataDomain: MetadataDataDomains | undefined, dataType: MetadataDataTypes | undefined): QueryOperators.Equal | QueryOperators.Contain | QueryOperators.In;
|
|
15
|
-
export declare const getQD: (tid: number | undefined, easyOr: boolean) => Promise<QueryDescriptor | undefined>;
|
|
15
|
+
export declare const getQD: (tid: number | undefined, easyOr: boolean, newMaxDcmtsToBeReturned: number) => Promise<QueryDescriptor | undefined>;
|
|
16
16
|
export declare const getWorkItemSetIDAsync: (vid: number, did: number) => Promise<string | undefined>;
|
|
17
17
|
export declare const getSysAllDcmtsSQD: (tid: number | undefined, easyOr: boolean) => Promise<SavedQueryDescriptor>;
|
|
18
18
|
export declare const searchResultToMetadataValues: (tid: number | undefined, dtd: DataTableDescriptor | undefined, rows: string[], mids: number[], metadata: MetadataDescriptor[], layoutMode: LayoutModes) => MetadataValueDescriptorEx[];
|
|
@@ -2,6 +2,8 @@ import { AccessLevels, MetadataDataDomains, DcmtTypeListCacheService, SystemMIDs
|
|
|
2
2
|
import { DateDisplayTypes, Globalization } from './Globalization';
|
|
3
3
|
import { ChronologyMIDs, DraftsMIDs, MetadataValueDescriptorEx } from '../ts';
|
|
4
4
|
import { SDKUI_Localizator } from './SDKUI_Localizator';
|
|
5
|
+
import { getDcmtCicoInfo } from './checkinCheckoutManager';
|
|
6
|
+
import { SDKUI_Globals } from './SDKUI_Globals';
|
|
5
7
|
export const getTIDsByQd = (qd) => {
|
|
6
8
|
let tids = [];
|
|
7
9
|
qd?.from?.tid && tids.push({ tid: qd.from?.tid, alias: undefined });
|
|
@@ -82,6 +84,22 @@ export const prepareQdForSearchAsync = async (qdInput, removeWhereItemNoValue) =
|
|
|
82
84
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsMail);
|
|
83
85
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsSigned);
|
|
84
86
|
addHiddenSelectItem(qd.select, fromTID, SystemMIDsAsNumber.IsShared);
|
|
87
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(fromTID);
|
|
88
|
+
if (dtd) {
|
|
89
|
+
const cicoInfo = getDcmtCicoInfo(dtd);
|
|
90
|
+
const canCICO = cicoInfo.CICO === 1 && cicoInfo.CanCICO === AccessLevels.Yes;
|
|
91
|
+
if (canCICO) {
|
|
92
|
+
if (!qd.select.find(o => o.mid == cicoInfo.UserID_MID) && cicoInfo.UserID_CanViewOrUpdate == AccessLevels.Yes) {
|
|
93
|
+
addHiddenSelectItem(qd.select, fromTID, cicoInfo.UserID_MID);
|
|
94
|
+
}
|
|
95
|
+
if (!qd.select.find(o => o.mid == cicoInfo.Date_MID) && cicoInfo.Date_CanViewOrUpdate == AccessLevels.Yes) {
|
|
96
|
+
addHiddenSelectItem(qd.select, fromTID, cicoInfo.Date_MID);
|
|
97
|
+
}
|
|
98
|
+
if (!qd.select.find(o => o.mid == cicoInfo.Ver_MID) && cicoInfo.Ver_CanViewOrUpdate == AccessLevels.Yes) {
|
|
99
|
+
addHiddenSelectItem(qd.select, fromTID, cicoInfo.Ver_MID);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
85
103
|
if (qd.orderBy && qd.orderBy.length <= 0) {
|
|
86
104
|
let obi = new OrderByItem();
|
|
87
105
|
obi.tid = fromTID;
|
|
@@ -164,14 +182,14 @@ export function getDefaultOperator(dataDomain, dataType) {
|
|
|
164
182
|
return QueryOperators.In;
|
|
165
183
|
return dataType == MetadataDataTypes.Varchar ? QueryOperators.Contain : QueryOperators.Equal;
|
|
166
184
|
}
|
|
167
|
-
export const getQD = async (tid, easyOr) => {
|
|
185
|
+
export const getQD = async (tid, easyOr, newMaxDcmtsToBeReturned) => {
|
|
168
186
|
let dtd = await DcmtTypeListCacheService.GetAsync(tid);
|
|
169
187
|
if (!dtd?.metadata)
|
|
170
188
|
return;
|
|
171
189
|
let qd = SearchEngine.NewQueryDescriptor();
|
|
172
190
|
qd.isDistinct = false;
|
|
173
191
|
qd.id = 1;
|
|
174
|
-
qd.maxDcmtsToBeReturned =
|
|
192
|
+
qd.maxDcmtsToBeReturned = newMaxDcmtsToBeReturned;
|
|
175
193
|
qd.from = new FromItem();
|
|
176
194
|
qd.from.tid = tid;
|
|
177
195
|
qd.select = [];
|
|
@@ -239,7 +257,7 @@ export const getSysAllDcmtsSQD = async (tid, easyOr) => {
|
|
|
239
257
|
sqd.masterTID = tid;
|
|
240
258
|
sqd.isEasyWhere = 1;
|
|
241
259
|
sqd.name = SDKUI_Localizator.AllDcmts;
|
|
242
|
-
sqd.qd = await getQD(tid, easyOr);
|
|
260
|
+
sqd.qd = await getQD(tid, easyOr, SDKUI_Globals.userSettings.searchSettings?.maxDcmtsToBeReturned ?? 1000);
|
|
243
261
|
return sqd;
|
|
244
262
|
};
|
|
245
263
|
export const searchResultToMetadataValues = (tid, dtd, rows, mids, metadata, layoutMode) => {
|
|
@@ -311,6 +329,18 @@ export const searchResultToMetadataValues = (tid, dtd, rows, mids, metadata, lay
|
|
|
311
329
|
mvd.customName = SDKUI_Localizator.Author;
|
|
312
330
|
mvd.isReadOnly = true;
|
|
313
331
|
break;
|
|
332
|
+
case ChronologyMIDs.CheckInTime:
|
|
333
|
+
mvd.customName = SDKUI_Localizator.LastUpdateTime;
|
|
334
|
+
mvd.isReadOnly = true;
|
|
335
|
+
break;
|
|
336
|
+
case SystemMIDsAsNumber.FileExt:
|
|
337
|
+
mvd.customName = SDKUI_Localizator.Extension;
|
|
338
|
+
mvd.isReadOnly = true;
|
|
339
|
+
break;
|
|
340
|
+
case SystemMIDsAsNumber.FileSize:
|
|
341
|
+
mvd.customName = SDKUI_Localizator.File_Size;
|
|
342
|
+
mvd.isReadOnly = true;
|
|
343
|
+
break;
|
|
314
344
|
}
|
|
315
345
|
}
|
|
316
346
|
return mvd;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IWorkItemData, WFInstanceDescriptor } from '../ts';
|
|
2
|
+
/**
|
|
3
|
+
* Helper function per costruire IWorkItemData da un WFInstanceDescriptor
|
|
4
|
+
* Effettua le chiamate API necessarie e popola tutti i campi disponibili
|
|
5
|
+
*/
|
|
6
|
+
export declare const buildWorkItemsFromWFCtrl: (wfInstance: WFInstanceDescriptor) => Promise<IWorkItemData[]>;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { SDK_Globals, WorkItemMetadataNames, SystemDataListIDs } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { WorkflowCacheService, DataListCacheService, UserListCacheService, DcmtTypeListCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { parseWfDiagramXml } from '../components/features/workflow/diagram/xmlParser';
|
|
4
|
+
/**
|
|
5
|
+
* Helper function per costruire IWorkItemData da un WFInstanceDescriptor
|
|
6
|
+
* Effettua le chiamate API necessarie e popola tutti i campi disponibili
|
|
7
|
+
*/
|
|
8
|
+
export const buildWorkItemsFromWFCtrl = async (wfInstance) => {
|
|
9
|
+
const { wfid, tid: mtid, did: mdid, instanceId } = wfInstance;
|
|
10
|
+
if (!wfid || !mtid || !mdid) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
// Recupera il workflow descriptor
|
|
14
|
+
const workflow = await WorkflowCacheService.GetWFCtrlInfoAsync(wfid);
|
|
15
|
+
// Recupera tutti i work items per questo workflow usando WFCtrl_RetrieveAllWIsAsync
|
|
16
|
+
const workItemsResult = await SDK_Globals.tmSession?.NewWorkflowEngine().WFCtrl_RetrieveAllWIsAsync(wfid, mtid, mdid, instanceId);
|
|
17
|
+
// Se non ci sono work items, restituisci array vuoto
|
|
18
|
+
if (!workItemsResult || workItemsResult.dcmtsFound === 0 || !workItemsResult.dtdResult?.rows) {
|
|
19
|
+
return [];
|
|
20
|
+
}
|
|
21
|
+
// Recupera la DataList degli stati del workflow
|
|
22
|
+
const dldStatus = await DataListCacheService.GetAsync(SystemDataListIDs.WIStates);
|
|
23
|
+
// Parse del diagramma del workflow per ottenere type e name dai diagramItems
|
|
24
|
+
let wfDiagram;
|
|
25
|
+
if (workflow?.diagram) {
|
|
26
|
+
try {
|
|
27
|
+
wfDiagram = parseWfDiagramXml(workflow.diagram);
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.warn('Errore nel parsing del diagramma workflow:', error);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Recupera il DTD per ottenere i MID dai nomi dei metadati
|
|
34
|
+
const dtd = await DcmtTypeListCacheService.GetAsync(workItemsResult.fromTID);
|
|
35
|
+
if (!dtd?.metadata) {
|
|
36
|
+
return [];
|
|
37
|
+
}
|
|
38
|
+
// Crea una mappa nome metadato -> MID
|
|
39
|
+
const metadataNameToMID = {};
|
|
40
|
+
for (const meta of dtd.metadata) {
|
|
41
|
+
if (meta.name) {
|
|
42
|
+
metadataNameToMID[meta.name] = meta.id;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const columns = workItemsResult.dtdResult.columns || [];
|
|
46
|
+
// Funzione helper per trovare l'indice di una colonna tramite MID
|
|
47
|
+
const findColumnIndexByMID = (mid) => {
|
|
48
|
+
if (mid === -1)
|
|
49
|
+
return -1;
|
|
50
|
+
return columns.findIndex(col => col.extendedProperties?.MID === mid.toString());
|
|
51
|
+
};
|
|
52
|
+
// Mappa degli indici delle colonne usando MID
|
|
53
|
+
const columnIndices = {
|
|
54
|
+
tid: 0, // TID è sempre il primo
|
|
55
|
+
did: 1, // DID è sempre il secondo
|
|
56
|
+
setID: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_SetID] ?? -1),
|
|
57
|
+
creationTime: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_CreationTime] ?? -1),
|
|
58
|
+
response: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_Response] ?? -1),
|
|
59
|
+
completionTime: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_CompletionTime] ?? -1),
|
|
60
|
+
from: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_From] ?? -1),
|
|
61
|
+
to: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_To] ?? -1),
|
|
62
|
+
or: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_Or] ?? -1),
|
|
63
|
+
status: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_Status] ?? -1),
|
|
64
|
+
category: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_Category] ?? -1),
|
|
65
|
+
description: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_Description] ?? -1),
|
|
66
|
+
setStatus: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_SetStatus] ?? -1),
|
|
67
|
+
setRule: findColumnIndexByMID(metadataNameToMID[WorkItemMetadataNames.WI_SetRule] ?? -1),
|
|
68
|
+
};
|
|
69
|
+
// Crea i WorkItemDetail
|
|
70
|
+
const details = [];
|
|
71
|
+
for (let i = 0; i < workItemsResult.dtdResult.rows.length; i++) {
|
|
72
|
+
const row = workItemsResult.dtdResult.rows[i];
|
|
73
|
+
const tid = Number(row[columnIndices.tid]);
|
|
74
|
+
const did = Number(row[columnIndices.did]);
|
|
75
|
+
const setID = columnIndices.setID !== -1 ? row[columnIndices.setID] : '';
|
|
76
|
+
const toUserID = columnIndices.to !== -1 ? Number(row[columnIndices.to]) : undefined;
|
|
77
|
+
// Risolvi l'utente usando la cache
|
|
78
|
+
let toUser = undefined;
|
|
79
|
+
if (toUserID !== undefined) {
|
|
80
|
+
try {
|
|
81
|
+
toUser = await UserListCacheService.GetAsync(toUserID);
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
console.warn(`Impossibile recuperare l'utente con ID ${toUserID}:`, error);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Calcola lo status come DataListItemDescriptor
|
|
88
|
+
let statusItem = undefined;
|
|
89
|
+
if (columnIndices.status !== -1) {
|
|
90
|
+
const rawStatusValue = row[columnIndices.status];
|
|
91
|
+
if (rawStatusValue !== undefined && rawStatusValue !== null && dldStatus?.items) {
|
|
92
|
+
statusItem = dldStatus.items.find(item => item.value === rawStatusValue);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
details.push({
|
|
96
|
+
wid: `${tid}_${did}`,
|
|
97
|
+
tid,
|
|
98
|
+
did,
|
|
99
|
+
wfid: workflow?.id ?? 0,
|
|
100
|
+
approvalVID: workflow?.approvalVID ?? 0,
|
|
101
|
+
setID,
|
|
102
|
+
creationTime: columnIndices.creationTime !== -1 && row[columnIndices.creationTime]
|
|
103
|
+
? new Date(row[columnIndices.creationTime])
|
|
104
|
+
: undefined,
|
|
105
|
+
response: columnIndices.response !== -1 ? row[columnIndices.response] : undefined,
|
|
106
|
+
completionTime: columnIndices.completionTime !== -1 && row[columnIndices.completionTime]
|
|
107
|
+
? new Date(row[columnIndices.completionTime])
|
|
108
|
+
: undefined,
|
|
109
|
+
from: columnIndices.from !== -1 ? Number(row[columnIndices.from]) : undefined,
|
|
110
|
+
to: toUserID,
|
|
111
|
+
toUser: toUser,
|
|
112
|
+
or: columnIndices.or !== -1 ? Number(row[columnIndices.or]) : undefined,
|
|
113
|
+
status: statusItem,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
// Raggruppa per setID considerando il creationTime e setStatus
|
|
117
|
+
// Ordiniamo tutti i details per creationTime (ordine cronologico)
|
|
118
|
+
const sortedAllDetails = [...details].sort((a, b) => {
|
|
119
|
+
if (!a.creationTime || !b.creationTime)
|
|
120
|
+
return 0;
|
|
121
|
+
return a.creationTime.getTime() - b.creationTime.getTime();
|
|
122
|
+
});
|
|
123
|
+
// Crea una mappa detail -> setStatus per avere accesso al setStatus di ogni detail
|
|
124
|
+
const detailSetStatusMap = new Map();
|
|
125
|
+
for (const detail of details) {
|
|
126
|
+
const row = workItemsResult.dtdResult?.rows?.find(r => Number(r[columnIndices.tid]) === detail.tid &&
|
|
127
|
+
Number(r[columnIndices.did]) === detail.did);
|
|
128
|
+
if (row && columnIndices.setStatus !== -1) {
|
|
129
|
+
const setStatusValue = row[columnIndices.setStatus];
|
|
130
|
+
detailSetStatusMap.set(detail, setStatusValue?.toString() ?? '');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Logica di raggruppamento sequenziale dei workitems:
|
|
135
|
+
*
|
|
136
|
+
* Regole:
|
|
137
|
+
* 1. Primo workitem o SetID diverso => Nuovo step
|
|
138
|
+
* - Se SetStatus = "0" (Nuovo): attiva modalità aggregazione per tutti i successivi
|
|
139
|
+
*
|
|
140
|
+
* 2. Stesso SetID del precedente:
|
|
141
|
+
* - In modalità aggregazione (SetStatus = "0"): aggrega sempre nello stesso step
|
|
142
|
+
* - SetStatus != "0": raggruppa per stesso SetStatus
|
|
143
|
+
* - Stesso SetStatus => aggrega
|
|
144
|
+
* - SetStatus diverso => nuovo step
|
|
145
|
+
* - SetStatus = "0": nuovo step e attiva modalità aggregazione
|
|
146
|
+
*/
|
|
147
|
+
const groups = [];
|
|
148
|
+
let previousSetID = undefined;
|
|
149
|
+
let previousSetStatus = undefined;
|
|
150
|
+
let isInNewStatusMode = false;
|
|
151
|
+
for (const detail of sortedAllDetails) {
|
|
152
|
+
const currentSetStatus = detailSetStatusMap.get(detail) ?? '';
|
|
153
|
+
const currentSetID = detail.setID;
|
|
154
|
+
if (previousSetID === undefined || currentSetID !== previousSetID) {
|
|
155
|
+
// Nuovo SetID: crea nuovo step
|
|
156
|
+
groups.push([detail]);
|
|
157
|
+
previousSetID = currentSetID;
|
|
158
|
+
previousSetStatus = currentSetStatus;
|
|
159
|
+
isInNewStatusMode = currentSetStatus === '0';
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
// Stesso SetID
|
|
163
|
+
if (isInNewStatusMode) {
|
|
164
|
+
// Modalità aggregazione attiva: aggrega sempre
|
|
165
|
+
groups[groups.length - 1].push(detail);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
if (currentSetStatus === '0') {
|
|
169
|
+
// SetStatus "Nuovo": nuovo step e attiva modalità aggregazione
|
|
170
|
+
groups.push([detail]);
|
|
171
|
+
isInNewStatusMode = true;
|
|
172
|
+
previousSetStatus = currentSetStatus;
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
// SetStatus diverso da "Nuovo": raggruppa per stesso SetStatus
|
|
176
|
+
if (currentSetStatus !== previousSetStatus) {
|
|
177
|
+
groups.push([detail]);
|
|
178
|
+
previousSetStatus = currentSetStatus;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
groups[groups.length - 1].push(detail);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Crea IWorkItemData per ogni gruppo con tutti i campi disponibili
|
|
188
|
+
const finalWorkItems = groups.map((groupDetails, groupIndex) => {
|
|
189
|
+
const setID = groupDetails[0].setID;
|
|
190
|
+
// Ordina per creationTime (più recente prima)
|
|
191
|
+
const sortedDetails = [...groupDetails].sort((a, b) => {
|
|
192
|
+
if (!a.creationTime || !b.creationTime)
|
|
193
|
+
return 0;
|
|
194
|
+
return b.creationTime.getTime() - a.creationTime.getTime();
|
|
195
|
+
});
|
|
196
|
+
const latest = sortedDetails[0];
|
|
197
|
+
const latestRow = workItemsResult.dtdResult?.rows?.find(row => Number(row[columnIndices.tid]) === latest.tid &&
|
|
198
|
+
Number(row[columnIndices.did]) === latest.did);
|
|
199
|
+
// Calcola il setStatus come DataListItemDescriptor
|
|
200
|
+
let setStatusItem = undefined;
|
|
201
|
+
if (latestRow && columnIndices.setStatus !== -1) {
|
|
202
|
+
const rawStatusValue = latestRow[columnIndices.setStatus];
|
|
203
|
+
if (rawStatusValue !== undefined && rawStatusValue !== null && dldStatus?.items) {
|
|
204
|
+
setStatusItem = dldStatus.items.find(item => item.value === rawStatusValue);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
// Cerca il diagramItem corrispondente al setID nel workflow
|
|
208
|
+
const diagramItem = wfDiagram?.DiagramItems?.find(item => item.ID === setID);
|
|
209
|
+
return {
|
|
210
|
+
wid: `group_${setID}_${groupIndex}`,
|
|
211
|
+
setID,
|
|
212
|
+
creationTime: latest.creationTime,
|
|
213
|
+
groupIndex,
|
|
214
|
+
category: latestRow && columnIndices.category !== -1 ? latestRow[columnIndices.category] : undefined,
|
|
215
|
+
type: diagramItem?.Type,
|
|
216
|
+
name: diagramItem?.ItemName,
|
|
217
|
+
description: latestRow && columnIndices.description !== -1 ? latestRow[columnIndices.description] : undefined,
|
|
218
|
+
setStatus: setStatusItem,
|
|
219
|
+
setRule: latestRow && columnIndices.setRule !== -1 ? Number(latestRow[columnIndices.setRule]) : undefined,
|
|
220
|
+
details: sortedDetails,
|
|
221
|
+
wf: workflow,
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
// Ordina i gruppi per creationTime (più recente prima)
|
|
225
|
+
return finalWorkItems.sort((a, b) => {
|
|
226
|
+
if (!a.creationTime || !b.creationTime)
|
|
227
|
+
return 0;
|
|
228
|
+
return b.creationTime.getTime() - a.creationTime.getTime();
|
|
229
|
+
});
|
|
230
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { DcmtInfo, DownloadModes, DownloadTypes } from '../ts';
|
|
2
|
+
import { FileDescriptor, SearchResultDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
interface UseCheckInOutOperationsReturn {
|
|
4
|
+
showHistory: boolean;
|
|
5
|
+
showHistoryCallback: () => void;
|
|
6
|
+
hideHistoryCallback: () => void;
|
|
7
|
+
showCheckoutInformationForm: boolean;
|
|
8
|
+
showCheckoutInformationFormCallback: () => void;
|
|
9
|
+
hideCheckoutInformationFormCallback: () => void;
|
|
10
|
+
commentFormState: {
|
|
11
|
+
removeAndEditAttachment: boolean;
|
|
12
|
+
show: boolean;
|
|
13
|
+
isRequired: boolean;
|
|
14
|
+
};
|
|
15
|
+
hideCommentFormCallback: () => void;
|
|
16
|
+
copyCheckoutPathToClipboardCallback: (dcmt: DcmtInfo, filename: string) => void;
|
|
17
|
+
handleCheckOutCallback: (dcmt: DcmtInfo, checkout: boolean, filename: string, downloadDcmtsAsync: (inputDcmts: Array<DcmtInfo> | undefined, downloadType?: DownloadTypes, downloadMode?: DownloadModes, onFileDownloaded?: (dcmtFile: File) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, refreshCurrentDcmt?: () => Promise<void>, refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
18
|
+
handleCheckInCallback: (dcmt: DcmtInfo, refreshCurrentDcmt?: () => Promise<void>, refreshFocusedDataRowAsync?: (tid: number | undefined, did: number | undefined, refreshUI?: boolean, metadataResult?: SearchResultDescriptor | null) => Promise<void>) => Promise<void>;
|
|
19
|
+
refreshPreviewTrigger: number;
|
|
20
|
+
showCicoWaitPanel: boolean;
|
|
21
|
+
cicoWaitPanelTitle: string;
|
|
22
|
+
showCicoPrimaryProgress: boolean;
|
|
23
|
+
cicoPrimaryProgressText: string;
|
|
24
|
+
cicoPrimaryProgressValue: number;
|
|
25
|
+
cicoPrimaryProgressMax: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const useCheckInOutOperations: () => UseCheckInOutOperationsReturn;
|
|
28
|
+
export {};
|