@topconsultnpm/sdkui-react-beta 6.14.96 → 6.14.98
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.
|
@@ -70,7 +70,7 @@ interface TMBlogsProps {
|
|
|
70
70
|
isCreateContextualTask: boolean;
|
|
71
71
|
};
|
|
72
72
|
/** Optional refresh callback */
|
|
73
|
-
refreshCallback
|
|
73
|
+
refreshCallback?: () => Promise<void>;
|
|
74
74
|
/** An array of partecipants */
|
|
75
75
|
participants?: Array<UserDescriptor>;
|
|
76
76
|
/** An array of new blog posts ID */
|
|
@@ -38,6 +38,7 @@ const TMBlogs = (props) => {
|
|
|
38
38
|
let isMobile = useMemo(() => { return deviceType === DeviceType.MOBILE; }, [deviceType]);
|
|
39
39
|
// State to store an array of blog posts, which can be either BlogPost or HomeBlogPost type
|
|
40
40
|
const [blogPosts, setBlogPosts] = useState([]);
|
|
41
|
+
// State to store the first newly fetched blog post, used for highlighting or special display
|
|
41
42
|
const [firstNewPost, setFirstNewPost] = useState(undefined);
|
|
42
43
|
// State to manage the data source for a tree component
|
|
43
44
|
const [treeDataSource, setTreeDataSource] = useState([]);
|
|
@@ -495,32 +496,48 @@ const TMBlogs = (props) => {
|
|
|
495
496
|
handleFocusedBlog(blogPost);
|
|
496
497
|
handleFocusedAttachment(undefined);
|
|
497
498
|
};
|
|
498
|
-
return (
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
499
|
+
return (_jsx(BlogPostContainer, { className: "blog-post-container", id: id + "-" + blogPost.id.toString(), ref: containerRef, "$color": textColor, "$textDecoration": blogPost.isDel ? 'line-through' : 'none', "$backgroundColor": bgColor, "$isNew": isNew, "$canNavigate": canNavigate(), onClick: onClickCallback, onDoubleClick: headerClickCallback, tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onContextMenu: onContextMenu, children: _jsxs("div", { style: { position: 'relative' }, children: [isNew && _jsx("span", { style: {
|
|
500
|
+
position: 'absolute',
|
|
501
|
+
top: '0px',
|
|
502
|
+
right: '5px',
|
|
503
|
+
backgroundColor: '#f09c0a',
|
|
504
|
+
color: '#fff',
|
|
505
|
+
borderRadius: '12px',
|
|
506
|
+
padding: '2px 8px',
|
|
507
|
+
boxShadow: '0 2px 5px rgba(0,0,0,0.15)',
|
|
508
|
+
userSelect: 'none',
|
|
509
|
+
whiteSpace: 'nowrap',
|
|
510
|
+
display: 'flex',
|
|
511
|
+
alignItems: 'center',
|
|
512
|
+
justifyContent: 'center',
|
|
513
|
+
fontSize: '0.9rem',
|
|
514
|
+
maxWidth: "65px"
|
|
515
|
+
}, children: SDKUI_Localizator.New }), _jsxs("div", { style: { paddingRight: layoutMode === 'chat' ? "70px" : "10px" }, children: [_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [(layoutMode !== 'chat' || !isOwnComment) && OwnerInitialsBadge(blogPost), _jsx("div", { style: { flex: "1 1 auto", minWidth: "0" }, children: _jsxs("div", { style: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', flexWrap: "wrap", overflow: "hidden" }, children: [_jsxs("div", { children: [_jsxs("div", { style: { fontWeight: "bold", fontSize: '1rem', display: "flex", alignItems: "center" }, children: [showIconHeader && blogPost.header && blogPost.classID
|
|
516
|
+
? IconAndHeaderElement(blogPost, iconColor, isSelected, () => {
|
|
517
|
+
if (handleNavigateToWGs && blogPost.id && blogPost.classID === 'WG') {
|
|
518
|
+
handleNavigateToWGs(blogPost.id);
|
|
519
|
+
}
|
|
520
|
+
}, searchText)
|
|
521
|
+
: !isOwnComment && _jsx("span", { style: { marginLeft: showIconHeader ? "5px" : "0", color: isSelected ? "#fff" : !blogPost.isSys ? TMColors.primary : colors.RED }, children: highlightText(blogPost.ownerName ?? '', searchText, isSelected) }), (blogPost?.newPosts ?? 0) > 0 && (_jsx("div", { style: {
|
|
522
|
+
marginLeft: "5px",
|
|
523
|
+
minWidth: "20px",
|
|
524
|
+
height: "20px",
|
|
525
|
+
padding: "0 6px",
|
|
526
|
+
display: "flex",
|
|
527
|
+
alignItems: "center",
|
|
528
|
+
justifyContent: "center",
|
|
529
|
+
backgroundColor: isSelected ? '#fff' : color,
|
|
530
|
+
color: isSelected ? color : "#fff",
|
|
531
|
+
boxShadow: "1px 1px 2px #00000020",
|
|
532
|
+
borderRadius: "30px",
|
|
533
|
+
fontWeight: "bold",
|
|
534
|
+
fontSize: "12px",
|
|
535
|
+
whiteSpace: "nowrap",
|
|
536
|
+
}, children: blogPost.newPosts }))] }), _jsxs("div", { style: { fontSize: 'calc(1rem - 1px)', color: isSelected ? "#fff" : !blogPost.isSys ? TMColors.primary : colors.RED }, children: [(showIconHeader) && blogPost.header && blogPost.classID &&
|
|
537
|
+
_jsxs(_Fragment, { children: [_jsx("span", { style: { marginLeft: showIconHeader ? "5px" : "0" }, children: blogPost.ownerName }), _jsx("span", { style: { margin: "0 5px" }, children: "\u2501" })] }), blogPost.creationTime &&
|
|
538
|
+
highlightText(`${Globalization.getDateTimeDisplayValue(blogPost.creationTime)} ${new Date(blogPost.creationTime).toDateString() === new Date().toDateString() ? `(${SDKUI_Localizator.Today})` : ''}`, searchText, isSelected), localShowId && _jsxs(_Fragment, { children: [_jsx("span", { style: { margin: "0 5px" }, children: "\u2501" }), _jsxs("span", { children: ["(ID: ", blogPost.id, ")"] })] })] })] }), blogPost.attachments && showExtendedAttachments === false &&
|
|
539
|
+
_jsx("div", { style: { marginTop: "25px", fontSize: "13px", display: "flex", justifyContent: "flex-end" }, children: _jsx(TMTooltip, { content: `${SDKUI_Localizator.Attachments}: ${blogPost.attachments.length}`, children: _jsx(IconAttachment, { fontSize: 20, color: isSelected ? '#fff' : color }) }) })] }) })] }), _jsx("div", { style: { marginTop: "10px", fontSize: '1rem' }, children: _jsx(TMHtmlContentDisplay, { markup: blogPost.description ?? '-', searchText: searchText, isSelected: isSelected }) }), showExtendedAttachments && blogPost.attachments && blogPost.attachments.length > 0 &&
|
|
540
|
+
attachmentDetails(blogPost.attachments, isSelected)] })] }) }, id + "-" + blogPost.id));
|
|
524
541
|
};
|
|
525
542
|
return _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: _jsx("div", { ref: scrollRef, style: { backgroundColor: layoutMode === "stacked" ? "rgba(191, 191, 191, 0.15)" : '#fff', height: "100%", padding: "5px", overflowY: "auto", width: "100%" }, children: blogPosts.length === 0 ?
|
|
526
543
|
_jsxs("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%' }, children: [_jsx(IconBoard, { fontSize: 96 }), searchText.length > 0 ?
|
|
@@ -34,7 +34,7 @@ export const BlogPostContainer = styled.div `
|
|
|
34
34
|
cursor: ${(props) => (props.$canNavigate ? "pointer" : "default")};
|
|
35
35
|
border-radius: 5px;
|
|
36
36
|
margin: 5px 0;
|
|
37
|
-
padding:
|
|
37
|
+
padding: 10px;
|
|
38
38
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
|
|
39
39
|
word-wrap: break-word;
|
|
40
40
|
white-space: pre-wrap;
|