@topconsultnpm/sdkui-react-beta 6.14.80 → 6.14.82
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.
|
@@ -67,17 +67,17 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
67
67
|
const [dcmtFile, setDcmtFile] = useState(null);
|
|
68
68
|
const [focusedMetadataValue, setFocusedMetadataValue] = useState();
|
|
69
69
|
const [showAll, setShowAll] = useState(layoutMode === LayoutModes.Ark);
|
|
70
|
-
const [fetchError, setFetchError] = useState(
|
|
70
|
+
const [fetchError, setFetchError] = useState(false);
|
|
71
71
|
const [workItems, setWorkItems] = useState([]);
|
|
72
72
|
const { openConfirmAttachmentsDialog, ConfirmAttachmentsDialog } = useInputAttachmentsDialog();
|
|
73
73
|
const { abortController, showWaitPanel, waitPanelTitle, showPrimary, waitPanelTextPrimary, waitPanelValuePrimary, waitPanelMaxValuePrimary, showSecondary, waitPanelTextSecondary, waitPanelValueSecondary, waitPanelMaxValueSecondary, downloadDcmtsAsync } = useDcmtOperations();
|
|
74
74
|
// Custom hook to manage workflow approval data
|
|
75
|
-
const { workflowApproveData
|
|
75
|
+
const { workflowApproveData } = useWorkflowApprove();
|
|
76
76
|
const deviceType = useDeviceType();
|
|
77
77
|
const getDcmts = () => { return [{ TID: currentDcmt?.tid, DID: currentDcmt?.did, FILEEXT: currentDcmt?.fileExt }]; };
|
|
78
78
|
const fetchData = async () => {
|
|
79
79
|
try {
|
|
80
|
-
setFetchError(
|
|
80
|
+
setFetchError(false);
|
|
81
81
|
if (!TID)
|
|
82
82
|
return;
|
|
83
83
|
if (!DID && layoutMode === LayoutModes.Update)
|
|
@@ -99,8 +99,9 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
99
99
|
}
|
|
100
100
|
layoutMode === LayoutModes.Ark && resetHandler();
|
|
101
101
|
}
|
|
102
|
-
catch (
|
|
103
|
-
setFetchError(
|
|
102
|
+
catch (e) {
|
|
103
|
+
setFetchError(true);
|
|
104
|
+
throw e;
|
|
104
105
|
}
|
|
105
106
|
finally {
|
|
106
107
|
TMSpinner.hide();
|
|
@@ -156,7 +157,15 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
156
157
|
setDcmtFile(fileFromConnector);
|
|
157
158
|
}, [fileFromConnector]);
|
|
158
159
|
useEffect(() => {
|
|
159
|
-
|
|
160
|
+
const run = async () => {
|
|
161
|
+
try {
|
|
162
|
+
await fetchData();
|
|
163
|
+
}
|
|
164
|
+
catch (e) {
|
|
165
|
+
TMExceptionBoxManager.show({ exception: e });
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
run();
|
|
160
169
|
}, [TID, DID]);
|
|
161
170
|
useEffect(() => {
|
|
162
171
|
if (formData.length > 0) {
|
|
@@ -230,7 +239,7 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
230
239
|
const isSysMetadataDisabled = layoutMode !== LayoutModes.Update;
|
|
231
240
|
const isDetailsDisabled = layoutMode !== LayoutModes.Update || !DID;
|
|
232
241
|
const isMasterDisabled = layoutMode !== LayoutModes.Update || !DID;
|
|
233
|
-
const showToppyForApprove = layoutMode === LayoutModes.Update && workItems.length > 0 && !isOpenDetails && !isOpenMaster;
|
|
242
|
+
const showToppyForApprove = layoutMode === LayoutModes.Update && !fetchError && workItems.length > 0 && !isOpenDetails && !isOpenMaster;
|
|
234
243
|
const approvalVID = workItems.length > 0
|
|
235
244
|
? Number(workItems[0].tid) : -1;
|
|
236
245
|
const commandsMenuItems = [
|
|
@@ -605,9 +614,6 @@ const TMDcmtForm = ({ showHeader = true, onSaveRecents, layoutMode = LayoutModes
|
|
|
605
614
|
}
|
|
606
615
|
};
|
|
607
616
|
const renderDcmtForm = () => {
|
|
608
|
-
if (fetchError) {
|
|
609
|
-
return (_jsxs("div", { style: { color: 'red', padding: 24, display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 24 }, children: [_jsx("h2", { children: SDKUI_Localizator.ErrorLoadingDocument }), _jsx("pre", { style: { whiteSpace: 'pre-wrap', color: 'black', background: '#f8d7da', padding: 16, borderRadius: 8, maxWidth: 600, overflowX: 'auto' }, children: JSON.stringify(fetchError, Object.getOwnPropertyNames(fetchError), 2) }), _jsx("img", { src: Toppy, alt: "Errore", style: { width: 120, height: 'auto', marginBottom: 16 } })] }));
|
|
610
|
-
}
|
|
611
617
|
return (_jsxs("div", { style: {
|
|
612
618
|
display: 'flex',
|
|
613
619
|
flexDirection: deviceType === DeviceType.MOBILE ? 'column' : 'row',
|
|
@@ -24,26 +24,25 @@ const StyledSqdItem = styled.div `
|
|
|
24
24
|
position: relative;
|
|
25
25
|
white-space: nowrap;
|
|
26
26
|
text-overflow: ellipsis;
|
|
27
|
-
/* border-bottom: 1px solid #00A99D; // separator line */
|
|
28
27
|
|
|
29
28
|
&:hover {
|
|
30
29
|
cursor: pointer;
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
.info-icon {
|
|
34
|
-
position: absolute;
|
|
35
|
-
left: -2px;
|
|
36
|
-
top: calc(50% - 5px);
|
|
37
|
-
transform: translateY(-50%);
|
|
38
33
|
opacity: 0;
|
|
39
|
-
transition: opacity 0.2s;
|
|
40
34
|
pointer-events: none;
|
|
41
|
-
|
|
35
|
+
transition: opacity 0.2s;
|
|
42
36
|
${({ $isMobile }) => $isMobile && `
|
|
43
37
|
display: none !important;
|
|
44
38
|
`}
|
|
45
39
|
}
|
|
46
40
|
|
|
41
|
+
&:hover .info-icon {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
pointer-events: auto;
|
|
44
|
+
}
|
|
45
|
+
|
|
47
46
|
&::after {
|
|
48
47
|
content: '';
|
|
49
48
|
display: block;
|
|
@@ -53,11 +52,6 @@ const StyledSqdItem = styled.div `
|
|
|
53
52
|
margin-top: 8px;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
&:hover .info-icon {
|
|
57
|
-
opacity: 1;
|
|
58
|
-
pointer-events: auto;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
55
|
&:last-child {
|
|
62
56
|
border-bottom: none; // remove border for last item
|
|
63
57
|
margin-bottom: 0;
|
|
@@ -181,40 +175,42 @@ const TMSavedQuerySelector = React.memo(({ items, selectedId, allowShowSearch =
|
|
|
181
175
|
padding: '5px 10px',
|
|
182
176
|
gap: '3px',
|
|
183
177
|
overflow: 'auto'
|
|
184
|
-
}, 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) =>
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
178
|
+
}, 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) => {
|
|
179
|
+
const isCurrent = selectedItem?.id == sqd.id;
|
|
180
|
+
return (_jsxs(StyledSqdItem, { id: `sqd-item-${sqd.id}`, "$isMobile": isMobile, onClick: () => {
|
|
181
|
+
setSelectedItem(sqd);
|
|
182
|
+
onItemClick?.(sqd);
|
|
183
|
+
}, children: [_jsxs(StyledDivHorizontal, { style: { alignItems: 'center', gap: 8, width: '100%' }, children: [!isMobile && (_jsx("span", { className: "info-icon", style: {
|
|
184
|
+
marginRight: 4,
|
|
185
|
+
display: 'flex',
|
|
186
|
+
alignItems: 'center'
|
|
187
|
+
}, children: _jsx(TMTooltip, { content: getTooltipBySqd(sqd), children: _jsx(IconInfo, { color: TMColors.primaryColor }) }) })), _jsxs("div", { style: {
|
|
188
|
+
flex: 1,
|
|
189
|
+
display: 'flex',
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'center',
|
|
192
|
+
minWidth: 0
|
|
193
|
+
}, children: [_jsx("p", { style: {
|
|
194
|
+
fontSize: '1rem',
|
|
195
|
+
fontWeight: sqd.id === 1 ? 600 : 'normal',
|
|
196
|
+
whiteSpace: 'nowrap',
|
|
197
|
+
overflow: 'hidden',
|
|
198
|
+
textOverflow: 'ellipsis',
|
|
199
|
+
color: TMColors.primaryColor,
|
|
200
|
+
paddingRight: '15px'
|
|
201
|
+
}, children: sqd.name }), manageDefault && sqd.isDefault == 1 && _jsx(IconStar, { fontSize: 16, color: 'rgb(248, 215, 117)' })] }), _jsx("span", { style: {
|
|
202
|
+
width: 24,
|
|
203
|
+
height: 24,
|
|
204
|
+
borderRadius: 24,
|
|
205
|
+
display: 'flex',
|
|
206
|
+
alignItems: 'center',
|
|
207
|
+
justifyContent: 'center',
|
|
208
|
+
fontSize: '1rem',
|
|
209
|
+
fontWeight: 'bold',
|
|
210
|
+
marginLeft: 8,
|
|
211
|
+
visibility: isCurrent ? 'visible' : 'hidden'
|
|
212
|
+
}, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) })] }), _jsx(SavedQueryContexMenu, { sqd: sqd, manageDefault: manageDefault, isMobile: isMobile, setInfoSQD: setInfoSQD, setDefaultAsync: () => setDefaultSQDAsync(sqd), deleteAsync: () => deleteSQDAsync(sqd), favManageAsync: () => favManageSQDAsync(sqd) })] }, sqd.id));
|
|
213
|
+
}) }), dataSource.length > initialSQDsMaxItems && searchText.length <= 0 &&
|
|
218
214
|
_jsx("div", { style: { display: 'flex', justifyContent: 'flex-end', padding: '10px', position: 'relative' }, children: _jsx(TMShowAllOrMaxItemsButton, { showAll: showAllRoot, dataSourceLength: dataSource.length, onClick: () => { setShowAllRoot(!showAllRoot); } }) }), _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)] })] }));
|
|
219
215
|
});
|
|
220
216
|
export default TMSavedQuerySelector;
|
|
@@ -507,7 +507,7 @@ const TMBlogs = (props) => {
|
|
|
507
507
|
handleFocusedBlog(blogPost);
|
|
508
508
|
handleFocusedAttachment(undefined);
|
|
509
509
|
};
|
|
510
|
-
return (_jsxs(BlogPostContainer, { id: id + "-" + blogPost.id.toString(), ref: containerRef, "$color": textColor, "$textDecoration": blogPost.isDel ? 'line-through' : 'none', "$backgroundColor": bgColor, "$isNew": Boolean(blogPost.newPosts ?? 0) || isNew, "$canNavigate": canNavigate(), "$paddingRight": layoutMode === 'chat' ? "
|
|
510
|
+
return (_jsxs(BlogPostContainer, { id: id + "-" + blogPost.id.toString(), ref: containerRef, "$color": textColor, "$textDecoration": blogPost.isDel ? 'line-through' : 'none', "$backgroundColor": bgColor, "$isNew": Boolean(blogPost.newPosts ?? 0) || isNew, "$canNavigate": canNavigate(), "$paddingRight": layoutMode === 'chat' ? "50px" : "10px", onClick: onClickCallback, onDoubleClick: headerClickCallback, tabIndex: 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onContextMenu: onContextMenu, children: [_jsxs("div", { style: { display: "flex", alignItems: "center" }, children: [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
|
|
511
511
|
? IconAndHeaderElement(blogPost, iconColor, isSelected, () => {
|
|
512
512
|
if (handleNavigateToWGs && blogPost.id && blogPost.classID === 'WG') {
|
|
513
513
|
handleNavigateToWGs(blogPost.id);
|
|
@@ -545,7 +545,7 @@ const TMBlogs = (props) => {
|
|
|
545
545
|
display: "flex",
|
|
546
546
|
flexDirection: "row",
|
|
547
547
|
alignItems: "flex-start",
|
|
548
|
-
padding: "
|
|
548
|
+
padding: "2px",
|
|
549
549
|
borderRadius: "12px",
|
|
550
550
|
cursor: "default",
|
|
551
551
|
justifyContent: isOwnComment ? "flex-end" : "flex-start",
|
|
@@ -554,9 +554,8 @@ const TMBlogs = (props) => {
|
|
|
554
554
|
flexDirection: "column",
|
|
555
555
|
alignItems: isOwnComment ? "flex-end" : "flex-start",
|
|
556
556
|
textAlign: "left",
|
|
557
|
-
maxWidth: '
|
|
557
|
+
maxWidth: '90%',
|
|
558
558
|
borderRadius: '8px',
|
|
559
|
-
backgroundColor: isOwnComment ? '#D9EFE0' : '#F3E6E6',
|
|
560
559
|
}, children: renderBlogPostContent(blogPost, index, isOwnComment) }) }, 'blogPostChat-' + id + "-" + blogPost.id)] }, "blog-post-wrapper-" + id + "-" + blogPost.id));
|
|
561
560
|
}) }) });
|
|
562
561
|
};
|
|
@@ -625,17 +624,14 @@ const TMBlogs = (props) => {
|
|
|
625
624
|
display: 'flex',
|
|
626
625
|
justifyContent: 'center',
|
|
627
626
|
alignItems: 'center',
|
|
628
|
-
opacity: 0.3,
|
|
629
627
|
}, onMouseEnter: (e) => {
|
|
630
628
|
e.currentTarget.style.backgroundColor = '#D94A9F';
|
|
631
629
|
e.currentTarget.style.transform = 'scale(1.1)';
|
|
632
630
|
e.currentTarget.style.boxShadow = '0 4px 12px rgba(37, 89, 165, 0.6)';
|
|
633
|
-
e.currentTarget.style.opacity = '1';
|
|
634
631
|
}, onMouseLeave: (e) => {
|
|
635
632
|
e.currentTarget.style.backgroundColor = "#C2388B";
|
|
636
633
|
e.currentTarget.style.transform = 'scale(1)';
|
|
637
634
|
e.currentTarget.style.boxShadow = '0 2px 6px rgba(0,0,0,0.2)';
|
|
638
|
-
e.currentTarget.style.opacity = '0.3';
|
|
639
635
|
}, onClick: () => { showCommentFormCallback(); }, children: _jsx(TMTooltip, { content: SDKUI_Localizator.AddNewComment, children: _jsx("i", { className: "dx-icon-chat", style: { fontSize: !isMobile ? '30px' : '25px' } }) }) })] }) });
|
|
640
636
|
};
|
|
641
637
|
export default TMBlogs;
|
|
@@ -88,7 +88,7 @@ const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, o
|
|
|
88
88
|
alignItems: 'center',
|
|
89
89
|
justifyContent: 'center',
|
|
90
90
|
minWidth: 0
|
|
91
|
-
}, children: _jsx(TMTidViewer, { tid: dtd.id, color: TMColors.primaryColor, showIcon: false }) }),
|
|
91
|
+
}, children: _jsx(TMTidViewer, { tid: dtd.id, color: TMColors.primaryColor, showIcon: false }) }), _jsx("span", { style: {
|
|
92
92
|
width: 24,
|
|
93
93
|
height: 24,
|
|
94
94
|
borderRadius: 24,
|
|
@@ -97,8 +97,9 @@ const TMRecentsManager = ({ deviceType, mruTIDs, currentMruTID, onSelectedTID, o
|
|
|
97
97
|
justifyContent: 'center',
|
|
98
98
|
fontSize: '1rem',
|
|
99
99
|
fontWeight: 'bold',
|
|
100
|
-
marginLeft: 8
|
|
101
|
-
|
|
100
|
+
marginLeft: 8,
|
|
101
|
+
visibility: isCurrent ? 'visible' : 'hidden'
|
|
102
|
+
}, children: _jsx(IconApply, { fontSize: 24, color: 'green' }) })] }), _jsx(ContextMenu, { dataSource: [
|
|
102
103
|
{
|
|
103
104
|
text: SDKUI_Localizator.Remove,
|
|
104
105
|
icon: iconDelete(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topconsultnpm/sdkui-react-beta",
|
|
3
|
-
"version": "6.14.
|
|
3
|
+
"version": "6.14.82",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"lib"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@topconsultnpm/sdk-ts-beta": "6.14.
|
|
45
|
+
"@topconsultnpm/sdk-ts-beta": "6.14.17",
|
|
46
46
|
"buffer": "^6.0.3",
|
|
47
47
|
"devextreme": "24.2.6",
|
|
48
48
|
"devextreme-react": "24.2.6",
|