@topconsultnpm/sdkui-react 6.19.0-dev2.9 → 6.19.0-test2
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/TMAccordionNew.d.ts +28 -0
- package/lib/components/base/TMAccordionNew.js +326 -0
- package/lib/components/base/TMButton.d.ts +1 -0
- package/lib/components/base/TMButton.js +6 -6
- package/lib/components/base/TMCustomButton.d.ts +1 -1
- package/lib/components/base/TMCustomButton.js +83 -28
- package/lib/components/base/TMDataGridExportForm.js +9 -3
- package/lib/components/base/TMFileManager.js +11 -2
- package/lib/components/base/TMFileManagerDataGridView.d.ts +2 -0
- package/lib/components/base/TMFileManagerDataGridView.js +12 -3
- package/lib/components/base/TMFileManagerThumbnailItems.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailItems.js +12 -2
- package/lib/components/base/TMFileManagerThumbnailsView.d.ts +2 -0
- package/lib/components/base/TMFileManagerThumbnailsView.js +2 -2
- package/lib/components/base/TMModal.d.ts +2 -0
- package/lib/components/base/TMModal.js +48 -3
- package/lib/components/base/TMPopUp.js +74 -5
- package/lib/components/base/TMWaitPanel.js +8 -2
- package/lib/components/choosers/TMDataListItemChooser.js +1 -1
- package/lib/components/choosers/TMDcmtTypeChooser.js +2 -2
- package/lib/components/choosers/TMMetadataChooser.d.ts +4 -1
- package/lib/components/choosers/TMMetadataChooser.js +31 -8
- package/lib/components/choosers/TMUserChooser.d.ts +4 -0
- package/lib/components/choosers/TMUserChooser.js +21 -5
- package/lib/components/editors/TMMetadataValues.js +45 -4
- package/lib/components/editors/TMTextArea.d.ts +1 -0
- package/lib/components/editors/TMTextArea.js +44 -10
- package/lib/components/editors/TMTextBox.js +34 -4
- package/lib/components/editors/TMTextExpression.js +36 -28
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +30 -0
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +471 -0
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +9 -0
- package/lib/components/features/assistant/ToppySpeechBubble.js +117 -0
- package/lib/components/features/blog/TMBlogCommentForm.d.ts +2 -0
- package/lib/components/features/blog/TMBlogCommentForm.js +18 -6
- package/lib/components/features/documents/TMDcmtBlog.js +1 -1
- package/lib/components/features/documents/TMDcmtForm.js +290 -31
- package/lib/components/features/documents/TMDcmtIcon.js +9 -4
- package/lib/components/features/documents/TMDcmtPreview.js +45 -8
- package/lib/components/features/documents/TMRelationViewer.js +55 -22
- package/lib/components/features/search/TMSearch.js +2 -2
- package/lib/components/features/search/TMSearchQueryEditor.js +1 -1
- package/lib/components/features/search/TMSearchQueryPanel.js +10 -28
- package/lib/components/features/search/TMSearchResult.js +102 -33
- package/lib/components/features/search/TMSearchResultsMenuItems.d.ts +2 -1
- package/lib/components/features/search/TMSearchResultsMenuItems.js +67 -28
- package/lib/components/features/search/TMSignSettingsForm.d.ts +9 -0
- package/lib/components/features/search/TMSignSettingsForm.js +621 -0
- package/lib/components/features/tasks/TMTaskForm.js +10 -4
- package/lib/components/features/tasks/TMTasksAgenda.js +1 -1
- package/lib/components/features/tasks/TMTasksCalendar.js +1 -1
- package/lib/components/features/tasks/TMTasksUtils.d.ts +1 -0
- package/lib/components/features/tasks/TMTasksUtils.js +17 -2
- package/lib/components/features/tasks/TMTasksUtilsView.js +26 -4
- package/lib/components/features/tasks/TMTasksView.js +11 -5
- package/lib/components/features/workflow/TMWorkflowPopup.js +3 -3
- package/lib/components/features/workflow/diagram/WFDiagram.js +19 -1
- package/lib/components/forms/TMSaveForm.js +3 -11
- package/lib/components/grids/TMBlogAttachments.d.ts +0 -14
- package/lib/components/grids/TMBlogAttachments.js +10 -5
- package/lib/components/grids/TMBlogsPost.d.ts +8 -3
- package/lib/components/grids/TMBlogsPost.js +100 -39
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +27 -6
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +2 -1
- package/lib/components/layout/panelManager/TMPanelManagerContainer.d.ts +1 -0
- package/lib/components/layout/panelManager/TMPanelManagerContainer.js +2 -2
- package/lib/components/layout/panelManager/TMPanelManagerContext.js +0 -1
- package/lib/components/layout/panelManager/TMPanelManagerToolbar.js +2 -1
- package/lib/components/layout/panelManager/types.d.ts +1 -0
- package/lib/components/settings/SettingsAppearance.js +5 -5
- package/lib/helper/GlobalStyles.d.ts +2 -0
- package/lib/helper/GlobalStyles.js +10 -0
- package/lib/helper/Globalization.d.ts +1 -0
- package/lib/helper/Globalization.js +30 -0
- package/lib/helper/SDKUI_Localizator.d.ts +41 -1
- package/lib/helper/SDKUI_Localizator.js +410 -10
- package/lib/helper/TMIcons.d.ts +4 -1
- package/lib/helper/TMIcons.js +13 -1
- package/lib/helper/TMToppyMessage.d.ts +1 -0
- package/lib/helper/TMToppyMessage.js +4 -3
- package/lib/helper/TMUtils.d.ts +42 -4
- package/lib/helper/TMUtils.js +190 -23
- package/lib/helper/dcmtsHelper.d.ts +2 -1
- package/lib/helper/dcmtsHelper.js +56 -17
- package/lib/helper/helpers.d.ts +1 -1
- package/lib/helper/helpers.js +12 -17
- package/lib/helper/index.d.ts +1 -0
- package/lib/helper/index.js +1 -0
- package/lib/hooks/useDcmtOperations.d.ts +1 -1
- package/lib/hooks/useDcmtOperations.js +10 -6
- package/lib/hooks/useRelatedDocuments.js +35 -26
- package/lib/ts/types.d.ts +2 -0
- package/package.json +8 -8
- package/lib/components/features/assistant/ToppyHelpCenter.d.ts +0 -12
- package/lib/components/features/assistant/ToppyHelpCenter.js +0 -173
|
@@ -1,11 +1,11 @@
|
|
|
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 { LayoutModes, ResultTypes, SDK_Globals, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
3
|
+
import { DossierEngine, LayoutModes, ResultTypes, SDK_Globals, TaskDescriptor, WorkingGroupEngine } from "@topconsultnpm/sdk-ts";
|
|
4
4
|
import { ContextMenu } from "devextreme-react";
|
|
5
|
-
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper } from "../../helper";
|
|
5
|
+
import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper, calcResponsiveSizes } from "../../helper";
|
|
6
6
|
import TMToppyMessage from "../../helper/TMToppyMessage";
|
|
7
7
|
import { useDcmtOperations } from "../../hooks/useDcmtOperations";
|
|
8
|
-
import { DownloadTypes } from "../../ts";
|
|
8
|
+
import { DownloadTypes, FormModes } from "../../ts";
|
|
9
9
|
import { TMColors } from "../../utils/theme";
|
|
10
10
|
import ShowAlert from "../base/TMAlert";
|
|
11
11
|
import { TMMessageBoxManager, ButtonNames } from "../base/TMPopUp";
|
|
@@ -14,12 +14,14 @@ import { TMLayoutWaitingContainer } from "../base/TMWaitPanel";
|
|
|
14
14
|
import TMHtmlContentDisplay from "../editors/TMHtmlContentDisplay";
|
|
15
15
|
import TMDcmtForm from "../features/documents/TMDcmtForm";
|
|
16
16
|
import { TMResultManager } from "../forms/TMResultDialog";
|
|
17
|
-
import { isHeaderFullyHidden, TMBlogsFilterCategoryId, getDcmtTypeDescriptor, findFileItemByDraftID, BlogPostTitle, NewBadge } from "./TMBlogsPostUtils";
|
|
17
|
+
import { isHeaderFullyHidden, TMBlogsFilterCategoryId, getDcmtTypeDescriptor, findFileItemByDraftID, BlogPostTitle, NewBadge, stripHtml } from "./TMBlogsPostUtils";
|
|
18
18
|
import TMBlogAttachments from "./TMBlogAttachments";
|
|
19
19
|
import TMBlogHeader from "./TMBlogHeader";
|
|
20
|
+
import TMTaskForm from "../features/tasks/TMTaskForm";
|
|
21
|
+
import { useDeviceType } from "../base/TMDeviceProvider";
|
|
20
22
|
let localAbortController = new AbortController();
|
|
21
23
|
const TMBlogsPost = (props) => {
|
|
22
|
-
const { scrollToSelected, id, posts, displayMode = "stacked", height = "100%", width = "100%", scrollToBottom = true, header, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, context, contextMenuParams = {
|
|
24
|
+
const { scrollToSelected, id, posts, displayMode = "stacked", height = "100%", width = "100%", scrollToBottom = true, header, showExtendedAttachments = true, treeFs, draftLatestInfoMap, archivedDocumentMap, context, participants, contextMenuParams = {
|
|
23
25
|
isShowHideFilterEnabled: true,
|
|
24
26
|
isShowHideIDEnaled: true,
|
|
25
27
|
isCommentEnabled: false,
|
|
@@ -30,8 +32,10 @@ const TMBlogsPost = (props) => {
|
|
|
30
32
|
isRestoreEnabled: false,
|
|
31
33
|
isRefreshEnabled: false,
|
|
32
34
|
isCreateContextualTask: false,
|
|
33
|
-
}, showFloatingCommentButton = false, showCommentFormCallback,
|
|
35
|
+
}, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, } = props;
|
|
34
36
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
|
37
|
+
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
|
|
38
|
+
const deviceType = useDeviceType();
|
|
35
39
|
const bottomRef = useRef(null);
|
|
36
40
|
const containerRef = useRef(null);
|
|
37
41
|
// State to manage the layout mode of the document form
|
|
@@ -58,6 +62,10 @@ const TMBlogsPost = (props) => {
|
|
|
58
62
|
const [focusedItem, setFocusedItem] = useState(undefined);
|
|
59
63
|
// State to manage the focused file
|
|
60
64
|
const [focusedAttachment, setFocusedAttachment] = useState(undefined);
|
|
65
|
+
const [taskContext, setTaskContext] = useState(undefined);
|
|
66
|
+
const [currentTask, setCurrentTask] = useState(new TaskDescriptor());
|
|
67
|
+
// State to manage show task form selected file
|
|
68
|
+
const [showTaskForm, setShowTaskForm] = useState(false);
|
|
61
69
|
// State to manage show selected file
|
|
62
70
|
const [dcmtForm, setDcmtForm] = useState({ show: false, dcmt: undefined });
|
|
63
71
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
@@ -83,6 +91,24 @@ const TMBlogsPost = (props) => {
|
|
|
83
91
|
const handleFocusedAttachment = (attachment) => {
|
|
84
92
|
setFocusedAttachment(attachment);
|
|
85
93
|
};
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (context === undefined) {
|
|
96
|
+
setTaskContext(undefined);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (context.engine === 'WorkingGroupEngine' && context.object) {
|
|
100
|
+
setTaskContext({ workingGroup: { id: context?.object?.id ?? 0, name: context?.object?.name ?? '' } });
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
if (context.engine === 'DossierEngine' && context.object) {
|
|
104
|
+
setTaskContext({ dossier: { id: context?.object?.id ?? 0, name: context?.object?.name ?? '' } });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (context.engine === 'SearchEngine' && context.object) {
|
|
108
|
+
setTaskContext({ document: { tid: context?.object?.tid ?? 0, did: context?.object?.did ?? 0, name: '' } });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
}, [context]);
|
|
86
112
|
useEffect(() => {
|
|
87
113
|
if (externalBlogPost && externalBlogPost.id) {
|
|
88
114
|
const foundPost = blogPosts.find(post => post.id === externalBlogPost.id);
|
|
@@ -118,33 +144,32 @@ const TMBlogsPost = (props) => {
|
|
|
118
144
|
return () => ro.disconnect();
|
|
119
145
|
}, [layoutMode]);
|
|
120
146
|
useEffect(() => {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
]);
|
|
147
|
+
(async () => {
|
|
148
|
+
if (showExtendedAttachments) {
|
|
149
|
+
const descriptors = await getDcmtTypeDescriptor(posts);
|
|
150
|
+
setDcmtTypeDescriptors(descriptors);
|
|
151
|
+
}
|
|
152
|
+
const publishedBlogssLength = posts.filter(newsFeed => newsFeed.isSys !== 1 && newsFeed.isDel !== 1).length;
|
|
153
|
+
const systemBlogsLength = posts.filter(newsFeed => newsFeed.isSys === 1).length;
|
|
154
|
+
const deletedBlogsLength = posts.filter(newsFeed => newsFeed.isDel === 1).length;
|
|
155
|
+
setCategoryIdDataSource([
|
|
156
|
+
{
|
|
157
|
+
id: TMBlogsFilterCategoryId.PublishedBlogs,
|
|
158
|
+
label: SDKUI_Localizator.Active + " (" + publishedBlogssLength + ")",
|
|
159
|
+
value: SDKUI_Localizator.Active,
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
id: TMBlogsFilterCategoryId.SystemBlogs,
|
|
163
|
+
label: SDKUI_Localizator.OfSystem + " (" + systemBlogsLength + ")",
|
|
164
|
+
value: SDKUI_Localizator.OfSystem,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: TMBlogsFilterCategoryId.DeletedBlogs,
|
|
168
|
+
label: SDKUI_Localizator.Deleted + " (" + deletedBlogsLength + ")",
|
|
169
|
+
value: SDKUI_Localizator.Deleted,
|
|
170
|
+
},
|
|
171
|
+
]);
|
|
172
|
+
})();
|
|
148
173
|
}, [posts]);
|
|
149
174
|
useEffect(() => {
|
|
150
175
|
setIsHeaderHidden(isHeaderFullyHidden(currentHeader));
|
|
@@ -222,6 +247,11 @@ const TMBlogsPost = (props) => {
|
|
|
222
247
|
if (setShowId)
|
|
223
248
|
setShowId(localShowId);
|
|
224
249
|
}, [localShowId]);
|
|
250
|
+
useEffect(() => {
|
|
251
|
+
if (!visible) {
|
|
252
|
+
closeContextMenu();
|
|
253
|
+
}
|
|
254
|
+
}, [visible]);
|
|
225
255
|
const toggleHeaderClick = () => {
|
|
226
256
|
setCurrentHeader(prevState => {
|
|
227
257
|
if (prevState === undefined) {
|
|
@@ -320,6 +350,16 @@ const TMBlogsPost = (props) => {
|
|
|
320
350
|
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
321
351
|
});
|
|
322
352
|
break;
|
|
353
|
+
case 'DS':
|
|
354
|
+
const dossierEngine = new DossierEngine(SDK_Globals.tmSession);
|
|
355
|
+
await dossierEngine.FollowAddOrRemoveAsync(currentBlog.id, true).then(async () => {
|
|
356
|
+
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, description: SDKUI_Localizator.OperationSuccess, resultType: ResultTypes.SUCCESS });
|
|
357
|
+
refreshHomePageNews?.();
|
|
358
|
+
})
|
|
359
|
+
.catch((err) => {
|
|
360
|
+
result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
|
|
361
|
+
});
|
|
362
|
+
break;
|
|
323
363
|
default:
|
|
324
364
|
ShowAlert({ message: 'TODO', mode: 'warning', title: SDKUI_Localizator.Unfollow, duration: 3000 });
|
|
325
365
|
break;
|
|
@@ -418,6 +458,27 @@ const TMBlogsPost = (props) => {
|
|
|
418
458
|
}
|
|
419
459
|
});
|
|
420
460
|
};
|
|
461
|
+
const openTaskFormCallback = useCallback((targetItem) => {
|
|
462
|
+
const task = new TaskDescriptor();
|
|
463
|
+
const cleanText = stripHtml(targetItem?.description ?? '');
|
|
464
|
+
task.name = cleanText.slice(0, 100);
|
|
465
|
+
setCurrentTask(task);
|
|
466
|
+
setShowTaskForm(true);
|
|
467
|
+
}, []);
|
|
468
|
+
const closeTaskFormCallback = useCallback(() => {
|
|
469
|
+
setShowTaskForm(false);
|
|
470
|
+
}, []);
|
|
471
|
+
const onSavedTaskFormCallback = (task) => {
|
|
472
|
+
if (task) {
|
|
473
|
+
addTaskCallback?.(task);
|
|
474
|
+
setShowTaskForm(false);
|
|
475
|
+
afterTaskSaved?.(task, FormModes.Create);
|
|
476
|
+
ShowAlert({ message: SDKUI_Localizator.TaskSavedSuccessfully.replaceParams(task.name ?? '-'), mode: 'success', title: SDKUI_Localizator.Widget_Activities, duration: 3000 });
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
ShowAlert({ message: SDKUI_Localizator.TaskSaveError, mode: 'error', title: SDKUI_Localizator.Widget_Activities, duration: 3000 });
|
|
480
|
+
}
|
|
481
|
+
};
|
|
421
482
|
// Open document form
|
|
422
483
|
const openDcmtForm = (dcmtInfo) => {
|
|
423
484
|
setDcmtForm({ show: true, dcmt: dcmtInfo });
|
|
@@ -491,20 +552,20 @@ const TMBlogsPost = (props) => {
|
|
|
491
552
|
onClick: () => { copyInClipboard(targetItem); }
|
|
492
553
|
});
|
|
493
554
|
}
|
|
494
|
-
if (contextMenuParams.isCreateContextualTask
|
|
555
|
+
if (contextMenuParams.isCreateContextualTask) {
|
|
495
556
|
menuItems.push({
|
|
496
557
|
text: SDKUI_Localizator.CreateContextualTask,
|
|
497
558
|
icon: 'plus',
|
|
498
|
-
onClick: () =>
|
|
559
|
+
onClick: () => openTaskFormCallback(targetItem),
|
|
499
560
|
disabled: isGroupArchived ? true : false,
|
|
500
561
|
beginGroup: true
|
|
501
562
|
});
|
|
502
563
|
}
|
|
503
|
-
if (targetItem && Boolean(classId && classId === 'WG')) {
|
|
564
|
+
if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS'))) {
|
|
504
565
|
menuItems.push({
|
|
505
566
|
icon: "eyeclose",
|
|
506
567
|
text: SDKUI_Localizator.Unfollow,
|
|
507
|
-
onClick: () => targetItem && classId && unFollowCallback(targetItem, classId),
|
|
568
|
+
onClick: () => (targetItem && classId) && unFollowCallback(targetItem, classId),
|
|
508
569
|
});
|
|
509
570
|
}
|
|
510
571
|
if (contextMenuParams.isShowHideFilterEnabled) {
|
|
@@ -597,8 +658,8 @@ const TMBlogsPost = (props) => {
|
|
|
597
658
|
textDecoration: blogPost.isDel ? 'line-through' : 'none',
|
|
598
659
|
boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
|
|
599
660
|
cursor: 'pointer',
|
|
600
|
-
}, 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, {
|
|
601
|
-
}), _jsx("div", { ref: bottomRef }), anchorEl && _jsx("div", { style: { position: 'fixed', zIndex: 9999 }, children: _jsx(ContextMenu, { dataSource: menuItems, target: anchorEl, onHiding: closeContextMenu }) })] }), (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: {
|
|
661
|
+
}, 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: {
|
|
602
663
|
position: 'absolute',
|
|
603
664
|
bottom: '18px',
|
|
604
665
|
right: '20px',
|
|
@@ -110,4 +110,5 @@ interface BlogPostTitleProps {
|
|
|
110
110
|
handleNavigateToDossiers?: (blogPost: BlogPost | HomeBlogPost) => void;
|
|
111
111
|
}
|
|
112
112
|
export declare const BlogPostTitle: (props: BlogPostTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
export declare const stripHtml: (html: string) => string;
|
|
113
114
|
export {};
|
|
@@ -144,33 +144,44 @@ export const getAttachmentInfo = (attachment, treeFs, draftLatestInfoMap, archiv
|
|
|
144
144
|
export const getDcmtTypeDescriptor = async (blogPosts) => {
|
|
145
145
|
// Create a Map to store tid as key and DcmtTypeDescriptor as value
|
|
146
146
|
const dcmtTypeMap = new Map();
|
|
147
|
+
// Collect unique tids first to avoid duplicate HTTP calls
|
|
148
|
+
const uniqueTids = new Set();
|
|
147
149
|
for (const blogPost of blogPosts) {
|
|
148
150
|
if (blogPost.attachments) {
|
|
149
151
|
for (const attachment of blogPost.attachments) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
dcmtTypeMap.set(attachment.tid, dcmtTypeDescriptor);
|
|
152
|
+
if (attachment.tid) {
|
|
153
|
+
uniqueTids.add(attachment.tid);
|
|
153
154
|
}
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
157
|
}
|
|
158
|
+
// Fetch all descriptors in parallel instead of sequentially
|
|
159
|
+
const promises = Array.from(uniqueTids).map(async (tid) => {
|
|
160
|
+
const dcmtTypeDescriptor = await DcmtTypeListCacheService.GetAsync(tid, true);
|
|
161
|
+
if (dcmtTypeDescriptor) {
|
|
162
|
+
dcmtTypeMap.set(tid, dcmtTypeDescriptor);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
await Promise.all(promises);
|
|
157
166
|
return dcmtTypeMap;
|
|
158
167
|
};
|
|
159
168
|
export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
|
|
160
169
|
const isWorkGroup = classId === 'WG';
|
|
161
170
|
const iconColor = isSelected ? '#ffffff' : isWorkGroup ? '#009700' : '#e65b00';
|
|
162
|
-
return (_jsxs("div", {
|
|
171
|
+
return (_jsxs("div", { style: {
|
|
163
172
|
display: "flex",
|
|
164
173
|
alignItems: "center",
|
|
165
174
|
cursor: "pointer",
|
|
166
175
|
fontWeight: "bold",
|
|
167
176
|
color: isSelected ? "#fff" : TMColors.primary,
|
|
168
177
|
gap: "4px",
|
|
169
|
-
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : SDKUI_Localizator.Dossier, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28 })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28 })) }), _jsx("div", { style: {
|
|
178
|
+
}, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : SDKUI_Localizator.Dossier, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) }), _jsx("div", { onClick: headerClickCallback, style: {
|
|
170
179
|
whiteSpace: "nowrap",
|
|
171
180
|
overflow: "hidden",
|
|
172
181
|
textOverflow: "ellipsis",
|
|
173
|
-
|
|
182
|
+
display: "inline-block",
|
|
183
|
+
cursor: "pointer",
|
|
184
|
+
maxWidth: "100%",
|
|
174
185
|
}, children: highlightText(header ?? "", searchText, isSelected) })] }));
|
|
175
186
|
};
|
|
176
187
|
export const isHeaderFullyHidden = (header) => {
|
|
@@ -246,3 +257,13 @@ export const BlogPostTitle = (props) => {
|
|
|
246
257
|
...getCompactEllipsisStyle(layoutMode)
|
|
247
258
|
}, children: highlightText(subtitle, searchText, isSelected) }))] })] });
|
|
248
259
|
};
|
|
260
|
+
export const stripHtml = (html) => {
|
|
261
|
+
try {
|
|
262
|
+
const doc = new DOMParser().parseFromString(html, 'text/html');
|
|
263
|
+
return doc.body.textContent || '';
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
// Se qualcosa va storto, restituisci l'HTML originale
|
|
267
|
+
return html;
|
|
268
|
+
}
|
|
269
|
+
};
|
|
@@ -15,6 +15,7 @@ export * from './base/TMRightSidebar';
|
|
|
15
15
|
export * from './base/TMTreeView';
|
|
16
16
|
export * from './base/TMPanel';
|
|
17
17
|
export * from './base/TMResizableMenu';
|
|
18
|
+
export * from './base/TMAccordionNew';
|
|
18
19
|
export { default as CounterBar } from './base/TMCounterBar';
|
|
19
20
|
export { default as TMProgressBar } from './base/TMProgressBar';
|
|
20
21
|
export { default as TMSpinner } from './base/TMSpinner';
|
|
@@ -59,7 +60,7 @@ export { default as TMBlogAttachments } from './grids/TMBlogAttachments';
|
|
|
59
60
|
export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm';
|
|
60
61
|
export * from './query/TMQueryEditor';
|
|
61
62
|
export * from './query/TMQuerySummary';
|
|
62
|
-
export
|
|
63
|
+
export { default as ToppyDraggableHelpCenter } from './features/assistant/ToppyDraggableHelpCenter';
|
|
63
64
|
export * from './features/documents/TMDcmtForm';
|
|
64
65
|
export * from './features/documents/TMDcmtIcon';
|
|
65
66
|
export * from './features/documents/TMDcmtPreview';
|
package/lib/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from './base/TMRightSidebar';
|
|
|
16
16
|
export * from './base/TMTreeView';
|
|
17
17
|
export * from './base/TMPanel';
|
|
18
18
|
export * from './base/TMResizableMenu';
|
|
19
|
+
export * from './base/TMAccordionNew';
|
|
19
20
|
export { default as CounterBar } from './base/TMCounterBar';
|
|
20
21
|
export { default as TMProgressBar } from './base/TMProgressBar';
|
|
21
22
|
export { default as TMSpinner } from './base/TMSpinner';
|
|
@@ -66,7 +67,7 @@ export { default as TMBlogCommentForm } from './features/blog/TMBlogCommentForm'
|
|
|
66
67
|
export * from './query/TMQueryEditor';
|
|
67
68
|
export * from './query/TMQuerySummary';
|
|
68
69
|
//assistant
|
|
69
|
-
export
|
|
70
|
+
export { default as ToppyDraggableHelpCenter } from './features/assistant/ToppyDraggableHelpCenter';
|
|
70
71
|
//documents
|
|
71
72
|
export * from './features/documents/TMDcmtForm';
|
|
72
73
|
export * from './features/documents/TMDcmtIcon';
|
|
@@ -4,6 +4,7 @@ interface TMPanelManagerContainerProps {
|
|
|
4
4
|
showToolbar: boolean;
|
|
5
5
|
direction: TMPanelDirection;
|
|
6
6
|
parentId?: string;
|
|
7
|
+
minPanelSizePx?: number;
|
|
7
8
|
}
|
|
8
9
|
declare const TMPanelManagerContainer: (props: TMPanelManagerContainerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
9
10
|
export default TMPanelManagerContainer;
|
|
@@ -24,7 +24,7 @@ const StyledResizerGutter = styled.div `
|
|
|
24
24
|
z-index: 10;
|
|
25
25
|
`;
|
|
26
26
|
const TMPanelManagerContainer = (props) => {
|
|
27
|
-
const { panels, showToolbar, direction, parentId } = props;
|
|
27
|
+
const { panels, showToolbar, direction, parentId, minPanelSizePx = 150 } = props;
|
|
28
28
|
const { panelVisibility, setPanelDimensionsById, hasVisiblePanels, maximizedPanels, updateIsResizingActive } = useTMPanelManagerContext();
|
|
29
29
|
// Get the current device type (e.g., mobile, tablet, desktop) using a custom hook
|
|
30
30
|
const deviceType = useDeviceType();
|
|
@@ -73,7 +73,7 @@ const TMPanelManagerContainer = (props) => {
|
|
|
73
73
|
let newCurrent = initialCurrent + deltaPercent;
|
|
74
74
|
let newNext = initialNext - deltaPercent;
|
|
75
75
|
// Set a minimum size threshold (to prevent panels from collapsing)
|
|
76
|
-
const minPercent = (
|
|
76
|
+
const minPercent = (minPanelSizePx / containerSize) * 100;
|
|
77
77
|
// Correct sizes if they go below the minimum
|
|
78
78
|
if (newCurrent < minPercent) {
|
|
79
79
|
newCurrent = minPercent;
|
|
@@ -118,7 +118,6 @@ export const TMPanelManagerProvider = (props) => {
|
|
|
118
118
|
const maximizePanel = useCallback((id) => {
|
|
119
119
|
// Get all parent panel IDs recursively for the given panel ID
|
|
120
120
|
const parents = showParentRecursively(id, hierarchyMap).map(([pid]) => pid);
|
|
121
|
-
4;
|
|
122
121
|
// Combine parents and the current panel ID into one array to maximize
|
|
123
122
|
const toMaximize = [...parents, id];
|
|
124
123
|
// Update state to track which panels are maximized
|
|
@@ -76,7 +76,8 @@ const TMPanelManagerToolbar = (props) => {
|
|
|
76
76
|
const isActive = panelVisibility[visibleLeafPanel.id];
|
|
77
77
|
const isDisabled = toolbarButtonsDisabled[visibleLeafPanel.id];
|
|
78
78
|
const count = visibleLeafPanel.toolbarOptions?.count ?? 0;
|
|
79
|
-
|
|
79
|
+
const tooltip = visibleLeafPanel.toolbarOptions?.tooltip ?? '';
|
|
80
|
+
return _jsx(TMTooltip, { content: tooltip || (visibleLeafPanel.name + (count > 0 ? ": " + count : '')), position: isMobile ? 'top' : 'left', children: _jsxs(StyledToolbarButton, { disabled: isDisabled, "$isDisabled": isDisabled, onClick: () => onClickCallback(visibleLeafPanel.id, isActive), "$isActive": isActive || visibleLeafPanel.toolbarOptions?.alwaysActiveColor, children: [typeof visibleLeafPanel.toolbarOptions?.icon === 'string' ? (_jsx("i", { className: `dx-icon dx-icon-${visibleLeafPanel.toolbarOptions?.icon}` })) : (visibleLeafPanel.toolbarOptions?.icon), (!isActive && count > 0) && _jsxs(Badge, { "$background": visibleLeafPanel.toolbarOptions?.countBackgroundColor, children: [" ", formatCount(count), " "] })] }, visibleLeafPanel.id) }, visibleLeafPanel.id);
|
|
80
81
|
}) }));
|
|
81
82
|
};
|
|
82
83
|
export default TMPanelManagerToolbar;
|
|
@@ -47,14 +47,14 @@ const SettingsAppearance = ({ landingPagesOptions, permissions = { canArchive: t
|
|
|
47
47
|
return (_jsxs(TMLayoutContainer, { children: [landingPagesOptions && _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginBottom: '5px' }, children: SDKUI_Localizator.LandingPage }), landingPagesOptions && _jsx(TMDropDown, { dataSource: filteredLandingPageOptopns, value: SDKUI_Globals.userSettings.landingPage, width: '230px', onValueChanged: (e) => {
|
|
48
48
|
SDKUI_Globals.userSettings.landingPage = e.target.value;
|
|
49
49
|
triggerUIUpdate();
|
|
50
|
-
} }), _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginTop: '10px' }, children: 'Font' }), _jsx(TMDropDown, { label: SDKUI_Localizator.
|
|
51
|
-
let newpx = e.target.value;
|
|
52
|
-
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
53
|
-
triggerUIUpdate();
|
|
54
|
-
} }), _jsx(TMDropDown, { label: 'Family', dataSource: fontFamilies, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
50
|
+
} }), _jsx("p", { style: { fontSize: '1.h1rem', fontWeight: 'bold', marginTop: '10px' }, children: 'Font' }), _jsx(TMDropDown, { label: SDKUI_Localizator.Name, dataSource: fontFamilies, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontFamily, onValueChanged: (e) => {
|
|
55
51
|
let newFamily = e.target.value;
|
|
56
52
|
SDKUI_Globals.userSettings.themeSettings.fontFamily = newFamily;
|
|
57
53
|
triggerUIUpdate();
|
|
54
|
+
} }), _jsx(TMDropDown, { label: SDKUI_Localizator.Size, dataSource: fontSizes, width: '230px', value: SDKUI_Globals.userSettings.themeSettings.fontSize, onValueChanged: (e) => {
|
|
55
|
+
let newpx = e.target.value;
|
|
56
|
+
SDKUI_Globals.userSettings.themeSettings.fontSize = newpx;
|
|
57
|
+
triggerUIUpdate();
|
|
58
58
|
} }), _jsx("p", { style: { fontSize: '1rem', fontWeight: 'bold', marginTop: '10px', marginBottom: '5px' }, children: SDKUI_Localizator.Grids }), _jsx(TMCheckBox, { label: SDKUI_Localizator.ShowRowSeparatingLines, value: SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines, onValueChanged: (newValue) => {
|
|
59
59
|
SDKUI_Globals.userSettings.themeSettings.gridSettings.showRowLines = newValue;
|
|
60
60
|
triggerUIUpdate();
|
|
@@ -6,6 +6,7 @@ export declare enum DateDisplayTypes {
|
|
|
6
6
|
}
|
|
7
7
|
export declare class Globalization {
|
|
8
8
|
static getDateTimeDisplayValue(value: Date | string | undefined, displayType?: DateDisplayTypes, metadataFormat?: MetadataFormats): string;
|
|
9
|
+
static getDateTimeDisplayValueCompact(value: Date | string | undefined, displayType?: DateDisplayTypes, metadataFormat?: MetadataFormats): string;
|
|
9
10
|
static getDateDisplayFormat(displayType?: DateDisplayTypes): string;
|
|
10
11
|
static getNumberDisplayValue(value: Number, withThousandsSeparator?: boolean, numberDisplayFormat?: string): string;
|
|
11
12
|
static metadataFormatToDateDisplayFormat(format: MetadataFormats): "" | "MM/dd/yyyy" | "dd/MM/yyyy" | "EEEE dd MMMM yyyy" | "HH:mm" | "HH:mm:ss" | "MM/dd/yyyy HH:mm:ss" | "dd/MM/yyyy HH:mm:ss" | "MM/dd/yyyy HH:mm" | "dd/MM/yyyy HH:mm" | "EEEE dd MMMM yyyy HH:mm" | "EEEE dd MMMM yyyy HH:mm:ss";
|
|
@@ -29,6 +29,36 @@ export class Globalization {
|
|
|
29
29
|
dateTime = dateTime.replace("ss", dt.getSeconds().toString().padStart(2, '0'));
|
|
30
30
|
return dateTime;
|
|
31
31
|
}
|
|
32
|
+
static getDateTimeDisplayValueCompact(value, displayType, metadataFormat) {
|
|
33
|
+
if (!value)
|
|
34
|
+
return "";
|
|
35
|
+
let dt = typeof value === "string" ? new Date(value) : value;
|
|
36
|
+
let dateDisplayFormat = metadataFormat ? this.metadataFormatToDateDisplayFormat(metadataFormat) : this.getDateDisplayFormat(displayType);
|
|
37
|
+
let dateTime = dateDisplayFormat;
|
|
38
|
+
dateTime = dateTime.replace("EEEE", dt.toLocaleString(navigator.language, { weekday: "long" }));
|
|
39
|
+
dateTime = dateTime.replace("dd", dt.toLocaleString(navigator.language, { day: "2-digit" }));
|
|
40
|
+
dateTime = dateTime.replace("MMMM", dt.toLocaleString(navigator.language, { month: "long" }));
|
|
41
|
+
dateTime = dateTime.replace("MM", dt.toLocaleString(navigator.language, { month: "2-digit" }));
|
|
42
|
+
dateTime = dateTime.replace("yyyy", dt.toLocaleString(navigator.language, { year: "numeric" }));
|
|
43
|
+
// gestione ore, minuti e secondi
|
|
44
|
+
const hh = dt.getHours().toString().padStart(2, '0');
|
|
45
|
+
const mm = dt.getMinutes().toString().padStart(2, '0');
|
|
46
|
+
const ss = dt.getSeconds().toString().padStart(2, '0');
|
|
47
|
+
if (hh === '00' && mm === '00' && ss === '00') {
|
|
48
|
+
// nessun tempo
|
|
49
|
+
dateTime = dateTime.replace(/HH:mm:ss/, '').trim();
|
|
50
|
+
}
|
|
51
|
+
else if (ss === '00') {
|
|
52
|
+
// togli solo i secondi
|
|
53
|
+
dateTime = dateTime.replace(/ss/, '').replace(/:$/, '');
|
|
54
|
+
dateTime = dateTime.replace("HH", hh).replace("mm", mm);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
// mantieni tutto
|
|
58
|
+
dateTime = dateTime.replace("HH", hh).replace("mm", mm).replace("ss", ss);
|
|
59
|
+
}
|
|
60
|
+
return dateTime;
|
|
61
|
+
}
|
|
32
62
|
static getDateDisplayFormat(displayType = DateDisplayTypes.DateTime) {
|
|
33
63
|
let timeFormat = "HH:mm:ss";
|
|
34
64
|
if (displayType == DateDisplayTypes.Time)
|