目标分支 :
{" "}
- {" "}
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){