@topconsultnpm/sdkui-react 6.20.0-dev2.6 → 6.20.0-dev2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/features/documents/TMDcmtForm.js +8 -8
- package/lib/components/features/search/TMSearchResult.js +7 -7
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +3 -2
- package/lib/helper/TMUtils.d.ts +18 -0
- package/lib/helper/TMUtils.js +58 -0
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
import TMDcmtPreview from './TMDcmtPreview';
|
|
4
|
-
import { AccessLevels, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
4
|
+
import { AccessLevels, AppModules, ArchiveConstraints, ArchiveEngineByID, DcmtTypeListCacheService, LayoutCacheService, LayoutModes, MetadataDataTypes, ObjectClasses, ResultTypes, SDK_Globals, SDK_Localizator, SystemMIDsAsNumber, SystemTIDs, Task_States, TID_DID, UpdateEngineByID, UserListCacheService, ValidationItem, WorkflowCacheService, WorkItemMetadataNames } from '@topconsultnpm/sdk-ts';
|
|
5
5
|
import { WorkFlowApproveRejectPopUp, WorkFlowMoreInfoPopUp, WorkFlowOperationButtons, WorkFlowReAssignPopUp } from '../workflow/TMWorkflowPopup';
|
|
6
6
|
import { DownloadTypes, FormModes, DcmtOperationTypes } from '../../../ts';
|
|
7
7
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
8
8
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
10
10
|
import { getWorkItemSetIDAsync, handleArchiveVisibility, searchResultToMetadataValues } from '../../../helper/queryHelper';
|
|
11
|
-
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getExceptionMessage, isApprovalWorkflowView, getDcmtCicoStatus, IconFileDots, IconCustom, buildWorkItemsFromWFCtrl, IconLock } from '../../../helper';
|
|
11
|
+
import { genUniqueId, IconShow, SDKUI_Localizator, updateMruTids, IconBoard, IconDcmtTypeSys, IconDetailDcmts, IconDownload, calcIsModified, IconMenuVertical, Globalization, getListMaxItems, getSystemMetadata, IconBoxArchiveIn, IconClear, IconUndo, SDKUI_Globals, IconPreview, isTaskMoreInfo, IconWorkflow, IconSearch, deepCompare, IconCheck, IconActivity, TMImageLibrary, IconStar, IconRelation, IconInfo, IconArchiveDoc, IconDelete, IconPair, IconUnpair, IconArchiveMaster, IconArchiveDetail, getExceptionMessage, isApprovalWorkflowView, getDcmtCicoStatus, IconFileDots, IconCustom, buildWorkItemsFromWFCtrl, IconLock, getDcmtFormToolbarVisibility } from '../../../helper';
|
|
12
12
|
import { hasDetailRelations, hasMasterRelations, isXMLFileExt } from '../../../helper/dcmtsHelper';
|
|
13
13
|
import { Gutters, TMColors } from '../../../utils/theme';
|
|
14
14
|
import { StyledFormButtonsContainer, StyledLoadingContainer, StyledModalContainer, StyledReferenceButton, StyledSpinner, StyledToolbarCardContainer } from '../../base/Styled';
|
|
@@ -1405,7 +1405,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1405
1405
|
},
|
|
1406
1406
|
toolbarOptions: {
|
|
1407
1407
|
icon: _jsx(IconPreview, { fontSize: 24 }),
|
|
1408
|
-
visible:
|
|
1408
|
+
visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtForm,
|
|
1409
1409
|
orderNumber: 1,
|
|
1410
1410
|
isActive: allInitialPanelVisibility['tmDcmtForm']
|
|
1411
1411
|
}
|
|
@@ -1416,7 +1416,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1416
1416
|
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
|
1417
1417
|
toolbarOptions: {
|
|
1418
1418
|
icon: _jsx(IconBoard, { fontSize: 24 }),
|
|
1419
|
-
visible:
|
|
1419
|
+
visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog,
|
|
1420
1420
|
disabled: isBoardDisabled,
|
|
1421
1421
|
orderNumber: 2,
|
|
1422
1422
|
isActive: allInitialPanelVisibility['tmBlog']
|
|
@@ -1426,13 +1426,13 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1426
1426
|
id: 'tmSysMetadata',
|
|
1427
1427
|
name: SDKUI_Localizator.MetadataSystem,
|
|
1428
1428
|
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
|
1429
|
-
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible:
|
|
1429
|
+
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, disabled: isSysMetadataDisabled, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
1430
1430
|
},
|
|
1431
1431
|
{
|
|
1432
1432
|
id: 'tmDcmtPreview',
|
|
1433
1433
|
name: SDKUI_Localizator.PreviewDocument,
|
|
1434
1434
|
contentOptions: { component: tmDcmtPreview },
|
|
1435
|
-
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible:
|
|
1435
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), disabled: isPreviewDisabled, visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
1436
1436
|
},
|
|
1437
1437
|
{
|
|
1438
1438
|
id: 'tmWF',
|
|
@@ -1445,7 +1445,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1445
1445
|
},
|
|
1446
1446
|
toolbarOptions: {
|
|
1447
1447
|
icon: _jsx(IconWorkflow, { fontSize: 24 }),
|
|
1448
|
-
visible:
|
|
1448
|
+
visible: getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmWF,
|
|
1449
1449
|
disabled: isWFDisabled,
|
|
1450
1450
|
orderNumber: 5,
|
|
1451
1451
|
isActive: allInitialPanelVisibility['tmWF']
|
|
@@ -1459,7 +1459,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1459
1459
|
},
|
|
1460
1460
|
toolbarOptions: {
|
|
1461
1461
|
icon: _jsx(IconActivity, { fontSize: 24 }),
|
|
1462
|
-
visible: layoutMode !== LayoutModes.Ark,
|
|
1462
|
+
visible: layoutMode !== LayoutModes.Ark && getDcmtFormToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtTasks,
|
|
1463
1463
|
orderNumber: 6,
|
|
1464
1464
|
isActive: allInitialPanelVisibility['tmDcmtTasks'],
|
|
1465
1465
|
count: assignedToMe + assignedByMe,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { SDK_Globals, DataColumnTypes, MetadataDataDomains, DataListViewModes, MetadataFormats, LayoutModes, DcmtTypeListCacheService, SystemMIDsAsNumber, RetrieveFileOptions, DcmtOpers, GeneralRetrieveFormats, AccessLevelsEx, LayoutCacheService, UserListCacheService, AppModules } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
import { getAllFieldSelectedDcmtsOrFocused, getCommandsMenuItems, getSelectedDcmtsOrFocused } from './TMSearchResultsMenuItems';
|
|
6
|
-
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconInfo, IconCache, IconPlatform } from '../../../helper';
|
|
6
|
+
import { genUniqueId, IconShow, IconBoard, IconDcmtTypeSys, SDKUI_Localizator, IconDelete, IconRefresh, IconMenuVertical, deepCompare, generateUniqueColumnKeys, searchResultDescriptorToSimpleArray, searchResultToMetadataValues, IconSearchCheck, TMImageLibrary, convertSearchResultDescriptorToFileItems, IconCustom, isApprovalWorkflowView, SDKUI_Globals, getMoreInfoTasksForDocument, IconInfo, IconCache, IconPlatform, getSearchToolbarVisibility } from '../../../helper';
|
|
7
7
|
import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
8
8
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
@@ -839,32 +839,32 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
839
839
|
toolbar: searchResutlToolbar
|
|
840
840
|
},
|
|
841
841
|
},
|
|
842
|
-
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible:
|
|
842
|
+
toolbarOptions: { icon: _jsx(IconSearchCheck, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSearchResult, orderNumber: 1, isActive: allInitialPanelVisibility['tmSearchResult'] }
|
|
843
843
|
},
|
|
844
844
|
{
|
|
845
845
|
id: 'tmBlog',
|
|
846
846
|
name: SDKUI_Localizator.BlogCase,
|
|
847
847
|
contentOptions: { component: tmBlog, panelContainer: { title: SDKUI_Localizator.BlogCase, allowMaximize: !isMobile } },
|
|
848
|
-
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible:
|
|
848
|
+
toolbarOptions: { icon: _jsx(IconBoard, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmBlog, orderNumber: 2, isActive: allInitialPanelVisibility['tmBlog'] }
|
|
849
849
|
},
|
|
850
850
|
{
|
|
851
851
|
id: 'tmSysMetadata',
|
|
852
852
|
name: SDKUI_Localizator.MetadataSystem,
|
|
853
853
|
contentOptions: { component: tmSysMetadata, panelContainer: { title: SDKUI_Localizator.MetadataSystem, allowMaximize: !isMobile } },
|
|
854
|
-
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible:
|
|
854
|
+
toolbarOptions: { icon: _jsx(IconDcmtTypeSys, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmSysMetadata, orderNumber: 3, isActive: allInitialPanelVisibility['tmSysMetadata'] }
|
|
855
855
|
},
|
|
856
856
|
{
|
|
857
857
|
id: 'tmDcmtPreview',
|
|
858
858
|
name: SDKUI_Localizator.PreviewDocument,
|
|
859
859
|
contentOptions: { component: tmDcmtPreview },
|
|
860
|
-
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible:
|
|
860
|
+
toolbarOptions: { icon: _jsx(IconShow, { fontSize: 24 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmDcmtPreview, orderNumber: 4, isActive: allInitialPanelVisibility['tmDcmtPreview'] }
|
|
861
861
|
},
|
|
862
862
|
...(context === SearchResultContext.FREE_SEARCH ? [
|
|
863
863
|
{
|
|
864
864
|
id: 'tmFullTextSearch',
|
|
865
865
|
name: SDKUI_Localizator.ResultDetails,
|
|
866
866
|
contentOptions: { component: tmFullTextSearch, panelContainer: { title: SDKUI_Localizator.ResultDetails, allowMaximize: !isMobile } },
|
|
867
|
-
toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible:
|
|
867
|
+
toolbarOptions: { icon: _jsx(IconPlatform, { fontSize: 20 }), visible: getSearchToolbarVisibility(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER).tmFullTextSearch, orderNumber: 5, isActive: allInitialPanelVisibility['tmFullTextSearch'] }
|
|
868
868
|
}
|
|
869
869
|
] : [])
|
|
870
870
|
], [tmSearchResult, tmBlog, tmSysMetadata, tmDcmtPreview, tmFullTextSearch, showToolbarHeader, context, isMobile]);
|
|
@@ -4,9 +4,10 @@ import styled from 'styled-components';
|
|
|
4
4
|
import { useTMPanelManagerContext } from './TMPanelManagerContext';
|
|
5
5
|
import TMPanelWrapper from './TMPanelWrapper';
|
|
6
6
|
import TMPanelManagerToolbar from './TMPanelManagerToolbar';
|
|
7
|
-
import { IconInfo, SDKUI_Localizator } from '../../../helper';
|
|
7
|
+
import { getPanelManagerToolbarColor, IconInfo, SDKUI_Localizator } from '../../../helper';
|
|
8
8
|
import { DeviceType, useDeviceType } from '../../base/TMDeviceProvider';
|
|
9
9
|
import { Gutters } from '../../../utils/theme';
|
|
10
|
+
import { AppModules, SDK_Globals } from '@topconsultnpm/sdk-ts';
|
|
10
11
|
// Styled Component per il contenitore principale di PanelContainer
|
|
11
12
|
const StyledPanelContainerWrapper = styled.div `
|
|
12
13
|
display: ${props => (props.$hasVisiblePanels ? 'flex' : 'none')};
|
|
@@ -206,7 +207,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
206
207
|
alignItems: 'center',
|
|
207
208
|
width: isMobile ? '100%' : '50px',
|
|
208
209
|
height: isMobile ? '50px' : 'max-content',
|
|
209
|
-
background:
|
|
210
|
+
background: getPanelManagerToolbarColor(SDK_Globals.tmSession?.SessionDescr?.appModuleID ?? AppModules.SURFER),
|
|
210
211
|
borderRadius: isMobile ? '10px' : '10px 0px 0px 10px',
|
|
211
212
|
padding: '10px',
|
|
212
213
|
gap: '10px'
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -67,4 +67,22 @@ export declare const parseSignatureConfiguration: (did: number, informationSign:
|
|
|
67
67
|
};
|
|
68
68
|
export declare const convertSearchResultDescriptorToFileItems: (documents: Array<SearchResultDescriptor>) => Array<FileItem>;
|
|
69
69
|
export declare const getAppModuleGradient: (appModuleID: AppModules) => string;
|
|
70
|
+
export declare const getPanelManagerToolbarColor: (appModuleID: AppModules) => string;
|
|
71
|
+
type SearchToolbarVisibility = {
|
|
72
|
+
tmSearchResult: boolean;
|
|
73
|
+
tmBlog: boolean;
|
|
74
|
+
tmSysMetadata: boolean;
|
|
75
|
+
tmDcmtPreview: boolean;
|
|
76
|
+
tmFullTextSearch: boolean;
|
|
77
|
+
};
|
|
78
|
+
export declare const getSearchToolbarVisibility: (appModuleID: AppModules) => SearchToolbarVisibility;
|
|
79
|
+
type DcmtFormToolbarVisibility = {
|
|
80
|
+
tmDcmtForm: boolean;
|
|
81
|
+
tmBlog: boolean;
|
|
82
|
+
tmSysMetadata: boolean;
|
|
83
|
+
tmDcmtPreview: boolean;
|
|
84
|
+
tmWF: boolean;
|
|
85
|
+
tmDcmtTasks: boolean;
|
|
86
|
+
};
|
|
87
|
+
export declare const getDcmtFormToolbarVisibility: (appModuleID: AppModules) => DcmtFormToolbarVisibility;
|
|
70
88
|
export {};
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -445,3 +445,61 @@ export const getAppModuleGradient = (appModuleID) => {
|
|
|
445
445
|
return 'linear-gradient(270deg, #46B5A2 16%, #3BAABC 34%, #3BAABC 34%, #3681AD 54%, #3368A5 72%, #2F549D 88%, #304F99 100%)';
|
|
446
446
|
}
|
|
447
447
|
};
|
|
448
|
+
export const getPanelManagerToolbarColor = (appModuleID) => {
|
|
449
|
+
switch (appModuleID) {
|
|
450
|
+
case AppModules.SURFER:
|
|
451
|
+
return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
|
|
452
|
+
case AppModules.DESIGNER:
|
|
453
|
+
return '#482234';
|
|
454
|
+
case AppModules.ORCHESTRATOR:
|
|
455
|
+
return '#1d6f42';
|
|
456
|
+
default:
|
|
457
|
+
return 'transparent linear-gradient(90deg, #CCE0F4 0%, #7EC1E7 14%, #39A6DB 28%, #1E9CD7 35%, #0075BE 78%, #005B97 99%) 0% 0% no-repeat padding-box';
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
export const getSearchToolbarVisibility = (appModuleID) => {
|
|
461
|
+
switch (appModuleID) {
|
|
462
|
+
case AppModules.SURFER:
|
|
463
|
+
return {
|
|
464
|
+
tmSearchResult: true,
|
|
465
|
+
tmBlog: true,
|
|
466
|
+
tmSysMetadata: true,
|
|
467
|
+
tmDcmtPreview: true,
|
|
468
|
+
tmFullTextSearch: true,
|
|
469
|
+
};
|
|
470
|
+
case AppModules.DESIGNER:
|
|
471
|
+
case AppModules.ORCHESTRATOR:
|
|
472
|
+
default:
|
|
473
|
+
return {
|
|
474
|
+
tmSearchResult: true,
|
|
475
|
+
tmBlog: false,
|
|
476
|
+
tmSysMetadata: true,
|
|
477
|
+
tmDcmtPreview: true,
|
|
478
|
+
tmFullTextSearch: false,
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
export const getDcmtFormToolbarVisibility = (appModuleID) => {
|
|
483
|
+
switch (appModuleID) {
|
|
484
|
+
case AppModules.SURFER:
|
|
485
|
+
return {
|
|
486
|
+
tmDcmtForm: true,
|
|
487
|
+
tmBlog: true,
|
|
488
|
+
tmSysMetadata: true,
|
|
489
|
+
tmDcmtPreview: true,
|
|
490
|
+
tmWF: true,
|
|
491
|
+
tmDcmtTasks: true,
|
|
492
|
+
};
|
|
493
|
+
case AppModules.DESIGNER:
|
|
494
|
+
case AppModules.ORCHESTRATOR:
|
|
495
|
+
default:
|
|
496
|
+
return {
|
|
497
|
+
tmDcmtForm: true,
|
|
498
|
+
tmBlog: false,
|
|
499
|
+
tmSysMetadata: true,
|
|
500
|
+
tmDcmtPreview: true,
|
|
501
|
+
tmWF: false,
|
|
502
|
+
tmDcmtTasks: false,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
};
|