Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev
This commit is contained in:
commit
7b180560a6
|
@ -2456,7 +2456,7 @@ a.hoverLine:hover{
|
||||||
|
|
||||||
|
|
||||||
.color-grey-9 {
|
.color-grey-9 {
|
||||||
color: #333333 !important;
|
color: #999 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover{
|
a:hover{
|
||||||
|
|
|
@ -367,7 +367,6 @@ class NewHeader extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
let search_url = settings && settings.common && settings.common.search;
|
let search_url = settings && settings.common && settings.common.search;
|
||||||
let notice_url = settings && settings.common && settings.common.notice;
|
|
||||||
return (
|
return (
|
||||||
<div className="newHeaders" id="nHeader">
|
<div className="newHeaders" id="nHeader">
|
||||||
<div className="headerContent">
|
<div className="headerContent">
|
||||||
|
@ -438,7 +437,7 @@ class NewHeader extends Component {
|
||||||
</Dropdown>:""
|
</Dropdown>:""
|
||||||
}
|
}
|
||||||
|
|
||||||
{current_user && current_user.login ?
|
{ (settings && settings.common && settings.common.notice) && (current_user && current_user.login)?
|
||||||
<Popover
|
<Popover
|
||||||
overlayClassName="notice-popover"
|
overlayClassName="notice-popover"
|
||||||
placement={`bottomRight`}
|
placement={`bottomRight`}
|
||||||
|
@ -448,9 +447,9 @@ class NewHeader extends Component {
|
||||||
destroyTooltipOnHide
|
destroyTooltipOnHide
|
||||||
>
|
>
|
||||||
<Link to={"/settings/notice"} className="message-icon">
|
<Link to={"/settings/notice"} className="message-icon">
|
||||||
<Badge count={current_user.message_unread_total}>
|
{current_user && <Badge count={current_user.message_unread_total}>
|
||||||
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
|
<i className="iconfont icon-xiaoxilingdang color-grey-6 ml15 mr15"></i>
|
||||||
</Badge>
|
</Badge>}
|
||||||
</Link>
|
</Link>
|
||||||
</Popover>
|
</Popover>
|
||||||
: ""
|
: ""
|
||||||
|
|
|
@ -43,8 +43,9 @@ const PrivateLetter = Loadable({
|
||||||
});
|
});
|
||||||
|
|
||||||
function Index(props){
|
function Index(props){
|
||||||
const { current_user } = props;
|
const { current_user,mygetHelmetapi } = props;
|
||||||
const { pathname } = props.location;
|
const { pathname } = props.location;
|
||||||
|
const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<div className="newMain clearfix whiteBack">
|
<div className="newMain clearfix whiteBack">
|
||||||
|
@ -59,11 +60,11 @@ function Index(props){
|
||||||
<li>个人信息</li>
|
<li>个人信息</li>
|
||||||
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i><span className="text-shodow-bold">基本资料</span></Link></li>
|
<li className={pathname.indexOf("/settings/profile")>-1 ?"active":""}><Link to={`/settings/profile`}><i className="iconfont icon-gerenziliao mr5 font-14"></i><span className="text-shodow-bold">基本资料</span></Link></li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul className="securityUl ul-border-buttom">
|
{notice_url && <ul className="securityUl ul-border-buttom">
|
||||||
<li>消息通知</li>
|
<li>消息通知</li>
|
||||||
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={"/settings/notice"}><i className="iconfont icon-wodetongzhi"></i><span className="text-shodow-bold">我的通知</span></Link></li>
|
<li className={(pathname.indexOf("/settings/notice")>-1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}><Link to={"/settings/notice"}><i className="iconfont icon-wodetongzhi"></i><span className="text-shodow-bold">我的通知</span></Link></li>
|
||||||
{/* <li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli"></i><span className="text-shodow-bold">通知管理</span></Link></li> */}
|
{/* <li className={pathname.indexOf("/settings/notice/config")>-1 ?"active":""}><Link to={'/settings/notice/config'}><i className="iconfont icon-tongzhiguanli"></i><span className="text-shodow-bold">通知管理</span></Link></li> */}
|
||||||
</ul>
|
</ul>}
|
||||||
<ul className="securityUl">
|
<ul className="securityUl">
|
||||||
<li>安全设置</li>
|
<li>安全设置</li>
|
||||||
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i><span className="text-shodow-bold">SSH密钥</span></Link></li>
|
<li className={pathname.indexOf("/settings/SSH")>-1 ?"active":""}><Link to={`/settings/SSH`}><i className="iconfont icon-xuanzhongssh_icon mr5 font-14"></i><span className="text-shodow-bold">SSH密钥</span></Link></li>
|
||||||
|
|
|
@ -9,10 +9,9 @@ import './Index.scss';
|
||||||
import '../manager/Index.scss'
|
import '../manager/Index.scss'
|
||||||
|
|
||||||
function MyNotice(props) {
|
function MyNotice(props) {
|
||||||
let current_user = props.current_user;
|
let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props;
|
||||||
let resetUserInfo = props.resetUserInfo;
|
|
||||||
//消息悬停框选择tab
|
//消息悬停框选择tab
|
||||||
let popover = props.location.query && props.location.query.noticeType;
|
let popover = location && location.query && location.query.noticeType;
|
||||||
let pageSize = 15;
|
let pageSize = 15;
|
||||||
const [noticeType, setNoticeType] = useState(popover==="atme"?"2":"0");//消息类别tab栏选择
|
const [noticeType, setNoticeType] = useState(popover==="atme"?"2":"0");//消息类别tab栏选择
|
||||||
const [selectedNum, setSelectedNum] = useState(0);//@我批量删除选择消息条数
|
const [selectedNum, setSelectedNum] = useState(0);//@我批量删除选择消息条数
|
||||||
|
@ -27,6 +26,18 @@ function MyNotice(props) {
|
||||||
const [currentPage, setCurrentPage] = useState(1);//当前页数
|
const [currentPage, setCurrentPage] = useState(1);//当前页数
|
||||||
const [onlyUnread, setOnlyUnread] = useState();
|
const [onlyUnread, setOnlyUnread] = useState();
|
||||||
|
|
||||||
|
//登录情况下,通过地址访问,直接跳转:/settings/profile
|
||||||
|
//未登录情况下,通过地址访问,直接跳转:/explore
|
||||||
|
useEffect(()=>{
|
||||||
|
let notice = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
|
||||||
|
let login = current_user && current_user.login;
|
||||||
|
if(!login){
|
||||||
|
history.push(`/explore`);
|
||||||
|
}else if(!notice){
|
||||||
|
history.push(`/settings/profile`);
|
||||||
|
}
|
||||||
|
},[mygetHelmetapi])
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
popover==="atme" ? setNoticeType("2"):setNoticeType("0");
|
popover==="atme" ? setNoticeType("2"):setNoticeType("0");
|
||||||
},[popover])
|
},[popover])
|
||||||
|
@ -46,7 +57,7 @@ function MyNotice(props) {
|
||||||
limit: pageSize,
|
limit: pageSize,
|
||||||
page: currentPage,
|
page: currentPage,
|
||||||
};
|
};
|
||||||
axios.get(`/users/${current_user.login}/messages.json`, {
|
current_user && axios.get(`/users/${current_user.login}/messages.json`, {
|
||||||
params: params,
|
params: params,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if(response && response.data){
|
if(response && response.data){
|
||||||
|
@ -59,7 +70,7 @@ function MyNotice(props) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function readNotice(id){
|
function readNotice(id){
|
||||||
if(id){
|
if(id && current_user){
|
||||||
const params = {
|
const params = {
|
||||||
type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
|
type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
|
||||||
ids:id,
|
ids:id,
|
||||||
|
|
|
@ -161,12 +161,12 @@ class Setting extends Component {
|
||||||
loading:false
|
loading:false
|
||||||
})
|
})
|
||||||
this.props.showNotification(`仓库信息修改成功!`);
|
this.props.showNotification(`仓库信息修改成功!`);
|
||||||
// if(values.project_identifier !== projectsId){
|
if(values.project_identifier !== projectsId){
|
||||||
// this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
|
this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
|
||||||
// }else{
|
}else{
|
||||||
// }
|
|
||||||
const { getDetail } = this.props;
|
const { getDetail } = this.props;
|
||||||
getDetail && getDetail();
|
getDetail && getDetail();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
@ -288,7 +288,9 @@ class Setting extends Component {
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</div>
|
</div>
|
||||||
{/* <Form.Item label="项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)">
|
<Form.Item
|
||||||
|
label={<span>项目标识 <span className="color-grey-9">(项目url标识部分,更改项目标识将导致原仓库地址失效)</span></span>}
|
||||||
|
>
|
||||||
{getFieldDecorator("project_identifier", {
|
{getFieldDecorator("project_identifier", {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
|
@ -299,7 +301,7 @@ class Setting extends Component {
|
||||||
})(
|
})(
|
||||||
<Input placeholder="项目标识请使用与项目相关的英文关键字" maxLength="100" />
|
<Input placeholder="项目标识请使用与项目相关的英文关键字" maxLength="100" />
|
||||||
)}
|
)}
|
||||||
</Form.Item> */}
|
</Form.Item>
|
||||||
<Form.Item label="项目简介">
|
<Form.Item label="项目简介">
|
||||||
{getFieldDecorator("project_description", {
|
{getFieldDecorator("project_description", {
|
||||||
rules: [],
|
rules: [],
|
||||||
|
|
Loading…
Reference in New Issue