2020-07-10 15:42:57 +08:00
|
|
|
|
import React, { Component } from 'react';
|
2021-06-16 11:17:46 +08:00
|
|
|
|
import { Spin, Tooltip } from 'antd';
|
2020-06-11 15:40:22 +08:00
|
|
|
|
import { Link, Route, Switch } from 'react-router-dom';
|
2021-06-16 11:17:46 +08:00
|
|
|
|
import { Content , FlexAJ , AlignCenter } from '../Component/layout';
|
2021-03-19 15:46:37 +08:00
|
|
|
|
import DetailBanner from './sub/DetailBanner';
|
2021-06-09 17:37:04 +08:00
|
|
|
|
import Invite from './sub/Invite';
|
2020-06-22 14:07:06 +08:00
|
|
|
|
import '../css/index.scss'
|
2020-03-16 14:12:11 +08:00
|
|
|
|
import './list.css';
|
|
|
|
|
|
|
|
|
|
|
|
import Loadable from 'react-loadable';
|
|
|
|
|
|
import Loading from '../../Loading';
|
|
|
|
|
|
|
|
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
const Setting = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Settings/Index'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const TagList = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/Tags'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderNew = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/New'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/Detail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderIndex = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/order'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const CoderRootIndex = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('./CoderRootIndex'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
const OrderMilepost = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/Milepost'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrdernewMilepost = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/newMilepost'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrderupdateMilepost = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/UpdateMilepost'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrderupdateDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/UpdateDetail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const OrdercopyDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/CopyDetail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
//合并请求
|
|
|
|
|
|
const MergeIndexDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Merge/merge'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const CreateMerge = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Merge/NewMerge'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const MessageCount = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Merge/MessageCount'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
|
2020-06-12 17:58:58 +08:00
|
|
|
|
const UpdateMerge = Loadable({
|
|
|
|
|
|
loader: () => import('../Merge/UpdateMerge'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
|
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const MilepostDetail = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Order/MilepostDetail'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
2020-05-18 16:46:51 +08:00
|
|
|
|
const WatchUsers = Loadable({
|
2020-07-02 14:21:22 +08:00
|
|
|
|
loader: () => import('../UsersList/watch_users'),
|
|
|
|
|
|
loading: Loading,
|
2020-05-18 16:46:51 +08:00
|
|
|
|
})
|
|
|
|
|
|
const PraiseUsers = Loadable({
|
2020-07-02 14:21:22 +08:00
|
|
|
|
loader: () => import('../UsersList/praise_users'),
|
|
|
|
|
|
loading: Loading,
|
2020-05-18 16:46:51 +08:00
|
|
|
|
})
|
|
|
|
|
|
const ForkUsers = Loadable({
|
2020-07-02 14:21:22 +08:00
|
|
|
|
loader: () => import('../UsersList/fork_users'),
|
|
|
|
|
|
loading: Loading,
|
2020-05-18 16:46:51 +08:00
|
|
|
|
})
|
2021-03-19 11:35:03 +08:00
|
|
|
|
const Contribute = Loadable({
|
|
|
|
|
|
loader: () => import('./sub/Contribute'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2021-03-18 17:28:53 +08:00
|
|
|
|
const CoderRootCommit = Loadable({
|
|
|
|
|
|
loader: () => import('./CoderRootCommit'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
|
|
|
|
|
const CoderDepot = Loadable({
|
|
|
|
|
|
loader: () => import('./CoderDepot'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
|
|
|
|
|
const TrendsIndex = Loadable({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
loader: () => import('../Activity/Activity'),
|
|
|
|
|
|
loading: Loading,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
2020-06-02 18:54:46 +08:00
|
|
|
|
|
2020-10-05 18:01:56 +08:00
|
|
|
|
const DevAbout = Loadable({
|
|
|
|
|
|
loader: () => import('../About/Index'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2021-03-29 16:48:23 +08:00
|
|
|
|
const Source = Loadable({
|
|
|
|
|
|
loader: () => import('../Source/Index'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2020-07-10 15:42:57 +08:00
|
|
|
|
const DevIndex = Loadable({
|
|
|
|
|
|
loader: () => import('../DevOps/Index'),
|
|
|
|
|
|
loading: Loading,
|
|
|
|
|
|
})
|
2020-03-16 14:12:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
|
|
|
|
|
|
*/
|
2021-01-06 16:23:59 +08:00
|
|
|
|
function checkPathname(projectsId,owner,pathname){
|
2020-08-19 18:34:52 +08:00
|
|
|
|
let name = "";
|
2021-01-06 16:23:59 +08:00
|
|
|
|
if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
|
2021-03-08 10:26:39 +08:00
|
|
|
|
let url = pathname.split(`/projects/${owner}/${projectsId}`)[1];
|
|
|
|
|
|
if(url.indexOf("/about")>-1){
|
2020-10-05 18:01:56 +08:00
|
|
|
|
name="about"
|
2021-03-08 10:26:39 +08:00
|
|
|
|
}else if(url.indexOf("/issues")>-1 ||url.indexOf("Milepost") > 0){
|
2020-08-19 18:34:52 +08:00
|
|
|
|
name = "issues";
|
2021-03-08 10:26:39 +08:00
|
|
|
|
}else if(url.indexOf("/pulls")>-1){
|
2020-08-19 18:34:52 +08:00
|
|
|
|
name="pulls"
|
2021-03-08 10:26:39 +08:00
|
|
|
|
}else if(url.indexOf("/milestones")>-1){
|
2020-08-19 18:34:52 +08:00
|
|
|
|
name="milestones"
|
2021-03-08 10:26:39 +08:00
|
|
|
|
}else if(url.indexOf("/activity")>-1){
|
2020-08-19 18:34:52 +08:00
|
|
|
|
name="activity"
|
2021-03-08 10:26:39 +08:00
|
|
|
|
}else if(url.indexOf("/setting")>-1){
|
2020-08-19 18:34:52 +08:00
|
|
|
|
name="setting"
|
2021-03-08 10:26:39 +08:00
|
|
|
|
}else if(url.indexOf(`/devops`)>-1){
|
2020-08-26 16:09:27 +08:00
|
|
|
|
name="devops"
|
2021-03-29 16:48:23 +08:00
|
|
|
|
}else if(url.indexOf(`/source`)>-1){
|
|
|
|
|
|
name="source"
|
2020-08-19 18:34:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
return name;
|
|
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
class Detail extends Component {
|
|
|
|
|
|
constructor(props) {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
super(props);
|
2020-05-20 18:11:32 +08:00
|
|
|
|
this.state = {
|
|
|
|
|
|
projectDetail: undefined,
|
|
|
|
|
|
isManager: false,
|
|
|
|
|
|
isReporter: false,
|
|
|
|
|
|
isDeveloper: false,
|
|
|
|
|
|
project_id: undefined,
|
|
|
|
|
|
watchers_count: undefined,
|
|
|
|
|
|
praises_count: undefined,
|
|
|
|
|
|
forked_count: undefined,
|
|
|
|
|
|
watched: false,
|
|
|
|
|
|
praised: false,
|
2020-03-16 14:12:11 +08:00
|
|
|
|
http_url: undefined,
|
2020-05-20 18:11:32 +08:00
|
|
|
|
branchs: undefined,
|
|
|
|
|
|
branchList: undefined,
|
2020-07-02 16:07:35 +08:00
|
|
|
|
project: null,
|
|
|
|
|
|
firstSync:false,
|
2020-07-03 16:32:47 +08:00
|
|
|
|
secondSync:false,
|
2020-08-26 16:09:27 +08:00
|
|
|
|
open_devops:false,
|
2020-11-24 18:00:34 +08:00
|
|
|
|
// 默认分支
|
|
|
|
|
|
defaultBranch:undefined,
|
2020-10-22 19:34:11 +08:00
|
|
|
|
|
|
|
|
|
|
// 非本平台项目
|
|
|
|
|
|
platform:false
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
componentDidMount = () => {
|
2020-06-29 14:48:46 +08:00
|
|
|
|
this.getProject();
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
componentDidUpdate = (prevState) => {
|
2020-08-14 10:08:38 +08:00
|
|
|
|
let prevParam = prevState.match.params;
|
|
|
|
|
|
let propsParam = this.props.match.params;
|
|
|
|
|
|
if (prevState && this.props && (prevParam.projectsId !== propsParam.projectsId || prevParam.owner !== propsParam.owner)) {
|
2020-06-29 15:28:24 +08:00
|
|
|
|
this.getProject();
|
2020-03-24 16:51:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-07-02 16:07:35 +08:00
|
|
|
|
getProject = (num) => {
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
|
|
|
|
|
const url = `/${owner}/${projectsId}/simple.json`;
|
2020-06-29 14:48:46 +08:00
|
|
|
|
axios.get(url).then((result) => {
|
2020-07-02 16:07:35 +08:00
|
|
|
|
if (result && result.data) {
|
2020-07-02 14:21:22 +08:00
|
|
|
|
this.setState({
|
2020-08-26 16:09:27 +08:00
|
|
|
|
project: result.data,
|
2020-10-22 19:34:11 +08:00
|
|
|
|
open_devops:result.data.open_devops,
|
|
|
|
|
|
platform:result.data.platform && result.data.platform !== 'educoder'
|
2020-07-02 14:21:22 +08:00
|
|
|
|
})
|
2020-08-26 16:09:27 +08:00
|
|
|
|
|
2020-07-02 16:07:35 +08:00
|
|
|
|
if (result.data.type !== 0 && result.data.mirror_status === 1) {
|
2020-07-02 14:17:47 +08:00
|
|
|
|
console.log("--------start channel --------");
|
2020-07-02 16:07:35 +08:00
|
|
|
|
// 是镜像项目,且未完成迁移
|
2020-07-02 14:17:47 +08:00
|
|
|
|
this.canvasChannel();
|
2020-07-02 16:07:35 +08:00
|
|
|
|
if(num){
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
secondSync:true,
|
|
|
|
|
|
firsrtSync:false
|
|
|
|
|
|
})
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
firstSync:true,
|
|
|
|
|
|
secondSync:false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
this.getDetail();
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
firsrtSync:false,
|
|
|
|
|
|
secondSync:false
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
2020-07-02 16:07:35 +08:00
|
|
|
|
})
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
2020-08-26 16:09:27 +08:00
|
|
|
|
|
|
|
|
|
|
// 工作流激活后修改状态
|
|
|
|
|
|
changeOpenDevops=(flag)=>{
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
open_devops:flag
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-07-02 16:07:35 +08:00
|
|
|
|
canvasChannel = () => {
|
2020-07-03 11:17:23 +08:00
|
|
|
|
const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net" : window.location.hostname;
|
|
|
|
|
|
const actioncable = require("actioncable");
|
|
|
|
|
|
var project = this.state.project;
|
2020-07-02 18:22:54 +08:00
|
|
|
|
var cable = actioncable.createConsumer(`wss://${name}/cable`);
|
2020-07-02 16:07:35 +08:00
|
|
|
|
this.canvasChannel1 = cable.subscriptions.create({
|
|
|
|
|
|
channel: `MirrorProjectChannel`,
|
|
|
|
|
|
id: project && project.identifier
|
|
|
|
|
|
}, {
|
|
|
|
|
|
connected: () => {
|
|
|
|
|
|
console.log("###### channel connected! ######");
|
|
|
|
|
|
},
|
|
|
|
|
|
disconnected: () => { },
|
|
|
|
|
|
received: data => {
|
|
|
|
|
|
console.log(`###### ---received data--- ######`);
|
|
|
|
|
|
if (data) {
|
|
|
|
|
|
this.getDetail();
|
|
|
|
|
|
cable.subscriptions.consumer.disconnect();
|
2020-07-02 14:17:47 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-06-29 14:48:46 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
getDetail = () => {
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
2021-03-19 15:46:37 +08:00
|
|
|
|
this.getBanner();
|
2021-03-18 17:28:53 +08:00
|
|
|
|
const url = `/${owner}/${projectsId}/detail.json`;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
axios.get(url).then((result) => {
|
2020-08-26 16:09:27 +08:00
|
|
|
|
if (result && result.data) {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
this.setState({
|
2020-05-20 18:11:32 +08:00
|
|
|
|
projectDetail: result.data,
|
|
|
|
|
|
project_id: result.data.project_id,
|
2020-10-19 11:45:58 +08:00
|
|
|
|
isManager: result.data.permission && (result.data.permission === "Manager" || result.data.permission === "Admin" || result.data.permission === "Owner"),
|
2020-05-20 18:11:32 +08:00
|
|
|
|
isReporter: result.data.permission && result.data.permission === "Reporter",
|
|
|
|
|
|
isDeveloper: result.data.permission && result.data.permission === "Developer",
|
2020-03-16 14:12:11 +08:00
|
|
|
|
http_url: result.data.clone_url,
|
2020-05-20 18:11:32 +08:00
|
|
|
|
praised: result.data.praised,
|
|
|
|
|
|
watched: result.data.watched,
|
|
|
|
|
|
watchers_count: result.data.watchers_count,
|
|
|
|
|
|
praises_count: result.data.praises_count,
|
|
|
|
|
|
forked_count: result.data.forked_count,
|
2020-11-24 18:00:34 +08:00
|
|
|
|
defaultBranch:result.data.default_branch
|
2020-03-16 14:12:11 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
}).catch((error) => { })
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-03-19 15:46:37 +08:00
|
|
|
|
// 获取动态导航栏菜单
|
|
|
|
|
|
getBanner(){
|
|
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
|
|
|
|
|
const url = `/${owner}/${projectsId}/menu_list.json`;
|
|
|
|
|
|
axios.get(url).then(result=>{
|
|
|
|
|
|
if(result){
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
bannerList:result.data
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}).catch(error=>{})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
// 关注和取消关注
|
2020-05-20 18:11:32 +08:00
|
|
|
|
focusFunc = (flag) => {
|
2020-10-22 19:34:11 +08:00
|
|
|
|
const { platform } = this.state;
|
|
|
|
|
|
if(!platform)return;
|
2020-06-29 11:34:05 +08:00
|
|
|
|
|
2020-10-22 19:34:11 +08:00
|
|
|
|
const { project_id } = this.state;
|
2020-07-02 14:21:22 +08:00
|
|
|
|
axios({
|
|
|
|
|
|
method: flag ? 'delete' : 'post',
|
|
|
|
|
|
url: `/watchers/${flag ? 'unfollow' : 'follow'}.json`,
|
2020-05-18 16:46:51 +08:00
|
|
|
|
params: {
|
|
|
|
|
|
target_type: "project",
|
|
|
|
|
|
id: project_id
|
|
|
|
|
|
}
|
2020-08-14 10:08:38 +08:00
|
|
|
|
}).then(result => {
|
|
|
|
|
|
if (result && result.data.status === 0) {
|
|
|
|
|
|
this.setWatchersCount(result.data.watchers_count, result.data.watched);
|
|
|
|
|
|
}
|
2020-07-02 14:21:22 +08:00
|
|
|
|
})
|
2020-08-14 10:08:38 +08:00
|
|
|
|
.catch(error => {
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 点赞和取消点赞
|
2020-05-20 18:11:32 +08:00
|
|
|
|
pariseFunc = (flag) => {
|
2020-10-22 19:34:11 +08:00
|
|
|
|
const { platform } = this.state;
|
|
|
|
|
|
if(!platform)return;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const { project_id } = this.state;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
axios({
|
|
|
|
|
|
method: flag ? 'delete' : 'post',
|
|
|
|
|
|
url: `/projects/${project_id}/praise_tread/${flag ? 'unlike' : 'like'}.json`
|
2020-08-14 10:08:38 +08:00
|
|
|
|
}).then(result => {
|
|
|
|
|
|
if (result && result.data.status === 0) {
|
|
|
|
|
|
this.setPraisesCount(result.data.praises_count, result.data.praised)
|
|
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
})
|
2020-08-14 10:08:38 +08:00
|
|
|
|
.catch(error => {
|
|
|
|
|
|
console.log(error);
|
|
|
|
|
|
});
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
setWatchersCount = (count, is_watched) => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
watched: is_watched,
|
|
|
|
|
|
watchers_count: count
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-03-27 17:30:16 +08:00
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
setPraisesCount = (count, is_praised) => {
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
praised: is_praised,
|
|
|
|
|
|
praises_count: count
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-03-27 17:30:16 +08:00
|
|
|
|
|
2020-03-16 14:12:11 +08:00
|
|
|
|
// fork项目
|
2020-05-20 18:11:32 +08:00
|
|
|
|
forkFunc = () => {
|
2020-10-22 19:34:11 +08:00
|
|
|
|
const { platform } = this.state;
|
|
|
|
|
|
if(!platform)return;
|
2020-08-14 10:08:38 +08:00
|
|
|
|
const { current_user } = this.props
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
|
|
|
|
|
const url = `/${owner}/${projectsId}/forks.json`;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
axios.post(url).then(result => {
|
|
|
|
|
|
if (result && result.data.status === 0) {
|
2020-08-19 18:34:52 +08:00
|
|
|
|
this.props.history.push(`/projects/${current_user && current_user.login}/${result.data.identifier}`);
|
2020-04-07 14:03:16 +08:00
|
|
|
|
this.props.showNotification(result.data.message);
|
2020-03-16 14:12:11 +08:00
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
}).catch(error => {
|
2020-03-16 14:12:11 +08:00
|
|
|
|
console.log(error);
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
2020-06-29 11:34:05 +08:00
|
|
|
|
|
2020-06-03 09:56:07 +08:00
|
|
|
|
// 同步镜像
|
2020-07-02 14:21:22 +08:00
|
|
|
|
synchronismMirror = () => {
|
2020-10-22 19:34:11 +08:00
|
|
|
|
const { platform } = this.state;
|
|
|
|
|
|
if(!platform)return;
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
|
|
|
|
|
const url = `/${owner}/${projectsId}/sync_mirror.json`;
|
2020-07-02 14:21:22 +08:00
|
|
|
|
axios.post(url).then(result => {
|
|
|
|
|
|
if (result && result.data && result.data.status === 0) {
|
2021-03-01 16:02:02 +08:00
|
|
|
|
this.props.showNotification("镜像同步成功!");
|
2020-07-02 16:07:35 +08:00
|
|
|
|
this.getProject(2);
|
2020-07-02 14:21:22 +08:00
|
|
|
|
} else {
|
2020-06-03 09:56:07 +08:00
|
|
|
|
this.props.showNotification("镜像同步失败!");
|
|
|
|
|
|
}
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}).catch(error => {
|
2020-06-03 09:56:07 +08:00
|
|
|
|
console.log(error);
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-09 17:37:04 +08:00
|
|
|
|
textFunc = (forked_from_project_id,fork_info)=>{
|
|
|
|
|
|
return forked_from_project_id && fork_info ?
|
|
|
|
|
|
<div className="color-grey-9">
|
2021-06-15 11:36:42 +08:00
|
|
|
|
<span>复刻自 </span>
|
2021-06-09 17:37:04 +08:00
|
|
|
|
<Link to={`/users/${fork_info.fork_project_user_login}`} className="show-user-link color-grey-6">{fork_info.fork_project_user_name}</Link>
|
|
|
|
|
|
<span> / </span>
|
|
|
|
|
|
<Link to={`/projects/${fork_info.fork_project_user_login}/${fork_info.fork_project_identifier}`} className="color-grey-6">{fork_info.fork_form_name}</Link>
|
|
|
|
|
|
</div> : ""
|
|
|
|
|
|
}
|
2020-08-19 18:34:52 +08:00
|
|
|
|
|
|
|
|
|
|
|
2020-05-20 18:11:32 +08:00
|
|
|
|
render() {
|
2020-08-26 16:09:27 +08:00
|
|
|
|
const { projectDetail, watchers_count, praises_count,
|
|
|
|
|
|
forked_count, firstSync , secondSync ,
|
|
|
|
|
|
isManager, watched, praised,
|
2021-03-19 15:46:37 +08:00
|
|
|
|
project , open_devops , platform , defaultBranch , bannerList } = this.state;
|
2020-03-16 14:12:11 +08:00
|
|
|
|
const url = this.props.history.location.pathname;
|
2020-05-20 18:11:32 +08:00
|
|
|
|
const urlArr = url.split("/");
|
2020-03-20 21:40:43 +08:00
|
|
|
|
const urlFlag = (urlArr.length === 3);
|
2020-03-24 15:40:22 +08:00
|
|
|
|
|
2020-08-12 18:13:18 +08:00
|
|
|
|
const { projectsId , owner } = this.props.match.params;
|
2021-06-04 09:43:38 +08:00
|
|
|
|
const { current_user } = this.props;
|
2021-01-06 16:23:59 +08:00
|
|
|
|
let pathname = checkPathname(projectsId,owner,url);
|
2020-03-16 14:12:11 +08:00
|
|
|
|
|
|
|
|
|
|
const { state } = this.props.history.location;
|
2020-08-12 18:13:18 +08:00
|
|
|
|
|
2020-07-02 14:21:22 +08:00
|
|
|
|
const common = {
|
2020-08-26 16:09:27 +08:00
|
|
|
|
getDetail: this.getDetail,
|
2020-11-24 18:00:34 +08:00
|
|
|
|
changeOpenDevops:this.changeOpenDevops,
|
|
|
|
|
|
defaultBranch
|
2020-05-28 11:35:57 +08:00
|
|
|
|
}
|
2020-05-20 18:11:32 +08:00
|
|
|
|
return (
|
2020-03-16 14:12:11 +08:00
|
|
|
|
<div>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
<div className="detailHeader-wrapper">
|
|
|
|
|
|
<div className="normal">
|
2021-06-16 15:51:47 +08:00
|
|
|
|
<FlexAJ style={{paddingTop:"15px"}}>
|
2021-06-16 11:17:46 +08:00
|
|
|
|
<AlignCenter>
|
|
|
|
|
|
<div className="projectallName">
|
|
|
|
|
|
{project && project.author &&
|
|
|
|
|
|
<Link to={`${project.author.type ==="Organization" ? "/organize":'/users'}/${project.author.login}`}>{project.author.name}</Link>
|
2020-06-03 09:56:07 +08:00
|
|
|
|
}
|
2021-06-16 11:17:46 +08:00
|
|
|
|
<span className="ml5 mr5">/</span>
|
|
|
|
|
|
<Link to={`/projects/${owner}/${projectsId}`} className="projectN">{project && project.name}</Link>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{ projectDetail && projectDetail.private && <span className="privateTag">私有</span>}
|
|
|
|
|
|
{
|
|
|
|
|
|
projectDetail && projectDetail.type && projectDetail.type !== 0 ?
|
|
|
|
|
|
projectDetail.type === 2 ?
|
|
|
|
|
|
<Tooltip title={"镜像自: " + projectDetail.mirror_url} className="ml5" placement={'right'}>
|
|
|
|
|
|
<i className="iconfont icon-banbenku font-18 mt6" style={{ color: "#8D90E3" }}/>
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
:
|
|
|
|
|
|
<Tooltip title={"镜像自: " + projectDetail.mirror_url} className="ml5" placement={'right'}>
|
|
|
|
|
|
<i className="iconfont icon-jingxiang font-18 color-green mt6" />
|
|
|
|
|
|
</Tooltip>
|
|
|
|
|
|
:""
|
|
|
|
|
|
}
|
|
|
|
|
|
</AlignCenter>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
{
|
2020-07-02 16:07:35 +08:00
|
|
|
|
firstSync ? "":
|
2021-06-16 11:17:46 +08:00
|
|
|
|
<span className="df">
|
2020-06-03 09:56:07 +08:00
|
|
|
|
{
|
2021-06-04 10:55:05 +08:00
|
|
|
|
((current_user && current_user.admin) || isManager) && (projectDetail && projectDetail.type && projectDetail.type === 2) ?
|
2021-06-04 09:43:38 +08:00
|
|
|
|
<a className="synchronism ml30" onClick={this.synchronismMirror}>同步镜像</a> : ""
|
2020-06-03 09:56:07 +08:00
|
|
|
|
}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
<span className="detail_tag_btn">
|
2020-10-22 19:34:11 +08:00
|
|
|
|
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={() => this.focusFunc(watched)}>
|
2020-10-09 11:45:04 +08:00
|
|
|
|
<i className={watched ? "iconfont icon-shixing color-orange font-16 mr3":"iconfont icon-kongxing color-grey-9 font-16 mr3"}></i>
|
|
|
|
|
|
<span>{watched ? '取消关注' : '关注'}</span>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</a>
|
2020-10-22 19:34:11 +08:00
|
|
|
|
{
|
2021-01-05 15:31:26 +08:00
|
|
|
|
watchers_count > 0 ?
|
2020-10-22 19:34:11 +08:00
|
|
|
|
platform ?
|
|
|
|
|
|
<Link className="detail_tag_btn_count" style={{color:`${watched?"#2878FF":"#666"}`}} to={platform?{ pathname: `/projects/${owner}/${projectsId}/watchers`, state }:""}>
|
|
|
|
|
|
{watchers_count}
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
:
|
|
|
|
|
|
<span className="detail_tag_btn_count">{watchers_count}</span>
|
2021-01-05 15:31:26 +08:00
|
|
|
|
:""
|
2020-10-22 19:34:11 +08:00
|
|
|
|
}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
<span className="detail_tag_btn">
|
2020-10-22 19:34:11 +08:00
|
|
|
|
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={() => this.pariseFunc(praised)}>
|
2020-10-05 18:01:56 +08:00
|
|
|
|
<i className={praised ? "iconfont icon-weibiaoti105 color-orange font-14 mr3":"iconfont icon-guanzhu color-grey-9 font-14 mr3"}></i>
|
2020-10-09 11:45:04 +08:00
|
|
|
|
<span>{praised ? '取消点赞' : '点赞'}</span>
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</a>
|
2020-10-22 19:34:11 +08:00
|
|
|
|
{
|
2021-01-05 15:31:26 +08:00
|
|
|
|
praises_count > 0 ?
|
2020-10-22 19:34:11 +08:00
|
|
|
|
platform ?
|
|
|
|
|
|
<Link className="detail_tag_btn_count" style={{color:`${praised?"#2878FF":"#666"}`}} to={{ pathname: `/projects/${owner}/${projectsId}/stargazers`, state }}>
|
|
|
|
|
|
{praises_count}
|
|
|
|
|
|
</Link>:
|
|
|
|
|
|
<span className="detail_tag_btn_count">{praises_count}</span>
|
2021-01-05 15:31:26 +08:00
|
|
|
|
:""
|
2020-10-22 19:34:11 +08:00
|
|
|
|
}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</span>
|
|
|
|
|
|
<span className="detail_tag_btn">
|
2021-03-30 15:01:25 +08:00
|
|
|
|
<Tooltip title="复刻是fork的中文名,即复制代码仓库" placement="bottom">
|
|
|
|
|
|
<a className="detail_tag_btn_name" style={{cursor:platform?"pointer":"default"}} onClick={this.forkFunc}>
|
|
|
|
|
|
<i className="iconfont icon-fork color-grey-9 mr3"></i>复刻
|
|
|
|
|
|
</a>
|
|
|
|
|
|
</Tooltip>
|
2020-10-22 19:34:11 +08:00
|
|
|
|
{
|
2021-01-05 15:31:26 +08:00
|
|
|
|
forked_count > 0 ?
|
2020-10-22 19:34:11 +08:00
|
|
|
|
platform ?
|
|
|
|
|
|
<Link className="detail_tag_btn_count" to={{ pathname: `/projects/${owner}/${projectsId}/fork_users`, state }}>
|
|
|
|
|
|
{forked_count}
|
|
|
|
|
|
</Link>
|
|
|
|
|
|
:
|
2021-01-05 15:31:26 +08:00
|
|
|
|
<span className="detail_tag_btn_count">{forked_count}</span>
|
|
|
|
|
|
:""
|
2020-10-22 19:34:11 +08:00
|
|
|
|
}
|
2020-03-24 16:51:34 +08:00
|
|
|
|
</span>
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</span>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
2021-06-16 11:17:46 +08:00
|
|
|
|
</FlexAJ>
|
2021-06-09 17:37:04 +08:00
|
|
|
|
<FlexAJ>
|
|
|
|
|
|
<div>
|
|
|
|
|
|
{
|
|
|
|
|
|
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
|
|
|
|
|
|
this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info)
|
|
|
|
|
|
:""
|
|
|
|
|
|
}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
{
|
|
|
|
|
|
projectDetail && projectDetail.invite_code &&
|
|
|
|
|
|
<Invite code={projectDetail.invite_code} />
|
|
|
|
|
|
}
|
|
|
|
|
|
</FlexAJ>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
{
|
2020-07-02 16:07:35 +08:00
|
|
|
|
firstSync ? "" :
|
2021-03-19 15:46:37 +08:00
|
|
|
|
<DetailBanner
|
2021-04-06 17:34:37 +08:00
|
|
|
|
history={this.props.history}
|
2021-03-19 15:46:37 +08:00
|
|
|
|
list={bannerList}
|
|
|
|
|
|
owner={owner}
|
|
|
|
|
|
projectsId={projectsId}
|
|
|
|
|
|
pathname={pathname}
|
|
|
|
|
|
state={state}
|
|
|
|
|
|
projectDetail={projectDetail}
|
|
|
|
|
|
open_devops={open_devops}
|
|
|
|
|
|
platform={platform}
|
|
|
|
|
|
urlFlag={urlFlag}
|
|
|
|
|
|
isManager={isManager}
|
|
|
|
|
|
/>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</div>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
{
|
2020-07-02 16:07:35 +08:00
|
|
|
|
firstSync ?
|
2020-07-02 14:21:22 +08:00
|
|
|
|
<Content className="spincontent">
|
2021-03-19 15:46:37 +08:00
|
|
|
|
<Spin className="spinstyle" tip={project && `正在从 ${project.mirror_url} 迁移`} size="large" />
|
2020-07-02 14:21:22 +08:00
|
|
|
|
</Content>
|
|
|
|
|
|
:
|
2020-07-02 16:07:35 +08:00
|
|
|
|
<Spin spinning={secondSync} className="spinstyle" tip="正在同步镜像" size="large">
|
2020-07-02 14:21:22 +08:00
|
|
|
|
<Switch {...this.props}>
|
2021-03-29 16:48:23 +08:00
|
|
|
|
{/* 资源 */}
|
|
|
|
|
|
<Route path="/projects/:owner/:projectsId/source"
|
|
|
|
|
|
render={
|
|
|
|
|
|
() => (<Source {...this.props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-10-05 18:01:56 +08:00
|
|
|
|
{/* 主页 */}
|
|
|
|
|
|
<Route path="/projects/:owner/:projectsId/about"
|
|
|
|
|
|
render={
|
|
|
|
|
|
() => (<DevAbout {...this.props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-07-10 15:42:57 +08:00
|
|
|
|
{/* 工作流 */}
|
2020-08-26 16:09:27 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/devops"
|
2020-07-10 15:42:57 +08:00
|
|
|
|
render={
|
|
|
|
|
|
() => (<DevIndex {...this.props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-07-02 14:21:22 +08:00
|
|
|
|
{/* 标签列表 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues/tags"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<TagList {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 仓库设置 */}
|
2020-08-12 18:13:18 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/setting"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<Setting {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 任务详情 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues/:orderId/detail"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
2020-08-13 11:42:44 +08:00
|
|
|
|
(props) => (<OrderDetail {...this.props} {...this.state} {...props} {...common} />)
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
{/*修改里程碑*/}
|
|
|
|
|
|
<Route path="/projects/:owner/:projectsId/milestones/:meilid/edit"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
2020-08-13 15:44:02 +08:00
|
|
|
|
(props) => (<OrderupdateMilepost {...this.props} {...props} {...this.state} {...common} />)
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 新建里程碑 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/milestones/new"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<OrdernewMilepost {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/*里程碑详情*/}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/milestones/:meilid"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<MilepostDetail {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
{/* 里程碑 */}
|
|
|
|
|
|
<Route path="/projects/:owner/:projectsId/milestones"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
2020-08-13 15:44:02 +08:00
|
|
|
|
(props) => (<OrderMilepost {...this.props} {...props} {...this.state} {...common} />)
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 里程碑页面新建任务 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues/:milepostId/new"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 新建任务 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues/new"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<OrderNew {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 修改详情 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues/:orderId/updatedetail"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<OrderupdateDetail {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 复制详情 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues/:orderId/copyetail"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<OrdercopyDetail {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 动态 */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/activity"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<TrendsIndex {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
{/* 代码Index */}
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/issues"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<OrderIndex {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2021-03-19 11:35:03 +08:00
|
|
|
|
{/* 新建合并请求 */}
|
2021-06-04 10:55:05 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/pulls/new/:branch"
|
|
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/pulls/new"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<CreateMerge {...this.props} {...props} {...this.state} {...common} is_fork={true} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/pulls/:mergeId/UpdateMerge"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<UpdateMerge {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/pulls/:mergeId/Messagecount"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/pulls/:mergeId/MergeSubmit"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<MessageCount {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/pulls"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<MergeIndexDetail {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/watchers"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<WatchUsers {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-13 15:44:02 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/stargazers"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<PraiseUsers {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-12 18:13:18 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/fork_users"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<ForkUsers {...this.props} {...props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2021-03-19 11:35:03 +08:00
|
|
|
|
{/* 贡献者列表 */}
|
|
|
|
|
|
<Route path="/projects/:owner/:projectsId/contribute"
|
|
|
|
|
|
render={
|
|
|
|
|
|
() => (<Contribute {...this.props} {...this.state} {...common} />)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2021-03-18 17:28:53 +08:00
|
|
|
|
|
|
|
|
|
|
{/* 代码库----详情页面 */}
|
2020-11-24 10:46:27 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/commits/branch/:branchName"
|
|
|
|
|
|
render={
|
2021-03-18 17:28:53 +08:00
|
|
|
|
(props) => (<CoderRootCommit {...this.props} {...props} {...this.state} {...common}/>)
|
2020-11-24 10:46:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2021-03-02 11:40:55 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId/tree/:branchName"
|
2020-11-24 10:46:27 +08:00
|
|
|
|
render={
|
2021-03-18 17:28:53 +08:00
|
|
|
|
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common}/>)
|
|
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
<Route path="/projects/:owner/:projectsId/:subIndex"
|
|
|
|
|
|
render={
|
|
|
|
|
|
(props) => (<CoderRootIndex {...this.props} {...props} {...this.state} {...common}/>)
|
2020-11-24 10:46:27 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
2020-08-12 18:13:18 +08:00
|
|
|
|
<Route path="/projects/:owner/:projectsId"
|
2020-07-02 14:21:22 +08:00
|
|
|
|
render={
|
2021-03-18 17:28:53 +08:00
|
|
|
|
(props) => (<CoderDepot {...this.props} {...props} {...this.state} {...common}/>)
|
2020-07-02 14:21:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
></Route>
|
|
|
|
|
|
</Switch>
|
|
|
|
|
|
</Spin>
|
|
|
|
|
|
}
|
2020-03-16 14:12:11 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-06-11 15:40:22 +08:00
|
|
|
|
export default Detail;
|