diff --git a/public/css/iconfont.css b/public/css/iconfont.css index 080d38a72..92de082aa 100644 --- a/public/css/iconfont.css +++ b/public/css/iconfont.css @@ -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"; } diff --git a/public/css/iconfont.js b/public/css/iconfont.js index 709a100e6..b910937d3 100644 --- a/public/css/iconfont.js +++ b/public/css/iconfont.js @@ -1 +1 @@ -!function(a){var l,c,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(a,l){l.parentNode.insertBefore(a,l)};if(t&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}l=function(){var a,l=document.createElement("div");l.innerHTML=z,z=null,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),l()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(h=l,i=a.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window); \ No newline at end of file +!function(a){var l,c,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(a,l){l.parentNode.insertBefore(a,l)};if(t&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}l=function(){var a,l=document.createElement("div");l.innerHTML=z,z=null,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),l()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(h=l,i=a.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window); \ No newline at end of file diff --git a/public/css/iconfont.json b/public/css/iconfont.json index d1a1779fe..3bf3eb57d 100644 --- a/public/css/iconfont.json +++ b/public/css/iconfont.json @@ -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", diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf index 976c59a38..76ccae2b2 100644 Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff index c2a9a1512..be0e660da 100644 Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2 index a7418992b..51640e89e 100644 Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ diff --git a/src/AppConfig.js b/src/AppConfig.js index b4107e460..cd3aca3d4 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -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) { diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js index 2f080bcac..e4ac51d4f 100644 --- a/src/forge/Merge/CreateMerge.js +++ b/src/forge/Merge/CreateMerge.js @@ -116,68 +116,45 @@ 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) => { - 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, - project_id: result.data.project_id, - id: result.data.id, - merge: returnbar(mergeBranch), - pull: returnbar(pullBranch), - }); - - //判断源分支是否存在 - if(noPullBranch){ - 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, - }); - } - }else{ - this.getBranchList(branchParams); - } - } + 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 }); - }) - .catch((error) => { - this.setState({ isSpin: false }); - console.log(error); - }); + 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, + project_id: result.data.project_id, + id: result.data.id, + merge: returnbar(mergeBranch), + pull: returnbar(pullBranch), + }); + this.checkBranch(branchParams); + this.setState({ + isSpin: false,isCompareSpin: false + }); + } + }) + .catch((error) => { + this.setState({ isSpin: false }); + console.log(error); + }); }; + 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; } - this.setState({ isSpin: false }); - }) - .catch((error) => { - this.setState({ isSpin: false }); - console.log(error); - }); + if(mfilter){ + this.setState({ + showMessage: mergebranch, + defaultMessage: `目标分支不存在`, + isCompareSpin: false + }); + return false; + } + this.setState({ + pullBranches:result.data, + mergeBranches:result.data + }) + return true; + } + }) + .catch((error) => { + this.setState({ isSpin: false }); + check = false; + }); + return check; }; // 切换分支事件 @@ -339,21 +323,25 @@ class CreateMerge extends Component { }; // 源分支-分支搜索 - changePullValue=(value,cate)=>{ + changePullValue=async(value,cate)=>{ const branchParams = getBranchParams(this.props.location.pathname); - const { pullOwner , projectId } = branchParams; - const url = `/${pullOwner}/${projectId}/pulls/new.json`; + const { pullOwner, mergeOwner , projectId } = branchParams; + const url = `/${cate === "pull" ? pullOwner :mergeOwner}/${projectId}/pulls/get_branches.json`; axios.get(url,{ - params:{branch_name:value || undefined} + params:{ + name:value || undefined, + } }).then(result=>{ if(result){ if(cate === "pull"){ this.setState({ - pullBranches:result.data.branches + pullBranches:result.data, + pullBranch:result.data }) }else{ this.setState({ - mergeBranches:result.data.branches + mergeBranches:result.data, + mergeBranch:result.data }) } } @@ -379,7 +367,6 @@ class CreateMerge extends Component { } = this.state; let { project } = this.props; - return (
@@ -402,8 +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} + // onSearch={(e)=>this.changePullValue(e,"pull")} + // filterOption={(input,option)=>option} > {this.renderBrances(pullBranches)} @@ -432,8 +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} + // onSearch={(e)=>this.changePullValue(e,"merge")} + // filterOption={(input,option)=>option} > {this.renderBrances(mergeBranches)} diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css index f763903fc..ab9a591f5 100644 --- a/src/forge/Order/order.css +++ b/src/forge/Order/order.css @@ -11,7 +11,7 @@ } .quillFlag { position: absolute; - bottom: 0px; + bottom: 30px; left: 6px; height: 20px; line-height: 18px; diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js index c6502cb9f..cc938452e 100644 --- a/src/forge/Order/order_form.js +++ b/src/forge/Order/order_form.js @@ -210,17 +210,17 @@ 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({ + description: "", + isSpin: false, + }); }) .catch((error) => { this.setState({ - isSpin: false, + isSpin: false }); }); } else { @@ -240,10 +240,13 @@ class order_form extends Component { const { getDetail } = this.props; getDetail && getDetail(); } + this.setState({ + isSpin: false + }); }) .catch((error) => { this.setState({ - isSpin: false, + isSpin: false }); }); } diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index fb19e1dad..079ffeff7 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -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" /> -
+

- {quillFlag && 请输入评论内容} + {quillFlag && 请输入评论内容}

{}) } - return( + props && props.menuKey === "0" ?
aLimit &&
setPage(p)}/>
}
+ : + ) } export default Index; \ No newline at end of file diff --git a/src/forge/users/Index.css b/src/forge/users/Index.css index 8cad4168d..fe496d8ee 100644 --- a/src/forge/users/Index.css +++ b/src/forge/users/Index.css @@ -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 { diff --git a/src/forge/users/Index.jsx b/src/forge/users/Index.jsx index 04c867f7e..d4d0ff6cd 100644 --- a/src/forge/users/Index.jsx +++ b/src/forge/users/Index.jsx @@ -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 ( diff --git a/src/forge/users/Index.scss b/src/forge/users/Index.scss index e523323d2..6e354f76f 100644 --- a/src/forge/users/Index.scss +++ b/src/forge/users/Index.scss @@ -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{ diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index f3ecbaabd..d5d547067 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -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 (
{ @@ -254,34 +289,42 @@ class Infos extends Component {
{user && user.description}
-
- {/* {user && current_user && user.login === current_user.login && ( -
- -
- )} */} - {current_user && user && user.login !== current_user.login && ( -
- -
- )} -
+ + {/* {user && current_user && user.login === current_user.login && ( +
+ +
+ )} */} + {current_user && user && user.login !== current_user.login && ( +
+ +
+ )} + { + current_user && user && user.login === current_user.login && +
+

想全方位展示自己?试试点击下方按钮定制化您的专属个人简介吧!

+ { + user.show_super_description ? this.aboutDescFunc(false)}>隐藏个人简介 : this.aboutDescFunc(true)}>展示个人简介 + } +
+ }
{ !route_type && menuKey && - 活动概览 + { + user && user.show_super_description && + this.chooseTab("6")}>个人简介 + } + this.chooseTab("0")}>活动概览 数据统计 参与项目 { @@ -406,13 +453,19 @@ class Infos extends Component { { - return ; + return ; }} > + {/* { + return ; + }} + > */} { - return ; + return ; }} > diff --git a/src/forge/users/Material/Base.jsx b/src/forge/users/Material/Base.jsx index c17bfbe36..35f4d0ad8 100644 --- a/src/forge/users/Material/Base.jsx +++ b/src/forge/users/Material/Base.jsx @@ -115,11 +115,11 @@ export default Form.create()( 在个人主页展示 )} - + {getFieldDecorator("description",{ rules:[] })( -