Merge pull request 'router修改' (#33) from tongChong/forgeplus-react:feature_router into feature_router
This commit is contained in:
commit
9655cd5105
146
src/App.js
146
src/App.js
|
@ -3,7 +3,7 @@ import './App.css';
|
||||||
import { ConfigProvider } from 'antd'
|
import { ConfigProvider } from 'antd'
|
||||||
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
import zhCN from 'antd/lib/locale-provider/zh_CN';
|
||||||
import {
|
import {
|
||||||
BrowserRouter as Router,
|
// BrowserRouter as Router,
|
||||||
Route,
|
Route,
|
||||||
Switch
|
Switch
|
||||||
} from 'react-router-dom';
|
} from 'react-router-dom';
|
||||||
|
@ -100,6 +100,37 @@ class App extends Component {
|
||||||
mydisplay: false,
|
mydisplay: false,
|
||||||
occupation: 0,
|
occupation: 0,
|
||||||
mygetHelmetapi: null,
|
mygetHelmetapi: null,
|
||||||
|
pathType: null,
|
||||||
|
pathName:'',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UNSAFE_componentWillMount() {
|
||||||
|
initAxiosInterceptors(this.props);
|
||||||
|
let pathname = window.location.pathname ? window.location.pathname.split('/')[1] : '';
|
||||||
|
pathname && this.getPathnameType(pathname);
|
||||||
|
|
||||||
|
// 添加路由监听,决定组织还是个人
|
||||||
|
this.unlisten = this.props.history.listen((location) => {
|
||||||
|
let newPathname = location.pathname.split('/')[1];
|
||||||
|
if(this.state.pathName!==newPathname){
|
||||||
|
newPathname && this.getPathnameType(newPathname);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getPathnameType = (pathname) => {
|
||||||
|
let keyWord = ["Gitlink", "Trustie", "explore", "settings", "setting", "CCF", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501"];
|
||||||
|
if (!keyWord.includes(pathname)) {
|
||||||
|
let url = `/owners/${pathname}.json`;
|
||||||
|
axios.get(url).then((response) => {
|
||||||
|
if (response && response.status === 200) {
|
||||||
|
this.setState({
|
||||||
|
pathType: response.data.type || '404',
|
||||||
|
pathName:pathname,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,13 +150,20 @@ class App extends Component {
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
document.title = "loading...";
|
document.title = "loading...";
|
||||||
initAxiosInterceptors(this.props);
|
|
||||||
this.getAppdata();
|
this.getAppdata();
|
||||||
|
|
||||||
window.addEventListener('error', (event) => {
|
window.addEventListener('error', (event) => {
|
||||||
const msg = `${event.type}: ${event.message}`;
|
const msg = `${event.type}: ${event.message}`;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
this.unlisten && this.unlisten(); // 执行解绑
|
||||||
|
}
|
||||||
|
|
||||||
//修改登录方法
|
//修改登录方法
|
||||||
Modifyloginvalue = () => {
|
Modifyloginvalue = () => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -196,7 +234,7 @@ class App extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { mygetHelmetapi } = this.state;
|
const { mygetHelmetapi, pathType } = this.state;
|
||||||
let personal = mygetHelmetapi && mygetHelmetapi.personal;
|
let personal = mygetHelmetapi && mygetHelmetapi.personal;
|
||||||
return (
|
return (
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
|
@ -204,10 +242,10 @@ class App extends Component {
|
||||||
<MuiThemeProvider theme={theme}>
|
<MuiThemeProvider theme={theme}>
|
||||||
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
|
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={() => this.Modifyloginvalue()}></LoginDialog>
|
||||||
<SiderBar />
|
<SiderBar />
|
||||||
<Router>
|
{/* <Router> */}
|
||||||
<Switch>
|
<Switch>
|
||||||
{/* wiki预览 */}
|
{/* wiki预览 */}
|
||||||
<Route path="/projects/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={
|
<Route path="/:owner/:projectsId/wiki/preview/:projectName/:projectId" render={
|
||||||
(props) => {
|
(props) => {
|
||||||
return (<WikiPreview {...this.props} {...props} {...this.state} />)
|
return (<WikiPreview {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
|
@ -215,7 +253,7 @@ class App extends Component {
|
||||||
|
|
||||||
{/*项目*/}
|
{/*项目*/}
|
||||||
<Route
|
<Route
|
||||||
path={"/projects/:owner/:projectId/devops/:opsId/detail"}
|
path={"/:owner/:projectId/devops/:opsId/detail"}
|
||||||
render={
|
render={
|
||||||
(props) => {
|
(props) => {
|
||||||
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
return (<OpsDetail {...this.props} {...props} {...this.state} />)
|
||||||
|
@ -230,15 +268,7 @@ class App extends Component {
|
||||||
}
|
}
|
||||||
}>
|
}>
|
||||||
</Route>
|
</Route>
|
||||||
{/*项目*/}
|
|
||||||
<Route
|
|
||||||
path={"/projects"}
|
|
||||||
render={
|
|
||||||
(props) => {
|
|
||||||
return (<Projects {...this.props} {...props} {...this.state} />)
|
|
||||||
}
|
|
||||||
}>
|
|
||||||
</Route>
|
|
||||||
<Route
|
<Route
|
||||||
path="/register"
|
path="/register"
|
||||||
render={
|
render={
|
||||||
|
@ -251,28 +281,14 @@ class App extends Component {
|
||||||
<Route path="/403" component={Shixunauthority} />
|
<Route path="/403" component={Shixunauthority} />
|
||||||
|
|
||||||
<Route path="/500" component={http500} />
|
<Route path="/500" component={http500} />
|
||||||
<Route path={"/organize"}
|
|
||||||
render={
|
|
||||||
(props) => {
|
|
||||||
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
|
||||||
}
|
|
||||||
}>
|
|
||||||
</Route>
|
|
||||||
{/*404*/}
|
{/*404*/}
|
||||||
<Route path="/nopage" component={Shixunnopage} />
|
<Route path="/nopage" component={Shixunnopage} />
|
||||||
|
|
||||||
{/* 查询 */}
|
{/* 查询 */}
|
||||||
<Route path="/search" component={Search} />
|
<Route path="/search" component={Search} />
|
||||||
|
|
||||||
|
<Route exact path="/explore"
|
||||||
{/* 个人主页 */}
|
|
||||||
<Route path="/users/:username"
|
|
||||||
render={
|
|
||||||
(props) => {
|
|
||||||
return (<InfosIndex {...this.props} {...this.state} />)
|
|
||||||
}
|
|
||||||
}></Route>
|
|
||||||
<Route exact path="/"
|
|
||||||
render={
|
render={
|
||||||
(props) => (
|
(props) => (
|
||||||
personal && personal.length > 0 ?
|
personal && personal.length > 0 ?
|
||||||
|
@ -282,9 +298,75 @@ class App extends Component {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* <Route
|
||||||
|
path={"/:owner/:projectsId"}
|
||||||
|
render={
|
||||||
|
(props) => {
|
||||||
|
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
</Route> */}
|
||||||
|
|
||||||
|
{/* 判断为用户/组织,并进入对应页面 */}
|
||||||
|
{
|
||||||
|
pathType === 'User' ?
|
||||||
|
<Route exact path="/:username"
|
||||||
|
render={
|
||||||
|
(props) => {
|
||||||
|
return (<InfosIndex {...this.props} {...this.state} />)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/> : pathType === 'Organization' ? <Route path={"/:OIdentifier"}
|
||||||
|
render={
|
||||||
|
(props) => {
|
||||||
|
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
</Route> : pathType === '404' ? <Route path="/nopage" component={Shixunnopage} /> : <Route exact path="/"
|
||||||
|
render={
|
||||||
|
(props) => (
|
||||||
|
personal && personal.length > 0 ?
|
||||||
|
<InfosIndex {...this.props} {...props} />
|
||||||
|
:
|
||||||
|
<ProjectIndex {...this.props} {...props} />
|
||||||
|
)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
|
||||||
|
{/*项目*/}
|
||||||
|
<Route
|
||||||
|
path={"/projects"}
|
||||||
|
render={
|
||||||
|
(props) => {
|
||||||
|
return (<Projects {...this.props} {...props} {...this.state} />)
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
{/* 组织 */}
|
||||||
|
<Route path={"/organize"}
|
||||||
|
render={
|
||||||
|
(props) => {
|
||||||
|
return (<OrganizeIndex {...props} {...this.props} {...this.state} />)
|
||||||
|
}
|
||||||
|
}>
|
||||||
|
</Route>
|
||||||
|
|
||||||
|
{/* 个人主页 */}
|
||||||
|
|
||||||
|
<Route path="/:username"
|
||||||
|
render={
|
||||||
|
(props) => {
|
||||||
|
return (<InfosIndex {...this.props} {...this.state} />)
|
||||||
|
}
|
||||||
|
}></Route>
|
||||||
|
|
||||||
|
|
||||||
<Route component={Shixunnopage} />
|
<Route component={Shixunnopage} />
|
||||||
</Switch>
|
</Switch>
|
||||||
</Router>
|
{/* </Router> */}
|
||||||
</MuiThemeProvider>
|
</MuiThemeProvider>
|
||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
</Provider>
|
</Provider>
|
||||||
|
|
|
@ -11,9 +11,9 @@ broadcastChannelOnmessage('refreshPage', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
function locationurl(list) {
|
function locationurl(list) {
|
||||||
if (window.location.port !== "3007") {
|
// if (window.location.port !== "3007") {
|
||||||
window.location.href = list
|
window.location.href = list
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
// TODO 开发期多个身份切换
|
// TODO 开发期多个身份切换
|
||||||
let debugType = ""
|
let debugType = ""
|
||||||
|
@ -85,8 +85,11 @@ export function initAxiosInterceptors(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response.data.status === 404) {
|
if (response.data.status === 404) {
|
||||||
|
let responseURL = response.data.request ? response.data.request.responseURL:'';
|
||||||
|
if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1) {
|
||||||
locationurl('/nopage');
|
locationurl('/nopage');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (response.data.status === 500) {
|
if (response.data.status === 500) {
|
||||||
locationurl('/500');
|
locationurl('/500');
|
||||||
|
|
|
@ -195,7 +195,7 @@ class College extends Component {
|
||||||
align: 'center',
|
align: 'center',
|
||||||
className: "edu-txt-center font-14 maxnamewidth105",
|
className: "edu-txt-center font-14 maxnamewidth105",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<a href={`/users/${record.login}`} title={record.name} target="_blank" className="task-hide maxnamewidth105" style={{
|
<a href={`/${record.login}`} title={record.name} target="_blank" className="task-hide maxnamewidth105" style={{
|
||||||
color:'#007bff',
|
color:'#007bff',
|
||||||
|
|
||||||
}}> {
|
}}> {
|
||||||
|
|
|
@ -107,7 +107,7 @@ export function timeAgo(backDate) {
|
||||||
try {
|
try {
|
||||||
moment(backDate);
|
moment(backDate);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return;
|
return '刚刚';
|
||||||
}
|
}
|
||||||
if(typeof backDate ==='number'){
|
if(typeof backDate ==='number'){
|
||||||
backDate=backDate*1000
|
backDate=backDate*1000
|
||||||
|
@ -134,4 +134,5 @@ export function timeAgo(backDate) {
|
||||||
if (seconds) {
|
if (seconds) {
|
||||||
return seconds + "秒前";
|
return seconds + "秒前";
|
||||||
}
|
}
|
||||||
|
return "刚刚";
|
||||||
}
|
}
|
|
@ -435,11 +435,11 @@ class TPIContextProvider extends Component {
|
||||||
image_url: "avatars/User/1"
|
image_url: "avatars/User/1"
|
||||||
login: "innov"
|
login: "innov"
|
||||||
name: "Coder"
|
name: "Coder"
|
||||||
user_url: "/users/innov"
|
user_url: "/innov"
|
||||||
*/
|
*/
|
||||||
let user = resData.user;
|
let user = resData.user;
|
||||||
user.username = resData.user.name;
|
user.username = resData.user.name;
|
||||||
user.user_url = `/users/${resData.user.login}`;
|
user.user_url = `/${resData.user.login}`;
|
||||||
// user.image_url = resData.image_url;
|
// user.image_url = resData.image_url;
|
||||||
user.is_teacher = resData.is_teacher;
|
user.is_teacher = resData.is_teacher;
|
||||||
resData.user = user;
|
resData.user = user;
|
||||||
|
|
|
@ -14,25 +14,25 @@ class ActivityItem extends Component {
|
||||||
{/* 如果是版本发布 */}
|
{/* 如果是版本发布 */}
|
||||||
{item.trend_type === "VersionRelease" ?
|
{item.trend_type === "VersionRelease" ?
|
||||||
<p className="itemLine">
|
<p className="itemLine">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/version`} className="color-blue font-16">{item.name}</Link>
|
<Link to={`/${owner}/${projectsId}/version`} className="color-blue font-16">{item.name}</Link>
|
||||||
<span className="activity_type">{item.trend_type}</span>
|
<span className="activity_type">{item.trend_type}</span>
|
||||||
</p >
|
</p >
|
||||||
:
|
:
|
||||||
// 如果是任务
|
// 如果是任务
|
||||||
item.trend_type === "Issue" ?
|
item.trend_type === "Issue" ?
|
||||||
<p className="itemLine">
|
<p className="itemLine">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/issues/${item.trend_id}/detail`} className="color-blue font-16">{item.name}</Link>
|
<Link to={`/${owner}/${projectsId}/issues/${item.trend_id}/detail`} className="color-blue font-16">{item.name}</Link>
|
||||||
<span className="activity_type">{item.trend_type}</span>
|
<span className="activity_type">{item.trend_type}</span>
|
||||||
</p >
|
</p >
|
||||||
:
|
:
|
||||||
// 如果是合并请求
|
// 如果是合并请求
|
||||||
<p className="itemLine">
|
<p className="itemLine">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/pulls/${item.trend_id}/Messagecount`} className="color-blue font-16">{item.name}</Link>
|
<Link to={`/${owner}/${projectsId}/pulls/${item.trend_id}/Messagecount`} className="color-blue font-16">{item.name}</Link>
|
||||||
<span className="activity_type">{item.trend_type}</span>
|
<span className="activity_type">{item.trend_type}</span>
|
||||||
</p >
|
</p >
|
||||||
}
|
}
|
||||||
<p className="itemLine mt10">
|
<p className="itemLine mt10">
|
||||||
<Link to={`/users/${item && item.user_login}`} className="show-user-link">
|
<Link to={`/${item && item.user_login}`} className="show-user-link">
|
||||||
<img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" />
|
<img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" />
|
||||||
<span className="mr20">{item.user_name}</span>
|
<span className="mr20">{item.user_name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -55,6 +55,7 @@ function AddGroup({organizeId,getGroupID}){
|
||||||
|
|
||||||
function addCollaborator(){
|
function addCollaborator(){
|
||||||
getGroupID && getGroupID(id);
|
getGroupID && getGroupID(id);
|
||||||
|
setID(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
|
|
@ -52,8 +52,8 @@ function Contributors({contributors,owner,projectsId}){
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<Link to={`/users/${data.login}`}><img src={getImageUrl(`/${data.image_url}`)} alt="" className="radius" width="38px" height="38px"/></Link>
|
<Link to={`/${data.login}`}><img src={getImageUrl(`/${data.image_url}`)} alt="" className="radius" width="38px" height="38px"/></Link>
|
||||||
<Link to={`/users/${data.login}`} className="ml10">{data.name}</Link>
|
<Link to={`/${data.login}`} className="ml10">{data.name}</Link>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
{
|
{
|
||||||
data.is_watch ? <a className="color-grey-9" onClick={()=>FocusFunc(false,data.login)}>取消关注</a>:<a className="color-blue" onClick={()=>FocusFunc(true,data.login)}>关注</a>
|
data.is_watch ? <a className="color-grey-9" onClick={()=>FocusFunc(false,data.login)}>取消关注</a>:<a className="color-blue" onClick={()=>FocusFunc(true,data.login)}>关注</a>
|
||||||
|
@ -137,7 +137,7 @@ function Contributors({contributors,owner,projectsId}){
|
||||||
<div className="halfs">
|
<div className="halfs">
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<AlignCenter><span className="font-16 color-grey-6">贡献者</span>{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}</AlignCenter>
|
<AlignCenter><span className="font-16 color-grey-6">贡献者</span>{ contributors && contributors.total_count > 0 && <span className="infoCount">{contributors.total_count}</span>}</AlignCenter>
|
||||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/contribute`}>全部</Link>
|
<Link className="font-12 color-grey-9" to={`/${owner}/${projectsId}/contribute`}>全部</Link>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
<div className="attrPerson" onMouseLeave={()=>setVisibleFunc(false)}>
|
<div className="attrPerson" onMouseLeave={()=>setVisibleFunc(false)}>
|
||||||
{
|
{
|
||||||
|
@ -145,7 +145,7 @@ function Contributors({contributors,owner,projectsId}){
|
||||||
list.map((item,key)=>{
|
list.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
|
<Popover content={menu} visible={item.visible} overlayClassName="menuPanels" placement="top">
|
||||||
<Link key={key} to={`/users/${item.login}`}>
|
<Link key={key} to={`/${item.login}`}>
|
||||||
<img src={getImageUrl(`/${item.image_url}`)} alt="" onMouseOver={()=>setVisibleFunc(true,item.login,key)}/>
|
<img src={getImageUrl(`/${item.image_url}`)} alt="" onMouseOver={()=>setVisibleFunc(true,item.login,key)}/>
|
||||||
</Link>
|
</Link>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
import React, { useState, useCallback, memo } from 'react';
|
||||||
|
import { Tooltip } from 'antd';
|
||||||
|
|
||||||
|
CopyTool.defaultProps = {
|
||||||
|
beforeText: '复制', //浮动过去显示的文字
|
||||||
|
afterText: '复制成功', //点击后显示的文字
|
||||||
|
className: '', //传给svg的class
|
||||||
|
inputId: 'copyText', //要复制的文本的ID
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
function CopyTool({ beforeText, afterText, className,inputId }) {
|
||||||
|
const [title, setTitle] = useState(() => {
|
||||||
|
return beforeText;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 复制链接
|
||||||
|
const copyUrl = useCallback(() => {
|
||||||
|
let inputDom = document.getElementById(inputId);
|
||||||
|
if (!inputDom) {
|
||||||
|
console.error("您的CopyTool未设置正确的inputId");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
inputDom.select();
|
||||||
|
if (document.execCommand('copy')) {
|
||||||
|
document.execCommand('copy');
|
||||||
|
}
|
||||||
|
setTitle(afterText);
|
||||||
|
inputDom.blur();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Tooltip
|
||||||
|
placement="top"
|
||||||
|
title={title}
|
||||||
|
onVisibleChange={() => { setTitle(beforeText) }}
|
||||||
|
>
|
||||||
|
<i className={`iconfont icon-fuzhiicon ${className}`} style={{ color: '#466aff' }} onClick={copyUrl}></i>
|
||||||
|
</Tooltip>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default memo(CopyTool);
|
|
@ -78,7 +78,7 @@ function DrawerPanel({visible,onClose,branch,owner,projectsId,history, name , li
|
||||||
if(dataref.type==="file"){
|
if(dataref.type==="file"){
|
||||||
onClose();
|
onClose();
|
||||||
let value = turnbar(branch);
|
let value = turnbar(branch);
|
||||||
history.push(`/projects/${owner}/${projectsId}/tree/${value}/${dataref.path}`);
|
history.push(`/${owner}/${projectsId}/tree/${value}/${dataref.path}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ const Div = styled.div`{
|
||||||
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
|
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
|
||||||
return (
|
return (
|
||||||
<Div>
|
<Div>
|
||||||
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
|
<Link to={`/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
|
||||||
<div className="m-infos">
|
<div className="m-infos">
|
||||||
<Link to={`/users/${user && user.login}`}><Name>{name}</Name></Link>
|
<Link to={`/${user && user.login}`}><Name>{name}</Name></Link>
|
||||||
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
|
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
|
||||||
{
|
{
|
||||||
is_current_user ?
|
is_current_user ?
|
||||||
|
|
|
@ -11,9 +11,9 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}
|
||||||
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
{ releaseVersions && releaseVersions.total_count > 0 && <span className="infoCount">{releaseVersions.total_count}</span>}
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
{ (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ?
|
{ (releaseVersions && releaseVersions.total_count > 0) || projectType ===2 ?
|
||||||
<Link className="font-12 color-grey-9" to={`/projects/${owner}/${projectsId}/releases`}>全部</Link>
|
<Link className="font-12 color-grey-9" to={`/${owner}/${projectsId}/releases`}>全部</Link>
|
||||||
:
|
:
|
||||||
baseOperate && <Link className="font-12 color-blue" to={`/projects/${owner}/${projectsId}/releases/new`}>新建</Link>
|
baseOperate && <Link className="font-12 color-blue" to={`/${owner}/${projectsId}/releases/new`}>新建</Link>
|
||||||
}
|
}
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ function Releases({owner,projectsId,releaseVersions , baseOperate , projectType}
|
||||||
<i className="iconfont icon-biaoqian3 color-grey-6 font-18 mr10"></i>
|
<i className="iconfont icon-biaoqian3 color-grey-6 font-18 mr10"></i>
|
||||||
<div>
|
<div>
|
||||||
<p className="font-16 color-grey-6">
|
<p className="font-16 color-grey-6">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/releases`}>{item.name}</Link>
|
<Link to={`/${owner}/${projectsId}/releases`}>{item.name}</Link>
|
||||||
<span className="font-12 laterest ml5">最新</span>
|
<span className="font-12 laterest ml5">最新</span>
|
||||||
</p>
|
</p>
|
||||||
<p className="color-grey-9 font-13">{item.created_at}</p>
|
<p className="color-grey-9 font-13">{item.created_at}</p>
|
||||||
|
|
|
@ -20,7 +20,7 @@ export default ({ url , name , column , id , login })=>{
|
||||||
`;
|
`;
|
||||||
return(
|
return(
|
||||||
id?
|
id?
|
||||||
<Link to={`/users/${login}`}>
|
<Link to={`/${login}`}>
|
||||||
<Img>
|
<Img>
|
||||||
{ url && <img src={url} alt=""/> }
|
{ url && <img src={url} alt=""/> }
|
||||||
<span>{name}</span>
|
<span>{name}</span>
|
||||||
|
|
|
@ -149,7 +149,7 @@ function About(props, ref) {
|
||||||
axios.post(url).then(result=>{
|
axios.post(url).then(result=>{
|
||||||
setIsSpining(false);
|
setIsSpining(false);
|
||||||
if(result && result.data.status === 0){
|
if(result && result.data.status === 0){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/dispose`);
|
props.history.push(`/${owner}/${projectsId}/devops/dispose`);
|
||||||
// 需要将顶部的open_devops修改
|
// 需要将顶部的open_devops修改
|
||||||
let { changeOpenDevops } = props;
|
let { changeOpenDevops } = props;
|
||||||
changeOpenDevops && changeOpenDevops(true);
|
changeOpenDevops && changeOpenDevops(true);
|
||||||
|
|
|
@ -96,7 +96,7 @@ function Dispose(props){
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
props.showNotification("流水线新增成功,请进行工作流配置!");
|
props.showNotification("流水线新增成功,请进行工作流配置!");
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/dispose/${result.data.id}`);
|
props.history.push(`/${owner}/${projectsId}/devops/dispose/${result.data.id}`);
|
||||||
}else{
|
}else{
|
||||||
props.showNotification("流水线新增失败,请稍后再试!");
|
props.showNotification("流水线新增失败,请稍后再试!");
|
||||||
}
|
}
|
||||||
|
@ -134,12 +134,12 @@ function Dispose(props){
|
||||||
|
|
||||||
// 模板管理
|
// 模板管理
|
||||||
function toModalManage(){
|
function toModalManage(){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/mould`);
|
props.history.push(`/${owner}/${projectsId}/devops/mould`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 参数管理
|
// 参数管理
|
||||||
function toparameter(){
|
function toparameter(){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/params`);
|
props.history.push(`/${owner}/${projectsId}/devops/params`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const operate = current_user && (permission && permission !== "Reporter");
|
const operate = current_user && (permission && permission !== "Reporter");
|
||||||
|
|
|
@ -73,7 +73,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
render:(value,item)=>{
|
render:(value,item)=>{
|
||||||
let v = turnbar(item.branch);
|
let v = turnbar(item.branch);
|
||||||
return(
|
return(
|
||||||
<Link to={`/projects/${owner}/${projectsId}/tree/${v}/${value}`} className="color-blue">{value}</Link>
|
<Link to={`/${owner}/${projectsId}/tree/${v}/${value}`} className="color-blue">{value}</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -117,7 +117,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
return(
|
return(
|
||||||
<span>
|
<span>
|
||||||
{ operate ?
|
{ operate ?
|
||||||
<Link to={`/projects/${owner}/${projectsId}/devops/dispose/${item.id}`} className="mr10 color-grey-6">
|
<Link to={`/${owner}/${projectsId}/devops/dispose/${item.id}`} className="mr10 color-grey-6">
|
||||||
<i className="iconfont icon-zaibianji font-13 mr3"></i>编辑</Link> :""
|
<i className="iconfont icon-zaibianji font-13 mr3"></i>编辑</Link> :""
|
||||||
}
|
}
|
||||||
{ operate ?
|
{ operate ?
|
||||||
|
@ -125,7 +125,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
|
||||||
<a className="mr10 color-grey-6"><i className="iconfont icon-lajitong font-13 mr3"></i>删除</a>
|
<a className="mr10 color-grey-6"><i className="iconfont icon-lajitong font-13 mr3"></i>删除</a>
|
||||||
</Popconfirm>:""
|
</Popconfirm>:""
|
||||||
}
|
}
|
||||||
<Link to={`/projects/${owner}/${projectsId}/devops/list/${item.branch}`} className="color-grey-6"><i className="iconfont icon-yunhang font-13 mr3"></i>查看运行记录</Link>
|
<Link to={`/${owner}/${projectsId}/devops/list/${item.branch}`} className="color-grey-6"><i className="iconfont icon-yunhang font-13 mr3"></i>查看运行记录</Link>
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,37 +36,37 @@ export default ((props)=>{
|
||||||
return(
|
return(
|
||||||
<WhiteBack className="opsPanel">
|
<WhiteBack className="opsPanel">
|
||||||
<Switch {...props}>
|
<Switch {...props}>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/dispose/:disposeId"
|
<Route path="/:owner/:projectsId/devops/dispose/:disposeId"
|
||||||
render={
|
render={
|
||||||
(p) => (<New {...props} {...p}/>)
|
(p) => (<New {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/params"
|
<Route path="/:owner/:projectsId/devops/params"
|
||||||
render={
|
render={
|
||||||
(p) => (<Params {...props} {...p}/>)
|
(p) => (<Params {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/mould"
|
<Route path="/:owner/:projectsId/devops/mould"
|
||||||
render={
|
render={
|
||||||
(p) => (<Mould {...props} {...p}/>)
|
(p) => (<Mould {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/dispose/new"
|
<Route path="/:owner/:projectsId/devops/dispose/new"
|
||||||
render={
|
render={
|
||||||
(p) => (<New {...props} {...p}/>)
|
(p) => (<New {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/dispose"
|
<Route path="/:owner/:projectsId/devops/dispose"
|
||||||
render={
|
render={
|
||||||
(p) => (<Dispose {...props} {...p}/>)
|
(p) => (<Dispose {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops/list/:branch"
|
<Route path="/:owner/:projectsId/devops/list/:branch"
|
||||||
render={
|
render={
|
||||||
(p) => (<Stucture {...props} {...p}/>)
|
(p) => (<Stucture {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/devops"
|
<Route path="/:owner/:projectsId/devops"
|
||||||
render={
|
render={
|
||||||
(p) => (<About {...props} {...p}/>)
|
(p) => (<About {...props} {...p}/>)
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ export default ((props)=>{
|
||||||
return(
|
return(
|
||||||
<div className="disposePanel">
|
<div className="disposePanel">
|
||||||
<Banner>
|
<Banner>
|
||||||
{ permission !=="Reporter" && <Link to={`/projects/${owner}/${props.match.params.projectsId}/devops/dispose`}>工作流配置</Link>}
|
{ permission !=="Reporter" && <Link to={`/${owner}/${props.match.params.projectsId}/devops/dispose`}>工作流配置</Link>}
|
||||||
</Banner>
|
</Banner>
|
||||||
<Div>
|
<Div>
|
||||||
<Dispost {...props}/>
|
<Dispost {...props}/>
|
||||||
|
|
|
@ -104,7 +104,7 @@ function Params(props){
|
||||||
<Banner>
|
<Banner>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<span className="font-18">工作流 - 参数管理</span>
|
<span className="font-18">工作流 - 参数管理</span>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9 ml20">返回</Link>
|
<Link to={`/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9 ml20">返回</Link>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
</Banner>
|
</Banner>
|
||||||
<Div className="disposeList">
|
<Div className="disposeList">
|
||||||
|
|
|
@ -126,7 +126,7 @@ function Mould(props){
|
||||||
<div>
|
<div>
|
||||||
<New wrappedComponentRef={(f) => childRef.current = f} ref={childRef} visible={visible} onCancel={()=>setVisible(false)} onOk={onOk}></New>
|
<New wrappedComponentRef={(f) => childRef.current = f} ref={childRef} visible={visible} onCancel={()=>setVisible(false)} onOk={onOk}></New>
|
||||||
<Banner>
|
<Banner>
|
||||||
<FlexAJ><span>工作流 - 模板管理</span><Link to={`/projects/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9">返回</Link></FlexAJ>
|
<FlexAJ><span>工作流 - 模板管理</span><Link to={`/${owner}/${projectsId}/devops/dispose`} className="font-14 color-grey-9">返回</Link></FlexAJ>
|
||||||
</Banner>
|
</Banner>
|
||||||
<Div className="disposeList">
|
<Div className="disposeList">
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
|
|
|
@ -198,7 +198,7 @@ function Structure(props,ref){
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickRows(event,e){
|
function clickRows(event,e){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/${e.number}/detail`);
|
props.history.push(`/${owner}/${projectsId}/devops/${e.number}/detail`);
|
||||||
}
|
}
|
||||||
const column = [
|
const column = [
|
||||||
{
|
{
|
||||||
|
@ -290,7 +290,7 @@ function Structure(props,ref){
|
||||||
<Banner>
|
<Banner>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<span>构建列表</span>
|
<span>构建列表</span>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/devops/dispose`} className="font-15 color-grey-9">返回</Link>
|
<Link to={`/${owner}/${projectsId}/devops/dispose`} className="font-15 color-grey-9">返回</Link>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
</Banner>
|
</Banner>
|
||||||
<Div>
|
<Div>
|
||||||
|
|
|
@ -275,7 +275,7 @@ function disposePipeline(props){
|
||||||
...params
|
...params
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result){
|
if(result){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/devops/dispose`);
|
props.history.push(`/${owner}/${projectsId}/devops/dispose`);
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}).catch(error=>{
|
}).catch(error=>{
|
||||||
|
|
|
@ -48,7 +48,7 @@ export default (props) => {
|
||||||
axios.post(url).then((result) => {
|
axios.post(url).then((result) => {
|
||||||
if (result && result.data) {
|
if (result && result.data) {
|
||||||
props.showNotification("工作流正在重新构建!");
|
props.showNotification("工作流正在重新构建!");
|
||||||
props.history.push(`/projects/${owner}/${projectId}/devops/${result.data.number}/detail`);
|
props.history.push(`/${owner}/${projectId}/devops/${result.data.number}/detail`);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -87,7 +87,7 @@ export default (props) => {
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<Link
|
<Link
|
||||||
style={{ color: "#ddd" }}
|
style={{ color: "#ddd" }}
|
||||||
to={`/projects/${owner}/${projectId}/devops/dispose`}
|
to={`/${owner}/${projectId}/devops/dispose`}
|
||||||
>
|
>
|
||||||
<i className="iconfont icon-yiguanbi font-15 mr5"></i>退出
|
<i className="iconfont icon-yiguanbi font-15 mr5"></i>退出
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -104,7 +104,7 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
|
||||||
</ul>
|
</ul>
|
||||||
:
|
:
|
||||||
<ul className="descUl">
|
<ul className="descUl">
|
||||||
<li>仓库仅可以转移到您已经加入的组织中,不可以转移到未加入的组织中</li>
|
<li>仓库仅可以转移到您具有管理权限的组织中</li>
|
||||||
<li>涉及到仓库改名操作,请提前做好仓库备份并且在转移后对本地仓库的remote进行修改</li>
|
<li>涉及到仓库改名操作,请提前做好仓库备份并且在转移后对本地仓库的remote进行修改</li>
|
||||||
<li>转移仓库到组织后,你和组织创建者/管理员同时拥有对该仓库的管理操作</li>
|
<li>转移仓库到组织后,你和组织创建者/管理员同时拥有对该仓库的管理操作</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -385,16 +385,16 @@ class NewHeader extends Component {
|
||||||
if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
|
if (new_link && (new_link.indexOf("courses") > -1 || new_link.indexOf("contests") > -1)) {
|
||||||
if (user_login) {
|
if (user_login) {
|
||||||
if (new_link.indexOf("courses") > -1) {
|
if (new_link.indexOf("courses") > -1) {
|
||||||
new_link = new_link.replace(/courses/g, "users/" + user_login + "/courses")
|
new_link = new_link.replace(/courses/g, user_login + "/courses")
|
||||||
} else if (new_link.indexOf("contests") > -1) {
|
} else if (new_link.indexOf("contests") > -1) {
|
||||||
new_link = new_link.replace(/contests/g, "users/" + user_login + "/contests")
|
new_link = new_link.replace(/contests/g, user_login + "/contests")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
is_hidden = true
|
is_hidden = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
|
if (user_login && (new_link && new_link.indexOf("homes") > -1)) {
|
||||||
new_link = new_link.replace(/homes/g, "users/" + user_login + "/user_activities")
|
new_link = new_link.replace(/homes/g, user_login + "/user_activities")
|
||||||
}
|
}
|
||||||
|
|
||||||
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
|
var waiLian = (new_link && str.filter(item=>new_link.indexOf(item)>-1) );
|
||||||
|
@ -442,7 +442,7 @@ class NewHeader extends Component {
|
||||||
</span>
|
</span>
|
||||||
:
|
:
|
||||||
<Dropdown placement={`bottomRight`} overlay={this.renderMenu(settings && settings.personal)}>
|
<Dropdown placement={`bottomRight`} overlay={this.renderMenu(settings && settings.personal)}>
|
||||||
<a href={`/users/${this.props.current_user && this.props.current_user.login}`}>
|
<a href={`/${this.props.current_user && this.props.current_user.login}`}>
|
||||||
<img alt="头像" src={getImageUrl(`/${user.image_url}`)} className="currentImg"></img>
|
<img alt="头像" src={getImageUrl(`/${user.image_url}`)} className="currentImg"></img>
|
||||||
</a>
|
</a>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
|
|
@ -40,13 +40,13 @@ class Index extends Component {
|
||||||
<div className="newMain clearfix">
|
<div className="newMain clearfix">
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:projectsType/new/:OIdentifier"
|
path="/:projectsType/new/:OIdentifier"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<ProjectNew {...this.props} {...props} />
|
<ProjectNew {...this.props} {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:projectsType/new"
|
path="/:projectsType/new"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<ProjectNew {...this.props} {...props} />
|
<ProjectNew {...this.props} {...props} />
|
||||||
)}
|
)}
|
||||||
|
@ -58,17 +58,17 @@ class Index extends Component {
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId"
|
path="/:owner/:projectsId"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<ProjectDetail {...this.props} {...props} />
|
<ProjectDetail {...this.props} {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
{/* <Route
|
||||||
path="/projects"
|
path="/projects"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<ProjectIndex {...this.props} {...props} />
|
<ProjectIndex {...this.props} {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route> */}
|
||||||
<Route
|
<Route
|
||||||
path="/"
|
path="/"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
|
@ -80,9 +80,16 @@ class Index extends Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// export default withRouter(
|
||||||
|
// ImageLayerOfCommentHOC({
|
||||||
|
// imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||||
|
// parentSelector: ".newMain",
|
||||||
|
// })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))
|
||||||
|
// );
|
||||||
|
|
||||||
export default withRouter(
|
export default withRouter(
|
||||||
ImageLayerOfCommentHOC({
|
ImageLayerOfCommentHOC({
|
||||||
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||||
parentSelector: ".newMain",
|
parentSelector: ".newMain",
|
||||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index))))
|
})(Index)
|
||||||
);
|
);
|
||||||
|
|
|
@ -112,7 +112,7 @@ function CoderDepot(props){
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if (projectsId && owner && defaultBranch){
|
if (projectsId && owner && defaultBranch){
|
||||||
let b = turnbar(branchName) ;
|
let b = turnbar(branchName) ;
|
||||||
if(pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) {
|
if(pathname.indexOf(`/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${b}/`) > -1) {
|
||||||
let url = pathname.split(`/tree/${b}/`)[1];
|
let url = pathname.split(`/tree/${b}/`)[1];
|
||||||
setTreeValue(url);
|
setTreeValue(url);
|
||||||
getFileInfo(url,branchName);
|
getFileInfo(url,branchName);
|
||||||
|
@ -147,6 +147,7 @@ function CoderDepot(props){
|
||||||
setReadme(result.data.readme);
|
setReadme(result.data.readme);
|
||||||
setEditReadme(false);
|
setEditReadme(false);
|
||||||
setHide(true);
|
setHide(true);
|
||||||
|
console.log("dddd:",result.data.entries);
|
||||||
}
|
}
|
||||||
setTimeout(function(){setIsSpin(false);},500);
|
setTimeout(function(){setIsSpin(false);},500);
|
||||||
}).catch(error=>{setIsSpin(false);})
|
}).catch(error=>{setIsSpin(false);})
|
||||||
|
@ -198,7 +199,7 @@ function CoderDepot(props){
|
||||||
// 切换分支或者标签
|
// 切换分支或者标签
|
||||||
function changeBranch(value){
|
function changeBranch(value){
|
||||||
let checkvalue = turnbar(value);
|
let checkvalue = turnbar(value);
|
||||||
let url = `/projects/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
|
let url = `/${owner}/${projectsId}${value && `/tree/${checkvalue}`}${treeValue ? `/${treeValue}`:""}`;
|
||||||
props.history.push(url);
|
props.history.push(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -208,8 +209,8 @@ function CoderDepot(props){
|
||||||
let checkvalue = turnbar(b);
|
let checkvalue = turnbar(b);
|
||||||
return (
|
return (
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${checkvalue}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item>
|
<Menu.Item><a onClick={()=>urlLink(`/${owner}/${projectsId}/${checkvalue}/uploadfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>上传文件</a></Menu.Item>
|
||||||
<Menu.Item><a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/${checkvalue}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item>
|
<Menu.Item><a onClick={()=>urlLink(`/${owner}/${projectsId}/${checkvalue}/newfile${treeValue === undefined ? "" : `/${treeValue}`}`)}>新建文件</a></Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -228,12 +229,12 @@ function CoderDepot(props){
|
||||||
setTreeValue(undefined);
|
setTreeValue(undefined);
|
||||||
let branch = branchName || defaultBranch;
|
let branch = branchName || defaultBranch;
|
||||||
let checkvalue = turnbar(branch);
|
let checkvalue = turnbar(branch);
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/tree/${checkvalue}`);
|
props.history.push(`/${owner}/${projectsId}/tree/${checkvalue}`);
|
||||||
};
|
};
|
||||||
// 子目录路径返回链接
|
// 子目录路径返回链接
|
||||||
function returnUlr(url){
|
function returnUlr(url){
|
||||||
let enBranch = turnbar(branchName);
|
let enBranch = turnbar(branchName);
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`);
|
props.history.push(`/${owner}/${projectsId}/tree${enBranch?`/${enBranch}`:""}/${url}`);
|
||||||
}
|
}
|
||||||
// 点击跳转到子目录
|
// 点击跳转到子目录
|
||||||
function goToSubRoot(path,type,filename){
|
function goToSubRoot(path,type,filename){
|
||||||
|
@ -241,7 +242,7 @@ function CoderDepot(props){
|
||||||
let enBranch = branchName || defaultBranch;
|
let enBranch = branchName || defaultBranch;
|
||||||
let checkvalue = turnbar(enBranch);
|
let checkvalue = turnbar(enBranch);
|
||||||
setType(type);
|
setType(type);
|
||||||
props.history.push(`/projects/${owner}/${projectsId}${`/tree/${checkvalue}`}${path?`/${path}`:""}`);
|
props.history.push(`/${owner}/${projectsId}${`/tree/${checkvalue}`}${path?`/${path}`:""}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,7 +254,7 @@ function CoderDepot(props){
|
||||||
//点击直接跳转页面 加载一次路由
|
//点击直接跳转页面 加载一次路由
|
||||||
let enBranch = branchName || defaultBranch;
|
let enBranch = branchName || defaultBranch;
|
||||||
let checkvalue = turnbar(enBranch);
|
let checkvalue = turnbar(enBranch);
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/tree/${checkvalue}/${path}`);
|
props.history.push(`/${owner}/${projectsId}/tree/${checkvalue}/${path}`);
|
||||||
setType("file");
|
setType("file");
|
||||||
setEditReadme(true);
|
setEditReadme(true);
|
||||||
};
|
};
|
||||||
|
@ -345,13 +346,13 @@ function CoderDepot(props){
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<AlignCenter className="mr20">
|
<AlignCenter className="mr20">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/branchs`} className="color-grey-9">
|
<Link to={`/${owner}/${projectsId}/branchs`} className="color-grey-9">
|
||||||
<i className="iconfont icon-fenzhi2 font-18 color-grey-9 mr3"></i>
|
<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>分支
|
<span className="color-grey-6 mr3">{projectDetail && projectDetail.branches && projectDetail.branches.total_count}个</span>分支
|
||||||
</Link>
|
</Link>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<AlignCenter className="mr20">
|
<AlignCenter className="mr20">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/tag`} className="color-grey-9">
|
<Link to={`/${owner}/${projectsId}/tag`} className="color-grey-9">
|
||||||
<i className="iconfont icon-biaoqian3 font-16 color-grey-9 mr3"></i>
|
<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>标签
|
<span className="color-grey-6 mr3">{projectDetail && projectDetail.tags && projectDetail.tags.total_count}个</span>标签
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -363,11 +364,11 @@ function CoderDepot(props){
|
||||||
<div className="mr20 addOptionBtn">
|
<div className="mr20 addOptionBtn">
|
||||||
{
|
{
|
||||||
projectDetail.type !== 2 && pullsFlag &&
|
projectDetail.type !== 2 && pullsFlag &&
|
||||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
<a onClick={()=>urlLink(`/${owner}/${projectsId}/pulls/new`)} >+ 合并请求</a>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
issuesFlag &&
|
issuesFlag &&
|
||||||
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
<a onClick={()=>urlLink(`/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
@ -383,7 +384,7 @@ function CoderDepot(props){
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
{
|
{
|
||||||
dirInfo || fileInfo ?
|
(dirInfo && dirInfo.length>0) || fileInfo ?
|
||||||
<div className="listtable">
|
<div className="listtable">
|
||||||
{
|
{
|
||||||
lastCommit &&
|
lastCommit &&
|
||||||
|
@ -395,7 +396,7 @@ function CoderDepot(props){
|
||||||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||||
|
|
||||||
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
<span className="ml12 color-grey-9 mt3">{lastCommit && lastCommit.time_from_now}</span>
|
||||||
{ commitCount ? <Link to={`/projects/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml12 color-grey-9">
|
{ commitCount ? <Link to={`/${owner}/${projectsId}/commits/branch/${turnbar(branchName || defaultBranch)}`} className="ml12 color-grey-9">
|
||||||
<i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交
|
<i className="iconfont icon-tijiao mr3 font-17 color-grey-9"></i>{commitCount}次提交
|
||||||
</Link>:"" }
|
</Link>:"" }
|
||||||
</div>
|
</div>
|
||||||
|
@ -441,7 +442,7 @@ function CoderDepot(props){
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
(dirInfo && dirInfo.length === 0) && (fileInfo && fileInfo.length === 0) ? <Nodata _html="暂未发现文件"/> :""
|
(dirInfo && dirInfo.length === 0) && !fileInfo ? <Nodata _html="暂未发现文件"/> :""
|
||||||
}
|
}
|
||||||
{/* readme文件显示(显示文件详情时不显示readme文件) */}
|
{/* readme文件显示(显示文件详情时不显示readme文件) */}
|
||||||
{ dirInfo && (readme && readme.content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
|
{ dirInfo && (readme && readme.content) ? <ReadMe ChangeFile={ChangeFile} readme={readme} operate={props && (props.isManager || props.isDeveloper) && projectDetail.type !==2 } history={props.history} /> :"" }
|
||||||
|
@ -511,11 +512,11 @@ function CoderDepot(props){
|
||||||
}
|
}
|
||||||
{/* 贡献者 */}
|
{/* 贡献者 */}
|
||||||
{
|
{
|
||||||
projectDetail && projectDetail.contributors &&
|
projectDetail && projectDetail.contributors && projectDetail.contributors.length >0 &&
|
||||||
<Contributors contributors={projectDetail && projectDetail.contributors} owner={owner} projectsId={projectsId} />
|
<Contributors contributors={projectDetail && projectDetail.contributors} owner={owner} projectsId={projectsId} />
|
||||||
}
|
}
|
||||||
{/* 语言 */}
|
{/* 语言 */}
|
||||||
{ projectDetail && projectDetail.languages &&
|
{ projectDetail && projectDetail.languages && projectDetail.languages.length >0 &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Divider />
|
<Divider />
|
||||||
<LanguagePower languages={projectDetail.languages}/>
|
<LanguagePower languages={projectDetail.languages}/>
|
||||||
|
|
|
@ -17,7 +17,7 @@ function CoderDepotCatalogue({item , goToSubRoot , owner , projectsId }){
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
<span title="init project">
|
<span title="init project">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.commit && item.commit.sha}`)}`} title={item.commit && item.commit.message}>
|
||||||
{item.commit && item.commit.message}
|
{item.commit && item.commit.message}
|
||||||
</Link>
|
</Link>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -38,9 +38,9 @@ export default ((props)=>{
|
||||||
return(
|
return(
|
||||||
<li key={key}>
|
<li key={key}>
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/tree/${turnbar(item.name)}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
<Link to={`/${owner}/${projectsId}/tree/${turnbar(item.name)}`} className="color-blue font-15" style={{"maxWidth":"100px"}}>{item.name}</Link>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.last_commit.sha}`)}`} className="mr5 commitKey" style={{marginLeft:0}}>{item.last_commit && truncateCommitId(item.last_commit.sha)}</Link>
|
||||||
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
<span className="color-grey-3 hide-1 messages leftPoint">{item.last_commit && item.last_commit.message}</span>
|
||||||
<span className="color-grey-8 ml30">最后更新于{item.last_commit && item.last_commit.time_from_now}</span>
|
<span className="color-grey-8 ml30">最后更新于{item.last_commit && item.last_commit.time_from_now}</span>
|
||||||
</p>
|
</p>
|
||||||
|
@ -48,7 +48,7 @@ export default ((props)=>{
|
||||||
<span>
|
<span>
|
||||||
{
|
{
|
||||||
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
|
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
|
||||||
<Link to={`/projects/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
<Link to={`/${owner}/${projectsId}/pulls/new/${item.name}`} className="mr20 color-blue mr30">创建合并请求</Link>
|
||||||
}
|
}
|
||||||
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
|
<Dropdown overlay={menu(item.zip_url,item.tar_url)} trigger={['click']} placement="bottomRight" className="color-green-file">
|
||||||
<a className="ant-dropdown-link">
|
<a className="ant-dropdown-link">
|
||||||
|
|
|
@ -101,7 +101,7 @@ class CoderRootCommit extends Component{
|
||||||
// 切换分支 search:tag为根据标签搜索
|
// 切换分支 search:tag为根据标签搜索
|
||||||
changeBranch=(value)=>{
|
changeBranch=(value)=>{
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/commits/branch/${value}`);
|
this.props.history.push(`/${owner}/${projectsId}/commits/branch/${value}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangePage=(page)=>{
|
ChangePage=(page)=>{
|
||||||
|
@ -141,13 +141,13 @@ class CoderRootCommit extends Component{
|
||||||
return(
|
return(
|
||||||
<div key={k}>
|
<div key={k}>
|
||||||
<AlignTop>
|
<AlignTop>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0,marginTop:"3px"}}>{truncateCommitId(`${item.sha}`)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0,marginTop:"3px"}}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitDesc">{item.message}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitDesc">{item.message}</Link>
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
<p className="f-wrap-alignCenter mt15">
|
<p className="f-wrap-alignCenter mt15">
|
||||||
{
|
{
|
||||||
item.id ?
|
item.id ?
|
||||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
<Link to={`/${item.login}`} className="show-user-link">
|
||||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||||
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
||||||
</Link>:
|
</Link>:
|
||||||
|
|
|
@ -149,7 +149,7 @@ class CoderRootFileDetail extends Component {
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.props.showNotification("删除成功!");
|
this.props.showNotification("删除成功!");
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}`);
|
this.props.history.push(`/${owner}/${projectsId}`);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
|
|
@ -87,57 +87,57 @@ class CoderRootIndex extends Component{
|
||||||
<Top {...this.props} {...this.state}/>
|
<Top {...this.props} {...this.state}/>
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
{/* 新建文件 */}
|
{/* 新建文件 */}
|
||||||
<Route path="/projects/:owner/:projectsId/:branch/newfile/:path"
|
<Route path="/:owner/:projectsId/:branch/newfile/:path"
|
||||||
render={
|
render={
|
||||||
(props) => (<FileNew {...this.props} {...props} {...this.state} />)
|
(props) => (<FileNew {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/:branch/uploadfile"
|
<Route path="/:owner/:projectsId/:branch/uploadfile"
|
||||||
render={
|
render={
|
||||||
(props) => (<UploadFile {...this.props} {...props} {...this.state} />)
|
(props) => (<UploadFile {...this.props} {...props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/:branch/newfile"
|
<Route path="/:owner/:projectsId/:branch/newfile"
|
||||||
render={
|
render={
|
||||||
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
(props) => (<FileNew {...this.props} {...props} {...this.state} getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
<Route path="/:owner/:projectsId/commits/branch/:branchName"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/commits/:sha"
|
<Route path="/:owner/:projectsId/commits/:sha"
|
||||||
render={
|
render={
|
||||||
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
(props) => (<Diff {...this.props} {...props} {...this.state}/>)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/commits"
|
<Route path="/:owner/:projectsId/commits"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
() => (<CoderRootCommit {...this.props} {...this.state} commit_class="main" getTopCount={this.getTopCount} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/releases/:versionId/update"
|
<Route path="/:owner/:projectsId/releases/:versionId/update"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootVersionUpdate {...this.props} {...this.state} {...props} />)
|
(props) => (<CoderRootVersionUpdate {...this.props} {...this.state} {...props} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/releases/new"
|
<Route path="/:owner/:projectsId/releases/new"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootVersionNew {...this.props} {...this.state} />)
|
() => (<CoderRootVersionNew {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/releases"
|
<Route path="/:owner/:projectsId/releases"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootVersion {...this.props} {...this.state} />)
|
() => (<CoderRootVersion {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/tag"
|
<Route path="/:owner/:projectsId/tag"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootTag {...this.props} {...this.state} />)
|
() => (<CoderRootTag {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/branchs"
|
<Route path="/:owner/:projectsId/branchs"
|
||||||
render={
|
render={
|
||||||
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
() => (<CoderRootBranch {...this.props} {...this.state} />)
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ export default (( props, { projectDetail }) => {
|
||||||
<span className="font-16">{item.name}</span>
|
<span className="font-16">{item.name}</span>
|
||||||
</span>
|
</span>
|
||||||
<span className="ul_tbody_third">
|
<span className="ul_tbody_third">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`} className="commitKey" style={{ "marginLeft": 0 }}>{truncateCommitId(`${item.id}`)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.id}`)}`} className="commitKey" style={{ "marginLeft": 0 }}>{truncateCommitId(`${item.id}`)}</Link>
|
||||||
</span>
|
</span>
|
||||||
<span className="ul_tbody_forth">
|
<span className="ul_tbody_forth">
|
||||||
<a href={item.tarball_url} style={{ color: "#4CC1DA" }} className="mr30"><i className="iconfont icon-TAR font-18 mr5"></i>TAR</a>
|
<a href={item.tarball_url} style={{ color: "#4CC1DA" }} className="mr30"><i className="iconfont icon-TAR font-18 mr5"></i>TAR</a>
|
||||||
|
|
|
@ -141,8 +141,8 @@ const WikiEdit = Loadable({
|
||||||
*/
|
*/
|
||||||
function checkPathname(projectsId, owner, pathname) {
|
function checkPathname(projectsId, owner, pathname) {
|
||||||
let name = "";
|
let name = "";
|
||||||
if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
|
if (pathname && pathname !== `/${owner}/${projectsId}`) {
|
||||||
let url = pathname.split(`/projects/${owner}/${projectsId}`)[1];
|
let url = pathname.split(`/${owner}/${projectsId}`)[1];
|
||||||
if (url.indexOf("/about") > -1) {
|
if (url.indexOf("/about") > -1) {
|
||||||
name = "about"
|
name = "about"
|
||||||
} else if (url.indexOf("/issues") > -1 || url.indexOf("Milepost") > 0) {
|
} else if (url.indexOf("/issues") > -1 || url.indexOf("Milepost") > 0) {
|
||||||
|
@ -233,6 +233,8 @@ class Detail extends Component {
|
||||||
secondSync: false
|
secondSync: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
} else if (result.data.mirror_status === 2) {
|
||||||
|
this.deleteProjectBack();
|
||||||
} else {
|
} else {
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -265,7 +267,11 @@ class Detail extends Component {
|
||||||
disconnected: () => { },
|
disconnected: () => { },
|
||||||
received: data => {
|
received: data => {
|
||||||
console.log(`###### ---received data--- ######`);
|
console.log(`###### ---received data--- ######`);
|
||||||
|
console.log(data);
|
||||||
if (data) {
|
if (data) {
|
||||||
|
if ( data.project && data.project.mirror_status === 2) {
|
||||||
|
this.deleteProjectBack();
|
||||||
|
}
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
this.setState({
|
this.setState({
|
||||||
firstSync: false,
|
firstSync: false,
|
||||||
|
@ -277,6 +283,23 @@ class Detail extends Component {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deleteProjectBack = () => {
|
||||||
|
const { history } = this.props;
|
||||||
|
const { projectsId, owner } = this.props.match.params;
|
||||||
|
axios.delete(`/${owner}/${projectsId}.json`).then(res => {
|
||||||
|
let hash = '/projects/mirror/new';
|
||||||
|
if (res && res.data) {
|
||||||
|
history.push({
|
||||||
|
pathname: hash,
|
||||||
|
mirror_status: 2
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
window.location.hash = hash;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getDetail = () => {
|
getDetail = () => {
|
||||||
const { projectsId, owner } = this.props.match.params;
|
const { projectsId, owner } = this.props.match.params;
|
||||||
this.getBanner();
|
this.getBanner();
|
||||||
|
@ -381,7 +404,7 @@ class Detail extends Component {
|
||||||
const url = `/${owner}/${projectsId}/forks.json`;
|
const url = `/${owner}/${projectsId}/forks.json`;
|
||||||
axios.post(url).then(result => {
|
axios.post(url).then(result => {
|
||||||
if (result && result.data.status === 0) {
|
if (result && result.data.status === 0) {
|
||||||
this.props.history.push(`/projects/${current_user && current_user.login}/${result.data.identifier}`);
|
this.props.history.push(`/${current_user && current_user.login}/${result.data.identifier}`);
|
||||||
this.props.showNotification(result.data.message);
|
this.props.showNotification(result.data.message);
|
||||||
}
|
}
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -417,9 +440,9 @@ class Detail extends Component {
|
||||||
return forked_from_project_id && fork_info ?
|
return forked_from_project_id && fork_info ?
|
||||||
<div className="color-grey-9 df">
|
<div className="color-grey-9 df">
|
||||||
<span>复刻自</span>
|
<span>复刻自</span>
|
||||||
<Link to={`${type ==="Organization" ? "/organize":'/users'}/${fork_info.fork_project_user_login}`} className="show-user-link color-grey-6 ml5">{fork_info.fork_project_user_name}</Link>
|
<Link to={`/${fork_info.fork_project_user_login}`} className="show-user-link color-grey-6 ml5">{fork_info.fork_project_user_name}</Link>
|
||||||
<span> / </span>
|
<span> / </span>
|
||||||
<Link to={`/projects/${fork_info.fork_project_user_login}/${fork_info.fork_project_identifier}`} className="color-grey-6 task-hide flex1" style={{maxWidth:"400px"}} title={fork_info.fork_form_name}>{fork_info.fork_form_name}</Link>
|
<Link to={`/${fork_info.fork_project_user_login}/${fork_info.fork_project_identifier}`} className="color-grey-6 task-hide flex1" style={{ maxWidth: "400px" }} title={fork_info.fork_form_name}>{fork_info.fork_form_name}</Link>
|
||||||
</div> : ""
|
</div> : ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -453,10 +476,10 @@ class Detail extends Component {
|
||||||
<AlignTop>
|
<AlignTop>
|
||||||
<div className="projectallName">
|
<div className="projectallName">
|
||||||
{project && project.author &&
|
{project && project.author &&
|
||||||
<Link to={`${project.author.type ==="Organization" ? "/organize":'/users'}/${project.author.login}`}>{project.author.name}</Link>
|
<Link to={`/${project.author.login}`}>{project.author.name}</Link>
|
||||||
}
|
}
|
||||||
<span className="ml5 mr5">/</span>
|
<span className="ml5 mr5">/</span>
|
||||||
<Link to={`/projects/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link>
|
<Link to={`/${owner}/${projectsId}`} className="projectN mt6">{projectDetail && projectDetail.name}</Link>
|
||||||
</div>
|
</div>
|
||||||
{projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
|
{projectDetail && projectDetail.private && <span className="privateTag mt6">私有</span>}
|
||||||
</AlignTop>
|
</AlignTop>
|
||||||
|
@ -489,7 +512,7 @@ class Detail extends Component {
|
||||||
{
|
{
|
||||||
watchers_count > 0 ?
|
watchers_count > 0 ?
|
||||||
platform ?
|
platform ?
|
||||||
<Link className="detail_tag_btn_count" style={{color:`${watched?"#2878FF":"#666"}`}} to={platform?{ pathname: `/projects/${owner}/${projectsId}/watchers`, state }:""}>
|
<Link className="detail_tag_btn_count" style={{ color: `${watched ? "#2878FF" : "#666"}` }} to={platform ? { pathname: `/${owner}/${projectsId}/watchers`, state } : ""}>
|
||||||
{watchers_count}
|
{watchers_count}
|
||||||
</Link>
|
</Link>
|
||||||
:
|
:
|
||||||
|
@ -505,7 +528,7 @@ class Detail extends Component {
|
||||||
{
|
{
|
||||||
praises_count > 0 ?
|
praises_count > 0 ?
|
||||||
platform ?
|
platform ?
|
||||||
<Link className="detail_tag_btn_count" style={{color:`${praised?"#2878FF":"#666"}`}} to={{ pathname: `/projects/${owner}/${projectsId}/stargazers`, state }}>
|
<Link className="detail_tag_btn_count" style={{ color: `${praised ? "#2878FF" : "#666"}` }} to={{ pathname: `/${owner}/${projectsId}/stargazers`, state }}>
|
||||||
{praises_count}
|
{praises_count}
|
||||||
</Link> :
|
</Link> :
|
||||||
<span className="detail_tag_btn_count">{praises_count}</span>
|
<span className="detail_tag_btn_count">{praises_count}</span>
|
||||||
|
@ -521,7 +544,7 @@ class Detail extends Component {
|
||||||
{
|
{
|
||||||
forked_count > 0 ?
|
forked_count > 0 ?
|
||||||
platform ?
|
platform ?
|
||||||
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${owner}/${projectsId}/fork_users`, state }}>
|
<Link className="detail_tag_btn_count" to={{ pathname: `/${owner}/${projectsId}/fork_users`, state }}>
|
||||||
{forked_count}
|
{forked_count}
|
||||||
</Link>
|
</Link>
|
||||||
:
|
:
|
||||||
|
@ -560,190 +583,190 @@ class Detail extends Component {
|
||||||
<Spin spinning={secondSync} className="spinstyle" tip="正在同步镜像" size="large">
|
<Spin spinning={secondSync} className="spinstyle" tip="正在同步镜像" size="large">
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
{/* 资源 */}
|
{/* 资源 */}
|
||||||
<Route path="/projects/:owner/:projectsId/source"
|
<Route path="/:owner/:projectsId/source"
|
||||||
render={
|
render={
|
||||||
() => (<Source {...this.props} {...this.state} {...common} />)
|
() => (<Source {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 主页 */}
|
{/* 主页 */}
|
||||||
<Route path="/projects/:owner/:projectsId/about"
|
<Route path="/:owner/:projectsId/about"
|
||||||
render={
|
render={
|
||||||
() => (<DevAbout {...this.props} {...this.state} {...common} />)
|
() => (<DevAbout {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* wiki新增文件 */}
|
{/* wiki新增文件 */}
|
||||||
<Route path="/projects/:owner/:projectsId/wiki/add"
|
<Route path="/:owner/:projectsId/wiki/add"
|
||||||
render={
|
render={
|
||||||
() => (<WikiEdit {...this.props} {...this.state} {...common} />)
|
() => (<WikiEdit {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* wiki编辑文件 */}
|
{/* wiki编辑文件 */}
|
||||||
<Route path="/projects/:owner/:projectsId/wiki/edit/:wikiName"
|
<Route path="/:owner/:projectsId/wiki/edit/:wikiName"
|
||||||
render={
|
render={
|
||||||
() => (<WikiEdit {...this.props} {...this.state} {...common} />)
|
() => (<WikiEdit {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* wiki */}
|
{/* wiki */}
|
||||||
<Route path="/projects/:owner/:projectsId/wiki"
|
<Route path="/:owner/:projectsId/wiki"
|
||||||
render={
|
render={
|
||||||
() => (<Wiki {...this.props} {...this.state} {...common} />)
|
() => (<Wiki {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 工作流 */}
|
{/* 工作流 */}
|
||||||
<Route path="/projects/:owner/:projectsId/devops"
|
<Route path="/:owner/:projectsId/devops"
|
||||||
render={
|
render={
|
||||||
() => (<DevIndex {...this.props} {...this.state} {...common} />)
|
() => (<DevIndex {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 标签列表 */}
|
{/* 标签列表 */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues/tags"
|
<Route path="/:owner/:projectsId/issues/tags"
|
||||||
render={
|
render={
|
||||||
(props) => (<TagList {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<TagList {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 仓库设置 */}
|
{/* 仓库设置 */}
|
||||||
<Route path="/projects/:owner/:projectsId/setting"
|
<Route path="/:owner/:projectsId/setting"
|
||||||
render={
|
render={
|
||||||
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 任务详情 */}
|
{/* 任务详情 */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues/:orderId/detail"
|
<Route path="/:owner/:projectsId/issues/:orderId/detail"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderDetail {...this.props} {...this.state} {...props} {...common} />)
|
(props) => (<OrderDetail {...this.props} {...this.state} {...props} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/*修改里程碑*/}
|
{/*修改里程碑*/}
|
||||||
<Route path="/projects/:owner/:projectsId/milestones/:meilid/edit"
|
<Route path="/:owner/:projectsId/milestones/:meilid/edit"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 新建里程碑 */}
|
{/* 新建里程碑 */}
|
||||||
<Route path="/projects/:owner/:projectsId/milestones/new"
|
<Route path="/:owner/:projectsId/milestones/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/*里程碑详情*/}
|
{/*里程碑详情*/}
|
||||||
<Route path="/projects/:owner/:projectsId/milestones/:meilid"
|
<Route path="/:owner/:projectsId/milestones/:meilid"
|
||||||
render={
|
render={
|
||||||
(props) => (<MilepostDetail {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<MilepostDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 里程碑 */}
|
{/* 里程碑 */}
|
||||||
<Route path="/projects/:owner/:projectsId/milestones"
|
<Route path="/:owner/:projectsId/milestones"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 里程碑页面新建任务 */}
|
{/* 里程碑页面新建任务 */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues/:milepostId/new"
|
<Route path="/:owner/:projectsId/issues/:milepostId/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 新建任务 */}
|
{/* 新建任务 */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues/new"
|
<Route path="/:owner/:projectsId/issues/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 修改详情 */}
|
{/* 修改详情 */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues/:orderId/updatedetail"
|
<Route path="/:owner/:projectsId/issues/:orderId/updatedetail"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 复制详情 */}
|
{/* 复制详情 */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues/:orderId/copyetail"
|
<Route path="/:owner/:projectsId/issues/:orderId/copyetail"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 动态 */}
|
{/* 动态 */}
|
||||||
<Route path="/projects/:owner/:projectsId/activity"
|
<Route path="/:owner/:projectsId/activity"
|
||||||
render={
|
render={
|
||||||
(props) => (<TrendsIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<TrendsIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 代码Index */}
|
{/* 代码Index */}
|
||||||
<Route path="/projects/:owner/:projectsId/issues"
|
<Route path="/:owner/:projectsId/issues"
|
||||||
render={
|
render={
|
||||||
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 新建合并请求 */}
|
{/* 新建合并请求 */}
|
||||||
<Route path="/projects/:owner/:projectsId/pulls/new/:branch"
|
<Route path="/:owner/:projectsId/pulls/new/:branch"
|
||||||
render={
|
render={
|
||||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/pulls/new"
|
<Route path="/:owner/:projectsId/pulls/new"
|
||||||
render={
|
render={
|
||||||
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/pulls/:mergeId/UpdateMerge"
|
<Route path="/:owner/:projectsId/pulls/:mergeId/UpdateMerge"
|
||||||
render={
|
render={
|
||||||
(props) => (<UpdateMerge {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<UpdateMerge {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/pulls/:mergeId/Messagecount"
|
<Route path="/:owner/:projectsId/pulls/:mergeId/Messagecount"
|
||||||
render={
|
render={
|
||||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/pulls/:mergeId/MergeSubmit"
|
<Route path="/:owner/:projectsId/pulls/:mergeId/MergeSubmit"
|
||||||
render={
|
render={
|
||||||
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
<Route path="/projects/:owner/:projectsId/pulls"
|
<Route path="/:owner/:projectsId/pulls"
|
||||||
render={
|
render={
|
||||||
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/watchers"
|
<Route path="/:owner/:projectsId/watchers"
|
||||||
render={
|
render={
|
||||||
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/stargazers"
|
<Route path="/:owner/:projectsId/stargazers"
|
||||||
render={
|
render={
|
||||||
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/fork_users"
|
<Route path="/:owner/:projectsId/fork_users"
|
||||||
render={
|
render={
|
||||||
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 贡献者列表 */}
|
{/* 贡献者列表 */}
|
||||||
<Route path="/projects/:owner/:projectsId/contribute"
|
<Route path="/:owner/:projectsId/contribute"
|
||||||
render={
|
render={
|
||||||
() => (<Contribute {...this.props} {...this.state} {...common} />)
|
() => (<Contribute {...this.props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
|
|
||||||
{/* 代码库----详情页面 */}
|
{/* 代码库----详情页面 */}
|
||||||
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
<Route path="/:owner/:projectsId/commits/branch/:branchName"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
<Route path="/:owner/:projectsId/tree/:branchName"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId/:subIndex"
|
<Route path="/:owner/:projectsId/:subIndex"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<Route path="/projects/:owner/:projectsId"
|
<Route path="/:owner/:projectsId"
|
||||||
render={
|
render={
|
||||||
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common} />)
|
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common} />)
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,19 +12,19 @@ class DetailTop extends Component {
|
||||||
{
|
{
|
||||||
platform ?
|
platform ?
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits`} className={pathname.indexOf("/commits") > 0 ? "active" : ""}>
|
<Link to={`/${owner}/${projectsId}/commits`} className={pathname.indexOf("/commits") > 0 ? "active" : ""}>
|
||||||
<i className="iconfont icon-tijiaojilu font-20 mr3 font-bd"></i>
|
<i className="iconfont icon-tijiaojilu font-20 mr3 font-bd"></i>
|
||||||
<span>{(coderCount && coderCount.commits_count) || 0}</span>个提交
|
<span>{(coderCount && coderCount.commits_count) || 0}</span>个提交
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/branchs`} className={pathname.indexOf("/branchs") > 0 ? "active" : ""}>
|
<Link to={`/${owner}/${projectsId}/branchs`} className={pathname.indexOf("/branchs") > 0 ? "active" : ""}>
|
||||||
<i className="iconfont icon-fenzhi1 font-18 mr3"></i>
|
<i className="iconfont icon-fenzhi1 font-18 mr3"></i>
|
||||||
<span>{(coderCount && coderCount.branches_count) || 0}</span>个分支
|
<span>{(coderCount && coderCount.branches_count) || 0}</span>个分支
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/tag`} className={pathname.indexOf("/tag") > 0 ? "active" : ""}>
|
<Link to={`/${owner}/${projectsId}/tag`} className={pathname.indexOf("/tag") > 0 ? "active" : ""}>
|
||||||
<i className="iconfont icon-biaoqian3 font-18 mr3"></i>
|
<i className="iconfont icon-biaoqian3 font-18 mr3"></i>
|
||||||
<span>{(coderCount && coderCount.tags_count) || 0}</span>个标签
|
<span>{(coderCount && coderCount.tags_count) || 0}</span>个标签
|
||||||
</Link>
|
</Link>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/releases`} className={pathname.indexOf("/releases") > 0 ? "active" : ""}>
|
<Link to={`/${owner}/${projectsId}/releases`} className={pathname.indexOf("/releases") > 0 ? "active" : ""}>
|
||||||
<i className="iconfont icon-fahangban font-18 mr3"></i>
|
<i className="iconfont icon-fahangban font-18 mr3"></i>
|
||||||
<span>{(coderCount && coderCount.version_releasesed_count) || 0}</span>个发行版
|
<span>{(coderCount && coderCount.version_releasesed_count) || 0}</span>个发行版
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -59,7 +59,7 @@ export default ({ match , history }) => {
|
||||||
{commit && commit.message &&
|
{commit && commit.message &&
|
||||||
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
|
<pre className="task-hide" style={{marginBottom:"0px",height:"28px",whiteSpace:"pre-wrap"}}>{commit.message}</pre>
|
||||||
}
|
}
|
||||||
<Button type="primary" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
<Button type="primary" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(sha)}`)}} className="ml30">浏览代码</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="f-wrap-between" style={{ alignItems: "center" }}>
|
<div className="f-wrap-between" style={{ alignItems: "center" }}>
|
||||||
|
|
|
@ -228,7 +228,7 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
getoDetail=(login,identifier)=>{
|
getoDetail=(login,identifier)=>{
|
||||||
this.props.history.push(`/projects/${login}/${identifier}`);
|
this.props.history.push(`/${login}/${identifier}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择语言类别
|
// 选择语言类别
|
||||||
|
|
|
@ -28,14 +28,14 @@ class IndexItem extends Component {
|
||||||
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
<img className="p-r-photo" alt="" src={item.author && item.author.image_url} ></img>
|
||||||
</a>
|
</a>
|
||||||
:
|
:
|
||||||
<Link to={item.author && (item.author.type === "Organization" ? `/organize/${item.author.login}`:`/users/${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>
|
<img className="p-r-photo" alt="" src={getImageUrl(`/${item.author && item.author.image_url}`)} ></img>
|
||||||
</Link>
|
</Link>
|
||||||
}
|
}
|
||||||
<div className="p-r-Infos">
|
<div className="p-r-Infos">
|
||||||
<div className="p-r-name">
|
<div className="p-r-name">
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<Link to={`/projects/${item.author.login}/${item.identifier}`} title={`${item.author.name}/${item.name}`} className="color-grey-3 font-18 task-hide " style={{maxWidth: 470 }}>
|
<Link to={`/${item.author.login}/${item.identifier}`} title={`${item.author.name}/${item.name}`} className="color-grey-3 font-18 task-hide " style={{maxWidth: 470 }}>
|
||||||
{item.author.name}/{item.name}
|
{item.author.name}/{item.name}
|
||||||
</Link>
|
</Link>
|
||||||
{ !item.is_public && <span className="privateTag">私有</span> }
|
{ !item.is_public && <span className="privateTag">私有</span> }
|
||||||
|
|
|
@ -52,7 +52,7 @@ function Contribute(props){
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`/${item.image_url}`)} width="50px" height="50px"/>
|
<img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`/${item.image_url}`)} width="50px" height="50px"/>
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/users/${item.login}`} className="font-16">{item.name}</Link>
|
<Link to={`/${item.login}`} className="font-16">{item.name}</Link>
|
||||||
<p className="font-12 color-grey-9">提交{item.contributions}次</p>
|
<p className="font-12 color-grey-9">提交{item.contributions}次</p>
|
||||||
</div>
|
</div>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
|
|
|
@ -10,7 +10,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
if(pathname && pathname==="source"){
|
if(pathname && pathname==="source"){
|
||||||
let a = list.filter(item=>item.menu_name === "resources");
|
let a = list.filter(item=>item.menu_name === "resources");
|
||||||
if(a && a.length === 0){
|
if(a && a.length === 0){
|
||||||
history.push(`/projects/${owner}/${projectsId}`);
|
history.push(`/${owner}/${projectsId}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setMenuName(list);
|
setMenuName(list);
|
||||||
|
@ -28,7 +28,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "home" &&
|
item.menu_name === "home" &&
|
||||||
<li className={pathname==="about" ? "active" : ""}>
|
<li className={pathname==="about" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/about`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/about`, state }}>
|
||||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-zhuye1 color-grey-3 mr5 font-14":"iconfont icon-zhuye1 color-grey-6 font-14 mr5"}></i>
|
<i className={(pathname==="" || urlFlag) ? "iconfont icon-zhuye1 color-grey-3 mr5 font-14":"iconfont icon-zhuye1 color-grey-6 font-14 mr5"}></i>
|
||||||
<span>主页</span>
|
<span>主页</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -37,7 +37,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "code" &&
|
item.menu_name === "code" &&
|
||||||
<li className={(pathname==="" || urlFlag) ? "active" : ""}>
|
<li className={(pathname==="" || urlFlag) ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}`, state }}>
|
||||||
<i className={(pathname==="" || urlFlag) ? "iconfont icon-daimaku color-grey-3 mr5 font-14":"iconfont icon-daimaku color-grey-6 font-14 mr5"}></i>
|
<i className={(pathname==="" || urlFlag) ? "iconfont icon-daimaku color-grey-3 mr5 font-14":"iconfont icon-daimaku color-grey-6 font-14 mr5"}></i>
|
||||||
<span>代码库</span>
|
<span>代码库</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -47,7 +47,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
item.menu_name === "issues" &&
|
item.menu_name === "issues" &&
|
||||||
<li className={pathname==="issues" ? "active" : ""}>
|
<li className={pathname==="issues" ? "active" : ""}>
|
||||||
<Tooltip title="易修是Issue的中文名,即问题列表" placement="bottom">
|
<Tooltip title="易修是Issue的中文名,即问题列表" placement="bottom">
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/issues`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/issues`, state }}>
|
||||||
<i className={pathname==="issues" ? "iconfont icon-renwu color-grey-3 mr5 font-14":"iconfont icon-renwu color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="issues" ? "iconfont icon-renwu color-grey-3 mr5 font-14":"iconfont icon-renwu color-grey-6 font-14 mr5"}></i>
|
||||||
<span>易修</span>
|
<span>易修</span>
|
||||||
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
||||||
|
@ -58,7 +58,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "pulls" && projectDetail && parseInt(projectDetail.type) !== 2 && platform ?
|
item.menu_name === "pulls" && projectDetail && parseInt(projectDetail.type) !== 2 && platform ?
|
||||||
<li className={pathname==="pulls" ? "active" : ""}>
|
<li className={pathname==="pulls" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/pulls`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/pulls`, state }}>
|
||||||
<i className={pathname==="pulls" ? "iconfont icon-hebingqingqiu1 color-grey-3 mr5 font-14":"iconfont icon-hebingqingqiu1 color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="pulls" ? "iconfont icon-hebingqingqiu1 color-grey-3 mr5 font-14":"iconfont icon-hebingqingqiu1 color-grey-6 font-14 mr5"}></i>
|
||||||
<span>合并请求</span>
|
<span>合并请求</span>
|
||||||
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</span> : ""}
|
{projectDetail && projectDetail.pull_requests_count ? <span className="num">{projectDetail.pull_requests_count}</span> : ""}
|
||||||
|
@ -68,7 +68,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "wiki" &&
|
item.menu_name === "wiki" &&
|
||||||
<li className={pathname === "wiki" ? "active" : ""}>
|
<li className={pathname === "wiki" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/wiki`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/wiki`, state }}>
|
||||||
<i className={pathname==="wiki" ? "iconfont icon-wiki_icon color-grey-3 mr5 font-14":"iconfont icon-wiki_icon color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="wiki" ? "iconfont icon-wiki_icon color-grey-3 mr5 font-14":"iconfont icon-wiki_icon color-grey-6 font-14 mr5"}></i>
|
||||||
<span>Wiki</span>
|
<span>Wiki</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -77,7 +77,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "devops" && platform ?
|
item.menu_name === "devops" && platform ?
|
||||||
<li className={pathname==="devops" ? "active" : ""}>
|
<li className={pathname==="devops" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/devops${open_devops ? `/dispose`:""}`, state }}>
|
||||||
<i className="iconfont icon-gongzuoliu font-13 mr8"></i>工作流(beta版)
|
<i className="iconfont icon-gongzuoliu font-13 mr8"></i>工作流(beta版)
|
||||||
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
{projectDetail && projectDetail.ops_count ? <span>{projectDetail.ops_count}</span> : ""}
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -85,19 +85,19 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
:""
|
:""
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
item.menu_name === "resources" &&
|
// item.menu_name === "resources" &&
|
||||||
<li className={pathname==="source" ? "active" : ""}>
|
// <li className={pathname==="source" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/source`, state }}>
|
// <Link to={{ pathname: `/${owner}/${projectsId}/source`, state }}>
|
||||||
<i className={pathname==="source" ? "iconfont icon-ziyuanpaihanghetuijian color-grey-3 mr5 font-14":"iconfont icon-ziyuanpaihanghetuijian color-grey-6 font-14 mr5"}></i>
|
// <i className={pathname==="source" ? "iconfont icon-ziyuanpaihanghetuijian color-grey-3 mr5 font-14":"iconfont icon-ziyuanpaihanghetuijian color-grey-6 font-14 mr5"}></i>
|
||||||
<span>资源库</span>
|
// <span>资源库</span>
|
||||||
{projectDetail && projectDetail.source_count ? <span className="num">{projectDetail.source_count}</span> :""}
|
// {projectDetail && projectDetail.source_count ? <span className="num">{projectDetail.source_count}</span> :""}
|
||||||
</Link>
|
// </Link>
|
||||||
</li>
|
// </li>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
item.menu_name === "versions" &&
|
item.menu_name === "versions" &&
|
||||||
<li className={pathname==="milestones" ? "active" : ""}>
|
<li className={pathname==="milestones" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/milestones`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/milestones`, state }}>
|
||||||
<i className={pathname==="milestones" ? "iconfont icon-lichengbei color-grey-3 mr5 font-14":"iconfont icon-lichengbei color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="milestones" ? "iconfont icon-lichengbei color-grey-3 mr5 font-14":"iconfont icon-lichengbei color-grey-6 font-14 mr5"}></i>
|
||||||
<span>里程碑</span>
|
<span>里程碑</span>
|
||||||
{projectDetail && projectDetail.versions_count ? <span className="num">{projectDetail.versions_count}</span> :""}
|
{projectDetail && projectDetail.versions_count ? <span className="num">{projectDetail.versions_count}</span> :""}
|
||||||
|
@ -107,7 +107,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "activity" &&
|
item.menu_name === "activity" &&
|
||||||
<li className={pathname==="activity" ? "active" : ""}>
|
<li className={pathname==="activity" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/activity`, state }}>
|
<Link to={{ pathname: `/${owner}/${projectsId}/activity`, state }}>
|
||||||
<i className={pathname==="activity" ? "iconfont icon-tongzhi color-grey-3 mr5 font-14":"iconfont icon-tongzhi color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="activity" ? "iconfont icon-tongzhi color-grey-3 mr5 font-14":"iconfont icon-tongzhi color-grey-6 font-14 mr5"}></i>
|
||||||
<span>动态</span>
|
<span>动态</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -116,7 +116,7 @@ function DetailBanner({ history,list , owner , projectsId , isManager , url , pa
|
||||||
{
|
{
|
||||||
item.menu_name === "setting" &&
|
item.menu_name === "setting" &&
|
||||||
<li className={pathname === "setting" ? "active" : ""}>
|
<li className={pathname === "setting" ? "active" : ""}>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting`}>
|
<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>
|
<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>
|
||||||
<span>仓库设置</span>
|
<span>仓库设置</span>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
@ -16,10 +16,10 @@ function Commits({ commits , projectsId , owner }){
|
||||||
<div className="prInfo">
|
<div className="prInfo">
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0}}>{truncateCommitId(`${item.sha}`)}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${item.sha}`)}`} className="commitKey" style={{marginLeft:0}}>{truncateCommitId(`${item.sha}`)}</Link>
|
||||||
<p className="ml15 font-16 color-grey-3 task-hide" style={{maxWidth:"700px"}}>{item.message}</p>
|
<p className="ml15 font-16 color-grey-3 task-hide" style={{maxWidth:"700px"}}>{item.message}</p>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
<AlignCenter className="mt15">
|
<AlignCenter className="mt15">
|
||||||
<User url={getImageUrl(`/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
<User url={getImageUrl(`/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
||||||
|
|
|
@ -47,7 +47,7 @@ function Files({data,history,owner,projectsId}){
|
||||||
<span>{item.name}</span>
|
<span>{item.name}</span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<span>
|
<span>
|
||||||
<Button className="mr20" onClick={()=>{history.push(`/projects/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}/${item.name}`)}}>查看文件</Button>
|
<Button className="mr20" onClick={()=>{history.push(`/${owner}/${projectsId}/tree/${truncateCommitId(item.sha)}/${item.name}`)}}>查看文件</Button>
|
||||||
<span className="color-green">+{item.addition}</span>
|
<span className="color-green">+{item.addition}</span>
|
||||||
<span className="color-red ml20">-{item.deletion}</span>
|
<span className="color-red ml20">-{item.deletion}</span>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -228,7 +228,7 @@ class MergeDetail extends Component {
|
||||||
<div>
|
<div>
|
||||||
{
|
{
|
||||||
data && data.issue.user_permission ?
|
data && data.issue.user_permission ?
|
||||||
<Link to={`/projects/${owner}/${projectsId}/pulls/${mergeid}/updatemerge`} className="color-blue fr">编辑</Link>
|
<Link to={`/${owner}/${projectsId}/pulls/${mergeid}/updatemerge`} className="color-blue fr">编辑</Link>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -248,8 +248,8 @@ class MergeDetail extends Component {
|
||||||
<div className="detailHeader-wrapper">
|
<div className="detailHeader-wrapper">
|
||||||
<div className="normal f-wrap-between">
|
<div className="normal f-wrap-between">
|
||||||
<ul className="headerMenu-wrapper">
|
<ul className="headerMenu-wrapper">
|
||||||
<li className={url.indexOf("Messagecount") > 0 ? "active" : ""}><Link to={`/projects/${owner}/${projectsId}/pulls/${mergeid}/Messagecount`}>对话内容</Link></li>
|
<li className={url.indexOf("Messagecount") > 0 ? "active" : ""}><Link to={`/${owner}/${projectsId}/pulls/${mergeid}/Messagecount`}>对话内容</Link></li>
|
||||||
<li className={url.indexOf("MergeSubmit") > 0 ? "active" : ""}><Link to={`/projects/${owner}/${projectsId}/pulls/${mergeid}/MergeSubmit`}>代码提交</Link></li>
|
<li className={url.indexOf("MergeSubmit") > 0 ? "active" : ""}><Link to={`/${owner}/${projectsId}/pulls/${mergeid}/MergeSubmit`}>代码提交</Link></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -49,7 +49,7 @@ class MergeItem extends Component {
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { issues, project_name, project_author_name , user_admin_or_member} = this.props;
|
const { issues, project_name, project_author_name , user_admin_or_developer} = this.props;
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const { current_user } = this.props;
|
const { current_user } = this.props;
|
||||||
const renderList = () => {
|
const renderList = () => {
|
||||||
|
@ -62,7 +62,7 @@ class MergeItem extends Component {
|
||||||
<p className="mb15 df" style={{ alignItems: "center" }}>
|
<p className="mb15 df" style={{ alignItems: "center" }}>
|
||||||
<i className={`iconfont icon-hebingqingqiu1 font-14 mr3 i_${status}`}></i>
|
<i className={`iconfont icon-hebingqingqiu1 font-14 mr3 i_${status}`}></i>
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}
|
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}
|
||||||
className="hide-1 font-15 color-grey-3 fwb lineh-30 mr10"
|
className="hide-1 font-15 color-grey-3 fwb lineh-30 mr10"
|
||||||
style={{ maxWidth: "300px" }}
|
style={{ maxWidth: "300px" }}
|
||||||
>
|
>
|
||||||
|
@ -78,7 +78,7 @@ class MergeItem extends Component {
|
||||||
</p>
|
</p>
|
||||||
<p className="grid-item font-13">
|
<p className="grid-item font-13">
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item && item.author_login}`}
|
to={`/${item && item.author_login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
@ -91,7 +91,7 @@ class MergeItem extends Component {
|
||||||
</Link>
|
</Link>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item && item.author_login}`}
|
to={`/${item && item.author_login}`}
|
||||||
className="show-user-link color-grey-8 ml5"
|
className="show-user-link color-grey-8 ml5"
|
||||||
>
|
>
|
||||||
{item && item.author_name}
|
{item && item.author_name}
|
||||||
|
@ -109,7 +109,7 @@ class MergeItem extends Component {
|
||||||
item.pull_request_head &&
|
item.pull_request_head &&
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${turnbar(item.pull_request_head)}`}
|
to={`/${item.is_original ? item.fork_project_user : owner}/${ item.is_original ? item.fork_project_identifier : projectsId }/tree/${turnbar(item.pull_request_head)}`}
|
||||||
className="maxW200px hide-1 ver-middle"
|
className="maxW200px hide-1 ver-middle"
|
||||||
>
|
>
|
||||||
{item.is_original
|
{item.is_original
|
||||||
|
@ -133,7 +133,7 @@ class MergeItem extends Component {
|
||||||
item.pull_request_base &&
|
item.pull_request_base &&
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`}
|
to={`/${owner}/${projectsId}/tree/${turnbar(item.pull_request_base)}`}
|
||||||
className="maxW200px hide-1 ver-middle"
|
className="maxW200px hide-1 ver-middle"
|
||||||
>
|
>
|
||||||
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
|
||||||
|
@ -156,7 +156,7 @@ class MergeItem extends Component {
|
||||||
<li>
|
<li>
|
||||||
{item.assign_user_name ? (
|
{item.assign_user_name ? (
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item.assign_user_login}`}
|
to={`/${item.assign_user_login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
{item.assign_user_name}
|
{item.assign_user_name}
|
||||||
|
@ -175,7 +175,7 @@ class MergeItem extends Component {
|
||||||
{item.journals_count ? (
|
{item.journals_count ? (
|
||||||
<Link
|
<Link
|
||||||
className="mr5 color-grey-8"
|
className="mr5 color-grey-8"
|
||||||
to={`/projects/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}
|
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/Messagecount`}
|
||||||
>
|
>
|
||||||
<i className="iconfont icon-huifu1 font-15 mr5 ver-middle"></i>
|
<i className="iconfont icon-huifu1 font-15 mr5 ver-middle"></i>
|
||||||
{item.journals_count}
|
{item.journals_count}
|
||||||
|
@ -183,7 +183,7 @@ class MergeItem extends Component {
|
||||||
) : (
|
) : (
|
||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
{user_admin_or_member && item.pull_request_status === 0 ? (
|
{user_admin_or_developer && item.pull_request_status === 0 ? (
|
||||||
<div
|
<div
|
||||||
className="milepostleft"
|
className="milepostleft"
|
||||||
style={{
|
style={{
|
||||||
|
@ -196,7 +196,7 @@ class MergeItem extends Component {
|
||||||
>
|
>
|
||||||
<div className="grid-item mr15 color-grey-9">
|
<div className="grid-item mr15 color-grey-9">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/pulls/${item.pull_request_id}/updatemerge`}
|
to={`/${owner}/${projectsId}/pulls/${item.pull_request_id}/updatemerge`}
|
||||||
className="color-grey-9"
|
className="color-grey-9"
|
||||||
>
|
>
|
||||||
<i className="iconfont icon-bianji3 font-14 mr5"></i>
|
<i className="iconfont icon-bianji3 font-14 mr5"></i>
|
||||||
|
|
|
@ -100,7 +100,7 @@ class MergeSubmit extends Component{
|
||||||
width:"10%",
|
width:"10%",
|
||||||
render: (text,item) => (
|
render: (text,item) => (
|
||||||
<span className="f-wrap-alignCenter">
|
<span className="f-wrap-alignCenter">
|
||||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
<Link to={`/${item.login}`} className="show-user-link">
|
||||||
<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
||||||
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
|
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -110,7 +110,7 @@ class MergeSubmit extends Component{
|
||||||
title:"SHA",
|
title:"SHA",
|
||||||
dataIndex: 'sha',
|
dataIndex: 'sha',
|
||||||
render: (text) => (
|
render: (text) => (
|
||||||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(`${text}`)}`} className="commitKey">{text}</Link>
|
<Link to={`/${owner}/${projectsId}/commits/${truncateCommitId(`${text}`)}`} className="commitKey">{text}</Link>
|
||||||
)
|
)
|
||||||
},{
|
},{
|
||||||
title:"备注",
|
title:"备注",
|
||||||
|
|
|
@ -361,7 +361,7 @@ class MessageCount extends Component {
|
||||||
<div className="mt15">
|
<div className="mt15">
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
|
to={`/${data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}/${data.pull_request.is_original?data.project_identifier:projectsId}/tree/${turnbar(data.pull_request && data.pull_request.head)}`}
|
||||||
className="ver-middle"
|
className="ver-middle"
|
||||||
>
|
>
|
||||||
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {turnbar(data.pull_request && data.pull_request.head)}
|
{data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {turnbar(data.pull_request && data.pull_request.head)}
|
||||||
|
@ -376,7 +376,7 @@ class MessageCount extends Component {
|
||||||
</span>
|
</span>
|
||||||
<Tag className="pr-branch-tag">
|
<Tag className="pr-branch-tag">
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/tree/${data.pull_request.base}`}
|
to={`/${owner}/${projectsId}/tree/${data.pull_request.base}`}
|
||||||
className="ver-middle"
|
className="ver-middle"
|
||||||
>
|
>
|
||||||
{data.issue.project_author_name}:{data.pull_request.base}
|
{data.issue.project_author_name}:{data.pull_request.base}
|
||||||
|
@ -386,14 +386,14 @@ class MessageCount extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
<div className="mt15">
|
<div className="mt15">
|
||||||
<Link to={`/users/${data.issue.author_login}`} className="show-user-link">
|
<Link to={`/${data.issue.author_login}`} className="show-user-link">
|
||||||
<img className="mr5" src={getImageUrl(`/${data.issue.author_picture}`)}
|
<img className="mr5" src={getImageUrl(`/${data.issue.author_picture}`)}
|
||||||
alt="" width="24" height="24" style={{borderRadius:"50%"}}
|
alt="" width="24" height="24" style={{borderRadius:"50%"}}
|
||||||
/>
|
/>
|
||||||
</Link>
|
</Link>
|
||||||
<span className="ver-middle">
|
<span className="ver-middle">
|
||||||
<span className="color-grey-8 mr5">由</span>
|
<span className="color-grey-8 mr5">由</span>
|
||||||
<Link to={`/users/${data.issue.author_login}`} className="show-user-link color-blue">
|
<Link to={`/${data.issue.author_login}`} className="show-user-link color-blue">
|
||||||
{data.issue.author_name}
|
{data.issue.author_name}
|
||||||
</Link>
|
</Link>
|
||||||
<span className="ml5 color-grey-8">
|
<span className="ml5 color-grey-8">
|
||||||
|
@ -408,7 +408,7 @@ class MessageCount extends Component {
|
||||||
<span className="color-grey-8">审查人员:</span>
|
<span className="color-grey-8">审查人员:</span>
|
||||||
{data.issue.assign_user_name ? (
|
{data.issue.assign_user_name ? (
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${data.issue.assign_user_login}`}
|
to={`/${data.issue.assign_user_login}`}
|
||||||
className="show-user-link color-blue"
|
className="show-user-link color-blue"
|
||||||
>
|
>
|
||||||
{data.issue.assign_user_name}
|
{data.issue.assign_user_name}
|
||||||
|
@ -448,7 +448,7 @@ class MessageCount extends Component {
|
||||||
type="green"
|
type="green"
|
||||||
ghost
|
ghost
|
||||||
className="ml20"
|
className="ml20"
|
||||||
onClick={()=>{this.props.history.push(`/projects/${owner}/${projectsId}/pulls/${mergeId}/UpdateMerge`);}}
|
onClick={()=>{this.props.history.push(`/${owner}/${projectsId}/pulls/${mergeId}/UpdateMerge`);}}
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -186,7 +186,7 @@ class NewMerge extends Component {
|
||||||
// this.ischeckmerge();
|
// this.ischeckmerge();
|
||||||
let { id ,merge , pull } = this.state;
|
let { id ,merge , pull } = this.state;
|
||||||
if(type==="pull"){
|
if(type==="pull"){
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new/${pull}`)
|
this.props.history.push(`/${owner}/${projectsId}/pulls/new/${pull}`)
|
||||||
this.compareProject(id,value,merge);
|
this.compareProject(id,value,merge);
|
||||||
}else{
|
}else{
|
||||||
this.compareProject(id,pull,value);
|
this.compareProject(id,pull,value);
|
||||||
|
@ -208,7 +208,7 @@ class NewMerge extends Component {
|
||||||
merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined
|
merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.props.history.push(`/projects/${login}/${identifier}/pulls/new`);
|
this.props.history.push(`/${login}/${identifier}/pulls/new`);
|
||||||
this.newMergelist(login,identifier);
|
this.newMergelist(login,identifier);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import "./merge.css";
|
||||||
import "../Order/order.css";
|
import "../Order/order.css";
|
||||||
import "../Order/index.scss";
|
import "../Order/index.scss";
|
||||||
import NoneData from "./no_data";
|
import NoneData from "./no_data";
|
||||||
import OrderItem from "./MergeItem";
|
import MergeItem from "./MergeItem";
|
||||||
import './Index.scss';
|
import './Index.scss';
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
@ -212,7 +212,7 @@ class merge extends Component {
|
||||||
|
|
||||||
checkOperation() {
|
checkOperation() {
|
||||||
const { projectsId,owner } = this.props.match.params;
|
const { projectsId,owner } = this.props.match.params;
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new`);
|
this.props.history.push(`/${owner}/${projectsId}/pulls/new`);
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
|
@ -255,7 +255,7 @@ class merge extends Component {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
data && data.user_admin_or_member &&
|
data && data.user_admin_or_developer &&
|
||||||
<a className="topWrapper_btn ml10" onClick={() => this.checkOperation()}>
|
<a className="topWrapper_btn ml10" onClick={() => this.checkOperation()}>
|
||||||
+ 新建合并请求
|
+ 新建合并请求
|
||||||
</a>
|
</a>
|
||||||
|
@ -387,7 +387,7 @@ class merge extends Component {
|
||||||
<Spin spinning={isSpin}>
|
<Spin spinning={isSpin}>
|
||||||
{data && data.search_count && data.search_count > 0 ? (
|
{data && data.search_count && data.search_count > 0 ? (
|
||||||
<div>
|
<div>
|
||||||
<OrderItem
|
<MergeItem
|
||||||
issues={issues}
|
issues={issues}
|
||||||
search_count={search_count}
|
search_count={search_count}
|
||||||
page={select_params.page}
|
page={select_params.page}
|
||||||
|
@ -396,8 +396,8 @@ class merge extends Component {
|
||||||
project_author_name={data.project_author_name}
|
project_author_name={data.project_author_name}
|
||||||
{...this.props}
|
{...this.props}
|
||||||
{...this.state}
|
{...this.state}
|
||||||
user_admin_or_member={data && data.user_admin_or_member}
|
user_admin_or_developer={data && data.user_admin_or_developer}
|
||||||
></OrderItem>
|
></MergeItem>
|
||||||
</div>
|
</div>
|
||||||
):""}
|
):""}
|
||||||
{search_count > select_params.limit ? (
|
{search_count > select_params.limit ? (
|
||||||
|
|
|
@ -165,7 +165,7 @@ class MergeForm extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin: false,
|
isSpin: false,
|
||||||
});
|
});
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/pulls`);
|
this.props.history.push(`/${owner}/${projectsId}/pulls`);
|
||||||
const { getDetail } = this.props;
|
const { getDetail } = this.props;
|
||||||
getDetail && getDetail();
|
getDetail && getDetail();
|
||||||
} else {
|
} else {
|
||||||
|
@ -195,7 +195,7 @@ class MergeForm extends Component {
|
||||||
isSpin: false,
|
isSpin: false,
|
||||||
});
|
});
|
||||||
this.props.history.push(
|
this.props.history.push(
|
||||||
`/projects/${owner}/${projectsId}/pulls/${mergeId}/Messagecount`
|
`/${owner}/${projectsId}/pulls/${mergeId}/Messagecount`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -287,7 +287,7 @@ class MergeForm extends Component {
|
||||||
type="default"
|
type="default"
|
||||||
className="ml30"
|
className="ml30"
|
||||||
onClick={()=>{
|
onClick={()=>{
|
||||||
this.props.history.push(merge_type === "new" ? `/projects/${owner}/${projectsId}/pulls` : `/projects/${owner}/${projectsId}/pulls/${mergeId}/detail`)
|
this.props.history.push(merge_type === "new" ? `/${owner}/${projectsId}/pulls` : `/${owner}/${projectsId}/pulls/${mergeId}/detail`)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span className="plr10">取消</span>
|
<span className="plr10">取消</span>
|
||||||
|
|
|
@ -12,7 +12,7 @@ class Nodata extends Component{
|
||||||
<h3>欢迎使用合并请求!</h3>
|
<h3>欢迎使用合并请求!</h3>
|
||||||
|
|
||||||
<div className="color-grey-8">
|
<div className="color-grey-8">
|
||||||
合并请求可以帮助您与他人协作编写代码。在使用之前,请先创建一个 <Link className="color-blue" to={`/projects/${owner}/${projectsId}/pulls/new`}>合并请求</Link>
|
合并请求可以帮助您与他人协作编写代码。在使用之前,请先创建一个 <Link className="color-blue" to={`/${owner}/${projectsId}/pulls/new`}>合并请求</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete } from 'antd';
|
import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal } from 'antd';
|
||||||
import { Base64 } from 'js-base64';
|
import { Base64 } from 'js-base64';
|
||||||
|
|
||||||
import '../css/index.scss';
|
import '../css/index.scss';
|
||||||
|
@ -58,6 +58,8 @@ class Index extends Component {
|
||||||
this.getGitignore();
|
this.getGitignore();
|
||||||
// 获取开源许可证
|
// 获取开源许可证
|
||||||
this.getLicenses();
|
this.getLicenses();
|
||||||
|
//判断是否为删除新建项目失败后返回,并执行对应逻辑
|
||||||
|
this.isDeleteProjectBack();
|
||||||
}
|
}
|
||||||
componentDidUpdate=(prevPros)=>{
|
componentDidUpdate=(prevPros)=>{
|
||||||
if(prevPros && this.props && !this.props.checkIfLogin()){
|
if(prevPros && this.props && !this.props.checkIfLogin()){
|
||||||
|
@ -69,6 +71,7 @@ class Index extends Component {
|
||||||
getOwner=()=>{
|
getOwner=()=>{
|
||||||
const { OIdentifier } = this.props.match.params;
|
const { OIdentifier } = this.props.match.params;
|
||||||
const { user_id } = this.props && this.props.current_user;
|
const { user_id } = this.props && this.props.current_user;
|
||||||
|
|
||||||
const url = `/owners.json`;
|
const url = `/owners.json`;
|
||||||
axios.get(url).then(result=>{
|
axios.get(url).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
|
@ -77,16 +80,13 @@ class Index extends Component {
|
||||||
OwnerList: owner,
|
OwnerList: owner,
|
||||||
})
|
})
|
||||||
if(OIdentifier){
|
if(OIdentifier){
|
||||||
owner = owner.filter(item=>item.name === OIdentifier);
|
owner = owner.filter(item=>item.login === OIdentifier);
|
||||||
this.props.form.setFieldsValue({
|
|
||||||
user_id:OIdentifier
|
|
||||||
})
|
|
||||||
}else if(user_id){
|
}else if(user_id){
|
||||||
owner = owner.filter(item=>item.id === user_id);
|
owner = owner.filter(item=>item.id === user_id);
|
||||||
|
}
|
||||||
this.props.form.setFieldsValue({
|
this.props.form.setFieldsValue({
|
||||||
user_id:owner && owner[0].name
|
user_id:owner && owner[0].name
|
||||||
})
|
})
|
||||||
}
|
|
||||||
owner && this.setState({
|
owner && this.setState({
|
||||||
owners_id:owner[0].id,
|
owners_id:owner[0].id,
|
||||||
owners_name:owner[0].name
|
owners_name:owner[0].name
|
||||||
|
@ -144,6 +144,31 @@ class Index extends Component {
|
||||||
}).catch((error) => { })
|
}).catch((error) => { })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isDeleteProjectBack = () => {
|
||||||
|
let mirror_status = this.props.history.location.mirror_status;
|
||||||
|
if (mirror_status === 2 && sessionStorage.newProjectValue) {
|
||||||
|
Modal.warning({
|
||||||
|
title: '警告',
|
||||||
|
content: '镜像项目创建失败!请按操作规范重新创建项目!',
|
||||||
|
});
|
||||||
|
let newProjectValue = JSON.parse(sessionStorage.newProjectValue);
|
||||||
|
if (newProjectValue) {
|
||||||
|
this.setState({
|
||||||
|
project_language_id: newProjectValue.project_language_id,
|
||||||
|
project_category_id: newProjectValue.project_category_id,
|
||||||
|
license_id: newProjectValue.license_id,
|
||||||
|
ignore_id: newProjectValue.ignore_id
|
||||||
|
});
|
||||||
|
delete newProjectValue.project_language_id;
|
||||||
|
delete newProjectValue.project_category_id;
|
||||||
|
delete newProjectValue.license_id;
|
||||||
|
delete newProjectValue.ignore_id;
|
||||||
|
this.props.form.setFieldsValue(newProjectValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 设置option
|
// 设置option
|
||||||
setOptionsList = (data, _head, name) => {
|
setOptionsList = (data, _head, name) => {
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
|
@ -172,6 +197,8 @@ class Index extends Component {
|
||||||
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
|
||||||
const decoderPass = Base64.encode(values.password);
|
const decoderPass = Base64.encode(values.password);
|
||||||
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
|
||||||
|
// 新建项目的时候,暂存数据,如果失败,返回的时候可以重新赋值
|
||||||
|
sessionStorage.newProjectValue=JSON.stringify({...values,project_language_id,project_category_id,license_id,ignore_id});
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
...values,
|
...values,
|
||||||
auth_password:decoderPass,
|
auth_password:decoderPass,
|
||||||
|
@ -185,8 +212,8 @@ class Index extends Component {
|
||||||
this.setState({
|
this.setState({
|
||||||
isSpin: false
|
isSpin: false
|
||||||
})
|
})
|
||||||
this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`);
|
projectsType && projectsType !== "mirror" && this.props.showNotification(`托管项目创建成功!`);
|
||||||
this.props.history.push(`/projects/${result.data.login}/${result.data.identifier}`);
|
this.props.history.push(`/${result.data.login}/${result.data.identifier}`);
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -337,7 +364,9 @@ class Index extends Component {
|
||||||
{
|
{
|
||||||
projectsType && projectsType === "mirror" &&
|
projectsType && projectsType === "mirror" &&
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>需要授权验证<i className={mirrorCheck?"iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i></p>
|
<p className="mt10 mb10 color-grey-3 pointer" onClick={this.changeMirrorCheck}>
|
||||||
|
需要授权验证<i className={mirrorCheck?"iconfont icon-xiajiantou font-13 ml10 color-grey-8":"iconfont icon-youjiantou font-13 ml10 color-grey-8"}></i>
|
||||||
|
<span className="ml20 font-12 color-red">如果源项目为公有仓库,禁止填写用户名密码。如果源项目为私有仓库,则必须填写正确的用户名和密码!</span></p>
|
||||||
{
|
{
|
||||||
mirrorCheck &&
|
mirrorCheck &&
|
||||||
<div className="df mb20" style={{alignItems:'center'}}>
|
<div className="df mb20" style={{alignItems:'center'}}>
|
||||||
|
|
|
@ -86,7 +86,7 @@ class UserSubmitComponent extends Component {
|
||||||
const { getTopCount } = this.props;
|
const { getTopCount } = this.props;
|
||||||
getTopCount && getTopCount(values.branchname);
|
getTopCount && getTopCount(values.branchname);
|
||||||
}
|
}
|
||||||
let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
|
let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -123,7 +123,7 @@ class UserSubmitComponent extends Component {
|
||||||
this.setState({ isSpin: false });
|
this.setState({ isSpin: false });
|
||||||
if (result.data && result.data.status === 1) {
|
if (result.data && result.data.status === 1) {
|
||||||
let b = currentBranch || branch;
|
let b = currentBranch || branch;
|
||||||
let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`;
|
let url = `/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`;
|
||||||
this.props.history.push(url);
|
this.props.history.push(url);
|
||||||
this.props.showNotification("文件修改成功!");
|
this.props.showNotification("文件修改成功!");
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ class UserSubmitComponent extends Component {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<span className="df" style={{ alignItems: "center" }}>
|
<span className="df" style={{ alignItems: "center" }}>
|
||||||
<Link to={`/users/${current_user && current_user.login}`} className="show-user-link" >
|
<Link to={`/${current_user && current_user.login}`} className="show-user-link" >
|
||||||
<img
|
<img
|
||||||
src={getImageUrl(`/${current_user && current_user.image_url}`)}
|
src={getImageUrl(`/${current_user && current_user.image_url}`)}
|
||||||
alt=""
|
alt=""
|
||||||
|
@ -248,7 +248,7 @@ class UserSubmitComponent extends Component {
|
||||||
<Button
|
<Button
|
||||||
type="primary grey"
|
type="primary grey"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}`);
|
this.props.history.push(`/${owner}/${projectsId}`);
|
||||||
}}
|
}}
|
||||||
className="mr20"
|
className="mr20"
|
||||||
>
|
>
|
||||||
|
|
|
@ -63,11 +63,11 @@ function Apply(props) {
|
||||||
{
|
{
|
||||||
list.map((i,k)=>{
|
list.map((i,k)=>{
|
||||||
return(
|
return(
|
||||||
<li>
|
<li key={k}>
|
||||||
<Link to={`/users/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
|
<Link to={`/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
|
||||||
<div className="notifyFlex">
|
<div className="notifyFlex">
|
||||||
<p className="notifyInfos">
|
<p className="notifyInfos">
|
||||||
<Link to={`/users/${i.user && i.user.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
|
<Link to={`/${i.user && i.user.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
|
||||||
<span className="color-grey-9">{i.time_ago}</span>
|
<span className="color-grey-9">{i.time_ago}</span>
|
||||||
</p>
|
</p>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
|
|
|
@ -33,7 +33,7 @@ function Index(props){
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if((username && current_user && (current_user.login !== username))){
|
if((username && current_user && (current_user.login !== username))){
|
||||||
props.history.push(`/users/${username}`);
|
props.history.push(`/${username}`);
|
||||||
}
|
}
|
||||||
},[current_user,username])
|
},[current_user,username])
|
||||||
|
|
||||||
|
@ -47,14 +47,14 @@ function Index(props){
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(pathname && username){
|
if(pathname && username){
|
||||||
if(pathname === `/users/${username}/notice`){
|
if(pathname === `/${username}/notice`){
|
||||||
setMenu("notify");
|
setMenu("notify");
|
||||||
changeNum(user.undo_messages);
|
changeNum(user.undo_messages);
|
||||||
}
|
}
|
||||||
if(pathname === `/users/${username}/notice/undo`){
|
if(pathname === `/${username}/notice/undo`){
|
||||||
setMenu("undo");
|
setMenu("undo");
|
||||||
}
|
}
|
||||||
if(pathname === `/users/${username}/notice/apply`){
|
if(pathname === `/${username}/notice/apply`){
|
||||||
setMenu("apply");
|
setMenu("apply");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,9 +70,9 @@ function Index(props){
|
||||||
function deleteEvent(type,count) {
|
function deleteEvent(type,count) {
|
||||||
let c = count;
|
let c = count;
|
||||||
if(type==="apply"){
|
if(type==="apply"){
|
||||||
setTransferCount(transferCount-count);
|
|
||||||
}else if(type==="undo"){
|
|
||||||
setApplyCount(applyCount-count);
|
setApplyCount(applyCount-count);
|
||||||
|
}else if(type==="undo"){
|
||||||
|
setTransferCount(transferCount-count);
|
||||||
}else{
|
}else{
|
||||||
setMessagesCount(0);
|
setMessagesCount(0);
|
||||||
c = messagesCount;
|
c = messagesCount;
|
||||||
|
@ -84,19 +84,19 @@ function Index(props){
|
||||||
<div>
|
<div>
|
||||||
<ul className="noticeMenu">
|
<ul className="noticeMenu">
|
||||||
<li className={menu === "notify" ? "active":""}>
|
<li className={menu === "notify" ? "active":""}>
|
||||||
<Link to={`/users/${username}/notice`} onClick={changeNum}>
|
<Link to={`/${username}/notice`} onClick={changeNum}>
|
||||||
<span>通知</span>
|
<span>通知</span>
|
||||||
{messagesCount ? <span className="unNum">{messagesCount}</span>:""}
|
{messagesCount ? <span className="unNum">{messagesCount}</span>:""}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={menu === "undo" ? "active":""}>
|
<li className={menu === "undo" ? "active":""}>
|
||||||
<Link to={`/users/${username}/notice/undo`}>
|
<Link to={`/${username}/notice/undo`}>
|
||||||
<span>接收仓库</span>
|
<span>接收仓库</span>
|
||||||
{transferCount ? <span className="unNum">{transferCount}</span>:""}
|
{transferCount ? <span className="unNum">{transferCount}</span>:""}
|
||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={menu === "apply" ? "active":""}>
|
<li className={menu === "apply" ? "active":""}>
|
||||||
<Link to={`/users/${username}/notice/apply`}>
|
<Link to={`/${username}/notice/apply`}>
|
||||||
<span>成员申请</span>
|
<span>成员申请</span>
|
||||||
{applyCount ? <span className="unNum">{applyCount}</span>:""}
|
{applyCount ? <span className="unNum">{applyCount}</span>:""}
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -104,19 +104,19 @@ function Index(props){
|
||||||
</ul>
|
</ul>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route
|
<Route
|
||||||
path="/users/:username/notice/apply"
|
path="/:username/notice/apply"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <Apply {...props} {...p} deleteEvent={deleteEvent}/>;
|
return <Apply {...props} {...p} deleteEvent={deleteEvent}/>;
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/users/:username/notice/undo"
|
path="/:username/notice/undo"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <UndoEvent {...props} {...p} deleteEvent={deleteEvent}/>;
|
return <UndoEvent {...props} {...p} deleteEvent={deleteEvent}/>;
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/users/:username/notice"
|
path="/:username/notice"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <Notify {...props} {...p} deleteEvent={deleteEvent}/>;
|
return <Notify {...props} {...p} deleteEvent={deleteEvent}/>;
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -44,13 +44,13 @@ function Notify(props){
|
||||||
if(status){
|
if(status){
|
||||||
switch(status){
|
switch(status){
|
||||||
case 'canceled':
|
case 'canceled':
|
||||||
return <p>取消转移【<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库</p>
|
return <p>取消转移【<Link to={`/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库</p>
|
||||||
case 'common':
|
case 'common':
|
||||||
return <p>正在将【<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库转移给【<Link to={`/users/${owner && owner.login}`}>{owner && owner.name}</Link>】</p>
|
return <p>正在将【<Link to={`/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库转移给【<Link to={`/${owner && owner.login}`}>{owner && owner.name}</Link>】</p>
|
||||||
case 'successed':
|
case 'successed':
|
||||||
return <p>【<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库成功转移给【<Link to={`/users/${owner && owner.login}`}>{owner && owner.name}</Link>】</p>
|
return <p>【<Link to={`/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库成功转移给【<Link to={`/${owner && owner.login}`}>{owner && owner.name}</Link>】</p>
|
||||||
default:
|
default:
|
||||||
return <p>拒绝转移【<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库</p>
|
return <p>拒绝转移【<Link to={`/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】仓库</p>
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
return ""
|
return ""
|
||||||
|
@ -62,9 +62,9 @@ function Notify(props){
|
||||||
if(status){
|
if(status){
|
||||||
switch(status){
|
switch(status){
|
||||||
case 'successed':
|
case 'successed':
|
||||||
return <p>已通过你加入【<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】项目的申请</p>
|
return <p>已通过你加入【<Link to={`/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】项目的申请</p>
|
||||||
default:
|
default:
|
||||||
return <p>已拒绝你加入【<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】项目的申请</p>
|
return <p>已拒绝你加入【<Link to={`/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>】项目的申请</p>
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
return ""
|
return ""
|
||||||
|
@ -81,11 +81,11 @@ function Notify(props){
|
||||||
{
|
{
|
||||||
list.map((i,k)=>{
|
list.map((i,k)=>{
|
||||||
return(
|
return(
|
||||||
<li>
|
<li i={k}>
|
||||||
<Link to={`/users/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link>
|
<Link to={`/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link>
|
||||||
<div className="notifyFlex">
|
<div className="notifyFlex">
|
||||||
<p className="notifyInfos">
|
<p className="notifyInfos">
|
||||||
<Link to={`/users/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link>
|
<Link to={`/${i.applied_user && i.applied_user.login}`} className="font-15 mr20">{i.applied_user && i.applied_user.name}</Link>
|
||||||
<span className="color-grey-9">{i.time_ago}</span>
|
<span className="color-grey-9">{i.time_ago}</span>
|
||||||
</p>
|
</p>
|
||||||
{ i.applied_type === "AppliedProject" ? renderApplyStatus(i.status,i.applied):renderStatus(i.status,i.applied)}
|
{ i.applied_type === "AppliedProject" ? renderApplyStatus(i.status,i.applied):renderStatus(i.status,i.applied)}
|
||||||
|
|
|
@ -53,7 +53,7 @@ function UndoEvent(props){
|
||||||
Axios.post(url).then(result=>{
|
Axios.post(url).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
getList();
|
getList();
|
||||||
props && props.deleteEvent("apply",1);
|
props && props.deleteEvent("undo",1);
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
@ -68,16 +68,16 @@ function UndoEvent(props){
|
||||||
{
|
{
|
||||||
list.map((i,k)=>{
|
list.map((i,k)=>{
|
||||||
return(
|
return(
|
||||||
<li>
|
<li key={k}>
|
||||||
<Link to={`/users/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
|
<Link to={`/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
|
||||||
<div className="notifyFlex">
|
<div className="notifyFlex">
|
||||||
<p className="notifyInfos">
|
<p className="notifyInfos">
|
||||||
<Link to={`/users/${i.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
|
<Link to={`/${i.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
|
||||||
<span className="color-grey-9">{i.time_ago}</span>
|
<span className="color-grey-9">{i.time_ago}</span>
|
||||||
</p>
|
</p>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<p className="color-grey-6">请求将仓库【<Link to={`/projects/${i.project && i.project.owner && i.project.owner.login}/${i.project && i.project.identifier}`}>{i.project && i.project.name}</Link>】
|
<p className="color-grey-6">请求将仓库【<Link to={`/${i.project && i.project.owner && i.project.owner.login}/${i.project && i.project.identifier}`}>{i.project && i.project.name}</Link>】
|
||||||
转移给【<Link to={`/users/${i.owner && i.owner.login}`}>{i.owner && i.owner.name}</Link>】,是否接受?</p>
|
转移给【<Link to={`/${i.owner && i.owner.login}`}>{i.owner && i.owner.name}</Link>】,是否接受?</p>
|
||||||
{
|
{
|
||||||
i.status === "common" &&
|
i.status === "common" &&
|
||||||
<span>
|
<span>
|
||||||
|
|
|
@ -85,7 +85,7 @@ class Detail extends Component {
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/issues`);
|
this.props.history.push(`/${owner}/${projectsId}/issues`);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
@ -132,7 +132,7 @@ class Detail extends Component {
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.props.history.push(
|
this.props.history.push(
|
||||||
`/projects/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
|
`/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -207,7 +207,7 @@ class Detail extends Component {
|
||||||
<div className="background-f boder-4">
|
<div className="background-f boder-4">
|
||||||
<div className="grid-item border-1f pd20 ">
|
<div className="grid-item border-1f pd20 ">
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${data && data.author_login}`}
|
to={`/${data && data.author_login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
@ -240,7 +240,7 @@ class Detail extends Component {
|
||||||
<div className="mt10">
|
<div className="mt10">
|
||||||
<span className="color-grey-9 mr5">由</span>
|
<span className="color-grey-9 mr5">由</span>
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${data && data.author_login}`}
|
to={`/${data && data.author_login}`}
|
||||||
className="show-user-link color-blue"
|
className="show-user-link color-blue"
|
||||||
>
|
>
|
||||||
{data && data.author_name}
|
{data && data.author_name}
|
||||||
|
@ -269,7 +269,7 @@ class Detail extends Component {
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
|
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${owner}/${projectsId}/issues/${orderId}/updatedetail`}
|
to={`/${owner}/${projectsId}/issues/${orderId}/updatedetail`}
|
||||||
className="color-blue fr"
|
className="color-blue fr"
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
|
|
|
@ -187,7 +187,7 @@ class Milepost extends Component {
|
||||||
</ul>
|
</ul>
|
||||||
{
|
{
|
||||||
data && data.user_admin_or_member ?
|
data && data.user_admin_or_member ?
|
||||||
<Link to={`/projects/${owner}/${projectsId}/milestones/new`} className="topWrapper_btn">新的里程碑</Link>
|
<Link to={`/${owner}/${projectsId}/milestones/new`} className="topWrapper_btn">新的里程碑</Link>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -204,7 +204,7 @@ class Milepost extends Component {
|
||||||
<div className="milepostwidth">
|
<div className="milepostwidth">
|
||||||
<div className="grid-item width100">
|
<div className="grid-item width100">
|
||||||
<i className="iconfont icon-lubiaosignpost3 font-12 mr3"></i>
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -228,7 +228,7 @@ class Milepost extends Component {
|
||||||
<div className="milepostleft">
|
<div className="milepostleft">
|
||||||
<div className="grid-item ml15 color-grey-9">
|
<div className="grid-item ml15 color-grey-9">
|
||||||
<i className="iconfont icon-bianji3 font-14 mr5"></i>
|
<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>
|
||||||
<div className="grid-item ml15 color-grey-9">
|
<div className="grid-item ml15 color-grey-9">
|
||||||
<i className={item.status === "closed" ? "iconfont icon-gouxuan font-14 mr5":"iconfont icon-yiguanbi1 font-14 mr5"}></i>
|
<i className={item.status === "closed" ? "iconfont icon-gouxuan font-14 mr5":"iconfont icon-yiguanbi1 font-14 mr5"}></i>
|
||||||
|
|
|
@ -238,8 +238,8 @@ class MilepostDetail extends Component {
|
||||||
<span className="font-weight-bold">{data && data.percent && data.percent.toFixed(2)}%完成 </span>
|
<span className="font-weight-bold">{data && data.percent && data.percent.toFixed(2)}%完成 </span>
|
||||||
</span>
|
</span>
|
||||||
<div className="milepostdiv">
|
<div className="milepostdiv">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/milestones/${meilid}/edit`} className="topWrapper_btn" style={{ marginRight: 15 }} >编辑里程碑</Link>
|
<Link to={`/${owner}/${projectsId}/milestones/${meilid}/edit`} className="topWrapper_btn" style={{ marginRight: 15 }} >编辑里程碑</Link>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/issues/${meilid}/new`} className="topWrapper_btn">创建易修</Link>
|
<Link to={`/${owner}/${projectsId}/issues/${meilid}/new`} className="topWrapper_btn">创建易修</Link>
|
||||||
</div>
|
</div>
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,8 +7,8 @@ class Nav extends Component{
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
return(
|
return(
|
||||||
<p className="topWrapper_nav">
|
<p className="topWrapper_nav">
|
||||||
<NavLink activeClassName="active" className="issue-type-button" to={`/projects/${owner}/${projectsId}/issues/tags`}>标签</NavLink>
|
<NavLink activeClassName="active" className="issue-type-button" to={`/${owner}/${projectsId}/issues/tags`}>标签</NavLink>
|
||||||
<NavLink activeClassName="active" className="issue-type-button" to={`/projects/${owner}/${projectsId}/milestones`}>里程碑</NavLink>
|
<NavLink activeClassName="active" className="issue-type-button" to={`/${owner}/${projectsId}/milestones`}>里程碑</NavLink>
|
||||||
</p>
|
</p>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ class OrderItem extends Component {
|
||||||
{current_user && current_user.login && checkbox}
|
{current_user && current_user.login && checkbox}
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<p className="mb10 df" style={{alignItems:"center"}}>
|
<p className="mb10 df" style={{alignItems:"center"}}>
|
||||||
<Link to={`/projects/${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}/detail`} 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")}
|
{TagInfo(item.priority,"mr10")}
|
||||||
</p>
|
</p>
|
||||||
<p className="color-grey-6 font-12">
|
<p className="color-grey-6 font-12">
|
||||||
|
@ -67,7 +67,7 @@ class OrderItem extends Component {
|
||||||
<li>
|
<li>
|
||||||
{
|
{
|
||||||
item.author_name ?
|
item.author_name ?
|
||||||
<Link to={`/users/${item.author_login}`} className="show-user-link">
|
<Link to={`/${item.author_login}`} className="show-user-link">
|
||||||
{item.author_name}
|
{item.author_name}
|
||||||
</Link>
|
</Link>
|
||||||
: "--"
|
: "--"
|
||||||
|
@ -76,7 +76,7 @@ class OrderItem extends Component {
|
||||||
<li>
|
<li>
|
||||||
{
|
{
|
||||||
item.assign_user_name ?
|
item.assign_user_name ?
|
||||||
<Link to={`/users/${item.assign_user_login}`} className="show-user-link">
|
<Link to={`/${item.assign_user_login}`} className="show-user-link">
|
||||||
{item.assign_user_name}
|
{item.assign_user_name}
|
||||||
</Link>
|
</Link>
|
||||||
: "--"
|
: "--"
|
||||||
|
@ -88,12 +88,12 @@ class OrderItem extends Component {
|
||||||
<li style={{color:`${item.done_ratio === "100%"?"#28BD6C":"#F73030"}`}}>{item.done_ratio || "--"}</li>
|
<li style={{color:`${item.done_ratio === "100%"?"#28BD6C":"#F73030"}`}}>{item.done_ratio || "--"}</li>
|
||||||
<li>
|
<li>
|
||||||
<div className="milepostleft">
|
<div className="milepostleft">
|
||||||
<Link to={`/projects/${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}/detail`}><i className="iconfont icon-pinglun1 mr3 font-16"></i>{item.journals_count}</Link>
|
||||||
{
|
{
|
||||||
user_admin_or_member ?
|
user_admin_or_member ?
|
||||||
<div id="hoverBox" style={{ display: this.state.orderid === item.id && this.state.isdisplay ? 'flex' : 'none' }}>
|
<div id="hoverBox" style={{ display: this.state.orderid === item.id && this.state.isdisplay ? 'flex' : 'none' }}>
|
||||||
<div className="mr8 ml8 color-grey-9">
|
<div className="mr8 ml8 color-grey-9">
|
||||||
<Link to={`/projects/${owner}/${projectsId}/issues/${item.id}/updatedetail`} className="color-grey-9"><i className="iconfont icon-bianji3 font-14 mr5"></i></Link>
|
<Link to={`/${owner}/${projectsId}/issues/${item.id}/updatedetail`} className="color-grey-9"><i className="iconfont icon-bianji3 font-14 mr5"></i></Link>
|
||||||
</div>
|
</div>
|
||||||
<div className="color-grey-9">
|
<div className="color-grey-9">
|
||||||
<Popconfirm placement="bottom" overlayClassName="overlayBox" getPopupContainer={()=>document.getElementById("hoverBox")} title={'您确定要删除当前易修吗?'} okText="是" cancelText="否" onConfirm={() => this.deletedetail(item.id)}>
|
<Popconfirm placement="bottom" overlayClassName="overlayBox" getPopupContainer={()=>document.getElementById("hoverBox")} title={'您确定要删除当前易修吗?'} okText="是" cancelText="否" onConfirm={() => this.deletedetail(item.id)}>
|
||||||
|
|
|
@ -79,7 +79,7 @@ class UpdateMilepost extends Component {
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.setState({ isSpin: false })
|
this.setState({ isSpin: false })
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/milestones`);
|
this.props.history.push(`/${owner}/${projectsId}/milestones`);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class NewMilepost extends Component {
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.setState({ isSpin: false })
|
this.setState({ isSpin: false })
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/milestones`);
|
this.props.history.push(`/${owner}/${projectsId}/milestones`);
|
||||||
const { getDetail } = this.props;
|
const { getDetail } = this.props;
|
||||||
getDetail && getDetail();
|
getDetail && getDetail();
|
||||||
}
|
}
|
||||||
|
|
|
@ -351,7 +351,7 @@ class order extends Component {
|
||||||
if(data && data.user_admin_or_member){
|
if(data && data.user_admin_or_member){
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
return(
|
return(
|
||||||
<Link className="topWrapper_btn ml10" target="_blank" to={`/projects/${owner}/${projectsId}/issues/new`}>
|
<Link className="topWrapper_btn ml10" target="_blank" to={`/${owner}/${projectsId}/issues/new`}>
|
||||||
+ 创建易修
|
+ 创建易修
|
||||||
</Link>
|
</Link>
|
||||||
)
|
)
|
||||||
|
|
|
@ -165,7 +165,7 @@ class order_form extends Component {
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result && result.data.id) {
|
if (result && result.data.id) {
|
||||||
this.props.showNotification("任务创建成功!");
|
this.props.showNotification("任务创建成功!");
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/issues/${result.data.id}/detail`);
|
this.props.history.push(`/${owner}/${projectsId}/issues/${result.data.id}/detail`);
|
||||||
this.setState({
|
this.setState({
|
||||||
description: "",
|
description: "",
|
||||||
isSpin: false,
|
isSpin: false,
|
||||||
|
@ -191,7 +191,7 @@ class order_form extends Component {
|
||||||
...values,
|
...values,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.props.history.push(`/projects/${owner}/${projectsId}/issues/${orderId}/detail`);
|
this.props.history.push(`/${owner}/${projectsId}/issues/${orderId}/detail`);
|
||||||
this.props.showNotification("任务更新成功!");
|
this.props.showNotification("任务更新成功!");
|
||||||
const { getDetail } = this.props;
|
const { getDetail } = this.props;
|
||||||
getDetail && getDetail();
|
getDetail && getDetail();
|
||||||
|
@ -371,7 +371,7 @@ class order_form extends Component {
|
||||||
type="default"
|
type="default"
|
||||||
className="ml30"
|
className="ml30"
|
||||||
onClick={()=>
|
onClick={()=>
|
||||||
this.props.history.push(form_type === "new" ? `/projects/${owner}/${projectsId || orderId}/issues` : `/projects/${owner}/${projectsId}/issues/${orderId}/detail`)}
|
this.props.history.push(form_type === "new" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}/detail`)}
|
||||||
>
|
>
|
||||||
<span className="plr10">取消</span>
|
<span className="plr10">取消</span>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
@ -88,7 +88,7 @@ export default ((props)=>{
|
||||||
|
|
||||||
// 跳转
|
// 跳转
|
||||||
function settingRule(protectBranch){
|
function settingRule(protectBranch){
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/setting/branch/${protectBranch}`);
|
props.history.push(`/${owner}/${projectsId}/setting/branch/${protectBranch}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 翻页
|
// 翻页
|
||||||
|
|
|
@ -290,7 +290,7 @@ export default Form.create()(
|
||||||
<Cancel
|
<Cancel
|
||||||
className="ml30"
|
className="ml30"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
history.push(`/projects/${owner}/${projectsId}/setting/branch`);
|
history.push(`/${owner}/${projectsId}/setting/branch`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
取消
|
取消
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from "react";
|
import React, { useState , useRef } from "react";
|
||||||
import {WhiteBack} from '../Component/layout';
|
import {WhiteBack} from '../Component/layout';
|
||||||
import AddMember from '../Component/AddMember';
|
import AddMember from '../Component/AddMember';
|
||||||
import AddGroup from '../Component/AddGroup';
|
import AddGroup from '../Component/AddGroup';
|
||||||
|
@ -8,9 +8,11 @@ import Group from './CollaboratorGroup';
|
||||||
function Collaborator(props){
|
function Collaborator(props){
|
||||||
const [ nav , setNav] = useState("1");
|
const [ nav , setNav] = useState("1");
|
||||||
const [ newId , setNewId] = useState(undefined);
|
const [ newId , setNewId] = useState(undefined);
|
||||||
|
const [ addOperation , setAddOperation] = useState(true);
|
||||||
const [ newGroupId , setNewGroupId] = useState(undefined);
|
const [ newGroupId , setNewGroupId] = useState(undefined);
|
||||||
const {projectsId ,owner} = props.match.params;
|
const {projectsId ,owner} = props.match.params;
|
||||||
|
|
||||||
|
|
||||||
const author = props && props.projectDetail && props.projectDetail.author;
|
const author = props && props.projectDetail && props.projectDetail.author;
|
||||||
|
|
||||||
function getID(id){
|
function getID(id){
|
||||||
|
@ -20,6 +22,7 @@ function Collaborator(props){
|
||||||
setNewGroupId(id);
|
setNewGroupId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WhiteBack>
|
<WhiteBack>
|
||||||
<div className="flex-a-center baseForm bbr">
|
<div className="flex-a-center baseForm bbr">
|
||||||
|
@ -27,15 +30,17 @@ function Collaborator(props){
|
||||||
author && author.type === "Organization" ?
|
author && author.type === "Organization" ?
|
||||||
<span>
|
<span>
|
||||||
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-18 text-black color-blue":"font-18 text-black"} onClick={()=>{setNav("1");setNewId(undefined)}}>协作者管理</span>
|
<span style={{cursor:"pointer"}} className={nav === "1" ? "font-18 text-black color-blue":"font-18 text-black"} onClick={()=>{setNav("1");setNewId(undefined)}}>协作者管理</span>
|
||||||
<span style={{cursor:"pointer"}} className={nav === "2" ? "font-18 text-black ml30 color-blue":"font-18 text-black ml30"} onClick={()=>{setNav("2");setNewId(undefined)}}>团队管理</span>
|
<span style={{cursor:"pointer"}} className={nav === "2" ? "font-18 text-black ml30 color-blue":"font-18 text-black ml30"} onClick={()=>{setNav("2");setNewId(undefined);setNewGroupId(undefined)}}>团队管理</span>
|
||||||
</span>
|
</span>
|
||||||
:
|
:
|
||||||
<span className="font-18 text-black">协作者管理</span>
|
<span className="font-18 text-black">协作者管理</span>
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nav === "1" ?
|
nav === "1" &&
|
||||||
<AddMember getID={getID} login showNotification={props.showNotification}/>
|
<AddMember getID={getID} login showNotification={props.showNotification}/>
|
||||||
:
|
}
|
||||||
|
{
|
||||||
|
(nav !== "1" && addOperation) &&
|
||||||
<AddGroup getGroupID={getGroupID} organizeId={owner}/>
|
<AddGroup getGroupID={getGroupID} organizeId={owner}/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,7 +49,7 @@ function Collaborator(props){
|
||||||
nav === "1" ?
|
nav === "1" ?
|
||||||
<Member newId={newId} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.projectDetail && props.projectDetail.author} showNotification={props.showNotification}/>
|
<Member newId={newId} projectsId={projectsId} owner={owner} project_id={props.project_id} author={props.projectDetail && props.projectDetail.author} showNotification={props.showNotification}/>
|
||||||
:
|
:
|
||||||
<Group owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
|
<Group setAddOperation={setAddOperation} owner={owner} projectsId={projectsId} newGroupId={newGroupId}/>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</WhiteBack>
|
</WhiteBack>
|
||||||
|
|
|
@ -10,7 +10,7 @@ const roles = {
|
||||||
read: "报告者",
|
read: "报告者",
|
||||||
};
|
};
|
||||||
const limit = 15;
|
const limit = 15;
|
||||||
function CollaboratorGroup({ newGroupId, owner, projectsId }) {
|
function CollaboratorGroup({ newGroupId, owner, projectsId , setAddOperation }) {
|
||||||
const [list, setList] = useState(undefined);
|
const [list, setList] = useState(undefined);
|
||||||
const [isSpin, setIsSpin] = useState(true);
|
const [isSpin, setIsSpin] = useState(true);
|
||||||
const [page, setPage] = useState(1);
|
const [page, setPage] = useState(1);
|
||||||
|
@ -34,6 +34,7 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) {
|
||||||
setList(result.data.teams);
|
setList(result.data.teams);
|
||||||
setTotal(result.data.total_count);
|
setTotal(result.data.total_count);
|
||||||
setIsSpin(false);
|
setIsSpin(false);
|
||||||
|
setAddOperation(result.data.can_add);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {});
|
.catch((error) => {});
|
||||||
|
@ -47,8 +48,7 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) {
|
||||||
// 添加团队
|
// 添加团队
|
||||||
function addGroup(id) {
|
function addGroup(id) {
|
||||||
const url = `/${owner}/${projectsId}/teams.json`;
|
const url = `/${owner}/${projectsId}/teams.json`;
|
||||||
axios
|
axios.post(url, {
|
||||||
.post(url, {
|
|
||||||
team_id: id,
|
team_id: id,
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
|
@ -77,7 +77,11 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) {
|
||||||
title: "团队名",
|
title: "团队名",
|
||||||
dataIndex: "name",
|
dataIndex: "name",
|
||||||
render: (value, item) => {
|
render: (value, item) => {
|
||||||
return <Link to={`/organize/${owner}/group/${item.id}`}>{value}</Link>;
|
if(item.is_admin || item.is_member){
|
||||||
|
return <Link to={`/${owner}/group/${item.id}`}>{value}</Link>;
|
||||||
|
}else{
|
||||||
|
return <span>{value}</span>;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -186,7 +186,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
||||||
render: (text, item) => (
|
render: (text, item) => (
|
||||||
<span className="f-wrap-alignCenter">
|
<span className="f-wrap-alignCenter">
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item.login}`}
|
to={`/${item.login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
@ -204,7 +204,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
||||||
title: "用户名",
|
title: "用户名",
|
||||||
dataIndex: "name",
|
dataIndex: "name",
|
||||||
render: (text, item) => (
|
render: (text, item) => (
|
||||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
<Link to={`/${item.login}`} className="show-user-link">
|
||||||
{text}
|
{text}
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|
|
@ -49,14 +49,14 @@ class Index extends Component {
|
||||||
const { projectsId , owner } = this.props.match.params;
|
const { projectsId , owner } = this.props.match.params;
|
||||||
const { pathname } = this.props.history.location;
|
const { pathname } = this.props.history.location;
|
||||||
|
|
||||||
const flag = pathname === `/projects/${owner}/${projectsId}/setting`;
|
const flag = pathname === `/${owner}/${projectsId}/setting`;
|
||||||
return (
|
return (
|
||||||
<Box className="ProjectListIndex">
|
<Box className="ProjectListIndex">
|
||||||
<Short>
|
<Short>
|
||||||
<ul className="list-l-Menu">
|
<ul className="list-l-Menu">
|
||||||
<li className={flag ? "active" : ""}>
|
<li className={flag ? "active" : ""}>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting`} className="w-100">
|
<Link to={`/${owner}/${projectsId}/setting`} className="w-100">
|
||||||
<i className="iconfont icon-huabanfuben font-18 mr10"></i>基本设置
|
<i className="iconfont icon-huabanfuben font-18 mr10"></i>基本设置
|
||||||
</Link>
|
</Link>
|
||||||
</p>
|
</p>
|
||||||
|
@ -67,7 +67,7 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/collaborator`} className="w-100">
|
<Link to={`/${owner}/${projectsId}/setting/collaborator`} className="w-100">
|
||||||
<i className="iconfont icon-chengyuan font-18 mr10"></i>
|
<i className="iconfont icon-chengyuan font-18 mr10"></i>
|
||||||
协作者管理
|
协作者管理
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -79,7 +79,7 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/webhooks`} className="w-100">
|
<Link to={`/${owner}/${projectsId}/setting/webhooks`} className="w-100">
|
||||||
<i className="iconfont icon-a-xuanzhongwebhookicon font-18 mr10 color-grey-9"></i>
|
<i className="iconfont icon-a-xuanzhongwebhookicon font-18 mr10 color-grey-9"></i>
|
||||||
Webhooks
|
Webhooks
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -91,7 +91,7 @@ class Index extends Component {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/branch`} className="w-100">
|
<Link to={`/${owner}/${projectsId}/setting/branch`} className="w-100">
|
||||||
<i className="iconfont icon-fenzhi font-20 mr10"></i>
|
<i className="iconfont icon-fenzhi font-20 mr10"></i>
|
||||||
分支设置
|
分支设置
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -101,7 +101,7 @@ class Index extends Component {
|
||||||
className={pathname.indexOf("setting/tags") > -1 ? "active" : ""}
|
className={pathname.indexOf("setting/tags") > -1 ? "active" : ""}
|
||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/tags`} className="w-100">
|
<Link to={`/${owner}/${projectsId}/setting/tags`} className="w-100">
|
||||||
<i className="iconfont icon-biaoqian3 font-18 mr10 color-grey-6"></i>
|
<i className="iconfont icon-biaoqian3 font-18 mr10 color-grey-6"></i>
|
||||||
项目标签
|
项目标签
|
||||||
</Link>
|
</Link>
|
||||||
|
@ -127,64 +127,64 @@ class Index extends Component {
|
||||||
<Switch {...this.props}>
|
<Switch {...this.props}>
|
||||||
{/* webhooks */}
|
{/* webhooks */}
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/webhooks/new"
|
path="/:owner/:projectsId/setting/webhooks/new"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<WebhookNew {...this.props} {...props} {...this.state} />
|
<WebhookNew {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/webhooks/:id"
|
path="/:owner/:projectsId/setting/webhooks/:id"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<WebhookNew {...this.props} {...props} {...this.state} />
|
<WebhookNew {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/webhooks"
|
path="/:owner/:projectsId/setting/webhooks"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<Webhook {...this.props} {...props} {...this.state} />
|
<Webhook {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 协作者 */}
|
{/* 协作者 */}
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/collaborator"
|
path="/:owner/:projectsId/setting/collaborator"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<Collaborator {...this.props} {...props} {...this.state} />
|
<Collaborator {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 修改仓库信息 */}
|
{/* 修改仓库信息 */}
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/tags"
|
path="/:owner/:projectsId/setting/tags"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<Tags {...this.props} {...props} {...this.state} />
|
<Tags {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/branch/:branch"
|
path="/:owner/:projectsId/setting/branch/:branch"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<BranchNew {...this.props} {...props} {...this.state} />
|
<BranchNew {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/branch"
|
path="/:owner/:projectsId/setting/branch"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<Branch {...this.props} {...props } {...this.state} />
|
<Branch {...this.props} {...props } {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/manage/new"
|
path="/:owner/:projectsId/setting/manage/new"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<ManageNew {...this.props} {...props} {...this.state} />
|
<ManageNew {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting/manage"
|
path="/:owner/:projectsId/setting/manage"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<Manage {...this.props} {...props} {...this.state} />
|
<Manage {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 修改仓库信息 */}
|
{/* 修改仓库信息 */}
|
||||||
<Route
|
<Route
|
||||||
path="/projects/:owner/:projectsId/setting"
|
path="/:owner/:projectsId/setting"
|
||||||
render={(props) => (
|
render={(props) => (
|
||||||
<Setting {...this.props} {...props} {...this.state} />
|
<Setting {...this.props} {...props} {...this.state} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -16,7 +16,7 @@ const menu = [
|
||||||
{name:"合并请求",index:"pulls"},
|
{name:"合并请求",index:"pulls"},
|
||||||
{name:"Wiki",index:"wiki"},
|
{name:"Wiki",index:"wiki"},
|
||||||
{name:"工作流(beta版)",index:"devops"},
|
{name:"工作流(beta版)",index:"devops"},
|
||||||
{name:"资源库",index:"resources"},
|
// {name:"资源库",index:"resources"},
|
||||||
{name:"里程碑",index:"versions"},
|
{name:"里程碑",index:"versions"},
|
||||||
{name:"动态",index:"activity"},
|
{name:"动态",index:"activity"},
|
||||||
]
|
]
|
||||||
|
@ -351,7 +351,7 @@ class Setting extends Component {
|
||||||
{
|
{
|
||||||
is_transfering ?
|
is_transfering ?
|
||||||
<span>此仓库正在转移给【
|
<span>此仓库正在转移给【
|
||||||
{transfer && <Link to={transfer.type="User"?`/users/${transfer.login}`:`/organize/${transfer.login}`}>{transfer.name}</Link>}
|
{transfer && <Link to={transfer.login}>{transfer.name}</Link>}
|
||||||
】,请联系对方接收此仓库。</span>
|
】,请联系对方接收此仓库。</span>
|
||||||
:
|
:
|
||||||
`将此仓库转移给其他用户或组织`
|
`将此仓库转移给其他用户或组织`
|
||||||
|
|
|
@ -62,7 +62,7 @@ function Index(props) {
|
||||||
if(total >= 20){
|
if(total >= 20){
|
||||||
return props.showNotification("webhooks数量已到上限!请删除暂不使用的webhooks以进行添加操作");
|
return props.showNotification("webhooks数量已到上限!请删除暂不使用的webhooks以进行添加操作");
|
||||||
}
|
}
|
||||||
props.history.push(`/projects/${owner}/${projectsId}/setting/webhooks/new`)
|
props.history.push(`/${owner}/${projectsId}/setting/webhooks/new`)
|
||||||
}
|
}
|
||||||
|
|
||||||
return(
|
return(
|
||||||
|
@ -90,9 +90,9 @@ function Index(props) {
|
||||||
return(
|
return(
|
||||||
<List.Item key={k}>
|
<List.Item key={k}>
|
||||||
<i className="iconfont icon-a-xuanzhongwebhookicon color-grey-d mr12 font-17"></i>
|
<i className="iconfont icon-a-xuanzhongwebhookicon color-grey-d mr12 font-17"></i>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/webhooks/${i.id}`} className="webName">{i.url}</Link>
|
<Link to={`/${owner}/${projectsId}/setting/webhooks/${i.id}`} className="webName">{i.url}</Link>
|
||||||
<span>
|
<span>
|
||||||
<Button ghost type={"primary"} onClick={()=>{props.history.push(`/projects/${owner}/${projectsId}/setting/webhooks/${i.id}`)}}>编辑</Button>
|
<Button ghost type={"primary"} onClick={()=>{props.history.push(`/${owner}/${projectsId}/setting/webhooks/${i.id}`)}}>编辑</Button>
|
||||||
<Button ghost className="ml20" type="danger" onClick={()=>{deleteFunc(i.id,i.url)}}>删除</Button>
|
<Button ghost className="ml20" type="danger" onClick={()=>{deleteFunc(i.id,i.url)}}>删除</Button>
|
||||||
</span>
|
</span>
|
||||||
</List.Item>
|
</List.Item>
|
||||||
|
|
|
@ -111,7 +111,7 @@ function New({ form , match , showNotification , history }) {
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result){
|
if(result){
|
||||||
showNotification("webhook更新成功!");
|
showNotification("webhook更新成功!");
|
||||||
history.push(`/projects/${owner}/${projectsId}/setting/webhooks`);
|
history.push(`/${owner}/${projectsId}/setting/webhooks`);
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}else{
|
}else{
|
||||||
|
@ -125,7 +125,7 @@ function New({ form , match , showNotification , history }) {
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result && result.data && result.data.id){
|
if(result && result.data && result.data.id){
|
||||||
showNotification("webhook新建成功!");
|
showNotification("webhook新建成功!");
|
||||||
history.push(`/projects/${owner}/${projectsId}/setting/webhooks`);
|
history.push(`/${owner}/${projectsId}/setting/webhooks`);
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ function New({ form , match , showNotification , history }) {
|
||||||
axios.delete(url).then(result=>{
|
axios.delete(url).then(result=>{
|
||||||
if(result){
|
if(result){
|
||||||
showNotification("webhook删除成功!");
|
showNotification("webhook删除成功!");
|
||||||
history.push(`/projects/${owner}/${projectsId}/setting/webhooks`);
|
history.push(`/${owner}/${projectsId}/setting/webhooks`);
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ function New({ form , match , showNotification , history }) {
|
||||||
subTitle={`删除后未来事件将不会推送至此Webhook地址:${data && data.url}`}
|
subTitle={`删除后未来事件将不会推送至此Webhook地址:${data && data.url}`}
|
||||||
/>
|
/>
|
||||||
<Banner>
|
<Banner>
|
||||||
<Link to={`/projects/${owner}/${projectsId}/setting/webhooks`} className="color-blue">Webhooks</Link>
|
<Link to={`/${owner}/${projectsId}/setting/webhooks`} className="color-blue">Webhooks</Link>
|
||||||
<i className="iconfont icon-youjiantou ml5 mr5 font-12"></i>
|
<i className="iconfont icon-youjiantou ml5 mr5 font-12"></i>
|
||||||
<span>{id ? "更新" : "添加"}Webhook</span>
|
<span>{id ? "更新" : "添加"}Webhook</span>
|
||||||
</Banner>
|
</Banner>
|
||||||
|
|
|
@ -217,7 +217,7 @@ function Index(props){
|
||||||
data.map((item,key)=>{
|
data.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<li>
|
<li>
|
||||||
<Link to= {`/users/${item.login}`} className="infoImg"><img src={getImageUrl(`/${item.imageUrl}`)} alt="" /></Link>
|
<Link to= {`/${item.login}`} className="infoImg"><img src={getImageUrl(`/${item.imageUrl}`)} alt="" /></Link>
|
||||||
<div style={{flex:'1',width:"0"}}>
|
<div style={{flex:'1',width:"0"}}>
|
||||||
<FlexAJ>
|
<FlexAJ>
|
||||||
<AlignCenter>
|
<AlignCenter>
|
||||||
|
|
|
@ -31,7 +31,7 @@ export default (({projects}) => {
|
||||||
return (
|
return (
|
||||||
<Div>
|
<Div>
|
||||||
<Imgs src={item.project && getImageUrl(`/${item.project.owner_image_url}`)}/>
|
<Imgs src={item.project && getImageUrl(`/${item.project.owner_image_url}`)}/>
|
||||||
<Link to={`/projects/${item.project.owner_login}/${item.project.identifier}`}>{item.project.name}</Link>
|
<Link to={`/${item.project.owner_login}/${item.project.identifier}`}>{item.project.name}</Link>
|
||||||
</Div>
|
</Div>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -26,18 +26,18 @@ export default (props)=>{
|
||||||
|
|
||||||
function returnActive (pathname){
|
function returnActive (pathname){
|
||||||
let a = 0;
|
let a = 0;
|
||||||
if(pathname === `/organize/${OIdentifier}/group/${groupId}/setting/member`){
|
if(pathname === `/${OIdentifier}/group/${groupId}/setting/member`){
|
||||||
a = 1;
|
a = 1;
|
||||||
}else if(pathname === `/organize/${OIdentifier}/group/${groupId}/setting/project`){
|
}else if(pathname === `/${OIdentifier}/group/${groupId}/setting/project`){
|
||||||
a = 2;
|
a = 2;
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
const active = returnActive(pathname);
|
const active = returnActive(pathname);
|
||||||
const array = {list:[
|
const array = {list:[
|
||||||
{name:'基本设置',icon:"icon-base",href:`/organize/${OIdentifier}/group/${groupId}/setting`},
|
{name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/group/${groupId}/setting`},
|
||||||
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${OIdentifier}/group/${groupId}/setting/member`},
|
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/group/${groupId}/setting/member`},
|
||||||
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${OIdentifier}/group/${groupId}/setting/project`},
|
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/group/${groupId}/setting/project`},
|
||||||
],
|
],
|
||||||
active
|
active
|
||||||
}
|
}
|
||||||
|
@ -51,19 +51,19 @@ export default (props)=>{
|
||||||
<WhiteBack style={{border:'1px solid #eee'}}>
|
<WhiteBack style={{border:'1px solid #eee'}}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId/setting/project"
|
path="/:OIdentifier/group/:groupId/setting/project"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Project {...props} />
|
<Project {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId/setting/member"
|
path="/:OIdentifier/group/:groupId/setting/member"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Member {...props} />
|
<Member {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId/setting"
|
path="/:OIdentifier/group/:groupId/setting"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Common {...props} />
|
<Common {...props} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -89,7 +89,7 @@ export default ((props) => {
|
||||||
axios.delete(url).then((result) => {
|
axios.delete(url).then((result) => {
|
||||||
if (result && result.data) {
|
if (result && result.data) {
|
||||||
props.showNotification(`已成功退出团队!`);
|
props.showNotification(`已成功退出团队!`);
|
||||||
props.history.push(`/organize/${OIdentifier}`);
|
props.history.push(`/${OIdentifier}`);
|
||||||
}
|
}
|
||||||
}).catch((error) => { });
|
}).catch((error) => { });
|
||||||
}
|
}
|
||||||
|
@ -119,7 +119,7 @@ export default ((props) => {
|
||||||
<div className="g-tip">
|
<div className="g-tip">
|
||||||
<p>管理员团队对 <span>所有仓库</span> 具有操作权限,且对组织具有 <span>管理员权限</span>。 </p>
|
<p>管理员团队对 <span>所有仓库</span> 具有操作权限,且对组织具有 <span>管理员权限</span>。 </p>
|
||||||
<p>此外,该团队拥有了 <span>创建仓库</span> 的权限:成员可以在组织中创建新的仓库。 </p>
|
<p>此外,该团队拥有了 <span>创建仓库</span> 的权限:成员可以在组织中创建新的仓库。 </p>
|
||||||
{group.is_admin ? <Button type="primary" onClick={()=>props.history.push(`/organize/${OIdentifier}/group/${groupId}/setting`)}><span className="color-white">团队设置</span></Button> : ""}
|
{group.is_admin ? <Button type="primary" onClick={()=>props.history.push(`/${OIdentifier}/group/${groupId}/setting`)}><span className="color-white">团队设置</span></Button> : ""}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
:
|
:
|
||||||
|
|
|
@ -24,21 +24,32 @@ export default Form.create()(
|
||||||
const [check_box, setCheckBox] = useState(false);
|
const [check_box, setCheckBox] = useState(false);
|
||||||
const [switch_box, setSwtichBox] = useState([]);
|
const [switch_box, setSwtichBox] = useState([]);
|
||||||
const [onwers, setOnwers] = useState(false);
|
const [onwers, setOnwers] = useState(false);
|
||||||
|
const [auth, setAuth] = useState("");
|
||||||
const [ descNum , setDescNum ] = useState(0);
|
const [ descNum , setDescNum ] = useState(0);
|
||||||
const [switch_box_code, setSwtichBoxCode] = useState(false);
|
const [switch_box_code, setSwtichBoxCode] = useState(false);
|
||||||
const [switch_box_pull, setSwtichBoxPull] = useState(false);
|
const [switch_box_pull, setSwtichBoxPull] = useState(false);
|
||||||
const [switch_box_issue, setSwtichBoxIssue] = useState(false);
|
const [switch_box_issue, setSwtichBoxIssue] = useState(false);
|
||||||
const [switch_box_release, setSwtichBoxRelease] = useState(false);
|
const [switch_box_release, setSwtichBoxRelease] = useState(false);
|
||||||
|
const [switch_box_wiki, setSwtichBoxWiki] = useState(false);
|
||||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||||
const { OIdentifier, groupId } = match.params;
|
const { OIdentifier, groupId } = match.params;
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
setFieldsValue({
|
||||||
|
authorize:"read",
|
||||||
|
includes_all_project:0
|
||||||
|
})
|
||||||
|
},[])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (GroupDetail) {
|
if (GroupDetail) {
|
||||||
setOnwers(GroupDetail.authorize === "owner");
|
setOnwers(GroupDetail.authorize === "owner");
|
||||||
|
setAuth(GroupDetail.authorize);
|
||||||
setCheckBox(GroupDetail.can_create_org_project)
|
setCheckBox(GroupDetail.can_create_org_project)
|
||||||
setSwtichBox(GroupDetail.units)
|
setSwtichBox(GroupDetail.units)
|
||||||
setFieldsValue({
|
setFieldsValue({
|
||||||
...GroupDetail
|
...GroupDetail,
|
||||||
|
includes_all_project:GroupDetail.includes_all_project ? 1 :0
|
||||||
})
|
})
|
||||||
setDescNum(GroupDetail.description ? GroupDetail.description.length : 0);
|
setDescNum(GroupDetail.description ? GroupDetail.description.length : 0);
|
||||||
}
|
}
|
||||||
|
@ -50,6 +61,7 @@ export default Form.create()(
|
||||||
setSwtichBoxPull(switch_checked("pulls"))
|
setSwtichBoxPull(switch_checked("pulls"))
|
||||||
setSwtichBoxIssue(switch_checked("issues"))
|
setSwtichBoxIssue(switch_checked("issues"))
|
||||||
setSwtichBoxRelease(switch_checked("releases"))
|
setSwtichBoxRelease(switch_checked("releases"))
|
||||||
|
setSwtichBoxWiki(switch_checked("wiki"))
|
||||||
}
|
}
|
||||||
}, [switch_box])
|
}, [switch_box])
|
||||||
|
|
||||||
|
@ -68,25 +80,28 @@ export default Form.create()(
|
||||||
setIsSpin(true)
|
setIsSpin(true)
|
||||||
validateFields((error, values) => {
|
validateFields((error, values) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
values.unit_types = switch_box
|
// values.unit_types = switch_box
|
||||||
|
values.unit_types = ['code','pulls','issues','releases','wiki'];
|
||||||
if (groupId) { // 表示编辑,否则为新建
|
if (groupId) { // 表示编辑,否则为新建
|
||||||
const url = `/organizations/${OIdentifier}/teams/${groupId}.json`;
|
const url = `/organizations/${OIdentifier}/teams/${groupId}.json`;
|
||||||
axios.put(url, {
|
axios.put(url, {
|
||||||
...values
|
...values,
|
||||||
|
includes_all_project:values.includes_all_project === 1?true:false
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (result && result.data) {
|
if (result && result.data) {
|
||||||
showNotification("基本设置更新成功!");
|
showNotification("基本设置更新成功!");
|
||||||
history.push(`/organize/${OIdentifier}/group/${groupId}`);
|
history.push(`/${OIdentifier}/group/${groupId}`);
|
||||||
}
|
}
|
||||||
}).catch(error => { })
|
}).catch(error => { })
|
||||||
} else {
|
} else {
|
||||||
const url = `/organizations/${OIdentifier}/teams.json`;
|
const url = `/organizations/${OIdentifier}/teams.json`;
|
||||||
axios.post(url, {
|
axios.post(url, {
|
||||||
...values
|
...values,
|
||||||
|
includes_all_project:values.includes_all_project === 1?true:false
|
||||||
}).then(result => {
|
}).then(result => {
|
||||||
if (result && result.data) {
|
if (result && result.data) {
|
||||||
showNotification("团队创建成功!");
|
showNotification("团队创建成功!");
|
||||||
history.push(`/organize/${OIdentifier}/group/${result.data.id}`);
|
history.push(`/${OIdentifier}/group/${result.data.id}`);
|
||||||
}
|
}
|
||||||
}).catch(error => { })
|
}).catch(error => { })
|
||||||
}
|
}
|
||||||
|
@ -132,14 +147,22 @@ export default Form.create()(
|
||||||
setSwtichBoxRelease(checked)
|
setSwtichBoxRelease(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function switch_wiki_types(checked, event) {
|
||||||
|
switch_unit_types(checked, "wiki");
|
||||||
|
setSwtichBoxWiki(checked);
|
||||||
|
}
|
||||||
|
|
||||||
function cancelEdit(){
|
function cancelEdit(){
|
||||||
if(groupId){
|
if(groupId){
|
||||||
history.push(`/organize/${OIdentifier}/group/${groupId}`);
|
history.push(`/${OIdentifier}/group/${groupId}`);
|
||||||
}else{
|
}else{
|
||||||
history.push(`/organize/${OIdentifier}`);
|
history.push(`/${OIdentifier}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeAuth(params) {
|
||||||
|
setAuth(params.target.value)
|
||||||
|
}
|
||||||
|
|
||||||
function checkname(rule, value, callback){
|
function checkname(rule, value, callback){
|
||||||
if(!value){
|
if(!value){
|
||||||
|
@ -192,8 +215,8 @@ export default Form.create()(
|
||||||
"includes_all_project",
|
"includes_all_project",
|
||||||
[],
|
[],
|
||||||
<Radio.Group>
|
<Radio.Group>
|
||||||
<Radio value={false} style={addStyle}>指定项目<span className="color-grey-8 ml10">(团队成员将只能访问添加到团队的项目。 选择此项 <span className="color-grey-3">将不会</span> 自动删除已经添加的项目)</span></Radio>
|
<Radio value={0} style={addStyle}>指定项目<span className="color-grey-8 ml10">(团队成员将只能访问添加到团队的项目。 选择此项 <span className="color-grey-3">将不会</span> 自动删除已经添加的项目)</span></Radio>
|
||||||
<Radio value={true} style={OptionStyle}>所有项目<span className="color-grey-8 ml10">(团队可以访问所有项目。选择此选项将 <span className="color-grey-3">添加所有现有的</span> 项目到指定团队)</span></Radio>
|
<Radio value={1} style={OptionStyle}>所有项目<span className="color-grey-8 ml10">(团队可以访问所有项目。选择此选项将 <span className="color-grey-3">添加所有现有的</span> 项目到指定团队)</span></Radio>
|
||||||
</Radio.Group>, false, 0,onwers ? "hide":""
|
</Radio.Group>, false, 0,onwers ? "hide":""
|
||||||
)}
|
)}
|
||||||
{helper(
|
{helper(
|
||||||
|
@ -202,18 +225,19 @@ export default Form.create()(
|
||||||
[],
|
[],
|
||||||
<Checkbox checked={check_box} onChange={change_check_box_status} style={OptionStyle}>新建项目<span className="color-grey-8 ml10">(成员可以在组织中新建项目。创建者将自动获得新建的项目的管理员权限)</span></Checkbox>, false, 20,onwers ? "hide":""
|
<Checkbox checked={check_box} onChange={change_check_box_status} style={OptionStyle}>新建项目<span className="color-grey-8 ml10">(成员可以在组织中新建项目。创建者将自动获得新建的项目的管理员权限)</span></Checkbox>, false, 20,onwers ? "hide":""
|
||||||
)}
|
)}
|
||||||
{/* {helper(
|
{helper(
|
||||||
'版本库权限:',
|
'版本库权限:',
|
||||||
"authorize",
|
"authorize",
|
||||||
[],
|
[],
|
||||||
<Radio.Group>
|
<Radio.Group onChange={changeAuth}>
|
||||||
<Radio value="read" style={addStyle}>读取权限<span className="color-grey-8 ml10">(成员可以查看和克隆团队项目)</span></Radio>
|
<Radio value="read" style={addStyle}>读取权限<span className="color-grey-8 ml10">(成员可以查看和克隆团队项目)</span></Radio>
|
||||||
<Radio value="write" style={addStyle}>写入权限<span className="color-grey-8 ml10">(成员可以查看和推送提交到团队项目)</span></Radio>
|
<Radio value="write" style={addStyle}>写入权限<span className="color-grey-8 ml10">(成员可以查看和推送提交到团队项目)</span></Radio>
|
||||||
<Radio value="admin" style={OptionStyle}>管理员权限<span className="color-grey-8 ml10">(成员可以拉取和推送到团队项目同时可以添加协作者)</span></Radio>
|
<Radio value="admin" style={OptionStyle}>管理员权限<span className="color-grey-8 ml10">(成员可以拉取和推送到团队项目同时可以添加协作者)</span></Radio>
|
||||||
</Radio.Group>, false, 20,onwers ? "hide":""
|
</Radio.Group>, false, 20,onwers ? "hide":""
|
||||||
)} */}
|
)}
|
||||||
</Form>
|
</Form>
|
||||||
{/* <p className="required">允许访问项目单元:</p>
|
{/* <div className={(auth!=="owner" && auth !=="admin") ? "" :"hide"}>
|
||||||
|
<p className="required">允许访问项目单元:</p>
|
||||||
<AlignCenter className="mb10">
|
<AlignCenter className="mb10">
|
||||||
<Switch checked={switch_box_code} onClick={switch_code_types} />
|
<Switch checked={switch_box_code} onClick={switch_code_types} />
|
||||||
<span className="ml30 color-grey-3">代码库<span className="color-grey-8 ml15">(查看源码、文件、提交和分支)</span></span>
|
<span className="ml30 color-grey-3">代码库<span className="color-grey-8 ml15">(查看源码、文件、提交和分支)</span></span>
|
||||||
|
@ -226,13 +250,17 @@ export default Form.create()(
|
||||||
<Switch checked={switch_box_pull} onClick={switch_pull_types} />
|
<Switch checked={switch_box_pull} onClick={switch_pull_types} />
|
||||||
<span className="ml30 color-grey-3">合并请求<span className="color-grey-8 ml15">(启用合并请求和代码评审)</span></span>
|
<span className="ml30 color-grey-3">合并请求<span className="color-grey-8 ml15">(启用合并请求和代码评审)</span></span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
<AlignCenter className="mb20">
|
<AlignCenter className="mb10">
|
||||||
<Switch checked={switch_box_release} onClick={switch_releas_types} />
|
<Switch checked={switch_box_release} onClick={switch_releas_types} />
|
||||||
<span className="ml30 color-grey-3">版本发布<span className="color-grey-8 ml15">(跟踪项目版本和下载)</span></span>
|
<span className="ml30 color-grey-3">版本发布<span className="color-grey-8 ml15">(跟踪项目版本和下载)</span></span>
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
*/}
|
<AlignCenter className="mb20">
|
||||||
|
<Switch checked={switch_box_wiki} onClick={switch_wiki_types} />
|
||||||
|
<span className="ml30 color-grey-3">wiki<span className="color-grey-8 ml15">(编辑此仓库的相关文档说明)</span></span>
|
||||||
|
</AlignCenter>
|
||||||
|
</div> */}
|
||||||
<Button type={"primary"} onClick={saveGroupFrom}>{groupId ? "更新团队设置" : "新建团队"}</Button>
|
<Button type={"primary"} onClick={saveGroupFrom}>{groupId ? "更新团队设置" : "新建团队"}</Button>
|
||||||
<Cancel className="ml30" onClick={() => cancelEdit()}><span className="pl30 pr30">取消</span></Cancel>
|
<Cancel className="ml30" onClick={() => cancelEdit()}><span>取消</span></Cancel>
|
||||||
</Div>
|
</Div>
|
||||||
</WhiteBack>
|
</WhiteBack>
|
||||||
</Spin>
|
</Spin>
|
||||||
|
|
|
@ -87,7 +87,7 @@ export default ((props) => {
|
||||||
align: "center",
|
align: "center",
|
||||||
render: (value, item) => {
|
render: (value, item) => {
|
||||||
return (
|
return (
|
||||||
<Link to={`/users/${item.user.login}`}>{item.user.name}</Link>
|
<Link to={`/${item.user.login}`}>{item.user.name}</Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -180,7 +180,7 @@ function GroupProjectSetting(props) {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<List.Item.Meta
|
<List.Item.Meta
|
||||||
title={<a href={`/projects/${item.project.owner_login}/${item.project.identifier}`}>{item.project.owner_name}/{item.project.name}</a>}
|
title={<a href={`/${item.project.owner_login}/${item.project.identifier}`}>{item.project.owner_name}/{item.project.name}</a>}
|
||||||
/>
|
/>
|
||||||
</List.Item>
|
</List.Item>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -33,28 +33,28 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
||||||
<Switch>
|
<Switch>
|
||||||
{/* 组织团队-设置 */}
|
{/* 组织团队-设置 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId/setting"
|
path="/:OIdentifier/group/:groupId/setting"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <SubDetailIndex {...props} {...p}/>
|
return <SubDetailIndex {...props} {...p}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 组织团队-新建 */}
|
{/* 组织团队-新建 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/new"
|
path="/:OIdentifier/group/new"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <GroupNew {...props} {...p}/>
|
return <GroupNew {...props} {...p}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 组织团队-子级(包含组织团队列表) */}
|
{/* 组织团队-子级(包含组织团队列表) */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group"
|
path="/:OIdentifier/group"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <DetailIndex {...props} {...p}/>
|
return <DetailIndex {...props} {...p}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 组织成员 */}
|
{/* 组织成员 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/member"
|
path="/:OIdentifier/member"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <DetailIndex {...props} {...p}/>
|
return <DetailIndex {...props} {...p}/>
|
||||||
}}
|
}}
|
||||||
|
@ -68,7 +68,7 @@ export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
||||||
></Route>
|
></Route>
|
||||||
{/* 组织详情(包含组织设置) */}
|
{/* 组织详情(包含组织设置) */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier"
|
path="/:OIdentifier"
|
||||||
render={(p) => (
|
render={(p) => (
|
||||||
<DetailIndex {...props} {...p}/>
|
<DetailIndex {...props} {...p}/>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -368,5 +368,5 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.hide{
|
.hide{
|
||||||
display: hidden;
|
display: none;
|
||||||
}
|
}
|
|
@ -61,8 +61,8 @@ function List(props){
|
||||||
)
|
)
|
||||||
const menu_new=(
|
const menu_new=(
|
||||||
<Menu>
|
<Menu>
|
||||||
<Menu.Item key="updated_on"><Link to={`/projects/deposit/new/${OIdentifier}`}>新建托管项目</Link></Menu.Item>
|
<Menu.Item key="updated_on"><Link to={`/deposit/new/${OIdentifier}`}>新建托管项目</Link></Menu.Item>
|
||||||
<Menu.Item key="created_on"><Link to={`/projects/mirror/new/${OIdentifier}`}>新建镜像项目</Link></Menu.Item>
|
<Menu.Item key="created_on"><Link to={`/mirror/new/${OIdentifier}`}>新建镜像项目</Link></Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ function List(props){
|
||||||
<Search placeholder="输入仓库名称进行搜索" onSearch={onSearch}/>
|
<Search placeholder="输入仓库名称进行搜索" onSearch={onSearch}/>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
<p>
|
||||||
{ organizeDetail && organizeDetail.is_admin ?
|
{ organizeDetail && organizeDetail.can_create_project ?
|
||||||
<Sort menu={menu_new}>
|
<Sort menu={menu_new}>
|
||||||
<a className="addBtn mr30">+ 新建项目</a>
|
<a className="addBtn mr30">+ 新建项目</a>
|
||||||
</Sort>
|
</Sort>
|
||||||
|
|
|
@ -7,7 +7,7 @@ function ListItem({item,key,OIdentifier}) {
|
||||||
<div className="team_project" key={key}>
|
<div className="team_project" key={key}>
|
||||||
<p className="t_p_title">
|
<p className="t_p_title">
|
||||||
<span className="flex1">
|
<span className="flex1">
|
||||||
<Link to={`/projects/${OIdentifier}/${item.identifier}`} className="name">{item.name}</Link>
|
<Link to={`/${OIdentifier}/${item.identifier}`} className="name">{item.name}</Link>
|
||||||
{ item.forked_from_project_id && <i className="iconfont icon-fork font-18 color-orange ml8" /> }
|
{ item.forked_from_project_id && <i className="iconfont icon-fork font-18 color-orange ml8" /> }
|
||||||
{
|
{
|
||||||
item.type && item.type !== 0 ?
|
item.type && item.type !== 0 ?
|
||||||
|
|
|
@ -49,7 +49,7 @@ export default Form.create()(
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
showNotification("组织创建成功!");
|
showNotification("组织创建成功!");
|
||||||
history.push(`/organize/${result.data.name}`);
|
history.push(`/${result.data.name}`);
|
||||||
}
|
}
|
||||||
}).catch(error=>{})
|
}).catch(error=>{})
|
||||||
}
|
}
|
||||||
|
@ -145,6 +145,7 @@ export default Form.create()(
|
||||||
<p className="mt20">
|
<p className="mt20">
|
||||||
<Button type="primary" className="mr30" onClick={createOrganize}>创建组织</Button>
|
<Button type="primary" className="mr30" onClick={createOrganize}>创建组织</Button>
|
||||||
<Button className="grey" onClick={()=>{window.history.back(-1)}}>取消</Button>
|
<Button className="grey" onClick={()=>{window.history.back(-1)}}>取消</Button>
|
||||||
|
<Button className="grey" onClick={()=>{test}}>test</Button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -67,14 +67,14 @@ function RightBox({ OIdentifier , history , admin }) {
|
||||||
<div className="list-r">
|
<div className="list-r">
|
||||||
{
|
{
|
||||||
memberData && memberData.organization_users && memberData.organization_users.length>0 ?
|
memberData && memberData.organization_users && memberData.organization_users.length>0 ?
|
||||||
<Box name="组织成员" count={memberData && memberData.total_count} url={`/organize/${OIdentifier}/member`}>
|
<Box name="组织成员" count={memberData && memberData.total_count} url={`/${OIdentifier}/member`}>
|
||||||
{
|
{
|
||||||
memberData.organization_users.map((item,key)=>{
|
memberData.organization_users.map((item,key)=>{
|
||||||
return(
|
return(
|
||||||
<div className="teammembers" key={key}>
|
<div className="teammembers" key={key}>
|
||||||
<Link to={`/users/${item.user && item.user.login}`}><Img src={getImageUrl(`/${item.user && item.user.image_url}`)} alt="" className="m-img"/></Link>
|
<Link to={`/${item.user && item.user.login}`}><Img src={getImageUrl(`/${item.user && item.user.image_url}`)} alt="" className="m-img"/></Link>
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/users/${item.user && item.user.login}`}><ListName>{item.user && item.user.name}</ListName></Link>
|
<Link to={`/${item.user && item.user.login}`}><ListName>{item.user && item.user.name}</ListName></Link>
|
||||||
<Align><i className="iconfont icon-shijian color-green mr3 font-13"></i><Span>加入时间:{item.created_at}</Span></Align>
|
<Align><i className="iconfont icon-shijian color-green mr3 font-13"></i><Span>加入时间:{item.created_at}</Span></Align>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -87,8 +87,8 @@ function RightBox({ OIdentifier , history , admin }) {
|
||||||
<Box
|
<Box
|
||||||
name="组织团队"
|
name="组织团队"
|
||||||
count={groupData && groupData.total_count}
|
count={groupData && groupData.total_count}
|
||||||
bottom={admin && <Button type={'primary'} onClick={()=>history.push(`/organize/${OIdentifier}/group/new`)}>新建团队</Button>}
|
bottom={admin && <Button type={'primary'} onClick={()=>history.push(`/${OIdentifier}/group/new`)}>新建团队</Button>}
|
||||||
url={`/organize/${OIdentifier}/group`}
|
url={`/${OIdentifier}/group`}
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
groupData && groupData.teams && groupData.teams.length>0?
|
groupData && groupData.teams && groupData.teams.length>0?
|
||||||
|
@ -97,7 +97,12 @@ function RightBox({ OIdentifier , history , admin }) {
|
||||||
return(
|
return(
|
||||||
<div className="teammembers" key={key}>
|
<div className="teammembers" key={key}>
|
||||||
<div>
|
<div>
|
||||||
<Link to={`/organize/${OIdentifier}/group/${item.id}`}><ColorListName>{item.name}</ColorListName></Link>
|
{
|
||||||
|
(item.is_admin || item.is_member) ?
|
||||||
|
<Link to={`/${OIdentifier}/group/${item.id}`}><ColorListName>{item.name}</ColorListName></Link>
|
||||||
|
:
|
||||||
|
<ColorListName>{item.name}</ColorListName>
|
||||||
|
}
|
||||||
<Align>
|
<Align>
|
||||||
<Span>{item.num_users}名成员</Span>
|
<Span>{item.num_users}名成员</Span>
|
||||||
<Span>{item.num_projects}个仓库</Span>
|
<Span>{item.num_projects}个仓库</Span>
|
||||||
|
|
|
@ -62,7 +62,7 @@ export default Form.create()(
|
||||||
showNotification("组织信息更新成功!");
|
showNotification("组织信息更新成功!");
|
||||||
if(values.name !== organizeDetail.name){
|
if(values.name !== organizeDetail.name){
|
||||||
console.log("false111");
|
console.log("false111");
|
||||||
history.push(`/organize/${values.name}/setting`);
|
history.push(`/${values.name}/setting`);
|
||||||
}
|
}
|
||||||
updateFunc && updateFunc(values.name,values.description);
|
updateFunc && updateFunc(values.name,values.description);
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ export default Form.create()(
|
||||||
}).then(result=>{
|
}).then(result=>{
|
||||||
if(result && result.data){
|
if(result && result.data){
|
||||||
// 删除后跳转到个人中心的组织页面
|
// 删除后跳转到个人中心的组织页面
|
||||||
history.push(`/users/${current_user && current_user.login}/organizes`);
|
history.push(`/${current_user && current_user.login}/organizes`);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
|
@ -168,7 +168,7 @@ export default Form.create()(
|
||||||
'权限:',
|
'权限:',
|
||||||
"repo_admin_change_team_access",
|
"repo_admin_change_team_access",
|
||||||
[],
|
[],
|
||||||
<Checkbox style={radioStyle}>仓库管理员可以添加或移除团队的访问权限</Checkbox>,false,true
|
<Checkbox style={radioStyle}>项目管理员可以添加或移除团队的访问权限</Checkbox>,false,true
|
||||||
)}
|
)}
|
||||||
<Divider/>
|
<Divider/>
|
||||||
{helper(
|
{helper(
|
||||||
|
|
|
@ -30,21 +30,21 @@ export default (( props )=>{
|
||||||
|
|
||||||
function returnActive (pathname){
|
function returnActive (pathname){
|
||||||
let a = 0;
|
let a = 0;
|
||||||
if(pathname === `/organize/${OIdentifier}/setting/member`){
|
if(pathname === `/${OIdentifier}/setting/member`){
|
||||||
a = 1;
|
a = 1;
|
||||||
}else if(pathname === `/organize/${OIdentifier}/setting/group`){
|
}else if(pathname === `/${OIdentifier}/setting/group`){
|
||||||
a = 2;
|
a = 2;
|
||||||
}else if(pathname === `/organize/${OIdentifier}/setting/hooks`){
|
}else if(pathname === `/${OIdentifier}/setting/hooks`){
|
||||||
a = 3;
|
a = 3;
|
||||||
}
|
}
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
const active = returnActive(pathname);
|
const active = returnActive(pathname);
|
||||||
const array = {list:[
|
const array = {list:[
|
||||||
{name:'基本设置',icon:"icon-base",href:`/organize/${OIdentifier}/setting`},
|
{name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/setting`},
|
||||||
{name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${OIdentifier}/setting/member`},
|
{name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/setting/member`},
|
||||||
{name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/organize/${OIdentifier}/setting/group`},
|
{name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/setting/group`},
|
||||||
// {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/organize/${OIdentifier}/setting/hooks`}
|
// {name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/${OIdentifier}/setting/hooks`}
|
||||||
],
|
],
|
||||||
active
|
active
|
||||||
}
|
}
|
||||||
|
@ -58,25 +58,25 @@ export default (( props )=>{
|
||||||
<div style={{border:"1px solid #eee"}}>
|
<div style={{border:"1px solid #eee"}}>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/setting/hooks"
|
path="/:OIdentifier/setting/hooks"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Hooks {...props} />
|
<Hooks {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/setting/group"
|
path="/:OIdentifier/setting/group"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Group {...props} />
|
<Group {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/setting/member"
|
path="/:OIdentifier/setting/member"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Member {...props} />
|
<Member {...props} />
|
||||||
)}
|
)}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/setting"
|
path="/:OIdentifier/setting"
|
||||||
render={() => (
|
render={() => (
|
||||||
<Common {...props} />
|
<Common {...props} />
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default (({organizeDetail})=>{
|
||||||
width:"5%",
|
width:"5%",
|
||||||
render:(value)=>{
|
render:(value)=>{
|
||||||
return(
|
return(
|
||||||
value && <Link to={`/users/${value && value.login}`}><Img src={getImageUrl('/'+value.image_url)}></Img> </Link>
|
value && <Link to={`/${value && value.login}`}><Img src={getImageUrl('/'+value.image_url)}></Img> </Link>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -73,7 +73,7 @@ export default (({organizeDetail})=>{
|
||||||
dataIndex: 'user',
|
dataIndex: 'user',
|
||||||
width:"15%",
|
width:"15%",
|
||||||
render:(value,item)=>{
|
render:(value,item)=>{
|
||||||
return <Link to={`/users/${value && value.login}`}>{value && value.name}</Link>
|
return <Link to={`/${value && value.login}`}>{value && value.name}</Link>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,12 +38,12 @@ function Detail(props){
|
||||||
// 设置页面:顶部不需要设置按钮了
|
// 设置页面:顶部不需要设置按钮了
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(pathname){
|
if(pathname){
|
||||||
if(pathname.indexOf(`/organize/${OIdentifier}/setting`)>-1){
|
if(pathname.indexOf(`/${OIdentifier}/setting`)>-1){
|
||||||
setFlag(false);
|
setFlag(false);
|
||||||
}else{
|
}else{
|
||||||
setFlag(true);
|
setFlag(true);
|
||||||
}
|
}
|
||||||
if(pathname.indexOf(`/organize/${OIdentifier}/group`)>-1 || pathname.indexOf(`/organize/${OIdentifier}/member`)>-1){
|
if(pathname.indexOf(`/${OIdentifier}/group`)>-1 || pathname.indexOf(`/${OIdentifier}/member`)>-1){
|
||||||
setButtonflagFlag(true);
|
setButtonflagFlag(true);
|
||||||
}else{
|
}else{
|
||||||
setButtonflagFlag(false);
|
setButtonflagFlag(false);
|
||||||
|
@ -77,19 +77,19 @@ function Detail(props){
|
||||||
{
|
{
|
||||||
detail &&
|
detail &&
|
||||||
<Cards
|
<Cards
|
||||||
src={`/organize/${detail.name}`}
|
src={`/${detail.name}`}
|
||||||
title={detail.nickname}
|
title={detail.nickname}
|
||||||
desc={!buttonflag && detail.description}
|
desc={!buttonflag && detail.description}
|
||||||
img={detail.avatar_url}
|
img={detail.avatar_url}
|
||||||
rightBtn={
|
rightBtn={
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{flag && !buttonflag && detail.is_admin ?
|
{flag && !buttonflag && detail.is_admin ?
|
||||||
<Link to={`/organize/${OIdentifier}/setting`} className="color-blue ml10 font-14">设置<i className="iconfont icon-shezhi2 ml3 fr"></i></Link>
|
<Link to={`/${OIdentifier}/setting`} className="color-blue ml10 font-14">设置<i className="iconfont icon-shezhi2 ml3 fr"></i></Link>
|
||||||
:""}
|
:""}
|
||||||
{buttonflag &&
|
{buttonflag &&
|
||||||
<span className="subNavs">
|
<span className="subNavs">
|
||||||
<Link to={`/organize/${OIdentifier}/member`} className={pathname ===`/organize/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
|
<Link to={`/${OIdentifier}/member`} className={pathname ===`/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
|
||||||
<Link to={`/organize/${OIdentifier}/group`} className={pathname ===`/organize/${OIdentifier}/group` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
|
<Link to={`/${OIdentifier}/group`} className={pathname ===`/${OIdentifier}/group` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
|
@ -112,33 +112,33 @@ function Detail(props){
|
||||||
|
|
||||||
{/* 组织团队-详情 */}
|
{/* 组织团队-详情 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId"
|
path="/:OIdentifier/group/:groupId"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <GroupDetails {...props} {...p} group={detail}/>
|
return <GroupDetails {...props} {...p} group={detail}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 组织成员 */}
|
{/* 组织成员 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/member"
|
path="/:OIdentifier/member"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <Member {...props} {...p} organizeDetail={detail}/>
|
return <Member {...props} {...p} organizeDetail={detail}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
{/* 组织团队 */}
|
{/* 组织团队 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group"
|
path="/:OIdentifier/group"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <Group {...props} {...p} organizeDetail={detail}/>
|
return <Group {...props} {...p} organizeDetail={detail}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/setting"
|
path="/:OIdentifier/setting"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <Setting {...props} {...p} organizeDetail={detail} updateFunc={updateDetail}/>
|
return <Setting {...props} {...p} organizeDetail={detail} updateFunc={updateDetail}/>
|
||||||
}}
|
}}
|
||||||
></Route>
|
></Route>
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier"
|
path="/:OIdentifier"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <DetailIndex {...props} {...p} organizeDetail={detail}/>
|
return <DetailIndex {...props} {...p} organizeDetail={detail}/>
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -22,7 +22,7 @@ export default ((props)=>{
|
||||||
// 设置页面:顶部不需要设置按钮了
|
// 设置页面:顶部不需要设置按钮了
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(pathname){
|
if(pathname){
|
||||||
if(pathname.indexOf(`/organize/${OIdentifier}/group/${groupId}/setting`)>-1){
|
if(pathname.indexOf(`/${OIdentifier}/group/${groupId}/setting`)>-1){
|
||||||
setFlag(false);
|
setFlag(false);
|
||||||
}else{
|
}else{
|
||||||
setFlag(true);
|
setFlag(true);
|
||||||
|
@ -48,19 +48,19 @@ export default ((props)=>{
|
||||||
<div className="teamDetail" style={{paddingTop:"0px"}}>
|
<div className="teamDetail" style={{paddingTop:"0px"}}>
|
||||||
<div>
|
<div>
|
||||||
<i className="iconfont icon-zuobiao mr5"></i>
|
<i className="iconfont icon-zuobiao mr5"></i>
|
||||||
<Link to={`/organize/${OIdentifier}`}>{OIdentifier}</Link>
|
<Link to={`/${OIdentifier}`}>{OIdentifier}</Link>
|
||||||
<i className="iconfont icon-youjiantou ml3 mr3 font-12 color-grey-9"></i>
|
<i className="iconfont icon-youjiantou ml3 mr3 font-12 color-grey-9"></i>
|
||||||
<span className="color-grey-9">{detail ? detail.name : "新建团队"}</span>
|
<span className="color-grey-9">{detail ? detail.name : "新建团队"}</span>
|
||||||
</div>
|
</div>
|
||||||
{
|
{
|
||||||
detail &&
|
detail &&
|
||||||
<Cards
|
<Cards
|
||||||
src={`/organize/${OIdentifier}/group/${groupId}`}
|
src={`/${OIdentifier}/group/${groupId}`}
|
||||||
title={detail.nickname||detail.name}
|
title={detail.nickname||detail.name}
|
||||||
rightBtn={
|
rightBtn={
|
||||||
flag && <span className="subNavs">
|
flag && <span className="subNavs">
|
||||||
<Link to={`/organize/${OIdentifier}/member`} className={pathname ===`/organize/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
|
<Link to={`/${OIdentifier}/member`} className={pathname ===`/${OIdentifier}/member` ? "active":""}><span>组织成员</span>{detail.num_users && <lable>{detail.num_users}</lable>}</Link>
|
||||||
<Link to={`/organize/${OIdentifier}/group`} className={pathname ===`/organize/${OIdentifier}/group` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
|
<Link to={`/${OIdentifier}/group`} className={pathname ===`/${OIdentifier}/group` ? "active":""}><span>组织团队</span>{detail.num_teams &&<lable>{detail.num_teams}</lable>}</Link>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
desc={!flag && detail.description}
|
desc={!flag && detail.description}
|
||||||
|
@ -69,7 +69,7 @@ export default ((props)=>{
|
||||||
<Switch {...props}>
|
<Switch {...props}>
|
||||||
{/* 组织团队-设置 */}
|
{/* 组织团队-设置 */}
|
||||||
<Route
|
<Route
|
||||||
path="/organize/:OIdentifier/group/:groupId/setting"
|
path="/:OIdentifier/group/:groupId/setting"
|
||||||
render={(p) => {
|
render={(p) => {
|
||||||
return <GroupSetting {...props} {...p}/>
|
return <GroupSetting {...props} {...p}/>
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -53,7 +53,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
|
||||||
}
|
}
|
||||||
// 团队设置
|
// 团队设置
|
||||||
function toGroupSetting(id){
|
function toGroupSetting(id){
|
||||||
history.push(`/organize/${organizeDetail && organizeDetail.name}/group/${id}/setting`);
|
history.push(`/${organizeDetail && organizeDetail.name}/group/${id}/setting`);
|
||||||
}
|
}
|
||||||
// 解散团队
|
// 解散团队
|
||||||
function disMissGroup(id){
|
function disMissGroup(id){
|
||||||
|
@ -75,7 +75,12 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
|
||||||
return(
|
return(
|
||||||
<div key={key}>
|
<div key={key}>
|
||||||
<p className="g-head">
|
<p className="g-head">
|
||||||
<Link to={`/organize/${organizeDetail.name}/group/${item.id}`} className="color-grey-3 font-16">{item.nickname}</Link>
|
{
|
||||||
|
(item.is_admin || item.is_member) ?
|
||||||
|
<Link to={`/${organizeDetail.name}/group/${item.id}`} className="color-grey-3 font-16">{item.nickname}</Link>
|
||||||
|
:
|
||||||
|
<span className="color-grey-3 font-16">{item.nickname}</span>
|
||||||
|
}
|
||||||
<span>
|
<span>
|
||||||
{ item.is_admin && item.authorize!=="owner" && <Popconfirm title={`确定解散团队${item.name}?`} okText="是" cancelText="否" onConfirm={()=>disMissGroup(item.id)}><a className="color-red">解散团队</a></Popconfirm>}
|
{ item.is_admin && item.authorize!=="owner" && <Popconfirm title={`确定解散团队${item.name}?`} okText="是" cancelText="否" onConfirm={()=>disMissGroup(item.id)}><a className="color-red">解散团队</a></Popconfirm>}
|
||||||
{ item.is_member && <LeaveTeam className="ml15" teamID={item.id} onOk={outTeam}/>}
|
{ item.is_member && <LeaveTeam className="ml15" teamID={item.id} onOk={outTeam}/>}
|
||||||
|
@ -86,10 +91,10 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
|
||||||
{
|
{
|
||||||
item.users && item.users.map((i,k)=>{
|
item.users && item.users.map((i,k)=>{
|
||||||
return(
|
return(
|
||||||
k < count ? <Link to={`/users/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`/${i.image_url}`)}/></Link>
|
k < count ? <Link to={`/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`/${i.image_url}`)}/></Link>
|
||||||
:
|
:
|
||||||
k === count ?
|
k === count ?
|
||||||
<Link to={`/organize/${organizeDetail && organizeDetail.name}/group/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link>
|
<Link to={`/${organizeDetail && organizeDetail.name}/group/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link>
|
||||||
:""
|
:""
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
|
@ -83,7 +83,7 @@ class ForkUsers extends Component {
|
||||||
<div className="pbt25 grid-item mlr10 border-b-line">
|
<div className="pbt25 grid-item mlr10 border-b-line">
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item.login}`}
|
to={`/${item.login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
@ -96,7 +96,7 @@ class ForkUsers extends Component {
|
||||||
<div className="ml12">
|
<div className="ml12">
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
to={`/projects/${item.login}/${item.identifier}`}
|
to={`/${item.login}/${item.identifier}`}
|
||||||
className="font-16 text-primary task-hide max-w-200"
|
className="font-16 text-primary task-hide max-w-200"
|
||||||
style={{display:"block"}}
|
style={{display:"block"}}
|
||||||
title={item.name}
|
title={item.name}
|
||||||
|
|
|
@ -14,7 +14,7 @@ class UserList extends Component {
|
||||||
<div className="pbt25 grid-item mlr10 border-b-line">
|
<div className="pbt25 grid-item mlr10 border-b-line">
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
href={`/users/${item.login}`}
|
href={`/${item.login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
@ -27,7 +27,7 @@ class UserList extends Component {
|
||||||
<div className="ml12">
|
<div className="ml12">
|
||||||
<div>
|
<div>
|
||||||
<Link
|
<Link
|
||||||
to={`/users/${item.login}`}
|
to={`/${item.login}`}
|
||||||
className="font-16 text-primary task-hide max-w-200"
|
className="font-16 text-primary task-hide max-w-200"
|
||||||
style={{display:"block"}}
|
style={{display:"block"}}
|
||||||
title={item.name}
|
title={item.name}
|
||||||
|
|
|
@ -103,7 +103,7 @@ export default Form.create()(
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
showNotification("版本修改成功!");
|
showNotification("版本修改成功!");
|
||||||
history.push(`/projects/${owner}/${projectsId}/releases`);
|
history.push(`/${owner}/${projectsId}/releases`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
@ -116,7 +116,7 @@ export default Form.create()(
|
||||||
.then(result => {
|
.then(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
showNotification("版本发布成功!");
|
showNotification("版本发布成功!");
|
||||||
history.push(`/projects/${owner}/${projectsId}/releases`);
|
history.push(`/${owner}/${projectsId}/releases`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ export default Form.create()(
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
history.push(`/projects/${owner}/${projectsId}/releases`)
|
history.push(`/${owner}/${projectsId}/releases`)
|
||||||
}
|
}
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: "rgba(187,187,187,1)",
|
backgroundColor: "rgba(187,187,187,1)",
|
||||||
|
|
|
@ -79,7 +79,7 @@ class version extends Component {
|
||||||
<span className="task-hide">{item.name}</span>
|
<span className="task-hide">{item.name}</span>
|
||||||
{
|
{
|
||||||
(isManager || isDeveloper) && type !==2 &&
|
(isManager || isDeveloper) && type !==2 &&
|
||||||
<Link to={`/projects/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
<Link to={`/${owner}/${projectsId}/releases/${item.version_id}/update`} className="color-blue ml3 font-12">(编辑)</Link>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
<span className="color-grey-3">
|
<span className="color-grey-3">
|
||||||
|
@ -114,7 +114,7 @@ class version extends Component {
|
||||||
<span className="font-18 color-grey-3">版本发布</span>
|
<span className="font-18 color-grey-3">版本发布</span>
|
||||||
{
|
{
|
||||||
data && data.user_permission && type !== 2 ?
|
data && data.user_permission && type !== 2 ?
|
||||||
<Link to={`/projects/${owner}/${projectsId}/releases/new`} className="topWrapper_btn_new">+ 发布新版</Link>
|
<Link to={`/${owner}/${projectsId}/releases/new`} className="topWrapper_btn_new">+ 发布新版</Link>
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -126,7 +126,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail,
|
||||||
}
|
}
|
||||||
|
|
||||||
function goBack() {
|
function goBack() {
|
||||||
history.push(`/projects/${owner}/${projectsId}/wiki`);
|
history.push(`/${owner}/${projectsId}/wiki`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeModal(e) {
|
function changeModal(e) {
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useCallback, useState } from 'react';
|
||||||
import { Button, Dropdown, Icon, Input, Menu, Tooltip, Select, Upload, message, Spin } from 'antd';
|
import { Button, Dropdown, Icon, Input, Menu, Tooltip, Select, Upload, message, Spin } from 'antd';
|
||||||
import { getImageUrl, timeAgo } from 'educoder';
|
import { getImageUrl, timeAgo } from 'educoder';
|
||||||
import cookie from 'react-cookies';
|
import cookie from 'react-cookies';
|
||||||
// import Loading from "../../Loading";
|
import CopyTool from '../Component/CopyTool';
|
||||||
import DelModal from './components/ModalFun';
|
import DelModal from './components/ModalFun';
|
||||||
import Welcome from './Welcome';
|
import Welcome from './Welcome';
|
||||||
import { wikiPages, getWiki, deleteWiki } from './api';
|
import { wikiPages, getWiki, deleteWiki } from './api';
|
||||||
|
@ -14,15 +14,12 @@ const InputGroup = Input.Group;
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
export default (props) => {
|
export default (props) => {
|
||||||
const { match, current_user, history, showNotification, project, projectDetail } = props;
|
const { match, history, showNotification, project, projectDetail } = props;
|
||||||
// const permission = projectDetail && projectDetail.permission !== "Reporter";
|
|
||||||
const permission = projectDetail && projectDetail.permission && projectDetail.permission !== "Reporter";
|
const permission = projectDetail && projectDetail.permission && projectDetail.permission !== "Reporter";
|
||||||
|
|
||||||
let projectsId = match.params.projectsId;
|
let projectsId = match.params.projectsId;
|
||||||
let owner = match.params.owner;
|
let owner = match.params.owner;
|
||||||
|
|
||||||
console.log(project);
|
|
||||||
|
|
||||||
const [fileArrInit, setFileArrInit] = useState(null);
|
const [fileArrInit, setFileArrInit] = useState(null);
|
||||||
const [checkItem, setCheckItem] = useState({});
|
const [checkItem, setCheckItem] = useState({});
|
||||||
const [itemDetail, setItemDetail] = useState({});
|
const [itemDetail, setItemDetail] = useState({});
|
||||||
|
@ -85,7 +82,7 @@ export default (props) => {
|
||||||
DelModal({
|
DelModal({
|
||||||
title: '删除页面',
|
title: '删除页面',
|
||||||
contentTitle: `您确定要删除“${item.name}”此页面吗?`,
|
contentTitle: `您确定要删除“${item.name}”此页面吗?`,
|
||||||
content: '此操作将删除该页面,请进行确认以防文件的丢失。',
|
content: '此操作将删除该页面,请进行确认以防文件的丢失',
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
deleteWiki({
|
deleteWiki({
|
||||||
owner: owner,
|
owner: owner,
|
||||||
|
@ -106,30 +103,19 @@ export default (props) => {
|
||||||
|
|
||||||
|
|
||||||
function goUser(login) {
|
function goUser(login) {
|
||||||
window.location.href = `/users/${login}`;
|
window.location.href = `/${login}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 复制链接
|
|
||||||
const copyUrl = useCallback(() => {
|
|
||||||
let wikiUrl = document.getElementById("wikiUrl");
|
|
||||||
wikiUrl.select();
|
|
||||||
if (document.execCommand('copy')) {
|
|
||||||
document.execCommand('copy');
|
|
||||||
}
|
|
||||||
message.success('复制成功');
|
|
||||||
wikiUrl.blur();
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
function addFile() {
|
function addFile() {
|
||||||
history.push(`/projects/${owner}/${projectsId}/wiki/add`);
|
history.push(`/${owner}/${projectsId}/wiki/add`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function goEdit() {
|
function goEdit() {
|
||||||
history.push(`/projects/${owner}/${projectsId}/wiki/edit/${encodeURI(checkItem.name)}`);
|
history.push(`/${owner}/${projectsId}/wiki/edit/${encodeURI(checkItem.name)}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function preview() {
|
function preview() {
|
||||||
window.open(`/projects/${owner}/${projectsId}/wiki/preview/${encodeURI(project.name)}/${project.id}`);
|
window.open(`/${owner}/${projectsId}/wiki/preview/${encodeURI(project.name)}/${project.id}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 支持 Markdown,Html,Pdf格式文件
|
// 支持 Markdown,Html,Pdf格式文件
|
||||||
|
@ -231,6 +217,7 @@ export default (props) => {
|
||||||
<Button type="default" className="ml10">导出<Icon type="caret-down" /></Button>
|
<Button type="default" className="ml10">导出<Icon type="caret-down" /></Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
<Button type="default" className="ml10" onClick={preview}>预览</Button>
|
<Button type="default" className="ml10" onClick={preview}>预览</Button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -246,8 +233,8 @@ export default (props) => {
|
||||||
|
|
||||||
{
|
{
|
||||||
fileArr.map(item => {
|
fileArr.map(item => {
|
||||||
return <div className="wiki-nav-title-parent">
|
return <div className="wiki-nav-title-parent" key={item.name}>
|
||||||
<div className={`wiki-nav-title ${item.name === checkItem.name ? 'active' : ''}`} key={item.name} onClick={() => { setCheckItem(item) }}>
|
<div className={`wiki-nav-title ${item.name === checkItem.name ? 'active' : ''}`} onClick={() => { setCheckItem(item) }}>
|
||||||
<div className="nav-title-left">
|
<div className="nav-title-left">
|
||||||
<i className="iconfont icon-wenjianjia2 mr3"></i>
|
<i className="iconfont icon-wenjianjia2 mr3"></i>
|
||||||
<span className="nav-title-left-text">{item.name}</span>
|
<span className="nav-title-left-text">{item.name}</span>
|
||||||
|
@ -266,9 +253,7 @@ export default (props) => {
|
||||||
<Option value="SSH">SSH</Option>
|
<Option value="SSH">SSH</Option>
|
||||||
</Select>
|
</Select>
|
||||||
<Input id="wikiUrl" value={urlType === 'HTTPS' ? checkItem.wiki_clone_link.https : checkItem.wiki_clone_link.ssh} />
|
<Input id="wikiUrl" value={urlType === 'HTTPS' ? checkItem.wiki_clone_link.https : checkItem.wiki_clone_link.ssh} />
|
||||||
<Tooltip placement="bottom" title={'复制'}>
|
<CopyTool className="copy-wiki" inputId="wikiUrl" />
|
||||||
<i className="iconfont icon-fuzhiicon copy-svg" onClick={copyUrl}></i>
|
|
||||||
</Tooltip>
|
|
||||||
</InputGroup>}
|
</InputGroup>}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -277,11 +262,11 @@ export default (props) => {
|
||||||
<div className="wiki-content-head">
|
<div className="wiki-content-head">
|
||||||
<div className="wiki-content-head-left">
|
<div className="wiki-content-head-left">
|
||||||
<h3 className="wiki-detail-title">{checkItem.name}</h3>
|
<h3 className="wiki-detail-title">{checkItem.name}</h3>
|
||||||
<span className="user-box mr10" onClick={() => { goUser(current_user.login) }}>
|
<span className="user-box mr10" onClick={() => { checkItem.commit && goUser(checkItem.commit.author.name) }}>
|
||||||
{itemDetail.image_url && <img alt="头像" className="head-log-small" src={getImageUrl(`/${itemDetail.image_url}`)} />}
|
{itemDetail.image_url && <img alt="头像" className="head-log-small" src={getImageUrl(`/${itemDetail.image_url}`)} />}
|
||||||
<span >{checkItem.commit ? checkItem.commit.author.name : ''}</span>
|
<span >{itemDetail.userName}</span>
|
||||||
</span>
|
</span>
|
||||||
<span className="time-ago">上次修改于{checkItem.commit && timeAgo(checkItem.commit.author.when)}</span>
|
<span className="time-ago">上次修改于{checkItem.commit ? timeAgo(checkItem.commit.author.when):'刚刚'}</span>
|
||||||
</div>
|
</div>
|
||||||
{permission && <Button type="primary" onClick={goEdit}>编辑</Button>}
|
{permission && <Button type="primary" onClick={goEdit}>编辑</Button>}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -199,7 +199,7 @@ body {
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
.copy-svg {
|
.copy-wiki {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue