网页标题修改-个人主页/组织/项目点赞关注fork列表
This commit is contained in:
parent
311c3d072c
commit
ec47699ef8
|
|
@ -27,6 +27,14 @@ function Index(props){
|
|||
const [ flag , setFlag ] = useState(true);
|
||||
const { current_user } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(user){
|
||||
// 更改网页标题
|
||||
const {username, login} = user;
|
||||
document.title = `${menu === "undo" ? '接收仓库' : '成员申请'}-${username}/${login}`;
|
||||
}
|
||||
},[user, menu])
|
||||
|
||||
useEffect(()=>{
|
||||
if((username && current_user && (current_user.login !== username))){
|
||||
props.history.push(`/${username}`);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export default ((props) => {
|
|||
const [ members , setMembers ] = useState(undefined);
|
||||
const [ group , setGroup ] = useState(undefined);
|
||||
const { OIdentifier, groupId } = props.match.params;
|
||||
const { current_user } = props;
|
||||
const { current_user, organizeDetail } = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(groupId){
|
||||
|
|
@ -42,6 +42,13 @@ export default ((props) => {
|
|||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
if(group && organizeDetail){
|
||||
const {nickname} = organizeDetail;
|
||||
document.title = `${group.nickname}-${nickname}`
|
||||
}
|
||||
}, [organizeDetail, group])
|
||||
|
||||
useEffect(()=>{
|
||||
if(nav === "0"){
|
||||
getMember(OIdentifier, groupId,page);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,19 @@
|
|||
import React from 'react';
|
||||
import React, { useEffect } from 'react';
|
||||
import GroupFrom from './GroupForm'
|
||||
import axios from 'axios';
|
||||
|
||||
function GropNew(props){
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
// 更改网页标签
|
||||
useEffect(()=>{
|
||||
OIdentifier && axios.get(`/organizations/${OIdentifier}.json`).then(result=>{
|
||||
if(result && result.data){
|
||||
const {nickname} = result.data;
|
||||
document.title = `新建团队-${nickname}`
|
||||
}
|
||||
}).catch(error=>{})
|
||||
},[OIdentifier])
|
||||
|
||||
return(
|
||||
<div className="teamDetail">
|
||||
<GroupFrom {...props}></GroupFrom>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,14 @@ function List(props){
|
|||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const organizeDetail = props.organizeDetail;
|
||||
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
// 更改网页标题
|
||||
const {nickname} = organizeDetail;
|
||||
document.title = `${nickname}`
|
||||
}
|
||||
},[organizeDetail])
|
||||
|
||||
useEffect(()=>{
|
||||
if(OIdentifier){
|
||||
setIsSpin(true);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,14 @@ const Hooks = Loadable({
|
|||
export default (( props )=>{
|
||||
const pathname = props.location.pathname;
|
||||
const OIdentifier = props.match.params.OIdentifier;
|
||||
const {organizeDetail} = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
const {nickname} = organizeDetail;
|
||||
document.title = `组织设置-${nickname}`
|
||||
}
|
||||
}, [organizeDetail])
|
||||
|
||||
function returnActive (pathname){
|
||||
let a = 0;
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ function Detail(props){
|
|||
<Route
|
||||
path="/:OIdentifier/teams/:groupId"
|
||||
render={(p) => {
|
||||
return <GroupDetails {...props} {...p} group={detail}/>
|
||||
return <GroupDetails {...props} {...p} organizeDetail={detail}/>
|
||||
}}
|
||||
></Route>
|
||||
{/* 组织成员 */}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,13 @@ export default ((props)=>{
|
|||
}
|
||||
}).catch(error=>{})
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
if(detail){
|
||||
const {nickname, organization} = detail;
|
||||
document.title = `团队设置-${nickname}-${organization.nickname}`
|
||||
}
|
||||
}, [detail])
|
||||
return(
|
||||
<div className="teamDetail" style={{paddingTop:"0px"}}>
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,18 @@
|
|||
import React from 'react';
|
||||
import React, {useEffect} from 'react';
|
||||
import { Banner } from '../Component/layout';
|
||||
import GroupItems from './TeamGroupItems';
|
||||
|
||||
const limit = 14;
|
||||
function TeamGroup({organizeDetail,history,current_user}){
|
||||
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
// 更改网页标题
|
||||
const {nickname} = organizeDetail;
|
||||
document.title = `组织团队-${nickname}`
|
||||
}
|
||||
},[organizeDetail])
|
||||
|
||||
return(
|
||||
<div style={{background:"#fff",marginBottom:"30px",border:'1px solid #eee'}}>
|
||||
<Banner>组织团队</Banner>
|
||||
|
|
|
|||
|
|
@ -20,6 +20,14 @@ function TeamMember({organizeDetail,current_user,history,match}){
|
|||
}
|
||||
},[organizeDetail,page]);
|
||||
|
||||
useEffect(()=>{
|
||||
if(organizeDetail){
|
||||
// 更改网页标题
|
||||
const {nickname} = organizeDetail;
|
||||
document.title = `组织成员-${nickname}`
|
||||
}
|
||||
},[organizeDetail])
|
||||
|
||||
function getData(){
|
||||
setIsSpin(true);
|
||||
const url = `/organizations/${organizeDetail.id}/organization_users.json`;
|
||||
|
|
|
|||
|
|
@ -19,8 +19,21 @@ class ForkUsers extends Component {
|
|||
|
||||
componentDidMount = () => {
|
||||
this.getUsersList();
|
||||
this.updateTitle();
|
||||
};
|
||||
|
||||
componentDidUpdate=()=>{
|
||||
this.updateTitle();
|
||||
}
|
||||
|
||||
updateTitle=()=>{
|
||||
const {projectDetail} = this.props;
|
||||
if(projectDetail){
|
||||
const {author, name} = projectDetail;
|
||||
document.title = `Fork用户-${author.name}/${name}`
|
||||
}
|
||||
}
|
||||
|
||||
getUsersList = (page, limit) => {
|
||||
this.setState({
|
||||
isSpin: true,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,21 @@
|
|||
import React, { Component } from "react";
|
||||
import CommonUsers from "./common_users"
|
||||
class PraiseUsers extends Component {
|
||||
componentDidMount=()=>{
|
||||
this.updateTitle();
|
||||
}
|
||||
componentDidUpdate=()=>{
|
||||
this.updateTitle();
|
||||
}
|
||||
|
||||
updateTitle=()=>{
|
||||
const {projectDetail} = this.props;
|
||||
if(projectDetail){
|
||||
const {author, name} = projectDetail;
|
||||
document.title = `点赞用户-${author.name}/${name}`
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { owner , projectsId } = this.props.match.params;
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -1,6 +1,21 @@
|
|||
import React, { Component } from "react";
|
||||
import CommonUsers from "./common_users"
|
||||
class WatchUsers extends Component {
|
||||
componentDidMount=()=>{
|
||||
this.updateTitle();
|
||||
}
|
||||
componentDidUpdate=()=>{
|
||||
this.updateTitle();
|
||||
}
|
||||
|
||||
updateTitle=()=>{
|
||||
const {projectDetail} = this.props;
|
||||
if(projectDetail){
|
||||
const {author, name} = projectDetail;
|
||||
document.title = `关注用户-${author.name}/${name}`
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
const { owner , projectsId } = this.props.match.params;
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -32,7 +32,18 @@ function Index(props) {
|
|||
|
||||
const username = props.match.params.username;
|
||||
const current_user = props.current_user;
|
||||
const user = props.user;
|
||||
const {menuKey, user} = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(user){
|
||||
const {username, login} = user;
|
||||
if(menuKey === '0'){
|
||||
document.title = `${username}(${login})`
|
||||
}else{
|
||||
document.title = `个人简介-${username}/${login}`
|
||||
}
|
||||
}
|
||||
},[menuKey])
|
||||
|
||||
useEffect(()=>{
|
||||
if(user){
|
||||
|
|
@ -97,7 +108,7 @@ function Index(props) {
|
|||
}).catch(error=>{})
|
||||
}
|
||||
return(
|
||||
props && props.menuKey === "0" ?
|
||||
menuKey && menuKey === "0" ?
|
||||
<div>
|
||||
<div>
|
||||
<ConcentrateProject
|
||||
|
|
|
|||
|
|
@ -25,10 +25,12 @@ class InfosUser extends Component {
|
|||
}
|
||||
|
||||
componentDidMount = () => {
|
||||
this.updateTitle();
|
||||
this.get_projects();
|
||||
};
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
this.updateTitle();
|
||||
const { username } = this.props.match.params;
|
||||
const prevUser = prevProps.match.params.username;
|
||||
if (prevProps.project_type !== this.props.project_type || (prevUser && username && prevUser !== username)) {
|
||||
|
|
@ -36,6 +38,15 @@ class InfosUser extends Component {
|
|||
}
|
||||
};
|
||||
|
||||
// 更改网页标题
|
||||
updateTitle=()=>{
|
||||
const {user} = this.props;
|
||||
if(user){
|
||||
const {username, login} = user;
|
||||
document.title = `参与项目-${username}/${login}`
|
||||
}
|
||||
}
|
||||
|
||||
get_projects = (isPublic) => {
|
||||
const { username } = this.props.match.params;
|
||||
const { project_type } = this.props;
|
||||
|
|
|
|||
|
|
@ -30,11 +30,19 @@ function Index(props) {
|
|||
|
||||
const [ cData, setCData ] = useState(undefined);
|
||||
const [ cloudData, setCloudData ] = useState(undefined);
|
||||
const {user} = props;
|
||||
|
||||
const disabledDate = current => {
|
||||
return current && current > moment().endOf('day');
|
||||
};
|
||||
|
||||
useEffect(()=>{
|
||||
if(user){
|
||||
const {username, login} = user;
|
||||
document.title = `数据统计-${username}/${login}`
|
||||
}
|
||||
}, [])
|
||||
|
||||
// 获取角色定位接口数据
|
||||
useEffect(()=>{
|
||||
getRoleSta();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,16 @@ function Team(props){
|
|||
const [ search ,setSearch ] = useState(undefined);
|
||||
const { checkIfLogin , showLoginDialog , current_user } = props;
|
||||
const { username } = props.match.params;
|
||||
const {user} = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(user){
|
||||
// 更改网页标题
|
||||
const {username, login} = user;
|
||||
document.title = `参与组织-${username}/${login}`;
|
||||
}
|
||||
},[user])
|
||||
|
||||
useEffect(()=>{
|
||||
if(username){
|
||||
getList(search);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,15 @@ import CIList from './CIList';
|
|||
|
||||
function DevOpsCI(props){
|
||||
const [ selectKey , setSelectKey ] = useState("dispose");
|
||||
const {user} = props;
|
||||
|
||||
useEffect(()=>{
|
||||
if(user){
|
||||
// 更改网页标题
|
||||
const {username, login} = user;
|
||||
document.title = `DevOps引擎-${username}/${login}`;
|
||||
}
|
||||
},[user])
|
||||
|
||||
function changeKeys(e){
|
||||
setSelectKey(e.key);
|
||||
|
|
|
|||
Loading…
Reference in New Issue