diff --git a/src/AppConfig.js b/src/AppConfig.js index 6723ab141..add2d851f 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -97,6 +97,7 @@ export function initAxiosInterceptors(props) { } if (response.data.status === 404) { + console.log("response:",response); let responseURL = (response && response.request) ? response.request.responseURL:''; // 组织和个人的拥有情况,404不跳转 if (responseURL.indexOf('/api/users/') === -1 && responseURL.indexOf('/api/organizations/') === -1 ) { diff --git a/src/forge/Activity/ActivityItem.js b/src/forge/Activity/ActivityItem.js index 19ce15366..1ee593e70 100644 --- a/src/forge/Activity/ActivityItem.js +++ b/src/forge/Activity/ActivityItem.js @@ -32,10 +32,18 @@ class ActivityItem extends Component {

}

- - - {item.user_name} - + { + item && item.user_login ? + + + {item.user_name} + + : + + + {item.user_name} + + } {item.created_at && 创建于{item.created_at}}

diff --git a/src/forge/Component/SearchUser.jsx b/src/forge/Component/SearchUser.jsx index 79d23fb65..de8ea9a3a 100644 --- a/src/forge/Component/SearchUser.jsx +++ b/src/forge/Component/SearchUser.jsx @@ -5,25 +5,21 @@ import axios from 'axios'; const Option = AutoComplete.Option; -export default ({ getUser , placeholder, width ,value })=>{ +export default ({ getUser , placeholder, width ,value, userList=[] })=>{ const [ source , setSource ] = useState(undefined); - const [ searchKey , setSearchKey ] = useState(undefined); - useEffect(()=>{ - if(!value){ - setSearchKey(undefined); + if(userList && userList.length){ + sourceOptions(userList); + }else{ + getUserList(); } - },[value]) - - useEffect(()=>{ - getUserList(); - },[searchKey]) + },[]) - function getUserList(e){ + function getUserList(value){ const url = `/users/list.json`; axios.get(url, { params: { - search: searchKey, + search: value, }, }).then((result) => { if (result) { @@ -61,13 +57,9 @@ export default ({ getUser , placeholder, width ,value })=>{ setSource(s); } - function changeInputUser(e){ - setSearchKey(e); - }; - // 选择用户 function selectInputUser(e, option){ - setSearchKey(option.props.name); + getUserList(option.props.name); getUser(option.props.login); }; @@ -76,12 +68,12 @@ export default ({ getUser , placeholder, width ,value })=>{ trigger.parentNode} dataSource={source} - value={searchKey} style={{ width: width || 300 }} - onChange={changeInputUser} + onSearch={(value)=>{getUserList(value)}} onSelect={selectInputUser} placeholder={placeholder || "搜索需要添加的用户..."} allowClear + optionLabelProp="name" /> ) diff --git a/src/forge/Component/User.jsx b/src/forge/Component/User.jsx index 198667b08..a789609dc 100644 --- a/src/forge/Component/User.jsx +++ b/src/forge/Component/User.jsx @@ -20,8 +20,8 @@ export default ({ url , name , column , id , login })=>{ } `; return( - id? - + (id && login)? + { url && } {name} diff --git a/src/forge/Divert/DivertModal.jsx b/src/forge/Divert/DivertModal.jsx index d4c1f2014..27e3e4f79 100644 --- a/src/forge/Divert/DivertModal.jsx +++ b/src/forge/Divert/DivertModal.jsx @@ -8,14 +8,9 @@ const { Option } = Select; function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ const { getFieldDecorator, validateFields , setFieldsValue } = form; const [ cate , setCate ] = useState(0); - const [ value , setValue ] = useState(undefined); const [ organizations , setOrganizations ] = useState(undefined); - useEffect(()=>{ - setFieldsValue({goal:cate}) - },[]) - useEffect(()=>{ if(owner && repo && visible===true){ getTeam(); @@ -25,7 +20,7 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ owner_name:undefined, identifier:undefined }) - setValue(undefined) + setCate(0); } },[repo,owner,visible]) @@ -79,7 +74,6 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ }; function getUser(id){ - setValue(id); setFieldsValue({ owner_name:id }) @@ -94,6 +88,7 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ okText="确认转移" cancelText={"取消"} centered + destroyOnClose={true} >
{ @@ -113,7 +108,8 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){
{getFieldDecorator("goal",{ - rules:[] + rules:[], + initialValue: 0 })( 个人 @@ -128,7 +124,7 @@ function DivertModal({form , visible , onSuccess , onCancel,owner,repo}){ rules:[{required:true,message:"请输入目标用户名"}] })( // - + )} } diff --git a/src/forge/Information/Component/comments/list.jsx b/src/forge/Information/Component/comments/list.jsx index 4014063d4..39c765cf9 100644 --- a/src/forge/Information/Component/comments/list.jsx +++ b/src/forge/Information/Component/comments/list.jsx @@ -125,14 +125,19 @@ function IssueCommentList(props){ {journals && (journals.length > 0 && journals.map(item=>{return
{/* 评论 */}
- + { + item.user.login ? + + : + + }
{/* 判断是否是编辑状态 */} {(showEdit === 2 && updateId === item.id) ?
:
- {item.user.name} + {item.user.login ? {item.user.name}:{item.user.name}} {timeAgo(item.created_at)}
{login && !isPhone() &&
diff --git a/src/forge/Issues/Component/comments/list.jsx b/src/forge/Issues/Component/comments/list.jsx index afabf21a2..50524f01b 100644 --- a/src/forge/Issues/Component/comments/list.jsx +++ b/src/forge/Issues/Component/comments/list.jsx @@ -129,7 +129,7 @@ function IssueCommentList(props){
- +
{item.user.name}  @@ -142,14 +142,19 @@ function IssueCommentList(props){
: '' :
{/* 评论 */}
- + { + item.user.login ? + + : + + }
{/* 判断是否是编辑状态 */} {(showEdit === 2 && updateId === item.id) ?
:
- {item.user.name} + {item.user.login ? {item.user.name}:{item.user.name}} {timeAgo(item.created_at)}
{login &&
diff --git a/src/forge/Issues/Component/datas.jsx b/src/forge/Issues/Component/datas.jsx index ea9ae9c6f..27d130c61 100644 --- a/src/forge/Issues/Component/datas.jsx +++ b/src/forge/Issues/Component/datas.jsx @@ -53,8 +53,13 @@ function Datas({checkbox ,item , projectsId,owner,chooseTagFunc}){ #{item.project_issues_index} }
- - {item.author && item.author.name} + + {item.author && item.author.login ? + + {item.author && item.author.name} + :{item.author && item.author.name} + } + {item.created_at} 发布 {item.updated_at}更新 {item.blockchain_token_num && {item.blockchain_token_num}} diff --git a/src/forge/Issues/Pages/details.jsx b/src/forge/Issues/Pages/details.jsx index 88c1b693c..ac2b4b137 100644 --- a/src/forge/Issues/Pages/details.jsx +++ b/src/forge/Issues/Pages/details.jsx @@ -391,9 +391,13 @@ function Details(props){ #{details.project_issues_index}
{ - details.author && + details.author &&
- {details.author.name} + { details.author.login ? + {details.author.name} + : + {details.author.name} + } 添加于{details.created_at}
} diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index 7cace1e5d..50d1475a3 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -79,25 +79,34 @@ class MergeItem extends Component {

- - - - - {item && item.author_name} - + { + item && item.author_login ? + + + {item && item.author_name} + + : + + {item && item.author_name} + + } + {item.pull_request_staus === "open" ? "创建于" diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index 767444e49..a9516b81d 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -342,7 +342,7 @@ class MessageCount extends Component { const { data, SpinMerge, - pr_status, + pr_status, isSpin, ismesrge, SpinFlag, @@ -404,19 +404,23 @@ class MessageCount extends Component { {

- - {data.pull_request && (data.pull_request.is_original ? data.pull_request.fork_project_user:data.issue.author_name)}: {data.pull_request && data.pull_request.head} - + { + (data.pull_request.fork_project_user || data.issue.author_name!=="已注销") ? + + {data.pull_request && (data.pull_request.is_original ? data.pull_request.fork_project_user:data.issue.author_name)}: {data.pull_request && data.pull_request.head} + + : + + {data.pull_request && (data.pull_request.is_original ? data.pull_request.fork_project_user:data.issue.author_name)}: {data.pull_request && data.pull_request.head} + + + } - + - - - + { + data.issue.author_login? + + + + : + + } - - {data.issue.author_name} - + { + data.issue.author_login ? + + {data.issue.author_name} + + : + {data.issue.author_name} + } {pr_status === 0 ? "创建于" diff --git a/src/forge/Newfile/codeReview/mock/component/index.jsx b/src/forge/Newfile/codeReview/mock/component/index.jsx index bbcf026fc..e219f0a72 100755 --- a/src/forge/Newfile/codeReview/mock/component/index.jsx +++ b/src/forge/Newfile/codeReview/mock/component/index.jsx @@ -146,18 +146,14 @@ const ReplyItem = memo(({ note, isChild }) => {
- - + : "images/avatars/User/b"} size={24} className="mr10"/> {note.user && note.user.username} - 于 {timeAgo(note.createdAt)} 发表评论: + + 于 {timeAgo(note.createdAt)} 发表评论: {user && (user.admin || diff --git a/src/forge/Notice/Apply.jsx b/src/forge/Notice/Apply.jsx index aeacd67a2..f16e9a34c 100644 --- a/src/forge/Notice/Apply.jsx +++ b/src/forge/Notice/Apply.jsx @@ -19,11 +19,15 @@ function Apply(props) { setIsSpin(true); getList(); } - },[username]) + },[username, page]) function getList() { const url = `/users/${username}/applied_projects.json`; - Axios.get(url).then(result=>{ + Axios.get(url,{ + params:{ + page,per_page:limit + } + }).then(result=>{ if(result){ setList(result.data.applied_projects); setTotal(result.data.total_count); diff --git a/src/forge/Team/Setting/cla/CLAinfos.jsx b/src/forge/Team/Setting/cla/CLAinfos.jsx index 3896f0cf2..6a98bce79 100644 --- a/src/forge/Team/Setting/cla/CLAinfos.jsx +++ b/src/forge/Team/Setting/cla/CLAinfos.jsx @@ -23,11 +23,7 @@ function CLAinfos(props){ } },[current_user,details]) - useEffect(()=>{ - if(current_user &&!current_user.login){ - props.history.push(`/login?go_page=/${OIdentifier}/cla/${claid}`); - } - },[current_user]) + useEffect(()=>{ if(claid){ diff --git a/src/forge/Team/Setting/cla/TeamSettingCLA.jsx b/src/forge/Team/Setting/cla/TeamSettingCLA.jsx index a207f0c81..3ca2923f0 100644 --- a/src/forge/Team/Setting/cla/TeamSettingCLA.jsx +++ b/src/forge/Team/Setting/cla/TeamSettingCLA.jsx @@ -9,6 +9,7 @@ function TeamSettingCLA(props){ const OIdentifier = props.match.params.OIdentifier; const [ list , setList ] = useState(undefined); const [ isSpin , setisSpin ] = useState(false); + const { current_user } = props; useEffect(()=>{ if(OIdentifier){ @@ -28,6 +29,14 @@ function TeamSettingCLA(props){ }).catch(error=>{}) } + function toDetail(){ + if(current_user && current_user.login){ + window.open(`/${OIdentifier}/cla/${list.key}`, '_blank'); + }else{ + window.open(`/login?go_page=/${OIdentifier}/cla/${claid}`, '_blank'); + } + } + return(
CLA管理 @@ -40,7 +49,7 @@ function TeamSettingCLA(props){

{list.name}

签署人数{list.count || 0}
- +
diff --git a/src/forge/comments/children_comments.js b/src/forge/comments/children_comments.js index 809ffdb54..bcf6265d0 100644 --- a/src/forge/comments/children_comments.js +++ b/src/forge/comments/children_comments.js @@ -124,20 +124,15 @@ class children_comments extends Component {
- - {item && item.user_name}
diff --git a/src/forge/comments/comments.js b/src/forge/comments/comments.js index 52707b8be..d28871e49 100644 --- a/src/forge/comments/comments.js +++ b/src/forge/comments/comments.js @@ -397,24 +397,34 @@ class comments extends Component { return (
- - - - - {item && item.user_name} - + { + item && item.user_login ? + + + {item && item.user_name} + + : + + + {item && item.user_name} + + } +
{item.content ? ( diff --git a/src/forge/users/Material/Password.jsx b/src/forge/users/Material/Password.jsx index c07984dbe..fdc68abe2 100644 --- a/src/forge/users/Material/Password.jsx +++ b/src/forge/users/Material/Password.jsx @@ -253,7 +253,7 @@ export default Form.create()( let can_delete = result.data.can_delete; if(can_delete === false){ setOffAgain(true); - message.error("当前账号名下存在未删除或退出的组织/仓库,请先删除或退出后再尝试注销操作"); + message.error("当前账号名下存在拥有的组织/代码库,请先删除或转让后再尝试注销操作"); } else { setOffAgain(false); setOffVisible(true); @@ -363,10 +363,10 @@ export default Form.create()(
请您谨慎操作,注销后帐号内所有数据都会被清空,且无法恢复帐号!
您可点击按钮完成账号的注销,注销后相关数据将不可恢复,注意事项如下:
- 请确认需注销的帐号未加入任何组织的owner团队,若owner团队仅此一人,则该组织将被删除。 - 注销账号后,该账号名下所有仓库将被删除,请进行备份以防数据的丢失。 - 注销账号后,该账号在Gitlink产生的所有过程数据(如疑修,合并请求,论坛帖子等)也将被删除。 - 注销后你将丢失该帐号产生的所有数据,一旦注销相关数据将不可恢复,请输入登录密码再次确认。 + 提交注销前,请确保此账号下没有拥有的组织及代码库,若存在上述情况请及时转让或删除。 + 注销后该账号产生的所有数据将会丢失且不可恢复,请提前进行数据备份。 + {/* 注销账号后,该账号在Gitlink产生的所有过程数据(如疑修,合并请求,论坛帖子等)也将被删除。 + 注销后你将丢失该帐号产生的所有数据,一旦注销相关数据将不可恢复,请输入登录密码再次确认。 */} { current_user && }
diff --git a/src/forge/users/contribution/index.jsx b/src/forge/users/contribution/index.jsx index 6c420620a..10fa4c516 100644 --- a/src/forge/users/contribution/index.jsx +++ b/src/forge/users/contribution/index.jsx @@ -1,11 +1,8 @@ import React , { useEffect , useState } from 'react'; import { Button, Dropdown, Input, Menu , message, Pagination } from 'antd'; -import Search from '../../Component/Search'; -import Item from '../Team-item'; import Nodata from '../../Nodata'; import axios from 'axios'; -import CheckProfile from '../../Component/ProfileModal/Profile'; import './index.scss'; import SearchUser from '../../Component/SearchUser'; import { FlexAJ } from '../../Component/layout'; @@ -28,6 +25,10 @@ function Contribution(props){ const [error2, setError2] = useState(undefined); // 操作仓库id const [proId, setProId] = useState(undefined); + // 名称搜索 + const [content, setContent] = useState(undefined); + // 平台用户列表 + const [userList, setUserList] = useState([]); const {current_user:{user_id, login, open_blockchain}, current_user} = props; const {user} = props; const username = props.match.params.username; @@ -43,7 +44,8 @@ function Contribution(props){ axios.get(`/users/blockchain/balance.json`,{params: { user_id, limit, - page + page, + keyword: content }}).then(res=>{ if(res && res.data){ const {projects} = res.data; @@ -63,7 +65,7 @@ function Contribution(props){ setTotal(res.data.total_count); } }) - }, [reload, page]) + }, [reload, page, content]) useEffect(()=>{ if(user){ @@ -73,6 +75,16 @@ function Contribution(props){ } },[user]) + useEffect(()=>{ + // 获取平台用户列表 + const url = `/users/list.json`; + axios.get(url).then((result) => { + if (result) { + setUserList(result.data.users); + } + }) + }, []) + // 目标转账用户 function getUser(id, login){ // 使用JSON进行对象深拷贝 @@ -113,7 +125,7 @@ function Contribution(props){ project_id: id }).then(res=>{ if(res && res.data && res.data.status === 2){ - getUser(id, undefined); + // getUser(id, undefined); setToken(id, undefined); setReload(Math.random()); message.success('转账成功'); @@ -124,10 +136,14 @@ function Contribution(props){ return(
{/* 转账/记录切换 */} - {/* */} +
+ {/* {setType(1)}}>token转账 + {setType(0)}}>token记录 */} + { + setPage(1); + setContent(value); + }}/> +
{/* token转账 */} {type ?
{list && list.length > 0 &&
@@ -142,7 +158,7 @@ function Contribution(props){
{item.name}
{item.balance}
- {getUser(item.id, login)}} width={"100%"} placeholder="搜索转账目标用户" value={userLogin[item.id]}/> + {getUser(item.id, login)}} width={"100%"} placeholder="搜索转账目标用户" userList={userList}/> {proId === item.id && error1 &&
{error1}
}