This commit is contained in:
caishi 2021-02-02 09:49:03 +08:00
parent ea77a13b6f
commit c71d8512df
3 changed files with 10 additions and 10 deletions

View File

@ -73,20 +73,18 @@ function Dispose(props){
let eventA = event.split(","); let eventA = event.split(",");
let l = {pipeline_name,id,branch,event:eventA} let l = {pipeline_name,id,branch,event:eventA}
setUpdateInfo(l); setUpdateInfo(l);
}else{
setUpdateInfo(undefined);
} }
} }
function onOk(pipeline_name,updateId,branch,event){ function onOk(pipeline_name,updateId,branch,event){
if(pipeline_name){ if(pipeline_name){
let eventStr = ""; let eventStr = "";
if(event.indexOf(",")>-1){ for(var i = 0;i<event.length;i++){
for(var i = 0;i<event.length;i++){ eventStr +=event[i]+",";
eventStr +=event[i]+",";
}
eventStr = eventStr.substring(0,eventStr.length-1);
}else{
eventStr = event;
} }
eventStr = eventStr.substring(0,eventStr.length-1);
if(!updateId){ if(!updateId){
// //
const url = `/ci/pipelines.json`; const url = `/ci/pipelines.json`;
@ -136,7 +134,7 @@ function Dispose(props){
// //
function toModalManage(){ function toModalManage(){
props.history.push(`/projects/cxt/DevOps-mo/devops/mould`); props.history.push(`/projects/${owner}/${projectsId}/devops/mould`);
} }
const operate = current_user && (permission && permission !== "Reporter"); const operate = current_user && (permission && permission !== "Reporter");

View File

@ -6,7 +6,7 @@ const EVENT = ["push","pull_request","tag","cron","custom","promote","rollback"]
function PipelineName({visible,onCancel,onOk,value ,branchList}){ function PipelineName({visible,onCancel,onOk,value ,branchList}){
const [ name , setName ] = useState(undefined); const [ name , setName ] = useState(undefined);
const [ branchValue , setBranchValue ] = useState(undefined); const [ branchValue , setBranchValue ] = useState(undefined);
const [ eventValue , setEventValue ] = useState(EVENT[0]); const [ eventValue , setEventValue ] = useState([EVENT[0]]);
useEffect(()=>{ useEffect(()=>{
if(branchList && branchList.length>0){ if(branchList && branchList.length>0){
@ -19,6 +19,8 @@ function PipelineName({visible,onCancel,onOk,value ,branchList}){
setName(value.pipeline_name); setName(value.pipeline_name);
setBranchValue(value.branch); setBranchValue(value.branch);
setEventValue(value.event); setEventValue(value.event);
}else{
setName(undefined);
} }
},[value]) },[value])

View File

@ -62,7 +62,7 @@ function CIList(props){
return( return(
<li key={key}> <li key={key}>
<span> <span>
<Link to={`/projects/${item.author && item.author.login}/${item.identifier}${ item.open_devops ? "/devops/list":""}`}>{item.name}</Link> <Link to={`/projects/${item.author && item.author.login}/${item.identifier}${ item.open_devops ? "/devops/dispose":""}`}>{item.name}</Link>
{ item.open_devops ? { item.open_devops ?
<span className="authTag green ml20">已激活</span> <span className="authTag green ml20">已激活</span>
: :