Merge branch 'develop'

# Conflicts:
#	public/css/edu-purge.css
This commit is contained in:
caishi 2021-05-07 16:37:21 +08:00
commit 51925542b8
28 changed files with 630 additions and 128 deletions

File diff suppressed because one or more lines are too long

View File

@ -1307,7 +1307,6 @@ td,
span {
margin: 0;
padding: 0;
margin-bottom: 0px!important;
}
table,
@ -6704,6 +6703,9 @@ ul.count_ul li:not(:last-child):after {
input.ant-input-lg::placeholder{
font-size: 14px !important;
}
p{
margin-bottom: 0px!important;
}
.toprightNum{
position: absolute;
right: 0px;

View File

@ -69,7 +69,7 @@ function Index(props){
<div className="aboutPanels">
<div className="aboutContent">
<AlignCenterBetween style={{padding:"14px 20px"}}>
<span className="font-16"><i className="iconfont icon-xiangmujianjie mr5 font-16 color-blue"></i>项目简介</span>
<span className="font-16"><i className="iconfont icon-xiangmujianjie mr5 font-16 color-blue"></i>项目概览</span>
{ editOpration && !edit && <a onClick={editContent} className="color-blue">编辑</a> }
</AlignCenterBetween>
{

View File

@ -3,7 +3,7 @@ import { getImageUrl } from 'educoder';
import { Link } from 'react-router-dom';
import './Component.scss';
function Cards({img , title, desc , rightBtn , src}){
function Cards({img , title, desc , rightBtn , src , bottomInfos}){
return(
<div className="cards">
{img &&<div className="img"><img src={getImageUrl(`/${img}`)} alt=""/></div>}
@ -15,6 +15,7 @@ function Cards({img , title, desc , rightBtn , src}){
<div className="desc">
{desc}
</div>
{bottomInfos}
</div>
</div>
)

View File

@ -1,8 +1,8 @@
.ant-modal-mask{
z-index: 10000;
z-index: 1001;
}
.ant-modal-wrap{
z-index: 10001;
z-index: 1002;
.ant-form-explain{
position: absolute;
}

View File

@ -1,45 +1,49 @@
import React , { useState } from 'react';
import React , { useState , useEffect } from 'react';
import { AutoComplete } from 'antd';
import { getImageUrl } from "educoder";
import axios from 'axios';
const Option = AutoComplete.Option;
export default ({ getUser })=>{
export default ({ getUser , placeholder, width ,value })=>{
const [ source , setSource ] = useState(undefined);
const [ searchKey , setSearchKey ] = useState(undefined);
const [ userDataSource , setUserDataSource ] = useState(undefined);
useEffect(()=>{
if(!value){
setSearchKey(undefined);
}
},[value])
useEffect(()=>{
getUserList();
},[searchKey])
function getUserList(e){
const url = `/users/list.json`;
axios.get(url, {
params: {
search: e,
search: searchKey,
},
})
.then((result) => {
}).then((result) => {
if (result) {
setUserDataSource(result.data.users);
sourceOptions(result.data.users);
}
})
.catch((error) => {
console.log(error);
});
};
function changeInputUser(value){
setSearchKey(value);
getUserList(value);
}
function selectInputUser(id, option){
setSearchKey(option.props.value);
getUserList(option.props.value);
getUser && getUser(id);
}
const source =
userDataSource && userDataSource.map((item, key) => {
function sourceOptions(userDataSource){
const s = userDataSource && userDataSource.map((item, key) => {
return (
<Option key={key} value={`${item.login}`}>
<Option
key={key}
value={`${item.user_id}`}
login={`${item.login}`}
name={item.username}
>
<img
className="user_img radius"
width="28"
@ -54,14 +58,31 @@ export default ({ getUser })=>{
</Option>
);
});
setSource(s);
}
function changeInputUser(e){
setSearchKey(e);
};
//
function selectInputUser(e, option){
setSearchKey(option.props.name);
getUser(option.props.login);
};
return(
<AutoComplete
dataSource={source}
value={searchKey}
style={{ width: 300 }}
onChange={changeInputUser}
onSelect={selectInputUser}
placeholder="搜索需要添加的用户..."
/>
<div className="addPanel">
<AutoComplete
getPopupContainer={trigger => trigger.parentNode}
dataSource={source}
value={searchKey}
style={{ width: width || 300 }}
onChange={changeInputUser}
onSelect={selectInputUser}
placeholder={placeholder || "搜索需要添加的用户..."}
allowClear
/>
</div>
)
}

View File

@ -0,0 +1,12 @@
.diverModal{
.descUl{
background-color: #fffae6;
border-radius: 4px;
padding:10px 15px;
color: #efc16b;
border:1px solid #efc16b;
}
.ant-form-item-required::before{
content: "";
}
}

View File

@ -305,12 +305,12 @@ function CoderDepot(props){
<a onClick={()=>urlLink(`/projects/${owner}/${projectsId}/issues/new`)} >+ 任务</a>
</div>
{ type === "dir" && projectDetail.type !== 2 &&
<Dropdown overlay={fileMenu} className="mr20">
<Dropdown overlay={fileMenu} className="mr20" trigger={['click']}>
<Button type="default">文件 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-grey-9"></i></Button>
</Dropdown>
}
<Dropdown overlay={downloadMenu} placement="bottomRight">
<Dropdown overlay={downloadMenu} placement="bottomRight" trigger={['click']}>
<Button type={'primary'}>下载 <i className="iconfont icon-sanjiaoxing-down ml3 font-14 color-white"></i></Button>
</Dropdown>
</AlignCenter>

View File

@ -35,11 +35,11 @@ function UpdateDescModal({form , visible , onCancel , onOk,desc,website,lesson_u
className={"descmodal"}
>
<Form>
<Form.Item label="仓库描述">
<Form.Item label="项目简介">
{getFieldDecorator("desc",{
rules:[]
})(
<TextArea placeholder="仓库描述" rows={4} maxLength={200}/>
<TextArea placeholder="项目简介" rows={4} maxLength={200}/>
)}
</Form.Item>
<Form.Item label="website">

View File

@ -178,7 +178,7 @@ class NewMerge extends Component {
let arr = projects_names && projects_names.filter(item=>item.id===value);
let identifier = arr && arr[0].project_id;
let login = arr && arr[0].project_user_login;
let is_fork_id = parseInt(value) !== parseInt(id)
let is_fork_id = parseInt(value) !== parseInt(id);
this.setState({
isSpin: true,
merge_head: is_fork_id,

View File

@ -168,6 +168,7 @@ form .ant-cascader-picker, form .ant-select {
}
.linesContent > p{
flex:1;
word-break: break-all;
}
.linesContent .lines{
display: flex;

View File

@ -34,17 +34,19 @@ class MergeForm extends Component {
this.set_defatul();
};
componentDidUpdate=(prevPros)=>{
const { projectsId ,owner } = this.props.match.params;
const pId = prevPros.match.params.projectsId;
const oId = prevPros.match.params.owner;
if(pId !== projectsId || oId !== owner ){
// console.log("切换了项目分支···········");
this.get_default_selects();
}
if(prevPros && this.props && !this.props.checkIfLogin()){
this.props.history.push("/403")
return
}
}
// check_is_login =() =>{
// if(!this.props.checkIfLogin()){
// this.props.history.push("/403")
// return
// }
// };
get_default_selects = () => {
const { projectsId ,owner } = this.props.match.params;
this.setState({ isSpin: true });

View File

@ -0,0 +1,88 @@
import React, { useEffect, useState } from "react";
import { Link } from 'react-router-dom';
import './Index.scss';
import Loadable from "react-loadable";
import Loading from "../../Loading";
import { Route, Switch } from "react-router-dom";
const Notify = Loadable({
loader: () => import("./Notify"),
loading: Loading,
});
const UndoEvent = Loadable({
loader: () => import("./UndoEvent"),
loading: Loading,
});
function Index(props){
const username = props.match.params.username;
const pathname = props.history.location.pathname;
const user = props.user;
const undo_messages = props.undo_messages;
const [ menu , setMenu ] = useState("notify");
const [ messages , setMessages ] = useState(0);
const [ transferProjects , setTransferProjects ] = useState(0);
useEffect(()=>{
if(user){
setTransferProjects(user.undo_transfer_projects);
}
if(undo_messages){
setMessages(undo_messages);
}
},[user,undo_messages])
useEffect(()=>{
if(pathname && username){
if(pathname === `/users/${username}/notice`){
setMenu("notify");
}
if(pathname === `/users/${username}/notice/undo`){
setMenu("undo");
}
}
},[pathname])
function fetchUser(){
props && props.fetchUser();
}
function changeNum(){
fetchUser();
}
return (
<div>
<ul className="noticeMenu">
<li className={menu === "notify" ? "active":""}>
<Link to={`/users/${username}/notice`} onClick={changeNum}>
<span>通知</span>
{messages ? <span className="unNum">{messages}</span>:""}
</Link>
</li>
<li className={menu === "undo" ? "active":""}>
<Link to={`/users/${username}/notice/undo`}>
<span>接收仓库</span>
{transferProjects ? <span className="unNum">{transferProjects}</span>:""}
</Link>
</li>
</ul>
<Switch>
<Route
path="/users/:username/notice/undo"
render={(p) => {
return <UndoEvent {...props} {...p} fetchUser={fetchUser}/>;
}}
></Route>
<Route
path="/users/:username/notice"
render={(p) => {
return <Notify {...props} {...p} fetchUser={fetchUser}/>;
}}
></Route>
</Switch>
</div>
);
}
export default Index;

View File

@ -0,0 +1,72 @@
.noticeMenu{
padding:0px 20px;
display: flex;
border-bottom: 1px solid #eee;
height: 54px;
line-height: 54px;
li{
font-size: 16px;
padding:0px;
margin:0px 30px 0px 20px!important;
height: 54px;
line-height: 54px;
position: relative;
transform: none;
a{
display: flex;
&>span{
position: relative;
}
}
&.active a span:first-child::after{
position: absolute;
bottom: 0px;
height: 2px;
left: 0px;
content: "";
background-color: #1890ff;
width: 100%;
}
.unNum{
color: #d38900;
font-size: 12px;
border-radius: 13px;
height: 16px;
line-height: 16px;
padding:0px 4px;
min-width: 23px;
text-align: center;
background-color: #ffe4b3;
margin-top: 19px;
margin-left: 10px;
display: block;
}
}
}
.notifyList{
padding:0px 20px;
min-height: 400px;
li{
display: flex;
border-bottom: 1px solid #eee;
padding:20px 0px;
.notifyImg{
width: 48px;
height: 48px;
border-radius: 50%;
margin-right: 15px;
}
.notifyFlex{
flex:1;
p{
margin:0px;
}
.notifyInfos{
margin-bottom: 8px;
}
}
&:last-child{
border-bottom: none;
}
}
}

View File

@ -0,0 +1,91 @@
import React, { useEffect, useState } from "react";
import Nodata from '../Nodata';
import {Pagination } from 'antd';
import { Link } from 'react-router-dom';
import { getImageUrl } from 'educoder';
import Axios from "axios";
const limit = 15;
function Notify(props){
const username = props.match.params.username;
const [ list , setList ] = useState(undefined);
const [ page , setPage ] = useState(1);
const [ total , setTotal ] = useState(0);
useEffect(()=>{
if(username){
getList();
}
},[username,page])
function getList(){
const url = `/users/${username}/applied_messages.json`;
Axios.get(url,{
params:{
page,per_page:limit
}
}).then(result=>{
if(result){
setList(result.data.applied_messages);
setTotal(result.data.total_count);
}
}).catch(error=>{})
}
function renderStatus(status,applied){
let { project , owner} = applied
if(status){
switch(status){
case 'canceled':
return <p>取消转移<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库</p>
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>
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>
default:
return <p>拒绝转移<Link to={`/projects/${project && project.owner && project.owner.login}/${project && project.identifier}`}>{project && project.name}</Link>仓库</p>
}
}else{
return ""
}
}
return(
<div>
{
list && list.length > 0 ?
<div>
<ul className="notifyList">
{
list.map((i,k)=>{
return(
<li>
<Link to={`/users/${i.login}`}><img src={getImageUrl(`/${i.applied_user && i.applied_user.image_url}`)} alt="" className="notifyImg"/></Link>
<div className="notifyFlex">
<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>
<span className="color-grey-9">{i.time_ago}</span>
</p>
{renderStatus(i.status,i.applied)}
</div>
</li>
)
})
}
</ul>
</div>
:
""
}
{list && list.length === 0 && <Nodata _html="暂无通知" />}
{
total > limit &&
<div className="edu-txt-center pt20 pb20">
<Pagination simple pageSize={limit} total={total} current={page} onChange={(p)=>{setPage(p)}}/>
</div>
}
</div>
)
}
export default Notify;

View File

@ -0,0 +1,118 @@
import React, { useEffect, useState } from "react";
import Nodata from '../Nodata';
import { FlexAJ } from '../Component/layout';
import { Pagination , Popconfirm } from 'antd';
import { Link } from 'react-router-dom';
import { getImageUrl } from 'educoder';
import Axios from 'axios';
const limit = 15;
function UndoEvent(props){
const username = props.match.params.username;
const [ list , setList ] = useState(undefined);
const [ page , setPage ] = useState(1);
const [ total , setTotal ] = useState(0);
useEffect(()=>{
if(username){
getList();
}
},[username,page])
function getList(){
const url = `/users/${username}/applied_transfer_projects.json`;
Axios.get(url,{
params:{
page,per_page:limit
}
}).then(result=>{
if(result){
setList(result.data.applied_transfer_projects);
setTotal(result.data.total_count);
}
}).catch(error=>{})
}
//
function acceptDivert(id){
const url = `/users/${username}/applied_transfer_projects/${id}/accept.json`;
Axios.post(url).then(result=>{
if(result && result.data){
getList();
props && props.fetchUser();
}
}).catch(error=>{})
}
//
function revertDivert(id){
const url = `/users/${username}/applied_transfer_projects/${id}/refuse.json`;
Axios.post(url).then(result=>{
if(result && result.data){
getList();
props && props.fetchUser();
}
}).catch(error=>{})
}
return(
<div>
{
list && list.length > 0 ?
<div>
<ul className="notifyList">
{
list.map((i,k)=>{
return(
<li>
<Link to={`/users/${i.user && i.user.login}`}><img src={getImageUrl(`/${i.user && i.user.image_url}`)} alt="" className="notifyImg"/></Link>
<div className="notifyFlex">
<p className="notifyInfos">
<Link to={`/users/${i.login}`} className="font-15 mr20">{i.user && i.user.name}</Link>
<span className="color-grey-9">{i.time_ago}</span>
</p>
<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>
转移给<Link to={`/users/${i.owner && i.owner.login}`}>{i.owner && i.owner.name}</Link>,是否接受</p>
{
i.status === "common" &&
<span>
<Popconfirm title={`确定接受仓库${i.project && i.project.name}`} okText="确定" cancelText="取消" onConfirm={()=>acceptDivert(i.id)}>
<a className="color-blue">接受</a>
</Popconfirm>
<Popconfirm title={`确定拒绝接受仓库${i.project && i.project.name}`} okText="确定" cancelText="取消" onConfirm={()=>revertDivert(i.id)}>
<a className="color-red ml20">拒绝</a>
</Popconfirm>
</span>
}
{
i.status === "canceled" && <span className="color-grey-9">对方已取消转移</span>
}
{
i.status === "accepted" && <span className="color-grey-9">已接受</span>
}
{
i.status === "refused" && <span className="color-grey-9">已拒绝</span>
}
</FlexAJ>
</div>
</li>
)
})
}
</ul>
</div>
:
""
}
{list && list.length === 0 && <Nodata _html="暂无接收信息" />}
{
total > limit &&
<div className="edu-txt-center pt20 pb20">
<Pagination simple pageSize={limit} total={total} current={page} onChange={(p)=>{setPage(p)}}/>
</div>
}
</div>
)
}
export default UndoEvent;

View File

@ -218,7 +218,7 @@ class MilepostDetail extends Component {
</span>
<div className="milepostdiv">
<Link to={`/projects/${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={`/projects/${owner}/${projectsId}/issues/${meilid}/new`} className="topWrapper_btn">创建易修</Link>
</div>
</FlexAJ>
</div>

View File

@ -352,12 +352,12 @@ class order extends Component {
if (this.props.checkIfLogin()) {
return(
<Link className="topWrapper_btn ml10" target="_blank" to={`/projects/${owner}/${projectsId}/issues/new`}>
+&nbsp;创建任务
+&nbsp;创建易修
</Link>
)
}else{
return(
<a className="topWrapper_btn ml10" onClick={this.islogin}>+&nbsp;创建任务</a>
<a className="topWrapper_btn ml10" onClick={this.islogin}>+&nbsp;创建易修</a>
)
}
}

View File

@ -310,14 +310,14 @@ class order_form extends Component {
<div className="list-right">
<div className="pd20">
<h3 className="mb15">
{form_type === "new" ? "新建" :( form_type === "copy" ? "复制" : "编辑")}任务
{form_type === "new" ? "新建" :( form_type === "copy" ? "复制" : "编辑")}易修
</h3>
<Form.Item>
{getFieldDecorator("subject", {
rules: [
{
required: true,
message: "请填写任务标题",
message: "请填写易修标题",
},
]
})(<Input placeholder="标题" size="large" maxLength={80}/>)}

View File

@ -2,6 +2,8 @@ import React, { Component } from "react";
import { Form, Input, Checkbox, Select , Spin } from "antd";
import Title from '../Component/Title';
import {WhiteBack} from '../Component/layout';
import DivertModal from '../Divert/DivertModal';
import { Link } from 'react-router-dom';
import axios from "axios";
import "./setting.scss";
const { TextArea } = Input;
@ -25,7 +27,9 @@ class Setting extends Component {
LanguageList: undefined,
private_check: undefined,
loading:true,
project_units:['home',"activity","code"]
project_units:['home',"activity","code"],
divertVisible:false,
is_transfering:undefined,
};
}
@ -73,7 +77,9 @@ class Setting extends Component {
this.setState({
private_check: result.data.private,
loading:false,
project_units:units
project_units:units,
transfer:result.data.transfer,
is_transfering:result.data.is_transfering,
});
}
})
@ -186,12 +192,55 @@ class Setting extends Component {
});
};
// 转移仓库
DivertProject=()=>{
this.setState({
divertVisible:true
})
}
// 取消仓库转移
CancelDivertProject=()=>{
this.props.confirm({
content: "是否确认取消将此项目转移给他人?",
onOk: () => {
const { projectsId , owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/applied_transfer_projects/cancel.json`;
axios.post(url).then(result=>{
if(result && result.data){
this.setState({
is_transfering:false
})
}
}).catch(error=>{})
},
});
}
// 确定转移仓库
onSuccess=(owner)=>{
this.setState({
is_transfering:true,
divertVisible:false,
transfer:owner
})
}
render() {
const { getFieldDecorator } = this.props.form;
const { projectsId , owner } = this.props.match.params;
const { projectDetail } = this.props;
const { CategoryList, LanguageList, private_check ,loading } = this.state;
const { CategoryList, LanguageList, private_check ,loading , divertVisible , is_transfering, transfer } = this.state;
let mirror = projectDetail && projectDetail.mirror;
return (
<div>
<DivertModal
owner={owner}
repo={projectsId}
visible={divertVisible}
onSuccess={this.onSuccess}
onCancel={()=>{this.setState({divertVisible:false})}}
/>
<Spin spinning={loading}>
<WhiteBack>
<Title>基本设置</Title>
@ -221,12 +270,12 @@ class Setting extends Component {
)}
</Form.Item>
</div>
<Form.Item label="仓库描述">
<Form.Item label="项目简介">
{getFieldDecorator("project_description", {
rules: [],
})(
<TextArea
placeholder="请输入仓库描述"
placeholder="请输入项目简介"
style={{ height: "80px" }} maxLength={200}
/>
)}
@ -262,7 +311,7 @@ class Setting extends Component {
<Checkbox
key={key}
value={item.index}
disabled={item.index === "home" || item.index === "activity" || item.index === "code"}
disabled={item.index === "home" || item.index === "activity" || item.index === "code" || (mirror && item.index === "pulls")}
>{item.name}</Checkbox>
)
})
@ -279,23 +328,48 @@ class Setting extends Component {
{/* 镜像设置部分,暂无接口,先不显示 */}
{/* <Mirror /> */}
</WhiteBack>
<WhiteBack className="dangerousBox mb20">
<div>
<div className="dangerousTitle">危险操作区</div>
<div className="flex-a-center padding15-10">
{
projectDetail && projectDetail.permission && (projectDetail.permission === "Admin" || projectDetail.permission === "Owner")?
<WhiteBack className="dangerousBox mb20">
<div>
<p className="font-bd font-16">删除本仓库</p>
<p className="mt10">
删除仓库是永久性的,
无法撤消且删除后与仓库关联的项目/任务/合并请求/版本发布等均会被删除
</p>
<div className="dangerousTitle">危险操作区</div>
<div className="flex-a-center padding15-10" style={{borderBottom:"1px solid #f9edbe"}}>
<div>
<p className="font-bd font-16">转移仓库</p>
<p className="mt10">
{
is_transfering ?
<span>此仓库正在转移给
{transfer && <Link to={transfer.type="User"?`/users/${transfer.login}`:`/organize/${transfer.login}`}>{transfer.name}</Link>}
请联系对方接收此仓库</span>
:
`将此仓库转移给其他用户或组织`
}
</p>
</div>
{
is_transfering ?
<a onClick={this.CancelDivertProject} className="red_deleteBtn">取消转移</a>
:
<a onClick={this.DivertProject} className="red_deleteBtn">转移</a>
}
</div>
<div className="flex-a-center padding15-10">
<div>
<p className="font-bd font-16">删除本仓库</p>
<p className="mt10">
删除仓库是永久性的,
无法撤消且删除后与仓库关联的项目/任务/合并请求/版本发布等均会被删除
</p>
</div>
<a onClick={this.deleteProject} className="red_deleteBtn">
删除本仓库
</a>
</div>
</div>
<a onClick={this.deleteProject} className="red_deleteBtn">
删除本仓库
</a>
</div>
</div>
</WhiteBack>
</WhiteBack>
:""
}
</Spin>
</div>
);

View File

@ -84,11 +84,12 @@ export default ((props) => {
//
function removeUser(username) {
const url = `/organizations/${OIdentifier}/teams/${groupId}/team_users/${username}.json`;
if (username) {
const url = `/organizations/${OIdentifier}/teams/${groupId}/team_users/quit.json`;
axios.delete(url).then((result) => {
if (result && result.data) {
props.showNotification(`已成功退出团队!`);
props.history.push(`/organize/${OIdentifier}`);
}
}).catch((error) => { });
}
@ -101,7 +102,7 @@ export default ((props) => {
group ?
<div>
<AlignCenterBetween>
<span className="color-grey-3">{group.nickname}</span>
<span className="color-grey-3 task-hide">{group.nickname}</span>
{group.is_member && !group.is_admin ?
<Popconfirm
title="确认离开团队吗?"

View File

@ -277,6 +277,7 @@
display: flex;
align-items: flex-start;
.g-sub-left{
width: 0;
&>div{
border:1px solid #eee;
}

View File

@ -7,7 +7,7 @@ function ListItem({item,key,OIdentifier}) {
<div className="team_project" key={key}>
<p className="t_p_title">
<span className="flex1">
<Link to={`/projects/${OIdentifier}/${item.identifier}`} className="name">{item.identifier}</Link>
<Link to={`/projects/${OIdentifier}/${item.identifier}`} className="name">{item.name}</Link>
{ item.forked_from_project_id && <i className="iconfont icon-fork font-18 color-orange ml8" /> }
{
item.type && item.type !== 0 ?

View File

@ -83,10 +83,9 @@ function Detail(props){
img={detail.avatar_url}
rightBtn={
<React.Fragment>
{flag && !buttonflag && detail.is_admin ? <AlignCenter className="color-blue">
<Link to={`/organize/${OIdentifier}/setting`} className="color-blue">设置</Link>
<i className="iconfont icon-shezhi2 ml3"></i>
</AlignCenter> :""}
{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>
:""}
{buttonflag &&
<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>
@ -95,6 +94,18 @@ function Detail(props){
}
</React.Fragment>
}
bottomInfos={
!buttonflag && <div>
{
detail.location &&
<span className="color-grey-6"><i className="iconfont icon-weizhi mr3 font-16 color-grey-6"></i>{detail.location}</span>
}
{
detail.website &&
<a href={detail.website} target="_blank" className="ml20 color-grey-6"><i className="iconfont icon-lianjie mr3 font-14"></i>{detail.website}</a>
}
</div>
}
/>
}
<Switch {...props}>

View File

@ -41,8 +41,8 @@ const FanUser = Loadable({
loading: Loading,
})
const UndoEvents = Loadable({
loader: () => import("./undo_events"),
const Notice = Loadable({
loader: () => import("../Notice/Index"),
loading: Loading,
})
class Infos extends Component {
@ -52,7 +52,9 @@ class Infos extends Component {
isSpin: false,
user: undefined,
project_type: undefined,
route_type: undefined
route_type: undefined,
undo_events:0,
undo_messages:0
};
}
@ -73,14 +75,22 @@ class Infos extends Component {
});
const { current_user } = this.props;
const { username } = this.props.match.params;
const { pathname } = this.props.location;
const { notice } = this.state;
let url = `/users/${username || (current_user && current_user.login)}.json`;
axios
.get(url)
.then((result) => {
let e = result.data && result.data.undo_events;
let p = result.data && result.data.undo_messages;
let n = notice || pathname === `/users/${username}/notice` ;
this.setState({
user: result.data,
isSpin: false,
undo_events:n ? (e-p) : e,
undo_messages:0,
notice:n
});
})
.catch((error) => {
@ -114,11 +124,15 @@ class Infos extends Component {
}
undo_link = () => {
const {user} = this.state
const {user } = this.state;
this.setState({
route_type: undefined
route_type: undefined,
project_type:"notice",
notice:true
},()=>{
this.props.history.push(`/users/${user && user.login}/notice`);
this.fetchUser();
})
this.props.history.push(`/users/${user && user.login}/undo_events`)
}
route_link = (type) => {
@ -130,7 +144,8 @@ class Infos extends Component {
organize_link = () => {
const {user} = this.state
this.setState({
route_type: undefined
route_type: undefined,
project_type:"organizes"
})
this.props.history.push(`/users/${user && user.login}/organizes`)
}
@ -140,7 +155,7 @@ class Infos extends Component {
const { current_user, mygetHelmetapi } = this.props;
const { username } = this.props.match.params;
const { user, isSpin, project_type, route_type } = this.state;
const { user, isSpin, project_type, route_type , undo_events , undo_messages } = this.state;
return (
<div className="newMain clearfix">
<Spin spinning={isSpin}>
@ -211,21 +226,23 @@ class Infos extends Component {
</div>
</div>
</div>
{/* {current_user && user && current_user.id === user.id && (
{current_user && user && user.login === current_user.login ? (
<div className="bgcF">
<div className="list-l-Menu">
<p className="list-l-p pd20" onClick={() => this.undo_link()}>
<span className="font-16 color-grey-3">
<i className="iconfont icon-dahuizhongzuo3x font-15 mr5"></i>
待办事项
</span>
<span className="text-yellow font-16">
{user.undo_events}
</span>
</p>
<li className={project_type && project_type === "notice" ? "active" : ""}>
<p onClick={() => this.undo_link()}>
<span className="font-16 color-grey-3">
<i className="iconfont icon-dahuizhongzuo3x font-15 mr5"></i>
待办事项
</span>
<span className="text-yellow font-16">
{undo_events}
</span>
</p>
</li>
</div>
</div>
)} */}
):""}
<div className="bgcF">
<ul className="list-l-Menu">
@ -285,19 +302,19 @@ class Infos extends Component {
</ul>
</div>
}
<div className="bgcF">
<div className="list-l-Menu">
<p className="list-l-p pd20" onClick={() => this.organize_link()} >
<span className="font-16 color-grey-3">
<i className="iconfont icon-itsm-liuchengguanli font-15 mr5"></i>
组织
</span>
<span className="color-blue font-16">
{user && user.user_org_count}
</span>
</p>
<li className={project_type && project_type === "organizes" ? "active" : ""}>
<p onClick={() => this.organize_link()} >
<span className="font-16 color-grey-3">
<i className="iconfont icon-itsm-liuchengguanli font-15 mr5"></i>
组织
</span>
<span className="color-blue font-16">
{user && user.user_org_count}
</span>
</p>
</li>
</div>
</div>
</div>
@ -312,9 +329,9 @@ class Infos extends Component {
}}
></Route>
<Route
path="/users/:username/undo_events"
path="/users/:username/notice"
render={() => {
return <UndoEvents {...this.props} {...this.state} />;
return <Notice {...this.props} {...this.state} fetchUser={this.fetchUser}/>;
}}
></Route>
<Route

View File

@ -1,16 +0,0 @@
import React, { Component } from "react";
import Nodata from "../Nodata";
class UndoEvents extends Component {
render() {
return (
<div className="pd20">
<div className="grid-item pb20 bbt">
<h3>待办事项</h3>
</div>
<Nodata _html={`暂时没有数据~`} />
</div>
);
}
}
export default UndoEvents;

View File

@ -47,6 +47,12 @@
.markdown-body img{
cursor: pointer;
}
.markdown-body pre ol.linenums,.markdown-body pre ul.linenums{
padding-left: 0px;
}
.markdown-body pre ol>li, .markdown-body pre ol>li{
list-style-type: none;
}
ol,
ul,

View File

@ -1062,7 +1062,7 @@ class TPMBanner extends Component {
</div> :
<div className="task-popup-content">
<p className="task-popup-text-center font-16 mt10 mb10">
尚未创建任务的实训不能申请发布
尚未创建易修的实训不能申请发布
</p>
</div>
}