@topconsultnpm/sdkui-react 6.20.0-t2 → 6.20.0-t3
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/TMPopUp.js +4 -0
- package/lib/components/base/TMTreeView.js +12 -8
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDataListItemFields.js +1 -1
- package/lib/components/choosers/TMDataListItemPicker.d.ts +1 -0
- package/lib/components/choosers/TMDataListItemPicker.js +5 -1
- package/lib/components/choosers/TMUserChooser.js +1 -1
- package/lib/components/editors/TMMetadataValues.js +200 -40
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +6 -6
- package/lib/components/features/archive/TMArchive.d.ts +1 -0
- package/lib/components/features/archive/TMArchive.js +2 -2
- package/lib/components/features/documents/TMDcmtForm.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +16 -7
- package/lib/components/features/documents/TMFileUploader.d.ts +2 -0
- package/lib/components/features/documents/TMFileUploader.js +16 -8
- package/lib/components/features/documents/TMMasterDetailDcmts.js +25 -63
- package/lib/components/features/documents/TMRelationViewer.js +109 -40
- package/lib/components/features/search/TMSearchQueryPanel.js +3 -3
- package/lib/components/features/search/TMSearchResult.js +5 -13
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +1 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +4 -16
- package/lib/components/features/search/TMSignatureInfoContent.js +10 -6
- package/lib/components/features/search/TMTreeSelector.js +1 -1
- package/lib/components/features/tasks/TMTaskFormUtils.js +1 -1
- package/lib/components/features/workflow/TMWorkflowPopup.js +9 -19
- package/lib/components/features/workflow/diagram/DiagramItemForm.d.ts +2 -0
- package/lib/components/features/workflow/diagram/DiagramItemForm.js +32 -25
- package/lib/components/features/workflow/diagram/RecipientList.d.ts +3 -1
- package/lib/components/features/workflow/diagram/RecipientList.js +13 -9
- package/lib/components/features/workflow/diagram/WFDiagram.js +29 -2
- package/lib/components/features/workflow/diagram/workflowHelpers.js +31 -19
- package/lib/components/grids/TMRecentsManager.js +1 -1
- package/lib/components/viewers/TMMidViewer.js +2 -1
- package/lib/components/viewers/TMTidViewer.js +2 -1
- package/lib/helper/SDKUI_Globals.d.ts +4 -0
- package/lib/helper/SDKUI_Globals.js +9 -1
- package/lib/helper/SDKUI_Localizator.d.ts +12 -4
- package/lib/helper/SDKUI_Localizator.js +104 -24
- package/lib/helper/TMUtils.d.ts +9 -41
- package/lib/helper/TMUtils.js +79 -167
- package/lib/hooks/useDataUserIdItem.js +2 -2
- package/package.json +2 -2
- package/lib/components/features/search/TMSignSettingsForm.d.ts +0 -9
- package/lib/components/features/search/TMSignSettingsForm.js +0 -621
|
@@ -8,7 +8,7 @@ import { useDcmtOperations } from '../../../hooks/useDcmtOperations';
|
|
|
8
8
|
import { useInputAttachmentsDialog, useInputCvtFormatDialog } from '../../../hooks/useInputDialog';
|
|
9
9
|
import { useRelatedDocuments } from '../../../hooks/useRelatedDocuments';
|
|
10
10
|
import { DcmtOperationTypes, SearchResultContext } from '../../../ts';
|
|
11
|
-
import { Gutters
|
|
11
|
+
import { Gutters } from '../../../utils/theme';
|
|
12
12
|
import { StyledModalContainer, StyledMultiViewPanel } from '../../base/Styled';
|
|
13
13
|
import TMButton from '../../base/TMButton';
|
|
14
14
|
import TMDataGrid, { TMDataGridPageSize } from '../../base/TMDataGrid';
|
|
@@ -39,7 +39,6 @@ import TMModal from '../../base/TMModal';
|
|
|
39
39
|
import TMSearch from './TMSearch';
|
|
40
40
|
import TMArchive from '../archive/TMArchive';
|
|
41
41
|
import TMCustomButton from '../../base/TMCustomButton';
|
|
42
|
-
import TMSignSettingsForm from './TMSignSettingsForm';
|
|
43
42
|
import { getDcmtCicoStatus } from '../../../helper/checkinCheckoutManager';
|
|
44
43
|
import TMViewHistoryDcmt from './TMViewHistoryDcmt';
|
|
45
44
|
import TMBlogCommentForm from '../blog/TMBlogCommentForm';
|
|
@@ -96,7 +95,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
96
95
|
const [sharedDcmtFile, setSharedDcmtFile] = useState(undefined);
|
|
97
96
|
// State to control whether the export form (for exporting to Excel/CSV/txt and others) should be shown
|
|
98
97
|
const [showExportForm, setShowExportForm] = useState(false);
|
|
99
|
-
const [showSignSettingsForm, setShowSignSettingsForm] = useState(false);
|
|
100
98
|
const [showIndexingInfo, setShowIndexingInfo] = useState(false);
|
|
101
99
|
const [loadingIndexingInfo, setLoadingIndexingInfo] = useState(false);
|
|
102
100
|
const [indexingInfo, setIndexingInfo] = useState('');
|
|
@@ -304,12 +302,6 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
304
302
|
const handleToggleSearch = () => {
|
|
305
303
|
setShowSearch(prev => !prev);
|
|
306
304
|
};
|
|
307
|
-
const openSignSettingsForm = () => {
|
|
308
|
-
setShowSignSettingsForm(true);
|
|
309
|
-
};
|
|
310
|
-
const closeSignSettingsForm = useCallback(() => {
|
|
311
|
-
setShowSignSettingsForm(false);
|
|
312
|
-
}, []);
|
|
313
305
|
const copyCheckoutPathToClipboardOperationCallback = () => {
|
|
314
306
|
const selectedDocs = getSelectedDcmtsOrFocused(selectedItems, focusedItem);
|
|
315
307
|
const firstDoc = selectedDocs?.[0];
|
|
@@ -610,7 +602,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
610
602
|
&& !showTodoDcmtForm);
|
|
611
603
|
}, [showToppyForApprove, showToppyDraggableHelpCenter, selectedDocs, showApprovePopup, showRejectPopup, showReAssignPopup, showMoreInfoPopup, editPdfForm, openS4TViewer, showTodoDcmtForm]);
|
|
612
604
|
const floatingMenuItems = useMemo(() => {
|
|
613
|
-
const baseMenuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove,
|
|
605
|
+
const baseMenuItems = getCommandsMenuItems(isMobile, fromDTD, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, refreshSelectionDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, openConfirmAttachmentsDialog, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove, handleCheckOutOperationCallback, handleCheckInOperationCallback, showCheckoutInformationFormCallback, showHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, currentTIDHasMasterRelations, currentTIDHasDetailRelations, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToMany, hasManyToManyRelation, pinnedItemIds, togglePin);
|
|
614
606
|
const customButtons = customButtonMenuItems();
|
|
615
607
|
return customButtons.name ? baseMenuItems.concat([customButtons]) : baseMenuItems;
|
|
616
608
|
}, [
|
|
@@ -886,7 +878,7 @@ const TMSearchResult = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, a
|
|
|
886
878
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
887
879
|
setArchiveRelatedDcmtFormMids([]);
|
|
888
880
|
await onRefreshSearchAsync?.();
|
|
889
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (
|
|
881
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, showDcmtFormSidebar: showDcmtFormSidebar }), (showHistory && fromDTD && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMViewHistoryDcmt, { fromDTD: fromDTD, deviceType: deviceType, inputDcmt: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0], onClose: hideHistoryCallback, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (commentFormState.show && getSelectedDcmtsOrFocused(selectedItems, focusedItem).length > 0) && _jsx(TMBlogCommentForm, { context: { engine: 'SearchEngine', object: { tid: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].TID, did: getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID } }, onClose: hideCommentFormCallback, refreshCallback: triggerBlogRefresh, participants: [], showAttachmentsSection: true, allArchivedDocumentsFileItems: convertSearchResultDescriptorToFileItems(currentSearchResults ?? []), isCommentRequired: commentFormState.isRequired, removeAndEditAttachment: commentFormState.removeAndEditAttachment, selectedAttachmentDid: [Number(getSelectedDcmtsOrFocused(selectedItems, focusedItem)[0].DID)] })] }));
|
|
890
882
|
};
|
|
891
883
|
export default TMSearchResult;
|
|
892
884
|
const TMSearchResultGrid = ({ openInOffice, fromDTD, allUsers, inputFocusedItem, showSearch, allowMultipleSelection = true, showExportForm = false, onCloseExportForm, onFocusedItemChanged, onDownloadDcmtsAsync, onVisibleItemChanged, inputSelectedItems = [], lastUpdateSearchTime, searchResult, floatingMenuItems, onSelectionChanged, onDblClick }) => {
|
|
@@ -1355,7 +1347,7 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1355
1347
|
default: return category;
|
|
1356
1348
|
}
|
|
1357
1349
|
};
|
|
1358
|
-
const renderItemTemplate = useCallback((data) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, did: Number(data.dtdResult?.rows?.[0]?.[1]), showIcon: true
|
|
1350
|
+
const renderItemTemplate = useCallback((data) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: data.fromTID, did: Number(data.dtdResult?.rows?.[0]?.[1]), showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: data.dcmtsReturned })] })), []);
|
|
1359
1351
|
const accordionGroups = useMemo(() => sortedCategories.map((category, index) => ({
|
|
1360
1352
|
id: category,
|
|
1361
1353
|
title: getHeaderTitle(category),
|
|
@@ -1371,7 +1363,7 @@ const TMSearchResultSelector = ({ searchResults = [], disableAccordionIfSingleCa
|
|
|
1371
1363
|
tooltip: 'Numero di tutti documenti'
|
|
1372
1364
|
}
|
|
1373
1365
|
],
|
|
1374
|
-
renderItem: (result, isSelected) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: result.fromTID, did: Number(result.dtdResult?.rows?.[0]?.[1]), showIcon: true
|
|
1366
|
+
renderItem: (result, isSelected) => (_jsxs("div", { style: { width: '100%', padding: '5px', display: 'flex', alignItems: 'center', justifyContent: 'space-between' }, children: [_jsx(TMTidViewer, { tid: result.fromTID, did: Number(result.dtdResult?.rows?.[0]?.[1]), showIcon: true }), _jsx("div", { style: { padding: 3, display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: 'white', color: 'gray', borderRadius: 3 }, children: result.dcmtsReturned })] })),
|
|
1375
1367
|
itemHeight: 40
|
|
1376
1368
|
})), [sortedCategories, groupedResults, searchResults]);
|
|
1377
1369
|
const renderCategoryItems = (category) => (_jsx("div", { style: { padding: '5px' }, children: groupedResults[category].map((result, index) => (_jsx(MemoizedStyledItemTemplate, { "$isSelected": selectedResult === result, onClick: () => handleSelect(result), children: renderItemTemplate(result) }, index))) }));
|
|
@@ -5,7 +5,7 @@ import { DcmtInfo, DcmtOperationTypes, DownloadModes, DownloadTypes, SearchResul
|
|
|
5
5
|
export declare const getSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => DcmtInfo[];
|
|
6
6
|
export declare const getAllFieldSelectedDcmtsOrFocused: (selectedItems: Array<any>, focusedItem: any, fileFormat?: FileFormats) => any[];
|
|
7
7
|
export declare const signatureInformationCallback: (isMobile: boolean, inputDcmts: DcmtInfo[] | undefined) => Promise<void>;
|
|
8
|
-
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, allUsers: Array<UserDescriptor>, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void,
|
|
8
|
+
export declare const getCommandsMenuItems: (isMobile: boolean, dtd: DcmtTypeDescriptor | undefined, allUsers: Array<UserDescriptor>, selectedItems: Array<any>, focusedItem: any, context: SearchResultContext, showFloatingBar: boolean, workingGroupContext: WorkingGroupDescriptor | undefined, showSearch: boolean, setShowFloatingBar: React.Dispatch<React.SetStateAction<boolean>>, openFormHandler: (layoutMode: LayoutModes) => void, openSharedArchiveHandler: () => Promise<void>, showSharedDcmtsHandler: () => Promise<void>, downloadDcmtsAsync: (inputDcmts: DcmtInfo[] | undefined, downloadType: DownloadTypes, downloadMode: DownloadModes, onFileDownloaded?: (dcmtFile: File | undefined) => void, confirmAttachments?: (list: FileDescriptor[]) => Promise<string[] | undefined>, skipConfirmation?: boolean) => Promise<void>, runOperationAsync: (inputDcmts: DcmtInfo[] | undefined, dcmtOperationType: DcmtOperationTypes, actionAfterOperationAsync?: () => Promise<void>) => Promise<void>, onRefreshSearchAsync: (() => Promise<void>) | undefined, onRefreshDataRowsAsync: (() => Promise<void>) | undefined, onRefreshAfterAddDcmtToFavs: (() => void) | undefined, confirmFormat: () => Promise<FileFormats>, confirmAttachments: (list: FileDescriptor[]) => Promise<string[] | undefined>, openTaskFormHandler: () => void, openDetailDcmtsFormHandler: (value: boolean) => void, openMasterDcmtsFormHandler: (value: boolean) => void, openBatchUpdateFormHandler: (value: boolean) => void, openExportForm: () => void, handleToggleSearch: () => void, handleSignApprove: () => void, handleCheckOutOperationCallback: (checkout: boolean) => Promise<void>, handleCheckInOperationCallback: () => void, showCheckoutInformationFormCallback: () => void, viewHistoryCallback: () => void, copyCheckoutPathToClipboardOperationCallback: () => void, openWGsCopyMoveForm?: ((mode: "copyToWgDraft" | "copyToWgArchivedDoc", dcmtTypeDescriptor: DcmtTypeDescriptor, documents: Array<DcmtInfo>) => void), openCommentFormCallback?: ((documents: Array<DcmtInfo>) => void), openEditPdf?: ((documents: Array<DcmtInfo>) => void), openAddDocumentForm?: () => void, passToArchiveCallback?: (outputMids: Array<{
|
|
9
9
|
mid: number;
|
|
10
10
|
value: string;
|
|
11
11
|
}>, tid?: number) => void, archiveMasterDocuments?: (tid: number | undefined) => Promise<void>, archiveDetailDocuments?: (tid: number | undefined) => Promise<void>, hasMasterRelation?: boolean, hasDetailRelation?: boolean, canArchiveMasterRelation?: boolean, canArchiveDetailRelation?: boolean, pairManyToManyDocuments?: (isPairing: boolean) => Promise<void>, hasManyToManyRelation?: boolean, pinnedItemIds?: string[], onTogglePin?: (id: string) => void) => Array<TMContextMenuItemProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService
|
|
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, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts,
|
|
2
|
+
import { AccessLevels, AccessLevelsEx, AppModules, FileFormats, LayoutModes, SDK_Globals, DcmtTypeListCacheService } 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, searchResultToMetadataValues, IconSignaturePencil, IconArchiveMaster, IconArchiveDetail, IconDetailDcmts, IconPair, IconUnpair, IconSharedDcmt, IconShare, IconCopy, IconMoveToFolder, IconPin, isPdfEditorAvailable } 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';
|
|
@@ -80,8 +80,7 @@ export const signatureInformationCallback = async (isMobile, inputDcmts) => {
|
|
|
80
80
|
TMSpinner.hide();
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, focusedItem, context, showFloatingBar, workingGroupContext, showSearch, setShowFloatingBar, openFormHandler, openSharedArchiveHandler, showSharedDcmtsHandler, downloadDcmtsAsync, runOperationAsync, onRefreshSearchAsync, onRefreshDataRowsAsync, onRefreshAfterAddDcmtToFavs, confirmFormat, confirmAttachments, openTaskFormHandler, openDetailDcmtsFormHandler, openMasterDcmtsFormHandler, openBatchUpdateFormHandler, openExportForm, handleToggleSearch, handleSignApprove,
|
|
84
|
-
const isPdfEditorLicensed = SDK_Globals?.license?.dcmtArchiveLicenses?.[0]?.siX_60007?.status === LicenseModuleStatus.Licensed;
|
|
83
|
+
export const getCommandsMenuItems = (isMobile, dtd, allUsers, 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, handleCheckInOperationCallback, showCheckoutInformationFormCallback, viewHistoryCallback, copyCheckoutPathToClipboardOperationCallback, openWGsCopyMoveForm, openCommentFormCallback, openEditPdf, openAddDocumentForm, passToArchiveCallback, archiveMasterDocuments, archiveDetailDocuments, hasMasterRelation, hasDetailRelation, canArchiveMasterRelation, canArchiveDetailRelation, pairManyToManyDocuments, hasManyToManyRelation, pinnedItemIds, onTogglePin) => {
|
|
85
84
|
const addPinIconToItems = (items) => {
|
|
86
85
|
if (isMobile || !onTogglePin)
|
|
87
86
|
return items;
|
|
@@ -102,10 +101,6 @@ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, foc
|
|
|
102
101
|
return newItem;
|
|
103
102
|
});
|
|
104
103
|
};
|
|
105
|
-
let pdfEditorAvailable = false;
|
|
106
|
-
if (dtd && dtd.widgets && dtd.widgets.length > 0) {
|
|
107
|
-
pdfEditorAvailable = isPdfEditorEnabled(dtd.widgets);
|
|
108
|
-
}
|
|
109
104
|
const addToFavoriteMenuItem = () => {
|
|
110
105
|
return {
|
|
111
106
|
id: 'fav',
|
|
@@ -320,13 +315,6 @@ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, foc
|
|
|
320
315
|
name: SDKUI_Localizator.Signature,
|
|
321
316
|
onClick: handleSignApprove
|
|
322
317
|
},
|
|
323
|
-
/* {
|
|
324
|
-
icon: <IconSettings />,
|
|
325
|
-
operationType: 'singleRow',
|
|
326
|
-
disabled: disabledForSingleRow(selectedItems, focusedItem),
|
|
327
|
-
name: SDKUI_Localizator.SignatureSettings,
|
|
328
|
-
onClick: openSignSettingsForm
|
|
329
|
-
}, */
|
|
330
318
|
{
|
|
331
319
|
id: 'sign-info',
|
|
332
320
|
icon: _jsx(IconCircleInfo, {}),
|
|
@@ -735,7 +723,7 @@ export const getCommandsMenuItems = (isMobile, dtd, allUsers, selectedItems, foc
|
|
|
735
723
|
duplicateDocumentMenuItem(),
|
|
736
724
|
batchUpdateMenuItem(),
|
|
737
725
|
passToArchive(),
|
|
738
|
-
...((
|
|
726
|
+
...((isPdfEditorAvailable(dtd, getSelectedDcmtsOrFocused(selectedItems, focusedItem)?.[0]?.FILEEXT) && openEditPdf) ? [pdfEditorMenuItem(openEditPdf)] : []),
|
|
739
727
|
]
|
|
740
728
|
},
|
|
741
729
|
signatureMenuItem(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { SDK_Globals } from "@topconsultnpm/sdk-ts";
|
|
4
|
-
import { IconCopy, getExceptionMessage } from "../../../helper";
|
|
4
|
+
import { IconCopy, getExceptionMessage, SDKUI_Localizator } from "../../../helper";
|
|
5
5
|
import TMSpinner from "../../base/TMSpinner";
|
|
6
6
|
const TMSignatureInfoContent = (props) => {
|
|
7
7
|
const { inputDcmt } = props;
|
|
@@ -105,12 +105,16 @@ const TMSignatureInfoContent = (props) => {
|
|
|
105
105
|
gap: '10px',
|
|
106
106
|
fontSize: '13px'
|
|
107
107
|
}, children: [_jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Intestatario:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info1 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Riferimento temporale:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info2 ?? '-' })] }), _jsxs("div", { children: [_jsx("strong", { style: { color: '#555' }, children: "Dettagli:" }), _jsx("div", { style: { marginTop: '4px', color: '#333' }, children: signer.info3 ?? '-' })] })] })] }, idx)))] })) : (_jsx("div", { style: {
|
|
108
|
-
|
|
108
|
+
border: "1px solid #d0d0d0",
|
|
109
|
+
borderRadius: "8px",
|
|
110
|
+
padding: "16px",
|
|
111
|
+
marginBottom: "12px",
|
|
112
|
+
background: "linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%)",
|
|
113
|
+
boxShadow: "0 2px 4px rgba(0,0,0,0.08)",
|
|
114
|
+
userSelect: 'text',
|
|
109
115
|
textAlign: 'center',
|
|
110
|
-
color: '#666'
|
|
111
|
-
|
|
112
|
-
borderRadius: '8px'
|
|
113
|
-
}, children: "Nessuna firma trovata" })), signerInfo.shA256 && (_jsxs("div", { style: {
|
|
116
|
+
color: '#666'
|
|
117
|
+
}, children: SDKUI_Localizator.NoSignatureFound })), signerInfo.shA256 && (_jsxs("div", { style: {
|
|
114
118
|
marginBottom: '12px',
|
|
115
119
|
padding: '16px',
|
|
116
120
|
background: '#f5f5f5',
|
|
@@ -86,7 +86,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
86
86
|
setShowInfo(false);
|
|
87
87
|
setInfoDTD(undefined);
|
|
88
88
|
}
|
|
89
|
-
}, children: [_jsx("span", { style: { cursor: 'pointer', flex: 1, minWidth: 0 }, children: _jsx(TMTidViewer, { tid: treeItem.tid,
|
|
89
|
+
}, children: [_jsx("span", { style: { cursor: 'pointer', flex: 1, minWidth: 0 }, children: _jsx(TMTidViewer, { tid: treeItem.tid, showIcon: false }) }), !isMobile && (_jsx("span", { style: {
|
|
90
90
|
opacity: showInfo ? 1 : 0,
|
|
91
91
|
transition: 'opacity 0.2s',
|
|
92
92
|
pointerEvents: showInfo ? 'auto' : 'none',
|
|
@@ -358,7 +358,7 @@ const TaskFormResponseComment = (props) => {
|
|
|
358
358
|
}, children: currentResponse && currentResponse.length > 0
|
|
359
359
|
? _jsx(TMHtmlContentDisplay, { markup: currentResponse ?? '-', isSelected: false })
|
|
360
360
|
: _jsx("span", { style: { color: '#6c757d', fontStyle: 'italic' }, children: SDKUI_Localizator.NoAnswerProvided }) }) }))] })
|
|
361
|
-
: (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined
|
|
361
|
+
: (_jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: currentResponse ?? '', onChange: onAnswerChange ? onAnswerChange : undefined }), _jsx(ResponseCommentLabel, { htmlFor: "responseId", children: SDKUI_Localizator.Answer }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (currentResponse ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] })) }));
|
|
362
362
|
};
|
|
363
363
|
// Stile comune per i container dei campi
|
|
364
364
|
const fieldContainerStyle = { width: '100%' };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
|
-
import { SDK_Globals, UserListCacheService, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
|
|
3
|
+
import { ResultTypes, SDK_Globals, UserListCacheService, ValidationItem, WFEvents, WorkflowCacheService } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import { SDKUI_Localizator, IconApply, IconCloseOutline, IconUser, IconInfo, IconSignaturePencil, isSign4TopEnabled, IconCheck, IconCloseCircle, IconStop, taskModalSizes } from "../../../helper";
|
|
6
6
|
import { TMColors } from "../../../utils/theme";
|
|
@@ -10,6 +10,7 @@ import TMModal from "../../base/TMModal";
|
|
|
10
10
|
import { TMExceptionBoxManager } from "../../base/TMPopUp";
|
|
11
11
|
import TMSpinner from "../../base/TMSpinner";
|
|
12
12
|
import TMUserChooser from "../../choosers/TMUserChooser";
|
|
13
|
+
import TMTextArea from "../../editors/TMTextArea";
|
|
13
14
|
import ShowAlert from "../../base/TMAlert";
|
|
14
15
|
import { FormModes } from "../../../ts";
|
|
15
16
|
import TMTaskForm from "../tasks/TMTaskForm";
|
|
@@ -19,17 +20,6 @@ const StyledWorkFlowOperationButtonsContainer = styled.div `
|
|
|
19
20
|
gap: 10px;
|
|
20
21
|
flex-direction: column;
|
|
21
22
|
`;
|
|
22
|
-
const StyledTextArea = styled.textarea `
|
|
23
|
-
width: 100%;
|
|
24
|
-
height: 100%;
|
|
25
|
-
border: 1px solid ${(props) => (props.$isValid ? '#b4b4b4' : TMColors.error)};
|
|
26
|
-
border-radius: 10px;
|
|
27
|
-
padding: 10px;
|
|
28
|
-
&:focus {
|
|
29
|
-
outline: none;
|
|
30
|
-
border-bottom: 4px solid ${(props) => (props.$isValid ? TMColors.primaryColor : TMColors.error)};
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
33
23
|
const CharacterCounter = styled.div `
|
|
34
24
|
text-align: right;
|
|
35
25
|
font-size: 0.8rem;
|
|
@@ -102,7 +92,7 @@ export const WorkFlowApproveRejectPopUp = ({ TID = 0, DID = 0, deviceType = Devi
|
|
|
102
92
|
const workflowAction = isReject === 0 ? SDKUI_Localizator.Approve : SDKUI_Localizator.Reject;
|
|
103
93
|
const itemCount = selectedItems.length > 0 ? `(${selectedItems.length} workitem)` : '';
|
|
104
94
|
const title = `${workflowAction} ${itemCount}`;
|
|
105
|
-
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [
|
|
95
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMTextArea, { label: SDKUI_Localizator.CommentText, value: commentValue, onValueChanged: (e) => setCommentValue(e.target.value), validationItems: isReject === 1 && disable ? [new ValidationItem(ResultTypes.ERROR, 'comment', SDKUI_Localizator.RequiredField)] : [], maxLength: 200, fillHeight: true }), commentValue.length > 0 && _jsx(CharacterCounter, { children: `${200 - commentValue.length} ${SDKUI_Localizator.CharactersRemaining}` })] }), _jsx(StyledModalFooter, { children: isReject === 0
|
|
106
96
|
? _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconApply, {}), caption: SDKUI_Localizator.Approve, disabled: false, onClick: () => completeOrRejectAsync(isReject), advancedColor: TMColors.success })
|
|
107
97
|
: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCloseOutline, {}), caption: SDKUI_Localizator.Reject, disabled: disable, onClick: () => { !disable && completeOrRejectAsync(isReject); }, advancedColor: TMColors.error }) })] }) }));
|
|
108
98
|
};
|
|
@@ -110,7 +100,7 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
110
100
|
const [commentValue, setCommentValue] = useState('');
|
|
111
101
|
const [selectedUserID, setSelectedUserID] = useState([]);
|
|
112
102
|
const [participants, setParticipants] = useState([]);
|
|
113
|
-
const disable = commentValue.length === 0 ||
|
|
103
|
+
const disable = commentValue.length === 0 || selectedUserID.length === 0;
|
|
114
104
|
// Determina se siamo nel contesto CtrlWorkflow (quando abbiamo workItemDetail)
|
|
115
105
|
const isCtrlWorkflowContext = !!workItemDetail;
|
|
116
106
|
const reAssignWorkFlowAsync = async () => {
|
|
@@ -175,9 +165,9 @@ export const WorkFlowReAssignPopUp = ({ DID = 0, TID = 0, deviceType = DeviceTyp
|
|
|
175
165
|
// Determina il conteggio degli item da mostrare nel titolo
|
|
176
166
|
const itemCount = workItemDetail ? 1 : selectedItems.length;
|
|
177
167
|
const titleSuffix = itemCount > 0 ? ` (${itemCount} workitem)` : '';
|
|
178
|
-
return (_jsx(TMModal, { onClose: onClose, width: '600px', height: '
|
|
168
|
+
return (_jsx(TMModal, { onClose: onClose, width: '600px', height: '350px', isModal: true, title: SDKUI_Localizator.Reassign + titleSuffix, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMUserChooser, { label: SDKUI_Localizator.AssignTo, dataSource: participants, validationItems: selectedUserID.length === 0 ? [new ValidationItem(ResultTypes.ERROR, 'selectedUser', SDKUI_Localizator.RequiredField)] : [], values: selectedUserID, onValueChanged: (IDs) => {
|
|
179
169
|
setSelectedUserID(IDs ?? []);
|
|
180
|
-
} }),
|
|
170
|
+
} }), _jsx(TMTextArea, { label: SDKUI_Localizator.CommentText, value: commentValue, onValueChanged: (e) => setCommentValue(e.target.value), validationItems: commentValue.length === 0 ? [new ValidationItem(ResultTypes.ERROR, 'comment', SDKUI_Localizator.RequiredField)] : [], maxLength: 200, fillHeight: true, elementStyle: { marginTop: '10px', flex: 1 } }), commentValue.length > 0 && _jsx(CharacterCounter, { children: `${200 - commentValue.length} ${SDKUI_Localizator.CharactersRemaining}` })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconUser, { fontSize: 16 }), caption: SDKUI_Localizator.Reassign, disabled: disable, onClick: () => !disable && reAssignWorkFlowAsync(), advancedColor: TMColors.tertiary }) })] }) }));
|
|
181
171
|
};
|
|
182
172
|
/**
|
|
183
173
|
* Modal per forzare l'approvazione di un work item
|
|
@@ -208,7 +198,7 @@ export const WorkflowForceApproveModal = ({ detail, onClose, onCompleted }) => {
|
|
|
208
198
|
};
|
|
209
199
|
const userName = detail.toUser?.name ?? detail.to;
|
|
210
200
|
const title = `Forza completamento - ${userName}`;
|
|
211
|
-
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(
|
|
201
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMTextArea, { label: "Motivazione", value: commentValue, onValueChanged: (e) => setCommentValue(e.target.value), validationItems: disable ? [new ValidationItem(ResultTypes.ERROR, 'comment', SDKUI_Localizator.RequiredField)] : [], placeHolder: "Inserisci il motivo della forzatura...", maxLength: 200, fillHeight: true }), commentValue.length > 0 && _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCheck, {}), caption: "Forza approvazione", width: '180px', disabled: disable, onClick: () => !disable && forceApproveAsync(), advancedColor: TMColors.success }) })] }) }));
|
|
212
202
|
};
|
|
213
203
|
/**
|
|
214
204
|
* Modal per forzare il rifiuto di un work item
|
|
@@ -239,7 +229,7 @@ export const WorkflowForceRejectModal = ({ detail, onClose, onCompleted }) => {
|
|
|
239
229
|
};
|
|
240
230
|
const userName = detail.toUser?.name ?? detail.to;
|
|
241
231
|
const title = `Forza rifiuto - ${userName}`;
|
|
242
|
-
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(
|
|
232
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMTextArea, { label: "Motivazione", value: commentValue, onValueChanged: (e) => setCommentValue(e.target.value), validationItems: disable ? [new ValidationItem(ResultTypes.ERROR, 'comment', SDKUI_Localizator.RequiredField)] : [], placeHolder: "Inserisci il motivo del rifiuto...", maxLength: 200, fillHeight: true }), commentValue.length > 0 && _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconCloseCircle, {}), caption: "Forza rifiuto", width: '150px', disabled: disable, onClick: () => !disable && forceRejectAsync(), advancedColor: TMColors.error }) })] }) }));
|
|
243
233
|
};
|
|
244
234
|
/**
|
|
245
235
|
* Modal per terminare le istanze workflow selezionate
|
|
@@ -278,7 +268,7 @@ export const WorkflowEndInstanceModal = ({ selectedInstances, onClose, onComplet
|
|
|
278
268
|
const title = selectedInstances.length === 1
|
|
279
269
|
? `${SDKUI_Localizator.WorkflowEndInstance} (DID: ${selectedInstances[0].did})`
|
|
280
270
|
: `${SDKUI_Localizator.WorkflowEndInstance} (${selectedInstances.length} istanze)`;
|
|
281
|
-
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(
|
|
271
|
+
return (_jsx(TMModal, { title: title, onClose: onClose, width: '600px', height: '270px', isModal: true, children: _jsxs(StyledModalBodyWrapper, { children: [_jsxs(StyledModalContentContainer, { children: [_jsx(TMTextArea, { label: "Motivazione", value: commentValue, onValueChanged: (e) => setCommentValue(e.target.value), validationItems: disable ? [new ValidationItem(ResultTypes.ERROR, 'comment', SDKUI_Localizator.RequiredField)] : [], placeHolder: "Inserisci il motivo della terminazione...", maxLength: 200, fillHeight: true }), commentValue.length > 0 && _jsxs(CharacterCounter, { children: [commentValue.length, "/200"] })] }), _jsx(StyledModalFooter, { children: _jsx(TMButton, { btnStyle: 'advanced', showTooltip: false, icon: _jsx(IconStop, {}), caption: SDKUI_Localizator.WorkflowEndInstance, width: '150px', disabled: disable, onClick: () => !disable && endInstancesAsync(), advancedColor: TMColors.error }) })] }) }));
|
|
282
272
|
};
|
|
283
273
|
export const WorkFlowMoreInfoPopUp = (props) => {
|
|
284
274
|
const { fromDTD, DID = 0, TID = 0, deviceType = DeviceType.DESKTOP, onClose, onCompleted, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, handleNavigateToWGs, handleNavigateToDossiers, triggerBlogRefresh } = props;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DiagramItem, WfInfo } from './interfaces';
|
|
3
|
+
import { DataListItemDescriptor } from '@topconsultnpm/sdk-ts';
|
|
3
4
|
interface DiagramItemFormProps {
|
|
4
5
|
itemToEdit: DiagramItem;
|
|
5
6
|
wf: WfInfo | null | undefined;
|
|
6
7
|
onClose: () => void;
|
|
7
8
|
onApply: (updatedItem: DiagramItem) => void;
|
|
9
|
+
onStatusItemEdited?: (originalItem: DataListItemDescriptor, editedItem: DataListItemDescriptor) => void;
|
|
8
10
|
}
|
|
9
11
|
declare const DiagramItemForm: React.FC<DiagramItemFormProps>;
|
|
10
12
|
export default DiagramItemForm;
|
|
@@ -10,7 +10,7 @@ import TMTextBox from '../../../editors/TMTextBox';
|
|
|
10
10
|
import TMButton from '../../../base/TMButton';
|
|
11
11
|
import styled from 'styled-components';
|
|
12
12
|
import TMQuerySummary from '../../../query/TMQuerySummary';
|
|
13
|
-
import { CultureIDs, DcmtTypeListCacheService, FromItem, MetadataDataDomains, SDK_Globals, SearchEngine, Severities, WFAppTypes, WorkItemSetRules } from '@topconsultnpm/sdk-ts';
|
|
13
|
+
import { CultureIDs, DcmtTypeListCacheService, FromItem, MetadataDataDomains, ResultTypes, SDK_Globals, SearchEngine, Severities, WFAppTypes, WorkItemSetRules } from '@topconsultnpm/sdk-ts';
|
|
14
14
|
import TMLocalizedTextBox from '../../../editors/TMLocalizedTextBox';
|
|
15
15
|
import TMDataListItemPicker from '../../../choosers/TMDataListItemPicker';
|
|
16
16
|
import WorkitemRecipientsEditor, { actorsToTos, RecipientsContainer, tosToActors } from './WorkitemRecipientsEditor';
|
|
@@ -30,9 +30,16 @@ import { DiagramItemProps, wfDiagramItemValidator } from './workflowHelpers';
|
|
|
30
30
|
const FormContainer = styled.div `
|
|
31
31
|
display: flex;
|
|
32
32
|
flex-direction: column;
|
|
33
|
-
|
|
33
|
+
height: 100%;
|
|
34
34
|
padding: 10px;
|
|
35
35
|
`;
|
|
36
|
+
const FieldsContainer = styled.div `
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
gap: 5px;
|
|
40
|
+
flex: 1;
|
|
41
|
+
overflow-y: auto;
|
|
42
|
+
`;
|
|
36
43
|
const FlexContainer = styled.div `
|
|
37
44
|
display: flex;
|
|
38
45
|
align-items: center;
|
|
@@ -76,7 +83,7 @@ const APP_TYPES_DATASOURCE = [
|
|
|
76
83
|
{ value: WFAppTypes.SP, display: "SP" },
|
|
77
84
|
{ value: WFAppTypes.REST, display: "REST" }
|
|
78
85
|
];
|
|
79
|
-
const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
86
|
+
const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply, onStatusItemEdited }) => {
|
|
80
87
|
const [localItem, setLocalItem] = useState(itemToEdit);
|
|
81
88
|
const [localItemOrig] = useState(structuredClone(itemToEdit));
|
|
82
89
|
const [validationItems, setValidationItems] = useState([]);
|
|
@@ -392,7 +399,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
392
399
|
};
|
|
393
400
|
// Function to render Status-specific fields
|
|
394
401
|
const renderStatusFields = () => {
|
|
395
|
-
return (_jsx(TMDataListItemPicker, { dataListID: wf?.MStatusDLID, selectedValue: localItem.StatusValue, onItemSelect: handleStatusChange, allowEdit: true }));
|
|
402
|
+
return (_jsx(TMDataListItemPicker, { dataListID: wf?.MStatusDLID, selectedValue: localItem.StatusValue, onItemSelect: handleStatusChange, onItemEdited: onStatusItemEdited, allowEdit: true }));
|
|
396
403
|
};
|
|
397
404
|
const renderAppFields = () => {
|
|
398
405
|
return (_jsxs(_Fragment, { children: [_jsx(TMDropDown, { label: SDKUI_Localizator.WorkflowAppType, dataSource: APP_TYPES_DATASOURCE, value: localItem.AppType, isModifiedWhen: localItem.AppType !== localItemOrig.AppType, validationItems: validationItems.filter(v => v.PropertyName === DiagramItemProps.AppType), onValueChanged: (e) => { handleAppTypeChange(e.target.value); } }), localItem.AppType === WFAppTypes.EXE
|
|
@@ -580,38 +587,38 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
580
587
|
setDossierTypes(formattedList);
|
|
581
588
|
});
|
|
582
589
|
}, [localItem.Type]);
|
|
583
|
-
//
|
|
584
|
-
const { andRecipients:
|
|
585
|
-
return tosToActors(localItem.Tos ?? '');
|
|
586
|
-
}, [localItem.Tos]);
|
|
587
|
-
const { andRecipients: tos2Recipients } = useMemo(() => {
|
|
590
|
+
// Owner = Tos2, Participants = Tos
|
|
591
|
+
const { andRecipients: ownerRecipients } = useMemo(() => {
|
|
588
592
|
return tosToActors(localItem.Tos2 ?? '');
|
|
589
593
|
}, [localItem.Tos2]);
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
handleTosChange(newTos);
|
|
595
|
-
}, [localItem.Tos, handleTosChange]);
|
|
596
|
-
const handleRemoveTosRecipient = useCallback((recipientToRemove) => {
|
|
597
|
-
const { andRecipients } = tosToActors(localItem.Tos ?? '');
|
|
598
|
-
const updatedRecipients = andRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID);
|
|
599
|
-
const newTos = actorsToTos(updatedRecipients);
|
|
600
|
-
handleTosChange(newTos);
|
|
601
|
-
}, [localItem.Tos, handleTosChange]);
|
|
602
|
-
const handleAddTos2Recipients = useCallback((newRecipients, orValue) => {
|
|
594
|
+
const { andRecipients: participantRecipients } = useMemo(() => {
|
|
595
|
+
return tosToActors(localItem.Tos ?? '');
|
|
596
|
+
}, [localItem.Tos]);
|
|
597
|
+
const handleAddOwnerRecipients = useCallback((newRecipients, orValue) => {
|
|
603
598
|
const { andRecipients } = tosToActors(localItem.Tos2 ?? '');
|
|
604
599
|
const updatedRecipients = [...andRecipients, ...newRecipients.map(r => ({ ...r, Or: orValue }))];
|
|
605
600
|
const newTos = actorsToTos(updatedRecipients);
|
|
606
601
|
handleTos2Change(newTos);
|
|
607
602
|
}, [localItem.Tos2, handleTos2Change]);
|
|
608
|
-
const
|
|
603
|
+
const handleRemoveOwnerRecipient = useCallback((recipientToRemove) => {
|
|
609
604
|
const { andRecipients } = tosToActors(localItem.Tos2 ?? '');
|
|
610
605
|
const updatedRecipients = andRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID);
|
|
611
606
|
const newTos = actorsToTos(updatedRecipients);
|
|
612
607
|
handleTos2Change(newTos);
|
|
613
608
|
}, [localItem.Tos2, handleTos2Change]);
|
|
614
|
-
|
|
609
|
+
const handleAddParticipantRecipients = useCallback((newRecipients, orValue) => {
|
|
610
|
+
const { andRecipients } = tosToActors(localItem.Tos ?? '');
|
|
611
|
+
const updatedRecipients = [...andRecipients, ...newRecipients.map(r => ({ ...r, Or: orValue }))];
|
|
612
|
+
const newTos = actorsToTos(updatedRecipients);
|
|
613
|
+
handleTosChange(newTos);
|
|
614
|
+
}, [localItem.Tos, handleTosChange]);
|
|
615
|
+
const handleRemoveParticipantRecipient = useCallback((recipientToRemove) => {
|
|
616
|
+
const { andRecipients } = tosToActors(localItem.Tos ?? '');
|
|
617
|
+
const updatedRecipients = andRecipients.filter(r => r.ActorType !== recipientToRemove.ActorType || r.ActorID !== recipientToRemove.ActorID);
|
|
618
|
+
const newTos = actorsToTos(updatedRecipients);
|
|
619
|
+
handleTosChange(newTos);
|
|
620
|
+
}, [localItem.Tos, handleTosChange]);
|
|
621
|
+
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.DossierType, 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: ownerRecipients, title: SDKUI_Localizator.OwnerName, tid: wf?.MTID, maxRecipients: 1, validationItems: validationItems.filter(v => v.PropertyName === DiagramItemProps.Tos2), onAdd: (newRecipients) => handleAddOwnerRecipients(newRecipients, 0), onRemove: handleRemoveOwnerRecipient }), _jsx(RecipientList, { recipients: participantRecipients, title: SDKUI_Localizator.Participants, tid: wf?.MTID, onAdd: (newRecipients) => handleAddParticipantRecipients(newRecipients, 0), onRemove: handleRemoveParticipantRecipient })] })] }));
|
|
615
622
|
};
|
|
616
623
|
const renderAddPartsFields = () => {
|
|
617
624
|
const { andRecipients: tosRecipients } = useMemo(() => {
|
|
@@ -679,7 +686,7 @@ const DiagramItemForm = ({ itemToEdit, wf, onClose, onApply }) => {
|
|
|
679
686
|
default:
|
|
680
687
|
specificFields = null;
|
|
681
688
|
}
|
|
682
|
-
return (_jsxs(FormContainer, { children: [renderCommonFields(), specificFields, _jsxs(ButtonsContainer, { children: [_jsx(TMButton, { caption: 'Applica', btnStyle: 'advanced', advancedColor: TMColors.tertiary, icon: _jsx(IconApply, {}), showTooltip: false, disabled: !isModified, onClick: handleSave }), _jsx(TMButton, { caption: 'Annulla', btnStyle: 'toolbar', color: 'primary', icon: _jsx(IconUndo, {}), showTooltip: false, disabled: !isModified, onClick: handleCancel })] })] }));
|
|
689
|
+
return (_jsxs(FormContainer, { children: [_jsxs(FieldsContainer, { children: [renderCommonFields(), specificFields] }), _jsxs(ButtonsContainer, { children: [_jsx(TMButton, { caption: 'Applica', btnStyle: 'advanced', advancedColor: TMColors.tertiary, icon: _jsx(IconApply, {}), showTooltip: false, disabled: !isModified || validationItems.some(v => v.ResultType === ResultTypes.ERROR), onClick: handleSave }), _jsx(TMButton, { caption: 'Annulla', btnStyle: 'toolbar', color: 'primary', icon: _jsx(IconUndo, {}), showTooltip: false, disabled: !isModified, onClick: handleCancel })] })] }));
|
|
683
690
|
};
|
|
684
691
|
return (_jsx(TMModal, { title: LocalizeDiagramItemType(localItem.Type), onClose: onClose, isModal: true, width: calculatedWidth, height: calculatedHeight, children: renderForm() }));
|
|
685
692
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { QueryDescriptor } from '@topconsultnpm/sdk-ts';
|
|
2
|
+
import { QueryDescriptor, ValidationItem } from '@topconsultnpm/sdk-ts';
|
|
3
3
|
export declare enum WorkItemActorTypes {
|
|
4
4
|
None = 0,
|
|
5
5
|
UID = 1,
|
|
@@ -19,6 +19,8 @@ interface RecipientListProps {
|
|
|
19
19
|
title: string;
|
|
20
20
|
tid?: number;
|
|
21
21
|
qd?: QueryDescriptor;
|
|
22
|
+
maxRecipients?: number;
|
|
23
|
+
validationItems?: ValidationItem[];
|
|
22
24
|
onQDChange?: (newQd: QueryDescriptor | undefined) => void;
|
|
23
25
|
onAdd: (recipient: WorkItemActor[]) => void;
|
|
24
26
|
onRemove: (recipient: WorkItemActor) => void;
|
|
@@ -7,6 +7,7 @@ import { TMUserChooserForm } from '../../../choosers/TMUserChooser';
|
|
|
7
7
|
import { TMGroupChooserForm, TMGroupIdViewer } from '../../../choosers/TMGroupChooser';
|
|
8
8
|
import { TMMidViewer } from '../../../viewers/TMMidViewer';
|
|
9
9
|
import { SDK_Globals, SDK_Localizator } from '@topconsultnpm/sdk-ts';
|
|
10
|
+
import TMVilViewer from '../../../base/TMVilViewer';
|
|
10
11
|
import { useOutsideClick } from '../../../../hooks/useOutsideClick';
|
|
11
12
|
import { FormModes } from '../../../../ts';
|
|
12
13
|
import { TMMessageBoxManager, ButtonNames } from '../../../base/TMPopUp';
|
|
@@ -70,7 +71,7 @@ const FloatingMenu = styled.div `
|
|
|
70
71
|
const FloatingMenuButton = (props) => {
|
|
71
72
|
return _jsx(TMButton, { width: "100%", ...props });
|
|
72
73
|
};
|
|
73
|
-
const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange }) => {
|
|
74
|
+
const RecipientList = ({ recipients, title, tid, qd, maxRecipients, validationItems, onAdd, onRemove, onQDChange }) => {
|
|
74
75
|
const [uiState, setUiState] = useState({
|
|
75
76
|
isMenuOpen: false,
|
|
76
77
|
showUserChooser: false,
|
|
@@ -102,7 +103,7 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
|
|
|
102
103
|
onAdd(recipientsToAdd);
|
|
103
104
|
}
|
|
104
105
|
setUiState(prevState => ({ ...prevState, showUserChooser: false }));
|
|
105
|
-
}, []);
|
|
106
|
+
}, [onAdd]);
|
|
106
107
|
const handleGroupChosen = useCallback((IDs) => {
|
|
107
108
|
if (IDs && IDs.length > 0) {
|
|
108
109
|
const recipientsToAdd = IDs.map(id => ({
|
|
@@ -113,7 +114,7 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
|
|
|
113
114
|
onAdd(recipientsToAdd);
|
|
114
115
|
}
|
|
115
116
|
setUiState(prevState => ({ ...prevState, showGroupChooser: false }));
|
|
116
|
-
}, []);
|
|
117
|
+
}, [onAdd]);
|
|
117
118
|
const handleMetadataChosen = useCallback((IDs) => {
|
|
118
119
|
if (IDs && IDs.length > 0) {
|
|
119
120
|
const recipientsToAdd = IDs.map(item => ({
|
|
@@ -124,8 +125,11 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
|
|
|
124
125
|
onAdd(recipientsToAdd);
|
|
125
126
|
}
|
|
126
127
|
setUiState(prevState => ({ ...prevState, showMetadataChooser: false }));
|
|
127
|
-
}, []);
|
|
128
|
+
}, [onAdd]);
|
|
129
|
+
const isMaxReached = maxRecipients !== undefined && recipients.length >= maxRecipients;
|
|
128
130
|
const handleAddClick = () => {
|
|
131
|
+
if (isMaxReached)
|
|
132
|
+
return;
|
|
129
133
|
setUiState(prevState => ({ ...prevState, isMenuOpen: !prevState.isMenuOpen }));
|
|
130
134
|
};
|
|
131
135
|
const handleRecipientClick = useCallback((index) => {
|
|
@@ -195,11 +199,11 @@ const RecipientList = ({ recipients, title, tid, qd, onAdd, onRemove, onQDChange
|
|
|
195
199
|
document.removeEventListener('keydown', handleKeyPress);
|
|
196
200
|
};
|
|
197
201
|
}, [handleKeyPress]);
|
|
198
|
-
return (_jsxs(RecipientsColumn, { children: [_jsxs(HeaderContainer, { children: [_jsx("p", { style: { fontWeight: 600 }, children: title }), _jsx(TMButton, { btnStyle: 'icon', caption: SDKUI_Localizator.AddRecipient, icon: _jsx(IconAdd, {}), onClick: handleAddClick }), uiState.isMenuOpen && renderFloatingMenu()] }), _jsx("div", { style: { height: '150px', overflowY: 'auto', gap: '5px', display: 'flex', flexDirection: 'column' }, children: recipients.map((recipient, index) => (_jsxs(RecipientItem, { "$isSelected": uiState.selectedRecipientIndex === index, onClick: () => handleRecipientClick(index), tabIndex: 0, children: [_jsx(IconDelete, { color: '#c00', cursor: 'pointer', onClick: (e) => {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
202
|
+
return (_jsxs(RecipientsColumn, { children: [_jsxs(HeaderContainer, { children: [_jsx("p", { style: { fontWeight: 600 }, children: title }), _jsx(TMButton, { btnStyle: 'icon', caption: SDKUI_Localizator.AddRecipient, icon: _jsx(IconAdd, {}), onClick: handleAddClick, disabled: isMaxReached }), uiState.isMenuOpen && !isMaxReached && renderFloatingMenu()] }), _jsx(TMVilViewer, { vil: validationItems }), _jsx("div", { style: { height: '150px', overflowY: 'auto', gap: '5px', display: 'flex', flexDirection: 'column' }, children: recipients.map((recipient, index) => (_jsxs(RecipientItem, { "$isSelected": uiState.selectedRecipientIndex === index, onClick: () => handleRecipientClick(index), tabIndex: 0, children: [_jsx("span", { style: { display: 'flex', alignItems: 'center', flexShrink: 0 }, children: _jsx(IconDelete, { color: '#c00', cursor: 'pointer', onClick: (e) => {
|
|
203
|
+
e.stopPropagation();
|
|
204
|
+
onRemove(recipient);
|
|
205
|
+
setUiState(prevState => ({ ...prevState, selectedRecipientIndex: null }));
|
|
206
|
+
} }) }), _jsx("span", { style: { flex: 1, minWidth: 0, display: 'flex', alignItems: 'center' }, children: 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 &&
|
|
203
207
|
_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 })) }) })] }));
|
|
204
208
|
};
|
|
205
209
|
export default RecipientList;
|