Merge branch 'gitlink_server' of https://gitlink.org.cn/Gitlink/forgeplus-react into feature_wiki

This commit is contained in:
谢思 2023-03-16 11:24:42 +08:00
commit 2a9c8d27fb
12 changed files with 48 additions and 30 deletions

View File

@ -44,6 +44,7 @@ function AllMenus({owner,projectsId,chooseFunc,update,defaultNames,defaultIds,op
useEffect(()=>{
if(defaultIds){
console.log("defaule:",defaultIds);
setIds(defaultIds);
}
},[defaultIds])

View File

@ -200,7 +200,7 @@ function IssueCommentList(props){
</div>
{login && <div>
{/* 平台管理员/仓库管理员/发布评论者/回复评论者/issue创建者 */}
{(admin || isManager || login === i.user.login || login === i.reply_user.login || user_id === author.id) && <Popconfirm
{(admin || isManager || login === i.user.login || (i.reply_user && login === i.reply_user.login) || user_id === author.id) && <Popconfirm
placement="bottom"
title={"确定要删除当前回复吗?"}
okText="是"

View File

@ -22,7 +22,6 @@ function Menus({name, ids , lists , size , imgControl , searchFunc , chooseFunc
useEffect(()=>{
setChooseValue(ids);
console.log(ids);
setShowValue(names);
},[ids,names])
@ -44,7 +43,6 @@ function Menus({name, ids , lists , size , imgControl , searchFunc , chooseFunc
setChooseValue(l);
setShowValue(nameArr.join(","));
chooseFunc(l,nameArr.join(","));
console.log("choosed:",l);
}else{
if(l && l.indexOf(id)>=0){
setChooseValue([]);

View File

@ -63,6 +63,7 @@ function List(props){
useEffect(()=>{
const datas = cookie.load('issuestates');
let states = datas === "undefined" ? undefined : datas;
console.log(states);
if(states){
setAboutMe(states.participant_category);
setCategory(states.category);
@ -72,8 +73,8 @@ function List(props){
setNames(states.names);
setBegin(states.begin_date);
setEnd(states.end_date);
if(states.participant_category ==="all" && states.category === "opened" && states.page === 1 && states.limit===defaultLimit)
Init({...states},states.page,states.names);
// if(states.participant_category ==="all" && states.category === "opened" && states.page === 1 && states.limit===defaultLimit)
// Init({...states},states.page,states.names);
}else{
Init();
}
@ -102,7 +103,7 @@ function List(props){
}
// 使hook
useUpdateEffect(handleAllDisabled, [aboutMe,keyword,category,limit,begin_date,end_date]);
useUpdateEffect(handleAllDisabled, [aboutMe,keyword,category,limit,end_date,updateIds]);
function getDirection(id){
@ -128,6 +129,7 @@ function List(props){
// issue
function Init(params,p,names){
setTotal(undefined);
const datas = cookie.load('issuestates');
let states = datas === "undefined" ? undefined : datas;
if(states){
@ -144,7 +146,7 @@ function List(props){
limit,
begin_date,end_date,
sort_direction:getDirection(params && params.sort_by),
sort_by:getBy(params && params.sort_by),
sort_by:getBy(params && params.sort_by),names:undefined
}
}).then(result=>{
if(result){
@ -179,7 +181,7 @@ function List(props){
)
function chooseAboutMe(e){
setPage(1);
setCategory("opened");
// setCategory("opened");
setAboutMe(e.key);
}
@ -188,14 +190,16 @@ function List(props){
setKeyword(undefined);
setAboutMe("all");
setCategory("opened");
setTotal(undefined);
setUpdateIds(undefined);
setAllValue([]);
setPage(1);
setValue(undefined);
setNames(undefined);
setEnd(undefined);
setBegin(undefined);
(!value || begin_date || end_date ) && Init();
// if(!value){
// Init();
// }
//
menuRef.current && menuRef.current.clearChoose();
}
@ -288,9 +292,14 @@ function List(props){
// setUpdateIds(ids);
setUpdateChooseIds(ids);
}else{
if(ids.status_id === "5"){
setCategory("closed");
}else{
setCategory("opened");
}
setUpdateIds(ids);
setTotal(undefined);
Init(ids,1,n);
// Init(ids,1,n);
}
}
@ -300,6 +309,19 @@ function List(props){
}
function changeCategory(value){
if(value !== category){
let ids = {...updateIds};
let ns = {...names};
if(value === "closed"){
ns = {...ns,status_name:"关闭"}
ids = {...ids,status_id:'5'};
setNames(ns)
setUpdateIds(ids);
}else{
ns = {...ns,status_name:undefined}
ids = {...ids,status_id:undefined};
setNames(ns)
setUpdateIds(ids);
}
setCategory(value);
setPage(1);
setTotal(undefined);
@ -316,8 +338,8 @@ function List(props){
//
function changeBeginTime(data, value){
setPage(1);
setBegin(value[0] || undefined);
setEnd(value[1] || undefined);
setBegin(value[0] || '');
setEnd(value[1] || '');
}
return(
<div>
@ -348,14 +370,7 @@ function List(props){
}
</div>
<div>
<RangePicker onChange={changeBeginTime} style={{width:240,marginRight:20}}/>
{/* <DatePicker
value={begin_date ? moment(begin_date, 'YYYY-MM-DD') : ""}
style={{ marginRight: "20px",width:125 }}
placeholder="选择开始时间"
onChange={changeBeginTime}
/>
<DatePicker style={{ marginRight: "20px",width:125 }} value={end_date ? moment(end_date, 'YYYY-MM-DD') : ""} placeholder="选择结束时间" onChange={changeEndTime} /> */}
<RangePicker value={[begin_date ? moment(begin_date, 'YYYY-MM-DD') : "",end_date ? moment(end_date, 'YYYY-MM-DD') : ""]} onChange={changeBeginTime} style={{width:240,marginRight:20}}/>
{
permission && permission !== "Reporter" &&
<Link to={`/${owner}/${projectsId}/issues/sign`} className="dorpdownButton"><img src={bj} alt="" className="mr5" />标记管理</Link>

View File

@ -122,7 +122,7 @@ function DispositionDetail(props){
<div className="ml40 font-16">
<div className="font-22"><a href={`/softbot/${id}`}>{botDetail && botDetail.market_name}</a></div>
<a className="mr30 color88" href={`/${botDetail.register_login}`}>{botDetail && botDetail.register_name}</a>
<span className="color88">{botDetail && botDetail.create_time && moment(botDetail.create_time).format('YYYY-MM-DD hh:mm:ss')}</span>
<span className="color88">{botDetail && botDetail.create_time}</span>
</div>
</div>}
<Button style={{width: '53px', padding: '0'}} className="grayBorBut"><Link to={`/settings/dispositionBot`}>返回</Link></Button>

View File

@ -15,6 +15,7 @@ function DispositionBot(props){
const [reload, setReload] = useState(undefined);
useEffect(()=>{
window.scrollTo(0,0);
document.title='Bot安装';
}, [])

View File

@ -149,6 +149,9 @@ function AdvancedInformation(props){
setVisibleDelete(false);
message.success("更改成功");
setReload(Math.random());
}else{
setVisibleDelete(false);
message.error(res.message);
}
})
}

View File

@ -54,8 +54,7 @@ function BasicInformation(props){
const params = {
...botDetail,
...fieldsValue,
bot_id: parseInt(id),
logo: imageId ? '/api/attachments/'+imageId : '/api/attachments/347246'
bot_id: parseInt(id)
}
registerUpdateBot(params).then(res=>{
if(res && res.code === 200){

View File

@ -16,6 +16,7 @@ function ExploitBot(props){
const [reload, setReload] = useState(undefined);
useEffect(()=>{
window.scrollTo(0,0);
document.title='我的Bot';
}, [])

View File

@ -92,7 +92,7 @@ function Disposition(props){
return <div className="createExploitBox">
<div className="ceHead pb5 font-16 mb10">
<Link to={`/settings/exploitBot`} className="blue-Purple">开发Bot</Link><span className="ceTitle font-18"><i className="iconfont icon-youjiantou ml5 mr5 font-12"></i>注册新的Bot</span>
<Link to={`/settings/exploitBot`} className="blue-Purple">我的Bot</Link><span className="ceTitle font-18"><i className="iconfont icon-youjiantou ml5 mr5 font-12"></i>注册新的Bot</span>
</div>
<Form className="createExploitForm" onSubmit={submit}>
<Form.Item label="Bot名称" className="width50 botItem">

View File

@ -278,7 +278,7 @@ ul.ant-menu.menuStyle{
.infosRightMenu{
.ant-menu-item{
padding:0px;
margin:0px 17px 0px 0px !important;
margin:0px 30px 0px 0px !important;
font-size: 17px;
height: 32px;
line-height: 0px;

View File

@ -397,11 +397,11 @@ class Infos extends Component {
</Menu.Item>
:""
}
{
{/* {
current_user && current_user.login && current_user.login === username ?
<Menu.Item key="4"><Link to={`/${user && user.login}/devops/CIService`}><i className="iconfont icon-gongzuoliu1"></i>DevOps</Link></Menu.Item>
:""
}
} */}
<Menu.Item key="5">
<Link to={`/${user && user.login}/organizes`}>
<i className="iconfont icon-zuzhi"></i>
@ -434,7 +434,7 @@ class Infos extends Component {
return <FanUser {...this.props} {...this.state} userType="fan_users" fetchUser={this.fetchUser}/>;
}}
></Route>
<Route
{/* <Route
path="/:username/devops/CDService"
render={() => {
return <InfosDevOpsCD {...this.props} {...this.state} />;
@ -445,7 +445,7 @@ class Infos extends Component {
render={() => {
return <InfosDevOps {...this.props} {...this.state} />;
}}
></Route>
></Route> */}
<Route
path="/:username/projects" // /:project_type
render={() => {