@topconsultnpm/sdkui-react 6.20.0-dev1.55 → 6.20.0-dev1.57
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/NewComponents/ContextMenu/TMContextMenu.js +86 -1
- package/lib/components/NewComponents/ContextMenu/types.d.ts +1 -0
- package/lib/components/features/documents/TMDcmtForm.js +1 -1
- package/lib/components/features/search/TMSavedQuerySelector.js +3 -3
- package/lib/components/features/tasks/TMTaskForm.js +20 -1
- package/lib/components/grids/TMBlogsPost.js +21 -2
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { createPortal } from 'react-dom';
|
|
|
4
4
|
import * as S from './styles';
|
|
5
5
|
import { useIsMobile, useMenuPosition, useIsIOS } from './hooks';
|
|
6
6
|
import { IconArrowLeft } from '../../../helper';
|
|
7
|
-
const TMContextMenu = ({ items, trigger = 'right', children, externalControl, keepOpenOnClick = false }) => {
|
|
7
|
+
const TMContextMenu = ({ items, trigger = 'right', children, target, externalControl, keepOpenOnClick = false }) => {
|
|
8
8
|
const [menuState, setMenuState] = useState({
|
|
9
9
|
visible: false,
|
|
10
10
|
position: { x: 0, y: 0 },
|
|
@@ -46,6 +46,91 @@ const TMContextMenu = ({ items, trigger = 'right', children, externalControl, ke
|
|
|
46
46
|
}));
|
|
47
47
|
}
|
|
48
48
|
}, [externalControl, items]);
|
|
49
|
+
// iOS long-press support: attach touch listeners to target elements
|
|
50
|
+
// On long-press, dispatch synthetic contextmenu event to trigger existing handlers
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (!target || !isIOS)
|
|
53
|
+
return;
|
|
54
|
+
const elements = document.querySelectorAll(target);
|
|
55
|
+
if (elements.length === 0)
|
|
56
|
+
return;
|
|
57
|
+
const touchStateMap = new WeakMap();
|
|
58
|
+
const handleTouchStart = (e) => {
|
|
59
|
+
const touchEvent = e;
|
|
60
|
+
const element = e.currentTarget;
|
|
61
|
+
const touch = touchEvent.touches[0];
|
|
62
|
+
let state = touchStateMap.get(element);
|
|
63
|
+
if (!state) {
|
|
64
|
+
state = { timeout: null, startX: 0, startY: 0 };
|
|
65
|
+
touchStateMap.set(element, state);
|
|
66
|
+
}
|
|
67
|
+
state.startX = touch.clientX;
|
|
68
|
+
state.startY = touch.clientY;
|
|
69
|
+
if (state.timeout)
|
|
70
|
+
clearTimeout(state.timeout);
|
|
71
|
+
state.timeout = setTimeout(() => {
|
|
72
|
+
// Haptic feedback
|
|
73
|
+
if ('vibrate' in navigator)
|
|
74
|
+
navigator.vibrate(50);
|
|
75
|
+
// Dispatch synthetic contextmenu event to trigger existing onContextMenu handlers
|
|
76
|
+
const syntheticEvent = new MouseEvent('contextmenu', {
|
|
77
|
+
bubbles: true,
|
|
78
|
+
cancelable: true,
|
|
79
|
+
clientX: touch.clientX,
|
|
80
|
+
clientY: touch.clientY,
|
|
81
|
+
});
|
|
82
|
+
element.dispatchEvent(syntheticEvent);
|
|
83
|
+
if (state)
|
|
84
|
+
state.timeout = null;
|
|
85
|
+
}, 500);
|
|
86
|
+
};
|
|
87
|
+
const handleTouchMove = (e) => {
|
|
88
|
+
const touchEvent = e;
|
|
89
|
+
const element = e.currentTarget;
|
|
90
|
+
const state = touchStateMap.get(element);
|
|
91
|
+
if (!state?.timeout)
|
|
92
|
+
return;
|
|
93
|
+
const touch = touchEvent.touches[0];
|
|
94
|
+
const dx = Math.abs(touch.clientX - state.startX);
|
|
95
|
+
const dy = Math.abs(touch.clientY - state.startY);
|
|
96
|
+
if (dx > 10 || dy > 10) {
|
|
97
|
+
clearTimeout(state.timeout);
|
|
98
|
+
state.timeout = null;
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
const handleTouchEnd = (e) => {
|
|
102
|
+
const element = e.currentTarget;
|
|
103
|
+
const state = touchStateMap.get(element);
|
|
104
|
+
if (state?.timeout) {
|
|
105
|
+
clearTimeout(state.timeout);
|
|
106
|
+
state.timeout = null;
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
// Attach listeners to all matching elements
|
|
110
|
+
elements.forEach(element => {
|
|
111
|
+
const el = element;
|
|
112
|
+
// Prevent iOS native callout
|
|
113
|
+
const style = el.style;
|
|
114
|
+
style.webkitTouchCallout = 'none';
|
|
115
|
+
style.webkitUserSelect = 'none';
|
|
116
|
+
el.addEventListener('touchstart', handleTouchStart, { passive: true });
|
|
117
|
+
el.addEventListener('touchmove', handleTouchMove, { passive: true });
|
|
118
|
+
el.addEventListener('touchend', handleTouchEnd);
|
|
119
|
+
el.addEventListener('touchcancel', handleTouchEnd);
|
|
120
|
+
});
|
|
121
|
+
return () => {
|
|
122
|
+
elements.forEach(element => {
|
|
123
|
+
const el = element;
|
|
124
|
+
const style = el.style;
|
|
125
|
+
style.webkitTouchCallout = '';
|
|
126
|
+
style.webkitUserSelect = '';
|
|
127
|
+
el.removeEventListener('touchstart', handleTouchStart);
|
|
128
|
+
el.removeEventListener('touchmove', handleTouchMove);
|
|
129
|
+
el.removeEventListener('touchend', handleTouchEnd);
|
|
130
|
+
el.removeEventListener('touchcancel', handleTouchEnd);
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
}, [target, isIOS]);
|
|
49
134
|
// Update items when they change while menu is visible (for keepOpenOnClick behavior)
|
|
50
135
|
useEffect(() => {
|
|
51
136
|
if (!keepOpenOnClick)
|
|
@@ -1567,7 +1567,7 @@ const TMDcmtForm = ({ allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTa
|
|
|
1567
1567
|
setArchiveRelatedDcmtFormTID(undefined);
|
|
1568
1568
|
setArchiveRelatedDcmtFormMids([]);
|
|
1569
1569
|
await fetchData();
|
|
1570
|
-
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })), showPairDcmtsModal && (_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshSearchAsync: async () => await fetchData(), onTaskCreateRequest: onTaskCreateRequest, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }))] }));
|
|
1570
|
+
}, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })), showPairDcmtsModal && (_jsx(TMModal, { title: (isPairingManyToMany ? "Abbina" : "Disabbina") + " documenti", onClose: () => setShowPairDcmtsModal(false), width: isMobile ? '90%' : '50%', height: isMobile ? '90%' : '70%', children: _jsx(TMSearchResult, { searchResults: pairedSearchResults, onRefreshSearchAsync: async () => await fetchData(), onTaskCreateRequest: onTaskCreateRequest, allowFloatingBar: false, floatingActionConfig: pairFloatingActionConfig, showBackButton: false, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }) }))] }));
|
|
1571
1571
|
};
|
|
1572
1572
|
export default TMDcmtForm;
|
|
1573
1573
|
/**
|
|
@@ -180,7 +180,7 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
180
180
|
overflow: 'auto'
|
|
181
181
|
}, children: dataSource.slice(0, showAllRoot || searchText.length > 0 ? dataSource.length : initialSQDsMaxItems).filter(o => searchText.length <= 0 || (searchText.length > 0 && o.name?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())) || o.description?.toLocaleLowerCase().includes(searchText.toLocaleLowerCase())).map((sqd, index) => {
|
|
182
182
|
const isCurrent = selectedItem?.id == sqd.id;
|
|
183
|
-
return (_jsx(StyledSqdItem, { "$isMobile": isMobile, onClick: () => {
|
|
183
|
+
return (_jsx(StyledSqdItem, { id: `sqd-item-${sqd.id}`, "$isMobile": isMobile, onClick: () => {
|
|
184
184
|
setSelectedItem(sqd);
|
|
185
185
|
onItemClick?.(sqd);
|
|
186
186
|
}, onContextMenu: (e) => {
|
|
@@ -222,10 +222,10 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
222
222
|
visibility: isCurrent ? 'visible' : 'hidden'
|
|
223
223
|
}, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) })] }) }, sqd.id));
|
|
224
224
|
}) }), dataSource.length > initialSQDsMaxItems && searchText.length <= 0 &&
|
|
225
|
-
_jsx("div", { style: { display: 'flex', justifyContent: 'flex-end', padding: '10px', position: 'relative' }, children: _jsx(TMShowAllOrMaxItemsButton, { showAll: showAllRoot, dataSourceLength: dataSource.length, onClick: () => { setShowAllRoot(!showAllRoot); } }) }),
|
|
225
|
+
_jsx("div", { style: { display: 'flex', justifyContent: 'flex-end', padding: '10px', position: 'relative' }, children: _jsx(TMShowAllOrMaxItemsButton, { showAll: showAllRoot, dataSourceLength: dataSource.length, onClick: () => { setShowAllRoot(!showAllRoot); } }) }), _jsx(TMContextMenu, { target: "[id^='sqd-item-']", items: contextMenuState.sqd ? getContextMenuItems(contextMenuState.sqd, manageDefault, isMobile, deleteSQDAsync, setDefaultSQDAsync, favManageSQDAsync, setInfoSQD) : [], externalControl: {
|
|
226
226
|
visible: contextMenuState.visible,
|
|
227
227
|
position: contextMenuState.position,
|
|
228
228
|
onClose: () => setContextMenuState(prev => ({ ...prev, visible: false, sqd: null }))
|
|
229
|
-
} })
|
|
229
|
+
} }), _jsxs(StyledOffCanvasPanel, { ref: panelRef, "$isOpen": isMobile && infoSQD !== undefined, children: [_jsxs(StyledDivHorizontal, { style: { gap: 10, padding: '10px 8px', width: '100%', alignItems: 'center' }, children: [_jsx("p", { style: { fontSize: '1.1rem', fontWeight: 'bold' }, children: `${SDK_Localizator.SavedQuery} - ${SDKUI_Localizator.About}` }), _jsx(IconCloseOutline, { style: { marginLeft: 'auto', cursor: 'pointer' }, onClick: () => setInfoSQD(undefined) })] }), getTooltipBySqd(infoSQD)] })] }));
|
|
230
230
|
});
|
|
231
231
|
export default TMSavedQuerySelector;
|
|
@@ -325,6 +325,25 @@ const TMTaskForm = (props) => {
|
|
|
325
325
|
await editTaskCallback(task);
|
|
326
326
|
onClose?.();
|
|
327
327
|
};
|
|
328
|
+
const handleNavigateToReference = (ref) => {
|
|
329
|
+
switch (ref.objClass) {
|
|
330
|
+
case ObjectClasses.Dossier:
|
|
331
|
+
if (ref.objID)
|
|
332
|
+
handleNavigateToDossiers(ref.objID);
|
|
333
|
+
else
|
|
334
|
+
console.log("Dossier reference missing objID");
|
|
335
|
+
break;
|
|
336
|
+
case ObjectClasses.WorkingGroup:
|
|
337
|
+
if (ref.objID)
|
|
338
|
+
handleNavigateToWGs(ref.objID);
|
|
339
|
+
else
|
|
340
|
+
console.log("Working Group reference missing objID");
|
|
341
|
+
break;
|
|
342
|
+
// Handle other object types as needed
|
|
343
|
+
default:
|
|
344
|
+
console.warn(`Unhandled object type: ${ref.objClass}`);
|
|
345
|
+
}
|
|
346
|
+
};
|
|
328
347
|
return (_jsx("div", { style: { width: "100%", height: "100%", overflow: "auto" }, ref: containerRef, children: _jsx(TMSaveForm, { width: width, height: height, id: id, title: title, isModal: isModal, formMode: formMode, onSaveAsync: saveDataAsync, onClose: onCloseCallback, onUndo: onUndoCallback, exception: exception, isModified: calcIsModified(formData, formDataOrig), validationItems: validationItems, showBackButton: showBackButton, hasNavigation: (hasNavigation && formMode !== FormModes.Create), canNext: canNext(), onNext: onNextCallback, canPrev: canPrev(), onPrev: onPrevCallback, showToolbar: !(showDcmtForm && formData?.iD1 && formData?.iD2), children: _jsxs(_Fragment, { children: [_jsx(ScrollView, { direction: "vertical", useNative: true, height: "calc(100% - 35px)", children: _jsx("div", { style: { marginRight: "5px" }, children: _jsxs(TMLayoutContainer, { direction: 'vertical', gap: 2, children: [(formMode === FormModes.Update && areDifferentIDs(formDataOrig?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)) && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#E29000" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.TaskAssignedMessage.replaceParams(formDataOrig?.fromName ?? '') })] }) }), taskContext?.workItem === undefined && (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
|
|
329
348
|
&& !areDifferentIDs(formData?.toID, SDK_Globals.tmSession?.SessionDescr?.userID))
|
|
330
349
|
&& _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs("div", { style: { width: '100%', display: 'flex', alignItems: 'center', color: "#2559A5" }, children: [_jsx("i", { className: "dx-icon-info", style: { fontSize: 20 } }), "\u00A0", _jsx("span", { children: SDKUI_Localizator.PersonalTaskAssignmentMessage })] }) }), (!areDifferentIDs(formData?.fromID, SDK_Globals.tmSession?.SessionDescr?.userID)
|
|
@@ -387,6 +406,6 @@ const TMTaskForm = (props) => {
|
|
|
387
406
|
: _jsx(TMTextBox, { label: SDKUI_Localizator.Priority, value: getPriorityLocalizatorValue(formData?.priority ?? Priorities.Low), readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 10 }, children: children }), children: _jsxs(_Fragment, { children: [_jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "start-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.StartDate, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.startTime, isModifiedWhen: formData?.startTime !== formDataOrig?.startTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate), onContentReady: handleStartTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, startTime: value }); }, showClearButton: true }) : _jsx(TMTextBox, { label: SDKUI_Localizator.StartDate, value: formData?.startTime ? formatDate(formData?.startTime) : '', readOnly: true }) }), _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: !fieldsReadOnly.startDate ? _jsx(TMDateBox, { id: "end-date", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Expiration, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.endTime, isModifiedWhen: formData?.endTime !== formDataOrig?.endTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorStartEndDate || o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onContentReady: handleEndTimeContentReady, onValueChange: (value) => { setFormData({ ...formData ?? {}, endTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.endDate }) : _jsx(TMTextBox, { label: SDKUI_Localizator.Expiration, value: formData?.endTime ? formatDate(formData?.endTime) : '', readOnly: true }) })] }) }), _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsx(TMDateBox, { id: "alert-time", resetTimeToZeroOnKeyPress: false, label: SDKUI_Localizator.Reminder, dateDisplayType: DateDisplayTypes.DateTime, value: formData?.remTime ?? undefined, isModifiedWhen: formData?.remTime !== formDataOrig?.remTime, validationItems: validationItems?.filter(o => o.PropertyName === SDKUI_Localizator.ErrorEndRemDate), onValueChange: (value) => { setFormData({ ...formData ?? {}, remTime: value }); }, showClearButton: true, readOnly: fieldsReadOnly.remTime }) }) }), (formData?.state && [Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state) ||
|
|
388
407
|
(formData?.response ?? "") !== "") && _jsx(TMConditionalWrapper, { condition: !isMobile, wrapper: children => _jsx("div", { style: { display: 'flex', flexDirection: 'row', width: '100%', gap: 3 }, children: children }), children: _jsx("div", { style: { width: isMobile ? '100%' : '50%', marginTop: 10 }, children: _jsxs(ResponseCommentWrapper, { children: [_jsx(ResponseCommentTextArea, { id: "responseId", name: "response", "$isValid": true, value: formData?.response ?? '', onChange: onAnswerChange, "$isModifiedWhen": formData?.response !== formDataOrig?.response, disabled: (formData?.response ?? "") !== "" &&
|
|
389
408
|
(formData?.state && ![Task_States.Completed, Task_States.Waiting, Task_States.Deferred].includes(formData?.state)) }), _jsxs(ResponseCommentLabel, { htmlFor: "responseId", children: [SDKUI_Localizator.Answer, _jsxs(TMTooltip, { content: SDKUI_Localizator.AnswerTooltip, children: [" ", _jsx("i", { className: 'dx-icon-info' }), " "] })] }), _jsx(ResponseCommentCharacterCounter, { children: `${500 - (formData?.response ?? '').length} ${SDKUI_Localizator.CharactersRemaining}` })] }) }) })] }) }) }), (showDcmtForm && formData?.iD1 && formData?.iD2) &&
|
|
390
|
-
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, taskMoreInfo: formData, onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers })] }) }) }));
|
|
409
|
+
_jsx(TMDcmtForm, { titleModal: formData.iD1Name ?? '-', isModal: true, TID: formData.iD1, DID: formData.iD2, allowButtonsRefs: true, taskMoreInfo: formData, onWFOperationCompleted: refreshWorkflowApprove, onTaskCompleted: onTaskCompleted, onClose: () => { setShowDcmtForm(false); }, onOpenS4TViewerRequest: onOpenS4TViewerRequest, s4TViewerDialogComponent: s4TViewerDialogComponent, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference })] }) }) }));
|
|
391
410
|
};
|
|
392
411
|
export default TMTaskForm;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
-
import { DossierEngine, LayoutModes, ResultTypes, SDK_Globals, TaskDescriptor, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { DossierEngine, LayoutModes, ObjectClasses, ResultTypes, SDK_Globals, TaskDescriptor, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { ContextMenu } from "devextreme-react";
|
|
5
5
|
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper, calcResponsiveSizes } from "../../helper";
|
|
6
6
|
import TMToppyMessage from "../../helper/TMToppyMessage";
|
|
@@ -608,6 +608,25 @@ const TMBlogsPost = (props) => {
|
|
|
608
608
|
const closeContextMenu = useCallback(() => {
|
|
609
609
|
setAnchorEl(null);
|
|
610
610
|
}, []);
|
|
611
|
+
const handleNavigateToReference = (ref) => {
|
|
612
|
+
switch (ref.objClass) {
|
|
613
|
+
case ObjectClasses.Dossier:
|
|
614
|
+
if (ref.objID)
|
|
615
|
+
handleNavigateToDossiers?.(ref.objID);
|
|
616
|
+
else
|
|
617
|
+
console.log("Dossier reference missing objID");
|
|
618
|
+
break;
|
|
619
|
+
case ObjectClasses.WorkingGroup:
|
|
620
|
+
if (ref.objID)
|
|
621
|
+
handleNavigateToWGs?.(ref.objID);
|
|
622
|
+
else
|
|
623
|
+
console.log("Working Group reference missing objID");
|
|
624
|
+
break;
|
|
625
|
+
// Handle other object types as needed
|
|
626
|
+
default:
|
|
627
|
+
console.warn(`Unhandled object type: ${ref.objClass}`);
|
|
628
|
+
}
|
|
629
|
+
};
|
|
611
630
|
return _jsx("div", { ref: containerRef, style: { height: height, width: width }, children: _jsx(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: showWaitPanel, showWaitPanelPrimary: showPrimary, showWaitPanelSecondary: showSecondary, waitPanelTitle: waitPanelTitle, waitPanelTextPrimary: waitPanelTextPrimary, waitPanelValuePrimary: waitPanelValuePrimary, waitPanelMaxValuePrimary: waitPanelMaxValuePrimary, waitPanelTextSecondary: waitPanelTextSecondary, waitPanelValueSecondary: waitPanelValueSecondary, waitPanelMaxValueSecondary: waitPanelMaxValueSecondary, isCancelable: true, abortController: abortController, children: _jsxs(TMLayoutWaitingContainer, { direction: 'vertical', showWaitPanel: localShowWaitPanel, showWaitPanelPrimary: localShowPrimary, waitPanelTitle: localWaitPanelTitle, waitPanelTextPrimary: localWaitPanelTextPrimary, waitPanelValuePrimary: localWaitPanelValuePrimary, waitPanelMaxValuePrimary: localWaitPanelMaxValuePrimary, isCancelable: true, abortController: localAbortController, children: [_jsx(TMBlogHeader, { isVisible: currentHeader !== undefined && !isHeaderHidden, layoutMode: layoutMode, height: layoutMode === 'extended' ? "40px" : "70px", width: "100%", allPosts: posts, postsToShow: postsToShow, onPostsToShowChange: handlePostsToShowChange, categoryIdDataSource: categoryIdDataSource, appliedCategoryIdFilters: appliedCategoryIdFilters, setAppliedCategoryIdFilters: setAppliedCategoryIdFilters, searchText: searchText, onSearchChange: handleSearchChange }), _jsxs("div", { style: {
|
|
612
631
|
width: "100%",
|
|
613
632
|
height: currentHeader !== undefined && !isHeaderHidden ? `calc(100% - ${layoutMode === 'extended' ? "40px" : "70px"})` : "100%",
|
|
@@ -659,7 +678,7 @@ const TMBlogsPost = (props) => {
|
|
|
659
678
|
boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
|
|
660
679
|
cursor: 'pointer',
|
|
661
680
|
}, children: [_jsx(BlogPostTitle, { displayMode: displayMode, layoutMode: layoutMode, blogPost: blogPost, isSelected: isSelected, isOwnComment: isOwnComment, searchText: searchText, isSys: isSys, isHomeBlogPost: isHomeBlogPost, showId: localShowId, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), isNew && _jsx(NewBadge, { layoutMode: layoutMode }), _jsx("div", { style: { fontSize: '1rem', color: "#000", marginTop: "10px", overflow: "hidden" }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 && (_jsx(TMBlogAttachments, { attachments: blogPost.attachments, layoutMode: layoutMode, isSelected: isSelected, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
|
|
662
|
-
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (showTaskForm && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsx(TMTaskForm, { id: -1, title: SDKUI_Localizator.ContextualTask, isModal: true, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '670px', '80%', '95%'), formMode: FormModes.Create, visualizedTasks: [], currentTask: currentTask, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, onSaved: onSavedTaskFormCallback, onClose: () => closeTaskFormCallback(), onCancel: () => closeTaskFormCallback(), usersList: participants, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, isContextualCreate: true, taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback }) }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
681
|
+
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (showTaskForm && handleNavigateToWGs && handleNavigateToDossiers && getAllTasks && deleteTaskByIdsCallback && addTaskCallback && editTaskCallback) && _jsx("div", { style: { height: "100%", width: "100%" }, children: _jsx(TMTaskForm, { id: -1, title: SDKUI_Localizator.ContextualTask, isModal: true, width: calcResponsiveSizes(deviceType, '700px', '700px', '95%'), height: calcResponsiveSizes(deviceType, '670px', '80%', '95%'), formMode: FormModes.Create, visualizedTasks: [], currentTask: currentTask, setCurrentTask: () => { }, selectedRowKeys: [], handleFocusedRowKeyChange: () => { }, onStatusChanged: () => { }, onSaved: onSavedTaskFormCallback, onClose: () => closeTaskFormCallback(), onCancel: () => closeTaskFormCallback(), usersList: participants, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, isContextualCreate: true, taskContext: taskContext, allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback }) }), (dcmtForm.dcmt && dcmtForm.dcmt.TID && dcmtForm.dcmt.DID) && _jsx(TMDcmtForm, { TID: Number(dcmtForm.dcmt.TID), DID: Number(dcmtForm.dcmt.DID), layoutMode: LayoutModes.Update, onClose: closeDcmtForm, isClosable: true, titleModal: SDKUI_Localizator.Attachment + ": " + dcmtForm.dcmt.fileName, isModal: true, widthModal: "95%", heightModal: "95%", allTasks: allTasks, getAllTasks: getAllTasks, deleteTaskByIdsCallback: deleteTaskByIdsCallback, addTaskCallback: addTaskCallback, editTaskCallback: editTaskCallback, handleNavigateToWGs: handleNavigateToWGs, handleNavigateToDossiers: handleNavigateToDossiers, onReferenceClick: handleNavigateToReference }), (showFloatingCommentButton && showCommentFormCallback && !(context?.engine === 'WorkingGroupEngine' && context?.object?.customData1 === 1)) && _jsx("button", { style: {
|
|
663
682
|
position: 'absolute',
|
|
664
683
|
bottom: '18px',
|
|
665
684
|
right: '20px',
|