forked from Gitlink/forgeplus-react
Merge pull request '修改例子中的路由以及新提出的路由,修改之前由于修改路由带来的issue' (#40) from tongChong/forgeplus-react:feature_router into feature_router
This commit is contained in:
commit
47f5d98d79
32
src/App.js
32
src/App.js
|
@ -105,7 +105,7 @@ class App extends Component {
|
|||
occupation: 0,
|
||||
mygetHelmetapi: null,
|
||||
pathType: null,
|
||||
pathName: '',
|
||||
pathName: null,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ class App extends Component {
|
|||
this.unlisten = this.props.history.listen((location) => {
|
||||
let newPathname = location.pathname.split('/')[1];
|
||||
if (this.state.pathName !== newPathname) {
|
||||
this.setState({ pathType: '' });
|
||||
// this.setState({ pathType: '' });
|
||||
newPathname && this.getPathnameType(newPathname);
|
||||
}
|
||||
});
|
||||
|
@ -175,7 +175,6 @@ class App extends Component {
|
|||
const msg = `${event.type}: ${event.message}`;
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
@ -252,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}>
|
||||
|
@ -309,15 +308,22 @@ class App extends Component {
|
|||
<Route exact path="/explore"
|
||||
render={
|
||||
(props) => (
|
||||
personal && personal.length > 0 ?
|
||||
<InfosIndex {...this.props} {...props} />
|
||||
:
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)
|
||||
}
|
||||
/>
|
||||
|
||||
{/*项目*/}
|
||||
|
||||
{/* 组织 */}
|
||||
<Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/*新建项目等*/}
|
||||
<Route
|
||||
path={"/projects"}
|
||||
render={
|
||||
|
@ -342,7 +348,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) => (
|
||||
|
@ -357,14 +363,6 @@ class App extends Component {
|
|||
}
|
||||
|
||||
|
||||
{/* 组织 */}
|
||||
<Route path={"/organize"}
|
||||
render={
|
||||
(props) => {
|
||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||
}
|
||||
}>
|
||||
</Route>
|
||||
|
||||
{/* 个人主页 */}
|
||||
<Route path="/:username"
|
||||
|
|
|
@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => {
|
|||
})
|
||||
|
||||
function locationurl(list) {
|
||||
if (window.location.port !== "3007") {
|
||||
// if (window.location.port !== "3007") {
|
||||
window.location.href = list
|
||||
}
|
||||
// }
|
||||
}
|
||||
// TODO 开发期多个身份切换
|
||||
let debugType = ""
|
||||
|
|
|
@ -14,14 +14,14 @@ class ActivityItem extends Component {
|
|||
{/* 如果是版本发布 */}
|
||||
{item.trend_type === "VersionRelease" ?
|
||||
<p className="itemLine">
|
||||
<Link to={`/${owner}/${projectsId}/version`} className="color-blue font-16">{item.name}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/releases`} className="color-blue font-16">{item.name}</Link>
|
||||
<span className="activity_type">{item.trend_type}</span>
|
||||
</p >
|
||||
:
|
||||
// 如果是任务
|
||||
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 >
|
||||
:
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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("流水线新增失败,请稍后再试!");
|
||||
}
|
||||
|
|
|
@ -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 ?
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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}/>
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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=>{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -12,8 +12,13 @@ import Loadable from "react-loadable";
|
|||
import Loading from "../Loading";
|
||||
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
|
||||
//404页面
|
||||
const Shixunnopage = Loadable({
|
||||
loader: () => import('../modules/404/Shixunnopage'),
|
||||
loading: Loading,
|
||||
})
|
||||
const ProjectNew = Loadable({
|
||||
loader: () => import("./New/Index"),
|
||||
loader: () => import("./New/Index"),
|
||||
loading: Loading,
|
||||
});
|
||||
const ProjectIndex = Loadable({
|
||||
|
@ -29,14 +34,15 @@ const ProjectIndex = Loadable({
|
|||
|
||||
class Index extends Component {
|
||||
|
||||
componentDidUpdate=()=>{
|
||||
this.props.history.listen(()=>{
|
||||
componentDidUpdate = () => {
|
||||
this.props.history.listen(() => {
|
||||
if (document.body.scrollTop || document.documentElement.scrollTop > 0) {
|
||||
window.scrollTo(0, 0)
|
||||
}
|
||||
})
|
||||
}
|
||||
render() {
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Switch {...this.props}>
|
||||
|
@ -70,6 +76,13 @@ class Index extends Component {
|
|||
<ProjectIndex {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/"
|
||||
render={(props) => (
|
||||
<ProjectIndex {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -347,13 +347,13 @@ function CoderDepot(props){
|
|||
}
|
||||
</div>
|
||||
<AlignCenter className="mr20">
|
||||
<Link to={`/${owner}/${projectsId}/branchs`} className="color-grey-9">
|
||||
<Link to={`/${owner}/${projectsId}/branches`} className="color-grey-9">
|
||||
<i className="iconfont icon-fenzhi2 font-18 color-grey-9 mr3"></i>
|
||||
<span className="color-grey-6 mr3">{projectDetail && projectDetail.branches && projectDetail.branches.total_count}个</span>分支
|
||||
</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>
|
||||
|
|
|
@ -132,12 +132,12 @@ 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} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/:owner/:projectsId/branchs"
|
||||
<Route path="/:owner/:projectsId/branches"
|
||||
render={
|
||||
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
@ -544,7 +544,7 @@ class Detail extends Component {
|
|||
{
|
||||
forked_count > 0 ?
|
||||
platform ?
|
||||
<Link className="detail_tag_btn_count" to={{ pathname: `/${owner}/${projectsId}/fork_users`, state }}>
|
||||
<Link className="detail_tag_btn_count" to={{ pathname: `/${owner}/${projectsId}/members`, state }}>
|
||||
{forked_count}
|
||||
</Link>
|
||||
:
|
||||
|
@ -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"
|
||||
|
@ -738,7 +739,7 @@ class Detail extends Component {
|
|||
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
></Route>
|
||||
<Route path="/:owner/:projectsId/fork_users"
|
||||
<Route path="/:owner/:projectsId/members"
|
||||
render={
|
||||
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ class DetailTop extends Component {
|
|||
<i className="iconfont icon-tijiaojilu font-20 mr3 font-bd"></i>
|
||||
<span>{(coderCount && coderCount.commits_count) || 0}</span>个提交
|
||||
</Link>
|
||||
<Link to={`/${owner}/${projectsId}/branchs`} className={pathname.indexOf("/branchs") > 0 ? "active" : ""}>
|
||||
<Link to={`/${owner}/${projectsId}/branches`} className={pathname.indexOf("/branches") > 0 ? "active" : ""}>
|
||||
<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>
|
||||
|
|
|
@ -28,7 +28,7 @@ class IndexItem extends Component {
|
|||
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
||||
</a>
|
||||
:
|
||||
<Link to={item.author && item.author.login} className="show-user-link">
|
||||
<Link to={`/${item.author && item.author.login}`} className="show-user-link">
|
||||
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
|
||||
</Link>
|
||||
}
|
||||
|
|
|
@ -77,7 +77,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 +115,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>
|
||||
|
|
|
@ -80,9 +80,10 @@ function Notify(props){
|
|||
<ul className="notifyList">
|
||||
{
|
||||
list.map((i,k)=>{
|
||||
console.log(i);
|
||||
return(
|
||||
<li i={k}>
|
||||
<Link to={`/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link>
|
||||
<Link to={`/${i.applied_user && i.applied_user.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg" /></Link>
|
||||
<div className="notifyFlex">
|
||||
<p className="notifyInfos">
|
||||
<Link to={`/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link>
|
||||
|
|
|
@ -31,7 +31,7 @@ class OrderItem extends Component {
|
|||
<div className="milepostwidth">
|
||||
<div className="grid-item width100">
|
||||
<i className="iconfont icon-lubiaosignpost3 font-12 mr3"></i>
|
||||
<Link to={`/projects/${owner}/${projectsId}/milestones/${item.id}`} className="font-16">{item.name}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/milestones/${item.id}`} className="font-16">{item.name}</Link>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -65,7 +65,7 @@ class OrderItem extends Component {
|
|||
<div className="milepostleft">
|
||||
<div className="grid-item ml15 color-grey-9">
|
||||
<i className="iconfont icon-bianji3 font-14 mr5"></i>
|
||||
<Link to={`/projects/${owner}/${projectsId}/milestones/${item.id}/edit`} className="color-grey-9">编辑</Link>
|
||||
<Link to={`/${owner}/${projectsId}/milestones/${item.id}/edit`} className="color-grey-9">编辑</Link>
|
||||
</div>
|
||||
<div className="grid-item ml15 color-grey-9">
|
||||
<i className="iconfont icon-yiguanbi1 font-14 mr5"></i>
|
||||
|
|
|
@ -52,7 +52,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">
|
||||
|
@ -89,7 +89,7 @@ class OrderItem extends Component {
|
|||
<li style={{color:`${item.done_ratio === "100%"?"#28BD6C":"#F73030"}`}}>{item.done_ratio || "--"}</li>
|
||||
<li>
|
||||
<div className="milepostleft">
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.id}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link>
|
||||
<Link to={`/${owner}/${projectsId}/issues/${item.id}`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link>
|
||||
{
|
||||
user_admin_or_member ?
|
||||
<div style={{ display: orderid === item.id && isdisplay ? 'flex' : 'none' }}>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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}`);
|
||||
}
|
||||
|
||||
// 翻页
|
||||
|
|
|
@ -290,7 +290,7 @@ export default Form.create()(
|
|||
<Cancel
|
||||
className="ml30"
|
||||
onClick={() => {
|
||||
history.push(`/${owner}/${projectsId}/setting/branch`);
|
||||
history.push(`/${owner}/${projectsId}/settings/branch`);
|
||||
}}
|
||||
>
|
||||
取消
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
|
|
|
@ -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/collaborators") > -1 ? "active" : ""
|
||||
}
|
||||
>
|
||||
<p>
|
||||
<Link to={`/${owner}/${projectsId}/setting/collaborator`} className="w-100">
|
||||
<Link to={`/${owner}/${projectsId}/settings/collaborators`} 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("settings/lables") > -1 ? "active" : ""}
|
||||
>
|
||||
<p>
|
||||
<Link to={`/${owner}/${projectsId}/setting/tags`} className="w-100">
|
||||
<Link to={`/${owner}/${projectsId}/settings/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/collaborators"
|
||||
render={(props) => (
|
||||
<Collaborator {...this.props} {...props} {...this.state} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 修改仓库信息 */}
|
||||
<Route
|
||||
path="/:owner/:projectsId/setting/tags"
|
||||
path="/:owner/:projectsId/settings/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} />
|
||||
)}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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} />
|
||||
)}
|
||||
|
|
|
@ -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>
|
||||
:
|
||||
|
|
|
@ -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}`);
|
||||
}
|
||||
|
|
|
@ -36,34 +36,6 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
|||
return (
|
||||
<div className="newMain">
|
||||
<Switch>
|
||||
{/* 组织团队-设置 */}
|
||||
<Route
|
||||
path="/:OIdentifier/group/:groupId/setting"
|
||||
render={(p) => {
|
||||
return <SubDetailIndex {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织团队-新建 */}
|
||||
<Route
|
||||
path="/:OIdentifier/group/new"
|
||||
render={(p) => {
|
||||
return <GroupNew {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织团队-子级(包含组织团队列表) */}
|
||||
<Route
|
||||
path="/:OIdentifier/group"
|
||||
render={(p) => {
|
||||
return <DetailIndex {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织成员 */}
|
||||
<Route
|
||||
path="/:OIdentifier/member"
|
||||
render={(p) => {
|
||||
return <DetailIndex {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 新建组织 */}
|
||||
<Route
|
||||
path="/organize/new"
|
||||
|
@ -71,6 +43,35 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
|||
return <New {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织团队-新建 */}
|
||||
<Route
|
||||
path="/:OIdentifier/teams/new"
|
||||
render={(p) => {
|
||||
return <GroupNew {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织团队-设置 */}
|
||||
<Route
|
||||
path="/:OIdentifier/teams/:groupId/setting"
|
||||
render={(p) => {
|
||||
return <SubDetailIndex {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织团队-子级(包含组织团队列表) */}
|
||||
<Route
|
||||
path="/:OIdentifier/teams"
|
||||
render={(p) => {
|
||||
return <DetailIndex {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织成员 */}
|
||||
<Route
|
||||
path="/:OIdentifier/members"
|
||||
render={(p) => {
|
||||
return <DetailIndex {...props} {...p}/>
|
||||
}}
|
||||
></Route>
|
||||
|
||||
|
||||
{/* 组织详情(包含组织设置) */}
|
||||
<Route
|
||||
|
|
|
@ -68,7 +68,7 @@ function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,complet
|
|||
<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(
|
||||
|
@ -93,11 +93,11 @@ function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,complet
|
|||
<CheckProfile
|
||||
showCompeleteDialog={showCompeleteDialog}
|
||||
completeProfile={completeProfile}
|
||||
sureFunc={()=>history.push(`/${OIdentifier}/group/new`)}
|
||||
sureFunc={()=>history.push(`/${OIdentifier}/teams/new`)}
|
||||
className={"ant-btn ant-btn-primary"}
|
||||
>新建团队</CheckProfile>
|
||||
}
|
||||
url={`/${OIdentifier}/group`}
|
||||
url={`/${OIdentifier}/teams`}
|
||||
>
|
||||
{
|
||||
groupData && groupData.teams && groupData.teams.length>0?
|
||||
|
@ -108,7 +108,7 @@ function RightBox({ OIdentifier , history , admin , showCompeleteDialog ,complet
|
|||
<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>
|
||||
}
|
||||
|
|
|
@ -3,11 +3,11 @@ import { WhiteBack , Banner } from '../../Component/layout';
|
|||
import GroupItems from '../TeamGroupItems';
|
||||
|
||||
const limit = 8;
|
||||
function TeamSettingGroup({organizeDetail,history}){
|
||||
function TeamSettingGroup({organizeDetail,history,current_user}){
|
||||
return(
|
||||
<WhiteBack>
|
||||
<Banner>组织团队管理</Banner>
|
||||
<GroupItems limit={limit} organizeDetail={organizeDetail} count={4} history={history}/>
|
||||
<GroupItems limit={limit} organizeDetail={organizeDetail} count={4} history={history} current_user={current_user}/>
|
||||
</WhiteBack>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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}/>
|
||||
}}
|
||||
|
|
|
@ -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}/>
|
||||
}}
|
||||
|
|
|
@ -3,11 +3,11 @@ import { Banner } from '../Component/layout';
|
|||
import GroupItems from './TeamGroupItems';
|
||||
|
||||
const limit = 14;
|
||||
function TeamGroup({organizeDetail,history}){
|
||||
function TeamGroup({organizeDetail,history,current_user}){
|
||||
return(
|
||||
<div style={{background:"#fff",marginBottom:"30px",border:'1px solid #eee'}}>
|
||||
<Banner>组织团队</Banner>
|
||||
<GroupItems limit={limit} organizeDetail={organizeDetail} count={7} history={history}/>
|
||||
<GroupItems limit={limit} organizeDetail={organizeDetail} count={7} history={history} current_user={current_user}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ const ImgContent = styled.img`{
|
|||
border-radius:50%;
|
||||
margin:5px 10px;
|
||||
}`
|
||||
function TeamGroupItems({organizeDetail,limit, count , history}){
|
||||
function TeamGroupItems({organizeDetail,limit, count , history ,current_user}){
|
||||
const [ page , setPage ] = useState(1);
|
||||
const [ isSpin , setIsSpin ] = useState(true);
|
||||
const [ total , setTotal ] = useState(0);
|
||||
|
@ -48,12 +48,13 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
|
|||
axios.delete(url).then(result =>{
|
||||
if(result && result.data){
|
||||
getData();
|
||||
history.push(`/${current_user && current_user.login}`);
|
||||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
// 团队设置
|
||||
function toGroupSetting(id){
|
||||
history.push(`/${organizeDetail && organizeDetail.name}/group/${id}/setting`);
|
||||
history.push(`/${organizeDetail && organizeDetail.name}/teams/${id}/setting`);
|
||||
}
|
||||
// 解散团队
|
||||
function disMissGroup(id){
|
||||
|
@ -77,7 +78,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 +95,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>
|
||||
:""
|
||||
)
|
||||
})
|
||||
|
|
|
@ -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>
|
||||
:
|
||||
|
|
|
@ -11,10 +11,10 @@ function Activity({list}) {
|
|||
list.map((i,k)=>{
|
||||
return(
|
||||
<li>
|
||||
<Link to={``}><img src={getImageUrl(`/system/lets/letter_avatars/2/D/169_162_140/120.png`)} alt="" className="aImg"/></Link>
|
||||
<Link to={`/${i.user_login}`}><img src={getImageUrl(`/system/lets/letter_avatars/2/D/169_162_140/120.png`)} alt="" className="aImg"/></Link>
|
||||
<div className="aInfos">
|
||||
<AlignCenter>
|
||||
<Link to={``} className="name">{i.user_name}</Link>
|
||||
<Link to={`/${i.user_login}`} className="name">{i.user_name}</Link>
|
||||
<span className="time">{i.action_time}</span>
|
||||
{i.priority && TagInfo(`${i.priority}`,"")}
|
||||
{i.issue_status && <span className="status">{i.issue_status}</span> }
|
||||
|
|
|
@ -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>}
|
||||
|
||||
|
|
|
@ -282,7 +282,7 @@ class Infos extends Component {
|
|||
<Menu selectedKeys={[menuKey]} mode={`horizontal`} className="infosRightMenu">
|
||||
<Menu.Item key="0"><Link to={`/${user && user.login}`}><i className="iconfont icon-gailan"></i>概览</Link></Menu.Item>
|
||||
<Menu.Item key="1"><Link to={`/${user && user.login}/statistics`}><i className="iconfont icon-shujutongji"></i>数据统计</Link></Menu.Item>
|
||||
<Menu.Item key="2"><Link to={`/${user && user.login}/projects/common`}><i className="iconfont icon-xiangmu"></i>项目</Link></Menu.Item>
|
||||
<Menu.Item key="2"><Link to={`/${user && user.login}/projects`}><i className="iconfont icon-xiangmu"></i>项目</Link></Menu.Item>
|
||||
{
|
||||
current_user && user && user.login === current_user.login ?
|
||||
<Menu.Item key="3">
|
||||
|
@ -338,7 +338,7 @@ class Infos extends Component {
|
|||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/:username/projects/:project_type"
|
||||
path="/:username/projects" // /:project_type
|
||||
render={() => {
|
||||
return <InfosUser {...this.props} {...this.state} />;
|
||||
}}
|
||||
|
|
|
@ -10,11 +10,6 @@ import './index.scss';
|
|||
const { Search } = Input;
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
// const https = 'http://192.168.0.77:8081'; //曾伟内网后台
|
||||
// const https = 'http://192.168.31.104:8081'; //曾伟外网后台
|
||||
// const https='http://106.75.31.211:58081';
|
||||
const https = 'https://test-statistics.trustie.net';
|
||||
|
||||
const GlobalSearch = ({ location, showNotification, history }) => {
|
||||
|
||||
const size = 10;
|
||||
|
@ -58,6 +53,8 @@ const GlobalSearch = ({ location, showNotification, history }) => {
|
|||
}
|
||||
|
||||
function searchDataList() {
|
||||
let chromesettingArray = JSON.parse(localStorage.getItem('chromesetting'));
|
||||
let https = chromesettingArray.common.search || 'https://statistics.trustie.net';
|
||||
const url = https + '/search';
|
||||
if (!term) {
|
||||
// showNotification('请输入关键字');
|
||||
|
|
Loading…
Reference in New Issue