diff --git a/public/css/iconfont.css b/public/css/iconfont.css
index 080d38a7..92de082a 100644
--- a/public/css/iconfont.css
+++ b/public/css/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 2340181 */
- src: url('iconfont.woff2?t=1649726899310') format('woff2'),
- url('iconfont.woff?t=1649726899310') format('woff'),
- url('iconfont.ttf?t=1649726899310') format('truetype');
+ src: url('iconfont.woff2?t=1651041108151') format('woff2'),
+ url('iconfont.woff?t=1651041108151') format('woff'),
+ url('iconfont.ttf?t=1651041108151') format('truetype');
}
.iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-personal-center:before {
+ content: "\e927";
+}
+
.icon-bangzhuzhongxinicon:before {
content: "\e926";
}
diff --git a/public/css/iconfont.js b/public/css/iconfont.js
index 709a100e..b910937d 100644
--- a/public/css/iconfont.js
+++ b/public/css/iconfont.js
@@ -1 +1 @@
-!function(a){var l,c,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(a,l){l.parentNode.insertBefore(a,l)};if(t&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}l=function(){var a,l=document.createElement("div");l.innerHTML=z,z=null,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),l()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(h=l,i=a.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window);
\ No newline at end of file
+!function(a){var l,c,h,i,o,z='',t=(t=document.getElementsByTagName("script"))[t.length-1].getAttribute("data-injectcss"),p=function(a,l){l.parentNode.insertBefore(a,l)};if(t&&!a.__iconfont__svg__cssinject__){a.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(a){console&&console.log(a)}}function v(){o||(o=!0,h())}function m(){try{i.documentElement.doScroll("left")}catch(a){return void setTimeout(m,50)}v()}l=function(){var a,l=document.createElement("div");l.innerHTML=z,z=null,(l=l.getElementsByTagName("svg")[0])&&(l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.width=0,l.style.height=0,l.style.overflow="hidden",l=l,(a=document.body).firstChild?p(l,a.firstChild):a.appendChild(l))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(l,0):(c=function(){document.removeEventListener("DOMContentLoaded",c,!1),l()},document.addEventListener("DOMContentLoaded",c,!1)):document.attachEvent&&(h=l,i=a.document,o=!1,m(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,v())})}(window);
\ No newline at end of file
diff --git a/public/css/iconfont.json b/public/css/iconfont.json
index d1a1779f..3bf3eb57 100644
--- a/public/css/iconfont.json
+++ b/public/css/iconfont.json
@@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
+ {
+ "icon_id": "29206429",
+ "name": "personal-center",
+ "font_class": "personal-center",
+ "unicode": "e927",
+ "unicode_decimal": 59687
+ },
{
"icon_id": "28888753",
"name": "帮助中心icon",
diff --git a/public/css/iconfont.ttf b/public/css/iconfont.ttf
index 976c59a3..76ccae2b 100644
Binary files a/public/css/iconfont.ttf and b/public/css/iconfont.ttf differ
diff --git a/public/css/iconfont.woff b/public/css/iconfont.woff
index c2a9a151..be0e660d 100644
Binary files a/public/css/iconfont.woff and b/public/css/iconfont.woff differ
diff --git a/public/css/iconfont.woff2 b/public/css/iconfont.woff2
index a7418992..51640e89 100644
Binary files a/public/css/iconfont.woff2 and b/public/css/iconfont.woff2 differ
diff --git a/src/App.css b/src/App.css
index 8d916d39..55bdd7f4 100644
--- a/src/App.css
+++ b/src/App.css
@@ -93,6 +93,9 @@ body {
.editormd-preview .markdown-body{
padding:0px !important;
}
+.editormd-preview{
+ width: 50%!important;
+}
/* 图片点击放大的场景,隐藏图片链接 */
.editormd-image-click-expand .editormd-image-dialog {
diff --git a/src/AppConfig.js b/src/AppConfig.js
index b4107e46..cd3aca3d 100644
--- a/src/AppConfig.js
+++ b/src/AppConfig.js
@@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
- window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
+ window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {
diff --git a/src/forge/Main/CoderDepot.jsx b/src/forge/Main/CoderDepot.jsx
index 6d45159b..4183131b 100644
--- a/src/forge/Main/CoderDepot.jsx
+++ b/src/forge/Main/CoderDepot.jsx
@@ -436,7 +436,7 @@ function CoderDepot(props){
{
baseOperate &&
-
urlLink(`/${owner}/${projectsId}/compare/master...${turnbar(branchName || defaultBranch)}`)} >+ 合并请求
+
urlLink(`/${owner}/${projectsId}/compare/${turnbar(branchName || defaultBranch)}...${turnbar(branchName || defaultBranch)}`)} >+ 合并请求
}
{
issuesFlag &&
diff --git a/src/forge/Main/tree/Index.jsx b/src/forge/Main/tree/Index.jsx
index 2829331b..f7aa7bd8 100644
--- a/src/forge/Main/tree/Index.jsx
+++ b/src/forge/Main/tree/Index.jsx
@@ -14,8 +14,8 @@ function Index(props) {
const [ isSpin , setIsSpin ] = useState(true);
const { projectsId , owner } = props.match.params;
- const { isManager , isDeveloper , projectDetail } = props;
-
+ const { isManager , isDeveloper , projectDetail , defaultBranch } = props;
+
useEffect(()=>{
getList();
},[])
@@ -85,7 +85,7 @@ function Index(props) {
{
(isManager || isDeveloper) && (projectDetail && projectDetail.type!==2) &&
-
+ 合并请求
+
+ 合并请求
}
下载
diff --git a/src/forge/Merge/CreateMerge.js b/src/forge/Merge/CreateMerge.js
index e6d0d037..e4ac51d4 100644
--- a/src/forge/Merge/CreateMerge.js
+++ b/src/forge/Merge/CreateMerge.js
@@ -116,68 +116,45 @@ class CreateMerge extends Component {
this.setState({ isSpin: true });
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams;
const url = `/${pullOwner}/${projectId}/pulls/new.json`;
- axios
- .get(url)
- .then((result) => {
- if (result) {
- if(init){
- //页面初始化时调用selectProjectName,给is_original、fork_project_id、merge_user_login赋值
- const initUser = result.data.projects_names && result.data.projects_names.filter((item)=>item.project_user_login === branchParams.mergeOwner);
- initUser && initUser[0] && this.selectProjectName(initUser[0].id,false,{projects_names: result.data.projects_names,id: result.data.id});
- }
- this.setState({isSpin: false});
- // 如果url上的分支不存在,取默认值master
- const noMergeBranch =
- (result.data.branches || []).filter(
- (branch) => branch.name === returnbar(mergeBranch)
- ).length === 0;
- const noPullBranch =
- (result.data.branches || []).filter(
- (branch) => branch.name === returnbar(pullBranch)
- ).length === 0;
- this.setState({
- // isFork: result.data.is_fork,
- projects_names: result.data.projects_names,
- mergeProjects: result.data.merge_projects,
- pullBranches: result.data.branches,
- mergeBranches: result.data.branches,
- project_id: result.data.project_id,
- id: result.data.id,
- merge: returnbar(mergeBranch),
- pull: returnbar(pullBranch),
- });
-
- //判断源分支是否存在
- if(noPullBranch){
- this.setState({
- showMessage: true,
- defaultMessage:'源分支不存在',
- isCompareSpin: false,
- });
- }else{
- if(pullOwner === returnbar(mergeOwner)){
- if (!noMergeBranch) {
- this.compareProject(true, branchParams);
- } else {
- this.setState({
- showMessage: true,
- defaultMessage:'目标分支不存在',
- isCompareSpin: false,
- });
- }
- }else{
- this.getBranchList(branchParams);
- }
- }
+ axios.get(url).then((result) => {
+ if (result) {
+ if(init){
+ //页面初始化时调用selectProjectName,给is_original、fork_project_id、merge_user_login赋值
+ const initUser = result.data.projects_names && result.data.projects_names.filter((item)=>item.project_user_login === branchParams.mergeOwner);
+ initUser && initUser[0] && this.selectProjectName(initUser[0].id,false,{projects_names: result.data.projects_names,id: result.data.id});
}
- this.setState({ isSpin: false });
- })
- .catch((error) => {
- this.setState({ isSpin: false });
- console.log(error);
- });
+ this.setState({
+ // isFork: result.data.is_fork,
+ projects_names: result.data.projects_names,
+ mergeProjects: result.data.merge_projects,
+ // pullBranches: result.data.branches,
+ // mergeBranches: result.data.branches,
+ project_id: result.data.project_id,
+ id: result.data.id,
+ merge: returnbar(mergeBranch),
+ pull: returnbar(pullBranch),
+ });
+ this.checkBranch(branchParams);
+ this.setState({
+ isSpin: false,isCompareSpin: false
+ });
+ }
+ })
+ .catch((error) => {
+ this.setState({ isSpin: false });
+ console.log(error);
+ });
};
+ checkBranch=async(branchParams)=>{
+ const { mergeBranch , mergeOwner, projectId , pullBranch ,pullOwner} = branchParams;
+ let getbranch =await this.getBranchList(mergeOwner,projectId,pullBranch,mergeBranch);
+ // let checkpull =await this.getBranchList(pullOwner,projectId,pullBranch,"pull");
+ if(getbranch){
+ this.compareProject(mergeOwner === pullOwner, branchParams);
+ }
+ }
+
// compare接口,获取分支对比信息
compareProject = (sameProject, branchParams) => {
const { pullOwner, pullBranch, mergeOwner, mergeBranch, projectId } = branchParams;
@@ -187,8 +164,6 @@ class CreateMerge extends Component {
} else {
url += `/${Base64.encode(returnbar(mergeBranch))}...${pullOwner}/${projectId}:${Base64.encode(returnbar(pullBranch))}.json`;
}
- console.log(url);
- this.setState({ isSpin: false, isCompareSpin: true });
axios
.get(url)
.then((result) => {
@@ -219,31 +194,40 @@ class CreateMerge extends Component {
};
// 根据所有者、仓库名,获取分支列表,目前仅涉及目标仓库分支查询
- getBranchList = (branchParams) => {
- const { mergeOwner, projectId, mergeBranch } = branchParams;
- this.setState({ isSpin: true });
- const url = `/${mergeOwner}/${projectId}/pulls/get_branches.json`;
- axios
- .get(url)
- .then((result) => {
- if (result) {
- const noMergeBranch =
- (result.data || []).filter((branch) => branch.name === mergeBranch)
- .length === 0;
+ getBranchList =async(owner,identifier,branch,mergebranch) => {
+ const url = `/${owner}/${identifier}/branches.json`;
+ let check = await axios.get(url).then((result) => {
+ if(result.data){
+ let pfilter = (result.data || []).filter(i => i.name === branch).length === 0;
+ let mfilter = (result.data || []).filter(i => i.name === mergebranch).length === 0;
+ if(pfilter){
this.setState({
- mergeBranches: result.data,
- showMessage: noMergeBranch,
- defaultMessage: '目标分支不存在',
- isCompareSpin: false,
+ showMessage: branch,
+ defaultMessage: `源分支不存在`,
+ isCompareSpin: false
});
- !noMergeBranch && this.compareProject(false, branchParams);
+ return false;
}
- this.setState({ isSpin: false });
- })
- .catch((error) => {
- this.setState({ isSpin: false });
- console.log(error);
- });
+ if(mfilter){
+ this.setState({
+ showMessage: mergebranch,
+ defaultMessage: `目标分支不存在`,
+ isCompareSpin: false
+ });
+ return false;
+ }
+ this.setState({
+ pullBranches:result.data,
+ mergeBranches:result.data
+ })
+ return true;
+ }
+ })
+ .catch((error) => {
+ this.setState({ isSpin: false });
+ check = false;
+ });
+ return check;
};
// 切换分支事件
@@ -291,14 +275,16 @@ class CreateMerge extends Component {
});
// 加上是否需要切换url判断
if(isChangeProject){
+ const { defaultBranch } = this.props;
+ let branch = turnbar(defaultBranch) || "master";
if (login === pullOwner) {
// 如果切换后, 仓库与源仓库一致了
this.props.history.push(
- `/${login}/${identifier}/compare/master...${turnbar(pullBranch)}`
+ `/${login}/${identifier}/compare/${branch}...${turnbar(pullBranch)}`
);
} else {
this.props.history.push(
- `/${login}/${identifier}/compare/master...${pullOwner}:${turnbar(pullBranch)}`
+ `/${login}/${identifier}/compare/${branch}...${pullOwner}:${turnbar(pullBranch)}`
);
}
}
@@ -336,6 +322,32 @@ class CreateMerge extends Component {
return ;
};
+ // 源分支-分支搜索
+ changePullValue=async(value,cate)=>{
+ const branchParams = getBranchParams(this.props.location.pathname);
+ const { pullOwner, mergeOwner , projectId } = branchParams;
+ const url = `/${cate === "pull" ? pullOwner :mergeOwner}/${projectId}/pulls/get_branches.json`;
+ axios.get(url,{
+ params:{
+ name:value || undefined,
+ }
+ }).then(result=>{
+ if(result){
+ if(cate === "pull"){
+ this.setState({
+ pullBranches:result.data,
+ pullBranch:result.data
+ })
+ }else{
+ this.setState({
+ mergeBranches:result.data,
+ mergeBranch:result.data
+ })
+ }
+ }
+ }).catch(error=>{})
+ }
+
render() {
const {
data,
@@ -355,7 +367,6 @@ class CreateMerge extends Component {
} = this.state;
let { project } = this.props;
-
return (
@@ -378,6 +389,8 @@ class CreateMerge extends Component {
className="merge-flex1 flex1 matchwidth"
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
+ // onSearch={(e)=>this.changePullValue(e,"pull")}
+ // filterOption={(input,option)=>option}
>
{this.renderBrances(pullBranches)}
@@ -406,6 +419,8 @@ class CreateMerge extends Component {
className="merge-flex1 flex1 matchwidth"
dropdownMatchSelectWidth={false}
dropdownClassName="overlihide"
+ // onSearch={(e)=>this.changePullValue(e,"merge")}
+ // filterOption={(input,option)=>option}
>
{this.renderBrances(mergeBranches)}
diff --git a/src/forge/Merge/merge.css b/src/forge/Merge/merge.css
index 0ac43c7d..0fc5effb 100644
--- a/src/forge/Merge/merge.css
+++ b/src/forge/Merge/merge.css
@@ -226,4 +226,7 @@ form .ant-cascader-picker, form .ant-select {
/* 距离底部加大 @列表被遮挡 */
.updateMerge{
margin: 30px auto 60px;
+ }
+ .searchIcon .ant-select-arrow{
+ margin-top:-9px
}
\ No newline at end of file
diff --git a/src/forge/Merge/merge.js b/src/forge/Merge/merge.js
index 0f6f1ac8..769d2d47 100644
--- a/src/forge/Merge/merge.js
+++ b/src/forge/Merge/merge.js
@@ -6,6 +6,7 @@ import "../Order/index.scss";
import NoneData from "./no_data";
import MergeItem from "./MergeItem";
import './Index.scss';
+import { turnbar } from "educoder";
import axios from "axios";
import CheckProfile from '../Component/ProfileModal/Profile';
@@ -210,10 +211,11 @@ class merge extends Component {
this.getIssueList();
};
-
checkOperation() {
+ const { defaultBranch } = this.props;
const { projectsId,owner } = this.props.match.params;
- this.props.history.push(`/${owner}/${projectsId}/compare/master...master`);
+ let branch = turnbar(defaultBranch) || "master";
+ this.props.history.push(`/${owner}/${projectsId}/compare/${branch}...${branch}`);
}
render() {
const { projectsId , owner } = this.props.match.params;
@@ -414,7 +416,7 @@ class merge extends Component {
) : (
""
)}
- { data && data.issues && data.issues.length === 0 ? :""}
+ { data && data.issues && data.issues.length === 0 ? :""}
diff --git a/src/forge/Merge/merge_form.js b/src/forge/Merge/merge_form.js
index c6de9638..2ad08d4b 100644
--- a/src/forge/Merge/merge_form.js
+++ b/src/forge/Merge/merge_form.js
@@ -181,7 +181,6 @@ class MergeForm extends Component {
this.setState({
isSpin: false,
});
- console.log(error);
});
} else {
let url = `/${owner}/${projectsId}/pulls/${mergeId}.json`;
@@ -315,7 +314,16 @@ class MergeForm extends Component {
{getFieldDecorator("assigned_to_id", {
initialValue: assigned_to_id,
})(
-