修复冲突

forge
sylor_huang@126.com 5 years ago
commit 87254011a3

@ -21,7 +21,7 @@
"./static/js/115.a12fef6d.chunk.js": "./static/js/115.a12fef6d.chunk.js",
"./static/js/116.574db64b.chunk.js": "./static/js/116.574db64b.chunk.js",
"./static/js/117.5acf3184.chunk.js": "./static/js/117.5acf3184.chunk.js",
"./static/js/118.99fc080c.chunk.js": "./static/js/118.99fc080c.chunk.js",
"./static/js/118.dcdaacee.chunk.js": "./static/js/118.dcdaacee.chunk.js",
"./static/js/119.cb63073c.chunk.js": "./static/js/119.cb63073c.chunk.js",
"./static/js/12.fb20694d.chunk.js": "./static/js/12.fb20694d.chunk.js",
"./static/js/120.1df9dd9f.chunk.js": "./static/js/120.1df9dd9f.chunk.js",
@ -92,7 +92,7 @@
"./static/js/18.bc842084.chunk.js": "./static/js/18.bc842084.chunk.js",
"./static/js/180.9c7901de.chunk.js": "./static/js/180.9c7901de.chunk.js",
"./static/js/181.32ab74d1.chunk.js": "./static/js/181.32ab74d1.chunk.js",
"./static/js/182.7cc692e1.chunk.js": "./static/js/182.7cc692e1.chunk.js",
"./static/js/182.32355a80.chunk.js": "./static/js/182.32355a80.chunk.js",
"./static/js/183.63280af3.chunk.js": "./static/js/183.63280af3.chunk.js",
"./static/js/184.d0035463.chunk.js": "./static/js/184.d0035463.chunk.js",
"./static/js/185.acfc5c9d.chunk.js": "./static/js/185.acfc5c9d.chunk.js",
@ -273,7 +273,7 @@
"./static/js/98.92e47c1c.chunk.js": "./static/js/98.92e47c1c.chunk.js",
"./static/js/99.f1a59e21.chunk.js": "./static/js/99.f1a59e21.chunk.js",
"main.css": "./static/css/main.c0718fb6.css",
"main.js": "./static/js/main.33d88119.js",
"main.js": "./static/js/main.92c53e22.js",
"static/media/KaTeX_AMS-Regular.ttf": "static/media/KaTeX_AMS-Regular.aaf4eee9.ttf",
"static/media/KaTeX_AMS-Regular.woff": "static/media/KaTeX_AMS-Regular.7f06b4e3.woff",
"static/media/KaTeX_AMS-Regular.woff2": "static/media/KaTeX_AMS-Regular.e78e28b4.woff2",

@ -24,7 +24,7 @@
_host = 'https://ali-cdn.educoder.net/react/build/'
}
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.33d88119.js"><\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.92c53e22.js"><\/script>');
})()
</script>
<script>!function(){var t=location.href;"3007"===window.location.port?-1!=t.indexOf("/tasks/")?(document.write('<script type="text/javascript" src="https://newweb.educoder.net/assets/kindeditor/kindeditor.js"><\/script>'),document.write('<script type="text/javascript" src="/react/build/js/create_kindeditor.js?v=1.1.1"><\/script>'),document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>')):-1!=t.indexOf("/paths/")&&document.write('<script type="text/javascript" src="https://newweb.educoder.net/javascripts/educoder/edu_application.js"><\/script>'):-1!=t.indexOf("/tasks/")?(document.write('<script type="text/javascript" src="/assets/kindeditor/kindeditor.js"><\/script>'),document.write('<script type="text/javascript" src="/react/build/js/create_kindeditor.js?v=1.1.1"><\/script>'),document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>')):-1!=t.indexOf("/paths/")&&document.write('<script type="text/javascript" src="/javascripts/educoder/edu_application.js"><\/script>')}()</script><script type="text/javascript" src="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.js"></script></body></html>

File diff suppressed because one or more lines are too long

@ -10201,8 +10201,8 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__DetailTop__ = __webpack_require__(3044);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_axios__ = __webpack_require__(15);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_axios___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_axios__);
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var CoderRootCommit=function(_Component){_inherits(CoderRootCommit,_Component);function CoderRootCommit(props){_classCallCheck(this,CoderRootCommit);var _this=_possibleConstructorReturn(this,(CoderRootCommit.__proto__||Object.getPrototypeOf(CoderRootCommit)).call(this,props));_this.componentDidMount=function(){var _this$state=_this.state,branch=_this$state.branch,page=_this$state.page,limit=_this$state.limit;_this.setState({isSpin:true});_this.getCommitList(branch,page,limit);};_this.getCommitList=function(branch,page,limit){var login=_this.props.current_user.login;var projectsId=_this.props.match.params.projectsId;var url='/'+login+'/'+projectsId+'/commits.json';__WEBPACK_IMPORTED_MODULE_8_axios___default.a.get(url,{params:{sha:branch,page:page,limit:limit}}).then(function(result){if(result){var array=[];result.data&&result.data.commits.length>0&&result.data.commits.map(function(item,key){array.push({name:item.author&&item.author.name,image_url:item.author&&item.author.image_url,sha:item.sha,time_from_now:item.time_from_now,message:item.message});});_this.setState({data:array,dataCount:result.data.total_count,isSpin:false});}}).catch(function(error){console.log(error);});};_this.changeBranch=function(value){var branchList=_this.props.branchList;var branchLastCommit=branchList[parseInt(value.key)];var _this$state2=_this.state,page=_this$state2.page,limit=_this$state2.limit;_this.setState({isSpin:true,branch:branchLastCommit.name});_this.getCommitList(branchLastCommit.name,page,limit);};_this.ChangePage=function(page){var _this$state3=_this.state,branch=_this$state3.branch,limit=_this$state3.limit;_this.getCommitList(branch,page,limit);};_this.state={branch:"master",data:undefined,dataCount:undefined,limit:50,page:1,isSpin:false};return _this;}// 切换分支
_createClass(CoderRootCommit,[{key:'render',value:function render(){var _this2=this;var _state=this.state,branch=_state.branch,data=_state.data,dataCount=_state.dataCount,limit=_state.limit,page=_state.page,isSpin=_state.isSpin;var branchs=this.props.branchs;var columns=[{title:"作者",dataIndex:'name',width:"10%",render:function render(text,item){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'f-wrap-alignCenter'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('img',{src:Object(__WEBPACK_IMPORTED_MODULE_5_educoder__["M" /* getImageUrl */])('images/'+item.image_url),alt:'',width:'28px',height:'28px',className:'mr3 radius'}),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('label',{className:'hide-1',style:{maxWidth:"75px"}},text));}},{title:"SHA",dataIndex:'sha',render:function render(text){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'commitKey'},text);}},{title:"备注",dataIndex:'message',render:function render(text){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,text);}},{title:"提交时间",className:"edu-txt-right",dataIndex:'time_from_now',render:function render(text){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,text);}}];var _title=function _title(){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'f-wrap-between',style:{alignItems:"center"}},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'font-16'},dataCount,'\u6B21\u63D0\u4EA4\u4EE3\u7801(',branch,')'));};var Pagination=function Pagination(){if(dataCount>limit){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'edu-txt-center pt30 mb30'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(Pagination,{simple:true,defaultCurrent:page,total:dataCount,pageSize:limit,onChange:_this2.ChangePage}));}};return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__DetailTop__["a" /* default */],Object.assign({},this.props,this.state)),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'f-wrap-between mt20'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__Branch_SelectBranch__["a" /* default */],{branch:branch,branchs:branchs,changeBranch:this.changeBranch})),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_spin___default.a,{spinning:isSpin},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_table___default.a,{className:'mt20 wrap-commit-table',columns:columns,dataSource:data,showHeader:false,size:'small',pagination:false,title:function title(){return _title();}}),Pagination()));}}]);return CoderRootCommit;}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);/* harmony default export */ __webpack_exports__["default"] = (CoderRootCommit);
var _createClass=function(){function defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};}();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _possibleConstructorReturn(self,call){if(!self){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return call&&(typeof call==="object"||typeof call==="function")?call:self;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof superClass);}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)Object.setPrototypeOf?Object.setPrototypeOf(subClass,superClass):subClass.__proto__=superClass;}var CoderRootCommit=function(_Component){_inherits(CoderRootCommit,_Component);function CoderRootCommit(props){_classCallCheck(this,CoderRootCommit);var _this=_possibleConstructorReturn(this,(CoderRootCommit.__proto__||Object.getPrototypeOf(CoderRootCommit)).call(this,props));_this.componentDidMount=function(){var _this$state=_this.state,branch=_this$state.branch,page=_this$state.page,limit=_this$state.limit;_this.setState({isSpin:true});_this.getCommitList(branch,page,limit);};_this.getCommitList=function(branch,page,limit){var login=_this.props.current_user.login;var projectsId=_this.props.match.params.projectsId;var url='/'+login+'/'+projectsId+'/commits.json';__WEBPACK_IMPORTED_MODULE_8_axios___default.a.get(url,{params:{sha:branch,page:page,limit:limit}}).then(function(result){if(result){var array=[];result.data&&result.data.commits.length>0&&result.data.commits.map(function(item,key){array.push({name:item.author&&item.author.name,image_url:item.author&&item.author.image_url,sha:item.sha,time_from_now:item.time_from_now,message:item.message});});_this.setState({data:array,dataCount:result.data.total_count,isSpin:false});}}).catch(function(error){console.log(error);});};_this.changeBranch=function(value){var branchList=_this.props.branchList;var branchLastCommit=branchList[parseInt(value.key)];var _this$state2=_this.state,page=_this$state2.page,limit=_this$state2.limit;_this.setState({isSpin:true,branch:branchLastCommit.name});_this.getCommitList(branchLastCommit.name,page,limit);};_this.ChangePage=function(page){var _this$state3=_this.state,branch=_this$state3.branch,limit=_this$state3.limit;_this.getCommitList(branch,page,limit);};_this.state={branch:"master",data:undefined,dataCount:undefined,limit:20,page:1,isSpin:false};return _this;}// 切换分支
_createClass(CoderRootCommit,[{key:'render',value:function render(){var _this2=this;var _state=this.state,branch=_state.branch,data=_state.data,dataCount=_state.dataCount,limit=_state.limit,page=_state.page,isSpin=_state.isSpin;var branchs=this.props.branchs;console.log("data",data);var columns=[{title:"作者",dataIndex:'name',width:"10%",render:function render(text,item){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'f-wrap-alignCenter'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('img',{src:Object(__WEBPACK_IMPORTED_MODULE_5_educoder__["M" /* getImageUrl */])('images/'+item.image_url),alt:'',width:'28px',height:'28px',className:'mr3 radius'}),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('label',{className:'hide-1',style:{maxWidth:"75px"}},text));}},{title:"SHA",dataIndex:'sha',render:function render(text){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'commitKey'},text);}},{title:"备注",dataIndex:'message',render:function render(text){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,text);}},{title:"提交时间",className:"edu-txt-right",dataIndex:'time_from_now',render:function render(text){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',null,text);}}];var _title=function _title(){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'f-wrap-between',style:{alignItems:"center"}},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('span',{className:'font-16'},dataCount,'\u6B21\u63D0\u4EA4\u4EE3\u7801(',branch,')'));};var Pagination=function Pagination(){if(dataCount>limit){return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'edu-txt-center pt30 mb30'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(Pagination,{simple:true,defaultCurrent:page,total:dataCount,pageSize:limit,onChange:_this2.ChangePage}));}};return __WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',null,__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_7__DetailTop__["a" /* default */],Object.assign({},this.props,this.state)),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement('div',{className:'f-wrap-between mt20'},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_6__Branch_SelectBranch__["a" /* default */],{branch:branch,branchs:branchs,changeBranch:this.changeBranch})),__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_1_antd_lib_spin___default.a,{spinning:isSpin},__WEBPACK_IMPORTED_MODULE_4_react___default.a.createElement(__WEBPACK_IMPORTED_MODULE_3_antd_lib_table___default.a,{className:'mt20 wrap-commit-table',columns:columns,dataSource:data,showHeader:false,size:'small',pagination:false,title:function title(){return _title();}}),Pagination()));}}]);return CoderRootCommit;}(__WEBPACK_IMPORTED_MODULE_4_react__["Component"]);/* harmony default export */ __webpack_exports__["default"] = (CoderRootCommit);
/***/ }),

@ -113,9 +113,9 @@ var _createClass=function(){function defineProperties(target,props){for(var i=0;
var MergeIndexDetail=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(160).then(__webpack_require__.bind(null, 4804));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var CreateMerge=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(59).then(__webpack_require__.bind(null, 4806));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var MessageCount=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(77).then(__webpack_require__.bind(null, 4807));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var MergeSubmit=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(64).then(__webpack_require__.bind(null, 4808));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var UpdateMerge=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(91).then(__webpack_require__.bind(null, 4809));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});//版本发布
var VersionIndex=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(199).then(__webpack_require__.bind(null, 4810));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var NewVersionIndex=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(125).then(__webpack_require__.bind(null, 4811));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var UpVersionIndex=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(85).then(__webpack_require__.bind(null, 4812));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var MilepostDetail=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(166).then(__webpack_require__.bind(null, 4813));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});var TrendsIndex=__WEBPACK_IMPORTED_MODULE_4_react_loadable___default()({loader:function loader(){return __webpack_require__.e/* import() */(162).then(__webpack_require__.bind(null, 4814));},loading:__WEBPACK_IMPORTED_MODULE_5__Loading__["a" /* default */]});/**
* permissionManager:管理员Reporter报告人员(只有读取权限)Developer开发人员除不能设置仓库信息外
*/var Detail=function(_Component){_inherits(Detail,_Component);function Detail(props){_classCallCheck(this,Detail);var _this=_possibleConstructorReturn(this,(Detail.__proto__||Object.getPrototypeOf(Detail)).call(this,props));_this.getUserInfo=function(){var url='/users/me.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.get(url).then(function(result){if(result&&result.data.login){_this.setState({current_user:result.data});_this.getDetail();}}).catch(function(error){console.log(error);});};_this.componentDidMount=function(){// this.getUserInfo();
_this.getDetail();};_this.getDetail=function(){console.log("state",_this.props);var state=_this.props.history.location.state;var current_user=_this.props.current_user;var projectsId=_this.props.match.params.projectsId;var url='/'+(state?state:current_user&&current_user.login)+'/'+projectsId+'.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.get(url).then(function(result){if(result){_this.setState({projectDetail:result.data,project_id:result.data.project_id,isManager:result.data.permission&&result.data.permission==="Manager",isReporter:result.data.permission&&result.data.permission==="Reporter",isDeveloper:result.data.permission&&result.data.permission==="Developer",http_url:result.data.clone_url,author:result.data.author,watchers_count:result.data.watchers_count,praises_count:result.data.praises_count,forked_count:result.data.forked_count});if(result.data.project_id){_this.getBranch(result.data.project_id);}}}).catch(function(error){});};_this.focusFunc=function(flag){var project_id=_this.state.project_id;if(!flag){var url='/projects/'+project_id+'/watchers/follow.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.post(url).then(function(result){if(result){_this.props.showNotification('关注成功');_this.getDetail();}}).catch(function(error){console.log(error);});}else{var _url='/projects/'+project_id+'/watchers/unfollow.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.delete(_url).then(function(result){if(result){_this.props.showNotification('取消关注成功');_this.getDetail();}}).catch(function(error){console.log(error);});}};_this.pariseFunc=function(flag){var project_id=_this.state.project_id;if(!flag){var url='/projects/'+project_id+'/praise_tread/like.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.post(url).then(function(result){if(result){_this.props.showNotification('点赞成功');_this.getDetail();}}).catch(function(error){console.log(error);});}else{var _url2='/projects/'+project_id+'/praise_tread/unlike.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.delete(_url2).then(function(result){if(result){_this.props.showNotification('取消点赞成功');_this.getDetail();}}).catch(function(error){console.log(error);});}};_this.forkFunc=function(){var project_id=_this.state.project_id;var url='/projects/'+project_id+'/forks.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.post(url).then(function(result){if(result&&result.data.status===0){_this.props.history.push('/projects/'+result.data.identifier+'/coder');}else{_this.props.showNotification(result.data.message);}}).catch(function(error){console.log(error);});};_this.getBranch=function(id){var url='/projects/'+id+'/branches.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.get(url).then(function(result){if(result&&result.data.length>0){var branchs=[];result.data.map(function(item,key){branchs.push({index:key,name:item.name});});_this.setState({branchList:result.data,branchs:branchs,branchLastCommit:result.data[0]// http_url:result.data[0].http_url
});}}).catch(function(error){});};_this.state={projectDetail:undefined,isManager:false,isReporter:false,isDeveloper:false,project_id:undefined,watchers_count:undefined,praises_count:undefined,forked_count:undefined,http_url:undefined,author:undefined,branchs:undefined,branchList:undefined,branchLastCommit:undefined};return _this;}// componentDidUpdate=(provState)=>{
*/var Detail=function(_Component){_inherits(Detail,_Component);function Detail(props){_classCallCheck(this,Detail);var _this=_possibleConstructorReturn(this,(Detail.__proto__||Object.getPrototypeOf(Detail)).call(this,props));_this.getUserInfo=function(){var url='/users/me.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.get(url).then(function(result){if(result&&result.data.login){_this.setState({current_user:result.data});}_this.getDetail();}).catch(function(error){console.log(error);});};_this.componentDidMount=function(){_this.getUserInfo();// this.getDetail();
};_this.getDetail=function(){console.log("state",_this.props);var state=_this.props.history.location.state;var current_user=_this.state.current_user;var projectsId=_this.props.match.params.projectsId;var url='/'+(state?state:current_user&&current_user.login)+'/'+projectsId+'.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.get(url).then(function(result){if(result){_this.setState({projectDetail:result.data,project_id:result.data.project_id,isManager:result.data.permission&&result.data.permission==="Manager",isReporter:result.data.permission&&result.data.permission==="Reporter",isDeveloper:result.data.permission&&result.data.permission==="Developer",http_url:result.data.clone_url,author:result.data.author,watchers_count:result.data.watchers_count,praises_count:result.data.praises_count,forked_count:result.data.forked_count});if(result.data.project_id){_this.getBranch(result.data.project_id);}}}).catch(function(error){});};_this.focusFunc=function(flag){var project_id=_this.state.project_id;if(!flag){var url='/projects/'+project_id+'/watchers/follow.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.post(url).then(function(result){if(result){_this.props.showNotification('关注成功');_this.getDetail();}}).catch(function(error){console.log(error);});}else{var _url='/projects/'+project_id+'/watchers/unfollow.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.delete(_url).then(function(result){if(result){_this.props.showNotification('取消关注成功');_this.getDetail();}}).catch(function(error){console.log(error);});}};_this.pariseFunc=function(flag){var project_id=_this.state.project_id;if(!flag){var url='/projects/'+project_id+'/praise_tread/like.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.post(url).then(function(result){if(result){_this.props.showNotification('点赞成功');_this.getDetail();}}).catch(function(error){console.log(error);});}else{var _url2='/projects/'+project_id+'/praise_tread/unlike.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.delete(_url2).then(function(result){if(result){_this.props.showNotification('取消点赞成功');_this.getDetail();}}).catch(function(error){console.log(error);});}};_this.forkFunc=function(){var project_id=_this.state.project_id;var url='/projects/'+project_id+'/forks.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.post(url).then(function(result){if(result&&result.data.status===0){_this.props.history.push('/projects/'+result.data.identifier+'/coder');}else{_this.props.showNotification(result.data.message);}}).catch(function(error){console.log(error);});};_this.getBranch=function(id){var url='/projects/'+id+'/branches.json';__WEBPACK_IMPORTED_MODULE_6_axios___default.a.get(url).then(function(result){if(result&&result.data.length>0){var branchs=[];result.data.map(function(item,key){branchs.push({index:key,name:item.name});});_this.setState({branchList:result.data,branchs:branchs,branchLastCommit:result.data[0]// http_url:result.data[0].http_url
});}}).catch(function(error){});};_this.state={projectDetail:undefined,isManager:false,isReporter:false,isDeveloper:false,project_id:undefined,watchers_count:undefined,praises_count:undefined,forked_count:undefined,http_url:undefined,author:undefined,branchs:undefined,branchList:undefined,branchLastCommit:undefined,current_user:undefined};return _this;}// componentDidUpdate=(provState)=>{
// if(provState.match.params.projectsId !== this.props.match.params.projectsId){
// this.getDetail();
// }

File diff suppressed because one or more lines are too long

@ -13,7 +13,7 @@ class CoderRootCommit extends Component{
branch:"master",
data:undefined,
dataCount:undefined,
limit:50,
limit:20,
page:1,
isSpin:false
}
@ -49,6 +49,7 @@ class CoderRootCommit extends Component{
message:item.message
})
})
this.setState({
data:array,
dataCount:result.data.total_count,
@ -79,6 +80,7 @@ class CoderRootCommit extends Component{
render(){
const { branch , data , dataCount , limit , page , isSpin } = this.state;
const { branchs } = this.props;
console.log("data", data)
const columns=[{
title:"作者",
dataIndex: 'name',

@ -142,6 +142,7 @@ class Detail extends Component{
branchs:undefined,
branchList:undefined,
branchLastCommit:undefined,
current_user: undefined
}
}
@ -152,8 +153,8 @@ class Detail extends Component{
this.setState({
current_user:result.data
})
this.getDetail();
}
this.getDetail();
}).catch(error=>{
console.log(error)
})
@ -161,8 +162,8 @@ class Detail extends Component{
componentDidMount=()=>{
// this.getUserInfo();
this.getDetail();
this.getUserInfo();
// this.getDetail();
}
// componentDidUpdate=(provState)=>{
@ -174,7 +175,7 @@ class Detail extends Component{
getDetail=()=>{
console.log("state",this.props)
const { state } = this.props.history.location;
const { current_user } = this.props
const { current_user } = this.state
const { projectsId } = this.props.match.params;
const url = `/${state ? state : current_user && current_user.login}/${projectsId}.json`;
axios.get(url).then((result)=>{

@ -85,7 +85,7 @@ class Index extends Component{
action: `${getUploadActionUrl()}`,
onChange:this.handleChange,
onRemove: this.onAttachmentRemove,
showUploadList: {showPreviewIcon: false, showRemoveIcon: true, showDownloadIcon: false}
showUploadList: { showPreviewIcon: false, showRemoveIcon: true, showDownloadIcon: false }
};
return(

Loading…
Cancel
Save