Merge pull request '20220507周里程碑内容' (#370) from gitlink_server into pre_gitlink_server

This commit is contained in:
yystopf 2022-05-07 13:55:25 +08:00
commit 62f4a0417f
35 changed files with 561 additions and 185 deletions

View File

@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
src: url('iconfont.woff2?t=1649726899310') format('woff2'),
url('iconfont.woff?t=1649726899310') format('woff'),
url('iconfont.ttf?t=1649726899310') format('truetype');
src: url('iconfont.woff2?t=1651041108151') format('woff2'),
url('iconfont.woff?t=1651041108151') format('woff'),
url('iconfont.ttf?t=1651041108151') format('truetype');
}
.iconfont {
@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
.icon-personal-center:before {
content: "\e927";
}
.icon-bangzhuzhongxinicon:before {
content: "\e926";
}

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "29206429",
"name": "personal-center",
"font_class": "personal-center",
"unicode": "e927",
"unicode_decimal": 59687
},
{
"icon_id": "28888753",
"name": "帮助中心icon",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -93,6 +93,9 @@ body {
.editormd-preview .markdown-body{
padding:0px !important;
}
.editormd-preview{
width: 50%!important;
}
/* 图片点击放大的场景,隐藏图片链接 */
.editormd-image-click-expand .editormd-image-dialog {

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -436,7 +436,7 @@ function CoderDepot(props){
<div className="addOptionBtn">
{
baseOperate &&
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/master...${turnbar(branchName || defaultBranch)}`)} >+ 合并请求</CheckProfile>
<CheckProfile {...props} sureFunc={()=>urlLink(`/${owner}/${projectsId}/compare/${turnbar(branchName || defaultBranch)}...${turnbar(branchName || defaultBranch)}`)} >+ 合并请求</CheckProfile>
}
{
issuesFlag &&

View File

@ -14,7 +14,7 @@ function Index(props) {
const [ isSpin , setIsSpin ] = useState(true);
const { projectsId , owner } = props.match.params;
const { isManager , isDeveloper , projectDetail } = props;
const { isManager , isDeveloper , projectDetail , defaultBranch } = props;
useEffect(()=>{
getList();
@ -85,7 +85,7 @@ function Index(props) {
<div className="treeabout">
{
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
<Link to={`/${owner}/${projectsId}/compare/master...${turnbar(i.name)}`} className="btn-83">+ 合并请求</Link>
<Link to={`/${owner}/${projectsId}/compare/${turnbar(defaultBranch)}...${turnbar(i.name)}`} className="btn-83">+ 合并请求</Link>
}
<Dropdown overlay={menu(i.zip_url,i.tar_url)} trigger={['click']} placement="bottomRight">
<a className="btn-83 ml15">下载<i className="iconfont icon-sanjiaoxing-down font-14"></i></a>

View File

@ -116,61 +116,29 @@ class CreateMerge extends Component {
this.setState({ isSpin: true });
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams;
const url = `/${pullOwner}/${projectId}/pulls/new.json`;
axios
.get(url)
.then((result) => {
axios.get(url).then((result) => {
if (result) {
if(init){
//页面初始化时调用selectProjectName给is_original、fork_project_id、merge_user_login赋值
const initUser = result.data.projects_names && result.data.projects_names.filter((item)=>item.project_user_login === branchParams.mergeOwner);
initUser && initUser[0] && this.selectProjectName(initUser[0].id,false,{projects_names: result.data.projects_names,id: result.data.id});
}
this.setState({isSpin: false});
// 如果url上的分支不存在取默认值master
const noMergeBranch =
(result.data.branches || []).filter(
(branch) => branch.name === returnbar(mergeBranch)
).length === 0;
const noPullBranch =
(result.data.branches || []).filter(
(branch) => branch.name === returnbar(pullBranch)
).length === 0;
this.setState({
// isFork: result.data.is_fork,
projects_names: result.data.projects_names,
mergeProjects: result.data.merge_projects,
pullBranches: result.data.branches,
mergeBranches: result.data.branches,
// pullBranches: result.data.branches,
// mergeBranches: result.data.branches,
project_id: result.data.project_id,
id: result.data.id,
merge: returnbar(mergeBranch),
pull: returnbar(pullBranch),
});
//判断源分支是否存在
if(noPullBranch){
this.checkBranch(branchParams);
this.setState({
showMessage: true,
defaultMessage:'源分支不存在',
isCompareSpin: false,
});
}else{
if(pullOwner === returnbar(mergeOwner)){
if (!noMergeBranch) {
this.compareProject(true, branchParams);
} else {
this.setState({
showMessage: true,
defaultMessage:'目标分支不存在',
isCompareSpin: false,
isSpin: false,isCompareSpin: false
});
}
}else{
this.getBranchList(branchParams);
}
}
}
this.setState({ isSpin: false });
})
.catch((error) => {
this.setState({ isSpin: false });
@ -178,6 +146,15 @@ class CreateMerge extends Component {
});
};
checkBranch=async(branchParams)=>{
const { mergeBranch , mergeOwner, projectId , pullBranch ,pullOwner} = branchParams;
let getbranch =await this.getBranchList(mergeOwner,projectId,pullBranch,mergeBranch);
// let checkpull =await this.getBranchList(pullOwner,projectId,pullBranch,"pull");
if(getbranch){
this.compareProject(mergeOwner === pullOwner, branchParams);
}
}
// compare接口获取分支对比信息
compareProject = (sameProject, branchParams) => {
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams;
@ -187,8 +164,6 @@ class CreateMerge extends Component {
} else {
url += `/${Base64.encode(returnbar(mergeBranch))}...${pullOwner}/${projectId}:${Base64.encode(returnbar(pullBranch))}.json`;
}
console.log(url);
this.setState({ isSpin: false, isCompareSpin: true });
axios
.get(url)
.then((result) => {
@ -219,31 +194,40 @@ class CreateMerge extends Component {
};
// 根据所有者、仓库名,获取分支列表,目前仅涉及目标仓库分支查询
getBranchList = (branchParams) => {
const { mergeOwner, projectId, mergeBranch } = branchParams;
this.setState({ isSpin: true });
const url = `/${mergeOwner}/${projectId}/pulls/get_branches.json`;
axios
.get(url)
.then((result) => {
if (result) {
const noMergeBranch =
(result.data || []).filter((branch) => branch.name === mergeBranch)
.length === 0;
getBranchList =async(owner,identifier,branch,mergebranch) => {
const url = `/${owner}/${identifier}/branches.json`;
let check = await axios.get(url).then((result) => {
if(result.data){
let pfilter = (result.data || []).filter(i => i.name === branch).length === 0;
let mfilter = (result.data || []).filter(i => i.name === mergebranch).length === 0;
if(pfilter){
this.setState({
mergeBranches: result.data,
showMessage: noMergeBranch,
defaultMessage: '目标分支不存在',
isCompareSpin: false,
showMessage: branch,
defaultMessage: `源分支不存在`,
isCompareSpin: false
});
!noMergeBranch && this.compareProject(false, branchParams);
return false;
}
if(mfilter){
this.setState({
showMessage: mergebranch,
defaultMessage: `目标分支不存在`,
isCompareSpin: false
});
return false;
}
this.setState({
pullBranches:result.data,
mergeBranches:result.data
})
return true;
}
this.setState({ isSpin: false });
})
.catch((error) => {
this.setState({ isSpin: false });
console.log(error);
check = false;
});
return check;
};
// 切换分支事件
@ -291,14 +275,16 @@ class CreateMerge extends Component {
});
// 加上是否需要切换url判断
if(isChangeProject){
const { defaultBranch } = this.props;
let branch = turnbar(defaultBranch) || "master";
if (login === pullOwner) {
// 如果切换后, 仓库与源仓库一致了
this.props.history.push(
`/${login}/${identifier}/compare/master...${turnbar(pullBranch)}`
`/${login}/${identifier}/compare/${branch}...${turnbar(pullBranch)}`
);
} else {
this.props.history.push(
`/${login}/${identifier}/compare/master...${pullOwner}:${turnbar(pullBranch)}`
`/${login}/${identifier}/compare/${branch}...${pullOwner}:${turnbar(pullBranch)}`
);
}
}
@ -336,6 +322,32 @@ class CreateMerge extends Component {
return <div dangerouslySetInnerHTML={{ __html: html }}></div>;
};
// 源分支-分支搜索
changePullValue=async(value,cate)=>{
const branchParams = getBranchParams(this.props.location.pathname);
const { pullOwner, mergeOwner , projectId } = branchParams;
const url = `/${cate === "pull" ? pullOwner :mergeOwner}/${projectId}/pulls/get_branches.json`;
axios.get(url,{
params:{
name:value || undefined,
}
}).then(result=>{
if(result){
if(cate === "pull"){
this.setState({
pullBranches:result.data,
pullBranch:result.data
})
}else{
this.setState({
mergeBranches:result.data,
mergeBranch:result.data
})
}
}
}).catch(error=>{})
}
render() {
const {
data,
@ -355,7 +367,6 @@ class CreateMerge extends Component {
} = this.state;
let { project } = this.props;
return (
<div>
<Spin spinning={isSpin || isCompareSpin}>
@ -378,6 +389,8 @@ class CreateMerge extends Component {
className="merge-flex1 flex1 matchwidth"
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
// onSearch={(e)=>this.changePullValue(e,"pull")}
// filterOption={(input,option)=>option}
>
{this.renderBrances(pullBranches)}
</Select>
@ -406,6 +419,8 @@ class CreateMerge extends Component {
className="merge-flex1 flex1 matchwidth"
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
// onSearch={(e)=>this.changePullValue(e,"merge")}
// filterOption={(input,option)=>option}
>
{this.renderBrances(mergeBranches)}
</Select>

View File

@ -227,3 +227,6 @@ form .ant-cascader-picker, form .ant-select {
.updateMerge{
margin: 30px auto 60px;
}
.searchIcon .ant-select-arrow{
margin-top:-9px
}

View File

@ -6,6 +6,7 @@ import "../Order/index.scss";
import NoneData from "./no_data";
import MergeItem from "./MergeItem";
import './Index.scss';
import { turnbar } from "educoder";
import axios from "axios";
import CheckProfile from '../Component/ProfileModal/Profile';
@ -210,10 +211,11 @@ class merge extends Component {
this.getIssueList();
};
checkOperation() {
const { defaultBranch } = this.props;
const { projectsId,owner } = this.props.match.params;
this.props.history.push(`/${owner}/${projectsId}/compare/master...master`);
let branch = turnbar(defaultBranch) || "master";
this.props.history.push(`/${owner}/${projectsId}/compare/${branch}...${branch}`);
}
render() {
const { projectsId , owner } = this.props.match.params;
@ -414,7 +416,7 @@ class merge extends Component {
) : (
""
)}
{ data && data.issues && data.issues.length === 0 ? <NoneData _html="暂时还没有相关数据!" user_admin_or_developer={data.user_admin_or_developer} projectsId={projectsId} owner={owner} /> :""}
{ data && data.issues && data.issues.length === 0 ? <NoneData _html="暂时还没有相关数据!" user_admin_or_developer={data.user_admin_or_developer} projectsId={projectsId} owner={owner} defaultBranch={this.props && turnbar(this.props.defaultBranch) }/> :""}
</Spin>
</div>
</div>

View File

@ -181,7 +181,6 @@ class MergeForm extends Component {
this.setState({
isSpin: false,
});
console.log(error);
});
} else {
let url = `/${owner}/${projectsId}/pulls/${mergeId}.json`;
@ -315,7 +314,16 @@ class MergeForm extends Component {
{getFieldDecorator("assigned_to_id", {
initialValue: assigned_to_id,
})(
<Select placeholder="未选择审查人员" showSearch>
<Select
placeholder="未选择审查人员"
showSearch
className="searchIcon"
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.value && option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
<Option key={0} value={""}>未选择审查人员</Option>
{this.renderSelect(members)}
</Select>
@ -330,6 +338,12 @@ class MergeForm extends Component {
issue_versions && issue_versions.length > 0? "未选择里程碑": "请添加里程碑"
}
showSearch
className="searchIcon"
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.value && option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
<Option key={0} value={""}>{issue_versions && issue_versions.length > 0? "未选择里程碑": "请添加里程碑"}</Option>
{this.renderSelect(issue_versions)}
@ -345,6 +359,12 @@ class MergeForm extends Component {
issue_tags && issue_tags.length > 0 ? "未选择标记" : "请在仓库设置里添加标记"
}
showSearch
className="searchIcon"
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.value && option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
<Option key={0} value={""}>{issue_tags && issue_tags.length > 0 ? "未选择标记" : "请在仓库设置里添加标记"}</Option>
{this.renderSelect(issue_tags)}

View File

@ -2,7 +2,7 @@ import React , { Component } from 'react';
import { Link } from "react-router-dom";
class Nodata extends Component{
render(){
const { _html, projectsId , owner , user_admin_or_developer} = this.props;
const { _html, projectsId , owner , user_admin_or_developer , defaultBranch} = this.props;
return(
<div className="none_panels">
<div>
@ -12,7 +12,7 @@ class Nodata extends Component{
<h3>欢迎使用合并请求</h3>
<div className="color-grey-8">
合并请求可以帮助您与他人协作编写代码{ user_admin_or_developer && <span>在使用之前请先创建一个 <Link className="color-blue" to={`/${owner}/${projectsId}/compare/master...master`}>合并请求</Link></span> }
合并请求可以帮助您与他人协作编写代码{ user_admin_or_developer && <span>在使用之前请先创建一个 <Link className="color-blue" to={`/${owner}/${projectsId}/compare/${defaultBranch}...${defaultBranch}`}>合并请求</Link></span> }
</div>
</div>
</div>

View File

@ -11,7 +11,7 @@
}
.quillFlag {
position: absolute;
bottom: 0px;
bottom: 30px;
left: 6px;
height: 20px;
line-height: 18px;
@ -711,3 +711,7 @@ a.issue-type-button.active:hover {
.pbt20{padding: 20px 0;}
.inline-block{display: inline-block;}
.pd10{padding: 10px;}
.searchIcon .ant-select-arrow{
margin-top:-9px
}

View File

@ -210,17 +210,16 @@ class order_form extends Component {
if (result && result.data.id) {
this.props.showNotification("任务创建成功!");
this.props.history.push(`/${owner}/${projectsId}/issues/${result.data.id}`);
this.setState({
description: "",
isSpin: false,
});
const { getDetail } = this.props;
getDetail && getDetail();
}
this.setState({
isSpin: false,
});
})
.catch((error) => {
this.setState({
isSpin: false,
isSpin: false
});
});
} else {
@ -240,10 +239,13 @@ class order_form extends Component {
const { getDetail } = this.props;
getDetail && getDetail();
}
this.setState({
isSpin: false
});
})
.catch((error) => {
this.setState({
isSpin: false,
isSpin: false
});
});
}
@ -437,7 +439,17 @@ class order_form extends Component {
<div className="pd20 background-f issue-form-right">
<Form.Item label="指派成员">
{getFieldDecorator("assigned_to_id", {rules: []})(
<Select>
<Select
showSearch
className="searchIcon"
showArrow={true}
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.children[1] && option.props.children[1].toLowerCase().indexOf(input.toLowerCase()) >= 0
}
placeholder="搜索成员"
>
<Option value={""}>未指派成员</Option>
{this.renderSelect(
issue_chosen && issue_chosen.assign_user
@ -485,7 +497,16 @@ class order_form extends Component {
<Form.Item label="里程碑">
{getFieldDecorator("fixed_version_id", {rules: []})(
<Select>
<Select
showSearch
className="searchIcon"
showArrow={true}
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.children[1] && option.props.children[1].toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
<Option value={""}>
{issue_chosen && issue_chosen.issue_version.length > 0
? "未选择里程碑"
@ -499,7 +520,16 @@ class order_form extends Component {
</Form.Item>
<Form.Item label="标记">
{getFieldDecorator("issue_tag_ids", {rules: []})(
<Select>
<Select
showSearch
className="searchIcon"
showArrow={true}
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.children[1] && option.props.children[1].toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
<Option value={""}>
{issue_chosen && issue_chosen.issue_tag.length > 0
? "未选择标记"
@ -537,7 +567,16 @@ class order_form extends Component {
{getFieldDecorator("branch_name", {
rules: []
})(
<Select>
<Select
showSearch
className="searchIcon"
showArrow={true}
suffixIcon={<i className="iconfont icon-sousuo1"></i>}
optionFilterProp="children"
filterOption={(input, option) =>
option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
>
<Option value={""}>分支未指定</Option>
{branches && branches.length > 0 && branches.map((item, key) => {
return (

View File

@ -21,24 +21,17 @@ export default ((props)=>{
const [ count , setCount ] = useState(0);
const [ page , setPage ] = useState(1);
let defaultBranch = props.defaultBranch;
useEffect(()=>{
if(defaultBranch){
setBranch(defaultBranch);
setProtectBranch(defaultBranch);
if(props.defaultBranch){
setBranch(props.defaultBranch);
setProtectBranch(props.defaultBranch);
}
},[defaultBranch]);
},[props.defaultBranch]);
const { projectsId , owner } = props.match.params;
const projectDetail = props.projectDetail;
useEffect(()=>{
if(defaultBranch){
setBranch(defaultBranch);
}
},[defaultBranch]);
useEffect(()=>{
if(owner){

View File

@ -52,7 +52,7 @@ class Attachment extends Component {
show_video: status === "preview",
video_url:
status === "preview"
? "https://forgeplus.trustie.net" + result.data.url
? "https://www.gitlink.org.cn" + result.data.url
: undefined,
move_spin: false,
});

View File

@ -192,7 +192,7 @@ export default Form.create()(({ form, history, showNotification, projectDetail,
/>
)}
<Form.Item className="mb0">
<Form.Item className="mb0 wiki-md">
<MDEditor
placeholder={"请输入wiki内容"}
height={500}

View File

@ -10,7 +10,7 @@ body {
.wiki-main {
width: 1200px;
min-height: 400px;
margin: 20px auto;
margin: 20px auto 60px;
.ant-btn-primary {
background-color: $wikiColor;
@ -106,6 +106,9 @@ body {
.has-error .ant-form-split {
position: absolute;
}
.wiki-md .ant-form-explain{
bottom: -6px;
}
.wiki-nav {
max-height: 60vh;
.wiki-search {

View File

@ -42,13 +42,14 @@ class comments extends Component {
//添加评论
addjournals = () => {
const { content, reply_content } = this.state;
const { content, reply_content , fileList } = this.state;
this.setState({
journal_spin: true,
});
if (!content && !reply_content) {
this.setState({
journal_spin: false,
quillFlag:true
});
return;
}
@ -58,15 +59,12 @@ class comments extends Component {
const {
page,
limit,
fileList,
orderId,
reply_id,
is_reply,
atWhoLoginList,
} = this.state;
const url = `/issues/${orderId}/journals.json`;
axios
.post(url, {
@ -343,7 +341,7 @@ class comments extends Component {
height="30"
/>
</Link>
<div>
<div style={{position:"relative"}}>
<MDEditor
placeholder={"添加评论..."}
height={300}
@ -362,7 +360,7 @@ class comments extends Component {
projectsId = {projectsId}
></MDEditor>
<p className="quillFlag">
{quillFlag && <span className="">请输入评论内容</span>}
{quillFlag && <span>请输入评论内容</span>}
</p>
<Upload
className="commentStyle"

View File

@ -15,6 +15,7 @@ import Activity from './Activity';
import moment from 'moment';
import Axios from 'axios';
import Nodata from '../../Nodata';
import Personal from '../Personal/Index';
const { Option } = Select;
const aLimit = 5;
@ -95,8 +96,8 @@ function Index(props) {
}
}).catch(error=>{})
}
return(
props && props.menuKey === "0" ?
<div>
<div>
<ConcentrateProject
@ -127,6 +128,8 @@ function Index(props) {
{ total > aLimit && <div style={{textAlign:'center',paddingBottom:"30px"}}><Pagination pageSize={aLimit} current={page} total={total} onChange={(p)=>setPage(p)}/></div> }
</div>
</div>
:
<Personal {...props}/>
)
}
export default Index;

View File

@ -216,7 +216,7 @@ ul.ant-menu.menuStyle li {
.infosRightMenu .ant-menu-item {
padding: 0px;
margin: 0px 20px !important;
margin: 0px 20px 0px 0px !important;
font-size: 17px;
height: 32px;
line-height: 0px;
@ -224,7 +224,7 @@ ul.ant-menu.menuStyle li {
position: relative;
}
.infosRightMenu .ant-menu-item a > i {
font-size: 15px !important;
font-size: 15px;
margin-right: 8px;
}
.infosRightMenu .ant-menu-item .menuNum {

View File

@ -24,7 +24,7 @@ export default withRouter(
secondRouter = props.location.pathname.split('/')[2];
}
let userRouterArr = ['statistics', 'projects', 'notice', 'devops', 'organizes', 'info', 'following', 'followers', 'password'];
let userRouterArr = ['statistics', 'projects', 'notice', 'devops', 'organizes', 'info', 'following', 'followers', 'password' , "general"];
return (
<Switch>

View File

@ -107,6 +107,46 @@ $flex:flex;
font-size: 16px;
text-align: center;
}
.usersDesc{
padding:20px 10px;
background-color: rgba(239, 247, 255, 1);
margin-top: 24px;
display: flex;
align-items: center;
flex-direction: column;
p{
text-align: left;
line-height: 20px;
font-size: 14px;
color: #666;
margin-bottom: 20px!important;
}
.emptyBtn{
width: 118px;
text-align: center;
height: 36px;
line-height: 34px;
border: 1px solid rgba(26, 71, 255, 1);
color: rgba(26, 71, 255, 1);
border-radius: 5px;
&:hover{
border-color:rgba(102, 132, 254, 1);
color: rgba(102, 132, 254, 1);
}
}
.fullBtn{
width: 118px;
text-align: center;
height: 36px;
line-height: 34px;
color: #fff!important;
border-radius: 5px;
background-color: rgba(70, 106, 255, 1);
&:hover{
background-color: rgba(102, 132, 254, 1);
}
}
}
.focusBox,.infoBox{
width: 100%!important;
display: inline-block;
@ -237,7 +277,7 @@ ul.ant-menu.menuStyle{
.infosRightMenu{
.ant-menu-item{
padding:0px;
margin:0px 20px!important;
margin:0px 30px 0px 0px !important;
font-size: 17px;
height: 32px;
line-height: 0px;
@ -245,9 +285,14 @@ ul.ant-menu.menuStyle{
position: relative;
a{
font-size: 16px;
display: flex;
align-items: center;
& >i{
font-size: 15px!important;
margin-right: 8px;
&.font-20{
font-size: 17px!important;
}
}
}
.menuNum{

View File

@ -58,6 +58,12 @@ const Notice = Loadable({
loader: () => import("../Notice/Index"),
loading: Loading,
})
const Personal = Loadable({
loader: () => import("./Personal/Index"),
loading: Loading,
})
class Infos extends Component {
constructor(props) {
super(props);
@ -67,15 +73,20 @@ class Infos extends Component {
project_type: undefined,
route_type: undefined,
undo_events:0,
menuKey:"0",
menuKey:"6",
avatarVisible:false
};
}
renderPath=(pathname)=>{
renderPath=(pathname,load)=>{
const { username } = this.props.match.params;
if(pathname === `/${username}`){
this.setState({menuKey:"0",route_type:undefined});
this.setState({route_type:undefined});
if(load){
this.setState({
menuKey:load.show_super_description ? "6" :"0"
})
}
}else if(pathname === `/${username}/statistics`){
this.setState({menuKey:"1",route_type:undefined});
}else if(pathname.indexOf(`/${username}/projects`)>-1){
@ -97,8 +108,6 @@ class Infos extends Component {
componentDidMount = () => {
this.fetchUser();
const { pathname } = this.props.location;
this.renderPath(pathname);
};
componentDidUpdate=(prevProps)=>{
@ -136,6 +145,8 @@ class Infos extends Component {
isSpin: false,
undo_events:e
});
const { pathname } = this.props.location;
this.renderPath(pathname,result.data);
})
.catch((error) => {
this.setState({
@ -211,10 +222,34 @@ class Infos extends Component {
}
}
chooseTab =(key)=>{
this.setState({
menuKey:key
})
}
aboutDescFunc =(flag)=>{
const { user } = this.state;
const url = `/users/${user && user.login}.json`;
const params={
user: {
user_extension_attributes: {
show_super_description:flag
}
}
}
axios.put(url,params).then(result=>{
if(result && result.data){
this.fetchUser();
}
})
}
render() {
const { current_user } = this.props;
const { username } = this.props.match.params;
const { user, isSpin, route_type , undo_events , menuKey , avatarVisible } = this.state;
return (
<div className="newMain clearfix">
{
@ -254,7 +289,7 @@ class Infos extends Component {
<div className="userDescription">
{user && user.description}
</div>
<div>
{/* {user && current_user && user.login === current_user.login && (
<div className="user-info-star-button ">
<Button
@ -281,7 +316,15 @@ class Infos extends Component {
/>
</div>
)}
{
current_user && user && user.login === current_user.login &&
<div className="usersDesc">
<p>想全方位展示自己试试点击下方按钮定制化您的专属个人简介吧</p>
{
user.show_super_description ? <a className="emptyBtn" onClick={()=>this.aboutDescFunc(false)}>隐藏个人简介</a> : <a className="fullBtn" onClick={()=>this.aboutDescFunc(true)}></a>
}
</div>
}
<div className="focusBox">
<Link
to={`/${user && user.login}/following`}
@ -315,7 +358,11 @@ class Infos extends Component {
<div className="list-right">
{ !route_type && menuKey &&
<Menu selectedKeys={[menuKey]} mode={`horizontal`} className="infosRightMenu">
<Menu.Item key="0"><Link to={`/${user && user.login}`}><i className="iconfont icon-gailan"></i></Link></Menu.Item>
{
user && user.show_super_description &&
<Menu.Item key="6"><Link to={`/${user && user.login}`} onClick={()=>this.chooseTab("6")}><i className="iconfont icon-personal-center font-20"></i></Link></Menu.Item>
}
<Menu.Item key="0"><Link to={`/${user && user.login}`} onClick={()=>this.chooseTab("0")}><i className="iconfont icon-gailan"></i></Link></Menu.Item>
<Menu.Item key="1"><Link to={`/${user && user.login}/statistics`}><i className="iconfont icon-shujutongji"></i></Link></Menu.Item>
<Menu.Item key="2"><Link to={`/${user && user.login}/projects`}><i className="iconfont icon-xiangmu"></i></Link></Menu.Item>
{
@ -406,13 +453,19 @@ class Infos extends Component {
<Route
path="/:username"
render={(props) => {
return <GeneralView {...this.props} {...this.state} />;
return <GeneralView {...this.props} {...this.state} menuKey={menuKey} show_super_description={user && user.show_super_description}/>;
}}
></Route>
{/* <Route
path="/:username"
render={(props) => {
return <Personal {...this.props} {...this.state} />;
}}
></Route> */}
<Route
path="/"
render={(props) => {
return <GeneralView {...this.props} {...this.state} />;
return <GeneralView {...this.props} {...this.state} menuKey={menuKey}/>;
}}
></Route>
</Switch>

View File

@ -115,11 +115,11 @@ export default Form.create()(
<Checkbox>在个人主页展示</Checkbox>
)}
</Form.Item>
<Form.Item label="简介">
<Form.Item label="签名">
{getFieldDecorator("description",{
rules:[]
})(
<TextArea placeholder="请输入您的自我简介" rows={4} maxLength={140} style={{width:"600px"}}/>
<TextArea placeholder="请输入您的签名" rows={4} maxLength={140} style={{width:"600px"}}/>
)}
</Form.Item>
<AlignCenter>

View File

@ -0,0 +1,111 @@
import React, { useEffect, useState } from 'react';
import { Button } from 'antd';
import './Index.scss';
import MDEditor from "../../../modules/tpm/challengesnew/tpm-md-editor";
import RenderHtml from "../../../components/render-html";
import { Divider } from 'antd';
import axios from 'axios';
function Personal(props){
const { user ,current_user , resetUserInfo } = props;
const [ edit , setEdit ] = useState(false);
const [ showedit , setShowEdit ] = useState(false);
const [ description ,setDescription ] = useState("");
const [ copyDescription ,setCopyDescription ] = useState("");
useEffect(()=>{
if(user && user.super_description){
setDescription(user.super_description);
setCopyDescription(user.super_description);
setShowEdit(true);
}
},[user])
function onContentChange(value){
setDescription(value);
}
function emtptyEditFunc(){
setShowEdit(true);
setEdit(true);
}
function editCancelFunc(){
if(!copyDescription){
setShowEdit(false);
}
setDescription(copyDescription);
setEdit(false);
}
function editSaveFunc(){
const url = `/users/${user && user.login}.json`;
const params={
user: {
user_extension_attributes: {
super_description:description
}
}
}
axios.put(url,params).then(result=>{
if(result && result.data){
setCopyDescription(description);
setEdit(false);
setShowEdit(description ?true :false);
resetUserInfo && resetUserInfo();
}
})
}
return(
<div>
{
description || showedit?
user && current_user && user.login === current_user.login &&
<div className="editPanel">
{
edit ?
<div>
<Button ghost onClick={()=>editCancelFunc()}>取消</Button>
<Button type="primary" ghost onClick={editSaveFunc}>保存</Button>
</div>
:
<Button type="primary" ghost onClick={()=>setEdit(true)}>编辑</Button>
}
</div>
:
<div className="emptyDescBox">
<img src={require('./img/nullicon.png')} alt="" width="58px"/>
<p className="emptyMain">暂无数据</p>
{
current_user && user && (current_user.login === user.login) &&
<div className="emptyContent">
<p className="emptysub">您可以在此页面定制化您的个人简介信息包括开发者介绍宣传链接宣传图片等</p>
<Divider className="divider"/>
<a className="fullBtn" onClick={emtptyEditFunc}>编辑个人简介</a>
</div>
}
</div>
}
{
showedit ?
<div className="padding20">
{
edit ?
<MDEditor
placeholder={"请输入个人简介"}
height={500}
mdID={"personal-description"}
initValue={description || ""}
onChange={onContentChange}
isCanAtme = {false}
></MDEditor>
:
<RenderHtml className="break_word_comments imageLayerParent" value={description || ""} url={props.history.location} />
}
</div>
:
""
}
</div>
)
}
export default Personal;

View File

@ -0,0 +1,70 @@
.editPanel
{
display: flex;
justify-content: right;
padding:20px 20px 0px 0px;
.ant-btn.ant-btn-background-ghost{
color: #d0d0d0;
}
.ant-btn.ant-btn-primary.ant-btn-background-ghost {
border-color: #1890ff;
color: #1890ff;
margin-left: 20px;
&:hover{
background-color: #fff!important;
color: #1890ff;;
}
}
}
.emptyDescBox{
min-height:420px;
background-color:#fafcff;
border:1px solid;
border-color:rgba(42, 97, 255, 0.23);
border-radius:4px 4px 0px 0px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
margin-top: 20px;
.emptyMain{
height: 28px;
line-height: 28px;
margin-top: 22px;
color:#333333;
font-size:20px;
text-align: center;
}
.emptyContent{
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
.emptysub{
margin-top: 12px;
line-height:23px;
color:#333333;
font-size:14px;
text-align:center;
width: 325px;
}
.divider{
width: 400px;
min-width: 400px;
}
.fullBtn{
width: 118px;
text-align: center;
height: 36px;
line-height: 34px;
color: #fff!important;
border-radius: 5px;
background-color: rgba(70, 106, 255, 1);
&:hover{
background-color: rgba(102, 132, 254, 1);
}
margin:0px auto;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

View File

@ -14,9 +14,9 @@ function Help(props) {
// wiki
useEffect(()=>{
wikiPages({
owner: locationStatus ? 'GLCC' : 'forgetest2',
repo: locationStatus ? 'glcc2022' : 'wiki1',
projectId: locationStatus ? '1403785' : '546103'
owner: locationStatus ? 'CCF-GLCC' : 'forgetest2',
repo: locationStatus ? 'glcc-help' : 'wiki1',
projectId: locationStatus ? '1403908' : '546103'
}).then(res => {
if (res && res.message === "200" && Array.isArray(res.data)) {
setFileArrInit(res.data);
@ -32,10 +32,10 @@ function Help(props) {
// wiki
useEffect(() => {
checkItem.name && getWiki({
owner: locationStatus ? 'GLCC' : 'forgetest2',
repo: locationStatus ? 'glcc2022' : 'wiki1',
owner: locationStatus ? 'CCF-GLCC' : 'forgetest2',
repo: locationStatus ? 'glcc-help' : 'wiki1',
pagename: checkItem.name,
projectId: locationStatus ? '1403785' : '546103'
projectId: locationStatus ? '1403908' : '546103'
}).then(res => {
if (res && res.message === "200") {
setItemDetail(res.data);

View File

@ -31,5 +31,8 @@
width: 100%;
top: 0;
}
div img{
max-width: 100%;
}
}
}

View File

@ -19,7 +19,7 @@ function Footnav() {
</ul>
<ul>
<li className="thehead">支持与服务</li>
<li><a href="https://forgeplus.trustie.net/docs/api">API文档</a></li>
<li><a href="https://www.gitlink.org.cn/docs/api">API文档</a></li>
<li><a href="https://git-scm.com">Git常用命令</a></li>
<li><a href="https://forum.trustie.net/forums/3080/detail">DevOps使用文档</a></li>
<li><a href='https://www.trustie.net/agreement'>服务协议</a></li>

View File

@ -94,7 +94,7 @@ function Index(props) {
CCF开源发展委员会首批执行委员名单发布
</li>
</a>
<a href="https://forgeplus.trustie.net/Gitlink/forgeplus" target="_blank" className="font-18">
<a href="https://www.gitlink.org.cn/Gitlink/forgeplus" target="_blank" className="font-18">
<li>
平台精选仓库GitLink/GitLink
</li>