Skip to content

Commit 2344f4d

Browse files
authored
Merge pull request #993 from nickcdon/main
🐛修复文件名过长无法复制问题
2 parents 277933c + 26c2787 commit 2344f4d

File tree

4 files changed

+87
-90
lines changed

4 files changed

+87
-90
lines changed

web/packages/tca-analysis/src/modules/projects/issues/issue-detail-modal.tsx

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -208,75 +208,75 @@ const IssueModal = (props: IssueModalProps) => {
208208
})}
209209
>
210210
{// 本行有问题 || 问题行为0,即文件问题显示在第一行之前
211-
(fileError || issueLines.includes(line)) && (
212-
<div className={style.ruleWrapper}>
213-
<div
214-
className={style.rule}
215-
onClick={() => {
216-
if (issueIndex > -1) {
217-
const list = cloneDeep(expanded);
218-
list[issueIndex] = !expanded[issueIndex];
219-
setExpanded(list);
220-
}
221-
}}
222-
>
223-
<span className={style.ruleContent}>
224-
{expanded[issueIndex] || fileError ? (
225-
<CaretDown />
226-
) : (
227-
<CaretRight />
228-
)}
229-
{detail.checkrule_real_name}】规则描述:
230-
{ruleDetail.rule_title}
231-
</span>
232-
<span>
233-
{issueIndex !== 0 && !fileError && (
234-
<Tooltip
235-
title="上一处问题"
236-
getPopupContainer={() => document.body}
237-
>
238-
<Button
239-
type="link"
240-
icon={<AngleUp />}
241-
onClick={(e: any) => {
242-
e.stopPropagation();
243-
if (issueIndex > -1) {
244-
scrollToItem(issueLines[issueIndex - 1]);
245-
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex - 1]);
246-
if (nextIssueDetail) {
247-
setCurIssueLine(nextIssueDetail.line);
211+
(fileError || issueLines.includes(line)) && (
212+
<div className={style.ruleWrapper}>
213+
<div
214+
className={style.rule}
215+
onClick={() => {
216+
if (issueIndex > -1) {
217+
const list = cloneDeep(expanded);
218+
list[issueIndex] = !expanded[issueIndex];
219+
setExpanded(list);
220+
}
221+
}}
222+
>
223+
<span className={style.ruleContent}>
224+
{expanded[issueIndex] || fileError ? (
225+
<CaretDown />
226+
) : (
227+
<CaretRight />
228+
)}
229+
{detail.checkrule_real_name}】规则描述:
230+
{ruleDetail.rule_title}
231+
</span>
232+
<span>
233+
{issueIndex !== 0 && !fileError && (
234+
<Tooltip
235+
title="上一处问题"
236+
getPopupContainer={() => document.body}
237+
>
238+
<Button
239+
type="link"
240+
icon={<AngleUp />}
241+
onClick={(e: any) => {
242+
e.stopPropagation();
243+
if (issueIndex > -1) {
244+
scrollToItem(issueLines[issueIndex - 1]);
245+
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex - 1]);
246+
if (nextIssueDetail) {
247+
setCurIssueLine(nextIssueDetail.line);
248+
}
248249
}
249-
}
250-
}}
251-
/>
252-
</Tooltip>
253-
)}
254-
{issueIndex < issueLines.length - 1 && !fileError && (
255-
<Tooltip
256-
title="下一处问题"
257-
getPopupContainer={() => document.body}
258-
>
259-
<Button
260-
type="link"
261-
icon={<AngleDown />}
262-
onClick={(e: any) => {
263-
e.stopPropagation();
264-
if (issueIndex > -1) {
265-
scrollToItem(issueLines[issueIndex + 1]);
266-
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex + 1]);
267-
if (nextIssueDetail) {
268-
setCurIssueLine(nextIssueDetail.line);
250+
}}
251+
/>
252+
</Tooltip>
253+
)}
254+
{issueIndex < issueLines.length - 1 && !fileError && (
255+
<Tooltip
256+
title="下一处问题"
257+
getPopupContainer={() => document.body}
258+
>
259+
<Button
260+
type="link"
261+
icon={<AngleDown />}
262+
onClick={(e: any) => {
263+
e.stopPropagation();
264+
if (issueIndex > -1) {
265+
scrollToItem(issueLines[issueIndex + 1]);
266+
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex + 1]);
267+
if (nextIssueDetail) {
268+
setCurIssueLine(nextIssueDetail.line);
269+
}
269270
}
270-
}
271-
}}
272-
/>
273-
</Tooltip>
274-
)}
275-
</span>
276-
</div>
277-
<div className={style.issueMsg}>
278-
错误原因:{detail.msg}&nbsp;
279-
{!isEmpty(curIssueDetail?.issue_refers) && (
271+
}}
272+
/>
273+
</Tooltip>
274+
)}
275+
</span>
276+
</div>
277+
<div className={style.issueMsg}>
278+
错误原因:{detail.msg}&nbsp;
279+
{!isEmpty(curIssueDetail?.issue_refers) && (
280280
<Button
281281
type="link"
282282
onClick={() => {
@@ -286,19 +286,19 @@ const IssueModal = (props: IssueModalProps) => {
286286
>
287287
{showRefers && !isEmpty(curIssueRefers) ? '关闭' : '展开'}追溯
288288
</Button>
289-
)}
289+
)}
290290
</div>
291-
{(expanded[issueIndex] || fileError)
292-
&& ruleDetail.checkruledesc?.desc && (
293-
<div className={style.ruleDesc}>
294-
<h4>规则详细说明</h4>
295-
<ReactMarkdown>
296-
{ruleDetail.checkruledesc?.desc}
297-
</ReactMarkdown>
298-
</div>
299-
)}
300-
</div>
301-
)}
291+
{(expanded[issueIndex] || fileError)
292+
&& ruleDetail.checkruledesc?.desc && (
293+
<div className={style.ruleDesc}>
294+
<h4>规则详细说明</h4>
295+
<ReactMarkdown>
296+
{ruleDetail.checkruledesc?.desc}
297+
</ReactMarkdown>
298+
</div>
299+
)}
300+
</div>
301+
)}
302302
<Highlight className={language}>
303303
{content.length > CODE_MAX_CHAR_LENGTH
304304
? `${content.substring(0, CODE_MAX_CHAR_LENGTH)}...`
@@ -400,10 +400,10 @@ const IssueModal = (props: IssueModalProps) => {
400400
<div className={style.modalTitle}>
401401
<p>
402402
{detail.file_path?.split('/').pop()}
403-
<span className={style.modalDesc}>
403+
<p className={style.modalDesc}>
404404
文件路径:{detail.file_path}
405-
</span>
406-
<Copy text={detail.file_path} className={style.copyIcon} />
405+
<Copy text={detail.file_path} className={style.copyIcon} />
406+
</p>
407407
</p>
408408
{/* todo: 全屏查看issue */}
409409
{/* <Tooltip title='点击跳转新窗口打开详情页'>

web/packages/tca-analysis/src/modules/projects/issues/style.scss

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,10 @@
247247
}
248248
}
249249

250-
.modal-desc{
251-
margin-left: 8px;
252-
}
253-
254250
.modal-desc, .copy-icon{
255251
font-size: 12px;
256252
color: #606c80;
253+
word-break: break-all
257254
}
258255
}
259256

-2 Bytes
Binary file not shown.

web/tca-deploy-source/conf/configs.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@
4141
"prefix": [
4242
"/static/tca-analysis/"
4343
],
44-
"commitId": "6154d99d26c5c11c06ff08a1136d0ffa8e9b992e",
44+
"commitId": "9a23058cb92010bd23d9ee804d65f2437d90a858",
4545
"match": "^/t/[^/]+/p/[^/]+/(code-analysis|repos|template|profile|group)|^/t/[^/]+/template",
4646
"js": [
4747
"/static/tca-analysis/runtime~tca-analysis-e5169baf.js",
48-
"/static/tca-analysis/vendors~tca-analysis-bff06498.js",
49-
"/static/tca-analysis/tca-analysis-706148f2.js"
48+
"/static/tca-analysis/vendors~tca-analysis-ac8c3771.js",
49+
"/static/tca-analysis/tca-analysis-2c18dc6c.js"
5050
],
5151
"css": [
5252
"/static/tca-analysis/vendors~tca-analysis-87dbf54c.css",
53-
"/static/tca-analysis/tca-analysis-fd1fb808.css"
53+
"/static/tca-analysis/tca-analysis-80623df4.css"
5454
]
5555
},
5656
{

0 commit comments

Comments
 (0)