diff --git a/src/forge/Main/list.scss b/src/forge/Main/list.scss
index 83b4d5ee..59589fb6 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/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx
index f897dea1..d9fa1bfa 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 ebe84bea..5ba82d60 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 f9707ab0..61a9d6f1 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){