修改其他路由及修改issue

This commit is contained in:
何童崇 2021-09-03 09:23:12 +08:00
parent 4f39f03b19
commit 24c4c746cd
36 changed files with 117 additions and 133 deletions

View File

@ -251,7 +251,7 @@ class App extends Component {
};
render() {
const { mygetHelmetapi, pathType } = this.state;
const { mygetHelmetapi, pathType} = this.state;
let personal = mygetHelmetapi && mygetHelmetapi.personal;
return (
<Provider store={store}>
@ -308,9 +308,6 @@ class App extends Component {
<Route exact path="/explore"
render={
(props) => (
personal && personal.length > 0 ?
<InfosIndex {...this.props} {...props} />
:
<ProjectIndex {...this.props} {...props} />
)
}
@ -341,7 +338,7 @@ class App extends Component {
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
}
}>
</Route> : pathType === '404' ? <Route path="/nopage" component={Shixunnopage} /> :
</Route> : pathType === '404' ? <Route path="/" component={Shixunnopage} /> :
<Route exact path="/"
render={
(props) => (

View File

@ -21,7 +21,7 @@ class ActivityItem extends Component {
// 如果是任务
item.trend_type === "Issue" ?
<p className="itemLine">
<Link to={`/${owner}/${projectsId}/issues/${item.trend_id}/detail`} className="color-blue font-16">{item.name}</Link>
<Link to={`/${owner}/${projectsId}/issues/${item.trend_id}`} className="color-blue font-16">{item.name}</Link>
<span className="activity_type">{item.trend_type}</span>
</p >
:

View File

@ -149,7 +149,7 @@ function About(props, ref) {
axios.post(url).then(result=>{
setIsSpining(false);
if(result && result.data.status === 0){
props.history.push(`/${owner}/${projectsId}/devops/dispose`);
props.history.push(`/${owner}/${projectsId}/devops`);
// open_devops
let { changeOpenDevops } = props;
changeOpenDevops && changeOpenDevops(true);

View File

@ -96,7 +96,7 @@ function Dispose(props){
setVisible(false);
if(result && result.data){
props.showNotification("流水线新增成功,请进行工作流配置!");
props.history.push(`/${owner}/${projectsId}/devops/dispose/${result.data.id}`);
props.history.push(`/${owner}/${projectsId}/devops/${result.data.id}`);
}else{
props.showNotification("流水线新增失败,请稍后再试!");
}

View File

@ -117,7 +117,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
return(
<span>
{ operate ?
<Link to={`/${owner}/${projectsId}/devops/dispose/${item.id}`} className="mr10 color-grey-6">
<Link to={`/${owner}/${projectsId}/devops/${item.id}`} className="mr10 color-grey-6">
<i className="iconfont icon-zaibianji font-13 mr3"></i>编辑</Link> :""
}
{ operate ?

View File

@ -36,11 +36,7 @@ export default ((props)=>{
return(
<WhiteBack className="opsPanel">
<Switch {...props}>
<Route path="/:owner/:projectsId/devops/dispose/:disposeId"
render={
(p) => (<New {...props} {...p}/>)
}
></Route>
<Route path="/:owner/:projectsId/devops/params"
render={
(p) => (<Params {...props} {...p}/>)
@ -51,24 +47,26 @@ export default ((props)=>{
(p) => (<Mould {...props} {...p}/>)
}
></Route>
<Route path="/:owner/:projectsId/devops/dispose/new"
<Route path="/:owner/:projectsId/devops/new"
render={
(p) => (<New {...props} {...p}/>)
}
></Route>
<Route path="/:owner/:projectsId/devops/dispose"
render={
(p) => (<Dispose {...props} {...p}/>)
}
></Route>
<Route path="/:owner/:projectsId/devops/list/:branch"
render={
(p) => (<Stucture {...props} {...p}/>)
}
></Route>
<Route path="/:owner/:projectsId/devops/:disposeId"
render={
(p) => (<New {...props} {...p}/>)
}
></Route>
{/* 原本的两种合为一个 */}
<Route path="/:owner/:projectsId/devops"
render={
(p) => (<About {...props} {...p}/>)
(p) =>{return( p.location.state.open_devops?<Dispose {...props} {...p}/>:<About {...props} {...p}/>)}
}
></Route>
</Switch>

View File

@ -26,7 +26,7 @@ export default ((props)=>{
return(
<div className="disposePanel">
<Banner>
{ permission !=="Reporter" && <Link to={`/${owner}/${props.match.params.projectsId}/devops/dispose`}>工作流配置</Link>}
{ permission !=="Reporter" && <Link to={`/${owner}/${props.match.params.projectsId}/devops`}>工作流配置</Link>}
</Banner>
<Div>
<Dispost {...props}/>

View File

@ -104,7 +104,7 @@ function Params(props){
<Banner>
<FlexAJ>
<span className="font-18">工作流 - 参数管理</span>
<Link to={`/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9 ml20">返回</Link>
<Link to={`/${owner}/${projectsId}/devops`} className="font-14 color-grey-9 ml20">返回</Link>
</FlexAJ>
</Banner>
<Div className="disposeList">

View File

@ -126,7 +126,7 @@ function Mould(props){
<div>
<New wrappedComponentRef={(f) => childRef.current = f} ref={childRef} visible={visible} onCancel={()=>setVisible(false)} onOk={onOk}></New>
<Banner>
<FlexAJ><span>工作流 - 模板管理</span><Link to={`/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9">返回</Link></FlexAJ>
<FlexAJ><span>工作流 - 模板管理</span><Link to={`/${owner}/${projectsId}/devops`} className="font-14 color-grey-9">返回</Link></FlexAJ>
</Banner>
<Div className="disposeList">
<FlexAJ>

View File

@ -290,7 +290,7 @@ function Structure(props,ref){
<Banner>
<FlexAJ>
<span>构建列表</span>
<Link to={`/${owner}/${projectsId}/devops/dispose`} className="font-15 color-grey-9">返回</Link>
<Link to={`/${owner}/${projectsId}/devops`} className="font-15 color-grey-9">返回</Link>
</FlexAJ>
</Banner>
<Div>

View File

@ -275,7 +275,7 @@ function disposePipeline(props){
...params
}).then(result=>{
if(result){
props.history.push(`/${owner}/${projectsId}/devops/dispose`);
props.history.push(`/${owner}/${projectsId}/devops`);
}
setLoading(false);
}).catch(error=>{

View File

@ -87,7 +87,7 @@ export default (props) => {
</AlignCenter>
<Link
style={{ color: "#ddd" }}
to={`/${owner}/${projectId}/devops/dispose`}
to={`/${owner}/${projectId}/devops`}
>
<i className="iconfont icon-yiguanbi font-15 mr5"></i>退出
</Link>

View File

@ -14,7 +14,7 @@ import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfComme
//404页面
const Shixunnopage = Loadable({
loader: () => import('./modules/404/Shixunnopage'),
loader: () => import('../modules/404/Shixunnopage'),
loading: Loading,
})
const ProjectNew = Loadable({
@ -42,6 +42,7 @@ class Index extends Component {
})
}
render() {
return (
<div className="newMain clearfix">
<Switch {...this.props}>
@ -75,7 +76,7 @@ class Index extends Component {
<ProjectIndex {...this.props} {...props} />
)}
></Route>
<Route path="/projects" component={Shixunnopage} />
<Route
path="/"
render={(props) => (

View File

@ -352,7 +352,7 @@ function CoderDepot(props){
</Link>
</AlignCenter>
<AlignCenter className="mr20">
<Link to={`/${owner}/${projectsId}/tag`} className="color-grey-9">
<Link to={`/${owner}/${projectsId}/tags`} className="color-grey-9">
<i className="iconfont icon-biaoqian3 font-16 color-grey-9 mr3"></i>
<span className="color-grey-6 mr3">{projectDetail && projectDetail.tags && projectDetail.tags.total_count}</span>标签
</Link>

View File

@ -132,7 +132,7 @@ class CoderRootIndex extends Component{
() => (<CoderRootVersion {...this.props} {...this.state} />)
}
></Route>
<Route path="/:owner/:projectsId/tag"
<Route path="/:owner/:projectsId/tags"
render={
() => (<CoderRootTag {...this.props} {...this.state} />)
}

View File

@ -153,8 +153,8 @@ function checkPathname(projectsId, owner, pathname) {
name = "milestones"
} else if (url.indexOf("/activity") > -1) {
name = "activity"
} else if (url.indexOf("/setting") > -1) {
name = "setting"
} else if (url.indexOf("/settings") > -1) {
name = "settings"
} else if (url.indexOf(`/devops`) > -1) {
name = "devops"
} else if (url.indexOf(`/source`) > -1) {
@ -625,17 +625,12 @@ class Detail extends Component {
}
></Route>
{/* 仓库设置 */}
<Route path="/:owner/:projectsId/setting"
<Route path="/:owner/:projectsId/settings"
render={
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 任务详情 */}
<Route path="/:owner/:projectsId/issues/:orderId/detail"
render={
(props) => (<OrderDetail {...this.props} {...this.state} {...props} {...common} />)
}
></Route>
{/*修改里程碑*/}
<Route path="/:owner/:projectsId/milestones/:meilid/edit"
render={
@ -683,6 +678,12 @@ class Detail extends Component {
render={
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 任务详情 */}
<Route path="/:owner/:projectsId/issues/:orderId"
render={
(props) => (<OrderDetail {...this.props} {...this.state} {...props} {...common} />)
}
></Route>
{/* 动态 */}
<Route path="/:owner/:projectsId/activity"

View File

@ -20,7 +20,7 @@ class DetailTop extends Component {
<i className="iconfont icon-fenzhi1 font-18 mr3"></i>
<span>{(coderCount && coderCount.branches_count) || 0}</span>
</Link>
<Link to={`/${owner}/${projectsId}/tag`} className={pathname.indexOf("/tag") > 0 ? "active" : ""}>
<Link to={`/${owner}/${projectsId}/tags`} className={pathname.indexOf("/tags") > 0 ? "active" : ""}>
<i className="iconfont icon-biaoqian3 font-18 mr3"></i>
<span>{(coderCount && coderCount.tags_count) || 0}</span>
</Link>

View File

@ -16,6 +16,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
setMenuName(list);
}
},[list]);
console.log('open_devops:'+open_devops)
return(
<div className="f-wrap-between mt15">
{
@ -77,7 +78,8 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
{
item.menu_name === "devops" && platform ?
<li className={pathname==="devops" ? "active" : ""}>
<Link to={{ pathname: `/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}>
{/* <Link to={{ pathname: `/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}> */}
<Link to={{ pathname: `/${owner}/${projectsId}/devops`, state:{...state,open_devops} }}>
<i className="iconfont icon-gongzuoliu font-13 mr8"></i>工作流(beta版)
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
</Link>
@ -114,10 +116,10 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
</li>
}
{
item.menu_name === "setting" &&
<li className={pathname === "setting" ? "active" : ""}>
<Link to={`/${owner}/${projectsId}/setting`}>
<i className={url && url.indexOf("/setting") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i>
item.menu_name === "settings" &&
<li className={pathname === "settings" ? "active" : ""}>
<Link to={`/${owner}/${projectsId}/settings`}>
<i className={url && url.indexOf("/settings") > 0 ? "iconfont icon-cangku color-grey-3 mr5 font-14":"iconfont icon-cangku color-grey-6 font-14 mr5"}></i>
<span>仓库设置</span>
</Link>
</li>

View File

@ -51,7 +51,7 @@ class OrderItem extends Component {
{current_user && current_user.login && checkbox}
<div className="flex-1">
<p className="mb10 df" style={{alignItems:"center"}}>
<Link to={`/${owner}/${projectsId}/issues/${item.id}/detail`} target="_blank" title={item.name} className="hide-1 font-16 color-grey-3 lineh-30 mr10" style={{maxWidth:"370px"}}>{item.name}</Link>
<Link to={`/${owner}/${projectsId}/issues/${item.id}`} target="_blank" title={item.name} className="hide-1 font-16 color-grey-3 lineh-30 mr10" style={{maxWidth:"370px"}}>{item.name}</Link>
{TagInfo(item.priority,"mr10")}
</p>
<p className="color-grey-6 font-12">

View File

@ -165,7 +165,7 @@ class order_form extends Component {
}).then((result) => {
if (result && result.data.id) {
this.props.showNotification("任务创建成功!");
this.props.history.push(`/${owner}/${projectsId}/issues/${result.data.id}/detail`);
this.props.history.push(`/${owner}/${projectsId}/issues/${result.data.id}`);
this.setState({
description: "",
isSpin: false,
@ -191,7 +191,7 @@ class order_form extends Component {
...values,
}).then((result) => {
if (result) {
this.props.history.push(`/${owner}/${projectsId}/issues/${orderId}/detail`);
this.props.history.push(`/${owner}/${projectsId}/issues/${orderId}`);
this.props.showNotification("任务更新成功!");
const { getDetail } = this.props;
getDetail && getDetail();
@ -371,7 +371,7 @@ class order_form extends Component {
type="default"
className="ml30"
onClick={()=>
this.props.history.push(form_type === "new" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}/detail`)}
this.props.history.push(form_type === "new" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}`)}
>
<span className="plr10">取消</span>
</Button>

View File

@ -88,7 +88,7 @@ export default ((props)=>{
// 跳转
function settingRule(protectBranch){
props.history.push(`/${owner}/${projectsId}/setting/branch/${protectBranch}`);
props.history.push(`/${owner}/${projectsId}/settings/branch/${protectBranch}`);
}
// 翻页

View File

@ -290,7 +290,7 @@ export default Form.create()(
<Cancel
className="ml30"
onClick={() => {
history.push(`/${owner}/${projectsId}/setting/branch`);
history.push(`/${owner}/${projectsId}/settings/branch`);
}}
>
取消

View File

@ -78,7 +78,7 @@ function CollaboratorGroup({ newGroupId, owner, projectsId , setAddOperation })
dataIndex: "name",
render: (value, item) => {
if(item.is_admin || item.is_member){
return <Link to={`/${owner}/group/${item.id}`}>{value}</Link>;
return <Link to={`/${owner}/teams/${item.id}`}>{value}</Link>;
}else{
return <span>{value}</span>;
}

View File

@ -49,25 +49,25 @@ class Index extends Component {
const { projectsId , owner } = this.props.match.params;
const { pathname } = this.props.history.location;
const flag = pathname === `/${owner}/${projectsId}/setting`;
const flag = pathname === `/${owner}/${projectsId}/settings`;
return (
<Box className="ProjectListIndex">
<Short>
<ul className="list-l-Menu">
<li className={flag ? "active" : ""}>
<p>
<Link to={`/${owner}/${projectsId}/setting`} className="w-100">
<Link to={`/${owner}/${projectsId}/settings`} className="w-100">
<i className="iconfont icon-huabanfuben font-18 mr10"></i>
</Link>
</p>
</li>
<li
className={
pathname.indexOf("setting/collaborator") > -1 ? "active" : ""
pathname.indexOf("settings/collaborator") > -1 ? "active" : ""
}
>
<p>
<Link to={`/${owner}/${projectsId}/setting/collaborator`} className="w-100">
<Link to={`/${owner}/${projectsId}/settings/collaborator`} className="w-100">
<i className="iconfont icon-chengyuan font-18 mr10"></i>
协作者管理
</Link>
@ -75,11 +75,11 @@ class Index extends Component {
</li>
<li
className={
pathname.indexOf("setting/webhooks") > -1 ? "active" : ""
pathname.indexOf("settings/webhooks") > -1 ? "active" : ""
}
>
<p>
<Link to={`/${owner}/${projectsId}/setting/webhooks`} className="w-100">
<Link to={`/${owner}/${projectsId}/settings/webhooks`} className="w-100">
<i className="iconfont icon-a-xuanzhongwebhookicon font-18 mr10 color-grey-9"></i>
Webhooks
</Link>
@ -87,21 +87,21 @@ class Index extends Component {
</li>
<li
className={
pathname.indexOf("setting/branch") > -1 ? "active" : ""
pathname.indexOf("settings/branch") > -1 ? "active" : ""
}
>
<p>
<Link to={`/${owner}/${projectsId}/setting/branch`} className="w-100">
<Link to={`/${owner}/${projectsId}/settings/branch`} className="w-100">
<i className="iconfont icon-fenzhi font-20 mr10"></i>
分支设置
</Link>
</p>
</li>
<li
className={pathname.indexOf("setting/tags") > -1 ? "active" : ""}
className={pathname.indexOf("lables") > -1 ? "active" : ""}
>
<p>
<Link to={`/${owner}/${projectsId}/setting/tags`} className="w-100">
<Link to={`/${owner}/${projectsId}/lables`} className="w-100">
<i className="iconfont icon-biaoqian3 font-18 mr10 color-grey-6"></i>
项目标签
</Link>
@ -110,7 +110,7 @@ class Index extends Component {
{/* <li
className={
pathname.indexOf("setting/manage") > -1 ? "active" : ""
pathname.indexOf("settings/manage") > -1 ? "active" : ""
}
>
<p>
@ -127,64 +127,64 @@ class Index extends Component {
<Switch {...this.props}>
{/* webhooks */}
<Route
path="/:owner/:projectsId/setting/webhooks/new"
path="/:owner/:projectsId/settings/webhooks/new"
render={(props) => (
<WebhookNew {...this.props} {...props} {...this.state} />
)}
></Route>
<Route
path="/:owner/:projectsId/setting/webhooks/:id"
path="/:owner/:projectsId/settings/webhooks/:id"
render={(props) => (
<WebhookNew {...this.props} {...props} {...this.state} />
)}
></Route>
<Route
path="/:owner/:projectsId/setting/webhooks"
path="/:owner/:projectsId/settings/webhooks"
render={(props) => (
<Webhook {...this.props} {...props} {...this.state} />
)}
></Route>
{/* 协作者 */}
<Route
path="/:owner/:projectsId/setting/collaborator"
path="/:owner/:projectsId/settings/collaborator"
render={(props) => (
<Collaborator {...this.props} {...props} {...this.state} />
)}
></Route>
{/* 修改仓库信息 */}
<Route
path="/:owner/:projectsId/setting/tags"
path="/:owner/:projectsId/lables"
render={(props) => (
<Tags {...this.props} {...props} {...this.state} />
)}
></Route>
<Route
path="/:owner/:projectsId/setting/branch/:branch"
path="/:owner/:projectsId/settings/branch/:branch"
render={(props) => (
<BranchNew {...this.props} {...props} {...this.state} />
)}
></Route>
<Route
path="/:owner/:projectsId/setting/branch"
path="/:owner/:projectsId/settings/branch"
render={(props) => (
<Branch {...this.props} {...props } {...this.state} />
)}
></Route>
<Route
path="/:owner/:projectsId/setting/manage/new"
path="/:owner/:projectsId/settings/manage/new"
render={(props) => (
<ManageNew {...this.props} {...props} {...this.state} />
)}
></Route>
<Route
path="/:owner/:projectsId/setting/manage"
path="/:owner/:projectsId/settings/manage"
render={(props) => (
<Manage {...this.props} {...props} {...this.state} />
)}
></Route>
{/* 修改仓库信息 */}
<Route
path="/:owner/:projectsId/setting"
path="/:owner/:projectsId/settings"
render={(props) => (
<Setting {...this.props} {...props} {...this.state} />
)}

View File

@ -62,7 +62,7 @@ function Index(props) {
if(total >= 20){
return props.showNotification("webhooks数量已到上限请删除暂不使用的webhooks以进行添加操作");
}
props.history.push(`/${owner}/${projectsId}/setting/webhooks/new`)
props.history.push(`/${owner}/${projectsId}/settings/webhooks/new`)
}
return(
@ -90,9 +90,9 @@ function Index(props) {
return(
<List.Item key={k}>
<i className="iconfont icon-a-xuanzhongwebhookicon color-grey-d mr12 font-17"></i>
<Link to={`/${owner}/${projectsId}/setting/webhooks/${i.id}`} className="webName">{i.url}</Link>
<Link to={`/${owner}/${projectsId}/settings/webhooks/${i.id}`} className="webName">{i.url}</Link>
<span>
<Button ghost type={"primary"} onClick={()=>{props.history.push(`/${owner}/${projectsId}/setting/webhooks/${i.id}`)}}>编辑</Button>
<Button ghost type={"primary"} onClick={()=>{props.history.push(`/${owner}/${projectsId}/settings/webhooks/${i.id}`)}}>编辑</Button>
<Button ghost className="ml20" type="danger" onClick={()=>{deleteFunc(i.id,i.url)}}>删除</Button>
</span>
</List.Item>

View File

@ -111,7 +111,7 @@ function New({ form , match , showNotification , history }) {
}).then(result=>{
if(result){
showNotification("webhook更新成功");
history.push(`/${owner}/${projectsId}/setting/webhooks`);
history.push(`/${owner}/${projectsId}/settings/webhooks`);
}
}).catch(error=>{})
}else{
@ -125,7 +125,7 @@ function New({ form , match , showNotification , history }) {
}).then(result=>{
if(result && result.data && result.data.id){
showNotification("webhook新建成功");
history.push(`/${owner}/${projectsId}/setting/webhooks`);
history.push(`/${owner}/${projectsId}/settings/webhooks`);
}
}).catch(error=>{})
}
@ -157,7 +157,7 @@ function New({ form , match , showNotification , history }) {
axios.delete(url).then(result=>{
if(result){
showNotification("webhook删除成功");
history.push(`/${owner}/${projectsId}/setting/webhooks`);
history.push(`/${owner}/${projectsId}/settings/webhooks`);
}
}).catch(error=>{})
}
@ -180,7 +180,7 @@ function New({ form , match , showNotification , history }) {
subTitle={`删除后未来事件将不会推送至此Webhook地址${data && data.url}`}
/>
<Banner>
<Link to={`/${owner}/${projectsId}/setting/webhooks`} className="color-blue">Webhooks</Link>
<Link to={`/${owner}/${projectsId}/settings/webhooks`} className="color-blue">Webhooks</Link>
<i className="iconfont icon-youjiantou ml5 mr5 font-12"></i>
<span>{id ? "更新" : "添加"}Webhook</span>
</Banner>

View File

@ -26,18 +26,18 @@ export default (props)=>{
function returnActive (pathname){
let a = 0;
if(pathname === `/${OIdentifier}/group/${groupId}/setting/member`){
if(pathname === `/${OIdentifier}/teams/${groupId}/setting/member`){
a = 1;
}else if(pathname === `/${OIdentifier}/group/${groupId}/setting/project`){
}else if(pathname === `/${OIdentifier}/teams/${groupId}/setting/project`){
a = 2;
}
return a;
}
const active = returnActive(pathname);
const array = {list:[
{name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/group/${groupId}/setting`},
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/group/${groupId}/setting/member`},
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/group/${groupId}/setting/project`},
{name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/teams/${groupId}/setting`},
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/teams/${groupId}/setting/member`},
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/teams/${groupId}/setting/project`},
],
active
}
@ -51,19 +51,19 @@ export default (props)=>{
<WhiteBack style={{border:'1px solid #eee'}}>
<Switch>
<Route
path="/:OIdentifier/group/:groupId/setting/project"
path="/:OIdentifier/teams/:groupId/setting/project"
render={() => (
<Project {...props} />
)}
></Route>
<Route
path="/:OIdentifier/group/:groupId/setting/member"
path="/:OIdentifier/teams/:groupId/setting/member"
render={() => (
<Member {...props} />
)}
></Route>
<Route
path="/:OIdentifier/group/:groupId/setting"
path="/:OIdentifier/teams/:groupId/setting"
render={() => (
<Common {...props} />
)}

View File

@ -119,7 +119,7 @@ export default ((props) => {
<div className="g-tip">
<p>管理员团队对 <span>所有仓库</span> 具有操作权限且对组织具有 <span>管理员权限</span> </p>
<p>此外该团队拥有了 <span>创建仓库</span> 的权限成员可以在组织中创建新的仓库 </p>
{group.is_admin ? <Button type="primary" onClick={()=>props.history.push(`/${OIdentifier}/group/${groupId}/setting`)}><span className="color-white">团队设置</span></Button> : ""}
{group.is_admin ? <Button type="primary" onClick={()=>props.history.push(`/${OIdentifier}/teams/${groupId}/setting`)}><span className="color-white">团队设置</span></Button> : ""}
</div>
</div>
:

View File

@ -90,7 +90,7 @@ export default Form.create()(
}).then(result => {
if (result && result.data) {
showNotification("基本设置更新成功!");
history.push(`/${OIdentifier}/group/${groupId}`);
history.push(`/${OIdentifier}/teams/${groupId}`);
}
}).catch(error => { })
} else {
@ -101,7 +101,7 @@ export default Form.create()(
}).then(result => {
if (result && result.data) {
showNotification("团队创建成功!");
history.push(`/${OIdentifier}/group/${result.data.id}`);
history.push(`/${OIdentifier}/teams/${result.data.id}`);
}
}).catch(error => { })
}
@ -154,7 +154,7 @@ export default Form.create()(
function cancelEdit(){
if(groupId){
history.push(`/${OIdentifier}/group/${groupId}`);
history.push(`/${OIdentifier}/teams/${groupId}`);
}else{
history.push(`/${OIdentifier}`);
}

View File

@ -38,28 +38,28 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
<Switch>
{/* 组织团队-设置 */}
<Route
path="/:OIdentifier/group/:groupId/setting"
path="/:OIdentifier/teams/:groupId/setting"
render={(p) => {
return <SubDetailIndex {...props} {...p}/>
}}
></Route>
{/* 组织团队-新建 */}
<Route
path="/:OIdentifier/group/new"
path="/:OIdentifier/teams/new"
render={(p) => {
return <GroupNew {...props} {...p}/>
}}
></Route>
{/* 组织团队-子级(包含组织团队列表) */}
<Route
path="/:OIdentifier/group"
path="/:OIdentifier/teams"
render={(p) => {
return <DetailIndex {...props} {...p}/>
}}
></Route>
{/* 组织成员 */}
<Route
path="/:OIdentifier/member"
path="/:OIdentifier/members"
render={(p) => {
return <DetailIndex {...props} {...p}/>
}}

View File

@ -67,7 +67,7 @@ function RightBox({ OIdentifier , history , admin }) {
<div className="list-r">
{
memberData && memberData.organization_users && memberData.organization_users.length>0 ?
<Box name="组织成员" count={memberData && memberData.total_count} url={`/${OIdentifier}/member`}>
<Box name="组织成员" count={memberData && memberData.total_count} url={`/${OIdentifier}/members`}>
{
memberData.organization_users.map((item,key)=>{
return(
@ -87,8 +87,8 @@ function RightBox({ OIdentifier , history , admin }) {
<Box
name="组织团队"
count={groupData && groupData.total_count}
bottom={admin && <Button type={'primary'} onClick={()=>history.push(`/${OIdentifier}/group/new`)}>新建团队</Button>}
url={`/${OIdentifier}/group`}
bottom={admin && <Button type={'primary'} onClick={()=>history.push(`/${OIdentifier}/teams/new`)}>新建团队</Button>}
url={`/${OIdentifier}/teams`}
>
{
groupData && groupData.teams && groupData.teams.length>0?
@ -99,7 +99,7 @@ function RightBox({ OIdentifier , history , admin }) {
<div>
{
(item.is_admin || item.is_member) ?
<Link to={`/${OIdentifier}/group/${item.id}`}><ColorListName>{item.name}</ColorListName></Link>
<Link to={`/${OIdentifier}/teams/${item.id}`}><ColorListName>{item.name}</ColorListName></Link>
:
<ColorListName>{item.name}</ColorListName>
}

View File

@ -43,7 +43,7 @@ function Detail(props){
}else{
setFlag(true);
}
if(pathname.indexOf(`/${OIdentifier}/group`)>-1 || pathname.indexOf(`/${OIdentifier}/member`)>-1){
if(pathname.indexOf(`/${OIdentifier}/teams`)>-1 || pathname.indexOf(`/${OIdentifier}/members`)>-1){
setButtonflagFlag(true);
}else{
setButtonflagFlag(false);
@ -88,8 +88,8 @@ function Detail(props){
:""}
{buttonflag &&
<span className="subNavs">
<Link to={`/${OIdentifier}/member`} className={pathname ===`/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
<Link to={`/${OIdentifier}/group`} className={pathname ===`/${OIdentifier}/group` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
<Link to={`/${OIdentifier}/members`} className={pathname ===`/${OIdentifier}/members` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
<Link to={`/${OIdentifier}/teams`} className={pathname ===`/${OIdentifier}/teams` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
</span>
}
</React.Fragment>
@ -112,21 +112,21 @@ function Detail(props){
{/* 组织团队-详情 */}
<Route
path="/:OIdentifier/group/:groupId"
path="/:OIdentifier/teams/:groupId"
render={(p) => {
return <GroupDetails {...props} {...p} group={detail}/>
}}
></Route>
{/* 组织成员 */}
<Route
path="/:OIdentifier/member"
path="/:OIdentifier/members"
render={(p) => {
return <Member {...props} {...p} organizeDetail={detail}/>
}}
></Route>
{/* 组织团队 */}
<Route
path="/:OIdentifier/group"
path="/:OIdentifier/teams"
render={(p) => {
return <Group {...props} {...p} organizeDetail={detail}/>
}}

View File

@ -22,7 +22,7 @@ export default ((props)=>{
//
useEffect(()=>{
if(pathname){
if(pathname.indexOf(`/${OIdentifier}/group/${groupId}/setting`)>-1){
if(pathname.indexOf(`/${OIdentifier}/teams/${groupId}/setting`)>-1){
setFlag(false);
}else{
setFlag(true);
@ -55,12 +55,12 @@ export default ((props)=>{
{
detail &&
<Cards
src={`/${OIdentifier}/group/${groupId}`}
src={`/${OIdentifier}/teams/${groupId}`}
title={detail.nickname||detail.name}
rightBtn={
flag && <span className="subNavs">
<Link to={`/${OIdentifier}/member`} className={pathname ===`/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
<Link to={`/${OIdentifier}/group`} className={pathname ===`/${OIdentifier}/group` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
<Link to={`/${OIdentifier}/members`} className={pathname ===`/${OIdentifier}/members` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
<Link to={`/${OIdentifier}/teams`} className={pathname ===`/${OIdentifier}/teams` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
</span>
}
desc={!flag && detail.description}
@ -69,7 +69,7 @@ export default ((props)=>{
<Switch {...props}>
{/* 组织团队-设置 */}
<Route
path="/:OIdentifier/group/:groupId/setting"
path="/:OIdentifier/teams/:groupId/setting"
render={(p) => {
return <GroupSetting {...props} {...p}/>
}}

View File

@ -53,7 +53,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
}
//
function toGroupSetting(id){
history.push(`/${organizeDetail && organizeDetail.name}/group/${id}/setting`);
history.push(`/${organizeDetail && organizeDetail.name}/teams/${id}/setting`);
}
//
function disMissGroup(id){
@ -77,7 +77,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
<p className="g-head">
{
(item.is_admin || item.is_member) ?
<Link to={`/${organizeDetail.name}/group/${item.id}`} className="color-grey-3 font-16">{item.nickname}</Link>
<Link to={`/${organizeDetail.name}/teams/${item.id}`} className="color-grey-3 font-16">{item.nickname}</Link>
:
<span className="color-grey-3 font-16">{item.nickname}</span>
}
@ -94,7 +94,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
k < count ? <Link to={`/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`/${i.image_url}`)}/></Link>
:
k === count ?
<Link to={`/${organizeDetail && organizeDetail.name}/group/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link>
<Link to={`/${organizeDetail && organizeDetail.name}/teams/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link>
:""
)
})

View File

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

View File

@ -10,11 +10,6 @@ const Infos = Loadable({
loader: () => import("./Infos"),
loading: Loading,
});
//forge
// const Projects = Loadable({
// loader: () => import('../Index'),
// loading: Loading,
// })
// forge
const ProjectDetail = Loadable({
loader: () => import("../Main/Detail"),
@ -25,20 +20,10 @@ export default withRouter(
//
let secondRouter = '';
let firstRouter = '';
if (props.location.pathname) {
firstRouter =props.location.pathname.split('/')[1];
secondRouter = props.location.pathname.split('/')[2];
}
// explore
let changePathProps={...props};
if(firstRouter==='explore'){
let login=props.current_user.login;
changePathProps.match.path=`/${login}`;
changePathProps.match.url=`/${login}`;
changePathProps.location.pathname=`/${login}`;
changePathProps.history.location.pathname=`/${login}`;
}
let userRouterArr = ['statistics', 'projects', 'notice', 'devops', 'organizes', 'info', 'watchers', 'fan_users', 'password'];
return (
<Switch>
@ -51,7 +36,7 @@ export default withRouter(
></Route> : <Route
path="/:username"
render={(p) => (
<Infos {...changePathProps} {...p} />
<Infos {...props} {...p} />
)}
></Route>}