@@ -84,10 +115,10 @@ export default (props) => {
defaultSize="40%"
>
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index ceaba628..6d59fdf9 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -134,6 +134,8 @@ function checkPathname(pathname){
name="activity"
}else if(pathname.indexOf("/setting")>-1){
name="setting"
+ }else if(pathname.indexOf("/devops")>-1){
+ name="devops"
}
}
return name;
@@ -159,6 +161,7 @@ class Detail extends Component {
project: null,
firstSync:false,
secondSync:false,
+ open_devops:false,
}
}
@@ -180,8 +183,21 @@ class Detail extends Component {
axios.get(url).then((result) => {
if (result && result.data) {
this.setState({
- project: result.data
+ project: result.data,
+ open_devops:result.data.open_devops
})
+
+ // 工作流:两种状态进入的链接不同
+ const pathname = this.props.history.location.pathname;
+ let p = checkPathname(pathname);
+ if(p==="devops"){
+ if(result.data.open_devops && pathname === `/projects/${owner}/${projectsId}/devops`){
+ this.props.history.push(`/projects/${owner}/${projectsId}/devops/list`);
+ }else if(result.data.open_devops===false && pathname !== `/projects/${owner}/${projectsId}/devops`){
+ this.props.history.push(`/projects/${owner}/${projectsId}/devops`);
+ }
+ }
+
if (result.data.type !== 0 && result.data.mirror_status === 1) {
console.log("--------start channel --------");
// 是镜像项目,且未完成迁移
@@ -207,6 +223,13 @@ class Detail extends Component {
}
})
}
+
+ // 工作流激活后修改状态
+ changeOpenDevops=(flag)=>{
+ this.setState({
+ open_devops:flag
+ })
+ }
canvasChannel = () => {
const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
const actioncable = require("actioncable");
@@ -234,7 +257,7 @@ class Detail extends Component {
const { projectsId , owner } = this.props.match.params;
const url = `/${owner}/${projectsId}.json`;
axios.get(url).then((result) => {
- if (result) {
+ if (result && result.data) {
this.setState({
projectDetail: result.data,
project_id: result.data.project_id,
@@ -337,7 +360,11 @@ class Detail extends Component {
render() {
- const { projectDetail, watchers_count, praises_count, forked_count, firstSync , secondSync , isManager, watched, praised, project } = this.state;
+ const { projectDetail, watchers_count, praises_count,
+ forked_count, firstSync , secondSync ,
+ isManager, watched, praised,
+ project , open_devops } = this.state;
+
const url = this.props.history.location.pathname;
const urlArr = url.split("/");
const urlFlag = (urlArr.length === 3);
@@ -361,7 +388,8 @@ class Detail extends Component {
const common = {
- getDetail: this.getDetail
+ getDetail: this.getDetail,
+ changeOpenDevops:this.changeOpenDevops
}
return (
@@ -391,10 +419,11 @@ class Detail extends Component {
projectDetail.type === 2 ?
- :
+
+ :
-
-
+
+
:""
}
@@ -458,12 +487,12 @@ class Detail extends Component {
}
- {/*
-1 ? "active" : ""}>
-
+
+
工作流
{projectDetail && projectDetail.ops_count ? {projectDetail.ops_count} : ""}
- */}
+
里程碑
@@ -494,7 +523,7 @@ class Detail extends Component {
{/* 工作流 */}
- ()
}