From 23b423a32d3c48a91319b8195b529b7fc4f4e39c Mon Sep 17 00:00:00 2001 From: caishi Date: Fri, 17 Sep 2021 09:34:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E9=95=9C=E5=83=8F?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=BA=8B=E4=BB=B6=EF=BC=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=92=8C=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=9A=84=E5=8F=AF=E9=80=89=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Main/Detail.js | 23 +++++++++++++++++------ src/forge/Merge/merge_form.js | 6 +++--- src/forge/Settings/Setting.js | 14 ++++++++------ src/forge/comments/comments.js | 2 +- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js index 560420a6..a1a74149 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -255,7 +255,11 @@ class Detail extends Component { open_devops: flag }) } - canvasChannel = () => { + /** + * + * @param {*} deleteFlag :同步镜像需要提示成功,且未成功的情况下不需要删除项目 + */ + canvasChannel = (deleteFlag) => { const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname; const actioncable = require("actioncable"); var project = this.state.project; @@ -272,10 +276,15 @@ class Detail extends Component { console.log(`###### ---received data--- ######`); console.log(data); if (data) { - if ( data.project && data.project.mirror_status === 2) { - this.deleteProjectBack(); + if(deleteFlag){ + this.props.showNotification("镜像同步成功!"); + window.location.reload(); + }else{ + if (data.project && data.project.mirror_status === 2) { + this.deleteProjectBack(); + } + this.getDetail(); } - this.getDetail(); this.setState({ firstSync: false, secondSync: false @@ -428,8 +437,10 @@ class Detail extends Component { const url = `/${owner}/${projectsId}/sync_mirror.json`; axios.post(url).then(result => { if (result && result.data && result.data.status === 0) { - this.props.showNotification("镜像同步成功!"); - this.getProject(2); + this.setState({ + secondSync:true + }) + this.canvasChannel(true); } else { this.props.showNotification("镜像同步失败!"); } diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js index f7cb57c5..5df9794b 100644 --- a/src/forge/Merge/merge_form.js +++ b/src/forge/Merge/merge_form.js @@ -301,7 +301,7 @@ class MergeForm extends Component { initialValue: assigned_to_id, })( )} @@ -316,7 +316,7 @@ class MergeForm extends Component { } showSearch > - {/* */} + {this.renderSelect(issue_versions)} )} @@ -331,7 +331,7 @@ class MergeForm extends Component { } showSearch > - {/* */} + {this.renderSelect(issue_tags)} )} diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js index 413152e5..d6d3cdc6 100644 --- a/src/forge/Settings/Setting.js +++ b/src/forge/Settings/Setting.js @@ -262,7 +262,7 @@ class Setting extends Component { message: "请输入项目名称", }, ], - })()} + })()}
可见性 @@ -298,7 +298,8 @@ class Setting extends Component { rules: [], })( )} @@ -306,10 +307,11 @@ class Setting extends Component { {getFieldDecorator("project_language_id", { rules: [], })( - - )} + + )} {getFieldDecorator("project_units", { diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index 228f57ca..c27bb12a 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -198,7 +198,7 @@ class comments extends Component { {item.value && item.value.length > 0 ? ( - (item.detail === "标签" || item.detail === "标记") ? ( + item.detail === "标记"? ( Date: Fri, 17 Sep 2021 14:59:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B0=8F=E9=93=83?= =?UTF-8?q?=E9=93=9Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/forge/Head/NoticeContent.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/forge/Head/NoticeContent.jsx b/src/forge/Head/NoticeContent.jsx index 6b6384ec..8f0fe4a4 100644 --- a/src/forge/Head/NoticeContent.jsx +++ b/src/forge/Head/NoticeContent.jsx @@ -27,6 +27,11 @@ function NoticeContent({ visible, showNotification, resetUserInfo, current_user: resetUserInfo(); }, [noticeUnreadCount,atUnreadCount]); + useEffect(()=>{ + setNoticePage(0); + setAtPage(0); + },[visible]) + useEffect(() => { const params = { type: noticeType,