From b948fe9459767c92583247d6612aa28f40ca5d9f Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Tue, 8 Jun 2021 14:56:00 +0800
Subject: [PATCH] issue
---
src/forge/Head/Header.js | 2 +-
src/forge/users/GeneralView/ConcentrateBox.jsx | 1 -
src/forge/users/GeneralView/ConcentrateProject.jsx | 3 +++
src/forge/users/Infos.js | 12 +++++++++---
src/forge/users/Material/Base.jsx | 11 ++++++-----
src/forge/users/Team.jsx | 3 +--
src/modules/tpm/TPMIndexHOC.js | 1 +
7 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/forge/Head/Header.js b/src/forge/Head/Header.js
index 5901bef0..206ff7b9 100644
--- a/src/forge/Head/Header.js
+++ b/src/forge/Head/Header.js
@@ -564,7 +564,7 @@ class NewHeader extends Component {
- - {this.props.current_user.username}
+ - {this.props.current_user.username}
{
settings && settings.personal && settings.personal.length > 0 && settings.personal.map((item,key)=>{
return(
diff --git a/src/forge/users/GeneralView/ConcentrateBox.jsx b/src/forge/users/GeneralView/ConcentrateBox.jsx
index 4c0b2afc..3ee94194 100644
--- a/src/forge/users/GeneralView/ConcentrateBox.jsx
+++ b/src/forge/users/GeneralView/ConcentrateBox.jsx
@@ -2,7 +2,6 @@ import React, { useEffect, useState } from 'react';
import { Modal , Checkbox , Spin , Input } from 'antd';
import Axios from 'axios';
import { Link } from 'react-router-dom';
-import { values } from 'lodash';
const { Search } = Input;
const limit = 20;
diff --git a/src/forge/users/GeneralView/ConcentrateProject.jsx b/src/forge/users/GeneralView/ConcentrateProject.jsx
index 0d15cb32..bfcf290d 100644
--- a/src/forge/users/GeneralView/ConcentrateProject.jsx
+++ b/src/forge/users/GeneralView/ConcentrateProject.jsx
@@ -30,6 +30,9 @@ function ConcentrateProject({userLogin,current}) {
}
function onSure(is_pinned_project_ids) {
+ if(is_pinned_project_ids && is_pinned_project_ids.length===0){
+ setValue([]);
+ }
const url = `/users/${userLogin}/is_pinned_projects/pin.json`;
axios.post(url,{
is_pinned_project_ids
diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js
index 3701c1be..a415b3d5 100644
--- a/src/forge/users/Infos.js
+++ b/src/forge/users/Infos.js
@@ -183,11 +183,17 @@ class Infos extends Component {
this.props.history.push(`/users/${user && user.login}/organizes`)
}
+ resetUser=()=>{
+ const { resetUserInfo } = this.props;
+
+ this.fetchUser();
+ resetUserInfo && resetUserInfo();
+ }
+
render() {
- const { current_user, mygetHelmetapi } = this.props;
+ const { current_user, mygetHelmetapi , resetUserInfo } = this.props;
const { username } = this.props.match.params;
const { user, isSpin, project_type, route_type , undo_events , undo_messages , menuKey } = this.state;
-
return (
@@ -336,7 +342,7 @@ class Infos extends Component {
{
- return ;
+ return ;
}}
>
{
const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form;
const { username } = props && props.match && props.match.params;
- const { user , resetUser } = props;
+ const { user , resetUser , current_user } = props;
+
useEffect(()=>{
- if(user && user.login){
+ if(current_user && current_user.login){
setFieldsValue({
- ...user,
- location:user.province && [user.province,user.city]
+ ...current_user,
+ location:current_user.province && [current_user.province,current_user.city]
})
}
- },[user])
+ },[current_user])
function submit() {
validateFields((error,values)=>{
diff --git a/src/forge/users/Team.jsx b/src/forge/users/Team.jsx
index 31b34d3e..9378106e 100644
--- a/src/forge/users/Team.jsx
+++ b/src/forge/users/Team.jsx
@@ -1,7 +1,6 @@
import React , { useEffect , useState } from 'react';
import { Dropdown, Menu , Pagination } from 'antd';
-import { Link } from 'react-router-dom';
import Search from '../Component/Search';
import Item from './Team-item';
import Nodata from '../Nodata';
@@ -15,7 +14,7 @@ function Team(props){
const [ sort_direction , setSort_direction ] = useState("asc");
const [ sort_by ,setSort_by ] = useState("created_at");
const [ search ,setSearch ] = useState(undefined);
- console.log(props);
+
const { username } = props.match.params;
useEffect(()=>{
if(username){
diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js
index 654ed8e5..271afff9 100644
--- a/src/modules/tpm/TPMIndexHOC.js
+++ b/src/modules/tpm/TPMIndexHOC.js
@@ -215,6 +215,7 @@ export function TPMIndexHOC(WrappedComponent) {
const common = {
showLoginDialog: this.showLoginDialog,
checkIfLogin: this.checkIfLogin,
+ resetUserInfo:this.fetchUsers
};
return (