showDown(item.flag,key,item.isBin)}>
+
+
- {!item.isBin ? :""}
-
- {item.name}
+ {!item.isBin ? showDown(item.flag,key,item.isBin)}>:""}
+ showDown(item.flag,key,item.isBin)}>{item.name}
+ setCopyfileTipTitle("复制文件路径")}
+ >
+ copyFileName(item.name)}>
+
-
-
- +{item.addition}
- -{item.deletion}
-
+
+
0 ? ":":""} ${item.addition > 0 ? item.addition + "处添加" : ""}${item.addition > 0 && item.deletion > 0 ? "和" : ""}${item.deletion > 0 ? item.deletion + "处删除" : ""}`}>
+
+ {item.addition+item.deletion}处
+
+ {
+ !item.isSubmodule &&
+
{history.push(`/${owner}/${projectsId}${item.isDeleted ? `/commits/${truncateCommitId(parentsSha)}`:`/tree/${truncateCommitId(item.sha)}/${item.name}`}`)}}>查看文件
+ }
+
{
item.sections && item.sections.length >= 1 && !item.flag &&
diff --git a/src/forge/Merge/Index.scss b/src/forge/Merge/Index.scss
index 936b868f..16cc9563 100644
--- a/src/forge/Merge/Index.scss
+++ b/src/forge/Merge/Index.scss
@@ -18,4 +18,86 @@
.pr_tags_closed{
border:1px solid #FA6400;
color: #FA6400;
+}
+.update-file-count{
+ cursor: pointer;
+ & .color-grey-3{
+ font-weight: bold;
+ }
+}
+.fileList{
+ .sc-bxivhb{
+ width: 55rem;
+ overflow: hidden;
+ white-space: normal;
+ word-break: break-all;
+ }
+ .see-file{
+ width: 14rem;
+ .ml10{
+ display: inline-block;
+ width: 4.5rem;
+ cursor: default;
+ }
+ span{
+ width: 7%;
+ }
+ }
+ .anchorPoint{
+ position: relative;
+ top: -5rem;
+ display: block;
+ height: 0;
+ }
+}
+.filesInfo{
+ background: #FAFCFF;
+ border-color:rgba(42, 97, 255, 0.23);
+ .ant-progress-line {
+ width: 5rem;
+ }
+ .ant-progress-inner{
+ background-color: #D14A4A;
+ }
+}
+.folders,.ant-anchor{
+ margin-left: 0;
+ padding-left: 0;
+}
+.folders{
+ position: absolute;
+ z-index: 2;
+ left: 0px;
+ top: 37px;
+ color: #333333;
+ width: 75rem;
+ box-shadow: 0px 4px 8px 2px rgba(212, 212, 212, 0.5);
+ border-radius: 4px;
+ border: 1px solid rgba(153, 153, 153, 0.32);
+ .ant-anchor-link-active > .ant-anchor-link-title {
+ color: #466AFF;
+ }
+ .ant-anchor-link {
+ padding: 0px;
+ }
+ .folderList{
+ max-height: 275px;
+ overflow:auto;
+ .files{
+ border: 0px;
+ }
+ .filesInfo {
+ padding: 10px 18px 10px 15px;
+ height: 55px;
+ background: #FFF;
+ border-bottom: 1px solid #EEEEEE;
+ &:hover{
+ background: #F3F4F6;
+ }
+ .color-green,.color-red{
+ width: 3%;
+ text-align: right;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/src/forge/Merge/MergeDetail.js b/src/forge/Merge/MergeDetail.js
index a7e2f33e..11bd3858 100644
--- a/src/forge/Merge/MergeDetail.js
+++ b/src/forge/Merge/MergeDetail.js
@@ -228,7 +228,7 @@ class MergeDetail extends Component {
{
data && data.issue.user_permission ?
- 编辑
+ 编辑
: ''
}
@@ -248,8 +248,8 @@ class MergeDetail extends Component {
- - 0 ? "active" : ""}>对话内容
- - 0 ? "active" : ""}>代码提交
+ - 0 ? "active" : ""}>对话内容
+ - 0 ? "active" : ""}>代码提交
diff --git a/src/forge/Merge/MergeItem.js b/src/forge/Merge/MergeItem.js
index 32f3f811..61477c14 100644
--- a/src/forge/Merge/MergeItem.js
+++ b/src/forge/Merge/MergeItem.js
@@ -49,7 +49,7 @@ class MergeItem extends Component {
};
render() {
- const { issues, project_name, project_author_name , user_admin_or_member} = this.props;
+ const { issues, project_name, project_author_name , user_admin_or_developer} = this.props;
const { projectsId , owner } = this.props.match.params;
const { current_user } = this.props;
const renderList = () => {
@@ -62,9 +62,9 @@ class MergeItem extends Component {
{item.name}
@@ -78,7 +78,7 @@ class MergeItem extends Component {
{item && item.author_name}
@@ -109,8 +109,8 @@ class MergeItem extends Component {
item.pull_request_head &&
{item.is_original
? item.fork_project_user
@@ -133,8 +133,8 @@ class MergeItem extends Component {
item.pull_request_base &&
{/* {item.is_fork ? item.pull_request_base : `${item.author_name}:${item.pull_request_base}`} */}
{project_author_name}:{item.pull_request_base}
@@ -156,7 +156,7 @@ class MergeItem extends Component {
{item.assign_user_name ? (
{item.assign_user_name}
@@ -175,7 +175,7 @@ class MergeItem extends Component {
{item.journals_count ? (
{item.journals_count}
@@ -183,7 +183,7 @@ class MergeItem extends Component {
) : (
""
)}
- {user_admin_or_member && item.pull_request_status === 0 ? (
+ {user_admin_or_developer && item.pull_request_status === 0 ? (
diff --git a/src/forge/Merge/MergeLinkFooter.jsx b/src/forge/Merge/MergeLinkFooter.jsx
new file mode 100644
index 00000000..2c9aa481
--- /dev/null
+++ b/src/forge/Merge/MergeLinkFooter.jsx
@@ -0,0 +1,210 @@
+import React, { Component } from 'react';
+import { Tabs, Spin } from 'antd';
+import { Link } from 'react-router-dom';
+import axios from 'axios';
+
+import Commits from './Commits';
+import Comments from '../comments/comments';
+import Files from './Files';
+
+import '../Order/order.css';
+import './merge.css';
+
+const { TabPane } = Tabs;
+
+class MergeFooter extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commitsData: [],
+ filesData: undefined,
+ isSpin: false,
+ activeKey: '1',
+ commitCount: 0,
+ filesCount: 0,
+ // 总评论数量,包含回复
+ commentsTotalCount: 0,
+ };
+ }
+ componentDidMount() {
+ this.Init();
+ // 为父组件绑定当前,以方便调用方法
+ this.props.bindFootRef && this.props.bindFootRef(this);
+ }
+
+ componentDidUpdate(prevProps) {
+ // 解决切换tab后浏览器回退不刷新的问题、点击tab后url变化但tab未切换的问题
+ const newPathname = this.props.location.pathname;
+ const prevPathname = prevProps.location.pathname;
+ if (newPathname !== prevPathname) {
+ this.Init(true);
+ }
+ }
+
+ Init = (isTabChange) => {
+ const { data, location, match } = this.props;
+ const { pathname } = location;
+ const { projectsId, owner, mergeId } = match.params;
+
+ let activeKey = '1';
+ if (pathname.indexOf('commits') > -1) {
+ activeKey = '2';
+ this.getCommit(owner, projectsId, mergeId);
+ } else if (pathname.indexOf('files') > -1) {
+ activeKey = '3';
+ this.getFile(owner, projectsId, mergeId);
+ }
+ if (isTabChange && activeKey === '1') {
+ this.refreshComment();
+ }
+ this.setState({
+ activeKey: activeKey,
+ commitCount: data && data.commits_count,
+ filesCount: data && data.files_count,
+ });
+ };
+
+ bindCommentRef = (commentRef) => {
+ this.childComment = commentRef;
+ }
+
+ refreshComment = () => {
+ this.childComment && this.childComment.getjournalslist();
+ }
+
+ getCommit = (owner, projectsId, mergeId) => {
+ this.setState({ isSpin: true });
+ const url = `/${owner}/${projectsId}/pulls/${mergeId}/commits.json`;
+ axios
+ .get(url)
+ .then((result) => {
+ if (result) {
+ this.setState({
+ commitsData: result.data.commits,
+ commitCount: result.data.commits_count,
+ });
+ }
+ this.setState({ isSpin: false });
+ })
+ .catch((error) => {
+ this.setState({ isSpin: false });
+ });
+ };
+
+ getFile = (owner, projectsId, mergeId) => {
+ this.setState({ isSpin: true });
+ const url = `/${owner}/${projectsId}/pulls/${mergeId}/files.json`;
+ axios
+ .get(url)
+ .then((result) => {
+ if (result) {
+ this.setState({
+ filesData: result.data,
+ filesCount: result.data.files_count,
+ });
+ }
+ this.setState({ isSpin: false });
+ })
+ .catch((error) => {
+ this.setState({ isSpin: false });
+ });
+ };
+
+ render() {
+ const { projectsId, owner, mergeId } = this.props.match.params;
+
+ const { order_id, data = {} } = this.props;
+ const {
+ isSpin,
+ activeKey,
+ filesCount,
+ commitCount,
+ filesData,
+ commitsData = [],
+ } = this.state;
+
+ // 评论数量优先取Comment组件中列表接口返回的,其次取合并请求详情接口中的,都没有取默认值0
+ const commentsTotalCount = parseInt(
+ this.state.commentsTotalCount || data.comments_total_count || 0,
+ 10
+ );
+
+ return (
+
+
+
+
+ 评论
+ {commentsTotalCount > 0 && (
+ {commentsTotalCount}
+ )}
+
+ }
+ key="1"
+ >
+ {
+ this.setState({ commentsTotalCount: commentsCount || 0 });
+ }}
+ {...this.props}
+ bindCommentRef={this.bindCommentRef}
+ />
+
+ {commitCount > 0 && (
+
+ 提交
+ {commitCount > 0 && (
+ {commitCount}
+ )}
+
+ }
+ key="2"
+ >
+ {commitsData.length > 0 && (
+
+ )}
+
+ )}
+ {filesCount > 0 && (
+
+ 文件
+ {filesCount > 0 && (
+ {filesCount}
+ )}
+
+ }
+ key="3"
+ >
+
+
+ )}
+
+
+
+ );
+ }
+}
+export default MergeFooter;
diff --git a/src/forge/Merge/MergeSubmit.js b/src/forge/Merge/MergeSubmit.js
index 8f2275d8..d4b42c3b 100644
--- a/src/forge/Merge/MergeSubmit.js
+++ b/src/forge/Merge/MergeSubmit.js
@@ -100,7 +100,7 @@ class MergeSubmit extends Component{
width:"10%",
render: (text,item) => (
-
+
@@ -110,7 +110,7 @@ class MergeSubmit extends Component{
title:"SHA",
dataIndex: 'sha',
render: (text) => (
- {text}
+ {text}
)
},{
title:"备注",
diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js
index f3e58657..6d01e8a3 100644
--- a/src/forge/Merge/MessageCount.js
+++ b/src/forge/Merge/MessageCount.js
@@ -1,7 +1,6 @@
import React, { Component } from "react";
import { Tabs } from 'antd';
import { Link } from "react-router-dom";
-import { AlignCenter } from '../Component/layout';
import axios from "axios";
import { getImageUrl } from "educoder";
import {
@@ -11,7 +10,6 @@ import {
Dropdown,
Icon,
Menu,
- Select,
Tag,
Button,
Alert,
@@ -19,9 +17,8 @@ import {
import "./merge.css";
import RenderHtml from "../../components/render-html";
import "../Order/order.css";
-import MergeFooter from "./merge_footer";
+import MergeLinkFooter from "./MergeLinkFooter";
-const Option = Select.Option;
const TextArea = Input.TextArea;
function turnbar(str){
@@ -61,6 +58,11 @@ class MessageCount extends Component {
// this.clickBody();
};
+
+ bindFootRef = (footRef) => {
+ this.footRef = footRef;
+ }
+
clickBody=()=>{
document.body.addEventListener('click', e => {
let name = e.target.className;
@@ -150,6 +152,8 @@ class MessageCount extends Component {
});
const { getDetail } = this.props;
getDetail && getDetail();
+ // 调用子组件的方法刷新评论列表
+ this.footRef && this.footRef.refreshComment();
} else {
this.setState({ SpinMerge: false });
}
@@ -283,13 +287,13 @@ class MessageCount extends Component {
conflict_files && conflict_files.length>0 &&
如下文件有代码冲突:
-
+
{
conflict_files.map((i,k)=>{
- return
{i}
+ return
{i}
})
}
-
+
}
@@ -336,11 +340,11 @@ class MessageCount extends Component {
-
-
+
+
-
+
{data.issue.subject}
@@ -361,10 +365,10 @@ class MessageCount extends Component {
- {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {turnbar(data.pull_request && data.pull_request.head)}
+ {data.pull_request.is_original ? data.pull_request.fork_project_user : data.issue.project_author_name}: {data.pull_request && data.pull_request.head}
@@ -376,8 +380,8 @@ class MessageCount extends Component {
{data.issue.project_author_name}:{data.pull_request.base}
@@ -386,14 +390,14 @@ class MessageCount extends Component {
}
-
+
由
-
+
{data.issue.author_name}
@@ -408,7 +412,7 @@ class MessageCount extends Component {
审查人员:
{data.issue.assign_user_name ? (
{data.issue.assign_user_name}
@@ -424,7 +428,7 @@ class MessageCount extends Component {
- 标签:
+ 标记:
{data.issue.issue_tags &&
data.issue.issue_tags.length > 0
@@ -441,14 +445,13 @@ class MessageCount extends Component {
-
-
+
{operate && (
@@ -465,7 +468,6 @@ class MessageCount extends Component {
)}
-
{
data.issue.description ?
@@ -543,7 +545,7 @@ class MessageCount extends Component {
onChange={this.changbodypr}
/>
-
@@ -558,19 +560,19 @@ class MessageCount extends Component {
取消
-
+
)}
-
+ bindFootRef={this.bindFootRef}
+ >
) : (
""
diff --git a/src/forge/Merge/NewMerge.js b/src/forge/Merge/NewMerge.js
index 97df7fb1..900dea82 100644
--- a/src/forge/Merge/NewMerge.js
+++ b/src/forge/Merge/NewMerge.js
@@ -6,6 +6,11 @@ import "./merge.css";
import MergeForm from "./merge_form";
import MergeFooter from "./merge_footer";
const Option = Select.Option;
+/**
+ * 此文件已废弃,新文件为CreateMerge.js
+ * 2021.10.12
+ */
+
class NewMerge extends Component {
constructor(props) {
super(props);
@@ -48,8 +53,10 @@ class NewMerge extends Component {
this.compareProject(this.state.id,pull,"master");
}
}
+
// 页面销毁取消监听
componentWillUnmount () {
+ console.log('----------destoyed---------');
window.removeEventListener('popstate', this.handleBack, false);
};
@@ -60,8 +67,11 @@ class NewMerge extends Component {
//获取新建分支数据
getmergelist = (projectsId) => {
- this.setState({isSpin: true})
- const { owner } = this.props.match.params;
+ this.setState({isSpin: true});
+ // const { owner } = this.props.match.params;
+ let owner =this.props.history.location.pathname.split('/')[1];
+ console.log('owner:'+owner);
+ console.log(this.props);
const url = `/${owner}/${projectsId}/pulls/new.json`;
axios
.get(url)
@@ -105,6 +115,7 @@ class NewMerge extends Component {
const { author , identifier } =oldProject;
url += `/${mergeBranch}...${author && author.login}/${identifier}:${localBranch}.json`;
}
+ this.setState({isSpin: true});
axios.get(url).then(result=>{
if(result){
if (result.data.status === 0) {
@@ -123,7 +134,9 @@ class NewMerge extends Component {
comparesData:result.data
})
}
- }).catch(error=>{})
+ }).catch(error=>{
+ this.setState({isSpin: false});
+ })
}
}
@@ -186,7 +199,7 @@ class NewMerge extends Component {
// this.ischeckmerge();
let { id ,merge , pull } = this.state;
if(type==="pull"){
- this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new/${pull}`)
+ this.props.history.push(`/${owner}/${projectsId}/compare/${pull}`)
this.compareProject(id,value,merge);
}else{
this.compareProject(id,pull,value);
@@ -208,7 +221,7 @@ class NewMerge extends Component {
merge_user_login: is_fork_id ? projects_names[0].project_user_login : undefined
}
})
- this.props.history.push(`/projects/${login}/${identifier}/pulls/new`);
+ this.props.history.push(`/${login}/${identifier}/compare`);
this.newMergelist(login,identifier);
};
@@ -264,7 +277,9 @@ class NewMerge extends Component {
show_message,
default_message,
merge_head,
- projects_names,id,comparesData
+ projects_names,
+ id,
+ comparesData
} = this.state;
const renderBrances = (list, type) => {
@@ -298,6 +313,7 @@ class NewMerge extends Component {
return
;
};
let { project } = this.props;
+
return (
diff --git a/src/forge/Merge/UpdateMerge.js b/src/forge/Merge/UpdateMerge.js
index 8ed8034a..8918db6e 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 {
目标分支 :
{" "}
-
+
{`${data.project_author}/${data.project_name}`}
{" "}
{" "}
diff --git a/src/forge/Merge/merge.css b/src/forge/Merge/merge.css
index 6b50eeb1..d61543b4 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%;
@@ -152,13 +153,23 @@ form .ant-cascader-picker, form .ant-select {
margin-top: 15px;
border-radius: 2px;
}
+.see-file-btn{
+ color: #466AFF;
+ cursor: pointer;
+}
.filesInfo{
padding:10px 15px;
background-color: #fafafa;
}
+.filesInfo .cursor-pointer{
+ cursor: pointer;
+}
.filesContent{
border-top: 1px solid #ddd;
}
+.icon-fuzhiicon:hover{
+ color: #466AFF;
+}
.linesContent{
display: flex;
min-height: 30px;
@@ -198,4 +209,17 @@ form .ant-cascader-picker, form .ant-select {
}
.linesContent.add{
background: rgba(48, 232, 132, 0.15);
-}
\ No newline at end of file
+}
+
+.mergeRequest .folders{
+ /* width: 72rem; */
+ width: 100%;
+ }
+
+ .matchwidth .ant-select-selection__rendered{
+ width: 200px;
+ }
+ .overlihide li{
+ max-width: 450px;
+
+ }
\ No newline at end of file
diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js
index 90e35dcc..8a0eaede 100644
--- a/src/forge/Merge/merge.js
+++ b/src/forge/Merge/merge.js
@@ -4,10 +4,11 @@ import "./merge.css";
import "../Order/order.css";
import "../Order/index.scss";
import NoneData from "./no_data";
-import OrderItem from "./MergeItem";
+import MergeItem from "./MergeItem";
import './Index.scss';
import axios from "axios";
+import CheckProfile from '../Component/ProfileModal/Profile';
const Search = Input.Search;
/**
@@ -42,7 +43,7 @@ class merge extends Component {
//设置选择高亮
openselect: 1,
closeselect: undefined,
- issue_tag_ids: "标签",
+ issue_tag_ids: "标记",
fixed_version_ids: "里程碑",
assigned_to_ids: "审查人员",
paix: "排序",
@@ -197,7 +198,7 @@ class merge extends Component {
});
this.setState({
status_type: type,
- issue_tag_ids: "标签",
+ issue_tag_ids: "标记",
fixed_version_ids: "里程碑",
assigned_to_ids: "审查人员",
paix: "排序",
@@ -212,7 +213,7 @@ class merge extends Component {
checkOperation() {
const { projectsId,owner } = this.props.match.params;
- this.props.history.push(`/projects/${owner}/${projectsId}/pulls/new`);
+ this.props.history.push(`/${owner}/${projectsId}/compare/master...master`);
}
render() {
const { projectsId , owner } = this.props.match.params;
@@ -255,10 +256,10 @@ class merge extends Component {
/>
{
- data && data.user_admin_or_member &&
-
this.checkOperation()}>
+ data && data.user_admin_or_developer &&
+ this.checkOperation()}>
+ 新建合并请求
-
+
}
@@ -320,7 +321,7 @@ class merge extends Component {
className="topWrapperSelect"
overlay={this.renderMenu(
issue_chosen && issue_chosen.issue_tag,
- "标签",
+ "标记",
"issue_tag_id"
)}
trigger={["click"]}
@@ -387,7 +388,7 @@ class merge extends Component {
{data && data.search_count && data.search_count > 0 ? (
-
+ user_admin_or_developer={data && data.user_admin_or_developer}
+ >
):""}
{search_count > select_params.limit ? (
diff --git a/src/forge/Merge/merge_footer.js b/src/forge/Merge/merge_footer.js
index 6502827c..868e736f 100644
--- a/src/forge/Merge/merge_footer.js
+++ b/src/forge/Merge/merge_footer.js
@@ -1,169 +1,84 @@
-import React, { Component } from "react";
-import { Tabs, Spin } from "antd";
-import "../Order/order.css";
-import "./merge.css";
-import Commits from "./Commits";
-import Comments from "../comments/comments";
-import Files from "./Files";
-import axios from 'axios';
+import React, { Component } from 'react';
+import { Tabs } from 'antd';
+import Commits from './Commits';
+import Files from './Files';
+
+import '../Order/order.css';
+import './merge.css';
+
const { TabPane } = Tabs;
class MergeFooter extends Component {
- constructor(props){
+ constructor(props) {
super(props);
- this.state={
- pageData:undefined,
- commitsData:undefined,
- filesData:undefined,
- isSpin:false,
- activeKey:"1",
- commitCount:0,
- filesCount:0
- }
- }
- componentDidMount=()=>{
- const { footer_type ,data } = this.props;
- if(footer_type){
- const { projectsId , owner , mergeId } = this.props.match.params;
- this.getCommit(owner,projectsId,mergeId);
- this.getFile(owner,projectsId,mergeId);
- }
- this.setState({
- activeKey:footer_type ? "1" : "2",
- commitCount:data && data.commits_count,
- filesCount:data && data.files_count
- })
- }
- componentDidUpdate=(prevProps)=>{
- const { comparesData } = this.props;
- const { footer_type } = this.props;
- if(footer_type){
- const { data } = this.props;
- if(data !== prevProps.data){
- this.setState({
- commitCount:data && data.commits_count,
- filesCount:data && data.files_count
- })
- }
- }
- if(comparesData !== prevProps.comparesData){
- this.setState({
- activeKey:footer_type ? "1" : "2"
- })
- this.changeTab(footer_type ? "1" : "2");
- }
+ this.state = {
+ activeKey: '1',
+ };
}
- changeTab=(index)=>{
+ changeTab = (index) => {
this.setState({
- isSpin:true
- })
- this.setState({
- activeKey:index
- })
- const { footer_type , comparesData } = this.props;
- const { projectsId , owner , mergeId } = this.props.match.params;
-
- if(footer_type){
- if(index === "2"){
- this.getCommit(owner,projectsId,mergeId);
- }else if(index === "3"){
- this.getFile(owner,projectsId,mergeId);
- }else{
- this.setState({
- isSpin:false
- })
- }
- }else{
- this.setState({
- commitsData:comparesData.commits,
- filesData:comparesData.diff,
- commitCount:comparesData.commits_count,
- filesCount:comparesData.diff && comparesData.diff.files_count,
- isSpin:false
- })
- }
- }
-
- getCommit =(owner,projectsId,mergeId)=>{
- const url = `/${owner}/${projectsId}/pulls/${mergeId}/commits.json`;
- axios.get(url).then(result=>{
- if(result){
- this.setState({
- commitsData:result.data.commits,
- isSpin:false,
- commitCount:result.data.commits_count
- })
- }
- }).catch(error=>{})
- }
-
- getFile =(owner,projectsId,mergeId)=>{
- const url = `/${owner}/${projectsId}/pulls/${mergeId}/files.json`;
- axios.get(url).then(result=>{
- if(result){
- this.setState({
- filesData:result.data,
- isSpin:false,
- filesCount:result.data.files_count,
- })
- }
- }).catch(error=>{})
- }
+ activeKey: index,
+ });
+ };
render() {
- const { projectsId , owner } = this.props.match.params;
+ const { projectsId, owner } = this.props.match.params;
+ const { comparesData = {} } = this.props;
+ const { commits, diff, commits_count } = comparesData;
+ const { activeKey } = this.state;
- const { footer_type, order_id, data , comparesData } = this.props;
- let { isSpin , activeKey , filesCount, commitCount , filesData , commitsData } = this.state;
-
- return (
- !footer_type && !comparesData || (comparesData && ((comparesData.commits && comparesData.commits.length===0)||(comparesData && !comparesData.diff)) )?"":
-
-
-
- {
- footer_type &&
- 评论
- {data && parseInt(data.comments_count) > 0 && {data.comments_count}}
-
- } key="1">
-
-
- }
- {
- commitsData && commitsData.length > 0 &&
- 提交
- {commitCount > 0 && {commitCount}}
- } key="2">
-
-
- }
- {
- filesData && filesData.files && filesData.files.length>0 &&
- 文件
- {filesCount > 0 && {filesCount}}
-
- } key="3">
-
-
- }
-
-
-
+ return (commits && commits.length === 0) || !diff ? (
+ ''
+ ) : (
+
+
+ {commits && commits.length > 0 && (
+
+ 提交
+ {commits_count > 0 && (
+ {commits_count}
+ )}
+
+ }
+ key="1"
+ >
+
+
+ )}
+ {diff && diff.files && diff.files.length > 0 && (
+
+ 文件
+ {diff.files_count > 0 && (
+ {diff.files_count}
+ )}
+
+ }
+ key="3"
+ >
+
+
+ )}
+
);
}
diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js
index 3481cc8f..e6378139 100644
--- a/src/forge/Merge/merge_form.js
+++ b/src/forge/Merge/merge_form.js
@@ -165,7 +165,8 @@ class MergeForm extends Component {
this.setState({
isSpin: false,
});
- this.props.history.push(`/projects/${owner}/${projectsId}/pulls`);
+ const { pull_request_id } = result.data;
+ this.props.history.push(`/${owner}/${projectsId}/pulls/${pull_request_id}`);
const { getDetail } = this.props;
getDetail && getDetail();
} else {
@@ -195,7 +196,7 @@ class MergeForm extends Component {
isSpin: false,
});
this.props.history.push(
- `/projects/${owner}/${projectsId}/pulls/${mergeId}/Messagecount`
+ `/${owner}/${projectsId}/pulls/${mergeId}`
);
} else {
this.setState({
@@ -264,7 +265,7 @@ class MergeForm extends Component {
},
],
initialValue: title,
- })(
)}
+ })(
)}
{
- this.props.history.push(merge_type === "new" ? `/projects/${owner}/${projectsId}/pulls` : `/projects/${owner}/${projectsId}/pulls/${mergeId}/detail`)
+ this.props.history.push(merge_type === "new" ? `/${owner}/${projectsId}/pulls` : `/${owner}/${projectsId}/pulls/${mergeId}`)
}}
>
取消
@@ -300,7 +301,8 @@ class MergeForm extends Component {
{getFieldDecorator("assigned_to_id", {
initialValue: assigned_to_id,
})(
-
diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js
index b0f07326..e9aa1f95 100644
--- a/src/forge/New/Index.js
+++ b/src/forge/New/Index.js
@@ -1,10 +1,11 @@
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
-import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete } from 'antd';
+import { Input , Form , Select , Checkbox , Button , Spin , AutoComplete, Modal } from 'antd';
import { Base64 } from 'js-base64';
+import { AlignCenter } from '../Component/layout';
import '../css/index.scss';
-import './new.css'
+import './new.scss'
import axios from 'axios';
const Option = Select.Option;
@@ -44,7 +45,12 @@ class Index extends Component {
project_category_name: undefined,
license_name: undefined,
ignore_name: undefined,
- descNum:0
+ descNum:0,
+
+ categoreFlag:false,
+ languageFlag:false,
+ ignoreFlag:false,
+ licenseFlag:false,
}
}
componentDidMount = () => {
@@ -58,6 +64,8 @@ class Index extends Component {
this.getGitignore();
// 获取开源许可证
this.getLicenses();
+ //判断是否为删除新建项目失败后返回,并执行对应逻辑
+ this.isDeleteProjectBack();
}
componentDidUpdate=(prevPros)=>{
if(prevPros && this.props && !this.props.checkIfLogin()){
@@ -69,6 +77,7 @@ class Index extends Component {
getOwner=()=>{
const { OIdentifier } = this.props.match.params;
const { user_id } = this.props && this.props.current_user;
+
const url = `/owners.json`;
axios.get(url).then(result=>{
if(result && result.data){
@@ -77,16 +86,13 @@ class Index extends Component {
OwnerList: owner,
})
if(OIdentifier){
- owner = owner.filter(item=>item.name === OIdentifier);
- this.props.form.setFieldsValue({
- user_id:OIdentifier
- })
+ owner = owner.filter(item=>item.login === OIdentifier);
}else if(user_id){
owner = owner.filter(item=>item.id === user_id);
- this.props.form.setFieldsValue({
- user_id:owner && owner[0].name
- })
}
+ this.props.form.setFieldsValue({
+ user_id:owner && owner[0].name
+ })
owner && this.setState({
owners_id:owner[0].id,
owners_name:owner[0].name
@@ -144,6 +150,31 @@ class Index extends Component {
}).catch((error) => { })
}
+ isDeleteProjectBack = () => {
+ let mirror_status = this.props.history.location.mirror_status;
+ if (mirror_status === 2 && sessionStorage.newProjectValue) {
+ Modal.warning({
+ title: '警告',
+ content: '项目导入失败!请按操作规范重新导入项目!',
+ });
+ let newProjectValue = JSON.parse(sessionStorage.newProjectValue);
+ if (newProjectValue) {
+ this.setState({
+ project_language_id: newProjectValue.project_language_id,
+ project_category_id: newProjectValue.project_category_id,
+ license_id: newProjectValue.license_id,
+ ignore_id: newProjectValue.ignore_id
+ });
+ delete newProjectValue.project_language_id;
+ delete newProjectValue.project_category_id;
+ delete newProjectValue.license_id;
+ delete newProjectValue.ignore_id;
+ this.props.form.setFieldsValue(newProjectValue);
+ }
+
+ }
+ }
+
// 设置option
setOptionsList = (data, _head, name) => {
if (data && data.length > 0) {
@@ -164,35 +195,40 @@ class Index extends Component {
subMitFrom = () => {
this.props.form.validateFieldsAndScroll((err, values) => {
+ console.log(values);
if (!err) {
this.setState({
isSpin: true
})
const { projectsType } = this.props.match.params;
- const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = this.state;
+ const {
+ project_language_id, project_category_id, license_id, ignore_id , owners_id ,
+ ignoreFlag,licenseFlag,categoreFlag,languageFlag
+ } = this.state;
const decoderPass = Base64.encode(values.password);
const url = (projectsType && projectsType === "mirror") ? "/projects/migrate.json" : "/projects.json";
+ // 新建项目的时候,暂存数据,如果失败,返回的时候可以重新赋值
+ sessionStorage.newProjectValue=JSON.stringify({...values,project_language_id,project_category_id,license_id,ignore_id});
axios.post(url, {
...values,
auth_password:decoderPass,
- project_language_id,
- project_category_id,
- license_id,
- ignore_id,
+ project_language_id:languageFlag ? project_language_id : undefined,
+ project_category_id:categoreFlag ? project_category_id : undefined,
+ license_id:licenseFlag ? license_id : undefined,
+ ignore_id:ignoreFlag ? ignore_id : undefined,
user_id:owners_id
}).then((result) => {
if (result && result.data.id) {
- this.setState({
- isSpin: false
- })
- this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`);
- this.props.history.push(`/projects/${result.data.login}/${result.data.identifier}`);
+ projectsType && projectsType !== "mirror" && this.props.showNotification(`项目创建成功!`);
+ this.props.history.push(`/${result.data.login}/${result.data.identifier}`);
}
+ this.setState({
+ isSpin: false
+ })
}).catch((error) => {
this.setState({
isSpin: false
})
- console.log(error);
})
} else {
this.setState({
@@ -249,12 +285,16 @@ class Index extends Component {
if(value.indexOf("/") > -1){
let arr = value.split("/");
let first = arr[arr.length-1];
- if(first.indexOf(".git") > -1){
+ if(first.indexOf(".") > -1){
let second = first.split('.')[0];
if(!second)return;
this.props.form.setFieldsValue({
repository_name:second
})
+ }else{
+ this.props.form.setFieldsValue({
+ repository_name:first
+ })
}
}
}
@@ -287,48 +327,35 @@ class Index extends Component {
mirrorCheck,
- descNum
+ descNum,
+
+ ignoreFlag,
+ licenseFlag,
+ languageFlag,
+ categoreFlag
} = this.state;
return (
-
创建{projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目
+
{projectsType && projectsType === "mirror" ? "导入" : "新建"}项目
diff --git a/src/forge/Newfile/UserSubmitComponent.js b/src/forge/Newfile/UserSubmitComponent.js
index 5cba3cf6..aa4bba6e 100644
--- a/src/forge/Newfile/UserSubmitComponent.js
+++ b/src/forge/Newfile/UserSubmitComponent.js
@@ -83,10 +83,10 @@ class UserSubmitComponent extends Component {
if (result.data && result.data.name) {
this.props.showNotification("文件新建成功!");
if(submitType === "1"){
- const { getTopCount } = this.props;
- getTopCount && getTopCount(values.branchname);
+ const { getDetail } = this.props;
+ getDetail && getDetail();
}
- let url = `/projects/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
+ let url = `/${owner}/${projectsId}${values.branchname ? `/tree/${turnbar(values.branchname)}`: (branch ? `/tree/${turnbar(branch)}` : "")}`;
this.props.history.push(url);
}
})
@@ -123,7 +123,7 @@ class UserSubmitComponent extends Component {
this.setState({ isSpin: false });
if (result.data && result.data.status === 1) {
let b = currentBranch || branch;
- let url = `/projects/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`;
+ let url = `/${owner}/${projectsId}${(values.branchname ? `/tree/${turnbar(values.branchname)}` : (b ? `/tree/${turnbar(b)}`:""))}`;
this.props.history.push(url);
this.props.showNotification("文件修改成功!");
}
@@ -147,10 +147,11 @@ class UserSubmitComponent extends Component {
const { current_user, filepath, projectDetail , currentBranch } = this.props;
const { editor_type } = this.props;
let b = currentBranch || branch;
+
return (
-
+
{
- this.props.history.push(`/projects/${owner}/${projectsId}`);
+ this.props.history.push(`/${owner}/${projectsId}`);
}}
className="mr20"
>
diff --git a/src/forge/Newfile/index.css b/src/forge/Newfile/index.css
index 242fd451..746febe5 100644
--- a/src/forge/Newfile/index.css
+++ b/src/forge/Newfile/index.css
@@ -8,7 +8,13 @@
border: 1px solid #d9d9d9!important;
border-right: none!important;
}
-
+.editorBorder .editorBorderBox{
+ border:1px solid #eee;
+ border-radius: 2px;
+}
+.editorBorder .editorBorderSubmitBox{
+ padding:20px 0px!important;
+}
.userScrew{
margin:20px 0px;
border:1px solid #f4f4f4;
@@ -39,7 +45,7 @@
z-index: 1;
}
.ant-input-group .ant-input:focus{
- border-right: 1px solid #d9d9d9!important;
+ border-right: 1px solid rgba(70, 106, 255, 1)!important;
}
.ant-btn-primary.grey{
border:1px solid #BBBBBB;
diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js
index 05a7b2ac..13d2ec46 100644
--- a/src/forge/Newfile/m_editor.js
+++ b/src/forge/Newfile/m_editor.js
@@ -1,5 +1,7 @@
import React, { Component } from "react";
import Editor from "react-monaco-editor";
+// import {UnControlled as CodeMirror} from 'react-codemirror2'
+
import UserSubmitComponent from "./UserSubmitComponent";
import "./index.css";
@@ -10,6 +12,7 @@ class m_editor extends Component {
super(props);
this.state = {
editorValue: this.props.content,
+ prevHeight:0
};
}
componentDidUpdate=(prevProps)=>{
@@ -41,42 +44,92 @@ class m_editor extends Component {
folding: true,
foldingStrategy: "indentation", // 代码可分小段折叠
automaticLayout: true, // 自适应布局
- // overviewRulerBorder: false, // 不要滚动条的边框
- // scrollBeyondLastLine: false, // 取消代码后面一大段空白
+ overviewRulerBorder: false, // 不要滚动条的边框
+ scrollBeyondLastLine: false, // 取消代码后面一大段空白
minimap: {
// 不要小地图
enabled: false,
},
};
+
+ const handleEditorMount = (editor, monaco) => {
+ editor.onDidChangeModelDecorations(() => {
+ requestAnimationFrame(updateEditorHeight); // folding
+ });
+
+ const updateEditorHeight = () => {
+ const editorElement = editor.getDomNode();
+
+ if (!editorElement) {
+ return;
+ }
+
+ const padding = 40;
+
+ const lineHeight = editor.getOption(
+ monaco.editor.EditorOption.lineHeight
+ );
+
+ const lineCount = editor.getModel().getLineCount() || 1;
+ let height =
+ editor.getTopForLineNumber(lineCount + 1) +
+ lineHeight +
+ padding ;
+
+ if(height<400){height = 400;}
+
+ if (this.state.prevHeight !== height) {
+ this.setState({
+ prevHeight:height
+ })
+ // setPrevHeight(height);
+ editorElement.style.height = `${height}px`;
+ editor.layout();
+ }
+ };
+
+ updateEditorHeight(); // typing
+ };
+
+
return (
-
-
-
-
- {!readOnly && (
-
-
-
- )}
-
+
+
+ {/* */}
+
+ {!readOnly && (
+
+
+
+ )}
);
}
diff --git a/src/forge/Nodata.js b/src/forge/Nodata.js
index 3147e560..ccc74ac5 100644
--- a/src/forge/Nodata.js
+++ b/src/forge/Nodata.js
@@ -1,7 +1,7 @@
import React , { Component } from 'react';
import nodata from './Images/nodata.png';
-
+import './css/index.scss';
class Nodata extends Component{
render(){
const { _html , small } = this.props;
diff --git a/src/forge/Notice/Apply.jsx b/src/forge/Notice/Apply.jsx
index 3c77edfa..aeacd67a 100644
--- a/src/forge/Notice/Apply.jsx
+++ b/src/forge/Notice/Apply.jsx
@@ -63,11 +63,11 @@ function Apply(props) {
{
list.map((i,k)=>{
return(
-
-
+
+
- {i.user && i.user.name}
+ {i.user && i.user.name}
{i.time_ago}
diff --git a/src/forge/Notice/Index.jsx b/src/forge/Notice/Index.jsx
index 63d09748..73a2561b 100644
--- a/src/forge/Notice/Index.jsx
+++ b/src/forge/Notice/Index.jsx
@@ -10,10 +10,6 @@ const Apply = Loadable({
loader: () => import("./Apply"),
loading: Loading,
});
-const Notify = Loadable({
- loader: () => import("./Notify"),
- loading: Loading,
-});
const UndoEvent = Loadable({
loader: () => import("./UndoEvent"),
loading: Loading,
@@ -23,7 +19,7 @@ function Index(props){
const pathname = props.history.location.pathname;
const user = props.user;
- const [ menu , setMenu ] = useState("notify");
+ const [ menu , setMenu ] = useState("undo");
const [ messagesCount , setMessagesCount ] = useState(0);
const [ transferCount , setTransferCount ] = useState(0);
const [ applyCount , setApplyCount ] = useState(0);
@@ -33,7 +29,7 @@ function Index(props){
useEffect(()=>{
if((username && current_user && (current_user.login !== username))){
- props.history.push(`/users/${username}`);
+ props.history.push(`/${username}`);
}
},[current_user,username])
@@ -47,14 +43,10 @@ function Index(props){
useEffect(()=>{
if(pathname && username){
- if(pathname === `/users/${username}/notice`){
- setMenu("notify");
- changeNum(user.undo_messages);
- }
- if(pathname === `/users/${username}/notice/undo`){
+ if(pathname === `/${username}/notice`){
setMenu("undo");
}
- if(pathname === `/users/${username}/notice/apply`){
+ if(pathname === `/${username}/notice/apply`){
setMenu("apply");
}
}
@@ -70,9 +62,9 @@ function Index(props){
function deleteEvent(type,count) {
let c = count;
if(type==="apply"){
- setTransferCount(transferCount-count);
- }else if(type==="undo"){
setApplyCount(applyCount-count);
+ }else if(type==="undo"){
+ setTransferCount(transferCount-count);
}else{
setMessagesCount(0);
c = messagesCount;
@@ -83,20 +75,14 @@ function Index(props){
return (
- -
-
- 通知
- {messagesCount ? {messagesCount}:""}
-
-
-
-
+
接收仓库
{transferCount ? {transferCount}:""}
-
-
+
成员申请
{applyCount ? {applyCount}:""}
@@ -104,23 +90,17 @@ function Index(props){
{
return ;
}}
>
{
return ;
}}
>
- {
- return ;
- }}
- >
);
diff --git a/src/forge/Notice/Notify.jsx b/src/forge/Notice/Notify.jsx
index 761366d3..31373908 100644
--- a/src/forge/Notice/Notify.jsx
+++ b/src/forge/Notice/Notify.jsx
@@ -44,13 +44,13 @@ function Notify(props){
if(status){
switch(status){
case 'canceled':
- return 取消转移【{project && project.name}】仓库
+ return 取消转移【{project && project.name}】仓库
case 'common':
- return 正在将【{project && project.name}】仓库转移给【{owner && owner.name}】
+ return 正在将【{project && project.name}】仓库转移给【{owner && owner.name}】
case 'successed':
- return 【{project && project.name}】仓库成功转移给【{owner && owner.name}】
+ return 【{project && project.name}】仓库成功转移给【{owner && owner.name}】
default:
- return 拒绝转移【{project && project.name}】仓库
+ return 拒绝转移【{project && project.name}】仓库
}
}else{
return ""
@@ -62,9 +62,9 @@ function Notify(props){
if(status){
switch(status){
case 'successed':
- return 已通过你加入【{project && project.name}】项目的申请
+ return 已通过你加入【{project && project.name}】项目的申请
default:
- return 已拒绝你加入【{project && project.name}】项目的申请
+ return 已拒绝你加入【{project && project.name}】项目的申请
}
}else{
return ""
@@ -80,12 +80,13 @@ function Notify(props){
{
list.map((i,k)=>{
+ console.log(i);
return(
- -
-
+ -
+
- {i.applied_user && i.applied_user.name}
+ {i.applied_user && i.applied_user.name}
{i.time_ago}
{ i.applied_type === "AppliedProject" ? renderApplyStatus(i.status,i.applied):renderStatus(i.status,i.applied)}
diff --git a/src/forge/Notice/UndoEvent.jsx b/src/forge/Notice/UndoEvent.jsx
index d93a1f83..17dcc321 100644
--- a/src/forge/Notice/UndoEvent.jsx
+++ b/src/forge/Notice/UndoEvent.jsx
@@ -53,7 +53,7 @@ function UndoEvent(props){
Axios.post(url).then(result=>{
if(result && result.data){
getList();
- props && props.deleteEvent("apply",1);
+ props && props.deleteEvent("undo",1);
}
}).catch(error=>{})
}
@@ -61,23 +61,23 @@ function UndoEvent(props){
return(
-
+
{
list && list.length > 0 ?
{
list.map((i,k)=>{
return(
- -
-
+ -
+
- {i.user && i.user.name}
+ {i.user && i.user.name}
{i.time_ago}
- 请求将仓库【{i.project && i.project.name}】
- 转移给【{i.owner && i.owner.name}】,是否接受?
+ 请求将仓库【{i.project && i.project.name}】
+ 转移给【{i.owner && i.owner.name}】,是否接受?
{
i.status === "common" &&
diff --git a/src/forge/Order/CopyDetail.js b/src/forge/Order/CopyDetail.js
index 1f61e736..906de4be 100644
--- a/src/forge/Order/CopyDetail.js
+++ b/src/forge/Order/CopyDetail.js
@@ -1,11 +1,13 @@
-import React, { Component } from "react";
+import React from "react";
import OrderItem from './order_form'
-class CopyDetail extends Component {
- render() {
- return (
-
- )
- }
+
+
+function CopyDetail(props){
+ const operate = props.match.params.operate;
+ console.log(operate);
+ return(
+
+ )
}
-export default CopyDetail;
+export default CopyDetail;
\ No newline at end of file
diff --git a/src/forge/Order/Detail.js b/src/forge/Order/Detail.js
index 644a653d..4d1b47cf 100644
--- a/src/forge/Order/Detail.js
+++ b/src/forge/Order/Detail.js
@@ -85,7 +85,7 @@ class Detail extends Component {
})
.then((result) => {
if (result) {
- this.props.history.push(`/projects/${owner}/${projectsId}/issues`);
+ this.props.history.push(`/${owner}/${projectsId}/issues`);
}
})
.catch((error) => {
@@ -123,22 +123,25 @@ class Detail extends Component {
//复制
copydetail = () => {
const { projectsId, orderId, owner } = this.props.match.params;
- const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`;
- axios
- .post(url, {
- project_id: projectsId,
- id: orderId,
- })
- .then((result) => {
- if (result) {
- this.props.history.push(
- `/projects/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
- );
- }
- })
- .catch((error) => {
- console.log(error);
- });
+ // const url = `/${owner}/${projectsId}/issues/${orderId}/copy.json`;
+ // axios
+ // .post(url, {
+ // project_id: projectsId,
+ // id: orderId,
+ // })
+ // .then((result) => {
+ // if (result) {
+ // this.props.history.push(
+ // `/${owner}/${projectsId}/issues/${result.data.issue_id}/copyetail`
+ // );
+ // }
+ // })
+ // .catch((error) => {
+ // console.log(error);
+ // });
+ this.props.history.push(
+ `/${owner}/${projectsId}/issues/${orderId}/copyetail`
+ );
};
// 翻页
@@ -207,7 +210,7 @@ class Detail extends Component {
![]()
-
{data && data.subject}
+
{data && data.subject}
{data && data.priority && (
@@ -240,7 +243,7 @@ class Detail extends Component {
由
{data && data.author_name}
@@ -269,7 +272,7 @@ class Detail extends Component {
编辑
@@ -315,7 +318,7 @@ class Detail extends Component {
- 标签:
+ 标记:
{data && data.issue_tags ? (
diff --git a/src/forge/Order/Milepost.js b/src/forge/Order/Milepost.js
index c18baf1b..48fc286b 100644
--- a/src/forge/Order/Milepost.js
+++ b/src/forge/Order/Milepost.js
@@ -4,6 +4,7 @@ import { Dropdown, Icon, Menu, Pagination, Typography, Popconfirm, Spin } from '
import NoneData from '../Nodata';
import axios from 'axios';
import './order.css';
+import CheckProfile from '../Component/ProfileModal/Profile';
const { Text } = Typography;
@@ -188,7 +189,7 @@ class Milepost extends Component {
{
data && data.user_admin_or_member ?
- 新的里程碑
+ {this.props.history.push(`/${owner}/${projectsId}/milestones/new`)}}>新的里程碑
: ''
}
@@ -205,7 +206,7 @@ class Milepost extends Component {
- {item.name}
+ {item.name}
@@ -229,7 +230,7 @@ class Milepost extends Component {
- 编辑
+ 编辑
diff --git a/src/forge/Order/MilepostDetail.js b/src/forge/Order/MilepostDetail.js
index 30526750..0f5d191e 100644
--- a/src/forge/Order/MilepostDetail.js
+++ b/src/forge/Order/MilepostDetail.js
@@ -2,7 +2,8 @@ import React, { Component } from "react";
import { Link } from 'react-router-dom';
import { Dropdown, Menu, Icon, Pagination, Spin } from 'antd';
import './order.css';
-import { FlexAJ } from '../Component/layout'
+import { FlexAJ } from '../Component/layout';
+import CheckProfile from '../Component/ProfileModal/Profile';
import NoneData from '../Nodata';
import OrderItem from './OrderItem';
@@ -39,7 +40,7 @@ class MilepostDetail extends Component {
issue_type: undefined,
status_type: '1',
//设置选择高亮
- issue_tag_ids: '标签',
+ issue_tag_ids: '标记',
tracker_ids: '类型',
author_ids: '发布人',
assigned_to_ids: '负责人',
@@ -113,7 +114,7 @@ class MilepostDetail extends Component {
this.setState({
data: result.data,
issues: result.data.issues,
- search_count: result.data.search_count,
+ search_count: params.status_type ==="1" ? result.data.open_issues_count : result.data.close_issues_count,
isSpin: false
})
}
@@ -193,7 +194,7 @@ class MilepostDetail extends Component {
done_ratio : undefined,
status_id: undefined,
assigned_to_id: undefined,
- issue_tag_ids: '标签',
+ issue_tag_ids: '标记',
tracker_ids: '类型',
author_ids: '发布人',
assigned_to_ids: '负责人',
@@ -238,8 +239,8 @@ class MilepostDetail extends Component {
{data && data.percent && data.percent.toFixed(2)}%完成
- 编辑里程碑
- 创建易修
+ 编辑里程碑
+ {this.props.history.push(`/${owner}/${projectsId}/issues/${meilid}/new`)}} className="topWrapper_btn">创建易修
@@ -253,7 +254,7 @@ class MilepostDetail extends Component {
@@ -65,7 +65,7 @@ class OrderItem extends Component {
- 编辑
+ 编辑
diff --git a/src/forge/Order/Nav.js b/src/forge/Order/Nav.js
index 93fbc101..3f5a20c5 100644
--- a/src/forge/Order/Nav.js
+++ b/src/forge/Order/Nav.js
@@ -7,8 +7,8 @@ class Nav extends Component{
const { projectsId , owner } = this.props.match.params;
return(
- 标签
- 里程碑
+ 标记
+ 里程碑
)
}
diff --git a/src/forge/Order/OrderItem.js b/src/forge/Order/OrderItem.js
index 3c5e5cf8..08178864 100644
--- a/src/forge/Order/OrderItem.js
+++ b/src/forge/Order/OrderItem.js
@@ -44,6 +44,7 @@ class OrderItem extends Component {
render() {
const { item , checkbox , mile , user_admin_or_member } = this.props;
const { projectsId , owner } = this.props.match.params;
+ const { orderid , isdisplay } = this.state;
const { current_user } = this.props;
return (
item &&
@@ -51,7 +52,7 @@ class OrderItem extends Component {
{current_user && current_user.login && checkbox}
- {item.name}
+ {item.name}
{TagInfo(item.priority,"mr10")}
@@ -67,7 +68,7 @@ class OrderItem extends Component {
-
{
item.author_name ?
-
+
{item.author_name}
: "--"
@@ -76,7 +77,7 @@ class OrderItem extends Component {
-
{
item.assign_user_name ?
-
+
{item.assign_user_name}
: "--"
@@ -88,15 +89,24 @@ class OrderItem extends Component {
- {item.done_ratio || "--"}
-
-
{item.journals_count}
+
{item.journals_count}
{
user_admin_or_member ?
-
+
-
+
+
+
-
document.getElementById("hoverBox")} title={'您确定要删除当前易修吗?'} okText="是" cancelText="否" onConfirm={() => this.deletedetail(item.id)}>
+ this.deletedetail(item.id)}
+ >
diff --git a/src/forge/Order/Tags.js b/src/forge/Order/Tags.js
index 174891aa..eeff8db2 100644
--- a/src/forge/Order/Tags.js
+++ b/src/forge/Order/Tags.js
@@ -324,11 +324,11 @@ class Tags extends Component {
data && data.issue_tags && data.issue_tags.length > 0 ?
-
共{data && data.issue_tags_count}个标签
+
共{data && data.issue_tags_count}个标记
diff --git a/src/forge/Order/UpdateDetail.js b/src/forge/Order/UpdateDetail.js
index 9cbb3cd6..0bf4f0f1 100644
--- a/src/forge/Order/UpdateDetail.js
+++ b/src/forge/Order/UpdateDetail.js
@@ -1,11 +1,11 @@
-import React, { Component } from "react";
+import React from "react";
import OrderForm from './order_form'
-class UpdateDetail extends Component {
- render() {
- return (
-
- )
- }
+
+function CopyDetail(props){
+ const operateName = props.match.params.operateName;
+ return(
+
+ )
}
-export default UpdateDetail;
+export default CopyDetail;
diff --git a/src/forge/Order/UpdateMilepost.js b/src/forge/Order/UpdateMilepost.js
index 88a73033..c4f38657 100644
--- a/src/forge/Order/UpdateMilepost.js
+++ b/src/forge/Order/UpdateMilepost.js
@@ -79,7 +79,7 @@ class UpdateMilepost extends Component {
}).then(result => {
if (result) {
this.setState({ isSpin: false })
- this.props.history.push(`/projects/${owner}/${projectsId}/milestones`);
+ this.props.history.push(`/${owner}/${projectsId}/milestones`);
}
diff --git a/src/forge/Order/newMilepost.js b/src/forge/Order/newMilepost.js
index b9513212..b7d1102d 100644
--- a/src/forge/Order/newMilepost.js
+++ b/src/forge/Order/newMilepost.js
@@ -63,7 +63,7 @@ class NewMilepost extends Component {
}).then(result => {
if (result) {
this.setState({ isSpin: false })
- this.props.history.push(`/projects/${owner}/${projectsId}/milestones`);
+ this.props.history.push(`/${owner}/${projectsId}/milestones`);
const { getDetail } = this.props;
getDetail && getDetail();
}
diff --git a/src/forge/Order/order.css b/src/forge/Order/order.css
index 6a0f029e..0abd116f 100644
--- a/src/forge/Order/order.css
+++ b/src/forge/Order/order.css
@@ -20,6 +20,9 @@
.overlayBox{
width: 230px;
}
+.hideOverlay{
+ display: none;
+}
.topmilepost {
box-sizing: border-box;
display: flex;
diff --git a/src/forge/Order/order.js b/src/forge/Order/order.js
index 1202f41f..7275c759 100644
--- a/src/forge/Order/order.js
+++ b/src/forge/Order/order.js
@@ -1,12 +1,12 @@
import React, { Component } from "react";
import { Input, Dropdown, Menu, Icon, Pagination, Spin, DatePicker, Checkbox } from "antd";
-import { Link } from 'react-router-dom';
import "./order.css";
import './index.scss';
import moment from 'moment';
import NoneData from "../Nodata";
import OrderItem from "./OrderItem";
+import CheckProfile from '../Component/ProfileModal/Profile';
import axios from "axios";
@@ -39,7 +39,7 @@ class order extends Component {
search_count: undefined,
issue_type: undefined,
status_type: "1", // 默认显示开启中的
- issue_tag_ids: "标签",
+ issue_tag_ids: "标记",
tracker_ids: "类型",
author_ids: "发布人",
assigned_to_ids: "负责人",
@@ -58,7 +58,7 @@ class order extends Component {
select_params: {
assigned_to_id: undefined, // 负责人
author_id: undefined, // 发布人
- issue_tag_id: undefined, // 标签
+ issue_tag_id: undefined, // 标记
tracker_id: undefined, //类型
done_ratio: undefined, // 完成度
status_id: undefined, // 优先级
@@ -257,7 +257,7 @@ class order extends Component {
author_id: undefined,
assigned_to_id: undefined,
status_type: type,
- issue_tag_ids: "标签",
+ issue_tag_ids: "标记",
tracker_ids: "类型",
author_ids: "发布人",
assigned_to_ids: "负责人",
@@ -351,9 +351,9 @@ class order extends Component {
if(data && data.user_admin_or_member){
const { projectsId , owner } = this.props.match.params;
return(
-
+
{window.open(`/${owner}/${projectsId}/issues/new`,'_blank')}}>
+ 创建易修
-
+
)
}
}
@@ -677,7 +677,7 @@ class order extends Component {
className="topWrapperSelect"
overlay={this.renderMenu(
issue_chosen && issue_chosen.issue_tag,
- "标签",
+ "标记",
"issue_tag_id"
)}
trigger={["click"]}
diff --git a/src/forge/Order/order_form.js b/src/forge/Order/order_form.js
index b6f065b2..3399a7fe 100644
--- a/src/forge/Order/order_form.js
+++ b/src/forge/Order/order_form.js
@@ -153,7 +153,7 @@ class order_form extends Component {
values.issue_tag_ids = [values.issue_tag_ids];
}
const { description, start_date, due_date, issue_type } = this.state;
- if (form_type === "new") {
+ if (form_type !== "edit") {
const url = `/${owner}/${projectsId}/issues.json`;
axios.post(url, {
...values,
@@ -165,7 +165,7 @@ class order_form extends Component {
}).then((result) => {
if (result && result.data.id) {
this.props.showNotification("任务创建成功!");
- this.props.history.push(`/projects/${owner}/${projectsId}/issues/${result.data.id}/detail`);
+ this.props.history.push(`/${owner}/${projectsId}/issues/${result.data.id}`);
this.setState({
description: "",
isSpin: false,
@@ -178,7 +178,6 @@ class order_form extends Component {
this.setState({
isSpin: false,
});
- console.log(error);
});
} else {
const url = `/${owner}/${projectsId}/issues/${orderId}.json`;
@@ -191,7 +190,7 @@ class order_form extends Component {
...values,
}).then((result) => {
if (result) {
- this.props.history.push(`/projects/${owner}/${projectsId}/issues/${orderId}/detail`);
+ this.props.history.push(`/${owner}/${projectsId}/issues/${orderId}`);
this.props.showNotification("任务更新成功!");
const { getDetail } = this.props;
getDetail && getDetail();
@@ -321,7 +320,7 @@ class order_form extends Component {
message: "请填写易修标题",
},
]
- })(
)}
+ })(
)}
- this.props.history.push(form_type === "new" ? `/projects/${owner}/${projectsId || orderId}/issues` : `/projects/${owner}/${projectsId}/issues/${orderId}/detail`)}
+ this.props.history.push(form_type === "new" ? `/${owner}/${projectsId || orderId}/issues` : `/${owner}/${projectsId}/issues/${orderId}`)}
>
取消
@@ -442,13 +441,13 @@ class order_form extends Component {
)}
-
+
{getFieldDecorator("issue_tag_ids", {rules: []})(
{this.renderSelect(issue_chosen && issue_chosen.issue_tag)}
diff --git a/src/forge/SecuritySetting/Index.jsx b/src/forge/SecuritySetting/Index.jsx
index e314c66a..d9fa1bfa 100644
--- a/src/forge/SecuritySetting/Index.jsx
+++ b/src/forge/SecuritySetting/Index.jsx
@@ -14,17 +14,38 @@ import { Link } from 'react-router-dom';
import './Index.scss';
+const MyNoticeIndex = Loadable({
+ loader: () => import("./notice/myNotice/Index"),
+ loading: Loading,
+});
+
+const NoticeManager = Loadable({
+ loader: () => import("./notice/manager/Index"),
+ loading: Loading,
+});
+
const SSHNew = Loadable({
loader: () => import("./sub/New"),
loading: Loading,
});
+const Profile = Loadable({
+ loader: () => import("../users/Material/Index"),
+ loading: Loading,
+});
const SSHIndex = Loadable({
loader: () => import("./sub/SSH"),
loading: Loading,
});
+
+const PrivateLetter = Loadable({
+ loader: () => import("./notice/privateLetter/Index"),
+ loading: Loading,
+});
+
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(
@@ -35,20 +56,53 @@ function Index(props){
{current_user && current_user.username}
+
+ - 个人信息
+ - -1 ?"active":""}>基本资料
+
+ {notice_url &&
+ - 消息通知
+ - -1 && pathname.indexOf("/settings/notice/config") == -1) || pathname.indexOf("/settings/notice/privateLetter")>-1 ?"active":""}>我的通知
+ - -1 ?"active":""}>通知管理
+
}
- 安全设置
- - -1 ?"active":""}>SSH密钥
+ - -1 ?"active":""}>SSH密钥
+ (
+
+ )}
+ >
+ (
+
+ )}
+ >
+ (
+
+ )}
+ >
(
)}
>
+ (
+
+ )}
+ >
(
@@ -60,7 +114,6 @@ function Index(props){
-
)
}
diff --git a/src/forge/SecuritySetting/Index.scss b/src/forge/SecuritySetting/Index.scss
index 664ed7ab..ede91c86 100644
--- a/src/forge/SecuritySetting/Index.scss
+++ b/src/forge/SecuritySetting/Index.scss
@@ -8,40 +8,44 @@
width: 198px;
border: 1px solid rgba(153, 153, 153, 0.22);
border-radius: 4px;
- min-height: 400px;
+ // min-height: 400px;
margin-bottom: 30px;
.userDetail{
background: rgba(153, 153, 153, 0.05);
border-radius: 4px 4px 0px 0px;
padding:20px 25px;
- display: flex;
- align-items: center;
- justify-content: flex-start;
+ text-align: center;
+ height: 105px;
img{
height: 48px;
width: 48px;
border-radius: 50%;
- margin-right: 12px;
}
span{
font-size: 16px;
color: #333;
- max-width: 90px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
+ font-weight: 500;
}
}
.securityUl{
- padding:20px 16px;
+ padding-left: 17px;
color: #333;
+ margin-bottom: 0px;
+ padding-bottom: 12px;
+ padding-top: 5px;
li{
+ font-size: 14px;
+ margin-top: 10px;
margin-bottom: 10px;
height: 27px;
line-height: 27px;
position: relative;
- cursor: pointer;
+ cursor: default;
+
a{
color: #666;
&:hover{
@@ -50,32 +54,57 @@
}
&.active a{
color: #333;
- }
- &:first-child{
- font-size: 16px;
+ .text-shodow-bold{
+ font-weight: 400;
+ text-shadow: 0.5px 0 #333;
+ }
}
&.active::before{
position: absolute;
- left: -16px;
- top:0px;
- height: 100%;
- width: 2px;
+ left: -18px;
+ top:6px;
+ height: 15px;
+ width: 3px;
+ border-radius: 2px;
content: "";
- background-color: #2A61FF;
+ background-color: #466AFF;
+ }
+
+ i{
+ font-size: 14px !important;
+ margin-right: 8px;
}
}
}
+ .ul-border-buttom{
+ border-bottom: 1px solid rgba(153, 153, 153, 0.22);
+ padding-bottom: 5px;
+ }
}
.sshHead{
display: flex;
align-items: center;
- padding:15px 20px;
+ padding:6px 0px;
+ margin-bottom: 15px;
justify-content: space-between;
border-bottom: 1px solid #EEEEEE;
- &>span{
+ &>.text-shadow07{
font-size: 18px;
+ font-weight: 400;
+ color: #333333;
+ text-shadow: 0.5px 0 #333;
+ }
+ &>.add-SSH-title{
+ font-size: 16px;
+ font-weight: 400;
+ color: #333333;
+ text-shadow: 0.5px 0 #333;
+ }
+ & .but25{
+ padding:0 12px;
}
}
+
.ant-list-item{
padding:20px;
border-bottom: 1px solid #eee!important;
@@ -107,7 +136,7 @@
.questionLink{
padding:15px 20px;
a{
- color: #4B7AFF;
+ color: #466AFF;
&:hover{
text-decoration: underline;
}
@@ -122,50 +151,6 @@
}
}
}
-.deleteBox{
- .ant-modal-header{
- background-color: rgba(223, 0, 2, 0.06);
- border-bottom: none;
- .ant-modal-title{
- text-align: left;
- font-size: 20px;
- }
- }
- .ant-modal-body{
- padding:30px 50px;
- p{
- font-size: 16px;
- line-height: 26px;
- color:#666
- }
- .desc{
- .descMain{
- align-items: center;
- justify-content: center;
- font-size: 20px;
- margin-bottom: 10px;
- i{
- font-size: 38px!important;
- color:#DF0002
- }
- }
- }
- }
- .ant-modal-footer{
- border-top: none;
- text-align: center;
- padding-bottom: 40px;
- button{
- width: 120px;
- margin:0px 20px;
- &.ant-btn-danger{
- background-color: #fff;
- color: #DF0002;
- border-color: #D0D0D0;
- }
- }
- }
-}
.descModal{
.ant-modal-title{
text-align: left;
@@ -189,4 +174,23 @@
flex:1;
}
}
+}
+.but25{
+ margin-bottom: 5px;
+ background-color: #466AFF;
+ color: #fff;
+ border-color: #466AFF;
+ &:hover{
+ opacity: 0.8;
+ background-color: #466AFF;
+ border-color: #466AFF;
+ }
+ &:active{
+ opacity: 1;
+ background-color: #466AFF;
+ border-color: #466AFF;
+ }
+}
+.blue-Purple{
+ color: #466AFF !important;
}
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/img/miyao_middle_icon.png b/src/forge/SecuritySetting/img/miyao_middle_icon.png
index 03584cfe..f69cba0e 100644
Binary files a/src/forge/SecuritySetting/img/miyao_middle_icon.png and b/src/forge/SecuritySetting/img/miyao_middle_icon.png differ
diff --git a/src/forge/SecuritySetting/notice/api.js b/src/forge/SecuritySetting/notice/api.js
new file mode 100644
index 00000000..07fc1838
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/api.js
@@ -0,0 +1,46 @@
+import fetch from './fetch';
+
+// 获取消息列表
+export function noticePages(params) {
+ return fetch({
+ url: '/api/notice/noticePages',
+ method: 'get',
+ params
+ });
+}
+
+// 获取单个notice
+export function getNotice(params) {
+ return fetch({
+ url: '/api/notice/getNotice',
+ method: 'get',
+ params
+ });
+}
+
+//新增notice
+export function addNotice(data) {
+ return fetch({
+ url: '/api/notice/createNotice',
+ method: 'post',
+ data: data
+ });
+}
+
+//更新notice
+export function updateNotice(data) {
+ return fetch({
+ url: '/api/notice/updateNotice',
+ method: 'PUT',
+ data: data
+ });
+}
+
+//删除notice
+export function deleteNotice(data) {
+ return fetch({
+ url: '/api/notice/deleteNotice',
+ method: 'DELETE',
+ data,
+ });
+}
diff --git a/src/forge/SecuritySetting/notice/fetch.js b/src/forge/SecuritySetting/notice/fetch.js
new file mode 100644
index 00000000..dba00b14
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/fetch.js
@@ -0,0 +1,10 @@
+
+import javaFetch from '../../javaFetch';
+
+const developUrl = "https://test-search.trustie.net";
+const testUrl = "https://test-search.trustie.net";
+const productUrl = "https://wiki-api.trustie.net";
+
+const { service, actionUrl } = javaFetch(productUrl, testUrl, developUrl);
+export const httpUrl = actionUrl;
+export default service;
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/notice/manager/Index.jsx b/src/forge/SecuritySetting/notice/manager/Index.jsx
new file mode 100644
index 00000000..5ba82d60
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/manager/Index.jsx
@@ -0,0 +1,79 @@
+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(
+
+
+ 通知管理
+
+
+
您可以通过通知管理来选择接受通知的方式
+ {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)}}>邮件
+
+ )
+ })}
+
+ )
+ })}
+
+
+ )
+}
+export default NoticeManager;
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/notice/manager/Index.scss b/src/forge/SecuritySetting/notice/manager/Index.scss
new file mode 100644
index 00000000..87a77a75
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/manager/Index.scss
@@ -0,0 +1,87 @@
+.notice-manager-tip{
+ font-size:16px;
+ font-weight:400;
+}
+.manager-cont-top{
+ font-size: 14px;
+ font-weight: 600;
+ height: 44px;
+ padding-left: 20px;
+ background: #FAFCFF;
+ border: 1px solid #89a4f7;
+ line-height: 44px;
+ border-top-left-radius: 3px;
+ border-top-right-radius: 3px;
+ margin-top: 25px;
+}
+
+.manager-cont{
+ padding: 8px 20px 6px;
+ display: flex;
+ align-items: center;
+ font-size: 14px;
+
+ .manager-cont-title{
+ width: 320px;
+ }
+}
+
+.notice01{
+ .ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after {
+ border-color: white;
+ }
+ .ant-checkbox-disabled .ant-checkbox-inner {
+ background-color: #999999 !important;
+ border-color: #999999 !important;
+ }
+
+ .ant-checkbox-checked .ant-checkbox-inner {
+ background-color: #466AFF;
+ border: #466AFF;
+ }
+
+ .ant-checkbox-checked::after{
+ border: 1px solid #466AFF;
+ }
+ .ant-checkbox-wrapper:hover .ant-checkbox-inner, .ant-checkbox:hover .ant-checkbox-inner, .ant-checkbox-input:focus + .ant-checkbox-inner,.ant-radio-checked .ant-radio-inner,.ant-radio-wrapper:hover .ant-radio, .ant-radio:hover .ant-radio-inner, .ant-radio-input:focus + .ant-radio-inner {
+ border-color: #466AFF;
+ }
+
+ .ant-checkbox + span,.manager-cont-title {
+ color: #000000;
+ }
+
+ .ant-radio-inner::after{
+ background-color:#466AFF;
+ }
+
+ .but25{
+ background-color: #466AFF;
+ color: #fff;
+ border-color: #466AFF;
+ &:hover{
+ opacity: 0.8;
+ background-color: #466AFF;
+ border-color: #466AFF;
+ }
+ &:active{
+ opacity: 1;
+ background-color: #466AFF;
+ border-color: #466AFF;
+ }
+ }
+
+ ::-webkit-scrollbar {
+ width: 5px; /*对垂直流动条有效*/
+ }
+ /*定义滑块颜色、内阴影及圆角*/
+ ::-webkit-scrollbar-thumb {
+ border-radius: 6px;
+ box-shadow: inset 0 0 6px #FFF;
+ background-color: #D4D4D4;
+ }
+ ::-webkit-scrollbar-track {
+ box-shadow: inset 0 0 6px #fff;
+ background-color: #FFF;
+ }
+}
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.jsx b/src/forge/SecuritySetting/notice/myNotice/Index.jsx
new file mode 100644
index 00000000..22660691
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/myNotice/Index.jsx
@@ -0,0 +1,274 @@
+import React, { useState, useEffect } from 'react';
+import { Link } from 'react-router-dom';
+import axios from 'axios';
+import { Badge, Button, Checkbox, Menu, Pagination } from 'antd';
+import DelModal from '../../../Component/ModalFun';
+import NoneData from '../../../Nodata.js';
+import { noticeSourceType } from '../../../common/static';
+import './Index.scss';
+import '../manager/Index.scss'
+
+function MyNotice(props) {
+ let { current_user, resetUserInfo, location, mygetHelmetapi, history}= props;
+ //消息悬停框选择tab
+ 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);//@我批量删除选择消息条数
+ const [isBatchDelete, setIsBatchDelete] = useState(false);//@我是否批量删除
+ const [batchDeleteCheckedAll, setBatchDeleteCheckAll] = useState(false);//@我批量删除--全选
+
+ const [noticeUnreadCount, setNoticeUnreadCount] = useState();//未读系统通知数量
+ // const [letterUnreadCount, setLetterUnreadCount] = useState(0);//未读私信数量
+ const [atUnreadCount, setAtUnreadCount] = useState();//未读@我数量
+ const [messageList, setMessageList] = useState([]);
+ const [messTotalCount, setMessTotalCount] = useState();//消息总数
+ 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])
+
+ useEffect(()=>{
+ resetUserInfo();
+ },[noticeUnreadCount,atUnreadCount])
+
+ useEffect(() => {
+ getMessageList();
+ }, [noticeType, onlyUnread, currentPage, current_user])
+
+ function getMessageList() {
+ const params = {
+ type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
+ status: onlyUnread ? onlyUnread : "",
+ limit: pageSize,
+ page: currentPage,
+ };
+ current_user && axios.get(`/users/${current_user.login}/messages.json`, {
+ params: params,
+ }).then((response) => {
+ if(response && response.data){
+ setNoticeUnreadCount(response.data.unread_notification);
+ setAtUnreadCount(response.data.unread_atme);
+ setMessageList(response.data.messages);
+ setMessTotalCount(response.data.total_count);
+ }
+ });
+ }
+
+ function readNotice(id){
+ if(id && current_user){
+ const params = {
+ type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
+ ids:id,
+ };
+ axios.post(`/users/${current_user.login}/messages/read.json`,params).then((response)=>{
+ if(response.status === 200){
+ getMessageList();
+ //已读当前页码最后一条数据时跳转到前一页
+ let totlaPage = Math.ceil((messTotalCount-1)/pageSize);
+ setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage);
+ }
+ });
+ }
+ }
+
+ function handleClick(e) {
+ setNoticeType(e.key);
+ setCurrentPage(1);
+ setOnlyUnread();
+ if (e.key != "2") {
+ setIsBatchDelete(false);
+ }
+ }
+
+ function onChange(e) {
+ var checkboxNum = 0;
+ let messageListNew=messageList.slice();
+ messageListNew.map((item)=>{
+ if(item.id===e.target.value){
+ item.checkedBatch = e.target.checked;
+ }
+ item.checkedBatch?checkboxNum++:"";
+ });
+ setMessageList(messageListNew);
+ setSelectedNum(checkboxNum);
+ setBatchDeleteCheckAll(checkboxNum === messageList.length);
+ }
+
+
+ function onChangeAll(e) {
+ setBatchDeleteCheckAll(e.target.checked);
+ setSelectedNum(e.target.checked?messageList.length:0);
+ let messageListNew=messageList.slice();
+ messageListNew.map((item)=>{
+ item.checkedBatch = e.target.checked;
+ });
+ setMessageList(messageListNew);
+ }
+
+ function deleteNotice(id) {
+ const ids = [];
+ if(!id){
+ messageList.map(item=>{
+ item.checkedBatch && ids.push(item.id);
+ });
+ }
+ DelModal({
+ title: noticeType === "1" ? '删除私信用户' : id ? '删除消息' : '批量删除',
+ contentTitle: noticeType === "1" ? '您确定要删除与 xxx 的聊天吗?' : id ? '您确定要删除这条@我消息吗?' : '您确定要删除选中的' + selectedNum + '条消息吗?',
+ content: noticeType === "1" ? '此操作将删除与xxx的聊天框和xxx的所有聊天记录,请进行确认以防数据的丢失' : id ? '此操作将删除这条消息,请进行确认以防数据的丢失' : '此操作将删除选中的' + selectedNum + '条消息,请进行确认以防数据的丢失',
+ onOk: () => {
+ const params = {
+ type: noticeType === "0" ? "notification" : noticeType === "2" ? "atme" : "",
+ ids:id?id:ids,
+ };
+ axios.delete(`/users/${current_user.login}/messages.json`,{
+ data:params,
+ }).then((response)=>{
+ if(response.status === 200){
+ getMessageList();
+ //删除当前页码最后一条数据时跳转到前一页
+ let totlaPage = Math.ceil((messTotalCount-1)/pageSize);
+ setCurrentPage(currentPage>=totlaPage? totlaPage : currentPage);
+ setSelectedNum(0);
+ setBatchDeleteCheckAll(false);
+ }
+ });
+ }
+ });
+ }
+
+ function cancelBatchDelete(){
+ setIsBatchDelete(false);
+ setSelectedNum(0);
+ //取消选中效果
+ let messageListNew=messageList.slice();
+ messageListNew.map((item)=>{
+ item.checkedBatch = false;
+ });
+ setMessageList(messageListNew);
+ setBatchDeleteCheckAll(false);
+ }
+
+ //跳转到消息详情页面
+ function turnToMess(item){
+ if(item.notification_url){
+ window.open(`${item.notification_url}`);
+ readNotice([item.id]);
+ }
+ }
+
+ return (
+
+
+
+ {(noticeType==="0" && noticeUnreadCount>0) || (noticeType==="2"&& atUnreadCount>0) ? {readNotice([-1])}}>所有{noticeType === "0" ? "系统通知" : noticeType === "1" ? "私信" : "@我"}一键已读:""}
+
+
+
+
+ {onlyUnread===1 || messageList && messageList.length>0 ? e.target.checked ? setOnlyUnread(1) : setOnlyUnread()}>仅看未读{noticeType === "1" ? `私信(12)` : noticeType === "0" ? `消息(${noticeUnreadCount})` : `消息(${atUnreadCount})`}:""}
+
+ {noticeType === "2" && messageList && messageList.length > 0 ?
{ setIsBatchDelete(true); }}>批量删除 : ""}
+
+
+ {messageList && messageList.length===0 ?
:""}
+
+ {messageList && messageList.length>0 &&
+
+ 全选
+ 已选择 {selectedNum} 项
+
+
+ 取消
+ 0 ? ()=>deleteNotice() : () => { }}>删除
+
+
}
+
+ {messageList && messageList.map(item => {
+ // 系统消息
+ if (noticeType === "0") {
+ // 消息类别
+ return (
+
+
+ {item.status === 1 ? : }
+
+ {turnToMess(item)}} dangerouslySetInnerHTML={{__html: item.content}}>
+
+
+ {item.time_ago}
+ {item.status === 1 && readNotice([item.id])}>标记为已读}
+
+
+ )
+ } else if (noticeType === "2") {
+ //@我
+ return (
+
+
+
+ {item.sender &&

{window.open(`/${item.sender && item.sender.login}`);}}/>}
+
{turnToMess(item)}}>
+ {item.status === 1 ? : }
+ {item.sender && " + item.sender.name+ " "+ item.content +" 中@我"}}>}
+
+
+
+ {item.time_ago}
+ {!isBatchDelete && item.status === 1 && readNotice([item.id])}>标记为已读}
+ {!isBatchDelete && deleteNotice([item.id])}>删除}
+
+
+ )
+ } else{
+ //私信
+ {/*
+

+
+
+
props.history.push('/settings/notice/privateLetter')}>
+ 最好的OpenStack控制台,对标OpenStack社区Horizon项目,最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
+
+
*/}
+ }
+ })}
+
+ {/* 分页 */}
+ {!isBatchDelete &&
+
{setCurrentPage(page)}}
+ total = {messTotalCount}
+ hideOnSinglePage
+ >
+
}
+
+ )
+}
+export default MyNotice;
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/notice/myNotice/Index.scss b/src/forge/SecuritySetting/notice/myNotice/Index.scss
new file mode 100644
index 00000000..8eab84c0
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/myNotice/Index.scss
@@ -0,0 +1,259 @@
+.whiteBack .boies .sshHead{
+ padding:0 10px 0px 0px;
+}
+.sshHead{
+ .ant-badge{
+ font-size: 16px;
+ color: #333333;
+ }
+ .ant-menu-item{
+ padding:0px;
+ margin-right:34px!important;
+ height: 34px;
+ width: 64px;
+ text-align: center;
+ line-height: 0px;
+ position: relative;
+ }
+
+ li.ant-menu-item, .ant-menu-horizontal > .ant-menu-item {
+ border-bottom: 0px;
+ }
+
+ & .ant-menu-item-selected{
+ color: #333333;
+ font-weight: 400;
+ text-shadow: 0.5px 0 #333;
+ border-bottom: 2px solid #2A61FF !important;
+ }
+
+ .ant-badge-count, .ant-badge-dot, .ant-badge .ant-scroll-number-custom-component {
+ right: -6px;
+ -webkit-box-shadow: 0 0 0 0;
+ box-shadow: 0 0 0 0;
+ }
+ .ant-badge-multiple-words {
+ padding: 0 0px;
+ }
+
+ .ant-menu-horizontal {
+ border-bottom: 0px solid #e8e8e8;
+ }
+
+ button{
+ padding:0 5px;
+ }
+}
+
+button {
+ color: #333333;
+ background: #FAFBFC;
+ border: 1px solid #D0D0D0;
+ border-radius: 4px;
+ height: 32px;
+}
+button:hover {
+ background: #F3F4F6;
+}
+button:active {
+ background: #EBECF0;
+}
+
+.deleteBut{
+ color: #DF0002;
+}
+
+.deleteBut:hover{
+ background: #DF0002;
+ border: 1px solid #DF0002;
+ color:#FFFFFF;
+}
+
+.deleteBut:active{
+ background: #CE0002;
+ border: 1px solid #CE0002;
+ color:#FFFFFF;
+}
+
+.mynotice-content {
+ justify-content: space-between;
+ padding: 15px 0 15px 10px;
+ border-bottom: 1px solid #EEEEEE;
+ color: #333333;
+ &:hover{
+ background: #F3F4F6;
+ }
+
+ & img{
+ cursor: pointer;
+ }
+
+ & b{
+ font-weight: 400;
+ text-shadow: 0.5px 0 #333;
+ }
+
+ & .invisable-read{
+ display: none;
+ }
+
+ &:hover .invisable-read{
+ display: block;
+ color: #466AFF;
+ opacity: 0.6;
+ cursor: pointer;
+
+ &:hover{
+ opacity: 1;
+ }
+ }
+
+ &:hover .timeSpan{
+ display: none;
+ }
+
+ i{
+ font-size: 16px !important;
+ margin-right: 5px;
+ }
+
+ .boldSpan{
+ font-weight: 400;
+ text-shadow: 0.5px 0 0 #333;
+ margin: 0 8px;
+ }
+ & .currentImg{
+ width: 40px;
+ height: 40px;
+ margin-left: 0px;
+ }
+
+ & .private-letter-img + .ant-badge-count{
+ top: 2px;
+ right: 5px;
+ height: 18px;
+ min-width: 18px;
+ line-height: 18px;
+ padding: 0 0;
+ }
+
+ & .highlightSpan:hover{
+ color: #466AFF;
+ cursor: pointer;
+ }
+
+ .mynotice-cont{
+ padding:0;
+ cursor: default;
+ & .visible-checkbox{
+ margin-right: 10px;
+ }
+ & .invisible-checkbox{
+ display: none;
+ }
+ .atme-notice-text{
+ margin-left: 6px;
+
+ & .atme-notice-name{
+ margin: 0 0 ;
+ }
+
+ & .atme-length{
+ max-width: 48rem;
+ word-break: break-all;
+ }
+ }
+ }
+
+ & .ant-badge-count, .ant-badge-dot, .ant-badge .ant-scroll-number-custom-component {
+ -webkit-box-shadow: 0 0 0 0;
+ box-shadow: 0 0 0 0;
+ top: 3px;
+ right: 4px;
+ min-width: 8px;
+ height: 8px;
+ }
+
+ & .system-notice-blank{
+ margin-right: 14px;
+ }
+}
+
+.batchDel{
+ & .currentImg, & .atme-notice-text{
+ pointer-events: none;
+ }
+}
+
+.baselineDiv{
+ align-items: baseline;
+}
+
+.invisible {
+ display: none;
+}
+
+.visible {
+ display: flex;
+ justify-content: space-between;
+ height: 30px;
+ padding: 0 10px;
+ color: #333333;
+ margin-bottom: 5px;
+ button{
+ padding:0px 12px;
+ }
+ .batchDeleteBut{
+ border:1px solid #466AFF;
+ color: #466AFF;
+ }
+}
+
+.private-letter-right {
+ flex: auto;
+ margin: 0px 10px 0 16px;
+ & div{
+ display: flex;
+ justify-content: space-between;
+ }
+}
+
+.letter-length-limit{
+ max-width: 50rem;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+}
+
+.sysNotice-length{
+ max-width: 52rem;
+ word-break: break-all;
+}
+
+
+.numberSpan{
+ color: #466AFF;
+}
+
+.vertical-center-style{
+ display: flex;
+ align-items: center;
+}
+
+.stretch-style{
+ display: flex;
+ align-items: baseline;
+}
+
+.float-left-little{
+ margin-right: 10px;
+}
+
+.float-right-little{
+ margin-left: 12px;
+}
+
+.paging{
+ text-align: center;
+ margin: 12px;
+}
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/notice/privateLetter/Index.jsx b/src/forge/SecuritySetting/notice/privateLetter/Index.jsx
new file mode 100644
index 00000000..51758377
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/privateLetter/Index.jsx
@@ -0,0 +1,200 @@
+import React, { useState, useEffect } from 'react';
+import './Index.scss'
+import '../manager/Index.scss'
+import { Button, Input, Icon, Badge } from 'antd';
+import { Link } from 'react-router-dom';
+
+function PrivateLetter(props){
+
+ const { TextArea,Search } = Input;
+
+ function deleteNotice(){
+ alert("删除消息");
+ }
+
+ return(
+
+
+
+
+ 蒋宇航
+
+
+
+

+
+
+ 嗨在吗?哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
+
删除
+
+
2021-08-29 11:59
+
+
+
+

+
+
+ 哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈
+
删除
+
+
2021-08-29 11:59
+
+
+
+
+
+

+
+
+
+ 发送
+
+
+
+
+
+ }
+ onSearch={value => console.log(value)}
+ style={{ width: 265 }}
+ />
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+

+
+
+ 蒋宇航
+ 4分钟前
+
+
+
最好的OpenStack控制台,对标OpenStack社区Horizon项目,在易用性、页面性能等方面进行深度优化,提供简单控制台。
+
删除
+
+
+
+
+
+
+ )
+}
+export default PrivateLetter;
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/notice/privateLetter/Index.scss b/src/forge/SecuritySetting/notice/privateLetter/Index.scss
new file mode 100644
index 00000000..6276b7a2
--- /dev/null
+++ b/src/forge/SecuritySetting/notice/privateLetter/Index.scss
@@ -0,0 +1,192 @@
+.private-letter{
+ border-radius: 4px 4px 0px 0px;
+ border: 1px solid rgba(151, 151, 151, 0.24);
+ display: flex;
+
+ .currentImg{
+ width: 40px;
+ height: 40px;
+ margin-left: 0px;
+ }
+ & .private-letter-img + .ant-badge-count{
+ top: 2px;
+ right: 5px;
+ }
+}
+
+.pl-content{
+ flex: auto;
+ .pl-name{
+ height: 3rem;
+ border-bottom: 1px solid #EEEEEE;
+
+ &>a{
+ position: relative;
+ left: 26px;
+ color:#999999;
+ }
+ span{
+ font-size: 16px;
+ font-weight: 600;
+ color: #333333;
+ flex: auto;
+ text-align: center;
+ }
+ }
+ .plcontent-list{
+ height: 24rem;
+ padding:20px;
+ overflow-y: scroll;
+
+ .plclo{
+ margin-bottom: 30px;
+ }
+
+ .notice-my{
+ flex-direction: row-reverse;
+
+ & .pld01{
+ left: 0;
+ }
+ }
+
+ & .notice-content{
+ padding:8px 10px;
+ background: #F4F4F4;
+ border-radius:5px;
+ position: relative;
+ max-width: 20rem;
+
+ .pld01{
+ display: none;
+
+ }
+ &:hover .pld01{
+ display: block;
+ position: absolute;
+ right: 0;
+ bottom: -2em;
+ color: #999999;
+ font-size: 12px;
+ &:hover{
+ color: #666666;
+ }
+ }
+ }
+
+ & .message-bubble{
+ position:relative;
+ width:0;
+ height:0;
+ font-size:0;
+ border:solid 8px;
+ border-color:#FFFFFF #FFFFFF #FFFFFF #F4F4F4;
+ }
+
+ & .mb-other{
+ border-color:#FFFFFF #F4F4F4 #FFFFFF #FFFFFF;
+ }
+
+ & span{
+ margin: 0 10px;
+ font-size: 12px;
+ color: #999999;
+ line-height: 17px;
+ }
+ }
+ .private-letter-present{
+ padding:20px 20px;
+ & div{
+ display: flex;
+ align-items: center;
+ justify-content: flex-end;
+ flex: auto;
+ }
+ .private-letter-cont-mt25{
+ margin-top: 8px;
+ padding:0 22px;
+ }
+
+ .private-letter-cont, .private-letter-cont .ant-input-suffix{
+ background-color: #fafafa !important;
+ margin-left: 17px;
+ }
+
+ .private-letter-cont{
+ resize:none;
+ &:hover,&:focus{
+ background-color: #fafafa !important;
+ }
+ }
+ }
+}
+
+.pl-list{
+ width: 30%;
+ border-left: 1px solid #EEEEEE;
+ .list-sort{
+ justify-content: center;
+ height: 3rem;
+ border-bottom: 1px solid #EEEEEE;
+ & .ant-btn-primary{
+ width: 2.3rem;
+ color: #466AFF;
+ background: #eff2ff;
+ border: 1px solid rgba(151, 151, 151, 0.24);
+ }
+
+ & .ant-btn{
+ padding: 0;
+ }
+
+ // & .ant-input:hover{
+ // border: 1px solid red !important;
+ // }
+ }
+
+ .list-scroll{
+ height: 32.4rem;
+ overflow-y: scroll;
+ }
+
+ .list-scroll-content{
+ padding: 10px 10px 15px 15px;
+ border-bottom: 1px solid #EEEEEE;
+ // &:last-child{
+ // border-bottom: 0px;
+ // }
+ &:hover{
+ background: #F3F4F6;
+ }
+ & a{
+ display: none;
+ }
+ &:hover a{
+ display: block;
+ color: #466AFF;
+ }
+ }
+
+ .ls-cont{
+ width: 13rem;
+ // flex: auto;
+ margin-left: 15px;
+ justify-content: space-between;
+ & .ls-content-span{
+ max-width: 11rem;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ }
+ }
+}
+
+.vertical-center-style{
+ display: flex;
+ align-items: center;
+}
+
+img{
+ width: 45x;
+ height: 45px;
+}
diff --git a/src/forge/SecuritySetting/sub/DeleteBox.jsx b/src/forge/SecuritySetting/sub/DeleteBox.jsx
index af8b6418..02d816b3 100644
--- a/src/forge/SecuritySetting/sub/DeleteBox.jsx
+++ b/src/forge/SecuritySetting/sub/DeleteBox.jsx
@@ -1,17 +1,16 @@
import React from 'react';
import { AlignCenter } from '../../Component/layout';
-import { Modal , Button } from 'antd';
+import Modals from '../../Component/PublicModal/Index';
+import { Button } from 'antd';
function DeleteBox({ visible , onCancel ,onSuccess }) {
return(
-
取消
确认删除
@@ -19,10 +18,11 @@ function DeleteBox({ visible , onCancel ,onSuccess }) {
}
>
-
您确定要删除此 SSH 密钥吗?
-
此操作将永久删除该SSH密钥,且不可恢复。如果您想再次使用该密钥,则需要您重新上传。
+
+ 您确定要删除此 SSH 密钥吗?
+
此操作将永久删除该SSH密钥,且不可恢复。如果您想再次使用该密钥,则需要您重新上传。
-
+
)
}
export default DeleteBox;
\ No newline at end of file
diff --git a/src/forge/SecuritySetting/sub/New.jsx b/src/forge/SecuritySetting/sub/New.jsx
index 68a65db3..409098e0 100644
--- a/src/forge/SecuritySetting/sub/New.jsx
+++ b/src/forge/SecuritySetting/sub/New.jsx
@@ -34,7 +34,7 @@ function New({ form , showNotification , history }) {
return(
- SSH密钥添加SSH密钥
+ SSH密钥添加SSH密钥
@@ -51,7 +51,7 @@ function New({ form , showNotification , history }) {
)}
-
确定
+
确定
)
diff --git a/src/forge/SecuritySetting/sub/SSH.jsx b/src/forge/SecuritySetting/sub/SSH.jsx
index bc004e11..2ca890ea 100644
--- a/src/forge/SecuritySetting/sub/SSH.jsx
+++ b/src/forge/SecuritySetting/sub/SSH.jsx
@@ -55,8 +55,8 @@ function SSH(props) {
setVisible(false)} onSuccess={onSuccess}/>
setVisibleDesc(false)} desc={content}/>
- SSH密钥
- props.history.push('/settings/SSH/new')}>添加SSH密钥
+ SSH密钥
+ props.history.push('/settings/SSH/new')} className="but25">添加SSH密钥
{
list && list.length > 0 &&
@@ -64,7 +64,7 @@ function SSH(props) {
{
list.map((i,k)=>{
return(
-
+
{setContent(i);setVisibleDesc(true)}}>{i.name}
diff --git a/src/forge/Settings/Branch.js b/src/forge/Settings/Branch.js
index d345f0fc..3e19f37e 100644
--- a/src/forge/Settings/Branch.js
+++ b/src/forge/Settings/Branch.js
@@ -88,7 +88,7 @@ export default ((props)=>{
// 跳转
function settingRule(protectBranch){
- props.history.push(`/projects/${owner}/${projectsId}/setting/branch/${protectBranch}`);
+ props.history.push(`/${owner}/${projectsId}/settings/branches/${protectBranch}`);
}
// 翻页
diff --git a/src/forge/Settings/BranchRule.jsx b/src/forge/Settings/BranchRule.jsx
index d15ecd00..85b9bf20 100644
--- a/src/forge/Settings/BranchRule.jsx
+++ b/src/forge/Settings/BranchRule.jsx
@@ -290,7 +290,7 @@ export default Form.create()(
{
- history.push(`/projects/${owner}/${projectsId}/setting/branch`);
+ history.push(`/${owner}/${projectsId}/settings/branches`);
}}
>
取消
diff --git a/src/forge/Settings/Collaborator.js b/src/forge/Settings/Collaborator.js
index 0b94eee5..0a50cae1 100644
--- a/src/forge/Settings/Collaborator.js
+++ b/src/forge/Settings/Collaborator.js
@@ -1,4 +1,4 @@
-import React, { useState } from "react";
+import React, { useState , useRef } from "react";
import {WhiteBack} from '../Component/layout';
import AddMember from '../Component/AddMember';
import AddGroup from '../Component/AddGroup';
@@ -8,9 +8,11 @@ import Group from './CollaboratorGroup';
function Collaborator(props){
const [ nav , setNav] = useState("1");
const [ newId , setNewId] = useState(undefined);
+ const [ addOperation , setAddOperation] = useState(true);
const [ newGroupId , setNewGroupId] = useState(undefined);
const {projectsId ,owner} = props.match.params;
+
const author = props && props.projectDetail && props.projectDetail.author;
function getID(id){
@@ -19,6 +21,7 @@ function Collaborator(props){
function getGroupID(id){
setNewGroupId(id);
}
+
return (
@@ -27,15 +30,17 @@ function Collaborator(props){
author && author.type === "Organization" ?
{setNav("1");setNewId(undefined)}}>协作者管理
- {setNav("2");setNewId(undefined)}}>团队管理
+ {setNav("2");setNewId(undefined);setNewGroupId(undefined)}}>团队管理
:
协作者管理
}
{
- nav === "1" ?
+ nav === "1" &&
- :
+ }
+ {
+ (nav !== "1" && addOperation) &&
}
@@ -44,7 +49,7 @@ function Collaborator(props){
nav === "1" ?
:
-
+
}
diff --git a/src/forge/Settings/CollaboratorGroup.jsx b/src/forge/Settings/CollaboratorGroup.jsx
index c6ab6ffb..5c38b1aa 100644
--- a/src/forge/Settings/CollaboratorGroup.jsx
+++ b/src/forge/Settings/CollaboratorGroup.jsx
@@ -10,7 +10,7 @@ const roles = {
read: "报告者",
};
const limit = 15;
-function CollaboratorGroup({ newGroupId, owner, projectsId }) {
+function CollaboratorGroup({ newGroupId, owner, projectsId , setAddOperation }) {
const [list, setList] = useState(undefined);
const [isSpin, setIsSpin] = useState(true);
const [page, setPage] = useState(1);
@@ -34,6 +34,7 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) {
setList(result.data.teams);
setTotal(result.data.total_count);
setIsSpin(false);
+ setAddOperation(result.data.can_add);
}
})
.catch((error) => {});
@@ -47,16 +48,15 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) {
// 添加团队
function addGroup(id) {
const url = `/${owner}/${projectsId}/teams.json`;
- axios
- .post(url, {
- team_id: id,
- })
- .then((result) => {
- if (result && result.data) {
- getData();
- }
- })
- .catch((error) => {});
+ axios.post(url, {
+ team_id: id,
+ })
+ .then((result) => {
+ if (result && result.data) {
+ getData();
+ }
+ })
+ .catch((error) => {});
}
// 删除团队
@@ -77,7 +77,11 @@ function CollaboratorGroup({ newGroupId, owner, projectsId }) {
title: "团队名",
dataIndex: "name",
render: (value, item) => {
- return
{value};
+ if(item.is_admin || item.is_member){
+ return
{value};
+ }else{
+ return
{value};
+ }
},
},
{
diff --git a/src/forge/Settings/CollaboratorMember.jsx b/src/forge/Settings/CollaboratorMember.jsx
index 1104a864..447e3b26 100644
--- a/src/forge/Settings/CollaboratorMember.jsx
+++ b/src/forge/Settings/CollaboratorMember.jsx
@@ -186,7 +186,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
render: (text, item) => (
(
-
+
{text}
),
diff --git a/src/forge/Settings/Index.js b/src/forge/Settings/Index.js
index c8fd2f1e..fe546cdf 100644
--- a/src/forge/Settings/Index.js
+++ b/src/forge/Settings/Index.js
@@ -49,25 +49,25 @@ class Index extends Component {
const { projectsId , owner } = this.props.match.params;
const { pathname } = this.props.history.location;
- const flag = pathname === `/projects/${owner}/${projectsId}/setting`;
+ const flag = pathname === `/${owner}/${projectsId}/settings`;
return (
-
-
+
基本设置
- -1 ? "active" : ""
+ pathname.indexOf("settings/collaborators") > -1 ? "active" : ""
}
>
-
+
协作者管理
@@ -75,11 +75,11 @@ class Index extends Component {
- -1 ? "active" : ""
+ pathname.indexOf("settings/webhooks") > -1 ? "active" : ""
}
>
-
+
Webhooks
@@ -87,30 +87,30 @@ class Index extends Component {
- -1 ? "active" : ""
+ pathname.indexOf("settings/branch") > -1 ? "active" : ""
}
>
-
+
分支设置
- -1 ? "active" : ""}
+ className={pathname.indexOf("settings/labels") > -1 ? "active" : ""}
>
-
-
- 项目标签
+
+
+ 项目标记
{/* - -1 ? "active" : ""
+ pathname.indexOf("settings/manage") > -1 ? "active" : ""
}
>
@@ -127,64 +127,64 @@ class Index extends Component {
{/* webhooks */}
(
)}
>
(
)}
>
(
)}
>
{/* 协作者 */}
(
)}
>
{/* 修改仓库信息 */}
(
)}
>
(
)}
>
(
)}
>
(
)}
>
(
)}
>
{/* 修改仓库信息 */}
(
)}
diff --git a/src/forge/Settings/Setting.js b/src/forge/Settings/Setting.js
index ba6e7a5a..deccb3da 100644
--- a/src/forge/Settings/Setting.js
+++ b/src/forge/Settings/Setting.js
@@ -16,7 +16,7 @@ const menu = [
{name:"合并请求",index:"pulls"},
{name:"Wiki",index:"wiki"},
{name:"工作流(beta版)",index:"devops"},
- {name:"资源库",index:"resources"},
+ // {name:"资源库",index:"resources"},
{name:"里程碑",index:"versions"},
{name:"动态",index:"activity"},
]
@@ -153,18 +153,22 @@ class Setting extends Component {
name: values.project_name,
description: values.project_description,
private: private_check,
+ identifier:values.project_identifier,
...values,
}).then((result) => {
if (result) {
this.props.showNotification(`仓库信息修改成功!`);
- const { getDetail } = this.props;
- getDetail && getDetail();
- this.setState({
- loading:false
- })
+ if(values.project_identifier !== projectsId){
+ this.props.history.push(`/${owner}/${values.project_identifier}/settings`);
+ }else{
+ const { getDetail } = this.props;
+ getDetail && getDetail();
+ }
}
+ this.setState({
+ loading:false
+ })
}).catch((error) => {
- console.log(error);
this.setState({
loading:false
})
@@ -179,11 +183,9 @@ class Setting extends Component {
content: 该操作无法撤销!且将会一并删除相关的易修、合并请求、工作流、里程碑、动态等数据。
是否确认删除 {owner}/{projectName}({projectsId})?,
onOk: () => {
const url = `/${owner}/${projectsId}.json`;
- axios
- .delete(url)
- .then((result) => {
+ axios.delete(url).then((result) => {
this.props.showNotification("仓库删除成功!");
- this.props.history.push("/projects");
+ this.props.history.push(`/${owner}`);
})
.catch((error) => {
console.log(error);
@@ -223,10 +225,14 @@ class Setting extends Component {
}
// 确定转移仓库
onSuccess=(owner)=>{
+ if(owner){
+ this.setState({
+ is_transfering:true,
+ transfer:owner
+ })
+ }
this.setState({
- is_transfering:true,
- divertVisible:false,
- transfer:owner
+ divertVisible:false
})
}
@@ -281,6 +287,20 @@ class Setting extends Component {
)}
+
项目标识 (项目url标识部分,更改项目标识将导致原仓库地址失效)}
+ >
+ {getFieldDecorator("project_identifier", {
+ rules: [
+ {
+ required: true,
+ message: "请输入项目标识",
+ },
+ ],
+ })(
+
+ )}
+
{getFieldDecorator("project_description", {
rules: [],
@@ -293,23 +313,23 @@ class Setting extends Component {
{getFieldDecorator("project_category_id", {
- rules: [
- {
- required: true,
- message: "请选择大类别",
- },
- ],
- })({CategoryList})}
+ rules: [],
+ })(
+
+
+ {CategoryList}
+
+ )}
{getFieldDecorator("project_language_id", {
- rules: [
- {
- required: true,
- message: "请选择项目语言",
- },
- ],
- })({LanguageList})}
+ rules: [],
+ })(
+
+
+ {LanguageList}
+
+ )}
{getFieldDecorator("project_units", {
@@ -351,7 +371,7 @@ class Setting extends Component {
{
is_transfering ?
此仓库正在转移给【
- {transfer && {transfer.name}}
+ {transfer && {transfer.name}}
】,请联系对方接收此仓库。
:
`将此仓库转移给其他用户或组织`
diff --git a/src/forge/Settings/Webhooks/Index.jsx b/src/forge/Settings/Webhooks/Index.jsx
index c6992243..57df13b4 100644
--- a/src/forge/Settings/Webhooks/Index.jsx
+++ b/src/forge/Settings/Webhooks/Index.jsx
@@ -62,7 +62,7 @@ function Index(props) {
if(total >= 20){
return props.showNotification("webhooks数量已到上限!请删除暂不使用的webhooks以进行添加操作");
}
- props.history.push(`/projects/${owner}/${projectsId}/setting/webhooks/new`)
+ props.history.push(`/${owner}/${projectsId}/settings/webhooks/new`)
}
return(
@@ -90,9 +90,9 @@ function Index(props) {
return(
- {i.url}
+ {i.url}
- {props.history.push(`/projects/${owner}/${projectsId}/setting/webhooks/${i.id}`)}}>编辑
+ {props.history.push(`/${owner}/${projectsId}/settings/webhooks/${i.id}`)}}>编辑
{deleteFunc(i.id,i.url)}}>删除
diff --git a/src/forge/Settings/Webhooks/New.jsx b/src/forge/Settings/Webhooks/New.jsx
index 0dedaa83..22b3899d 100644
--- a/src/forge/Settings/Webhooks/New.jsx
+++ b/src/forge/Settings/Webhooks/New.jsx
@@ -111,7 +111,7 @@ function New({ form , match , showNotification , history }) {
}).then(result=>{
if(result){
showNotification("webhook更新成功!");
- history.push(`/projects/${owner}/${projectsId}/setting/webhooks`);
+ history.push(`/${owner}/${projectsId}/settings/webhooks`);
}
}).catch(error=>{})
}else{
@@ -125,7 +125,7 @@ function New({ form , match , showNotification , history }) {
}).then(result=>{
if(result && result.data && result.data.id){
showNotification("webhook新建成功!");
- history.push(`/projects/${owner}/${projectsId}/setting/webhooks`);
+ history.push(`/${owner}/${projectsId}/settings/webhooks`);
}
}).catch(error=>{})
}
@@ -157,7 +157,7 @@ function New({ form , match , showNotification , history }) {
axios.delete(url).then(result=>{
if(result){
showNotification("webhook删除成功!");
- history.push(`/projects/${owner}/${projectsId}/setting/webhooks`);
+ history.push(`/${owner}/${projectsId}/settings/webhooks`);
}
}).catch(error=>{})
}
@@ -180,7 +180,7 @@ function New({ form , match , showNotification , history }) {
subTitle={`删除后未来事件将不会推送至此Webhook地址:${data && data.url}`}
/>
- Webhooks
+ Webhooks
{id ? "更新" : "添加"}Webhook
@@ -258,11 +258,11 @@ function New({ form , match , showNotification , history }) {
*/}
创建
- 创建分支或标签
+ 创建分支或标记
删除
- 删除分支或标签
+ 删除分支或标记
合并请求事件
diff --git a/src/forge/Settings/new_tags.js b/src/forge/Settings/new_tags.js
index bc763f9c..ed9269cb 100644
--- a/src/forge/Settings/new_tags.js
+++ b/src/forge/Settings/new_tags.js
@@ -348,7 +348,7 @@ class NewTags extends Component {
this.deletetag(item.id)}
@@ -383,7 +383,7 @@ class NewTags extends Component {
return (
-
共{data && data.issue_tags_count}个标签
+
共{data && data.issue_tags_count}个标记
-
- 标签
+ 标记
@@ -423,11 +423,11 @@ class NewTags extends Component {
className="flex-a-center baseForm bbr"
style={{ "justify-content": "space-between" }}
>
- 项目标签
+ 项目标记
{data && data.user_admin_or_member ? (
- 创建标签
+ 创建标记
) : (
""
@@ -442,7 +442,7 @@ class NewTags extends Component {
rules: [
{
required: true,
- message: "请填写标签名字",
+ message: "请填写标记名字",
},
],
})()}
@@ -481,7 +481,7 @@ class NewTags extends Component {
onClick={this.createtagpost}
className="fr"
>
- 创建标签
+ 创建标记
{/* 创建标签 */}
@@ -497,7 +497,7 @@ class NewTags extends Component {
+
{getFieldDecorator("tagName",{
- rules:[{required:true,message:"请输入标签名"}]
+ rules:[{required:true,message:"请输入标记名"}]
})(
-
+
)}
diff --git a/src/forge/Source/Index.jsx b/src/forge/Source/Index.jsx
index 8ba92587..1a57074a 100644
--- a/src/forge/Source/Index.jsx
+++ b/src/forge/Source/Index.jsx
@@ -141,7 +141,7 @@ function Index(props){
params:{id,tagName:tag}
}).then(result=>{
if(result && result.data){
- props.showNotification("标签删除成功");
+ props.showNotification("标记删除成功");
setIsSpin(true);
getData();
}
@@ -217,7 +217,7 @@ function Index(props){
data.map((item,key)=>{
return(
-
-
+
diff --git a/src/forge/Team/Group/GroupDetailProject.jsx b/src/forge/Team/Group/GroupDetailProject.jsx
index 0c843f0a..20284c9f 100644
--- a/src/forge/Team/Group/GroupDetailProject.jsx
+++ b/src/forge/Team/Group/GroupDetailProject.jsx
@@ -31,7 +31,7 @@ export default (({projects}) => {
return (
-
{item.project.name}
+
{item.project.name}
)
})
diff --git a/src/forge/Team/Group/GroupDetailSetting.jsx b/src/forge/Team/Group/GroupDetailSetting.jsx
index fa060ee3..168ba6ff 100644
--- a/src/forge/Team/Group/GroupDetailSetting.jsx
+++ b/src/forge/Team/Group/GroupDetailSetting.jsx
@@ -26,18 +26,18 @@ export default (props)=>{
function returnActive (pathname){
let a = 0;
- if(pathname === `/organize/${OIdentifier}/group/${groupId}/setting/member`){
+ if(pathname === `/${OIdentifier}/teams/${groupId}/setting/member`){
a = 1;
- }else if(pathname === `/organize/${OIdentifier}/group/${groupId}/setting/project`){
+ }else if(pathname === `/${OIdentifier}/teams/${groupId}/setting/project`){
a = 2;
}
return a;
}
const active = returnActive(pathname);
const array = {list:[
- {name:'基本设置',icon:"icon-base",href:`/organize/${OIdentifier}/group/${groupId}/setting`},
- {name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${OIdentifier}/group/${groupId}/setting/member`},
- {name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${OIdentifier}/group/${groupId}/setting/project`},
+ {name:'基本设置',icon:"icon-base",href:`/${OIdentifier}/teams/${groupId}/setting`},
+ {name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/${OIdentifier}/teams/${groupId}/setting/member`},
+ {name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/${OIdentifier}/teams/${groupId}/setting/project`},
],
active
}
@@ -51,19 +51,19 @@ export default (props)=>{
(
)}
>
(
)}
>
(
)}
diff --git a/src/forge/Team/Group/GroupDetails.jsx b/src/forge/Team/Group/GroupDetails.jsx
index 75183f35..ba569386 100644
--- a/src/forge/Team/Group/GroupDetails.jsx
+++ b/src/forge/Team/Group/GroupDetails.jsx
@@ -87,9 +87,9 @@ export default ((props) => {
if (username) {
const url = `/organizations/${OIdentifier}/teams/${groupId}/team_users/quit.json`;
axios.delete(url).then((result) => {
- if (result && result.data) {
+ if (result && result.message==='success') {
props.showNotification(`已成功退出团队!`);
- props.history.push(`/organize/${OIdentifier}`);
+ props.history.push(`/${username}`);
}
}).catch((error) => { });
}
@@ -119,7 +119,7 @@ export default ((props) => {
管理员团队对 所有仓库 具有操作权限,且对组织具有 管理员权限。
此外,该团队拥有了 创建仓库 的权限:成员可以在组织中创建新的仓库。
- {group.is_admin ?
props.history.push(`/organize/${OIdentifier}/group/${groupId}/setting`)}>团队设置 : ""}
+ {group.is_admin ?
props.history.push(`/${OIdentifier}/teams/${groupId}/setting`)}>团队设置 : ""}
:
diff --git a/src/forge/Team/Group/GroupForm.jsx b/src/forge/Team/Group/GroupForm.jsx
index 2eb8540f..94825905 100644
--- a/src/forge/Team/Group/GroupForm.jsx
+++ b/src/forge/Team/Group/GroupForm.jsx
@@ -24,21 +24,25 @@ export default Form.create()(
const [check_box, setCheckBox] = useState(false);
const [switch_box, setSwtichBox] = useState([]);
const [onwers, setOnwers] = useState(false);
+ const [auth, setAuth] = useState("");
const [ descNum , setDescNum ] = useState(0);
const [switch_box_code, setSwtichBoxCode] = useState(false);
const [switch_box_pull, setSwtichBoxPull] = useState(false);
const [switch_box_issue, setSwtichBoxIssue] = useState(false);
const [switch_box_release, setSwtichBoxRelease] = useState(false);
+ const [switch_box_wiki, setSwtichBoxWiki] = useState(false);
const { getFieldDecorator, validateFields, setFieldsValue } = form;
const { OIdentifier, groupId } = match.params;
useEffect(() => {
if (GroupDetail) {
setOnwers(GroupDetail.authorize === "owner");
+ setAuth(GroupDetail.authorize);
setCheckBox(GroupDetail.can_create_org_project)
setSwtichBox(GroupDetail.units)
setFieldsValue({
- ...GroupDetail
+ ...GroupDetail,
+ includes_all_project:GroupDetail.includes_all_project ? 1 :0
})
setDescNum(GroupDetail.description ? GroupDetail.description.length : 0);
}
@@ -50,6 +54,7 @@ export default Form.create()(
setSwtichBoxPull(switch_checked("pulls"))
setSwtichBoxIssue(switch_checked("issues"))
setSwtichBoxRelease(switch_checked("releases"))
+ setSwtichBoxWiki(switch_checked("wiki"))
}
}, [switch_box])
@@ -68,25 +73,28 @@ export default Form.create()(
setIsSpin(true)
validateFields((error, values) => {
if (!error) {
- values.unit_types = switch_box
+ // values.unit_types = switch_box
+ values.unit_types = ['code','pulls','issues','releases','wiki'];
if (groupId) { // 表示编辑,否则为新建
const url = `/organizations/${OIdentifier}/teams/${groupId}.json`;
axios.put(url, {
- ...values
+ ...values,
+ includes_all_project:values.includes_all_project === 1?true:false
}).then(result => {
if (result && result.data) {
showNotification("基本设置更新成功!");
- history.push(`/organize/${OIdentifier}/group/${groupId}`);
+ history.push(`/${OIdentifier}/teams/${groupId}`);
}
}).catch(error => { })
} else {
const url = `/organizations/${OIdentifier}/teams.json`;
axios.post(url, {
- ...values
+ ...values,
+ includes_all_project:values.includes_all_project === 1?true:false
}).then(result => {
if (result && result.data) {
showNotification("团队创建成功!");
- history.push(`/organize/${OIdentifier}/group/${result.data.id}`);
+ history.push(`/${OIdentifier}/teams/${result.data.id}`);
}
}).catch(error => { })
}
@@ -132,14 +140,22 @@ export default Form.create()(
setSwtichBoxRelease(checked)
}
+ function switch_wiki_types(checked, event) {
+ switch_unit_types(checked, "wiki");
+ setSwtichBoxWiki(checked);
+ }
+
function cancelEdit(){
if(groupId){
- history.push(`/organize/${OIdentifier}/group/${groupId}`);
+ history.push(`/${OIdentifier}/teams/${groupId}`);
}else{
- history.push(`/organize/${OIdentifier}`);
+ history.push(`/${OIdentifier}`);
}
}
+ function changeAuth(params) {
+ setAuth(params.target.value)
+ }
function checkname(rule, value, callback){
if(!value){
@@ -192,8 +208,8 @@ export default Form.create()(
"includes_all_project",
[],
- 指定项目(团队成员将只能访问添加到团队的项目。 选择此项 将不会 自动删除已经添加的项目)
- 所有项目(团队可以访问所有项目。选择此选项将 添加所有现有的 项目到指定团队)
+ 指定项目(团队成员将只能访问添加到团队的项目。 选择此项 将不会 自动删除已经添加的项目)
+ 所有项目(团队可以访问所有项目。选择此选项将 添加所有现有的 项目到指定团队)
, false, 0,onwers ? "hide":""
)}
{helper(
@@ -202,37 +218,42 @@ export default Form.create()(
[],
新建项目(成员可以在组织中新建项目。创建者将自动获得新建的项目的管理员权限), false, 20,onwers ? "hide":""
)}
- {/* {helper(
+ {helper(
'版本库权限:',
"authorize",
[],
-
+
读取权限(成员可以查看和克隆团队项目)
写入权限(成员可以查看和推送提交到团队项目)
管理员权限(成员可以拉取和推送到团队项目同时可以添加协作者)
, false, 20,onwers ? "hide":""
- )} */}
+ )}
- {/* 允许访问项目单元:
-
-
- 代码库(查看源码、文件、提交和分支)
-
-
-
- 任务(组织 bug 报告、任务和里程碑)
-
-
-
- 合并请求(启用合并请求和代码评审)
-
-
-
- 版本发布(跟踪项目版本和下载)
-
- */}
+ {/*
+
允许访问项目单元:
+
+
+ 代码库(查看源码、文件、提交和分支)
+
+
+
+ 任务(组织 bug 报告、任务和里程碑)
+
+
+
+ 合并请求(启用合并请求和代码评审)
+
+
+
+ 版本发布(跟踪项目版本和下载)
+
+
+
+ wiki(编辑此仓库的相关文档说明)
+
+
*/}
{groupId ? "更新团队设置" : "新建团队"}
- cancelEdit()}>取消
+ cancelEdit()}>取消
diff --git a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx
index a0d8ec78..998e7339 100644
--- a/src/forge/Team/Group/Setting/GroupMemberSetting.jsx
+++ b/src/forge/Team/Group/Setting/GroupMemberSetting.jsx
@@ -87,7 +87,7 @@ export default ((props) => {
align: "center",
render: (value, item) => {
return (
-
{item.user.name}
+
{item.user.name}
)
}
},
diff --git a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
index 1762a864..9a4f3958 100644
--- a/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
+++ b/src/forge/Team/Group/Setting/GroupProjectSetting.jsx
@@ -180,7 +180,7 @@ function GroupProjectSetting(props) {
}
>
{item.project.owner_name}/{item.project.name}}
+ title={{item.project.owner_name}/{item.project.name}}
/>
)}
diff --git a/src/forge/Team/Index.jsx b/src/forge/Team/Index.jsx
index fd4afedf..1a3bfde9 100644
--- a/src/forge/Team/Index.jsx
+++ b/src/forge/Team/Index.jsx
@@ -26,39 +26,16 @@ const SubDetailIndex = Loadable({
loader: () => import("./Sub/SubDetail"),
loading: Loading,
});
+// forge项目详情
+const ProjectDetail = Loadable({
+ loader: () => import("../Main/Detail"),
+ loading: Loading,
+});
export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
((props)=>{
return (
- {/* 组织团队-设置 */}
- {
- return
- }}
- >
- {/* 组织团队-新建 */}
- {
- return
- }}
- >
- {/* 组织团队-子级(包含组织团队列表) */}
- {
- return
- }}
- >
- {/* 组织成员 */}
- {
- return
- }}
- >
{/* 新建组织 */}
}}
>
+ {/* 组织团队-新建 */}
+ {
+ return
+ }}
+ >
+ {/* 组织团队-设置 */}
+ {
+ return
+ }}
+ >
+ {/* 组织团队-子级(包含组织团队列表) */}
+ {
+ return
+ }}
+ >
+ {/* 组织成员 */}
+ {
+ return
+ }}
+ >
+
+
{/* 组织详情(包含组织设置) */}
(
+
+ )}
+ >
+
+ {/* 组织下的项目详情 */}
+ (
+
+ )}
+ >
+
+ {/* 组织详情(包含组织设置) */}
+ (
)}
diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss
index a046f99d..11237973 100644
--- a/src/forge/Team/Index.scss
+++ b/src/forge/Team/Index.scss
@@ -368,5 +368,5 @@
}
}
.hide{
- display: hidden;
+ display: none;
}
\ No newline at end of file
diff --git a/src/forge/Team/List.jsx b/src/forge/Team/List.jsx
index b43fb75d..48a19c22 100644
--- a/src/forge/Team/List.jsx
+++ b/src/forge/Team/List.jsx
@@ -6,6 +6,7 @@ import './Index.scss';
import Item from './ListItem';
import Right from './RightBox';
import NoData from '../Nodata';
+import CheckProfile from '../Component/ProfileModal/Profile';
import { Menu , Pagination , Dropdown , Spin } from 'antd';
import axios from 'axios';
@@ -18,7 +19,6 @@ function List(props){
const [ search , setSearch ] = useState(undefined);
const [ page , setPage ] = useState(1);
const [ sortBy , setSortBy ] = useState("updated_on");
- const [ sortDirection , setSortDirection ] = useState("asc");
const OIdentifier = props.match.params.OIdentifier;
const organizeDetail = props.organizeDetail;
@@ -36,7 +36,7 @@ function List(props){
params:{
search,page,limit,
sort_by:sortBy,
- sort_direction:sortDirection
+ sort_direction:"desc"
}
}).then(result=>{
if(result && result.data){
@@ -60,10 +60,14 @@ function List(props){
)
const menu_new=(
-
+
+ -
+ {props.history.push(`/projects/deposit/new/${OIdentifier}`)}}>新建项目
+
+ -
+ {props.history.push(`/projects/mirror/new/${OIdentifier}`)}}>导入项目
+
+
)
return(
@@ -75,8 +79,8 @@ function List(props){
- { organizeDetail && organizeDetail.is_admin ?
-
+ { organizeDetail && organizeDetail.can_create_project ?
+
+ 新建项目
:""}
@@ -106,7 +110,13 @@ function List(props){
}
-
+
)
}
diff --git a/src/forge/Team/ListItem.jsx b/src/forge/Team/ListItem.jsx
index 3c2cf3f4..a908f80b 100644
--- a/src/forge/Team/ListItem.jsx
+++ b/src/forge/Team/ListItem.jsx
@@ -7,7 +7,7 @@ function ListItem({item,key,OIdentifier}) {