Merge branch 'pre_develop_dev' of https://git.trustie.net/Gitlink/forgeplus-react into testdev

This commit is contained in:
hucong 2021-10-14 09:38:00 +08:00
commit 7b180560a6
5 changed files with 32 additions and 19 deletions

View File

@ -2456,7 +2456,7 @@ a.hoverLine:hover{
.color-grey-9 {
color: #333333 !important;
color: #999 !important;
}
a:hover{

View File

@ -367,7 +367,6 @@ class NewHeader extends Component {
}
let search_url = settings && settings.common && settings.common.search;
let notice_url = settings && settings.common && settings.common.notice;
return (
<div className="newHeaders" id="nHeader">
<div className="headerContent">
@ -438,7 +437,7 @@ class NewHeader extends Component {
</Dropdown>:""
}
{current_user && current_user.login ?
{ (settings && settings.common && settings.common.notice) && (current_user && current_user.login)?
<Popover
overlayClassName="notice-popover"
placement={`bottomRight`}
@ -448,9 +447,9 @@ class NewHeader extends Component {
destroyTooltipOnHide
>
<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>
</Badge>
</Badge>}
</Link>
</Popover>
: ""

View File

@ -43,8 +43,9 @@ const PrivateLetter = Loadable({
});
function Index(props){
const { current_user } = props;
const { current_user,mygetHelmetapi } = props;
const { pathname } = props.location;
const notice_url = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.notice;
return(
<div className="newMain clearfix whiteBack">
@ -59,11 +60,11 @@ function Index(props){
<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>
</ul>
<ul className="securityUl ul-border-buttom">
{notice_url && <ul className="securityUl ul-border-buttom">
<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/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">
<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>

View File

@ -9,10 +9,9 @@ import './Index.scss';
import '../manager/Index.scss'
function MyNotice(props) {
let current_user = props.current_user;
let resetUserInfo = props.resetUserInfo;
let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props;
//tab
let popover = props.location.query && props.location.query.noticeType;
let popover = location && location.query && location.query.noticeType;
let pageSize = 15;
const [noticeType, setNoticeType] = useState(popover==="atme"?"2":"0");//tab
const [selectedNum, setSelectedNum] = useState(0);//@
@ -27,6 +26,18 @@ function MyNotice(props) {
const [currentPage, setCurrentPage] = useState(1);//
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(()=>{
popover==="atme" ? setNoticeType("2"):setNoticeType("0");
},[popover])
@ -46,7 +57,7 @@ function MyNotice(props) {
limit: pageSize,
page: currentPage,
};
axios.get(`/users/${current_user.login}/messages.json`, {
current_user && axios.get(`/users/${current_user.login}/messages.json`, {
params: params,
}).then((response) => {
if(response && response.data){
@ -59,7 +70,7 @@ function MyNotice(props) {
}
function readNotice(id){
if(id){
if(id && current_user){
const params = {
type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
ids:id,

View File

@ -161,12 +161,12 @@ class Setting extends Component {
loading:false
})
this.props.showNotification(`仓库信息修改成功!`);
// if(values.project_identifier !== projectsId){
// this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
// }else{
// }
if(values.project_identifier !== projectsId){
this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
}else{
const { getDetail } = this.props;
getDetail && getDetail();
}
}
}).catch((error) => {
console.log(error);
@ -288,7 +288,9 @@ class Setting extends Component {
)}
</Form.Item>
</div>
{/* <Form.Item label=" (url)">
<Form.Item
label={<span>项目标识 <span className="color-grey-9">(项目url标识部分更改项目标识将导致原仓库地址失效)</span></span>}
>
{getFieldDecorator("project_identifier", {
rules: [
{
@ -299,7 +301,7 @@ class Setting extends Component {
})(
<Input placeholder="项目标识请使用与项目相关的英文关键字" maxLength="100" />
)}
</Form.Item> */}
</Form.Item>
<Form.Item label="项目简介">
{getFieldDecorator("project_description", {
rules: [],