diff --git a/src/AppConfig.js b/src/AppConfig.js index f897831fc..2c34caa67 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/Main/Detail.js b/src/forge/Main/Detail.js index 61b2df722..5be749510 100644 --- a/src/forge/Main/Detail.js +++ b/src/forge/Main/Detail.js @@ -462,7 +462,7 @@ class Detail extends Component { firstSync ? "": { - ((current_user && current_user.admin) || isManager) && (projectDetail && projectDetail.type && projectDetail.type === 2) ? + current_user && current_user.login && (projectDetail && projectDetail.type && projectDetail.type === 2) ? 同步镜像 : "" } @@ -639,11 +639,6 @@ class Detail extends Component { } > {/* 新建合并请求 */} - () - } - > () diff --git a/src/forge/users/GeneralView/Index.jsx b/src/forge/users/GeneralView/Index.jsx index 47760da59..ded435827 100644 --- a/src/forge/users/GeneralView/Index.jsx +++ b/src/forge/users/GeneralView/Index.jsx @@ -48,6 +48,7 @@ function Index(props) { // 在贡献度日历表中选择一个时间 function chooseTime(data) { if(data){ + setPage(1); setActivityDate(data[0]); } } diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js index ec8f7bf19..6317bff59 100644 --- a/src/forge/users/Infos.js +++ b/src/forge/users/Infos.js @@ -1,6 +1,6 @@ import React, { Component } from "react"; import { Link } from "react-router-dom"; -import { Avatar, Tag, Button, Spin , Menu } from "antd"; +import { Button, Spin , Menu } from "antd"; import FocusButton from "../UsersList/focus_button"; import axios from "axios"; @@ -14,7 +14,10 @@ import './Index.scss'; import Loadable from "react-loadable"; import Loading from "../../Loading"; - +const UpdateInfo = Loadable({ + loader: () => import("./Material/Index"), + loading: Loading, +}); const InfosDevOps = Loadable({ loader: () => import("./devOpsCI"), loading: Loading, @@ -86,6 +89,8 @@ class Infos extends Component { this.setState({menuKey:undefined,route_type:"watchers"}); }else if(pathname === `/users/${username}/fan_users`){ this.setState({menuKey:undefined,route_type:"fan_users"}); + }else{ + this.setState({menuKey:undefined,route_type:undefined}); } } @@ -123,41 +128,25 @@ class Infos extends Component { 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) => { - this.setState({ - isSpin: false, - }); + 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) => { + this.setState({ + isSpin: false, + }); + }); }; - // change_project_type = (type) => { - // const {user} = this.state - // this.setState({ - // project_type: type , - // route_type: undefined - // }) - // let url = `/users/${user && user.login}` - // if (type){ - // url = `/users/${user && user.login}/projects/${type}` - // } - // this.props.history.push(url) - - // }; - change_devops_type=(type)=>{ const {user} = this.state; this.setState({ @@ -194,39 +183,51 @@ class Infos extends Component { this.props.history.push(`/users/${user && user.login}/organizes`) } + resetUser=(data)=>{ + this.setState({ + user:data + }) + } + render() { const { current_user, mygetHelmetapi } = this.props; const { username } = this.props.match.params; - const { user, isSpin, project_type, route_type , undo_events , undo_messages , menuKey } = this.state; + return (
-
- - {user && user.user_identity && ( -
- {user && user.user_identity} -
- )} +
+ + + + { + user && user.gender===1? + + : + + } + + +
{user && user.username}
+
+ {user && user.description} +
{user && current_user && user.login === current_user.login && (
)}
-
+
{user && user.watched_count}
+ { + user && (user.province || user.custom_department || user.email) ? +
+ { user.province &&
{user.province}{user.city}
} + { user.custom_department &&
{user.custom_department}
} + { user.email &&
{user.email}
} +
+ :"" + }
- { !route_type && + { !route_type && menuKey && 概览 数据统计 @@ -330,6 +340,19 @@ class Infos extends Component { return ; }} > + { + return ; + }} + > + { + return ; + }} + > + { diff --git a/src/forge/users/Material/Base.jsx b/src/forge/users/Material/Base.jsx index 7a2001116..578ae97fd 100644 --- a/src/forge/users/Material/Base.jsx +++ b/src/forge/users/Material/Base.jsx @@ -43,7 +43,6 @@ export default Form.create()( } Axios.put(url,params).then(result=>{ if(result && result.data){ - props.showNotification("资料修改成功!") resetUser && resetUser(result.data); } }).catch(error=>{})