- {
- item.platform === "educoder" ?
-
-
-
- {item.author.name}/{item.name}
- {
- item.forked_from_project_id ?
-
-
-
- : ""
- }
- {
- item.type && item.type !== 0 ?
- item.type === 2 ?
-
-
- :
+ const { visible , user_apply_signatures , project_id } = this.state;
+ const renderList = (
+ projects && projects.length > 0 ? projects.map((item, key) => {
+ return (
+
+ {
+ item.platform === "educoder" ?
+
+
+
+ :
+
+
+
+ }
+
+
-
{item.description}
+
+
+ : ""
+ }
+ {
+ item.type && item.type !== 0 ?
+ item.type === 2 ?
+
+
+ :
+
+
+ :""
+ }
+
+
+ 赞 {item.praises_count}
+ fork {item.forked_count}
+
+
+
{item.description}
-
-
- {/* {item.visits} */}
- {/* {item.category && item.category.id && {item.category.name}} */}
- {item.last_update_time ? {item.time_ago} : ""}
- {item.language && item.language.id ? {item.language.name} : ""}
-
-
+
+
+ {/* {item.visits} */}
+ {/* {item.category && item.category.id && {item.category.name}} */}
+ {item.last_update_time ? {item.time_ago} : ""}
+ {item.language && item.language.id ? {item.language.name} : ""}
+
- )
- }) :
}
+
+ )
+ }) :
+ )
+ return (
+
+
+ {renderList}
)
}
From 80f1e4d44898da4658811c7d40327c296648b1be Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Tue, 2 Mar 2021 10:51:50 +0800
Subject: [PATCH 03/16] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=96=87=E4=BB=B6-url?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/DevOps/Dispose/List.jsx | 2 +-
src/forge/Main/CoderRootDirectory.js | 73 +++++++---------------------
src/forge/Merge/Files.jsx | 2 +-
3 files changed, 19 insertions(+), 58 deletions(-)
diff --git a/src/forge/DevOps/Dispose/List.jsx b/src/forge/DevOps/Dispose/List.jsx
index b218281d..32bf5d8d 100644
--- a/src/forge/DevOps/Dispose/List.jsx
+++ b/src/forge/DevOps/Dispose/List.jsx
@@ -32,7 +32,7 @@ function List({ list, operate , projectsId , owner , showModal , deleteFunc }){
ellipsis:true,
render:(value,item)=>{
return(
-
{value}
+
{value}
)
}
},
diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js
index b4a31c0e..a6dc2658 100644
--- a/src/forge/Main/CoderRootDirectory.js
+++ b/src/forge/Main/CoderRootDirectory.js
@@ -52,7 +52,8 @@ class CoderRootDirectory extends Component {
tar_url:undefined,
chooseType:undefined,
- md:false
+ md:false,
+ treeValue:undefined
}
}
changeAddress = (address) => {
@@ -87,15 +88,13 @@ class CoderRootDirectory extends Component {
};
Init = () => {
- let { search } = this.props.history.location;
- const { branchName } = this.props.match.params;
+ let { pathname } = this.props.history.location;
+ const { branchName , owner , projectsId } = this.props.match.params;
const { defaultBranch } = this.props;
let branch = branchName || defaultBranch;
- if (search && (search.indexOf("?url=") > -1 || search.indexOf("&url=") > -1)) {
- let url = search.split("url=")[1];
- if(url && decodeURI(url).indexOf("&")){
- url=decodeURI(url).split("&")[0];
- }
+ if (pathname && (pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf("/tree/") > -1)) {
+ let url = pathname.split("/tree/")[1];
+ this.setState({treeValue:url})
this.getFileDetail(decodeURI(url),branch);
} else {
this.getProjectRoot(branch);
@@ -106,7 +105,8 @@ class CoderRootDirectory extends Component {
returnMain = (branch) => {
const { projectsId , owner , branchName } = this.props.match.params;
this.setState({
- readOnly:true
+ readOnly:true,
+ treeValue:undefined
})
this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}`);
this.getProjectRoot(branch);
@@ -145,45 +145,13 @@ class CoderRootDirectory extends Component {
ChangeFile = (arr, readOnly) => {
const { projectsId , owner } = this.props.match.params;
//点击直接跳转页面 加载一次路由
- this.props.history.push(`/projects/${owner}/${projectsId}?url=${arr.path}`);
+ this.props.history.push(`/projects/${owner}/${projectsId}/tree/${arr.path}`);
this.setState({
readOnly: readOnly,
chooseType:"file"
});
};
- renderUrl = (name, path, type) => {
- let list = [];
- const { filePath } = this.state;
- if (path.indexOf("/")) {
- const array = path.split("/");
- let str = "";
- array.map((i, k) => {
- str += "/" + i;
- return list.push({
- key: k,
- index: k,
- name: i,
- path: str.substr(1),
- type: filePath && filePath.length > 0 ? filePath[k] ? filePath[k].type : type : type,
- });
- });
- const { projectsId , owner } = this.props.match.params;
- //点击直接跳转页面 加载一次路由
- this.props.history.push(`/projects/${owner}/${projectsId}?url=${str.substr(1)}`);
- } else {
- list.push({
- index: 0,
- name,
- path,
- type,
- });
- }
- this.setState({
- filePath: list,
- });
- };
-
// 获取子目录
getFileDetail = (path, ref) => {
this.setState({
@@ -267,7 +235,7 @@ class CoderRootDirectory extends Component {
chooseType:type
})
const { projectsId, owner , branchName } = this.props.match.params;
- this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}?url=${path}`);
+ this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}${path?`/tree/${path}`:""}`);
if(filename.substring(filename.length - 3) === ".md"){
this.setState({
md:true
@@ -320,17 +288,9 @@ class CoderRootDirectory extends Component {
// 选择分支
changeBranch = (value) => {
- let { search } = this.props.history.location;
const { projectsId , owner } = this.props.match.params;
-
- let url = `/projects/${owner}/${projectsId}${value && `/branch/${value}`}`;
- if (search && (search.indexOf("?url=") > -1 || search.indexOf("&url=") > -1)) {
- let u = search.split("url=")[1];
- if(u && decodeURI(u).indexOf("&")){
- u=decodeURI(u).split("&")[0];
- }
- url += `?url=${u}`;
- }
+ const { treeValue } = this.state;
+ let url = `/projects/${owner}/${projectsId}${value && `/branch/${value}`}${treeValue ? `/tree/${treeValue}`:""}`;
this.props.history.push(url);
}
@@ -338,10 +298,11 @@ class CoderRootDirectory extends Component {
returnUlr=(url)=>{
this.setState({
chooseType:"dir",
- readOnly:true
+ readOnly:true,
+ treeValue:url
})
- const { projectsId , owner } = this.props.match.params;
- this.props.history.push(`/projects/${owner}/${projectsId}?url=${url}`);
+ const { projectsId , owner , branchName } = this.props.match.params;
+ this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}/tree/${url}`);
}
onEdit=(readOnly)=>{
diff --git a/src/forge/Merge/Files.jsx b/src/forge/Merge/Files.jsx
index 08983266..aa7003e5 100644
--- a/src/forge/Merge/Files.jsx
+++ b/src/forge/Merge/Files.jsx
@@ -47,7 +47,7 @@ function Files({data,history,owner,projectsId}){
{item.name}
-
+
+{item.addition}
-{item.deletion}
From 72fcbcd4dd792a91ef183c0ba53d4f12e5513211 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Tue, 2 Mar 2021 11:40:55 +0800
Subject: [PATCH 04/16] root
---
src/forge/Main/CoderRootDirectory.js | 11 ++++++-----
src/forge/Main/CoderRootIndex.js | 2 +-
src/forge/Main/Detail.js | 2 +-
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js
index a6dc2658..759165de 100644
--- a/src/forge/Main/CoderRootDirectory.js
+++ b/src/forge/Main/CoderRootDirectory.js
@@ -92,8 +92,8 @@ class CoderRootDirectory extends Component {
const { branchName , owner , projectsId } = this.props.match.params;
const { defaultBranch } = this.props;
let branch = branchName || defaultBranch;
- if (pathname && (pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf("/tree/") > -1)) {
- let url = pathname.split("/tree/")[1];
+ if (pathname && (pathname.indexOf(`/projects/${owner}/${projectsId}`) > -1 && pathname.indexOf(`/tree/${branchName}/`) > -1)) {
+ let url = pathname.split(`/tree/${branchName}/`)[1];
this.setState({treeValue:url})
this.getFileDetail(decodeURI(url),branch);
} else {
@@ -108,7 +108,7 @@ class CoderRootDirectory extends Component {
readOnly:true,
treeValue:undefined
})
- this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}`);
+ this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/tree/${branchName}`:""}`);
this.getProjectRoot(branch);
};
@@ -235,7 +235,8 @@ class CoderRootDirectory extends Component {
chooseType:type
})
const { projectsId, owner , branchName } = this.props.match.params;
- this.props.history.push(`/projects/${owner}/${projectsId}${branchName?`/branch/${branchName}`:""}${path?`/tree/${path}`:""}`);
+ const { defaultBranch } = this.props;
+ this.props.history.push(`/projects/${owner}/${projectsId}${`/tree/${branchName || defaultBranch}`}${path?`/${path}`:""}`);
if(filename.substring(filename.length - 3) === ".md"){
this.setState({
md:true
@@ -290,7 +291,7 @@ class CoderRootDirectory extends Component {
changeBranch = (value) => {
const { projectsId , owner } = this.props.match.params;
const { treeValue } = this.state;
- let url = `/projects/${owner}/${projectsId}${value && `/branch/${value}`}${treeValue ? `/tree/${treeValue}`:""}`;
+ let url = `/projects/${owner}/${projectsId}${value && `/tree/${value}`}${treeValue ? `/${treeValue}`:""}`;
this.props.history.push(url);
}
diff --git a/src/forge/Main/CoderRootIndex.js b/src/forge/Main/CoderRootIndex.js
index 27dbbb9d..0e9c7207 100644
--- a/src/forge/Main/CoderRootIndex.js
+++ b/src/forge/Main/CoderRootIndex.js
@@ -145,7 +145,7 @@ class CoderRootIndex extends Component{
() => (
)
}
>
-
()
}
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index 76852525..00d80046 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -701,7 +701,7 @@ class Detail extends Component {
(props) => ()
}
>
-
()
}
From f1c2841fe036452d0431361f9c2621d2ee0837ff Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Wed, 3 Mar 2021 16:46:45 +0800
Subject: [PATCH 05/16] logo
---
src/modules/tpm/NewHeader.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/modules/tpm/NewHeader.js b/src/modules/tpm/NewHeader.js
index daaefca9..f133e911 100644
--- a/src/modules/tpm/NewHeader.js
+++ b/src/modules/tpm/NewHeader.js
@@ -713,7 +713,7 @@ class NewHeader extends Component {
mygetHelmetapi2 && mygetHelmetapi2.nav_logo_url ?
:
-
+ ""
}
From 860b71c7c6de4e5edacdc646e01069c60384ed0b Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Thu, 4 Mar 2021 17:02:20 +0800
Subject: [PATCH 06/16] =?UTF-8?q?=E5=A4=96=E5=9B=B4=E8=B4=A1=E7=8C=AE?=
=?UTF-8?q?=E8=80=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/Settings/CollaboratorMember.jsx | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/forge/Settings/CollaboratorMember.jsx b/src/forge/Settings/CollaboratorMember.jsx
index f4d7aaeb..f594912e 100644
--- a/src/forge/Settings/CollaboratorMember.jsx
+++ b/src/forge/Settings/CollaboratorMember.jsx
@@ -15,7 +15,7 @@ const MENU_LIST = [
function CollaboratorMember({projectsId,owner,project_id,author,showNotification,newId}){
const [ roleName , setRoleName ] = useState(undefined);
const [ search , setSearch ] = useState(undefined);
- const [ page , setPage ] = useState(undefined);
+ const [ page , setPage ] = useState(1);
const [ isSpin , setIsSpin ] = useState(false);
const [ role , setRole ] = useState(undefined);
const [ listData , setListData ] = useState(undefined);
@@ -166,7 +166,11 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
- ) : (
+ )
+ :
+ item.is_apply_signature ?
+
+ :(
{operation && operation[0].name}
@@ -261,14 +265,8 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
{total > LIMIT ?
-
-
setPage(page)}
- >
+
:""}
From 5565eac6011994d2b153c95801e0cc4e087158c0 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Mon, 8 Mar 2021 09:55:12 +0800
Subject: [PATCH 07/16] nodata
---
src/forge/Main/CoderRootCommit.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/forge/Main/CoderRootCommit.js b/src/forge/Main/CoderRootCommit.js
index 9fc39cae..c9665c77 100644
--- a/src/forge/Main/CoderRootCommit.js
+++ b/src/forge/Main/CoderRootCommit.js
@@ -145,7 +145,7 @@ class CoderRootCommit extends Component{
)
})
}
- {commitDatas && commitDatas.length > 0 &&
}
+ {commitDatas && commitDatas.length === 0 &&
}
{
From 916cc293ac1993c3424544a85b1efbd1c09ce6d7 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Mon, 8 Mar 2021 11:15:05 +0800
Subject: [PATCH 08/16] url
---
src/forge/Main/Detail.js | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/src/forge/Main/Detail.js b/src/forge/Main/Detail.js
index df8a94e5..9886b7e2 100644
--- a/src/forge/Main/Detail.js
+++ b/src/forge/Main/Detail.js
@@ -115,22 +115,23 @@ const DevIndex = Loadable({
/**
* permission:Manager:管理员,Reporter:报告人员(只有读取权限),Developer:开发人员(除不能设置仓库信息外)
*/
-function checkPathname(pathname){
+function checkPathname(projectsId,owner,pathname){
let name = "";
- if(pathname){
- if(pathname.indexOf("/about")>-1){
+ if(pathname && pathname !== `/projects/${owner}/${projectsId}`){
+ let url = pathname.split(`/projects/${owner}/${projectsId}`)[1];
+ if(url.indexOf("/about")>-1){
name="about"
- }else if(pathname.indexOf("/issues")>-1 ||pathname.indexOf("Milepost") > 0){
+ }else if(url.indexOf("/issues")>-1 ||url.indexOf("Milepost") > 0){
name = "issues";
- }else if(pathname.indexOf("/pulls")>-1){
+ }else if(url.indexOf("/pulls")>-1){
name="pulls"
- }else if(pathname.indexOf("/milestones")>-1){
+ }else if(url.indexOf("/milestones")>-1){
name="milestones"
- }else if(pathname.indexOf("/activity")>-1){
+ }else if(url.indexOf("/activity")>-1){
name="activity"
- }else if(pathname.indexOf("/setting")>-1){
+ }else if(url.indexOf("/setting")>-1){
name="setting"
- }else if(pathname.indexOf("/devops")>-1){
+ }else if(url.indexOf(`/devops`)>-1){
name="devops"
}
}
@@ -400,9 +401,9 @@ class Detail extends Component {
const url = this.props.history.location.pathname;
const urlArr = url.split("/");
const urlFlag = (urlArr.length === 3);
- let pathname = checkPathname(url);
const { projectsId , owner } = this.props.match.params;
+ let pathname = checkPathname(projectsId,owner,url);
const { state } = this.props.history.location;
From a6e2171fcacce6c892e4adaac0cc8e7f1febd116 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Tue, 9 Mar 2021 11:49:48 +0800
Subject: [PATCH 09/16] filedetail
---
src/forge/Main/CoderRootDirectory.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js
index 759165de..e36c9a1e 100644
--- a/src/forge/Main/CoderRootDirectory.js
+++ b/src/forge/Main/CoderRootDirectory.js
@@ -251,7 +251,7 @@ class CoderRootDirectory extends Component {
// readme文件内容
renderReadMeContent = (readMeContent, permission) => {
const { fileDetail, readMeFile } = this.state;
- if (fileDetail) {
+ if (fileDetail && fileDetail.length !== 0) {
return;
}
if (readMeContent && readMeContent.length > 0) {
From 41ae6b1f8d9624e226ac0369da897a3273d65c18 Mon Sep 17 00:00:00 2001
From: caishi <1149225589@qq.com>
Date: Tue, 9 Mar 2021 13:55:02 +0800
Subject: [PATCH 10/16] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B5=84=E6=96=99?=
=?UTF-8?q?=E7=BB=83=E7=BA=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/forge/users/Infos.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/forge/users/Infos.js b/src/forge/users/Infos.js
index f33a3f10..17b0c6f0 100644
--- a/src/forge/users/Infos.js
+++ b/src/forge/users/Infos.js
@@ -167,7 +167,7 @@ class Infos extends Component {