diff --git a/src/forge/Branch/SelectOverlay.jsx b/src/forge/Branch/SelectOverlay.jsx index e9c4aae4f..0be567324 100644 --- a/src/forge/Branch/SelectOverlay.jsx +++ b/src/forge/Branch/SelectOverlay.jsx @@ -2,7 +2,7 @@ import React , { useState , useEffect } from 'react'; import { Input , Spin , Menu } from 'antd'; import { getBranch , getTag } from '../GetData/getData'; -function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owner , visible }) { +function SelectOverlay({ changeBranch , tagflag , projectsId , owner , visible }) { const [ inputValue , setInputValue] = useState(undefined); const [ nav , setNav ] = useState(0); const [ isSpin , setIsSpin ] = useState(true); @@ -11,21 +11,13 @@ function SelectOverlay({ changeBranch , tagflag , branchList , projectsId , owne const [ datas , setDatas ] = useState(undefined); const [ keys ,setKeys] = useState("branch"); - // useEffect(()=>{ - // if(visible){ - // setKeys("branch"); - // getBranchs(projectsId,owner); - // setIsSpin(true); - // } - // },[visible]) - useEffect(()=>{ - if(branchList){ - setData(branchList); - setDatas(branchList); - setIsSpin(false); + if(visible){ + setKeys("branch"); + getBranchs(projectsId,owner); + setIsSpin(true); } - },[branchList]) + },[visible]) async function getBranchs(id,owner){ let result = await getBranch(id,owner); diff --git a/src/forge/Component/NoticeModal/SystemNotice.jsx b/src/forge/Component/NoticeModal/SystemNotice.jsx index 917b87c85..1560c1ffc 100644 --- a/src/forge/Component/NoticeModal/SystemNotice.jsx +++ b/src/forge/Component/NoticeModal/SystemNotice.jsx @@ -12,26 +12,15 @@ function SystemNotice({system_notification,history}){ if(system_notification && !cookie.load('notice_stage')){ setVisible(true); } - },[system_notification]) + },[system_notification,history.location]) function sureContinue() { - // if(login && ( system_notification && system_notification.id )){ - // const url = `/users/${login}/system_notification_histories.json`; - // axios.post(url,{ - // system_notification_id:system_notification.id - // }).then(result=>{ - // if(result && result.status === 0){ - // setVisible(false); - // hideSystemNotice(); - // } - // }).catch(error=>{}) - // } - console.log("cookies before:",cookie.load('notice_stage')) ; cookie.remove('notice_stage'); + let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天 // let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟 - cookie.save('notice_stage', true,{ expires: inFifteenMinutes }); - console.log("cookies after:",cookie.load('notice_stage')) ; + cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" }); + setVisible(false); } diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx index 8dd5e4681..f50c134a3 100644 --- a/src/forge/Main/CoderDepot.jsx +++ b/src/forge/Main/CoderDepot.jsx @@ -407,14 +407,14 @@ function CoderDepot(props){ 分支 - {projectDetail && projectDetail.branches && projectDetail.branches.total_count} + {projectDetail && projectDetail.branches_count} 标签 - {projectDetail && projectDetail.tags && projectDetail.tags.total_count} + {projectDetail && projectDetail.tags_count} diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss index 83b4d5ee7..59589fb62 100644 --- a/src/forge/Main/list.scss +++ b/src/forge/Main/list.scss @@ -734,7 +734,9 @@ a.color-grey-ccc:hover{ border: 1px solid rgba(42, 97, 255, 0.23); border-radius: 4px; margin-left: 16px; - align-items: center; + & .treecopy{ + margin-top: 20px; + } & .markdown-body table{ background: #FAFCFF; } diff --git a/src/forge/Main/tree/Index.scss b/src/forge/Main/tree/Index.scss index b077d9de9..f65a1c68f 100644 --- a/src/forge/Main/tree/Index.scss +++ b/src/forge/Main/tree/Index.scss @@ -22,9 +22,14 @@ border-bottom: none; } .treeinfo{ - max-width: 399px; + width: 399px; flex:1; flex-direction: column; + &>a{ + display: block; + width: 399px; + + } a:hover{ span{ color: #466AFF!important; diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js index b766c023e..d7a320099 100644 --- a/src/forge/Merge/CreateMerge.js +++ b/src/forge/Merge/CreateMerge.js @@ -367,7 +367,9 @@ class CreateMerge extends Component { value={pull} onSelect={(e) => this.selectBrach('pull', e)} showSearch - className="merge-flex1 flex1" + className="merge-flex1 flex1 matchwidth" + dropdownMatchSelectWidth={false} + dropdownClassName="overlihide" > {this.renderBrances(pullBranches)} @@ -393,7 +395,9 @@ class CreateMerge extends Component { value={merge} onSelect={(e) => this.selectBrach('merge', e)} showSearch - className="merge-flex1 flex1" + className="merge-flex1 flex1 matchwidth" + dropdownMatchSelectWidth={false} + dropdownClassName="overlihide" > {this.renderBrances(mergeBranches)} diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js index f1afabf90..61477c142 100644 --- a/src/forge/Merge/MergeItem.js +++ b/src/forge/Merge/MergeItem.js @@ -110,7 +110,7 @@ class MergeItem extends Component { {item.is_original ? item.fork_project_user @@ -134,7 +134,7 @@ class MergeItem extends Component { {/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */} {project_author_name}:{item.pull_request_base} diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index e2dabd865..6d01e8a37 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -366,7 +366,7 @@ class MessageCount extends Component { {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head} @@ -381,7 +381,7 @@ class MessageCount extends Component { {data.issue.project_author_name}:{data.pull_request.base} diff --git a/src/forge/Merge/UpdateMerge.js b/src/forge/Merge/UpdateMerge.js index 001bedd57..8918db6eb 100644 --- a/src/forge/Merge/UpdateMerge.js +++ b/src/forge/Merge/UpdateMerge.js @@ -64,12 +64,12 @@ class UpdateMerge extends Component {
源分支:
- {" "} {" "} @@ -83,12 +83,12 @@ class UpdateMerge extends Component {
目标分支 :
{" "} - {" "} {" "} diff --git a/src/forge/Merge/merge.css b/src/forge/Merge/merge.css index 3ea2620cb..d61543b49 100644 --- a/src/forge/Merge/merge.css +++ b/src/forge/Merge/merge.css @@ -40,6 +40,7 @@ form .ant-cascader-picker, form .ant-select { } .merge-header-button{ background:rgba(241,248,255,1); + text-align: left; } .width70{ width:70%; @@ -213,4 +214,12 @@ form .ant-cascader-picker, form .ant-select { .mergeRequest .folders{ /* width: 72rem; */ width: 100%; - } \ No newline at end of file + } + + .matchwidth .ant-select-selection__rendered{ + width: 200px; + } + .overlihide li{ + max-width: 450px; + + } \ No newline at end of file diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx index f897dea19..d9fa1bfac 100644 --- a/src/forge/SecuritySetting/Index.jsx +++ b/src/forge/SecuritySetting/Index.jsx @@ -63,7 +63,7 @@ function Index(props){ {notice_url &&
  • 消息通知
  • -1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}>我的通知
  • - {/*
  • -1 ?"active":""}>通知管理
  • */} +
  • -1 ?"active":""}>通知管理
}
  • 安全设置
  • @@ -73,18 +73,24 @@ function Index(props){ - ( - - )} - > ( )} > + ( + + )} + > + ( + + )} + > ( @@ -103,12 +109,6 @@ function Index(props){ )} > - ( - - )} - > diff --git a/src/forge/SecuritySetting/notice/manager/Index.jsx b/src/forge/SecuritySetting/notice/manager/Index.jsx index ebe84beac..5ba82d60c 100644 --- a/src/forge/SecuritySetting/notice/manager/Index.jsx +++ b/src/forge/SecuritySetting/notice/manager/Index.jsx @@ -1,9 +1,52 @@ -import { Button, Checkbox } from "antd"; -import React from "react"; - +import { Checkbox } from "antd"; +import React, { useEffect, useState } from "react"; +import axios from 'axios'; import './Index.scss'; function NoticeManager(props){ + const {current_user} = props; + + const [settingTypes, setSettingTypes] = useState(); + const [userNotification, setUserNotification] = useState(); + const [userEmail, setUserEmail] = useState(); + + function onChange(type,e,setting){ + let notification_body = userNotification; + let email_body = userEmail; + if(type){//站内信 + notification_body[setting] = e.target.checked; + }else{//邮件 + email_body[setting] = e.target.checked; + } + axios.post(`/users/${current_user.login}/template_message_settings/update_setting.json`,{ + setting:{ + notification_body:notification_body, + email_body:email_body + } + }).then(response=>{ + if(response && response.status === 0){ + getUserSettings(); + } + }) + } + + function getUserSettings(){ + axios.get(`/users/${current_user.login}/template_message_settings.json`).then((response)=>{ + if(response && response.status === 200 ){ + setUserEmail(response.data.email_body); + setUserNotification(response.data.notification_body); + } + }) + } + + useEffect(()=>{ + axios.get("/template_message_settings.json").then(response => { + if (response && response.status === 200) { + setSettingTypes(response.data.setting_types); + } + }) + getUserSettings(); + },[]) return(
    @@ -12,87 +55,23 @@ function NoticeManager(props){
    您可以通过通知管理来选择接受通知的方式 -
    - 我创建或负责的 -
    -
    -
    易修状态变更
    - 站内信 - 邮件 -
    -
    -
    易修截止日期到达最后一天
    - 站内信 - 邮件 -
    -
    -
    合并请求状态变更
    - 站内信 - 邮件 -
    -
    -
    易修有新的评论
    - 站内信 - 邮件 -
    -
    -
    合并请求有新的评论
    - 站内信 - 邮件 -
    - -
    - 我管理的仓库 -
    -
    -
    被关注
    - 站内信 - 邮件 -
    -
    -
    被点赞
    - 站内信 - 邮件 -
    -
    -
    被复刻
    - 站内信 - 邮件 -
    -
    -
    有新的里程碑
    - 站内信 - 邮件 -
    - -
    - 我关注的仓库 -
    -
    -
    被删除
    - 站内信 - 邮件 -
    -
    -
    被转移
    - 站内信 - 邮件 -
    -
    -
    有新的易修
    - 站内信 - 邮件 -
    -
    -
    有新的合并请求
    - 站内信 - 邮件 -
    -
    -
    有新的版本发布
    - 站内信 - 邮件 -
    + {settingTypes && userNotification && userEmail && settingTypes.map((item,key)=>{ + return( + item.type_name &&
    +
    {item.type_name}
    + {item.settings.map((i, k) => { + const setting = item.type.substring(item.type.indexOf("::")+2)+"::"+i.key; + return ( +
    +
    {i.name}
    + {onChange(true,e,setting)}}>站内信 + {onChange(false,e,setting)}}>邮件 +
    + ) + })} +
    + ) + })}
) diff --git a/src/forge/users/Material/Base.jsx b/src/forge/users/Material/Base.jsx index f9707ab0d..61a9d6f1c 100644 --- a/src/forge/users/Material/Base.jsx +++ b/src/forge/users/Material/Base.jsx @@ -11,7 +11,6 @@ export default Form.create()( const { getFieldDecorator, validateFields , setFieldsValue } = props && props.form; // const { username } = props && props.match && props.match.params; const { resetUserInfo , current_user } = props; - console.log(props); useEffect(()=>{ if(current_user && current_user.login){