@topconsultnpm/sdkui-react 6.22.0-dev2.46 → 6.22.0-dev2.48
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/TMPanel.d.ts +4 -0
- package/lib/components/base/TMPanel.js +198 -144
- package/lib/components/features/archive/TMArchive.js +17 -3
- package/lib/components/features/documents/TMDcmtForm.js +39 -1
- package/lib/components/features/search/TMSearch.js +52 -8
- package/lib/components/features/search/TMSearchQueryPanel.d.ts +1 -0
- package/lib/components/features/search/TMSearchQueryPanel.js +251 -251
- package/lib/components/features/search/TMTreeSelector.js +136 -118
- package/lib/components/grids/TMBlogsPost.d.ts +2 -0
- package/lib/components/grids/TMBlogsPost.js +26 -3
- package/lib/components/grids/TMBlogsPostUtils.d.ts +1 -0
- package/lib/components/grids/TMBlogsPostUtils.js +14 -3
- package/lib/helper/TMUtils.d.ts +2 -0
- package/lib/helper/TMUtils.js +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { DcmtTypeListCacheService, LayoutModes, SDK_Localizator, TreeCacheService, TreeItemTypes } from '@topconsultnpm/sdk-ts';
|
|
4
4
|
import { TreeList, Column, Scrolling, Selection } from 'devextreme-react/tree-list';
|
|
5
5
|
import { DropDownBox } from 'devextreme-react';
|
|
@@ -36,39 +36,57 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
36
36
|
const deviceType = useDeviceType();
|
|
37
37
|
const isMobile = deviceType === DeviceType.MOBILE;
|
|
38
38
|
const panelRef = useOutsideClick(() => setInfoDTD(undefined));
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
//
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
39
|
+
// Tiene traccia dell'albero selezionato senza far dipendere loadTreesAsync da selectedTreeId:
|
|
40
|
+
// così il refresh può riproporre la selezione corrente senza ricaricare a ogni cambio di albero
|
|
41
|
+
const selectedTreeIdRef = useRef(selectedTreeId);
|
|
42
|
+
useEffect(() => { selectedTreeIdRef.current = selectedTreeId; }, [selectedTreeId]);
|
|
43
|
+
// Carica tutti gli alberi del contesto corrente (ricerca o archiviazione).
|
|
44
|
+
// Con forceRefresh la cache viene invalidata, altrimenti GetAll* restituirebbe gli alberi già in memoria.
|
|
45
|
+
const loadTreesAsync = useCallback(async (forceRefresh = false) => {
|
|
46
|
+
const isSearchContext = layoutMode == LayoutModes.Update;
|
|
47
|
+
if (forceRefresh) {
|
|
48
|
+
if (isSearchContext)
|
|
49
|
+
TreeCacheService.RemoveAllSearch();
|
|
50
|
+
else
|
|
51
|
+
TreeCacheService.RemoveAllArchive();
|
|
52
|
+
}
|
|
53
|
+
const result = isSearchContext
|
|
54
|
+
? await TreeCacheService.GetAllSearchAsync()
|
|
55
|
+
: await TreeCacheService.GetAllArchiveAsync();
|
|
56
|
+
if (!result || result.length === 0) {
|
|
57
|
+
// Sul refresh gli alberi possono essere spariti lato server: allinea anche lo stato vuoto
|
|
58
|
+
if (forceRefresh) {
|
|
59
|
+
setTrees([]);
|
|
60
|
+
setSelectedTreeId(0);
|
|
61
|
+
setSelectedRowKeys([]);
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setTrees(result);
|
|
66
|
+
// Dopo un refresh mantiene l'albero corrente, se ancora presente
|
|
67
|
+
const currentTreeId = selectedTreeIdRef.current;
|
|
68
|
+
if (forceRefresh && result.some(o => o.id == currentTreeId)) {
|
|
69
|
+
setSelectedTreeId(currentTreeId);
|
|
70
|
+
setSelectedRowKeys([currentTreeId]);
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
let defaultTree = SDKUI_Globals.userSettings.searchSettings.defaultTree;
|
|
74
|
+
let initialTreeId;
|
|
75
|
+
let treeToSelect;
|
|
76
|
+
if (defaultTree > 0) {
|
|
77
|
+
initialTreeId = defaultTree;
|
|
78
|
+
treeToSelect = result.find(o => o.id == defaultTree);
|
|
67
79
|
}
|
|
68
80
|
else {
|
|
69
|
-
|
|
81
|
+
initialTreeId = result[0]?.id ?? 0;
|
|
82
|
+
treeToSelect = result[0];
|
|
83
|
+
}
|
|
84
|
+
setSelectedTreeId(initialTreeId);
|
|
85
|
+
if (treeToSelect?.id) {
|
|
86
|
+
setSelectedRowKeys([treeToSelect.id]);
|
|
70
87
|
}
|
|
71
88
|
}, [layoutMode]);
|
|
89
|
+
useEffect(() => { loadTreesAsync(); }, [loadTreesAsync]);
|
|
72
90
|
useEffect(() => {
|
|
73
91
|
let newTreeItems = trees.find(o => o.id == selectedTreeId)?.items ?? [];
|
|
74
92
|
setTreeItems(newTreeItems);
|
|
@@ -160,7 +178,7 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
160
178
|
onSelectedTIDChanged?.(treeItem.tid, selectedTreeId);
|
|
161
179
|
}
|
|
162
180
|
}, [onSelectedTIDChanged, selectedTreeId]);
|
|
163
|
-
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
181
|
+
return (_jsx(TMPanel, { title: SDK_Localizator.Trees, isVisible: isVisible, totalItems: trees.length, onClose: onClosePanel, allowMaximize: allowMaximize, onMaximize: onMaximizePanel, onHeaderDoubleClick: onMaximizePanel, onRefresh: () => loadTreesAsync(true), toolbar: _jsx(TMButton, { btnStyle: 'icon', caption: defaultTreeId == selectedTreeId ? SDKUI_Localizator.TreeRemoveDefault : SDKUI_Localizator.SetAsDefault, icon: defaultTreeId == selectedTreeId ? _jsx(IconStarRemove, { color: 'rgb(243, 114, 92)' }) : _jsx(IconStar, { color: 'rgb(248, 215, 117)' }), onClick: () => {
|
|
164
182
|
if (defaultTreeId == selectedTreeId) {
|
|
165
183
|
if (layoutMode == LayoutModes.Update)
|
|
166
184
|
SDKUI_Globals.userSettings.searchSettings.defaultTree = -1;
|
|
@@ -196,93 +214,93 @@ const TMTreeSelector = ({ layoutMode = LayoutModes.Update, isVisible, onSelected
|
|
|
196
214
|
: _jsx("div", { style: { display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', height: '100%', width: '100%', fontSize: '1.5rem' }, children: SDKUI_Localizator.TreesNoAvailable }) }));
|
|
197
215
|
};
|
|
198
216
|
export default TMTreeSelector;
|
|
199
|
-
const StyledTreeDcmtTypeRow = styled(StyledDivHorizontal) `
|
|
200
|
-
align-items: center;
|
|
201
|
-
min-width: 0;
|
|
202
|
-
width: 100%;
|
|
203
|
-
gap: 2px;
|
|
204
|
-
position: relative;
|
|
205
|
-
|
|
206
|
-
.info-icon {
|
|
207
|
-
display: flex;
|
|
208
|
-
align-items: center;
|
|
209
|
-
margin-left: auto;
|
|
210
|
-
z-index: 2;
|
|
211
|
-
cursor: pointer;
|
|
212
|
-
opacity: 0;
|
|
213
|
-
pointer-events: none;
|
|
214
|
-
transition: opacity 0.2s;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
&:hover .info-icon {
|
|
218
|
-
opacity: 1;
|
|
219
|
-
pointer-events: auto;
|
|
220
|
-
}
|
|
217
|
+
const StyledTreeDcmtTypeRow = styled(StyledDivHorizontal) `
|
|
218
|
+
align-items: center;
|
|
219
|
+
min-width: 0;
|
|
220
|
+
width: 100%;
|
|
221
|
+
gap: 2px;
|
|
222
|
+
position: relative;
|
|
223
|
+
|
|
224
|
+
.info-icon {
|
|
225
|
+
display: flex;
|
|
226
|
+
align-items: center;
|
|
227
|
+
margin-left: auto;
|
|
228
|
+
z-index: 2;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
opacity: 0;
|
|
231
|
+
pointer-events: none;
|
|
232
|
+
transition: opacity 0.2s;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
&:hover .info-icon {
|
|
236
|
+
opacity: 1;
|
|
237
|
+
pointer-events: auto;
|
|
238
|
+
}
|
|
221
239
|
`;
|
|
222
|
-
const StyledTreeListWrapper = styled.div `
|
|
223
|
-
width: 100%;
|
|
224
|
-
height: 100%;
|
|
225
|
-
min-height: 0;
|
|
226
|
-
flex: 1;
|
|
227
|
-
display: flex;
|
|
228
|
-
flex-direction: column;
|
|
229
|
-
|
|
230
|
-
.dx-treelist,
|
|
231
|
-
.dx-treelist-rowsview,
|
|
232
|
-
.dx-scrollable,
|
|
233
|
-
.dx-scrollable-wrapper,
|
|
234
|
-
.dx-scrollable-container,
|
|
235
|
-
.dx-scrollable-content {
|
|
236
|
-
height: 100% !important;
|
|
237
|
-
min-height: 0 !important;
|
|
238
|
-
max-height: 100% !important;
|
|
239
|
-
box-sizing: border-box;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
.dx-scrollable-scrollbar.dx-scrollbar-vertical {
|
|
243
|
-
/* Mostra solo quando serve */
|
|
244
|
-
opacity: 1 !important;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
.dx-scrollable-scrollbar.dx-scrollbar-horizontal {
|
|
248
|
-
display: none !important;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
.dx-treelist-container>.dx-treelist-headers,
|
|
252
|
-
.dx-treelist-container>.dx-treelist-rowsview {
|
|
253
|
-
background-color: transparent;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.dx-treelist-rowsview .dx-treelist-empty-space {
|
|
257
|
-
position: relative;
|
|
258
|
-
top: 4px;
|
|
259
|
-
display: inline-block;
|
|
260
|
-
width: 16px;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
.dx-row > td {
|
|
264
|
-
padding: 10px 4px;
|
|
265
|
-
font-size: 1rem;
|
|
266
|
-
white-space: nowrap;
|
|
267
|
-
overflow: hidden;
|
|
268
|
-
text-overflow: ellipsis;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
.dx-selection td {
|
|
272
|
-
background: oklch(from var(--dx-color-primary) l c h / .2) !important;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.dx-data-row:hover {
|
|
276
|
-
cursor: pointer;
|
|
277
|
-
background: linear-gradient(
|
|
278
|
-
270deg,
|
|
279
|
-
rgba(70, 181, 162, 0.15) 16%,
|
|
280
|
-
rgba(59, 170, 188, 0.15) 34%,
|
|
281
|
-
rgba(59, 170, 188, 0.15) 34%,
|
|
282
|
-
rgba(54, 129, 173, 0.15) 54%,
|
|
283
|
-
rgba(51, 104, 165, 0.15) 72%,
|
|
284
|
-
rgba(47, 84, 157, 0.15) 88%,
|
|
285
|
-
rgba(48, 79, 153, 0.15) 100%
|
|
286
|
-
);
|
|
287
|
-
}
|
|
240
|
+
const StyledTreeListWrapper = styled.div `
|
|
241
|
+
width: 100%;
|
|
242
|
+
height: 100%;
|
|
243
|
+
min-height: 0;
|
|
244
|
+
flex: 1;
|
|
245
|
+
display: flex;
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
|
|
248
|
+
.dx-treelist,
|
|
249
|
+
.dx-treelist-rowsview,
|
|
250
|
+
.dx-scrollable,
|
|
251
|
+
.dx-scrollable-wrapper,
|
|
252
|
+
.dx-scrollable-container,
|
|
253
|
+
.dx-scrollable-content {
|
|
254
|
+
height: 100% !important;
|
|
255
|
+
min-height: 0 !important;
|
|
256
|
+
max-height: 100% !important;
|
|
257
|
+
box-sizing: border-box;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.dx-scrollable-scrollbar.dx-scrollbar-vertical {
|
|
261
|
+
/* Mostra solo quando serve */
|
|
262
|
+
opacity: 1 !important;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.dx-scrollable-scrollbar.dx-scrollbar-horizontal {
|
|
266
|
+
display: none !important;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.dx-treelist-container>.dx-treelist-headers,
|
|
270
|
+
.dx-treelist-container>.dx-treelist-rowsview {
|
|
271
|
+
background-color: transparent;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.dx-treelist-rowsview .dx-treelist-empty-space {
|
|
275
|
+
position: relative;
|
|
276
|
+
top: 4px;
|
|
277
|
+
display: inline-block;
|
|
278
|
+
width: 16px;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.dx-row > td {
|
|
282
|
+
padding: 10px 4px;
|
|
283
|
+
font-size: 1rem;
|
|
284
|
+
white-space: nowrap;
|
|
285
|
+
overflow: hidden;
|
|
286
|
+
text-overflow: ellipsis;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.dx-selection td {
|
|
290
|
+
background: oklch(from var(--dx-color-primary) l c h / .2) !important;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.dx-data-row:hover {
|
|
294
|
+
cursor: pointer;
|
|
295
|
+
background: linear-gradient(
|
|
296
|
+
270deg,
|
|
297
|
+
rgba(70, 181, 162, 0.15) 16%,
|
|
298
|
+
rgba(59, 170, 188, 0.15) 34%,
|
|
299
|
+
rgba(59, 170, 188, 0.15) 34%,
|
|
300
|
+
rgba(54, 129, 173, 0.15) 54%,
|
|
301
|
+
rgba(51, 104, 165, 0.15) 72%,
|
|
302
|
+
rgba(47, 84, 157, 0.15) 88%,
|
|
303
|
+
rgba(48, 79, 153, 0.15) 100%
|
|
304
|
+
);
|
|
305
|
+
}
|
|
288
306
|
`;
|
|
@@ -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
|
|
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",
|
package/lib/helper/TMUtils.d.ts
CHANGED
|
@@ -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>;
|
package/lib/helper/TMUtils.js
CHANGED
|
@@ -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([
|