+
{ setCheckItem(item) }}>
{item.name}
@@ -266,9 +253,7 @@ export default (props) => {
-
-
-
+
}
@@ -277,9 +262,9 @@ export default (props) => {
{checkItem.name}
-
{ goUser(current_user.login) }}>
+ { checkItem.commit && goUser(checkItem.commit.author.name) }}>
{itemDetail.image_url &&
}
- {checkItem.commit ? checkItem.commit.author.name : ''}
+ {itemDetail.userName}
上次修改于{checkItem.commit && timeAgo(checkItem.commit.author.when)}
diff --git a/src/forge/Wiki/Index.scss b/src/forge/Wiki/Index.scss
index c571da25f..e40de299f 100644
--- a/src/forge/Wiki/Index.scss
+++ b/src/forge/Wiki/Index.scss
@@ -199,7 +199,7 @@ body {
word-break: break-all;
}
- .copy-svg {
+ .copy-wiki {
display: inline-flex;
align-items: center;
justify-content: center;
diff --git a/src/forge/Wiki/Preview.jsx b/src/forge/Wiki/Preview.jsx
index 20645246a..e7c6a6236 100644
--- a/src/forge/Wiki/Preview.jsx
+++ b/src/forge/Wiki/Preview.jsx
@@ -1,5 +1,6 @@
import React, { useEffect, useCallback, useState } from 'react';
-import { Input, Button, Tooltip, Select, Dropdown, Icon, Menu, message } from 'antd';
+import { Input, Button, Select, Dropdown, Icon, Menu, message } from 'antd';
+import CopyTool from '../Component/CopyTool';
import { wikiPages, getWiki, } from './api';
import { httpUrl } from './fetch';
import './Index.scss';
@@ -59,16 +60,6 @@ export default (props) => {
});
}, [project, checkItem]);
- const copyUrl = useCallback(() => {
- let wikiUrl = document.getElementById("wikiUrl");
- wikiUrl.select();
- if (document.execCommand('copy')) {
- document.execCommand('copy');
- }
- message.success('复制成功');
- wikiUrl.blur();
- }, []);
-
function goEdit() {
history.push(`/projects/${owner}/${projectsId}/wiki/edit/${checkItem.name}`);
}
@@ -113,9 +104,7 @@ export default (props) => {
-
-
-
+
}
diff --git a/src/forge/Wiki/components/Login/index.jsx b/src/forge/Wiki/components/Login/index.jsx
index 9574a9a51..abfa52957 100644
--- a/src/forge/Wiki/components/Login/index.jsx
+++ b/src/forge/Wiki/components/Login/index.jsx
@@ -1,10 +1,9 @@
import React, { useState } from 'react';
import * as ReactDOM from 'react-dom';
import LoginDialog from '../../../../modules/login/LoginDialog';
-import './index.scss';
-// 使用函数调用删除组件
-export default function DelModal(props) {
+// 使用函数调用登录组件
+export default function Login(props) {
const div = document.createElement('div');
document.body.appendChild(div);
@@ -16,9 +15,6 @@ export default function DelModal(props) {
}
function render() {
- /**
- * Sync render blocks React event. Let's make this async.
- */
setTimeout(() => {
ReactDOM.render(
diff --git a/src/forge/Wiki/components/Login/index.scss b/src/forge/Wiki/components/Login/index.scss
deleted file mode 100644
index 13d160665..000000000
--- a/src/forge/Wiki/components/Login/index.scss
+++ /dev/null
@@ -1,56 +0,0 @@
-.delete-modal {
- .ant-modal-header {
- padding: 9px 24px;
- background: #f8f8f8;
- border-bottom: 1px solid #eee;
- }
- .ant-modal-title {
- text-align: left;
- }
- .ant-modal-close {
- top: 0px !important;
- }
- .ant-modal-close-x {
- font-size: 24px;
- }
- .ant-modal-body {
- text-align: center;
- }
- .delete-title {
- display: flex;
- justify-content: center;
- align-items: center;
- margin: 2rem 0 1rem !important;
- font-size: 16px;
- color: #333;
- letter-spacing: 0;
- line-height: 29px;
- font-weight: 400;
- }
- .red-circle {
- align-self: flex-start;
- color: #ca0002;
- font-size: 1.5rem !important;
- }
- .delete-descibe {
- font-size: 14px;
- color: #666;
- line-height: 33px;
- font-weight: 400;
- }
- .ant-modal-footer {
- padding: 2rem 0;
- text-align: center;
- border: 0;
- .ant-btn {
- width: 6rem;
- }
- }
- .foot-submit {
- margin-left: 3rem;
- color: #df0002;
- &:hover {
- border-color: #df0002;
- }
- }
-}
\ No newline at end of file
diff --git a/src/forge/Wiki/components/ModalFun/index.jsx b/src/forge/Wiki/components/ModalFun/index.jsx
index 661eca31b..73fbfd379 100644
--- a/src/forge/Wiki/components/ModalFun/index.jsx
+++ b/src/forge/Wiki/components/ModalFun/index.jsx
@@ -8,7 +8,8 @@ export default function DelModal(props) {
renderModal({ ...props, type: 'delete' })
}
-export function confirmModal(props) {
+// 使用函数调用选择模态框组件
+export function Confirm(props) {
renderModal({ ...props, type: 'confirm' })
}
@@ -35,9 +36,6 @@ function renderModal(props) {
}
function render() {
- /**
- * Sync render blocks React event. Let's make this async.
- */
setTimeout(() => {
ReactDOM.render(
modalType(type),
@@ -48,7 +46,8 @@ function renderModal(props) {
render();
}
-// 真正的删除组件
+
+// 删除组件
function DeleteModal({
onCancel,
onOk,
@@ -81,7 +80,7 @@ function DeleteModal({
className="myself-modal"
centered
footer={[
-
From 061fa0ee71d83e18ec26c64eb0359686a3ff2141 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Tue, 24 Aug 2021 16:14:49 +0800
Subject: [PATCH 04/13] =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=9B=A2=E9=98=9F?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=8F=AF=E9=80=89?=
=?UTF-8?q?=E8=AE=BF=E9=97=AE=E5=8D=95=E5=85=83wiki?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Team/Group/GroupForm.jsx | 57 +++++++++++++++++++-----------
src/forge/Team/Index.scss | 2 +-
2 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/src/forge/Team/Group/GroupForm.jsx b/src/forge/Team/Group/GroupForm.jsx
index 1be7bdc03..e27161e0a 100644
--- a/src/forge/Team/Group/GroupForm.jsx
+++ b/src/forge/Team/Group/GroupForm.jsx
@@ -24,21 +24,24 @@ 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,
})
setDescNum(GroupDetail.description ? GroupDetail.description.length : 0);
}
@@ -50,6 +53,7 @@ export default Form.create()(
setSwtichBoxPull(switch_checked("pulls"))
setSwtichBoxIssue(switch_checked("issues"))
setSwtichBoxRelease(switch_checked("releases"))
+ setSwtichBoxWiki(switch_checked("wiki"))
}
}, [switch_box])
@@ -132,6 +136,11 @@ 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}`);
@@ -140,6 +149,9 @@ export default Form.create()(
}
}
+ function changeAuth(params) {
+ setAuth(params.target.value)
+ }
function checkname(rule, value, callback){
if(!value){
@@ -206,31 +218,36 @@ export default Form.create()(
'版本库权限:',
"authorize",
[],
-
+
读取权限(成员可以查看和克隆团队项目)
写入权限(成员可以查看和推送提交到团队项目)
管理员权限(成员可以拉取和推送到团队项目同时可以添加协作者)
, false, 20,onwers ? "hide":""
)}
- 允许访问项目单元:
-
-
- 代码库(查看源码、文件、提交和分支)
-
-
-
- 任务(组织 bug 报告、任务和里程碑)
-
-
-
- 合并请求(启用合并请求和代码评审)
-
-
-
- 版本发布(跟踪项目版本和下载)
-
-
+
+
允许访问项目单元:
+
+
+ 代码库(查看源码、文件、提交和分支)
+
+
+
+ 任务(组织 bug 报告、任务和里程碑)
+
+
+
+ 合并请求(启用合并请求和代码评审)
+
+
+
+ 版本发布(跟踪项目版本和下载)
+
+
+
+ wiki(编辑此仓库的相关文档说明)
+
+
{groupId ? "更新团队设置" : "新建团队"}
cancelEdit()}>取消
diff --git a/src/forge/Team/Index.scss b/src/forge/Team/Index.scss
index a046f99d8..112379734 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
From 52e08e77e576754ab3b64bd60d759e5e96f14189 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <792998983@qq.com>
Date: Wed, 25 Aug 2021 11:34:46 +0800
Subject: [PATCH 05/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9websocket=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Main/Detail.js | 723 ++++++++++++++++++++-------------------
src/forge/New/Index.js | 37 +-
2 files changed, 407 insertions(+), 353 deletions(-)
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index f01ef2d3e..8128ff48a 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
-import { Spin, Tooltip , Button } from 'antd';
+import { Spin, Tooltip, Button } from 'antd';
import { Link, Route, Switch } from 'react-router-dom';
-import { Content , AlignTop } from '../Component/layout';
+import { Content, AlignTop } from '../Component/layout';
import DetailBanner from './sub/DetailBanner';
import '../css/index.scss'
import './list.css';
@@ -103,12 +103,12 @@ const Contribute = Loadable({
})
const CoderRootCommit = Loadable({
- loader: () => import('./CoderRootCommit'),
- loading: Loading,
+ loader: () => import('./CoderRootCommit'),
+ loading: Loading,
})
const CoderDepot = Loadable({
- loader: () => import('./CoderDepot'),
- loading: Loading,
+ loader: () => import('./CoderDepot'),
+ loading: Loading,
})
const TrendsIndex = Loadable({
@@ -139,28 +139,28 @@ const WikiEdit = Loadable({
/**
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
*/
-function checkPathname(projectsId,owner,pathname){
+function checkPathname(projectsId, owner, pathname) {
let name = "";
- if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
+ if (pathname && pathname !== `/projects/${owner}/${projectsId}`) {
let url = pathname.split(`/projects/${owner}/${projectsId}`)[1];
- if(url.indexOf("/about")>-1){
- name="about"
- }else if(url.indexOf("/issues")>-1 ||url.indexOf("Milepost") > 0){
+ if (url.indexOf("/about") > -1) {
+ name = "about"
+ } else if (url.indexOf("/issues") > -1 || url.indexOf("Milepost") > 0) {
name = "issues";
- }else if(url.indexOf("/pulls")>-1){
- name="pulls"
- }else if(url.indexOf("/milestones")>-1){
- name="milestones"
- }else if(url.indexOf("/activity")>-1){
- name="activity"
- }else if(url.indexOf("/setting")>-1){
- name="setting"
- }else if(url.indexOf(`/devops`)>-1){
- name="devops"
- }else if(url.indexOf(`/source`)>-1){
- name="source"
- }else if(url.indexOf(`/wiki`)>-1){
- name="wiki"
+ } else if (url.indexOf("/pulls") > -1) {
+ name = "pulls"
+ } else if (url.indexOf("/milestones") > -1) {
+ name = "milestones"
+ } else if (url.indexOf("/activity") > -1) {
+ name = "activity"
+ } else if (url.indexOf("/setting") > -1) {
+ name = "setting"
+ } else if (url.indexOf(`/devops`) > -1) {
+ name = "devops"
+ } else if (url.indexOf(`/source`) > -1) {
+ name = "source"
+ } else if (url.indexOf(`/wiki`) > -1) {
+ name = "wiki"
}
}
return name;
@@ -183,15 +183,15 @@ class Detail extends Component {
branchs: undefined,
branchList: undefined,
project: null,
- firstSync:false,
- secondSync:false,
- open_devops:false,
- forkSpin:false,
+ firstSync: false,
+ secondSync: false,
+ open_devops: false,
+ forkSpin: false,
// 默认分支
- defaultBranch:undefined,
+ defaultBranch: undefined,
// 非本平台项目
- platform:false
+ platform: false
}
}
@@ -208,36 +208,38 @@ class Detail extends Component {
}
getProject = (num) => {
- const { projectsId , owner } = this.props.match.params;
+ const { projectsId, owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/simple.json`;
axios.get(url).then((result) => {
if (result && result.data) {
this.setState({
project: result.data,
- open_devops:result.data.open_devops,
- platform:result.data.platform && result.data.platform !== 'educoder'
+ open_devops: result.data.open_devops,
+ platform: result.data.platform && result.data.platform !== 'educoder'
})
if (result.data.type !== 0 && result.data.mirror_status === 1) {
console.log("--------start channel --------");
// 是镜像项目,且未完成迁移
this.canvasChannel();
- if(num){
+ if (num) {
this.setState({
- secondSync:true,
- firstSync:false
+ secondSync: true,
+ firstSync: false
})
- }else{
+ } else {
this.setState({
- firstSync:true,
- secondSync:false
+ firstSync: true,
+ secondSync: false
})
}
- }else{
+ } else if (result.data.mirror_status === 2) {
+ this.deleteProjectBack();
+ } else {
this.getDetail();
this.setState({
- firstSync:false,
- secondSync:false
+ firstSync: false,
+ secondSync: false
})
}
}
@@ -245,9 +247,9 @@ class Detail extends Component {
}
// 工作流激活后修改状态
- changeOpenDevops=(flag)=>{
+ changeOpenDevops = (flag) => {
this.setState({
- open_devops:flag
+ open_devops: flag
})
}
canvasChannel = () => {
@@ -265,11 +267,15 @@ class Detail extends Component {
disconnected: () => { },
received: data => {
console.log(`###### ---received data--- ######`);
+ console.log(data);
if (data) {
+ if ( data.project && data.project.mirror_status === 2) {
+ this.deleteProjectBack();
+ }
this.getDetail();
this.setState({
- firstSync:false,
- secondSync:false
+ firstSync: false,
+ secondSync: false
});
cable.subscriptions.consumer.disconnect();
}
@@ -277,8 +283,25 @@ class Detail extends Component {
})
}
+ deleteProjectBack = () => {
+ const { history } = this.props;
+ const { projectsId, owner } = this.props.match.params;
+ axios.delete(`/${owner}/${projectsId}.json`).then(res => {
+ let hash = '/projects/mirror/new';
+ if (res && res.data) {
+ history.push({
+ pathname: hash,
+ mirror_status: 2
+ });
+ }
+ else {
+ window.location.hash = hash;
+ }
+ });
+ }
+
getDetail = () => {
- const { projectsId , owner } = this.props.match.params;
+ const { projectsId, owner } = this.props.match.params;
this.getBanner();
const url = `/${owner}/${projectsId}/detail.json`;
axios.get(url).then((result) => {
@@ -295,29 +318,29 @@ class Detail extends Component {
watchers_count: result.data.watchers_count,
praises_count: result.data.praises_count,
forked_count: result.data.forked_count,
- defaultBranch:result.data.default_branch
+ defaultBranch: result.data.default_branch
})
}
}).catch((error) => { })
}
// 获取动态导航栏菜单
- getBanner(){
- const { projectsId , owner } = this.props.match.params;
+ getBanner() {
+ const { projectsId, owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/menu_list.json`;
- axios.get(url).then(result=>{
- if(result){
+ axios.get(url).then(result => {
+ if (result) {
this.setState({
- bannerList:result.data
+ bannerList: result.data
})
}
- }).catch(error=>{})
+ }).catch(error => { })
}
// 关注和取消关注
focusFunc = (flag) => {
const { platform } = this.state;
- if(!platform)return;
+ if (!platform) return;
const { project_id } = this.state;
axios({
@@ -332,15 +355,15 @@ class Detail extends Component {
this.setWatchersCount(result.data.watchers_count, result.data.watched);
}
})
- .catch(error => {
- console.log(error);
- });
+ .catch(error => {
+ console.log(error);
+ });
}
// 点赞和取消点赞
pariseFunc = (flag) => {
const { platform } = this.state;
- if(!platform)return;
+ if (!platform) return;
const { project_id } = this.state;
axios({
method: flag ? 'delete' : 'post',
@@ -350,9 +373,9 @@ class Detail extends Component {
this.setPraisesCount(result.data.praises_count, result.data.praised)
}
})
- .catch(error => {
- console.log(error);
- });
+ .catch(error => {
+ console.log(error);
+ });
}
setWatchersCount = (count, is_watched) => {
@@ -372,12 +395,12 @@ class Detail extends Component {
// fork项目
forkFunc = () => {
const { platform } = this.state;
- if(!platform)return;
+ if (!platform) return;
this.setState({
- forkSpin:true
+ forkSpin: true
})
const { current_user } = this.props
- const { projectsId , owner } = this.props.match.params;
+ const { projectsId, owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/forks.json`;
axios.post(url).then(result => {
if (result && result.data.status === 0) {
@@ -385,11 +408,11 @@ class Detail extends Component {
this.props.showNotification(result.data.message);
}
this.setState({
- forkSpin:false
+ forkSpin: false
})
}).catch(error => {
this.setState({
- forkSpin:false
+ forkSpin: false
})
})
}
@@ -397,8 +420,8 @@ class Detail extends Component {
// 同步镜像
synchronismMirror = () => {
const { platform } = this.state;
- if(!platform)return;
- const { projectsId , owner } = this.props.match.params;
+ if (!platform) return;
+ const { projectsId, owner } = this.props.match.params;
const url = `/${owner}/${projectsId}/sync_mirror.json`;
axios.post(url).then(result => {
if (result && result.data && result.data.status === 0) {
@@ -412,344 +435,344 @@ class Detail extends Component {
})
}
- textFunc = (forked_from_project_id,fork_info)=>{
+ textFunc = (forked_from_project_id, fork_info) => {
let type = fork_info && fork_info.fork_project_user_type;
return forked_from_project_id && fork_info ?
复刻自
- {fork_info.fork_project_user_name}
+ {fork_info.fork_project_user_name}
/
- {fork_info.fork_form_name}
+ {fork_info.fork_form_name}
: ""
}
-
+
render() {
- const { projectDetail, watchers_count, praises_count,
- forked_count, firstSync , secondSync ,
- isManager, watched, praised,
- project , open_devops , platform , defaultBranch , bannerList , forkSpin } = this.state;
+ const { projectDetail, watchers_count, praises_count,
+ forked_count, firstSync, secondSync,
+ isManager, watched, praised,
+ project, open_devops, platform, defaultBranch, bannerList, forkSpin } = this.state;
const url = this.props.history.location.pathname;
const urlArr = url.split("/");
const urlFlag = (urlArr.length === 3);
- const { projectsId , owner } = this.props.match.params;
+ const { projectsId, owner } = this.props.match.params;
const { current_user } = this.props;
- let pathname = checkPathname(projectsId,owner,url);
+ let pathname = checkPathname(projectsId, owner, url);
const { state } = this.props.history.location;
-
+
const common = {
getDetail: this.getDetail,
- changeOpenDevops:this.changeOpenDevops,
+ changeOpenDevops: this.changeOpenDevops,
defaultBranch
}
return (
-
+
{project && project.author &&
- {project.author.name}
+ {project.author.name}
}
/
{projectDetail && projectDetail.name}
- { projectDetail && projectDetail.private && 私有}
+ {projectDetail && projectDetail.private && 私有}
{
projectDetail && projectDetail.forked_from_project_id && projectDetail.fork_info ?
- this.textFunc(projectDetail.forked_from_project_id,projectDetail.fork_info)
- :""
+ this.textFunc(projectDetail.forked_from_project_id, projectDetail.fork_info)
+ : ""
}
{
- projectDetail && projectDetail.type && projectDetail.type !== 0 ?
-
镜像自 {projectDetail.mirror_url}
- :""
+ projectDetail && projectDetail.type && projectDetail.type !== 0 ?
+
镜像自 {projectDetail.mirror_url}
+ : ""
}
{
firstSync ? "" :
-
+
}
{
firstSync ?
-
-
-
- :
-
-
- {/* 资源 */}
- ()
- }
- >
- {/* 主页 */}
- ()
- }
- >
- {/* wiki新增文件 */}
- ()
- }
- >
- {/* wiki编辑文件 */}
- ()
- }
- >
- {/* wiki */}
- ()
- }
- >
- {/* 工作流 */}
- ()
- }
- >
- {/* 标签列表 */}
- ()
- }
- >
- {/* 仓库设置 */}
- ()
- }
- >
- {/* 任务详情 */}
- ()
- }
- >
- {/*修改里程碑*/}
- ()
- }
- >
- {/* 新建里程碑 */}
- ()
- }
- >
- {/*里程碑详情*/}
- ()
- }
- >
- {/* 里程碑 */}
- ()
- }
- >
- {/* 里程碑页面新建任务 */}
- ()
- }
- >
- {/* 新建任务 */}
- ()
- }
- >
- {/* 修改详情 */}
- ()
- }
- >
- {/* 复制详情 */}
- ()
- }
- >
- {/* 动态 */}
- ()
- }
- >
- {/* 代码Index */}
- ()
- }
- >
- {/* 新建合并请求 */}
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
+
+
+
+ :
+
+
+ {/* 资源 */}
+ ()
+ }
+ >
+ {/* 主页 */}
+ ()
+ }
+ >
+ {/* wiki新增文件 */}
+ ()
+ }
+ >
+ {/* wiki编辑文件 */}
+ ()
+ }
+ >
+ {/* wiki */}
+ ()
+ }
+ >
+ {/* 工作流 */}
+ ()
+ }
+ >
+ {/* 标签列表 */}
+ ()
+ }
+ >
+ {/* 仓库设置 */}
+ ()
+ }
+ >
+ {/* 任务详情 */}
+ ()
+ }
+ >
+ {/*修改里程碑*/}
+ ()
+ }
+ >
+ {/* 新建里程碑 */}
+ ()
+ }
+ >
+ {/*里程碑详情*/}
+ ()
+ }
+ >
+ {/* 里程碑 */}
+ ()
+ }
+ >
+ {/* 里程碑页面新建任务 */}
+ ()
+ }
+ >
+ {/* 新建任务 */}
+ ()
+ }
+ >
+ {/* 修改详情 */}
+ ()
+ }
+ >
+ {/* 复制详情 */}
+ ()
+ }
+ >
+ {/* 动态 */}
+ ()
+ }
+ >
+ {/* 代码Index */}
+ ()
+ }
+ >
+ {/* 新建合并请求 */}
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
- {/* 贡献者列表 */}
- ()
- }
- >
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+ {/* 贡献者列表 */}
+ ()
+ }
+ >
- {/* 代码库----详情页面 */}
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
- ()
- }
- >
-
-
+ {/* 代码库----详情页面 */}
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+ ()
+ }
+ >
+
+
}
)
diff --git a/src/forge/New/Index.js b/src/forge/New/Index.js
index b0f073261..130699b25 100644
--- a/src/forge/New/Index.js
+++ b/src/forge/New/Index.js
@@ -1,6 +1,6 @@
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 '../css/index.scss';
@@ -58,6 +58,8 @@ class Index extends Component {
this.getGitignore();
// 获取开源许可证
this.getLicenses();
+ //判断是否为删除新建项目失败后返回,并执行对应逻辑
+ this.isDeleteProjectBack();
}
componentDidUpdate=(prevPros)=>{
if(prevPros && this.props && !this.props.checkIfLogin()){
@@ -144,6 +146,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) {
@@ -172,6 +199,8 @@ class Index extends Component {
const { project_language_id, project_category_id, license_id, ignore_id , owners_id , owners_name } = 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,
@@ -185,7 +214,7 @@ class Index extends Component {
this.setState({
isSpin: false
})
- this.props.showNotification(`${projectsType && projectsType === "mirror" ? "镜像" : "托管"}项目创建成功!`);
+ projectsType && projectsType !== "mirror" && this.props.showNotification(`托管项目创建成功!`);
this.props.history.push(`/projects/${result.data.login}/${result.data.identifier}`);
}
}).catch((error) => {
@@ -337,7 +366,9 @@ class Index extends Component {
{
projectsType && projectsType === "mirror" &&
- 需要授权验证
+
+ 需要授权验证
+ 如果源项目为公有仓库,禁止填写用户名密码。如果源项目为私有仓库,则必须填写正确的用户名和密码!
{
mirrorCheck &&
From 78517853357b85be20483faef0bf923d788fcf32 Mon Sep 17 00:00:00 2001
From: caishi
Date: Wed, 25 Aug 2021 14:25:35 +0800
Subject: [PATCH 06/13] =?UTF-8?q?=E5=9B=A2=E9=98=9F=E6=9D=83=E9=99=90?=
=?UTF-8?q?=E5=88=86=E6=94=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Team/Group/GroupForm.jsx | 4 ++--
src/forge/users/Team.jsx | 16 ++++++----------
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/forge/Team/Group/GroupForm.jsx b/src/forge/Team/Group/GroupForm.jsx
index e27161e0a..9d54b034e 100644
--- a/src/forge/Team/Group/GroupForm.jsx
+++ b/src/forge/Team/Group/GroupForm.jsx
@@ -239,7 +239,7 @@ export default Form.create()(
合并请求(启用合并请求和代码评审)
-
+
版本发布(跟踪项目版本和下载)
@@ -249,7 +249,7 @@ export default Form.create()(
{groupId ? "更新团队设置" : "新建团队"}
- cancelEdit()}>取消
+ cancelEdit()}>取消
diff --git a/src/forge/users/Team.jsx b/src/forge/users/Team.jsx
index 9378106e3..bf401d2cd 100644
--- a/src/forge/users/Team.jsx
+++ b/src/forge/users/Team.jsx
@@ -5,6 +5,7 @@ import Search from '../Component/Search';
import Item from './Team-item';
import Nodata from '../Nodata';
import axios from 'axios';
+import { Link } from 'react-router-dom';
const limit = 15;
function Team(props){
@@ -14,7 +15,7 @@ function Team(props){
const [ sort_direction , setSort_direction ] = useState("asc");
const [ sort_by ,setSort_by ] = useState("created_at");
const [ search ,setSearch ] = useState(undefined);
-
+ const { checkIfLogin , showLoginDialog } = props;
const { username } = props.match.params;
useEffect(()=>{
if(username){
@@ -47,14 +48,6 @@ function Team(props){
)
- function newFunc() {
- const { checkIfLogin , showLoginDialog } = props;
- if(checkIfLogin()){
- props.history.push(`/organize/new`);
- }else{
- showLoginDialog && showLoginDialog();
- }
- }
return(