Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛修复文件名过长无法复制问题 #993

Merged
merged 2 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,75 +208,75 @@ const IssueModal = (props: IssueModalProps) => {
})}
>
{// 本行有问题 || 问题行为0,即文件问题显示在第一行之前
(fileError || issueLines.includes(line)) && (
<div className={style.ruleWrapper}>
<div
className={style.rule}
onClick={() => {
if (issueIndex > -1) {
const list = cloneDeep(expanded);
list[issueIndex] = !expanded[issueIndex];
setExpanded(list);
}
}}
>
<span className={style.ruleContent}>
{expanded[issueIndex] || fileError ? (
<CaretDown />
) : (
<CaretRight />
)}
【{detail.checkrule_real_name}】规则描述:
{ruleDetail.rule_title}
</span>
<span>
{issueIndex !== 0 && !fileError && (
<Tooltip
title="上一处问题"
getPopupContainer={() => document.body}
>
<Button
type="link"
icon={<AngleUp />}
onClick={(e: any) => {
e.stopPropagation();
if (issueIndex > -1) {
scrollToItem(issueLines[issueIndex - 1]);
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex - 1]);
if (nextIssueDetail) {
setCurIssueLine(nextIssueDetail.line);
(fileError || issueLines.includes(line)) && (
<div className={style.ruleWrapper}>
<div
className={style.rule}
onClick={() => {
if (issueIndex > -1) {
const list = cloneDeep(expanded);
list[issueIndex] = !expanded[issueIndex];
setExpanded(list);
}
}}
>
<span className={style.ruleContent}>
{expanded[issueIndex] || fileError ? (
<CaretDown />
) : (
<CaretRight />
)}
【{detail.checkrule_real_name}】规则描述:
{ruleDetail.rule_title}
</span>
<span>
{issueIndex !== 0 && !fileError && (
<Tooltip
title="上一处问题"
getPopupContainer={() => document.body}
>
<Button
type="link"
icon={<AngleUp />}
onClick={(e: any) => {
e.stopPropagation();
if (issueIndex > -1) {
scrollToItem(issueLines[issueIndex - 1]);
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex - 1]);
if (nextIssueDetail) {
setCurIssueLine(nextIssueDetail.line);
}
}
}
}}
/>
</Tooltip>
)}
{issueIndex < issueLines.length - 1 && !fileError && (
<Tooltip
title="下一处问题"
getPopupContainer={() => document.body}
>
<Button
type="link"
icon={<AngleDown />}
onClick={(e: any) => {
e.stopPropagation();
if (issueIndex > -1) {
scrollToItem(issueLines[issueIndex + 1]);
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex + 1]);
if (nextIssueDetail) {
setCurIssueLine(nextIssueDetail.line);
}}
/>
</Tooltip>
)}
{issueIndex < issueLines.length - 1 && !fileError && (
<Tooltip
title="下一处问题"
getPopupContainer={() => document.body}
>
<Button
type="link"
icon={<AngleDown />}
onClick={(e: any) => {
e.stopPropagation();
if (issueIndex > -1) {
scrollToItem(issueLines[issueIndex + 1]);
const nextIssueDetail = getCurIssueDetail(issueLines[issueIndex + 1]);
if (nextIssueDetail) {
setCurIssueLine(nextIssueDetail.line);
}
}
}
}}
/>
</Tooltip>
)}
</span>
</div>
<div className={style.issueMsg}>
错误原因:{detail.msg}&nbsp;
{!isEmpty(curIssueDetail?.issue_refers) && (
}}
/>
</Tooltip>
)}
</span>
</div>
<div className={style.issueMsg}>
错误原因:{detail.msg}&nbsp;
{!isEmpty(curIssueDetail?.issue_refers) && (
<Button
type="link"
onClick={() => {
Expand All @@ -286,19 +286,19 @@ const IssueModal = (props: IssueModalProps) => {
>
{showRefers && !isEmpty(curIssueRefers) ? '关闭' : '展开'}追溯
</Button>
)}
)}
</div>
{(expanded[issueIndex] || fileError)
&& ruleDetail.checkruledesc?.desc && (
<div className={style.ruleDesc}>
<h4>规则详细说明</h4>
<ReactMarkdown>
{ruleDetail.checkruledesc?.desc}
</ReactMarkdown>
</div>
)}
</div>
)}
{(expanded[issueIndex] || fileError)
&& ruleDetail.checkruledesc?.desc && (
<div className={style.ruleDesc}>
<h4>规则详细说明</h4>
<ReactMarkdown>
{ruleDetail.checkruledesc?.desc}
</ReactMarkdown>
</div>
)}
</div>
)}
<Highlight className={language}>
{content.length > CODE_MAX_CHAR_LENGTH
? `${content.substring(0, CODE_MAX_CHAR_LENGTH)}...`
Expand Down Expand Up @@ -400,10 +400,10 @@ const IssueModal = (props: IssueModalProps) => {
<div className={style.modalTitle}>
<p>
{detail.file_path?.split('/').pop()}
<span className={style.modalDesc}>
<p className={style.modalDesc}>
文件路径:{detail.file_path}
</span>
<Copy text={detail.file_path} className={style.copyIcon} />
<Copy text={detail.file_path} className={style.copyIcon} />
</p>
</p>
{/* todo: 全屏查看issue */}
{/* <Tooltip title='点击跳转新窗口打开详情页'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,10 @@
}
}

.modal-desc{
margin-left: 8px;
}

.modal-desc, .copy-icon{
font-size: 12px;
color: #606c80;
word-break: break-all
}
}

Expand Down
Binary file modified web/tca-deploy-source/build_zip/tca-analysis.zip
Binary file not shown.
8 changes: 4 additions & 4 deletions web/tca-deploy-source/conf/configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"prefix": [
"/static/tca-analysis/"
],
"commitId": "6154d99d26c5c11c06ff08a1136d0ffa8e9b992e",
"commitId": "9a23058cb92010bd23d9ee804d65f2437d90a858",
"match": "^/t/[^/]+/p/[^/]+/(code-analysis|repos|template|profile|group)|^/t/[^/]+/template",
"js": [
"/static/tca-analysis/runtime~tca-analysis-e5169baf.js",
"/static/tca-analysis/vendors~tca-analysis-bff06498.js",
"/static/tca-analysis/tca-analysis-706148f2.js"
"/static/tca-analysis/vendors~tca-analysis-ac8c3771.js",
"/static/tca-analysis/tca-analysis-2c18dc6c.js"
],
"css": [
"/static/tca-analysis/vendors~tca-analysis-87dbf54c.css",
"/static/tca-analysis/tca-analysis-fd1fb808.css"
"/static/tca-analysis/tca-analysis-80623df4.css"
]
},
{
Expand Down