@topconsultnpm/sdkui-react 6.22.0-dev2.46 → 6.22.0-dev2.47

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.
@@ -86,6 +86,8 @@ interface TMBlogsPostProps {
86
86
  addTaskCallback?: (task: TaskDescriptor) => Promise<void>;
87
87
  handleNavigateToWGs?: (value: HomeBlogPost | number) => Promise<void>;
88
88
  handleNavigateToDossiers?: (value: HomeBlogPost | number) => Promise<void>;
89
+ /** Apre la pratica CaseFlow di una notizia con `classID === 'CF'` (bacheca Home V6). */
90
+ handleNavigateToCaseflows?: (value: HomeBlogPost | number) => Promise<void>;
89
91
  }
90
92
  declare const TMBlogsPost: (props: TMBlogsPostProps) => import("react/jsx-runtime").JSX.Element;
91
93
  export default TMBlogsPost;
@@ -5,6 +5,7 @@ import { ContextMenu as TMContextMenu } from "../NewComponents/ContextMenu";
5
5
  import { SDKUI_Localizator, Globalization, getExceptionMessage, TMConditionalWrapper, getMoreInfoTasksForDocument, taskModalSizes } from "../../helper";
6
6
  import TMToppyMessage from "../../helper/TMToppyMessage";
7
7
  import { useDcmtOperations } from "../../hooks/useDcmtOperations";
8
+ import { CaseFlowService } from "../../services/caseflow/CaseFlowService";
8
9
  import { DownloadTypes, FormModes } from "../../ts";
9
10
  import { TMColors } from "../../utils/theme";
10
11
  import ShowAlert from "../base/TMAlert";
@@ -32,7 +33,7 @@ const TMBlogsPost = (props) => {
32
33
  isRestoreEnabled: false,
33
34
  isRefreshEnabled: false,
34
35
  isCreateContextualTask: false,
35
- }, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, } = props;
36
+ }, showFloatingCommentButton = false, showCommentFormCallback, refreshCallback, showId, setShowId, refreshHomePageNews, markBlogAsRead, externalBlogPost, resetExternalBlogPost, visible = true, allTasks = [], getAllTasks, deleteTaskByIdsCallback, addTaskCallback, editTaskCallback, afterTaskSaved, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToCaseflows, } = props;
36
37
  const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
37
38
  // Get the current device type (e.g., mobile, tablet, desktop) using a custom hook.
38
39
  const deviceType = useDeviceType();
@@ -292,6 +293,8 @@ const TMBlogsPost = (props) => {
292
293
  handleNavigateToWGs(blogPost);
293
294
  if (handleNavigateToDossiers && id && blogPost.classID === 'DS')
294
295
  handleNavigateToDossiers(blogPost);
296
+ if (handleNavigateToCaseflows && id && blogPost.classID === 'CF')
297
+ handleNavigateToCaseflows(blogPost);
295
298
  };
296
299
  const handleKeyDown = (event) => {
297
300
  if (!selectedItem.length)
@@ -324,6 +327,9 @@ const TMBlogsPost = (props) => {
324
327
  if (handleNavigateToDossiers && item.id && classItemID === 'DS') {
325
328
  handleNavigateToDossiers(item);
326
329
  }
330
+ if (handleNavigateToCaseflows && item.id && classItemID === 'CF') {
331
+ handleNavigateToCaseflows(item);
332
+ }
327
333
  break;
328
334
  default:
329
335
  break;
@@ -367,6 +373,17 @@ const TMBlogsPost = (props) => {
367
373
  result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
368
374
  });
369
375
  break;
376
+ case 'CF':
377
+ // La notizia porta il solo CFIID: il template (cftid) che l'API
378
+ // richiede lo risolve CaseFlowService.setFollow.
379
+ await CaseFlowService.setFollow(currentBlog.id, false).then(async () => {
380
+ result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, description: SDKUI_Localizator.OperationSuccess, resultType: ResultTypes.SUCCESS });
381
+ refreshHomePageNews?.();
382
+ })
383
+ .catch((err) => {
384
+ result.push({ rowIndex: currentBlog.id, id1: currentBlog.id, id2: currentBlog.id, resultType: ResultTypes.ERROR, description: getExceptionMessage(err) });
385
+ });
386
+ break;
370
387
  default:
371
388
  ShowAlert({ message: 'TODO', mode: 'warning', title: SDKUI_Localizator.Unfollow, duration: 3000 });
372
389
  break;
@@ -570,7 +587,7 @@ const TMBlogsPost = (props) => {
570
587
  beginGroup: true
571
588
  });
572
589
  }
573
- if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS'))) {
590
+ if (targetItem && Boolean(classId && (classId === 'WG' || classId === 'DS' || classId === 'CF'))) {
574
591
  menuItems.push({
575
592
  icon: _jsx("span", { className: "dx-icon-eyeclose" }),
576
593
  name: SDKUI_Localizator.Unfollow,
@@ -632,6 +649,12 @@ const TMBlogsPost = (props) => {
632
649
  else
633
650
  console.log("Working Group reference missing objID");
634
651
  break;
652
+ case ObjectClasses.CaseFlowInstance:
653
+ if (ref.objID)
654
+ handleNavigateToCaseflows?.(ref.objID);
655
+ else
656
+ console.log("CaseFlow instance reference missing objID");
657
+ break;
635
658
  // Handle other object types as needed
636
659
  default:
637
660
  console.warn(`Unhandled object type: ${ref.objClass}`);
@@ -687,7 +710,7 @@ const TMBlogsPost = (props) => {
687
710
  textDecoration: blogPost.isDel ? 'line-through' : 'none',
688
711
  boxShadow: isFocused ? "0 4px 12px rgba(19, 85, 150, 0.6)" : "none",
689
712
  cursor: 'pointer',
690
- }, 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, isLoading: !descriptorsLoaded, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
713
+ }, 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, handleNavigateToCaseflows: handleNavigateToCaseflows }), 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, isLoading: !descriptorsLoaded, searchText: searchText, dcmtTypeDescriptors: dcmtTypeDescriptors, treeFs: treeFs, draftLatestInfoMap: draftLatestInfoMap, archivedDocumentMap: archivedDocumentMap, handleAttachmentFocus: handleFocusedAttachment, openDcmtForm: openDcmtForm }))] }, `${id}-blogpost-${blogPost.id}`) })] }, "blog-post-wrapper-" + id + "-" + blogPost.id);
691
714
  }), _jsx("div", { ref: bottomRef })] }), _jsx(TMContextMenu, { items: menuItems, target: `#${id}-blogs-wrapper`, externalControl: {
692
715
  visible: menuVisible,
693
716
  position: menuPosition,
@@ -109,6 +109,7 @@ interface BlogPostTitleProps {
109
109
  showId: boolean;
110
110
  handleNavigateToWGs?: (blogPost: BlogPost | HomeBlogPost) => void;
111
111
  handleNavigateToDossiers?: (blogPost: BlogPost | HomeBlogPost) => void;
112
+ handleNavigateToCaseflows?: (blogPost: BlogPost | HomeBlogPost) => void;
112
113
  }
113
114
  export declare const BlogPostTitle: (props: BlogPostTitleProps) => import("react/jsx-runtime").JSX.Element;
114
115
  export declare const stripHtml: (html: string) => string;
@@ -162,8 +162,16 @@ export const getDcmtTypeDescriptor = async (blogPosts) => {
162
162
  return dcmtTypeMap;
163
163
  };
164
164
  export const BlogPostHomeHeader = (header, classId, isSelected, searchText, headerClickCallback) => {
165
+ // 'CF' = istanza di CaseFlow (bacheca Home V6). Attenzione: nel mondo dei
166
+ // task PdGs.CF indica invece la pratica-dossier; qui il dominio e' il
167
+ // ClassID di HomeBlogPost, dove 'DS' e' la pratica e 'CF' la pratica CaseFlow.
165
168
  const isWorkGroup = classId === 'WG';
166
- const iconColor = isSelected ? '#ffffff' : isWorkGroup ? PDGS_COLORS.WORKING_GROUP : PDGS_COLORS.DOSSIER;
169
+ const isCaseFlow = classId === 'CF';
170
+ const iconColor = isSelected
171
+ ? '#ffffff'
172
+ : isWorkGroup ? PDGS_COLORS.WORKING_GROUP
173
+ : isCaseFlow ? PDGS_COLORS.CASEFLOW
174
+ : PDGS_COLORS.DOSSIER;
167
175
  return (_jsxs("div", { style: {
168
176
  display: "flex",
169
177
  alignItems: "center",
@@ -171,7 +179,7 @@ export const BlogPostHomeHeader = (header, classId, isSelected, searchText, head
171
179
  fontWeight: "bold",
172
180
  color: isSelected ? "#fff" : TMColors.primary,
173
181
  gap: "4px",
174
- }, 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: {
182
+ }, children: [_jsx(TMTooltip, { content: isWorkGroup ? SDKUI_Localizator.WorkGroup : isCaseFlow ? "CaseFlow" : SDKUI_Localizator.Dossier, children: isWorkGroup ? (_jsx(IconMenuCAWorkingGroups, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : isCaseFlow ? (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) : (_jsx(IconCADossier, { color: iconColor, fontSize: 28, onClick: headerClickCallback })) }), _jsx("div", { onClick: headerClickCallback, style: {
175
183
  whiteSpace: "nowrap",
176
184
  overflow: "hidden",
177
185
  textOverflow: "ellipsis",
@@ -218,7 +226,7 @@ export const removeFileExtension = (filename) => {
218
226
  return filename.includes('.') ? filename.substring(0, filename.lastIndexOf('.')) : filename;
219
227
  };
220
228
  export const BlogPostTitle = (props) => {
221
- const { displayMode, layoutMode, blogPost, isSelected, isOwnComment, searchText, isSys, isHomeBlogPost, showId, handleNavigateToWGs, handleNavigateToDossiers } = props;
229
+ const { displayMode, layoutMode, blogPost, isSelected, isOwnComment, searchText, isSys, isHomeBlogPost, showId, handleNavigateToWGs, handleNavigateToDossiers, handleNavigateToCaseflows } = props;
222
230
  const showOwnerBadge = (displayMode === "stacked" || !isOwnComment) && layoutMode === "extended";
223
231
  let subtitle = "";
224
232
  if (isHomeBlogPost) {
@@ -239,6 +247,9 @@ export const BlogPostTitle = (props) => {
239
247
  if (handleNavigateToDossiers && blogPost.id && blogPost.classID === 'DS') {
240
248
  handleNavigateToDossiers(blogPost);
241
249
  }
250
+ if (handleNavigateToCaseflows && blogPost.id && blogPost.classID === 'CF') {
251
+ handleNavigateToCaseflows(blogPost);
252
+ }
242
253
  };
243
254
  return _jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [showOwnerBadge && (_jsx("div", { style: { width: "40px", height: "40px", flexShrink: 0 }, children: OwnerInitialsBadge(blogPost) })), _jsxs("div", { style: {
244
255
  display: "flex",
@@ -8,110 +8,110 @@ import { SDKUI_Globals } from './SDKUI_Globals';
8
8
  import { SDKUI_Localizator } from './SDKUI_Localizator';
9
9
  import { IconUpdate, IconOpenInNew } from './TMIcons';
10
10
  import { getAppModuleButtonColors } from './TMUtils';
11
- const Content = styled.div `
12
- display: flex;
13
- flex-direction: column;
14
- width: 100%;
15
- background-color: #ffffff;
11
+ const Content = styled.div `
12
+ display: flex;
13
+ flex-direction: column;
14
+ width: 100%;
15
+ background-color: #ffffff;
16
16
  `;
17
- const Header = styled.div `
18
- display: flex;
19
- flex-direction: column;
20
- align-items: center;
21
- gap: 14px;
22
- padding: 32px 30px 26px 30px;
23
- background-color: ${({ $backgroundColor }) => $backgroundColor};
24
- color: #ffffff;
25
- text-align: center;
17
+ const Header = styled.div `
18
+ display: flex;
19
+ flex-direction: column;
20
+ align-items: center;
21
+ gap: 14px;
22
+ padding: 32px 30px 26px 30px;
23
+ background-color: ${({ $backgroundColor }) => $backgroundColor};
24
+ color: #ffffff;
25
+ text-align: center;
26
26
  `;
27
- const HeaderIcon = styled.div `
28
- display: flex;
29
- align-items: center;
30
- justify-content: center;
31
- width: 68px;
32
- height: 68px;
33
- border-radius: 50%;
34
- background-color: rgba(255, 255, 255, 0.18);
35
- border: 1px solid rgba(255, 255, 255, 0.35);
36
- box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
27
+ const HeaderIcon = styled.div `
28
+ display: flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ width: 68px;
32
+ height: 68px;
33
+ border-radius: 50%;
34
+ background-color: rgba(255, 255, 255, 0.18);
35
+ border: 1px solid rgba(255, 255, 255, 0.35);
36
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
37
37
  `;
38
- const HeaderTitle = styled.h2 `
39
- margin: 0;
40
- font-size: 22px;
41
- font-weight: 600;
42
- letter-spacing: 0.2px;
38
+ const HeaderTitle = styled.h2 `
39
+ margin: 0;
40
+ font-size: 22px;
41
+ font-weight: 600;
42
+ letter-spacing: 0.2px;
43
43
  `;
44
- const VersionBadge = styled.span `
45
- display: inline-block;
46
- padding: 4px 12px;
47
- border-radius: 999px;
48
- background-color: rgba(255, 255, 255, 0.22);
49
- border: 1px solid rgba(255, 255, 255, 0.4);
50
- font-size: 13px;
51
- font-weight: 600;
52
- letter-spacing: 0.3px;
44
+ const VersionBadge = styled.span `
45
+ display: inline-block;
46
+ padding: 4px 12px;
47
+ border-radius: 999px;
48
+ background-color: rgba(255, 255, 255, 0.22);
49
+ border: 1px solid rgba(255, 255, 255, 0.4);
50
+ font-size: 13px;
51
+ font-weight: 600;
52
+ letter-spacing: 0.3px;
53
53
  `;
54
- const Body = styled.div `
55
- display: flex;
56
- flex-direction: column;
57
- gap: 10px;
58
- padding: 26px 30px 22px 30px;
59
- text-align: center;
54
+ const Body = styled.div `
55
+ display: flex;
56
+ flex-direction: column;
57
+ gap: 10px;
58
+ padding: 26px 30px 22px 30px;
59
+ text-align: center;
60
60
  `;
61
- const Message = styled.p `
62
- margin: 0;
63
- font-size: 15px;
64
- line-height: 1.6;
65
- color: #242424;
61
+ const Message = styled.p `
62
+ margin: 0;
63
+ font-size: 15px;
64
+ line-height: 1.6;
65
+ color: #242424;
66
66
  `;
67
- const SubMessage = styled.p `
68
- margin: 0;
69
- font-size: 13px;
70
- line-height: 1.6;
71
- color: #6b6b6b;
67
+ const SubMessage = styled.p `
68
+ margin: 0;
69
+ font-size: 13px;
70
+ line-height: 1.6;
71
+ color: #6b6b6b;
72
72
  `;
73
- const Footer = styled.div `
74
- display: flex;
75
- flex-direction: row;
76
- justify-content: center;
77
- align-items: center;
78
- flex-wrap: wrap;
79
- gap: 12px;
80
- padding: 0 30px 28px 30px;
73
+ const Footer = styled.div `
74
+ display: flex;
75
+ flex-direction: row;
76
+ justify-content: center;
77
+ align-items: center;
78
+ flex-wrap: wrap;
79
+ gap: 12px;
80
+ padding: 0 30px 28px 30px;
81
81
  `;
82
- const BaseButton = styled.button `
83
- display: inline-flex;
84
- align-items: center;
85
- justify-content: center;
86
- gap: 8px;
87
- min-width: 150px;
88
- padding: 10px 18px;
89
- border-radius: 8px;
90
- font-size: 14px;
91
- font-weight: 600;
92
- cursor: pointer;
93
- transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
82
+ const BaseButton = styled.button `
83
+ display: inline-flex;
84
+ align-items: center;
85
+ justify-content: center;
86
+ gap: 8px;
87
+ min-width: 150px;
88
+ padding: 10px 18px;
89
+ border-radius: 8px;
90
+ font-size: 14px;
91
+ font-weight: 600;
92
+ cursor: pointer;
93
+ transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
94
94
  `;
95
- const PrimaryButton = styled(BaseButton) `
96
- border: 1px solid ${({ $base }) => $base};
97
- background-color: ${({ $base }) => $base};
98
- color: #ffffff;
99
-
100
- &:hover {
101
- background-color: ${({ $hover }) => $hover};
102
- border-color: ${({ $hover }) => $hover};
103
- box-shadow: 0 2px 8px ${({ $shadow }) => $shadow};
104
- }
95
+ const PrimaryButton = styled(BaseButton) `
96
+ border: 1px solid ${({ $base }) => $base};
97
+ background-color: ${({ $base }) => $base};
98
+ color: #ffffff;
99
+
100
+ &:hover {
101
+ background-color: ${({ $hover }) => $hover};
102
+ border-color: ${({ $hover }) => $hover};
103
+ box-shadow: 0 2px 8px ${({ $shadow }) => $shadow};
104
+ }
105
105
  `;
106
- const SecondaryButton = styled(BaseButton) `
107
- border: 1px solid #d5d5d5;
108
- background-color: #ffffff;
109
- color: #444444;
110
-
111
- &:hover {
112
- background-color: #f3f3f3;
113
- border-color: #bdbdbd;
114
- }
106
+ const SecondaryButton = styled(BaseButton) `
107
+ border: 1px solid #d5d5d5;
108
+ background-color: #ffffff;
109
+ color: #444444;
110
+
111
+ &:hover {
112
+ background-color: #f3f3f3;
113
+ border-color: #bdbdbd;
114
+ }
115
115
  `;
116
116
  export const TMAppUpdatedModal = () => {
117
117
  const deviceType = useDeviceType();
@@ -53,6 +53,8 @@ export declare const PDGS_COLORS: {
53
53
  DOSSIER: string;
54
54
  DOCUMENT: string;
55
55
  WORKING_GROUP: string;
56
+ /** Istanza di CaseFlow: viola, per non confonderla ne' con la pratica (arancio) ne' con il gruppo di lavoro (verde). */
57
+ CASEFLOW: string;
56
58
  };
57
59
  export declare const getPdgsIconMap: (fontSize?: number) => Map<PdGs, JSX.Element>;
58
60
  export declare const convertSearchResultDescriptorToFileItems: (documents: Array<SearchResultDescriptor>) => Array<FileItem>;
@@ -270,6 +270,8 @@ export const PDGS_COLORS = {
270
270
  DOSSIER: '#e65b00',
271
271
  DOCUMENT: '#b38600',
272
272
  WORKING_GROUP: '#009700',
273
+ /** Istanza di CaseFlow: viola, per non confonderla ne' con la pratica (arancio) ne' con il gruppo di lavoro (verde). */
274
+ CASEFLOW: '#6a3fb5',
273
275
  };
274
276
  export const getPdgsIconMap = (fontSize = 20) => {
275
277
  return new Map([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topconsultnpm/sdkui-react",
3
- "version": "6.22.0-dev2.46",
3
+ "version": "6.22.0-dev2.47",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",