build/static/js/100.0fcbf83d.chunk.js

1 line
12 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[100],{"3Diz":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n("jsC+")),a=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,u=void 0;try{for(var c,o=e[Symbol.iterator]();!(r=(c=o.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,u=e}finally{try{!r&&o.return&&o.return()}finally{if(a)throw u}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("aIZi");var u=n("q1tI"),c=s(u);n("MN5C");var o=s(n("cJAJ")),l=n("i8i4"),i=n("sYIF");function s(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.projectsId,n=e.branch,s=e.owner,f=e.changeBranch,d=e.branchList,p=e.tagflag,m=void 0===p||p,h=(0,u.useState)(n),v=a(h,2),g=v[0],b=v[1],y=(0,u.useState)(!1),E=a(y,2),x=E[0],w=E[1],k=(0,u.useRef)(null),j=(0,u.useRef)(null);(0,u.useEffect)((function(){document.addEventListener("click",_,!1)}),[]);var _=function(e){var t=e.target,n=(0,l.findDOMNode)(k.current),r=(0,l.findDOMNode)(j.current);if(n&&r){var a=n.contains(t),u=r.contains(t);a||u||w(!1)}};(0,u.useEffect)((function(){b(n)}),[n]);var N=c.default.createElement("div",{ref:k},c.default.createElement(o.default,{visible:x,changeBranch:function(e){w(!1);var t=(0,i.turnbar)(e);f(t)},tagflag:m,projectsId:t,owner:s,branchList:d}));return c.default.createElement(r.default,{placement:"bottomLeft",visible:x,overlay:N,overlayClassName:"branch-tagBox-list",trigger:["click"]},c.default.createElement("div",{className:"branch-tagBox",ref:j,onClick:function(){return w(!x)}},c.default.createElement("span",{className:"color-grey-9 mr3 ml8"},c.default.createElement("i",{className:"iconfont icon-fenzhi2 font-18"})),c.default.createElement("span",{className:"ant-dropdown-link task-hide",style:{fontWeight:"500",minWidth:"45px",maxWidth:"270px"}},g),c.default.createElement("i",{className:"showtag iconfont icon-sanjiaoxing-down font-15 color-grey-9 mr5 ml5 mt1"})))}},MN5C:function(e,t,n){},RIeY:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a,u=b(n("NUBc")),c=b(n("2/Rp")),o=b(n("14Xm")),l=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,u=void 0;try{for(var c,o=e[Symbol.iterator]();!(r=(c=o.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,u=e}finally{try{!r&&o.return&&o.return()}finally{if(a)throw u}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},i=(r=["{\n padding:20px 30px;\n min-height:500px;\n}"],a=["{\n padding:20px 30px;\n min-height:500px;\n}"],Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(a)}})));n("YQTV"),n("L/Qf");var s=n("q1tI"),f=b(s),d=b(n("3Diz")),p=b(n("ess8")),m=b(n("vOnD")),h=n("spEH"),v=b(n("vDqi")),g=n("tnhM");function b(e){return e&&e.__esModule?e:{default:e}}var y=m.default.div(i);t.default=function(e){var t,n,r=(t=o.default.mark((function e(t,n){var r;return o.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,g.getBranch)(t,n);case 2:r=e.sent,k(r);case 4:case"end":return e.stop()}}),e,this)})),n=function(){var e=t.apply(this,arguments);return new Promise((function(t,n){return function r(a,u){try{var c=e[a](u),o=c.value}catch(e){return void n(e)}if(!c.done)return Promise.resolve(o).then((function(e){r("next",e)}),(function(e){r("throw",e)}));t(o)}("next")}))},function(e,t){return n.apply(this,arguments)}),a=(0,s.useState)("master"),i=l(a,2),m=i[0],b=i[1],E=(0,s.useState)(void 0),x=l(E,2),w=x[0],k=x[1],j=(0,s.useState)("master"),_=l(j,2),N=_[0],S=_[1],B=(0,s.useState)(void 0),O=l(B,2),I=O[0],M=O[1],C=(0,s.useState)(0),P=l(C,2),A=P[0],z=P[1],D=(0,s.useState)(1),L=l(D,2),T=L[0],J=L[1];(0,s.useEffect)((function(){e.defaultBranch&&(b(e.defaultBranch),S(e.defaultBranch))}),[e.defaultBranch]);var q=e.match.params,W=q.projectsId,U=q.owner,H=e.projectDetail;function R(t){e.history.push("/"+U+"/"+W+"/settings/branches/"+t)}return(0,s.useEffect)((function(){U&&(r(W,U),function(e,t){var n="/"+e+"/"+t+"/protected_branches.json";v.default.get(n,{params:{page:T,limit:15}}).then((function(e){e&&(z(e.data.total_count),M(e.data.protected_branches))})).catch((function(e){}))}(U,W))}),[U]),f.default.createElement(h.WhiteBack,null,f.default.createElement(p.default,null,f.default.createElement("span",{className:"font-18"},"分支设置")),f.default.createElement(y,null,f.default.createElement("div",{className:"pb20",style:{borderBottom:"1px dashed #eee"}},f.default.createElement("p",{className:"color-grey-3 mb10 font-18"},"默认分支"),f.default.createElement("p",{className:"mb10"},"默认分支被视作为代码库中的基本分支,是所有克隆、代码提交、合并请求的目标分支"),f.default.createElement(h.AlignCenter,null,f.default.createElement(d.default,{branch:m,repo_id:H&&H.repo_id,projectsId:W,changeBranch:b,owner:U,history:e.history,branchList:w,tagflag:!1}),f.default.createElement("a",{className:"color-blue ml20",onClick:function(){return t="/"+U+"/"+W+".json",void v.default.put(t,{default_branch:m}).then((function(t){if(t){e.showNotification("分支设置成功!");var n=e.getDetail;n&&n()}})).catch((function(e){console.log(e)}));var t}},"设为默认分支"))),f.default.createElement("div",{className:"mt10"},f.default.createElement("p",{className:"color-grey-3 mb10 font-18"},"分支保护"),f.default.createElement(h.AlignCenter,null,f.default.createElement(d.default,{branch:N,repo_id:H&&H.repo_id,projectsId:W,changeBranch:S,owner:U,history:e.history,branchList:w,tagflag:!1}),f.default.createElement("a",{className:I&&I.length>0?"color-blue ml20":"color-grey ml20",onClick:function(){return R(N)}},"设置分支保护")),I&&I.length>0&&f.default.createElement("div",{className:"protectBranchList"},I.map((function(e,t){return f.default.createElement(h.FlexAJ,null,f.default.createElement("span",null,e.branch_name),f.default.createElement(c.default,{onClick:function(){return R(e.branch_name)}},"编辑"))}))),A>15&&f.default.createElement("div",{className:"mt15 mb20",style:{textAlign:"center"}},f.default.createElement(u.default,{simple:!0,current:T,pageSize:15,total:A,onChange:function(e){J(e)}})))))}},cJAJ:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n("W9HT")),a=f(n("BvKs")),u=f(n("5rEg")),c=f(n("14Xm")),o=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,a=!1,u=void 0;try{for(var c,o=e[Symbol.iterator]();!(r=(c=o.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){a=!0,u=e}finally{try{!r&&o.return&&o.return()}finally{if(a)throw u}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};n("04bd"),n("2WkQ"),n("1vPl");var l=n("q1tI"),i=f(l),s=n("tnhM");function f(e){return e&&e.__esModule?e:{default:e}}function d(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(a,u){try{var c=t[a](u),o=c.value}catch(e){return void n(e)}if(!c.done)return Promise.resolve(o).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(o)}("next")}))}}t.default=function(e){var t,n,f=(t=d(c.default.mark((function e(t,n){var r;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,s.getBranch)(t,n);case 2:r=e.sent,A(r),T(r),I(!1);case 6:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)}),p=(n=d(c.default.mark((function e(t,n){var r;return c.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,s.getTag)(t,n);case 2:r=e.sent,A(r),T(r),I(!1);case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)}),m=e.changeBranch,h=e.tagflag,v=e.projectsId,g=e.owner,b=e.visible,y=(0,l.useState)(void 0),E=o(y,2),x=E[0],w=E[1],k=(0,l.useState)(0),j=o(k,2),_=j[0],N=j[1],S=(0,l.useState)(!0),B=o(S,2),O=B[0],I=B[1],M=(0,l.useState)(void 0),C=o(M,2),P=C[0],A=C[1],z=(0,l.useState)(void 0),D=o(z,2),L=D[0],T=D[1],J=(0,l.useState)("branch"),q=o(J,2),W=q[0],U=q[1];return(0,l.useEffect)((function(){b&&(U("branch"),f(v,g),I(!0))}),[b]),i.default.createElement("div",{className:"overlayBranch"},i.default.createElement("div",{className:"padding15",style:{paddingBottom:"0px"}},i.default.createElement(u.default,{prefix:i.default.createElement("i",{className:"iconfont icon-sousuo_icon1 font-14"}),placeholder:"请输入分支"+(h?"或标签":"")+"名称搜索",autocomplete:"off",className:"OptionsInput",value:x,onChange:function(e){w(e.target.value);var t=e.target.value?P&&P.length>0&&P.filter((function(t){return t.name.indexOf(e.target.value)>-1})):P;T(t)}})),i.default.createElement(a.default,{mode:"horizontal",className:"navUl",selectedKeys:[W],onClick:function(e){U(e.key),I(!0),"branch"===e.key?(f(v,g),N(0)):(p(v,g),N(1))}},i.default.createElement(a.default.Item,{key:"branch"},"分支"),h&&i.default.createElement(a.default.Item,{key:"tag"},"标签")),i.default.createElement(r.default,{spinning:O},i.default.createElement("ul",{className:"OptionsUl",id:"ul-btn"},L&&L.length>0&&L.map((function(e,t){return i.default.createElement("li",{key:t,onClick:function(){return t=e.name,void m(t);var t}},i.default.createElement("a",{className:"task-hide ulALink"},e.name))})),L&&0===L.length&&i.default.createElement("p",{className:"listTips"},"暂无",x,0===_?"分支":"标签","~"))))}},ess8:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,a,u=(r=["{\n background-color:#fff;\n padding:20px 30px;\n border-bottom:1px solid #eee;\n font-size:18px;\n color:#333;\n display:flex;\n justify-content: space-between;\n align-items:center;\n}"],a=["{\n background-color:#fff;\n padding:20px 30px;\n border-bottom:1px solid #eee;\n font-size:18px;\n color:#333;\n display:flex;\n justify-content: space-between;\n align-items:center;\n}"],Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(a)}}))),c=o(n("q1tI"));function o(e){return e&&e.__esModule?e:{default:e}}var l=o(n("vOnD")).default.div(u);t.default=function(e){var t=e.children;return c.default.createElement(l,null,t)}},tnhM:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUser=t.getSubEntries=t.getHooks=t.getTag=t.getBranch=void 0;var r=u(n("14Xm")),a=u(n("vDqi"));function u(e){return e&&e.__esModule?e:{default:e}}function c(e){return function(){var t=e.apply(this,arguments);return new Promise((function(e,n){return function r(a,u){try{var c=t[a](u),o=c.value}catch(e){return void n(e)}if(!c.done)return Promise.resolve(o).then((function(e){r("next",e)}),(function(e){r("throw",e)}));e(o)}("next")}))}}var o,l,i,s,f;t.getBranch=(o=c(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.default.get("/"+n+"/"+t+"/branches.json");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e,void 0)}))),function(e,t){return o.apply(this,arguments)}),t.getTag=(l=c(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.default.get("/"+n+"/"+t+"/tags.json");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e,void 0)}))),function(e,t){return l.apply(this,arguments)}),t.getHooks=(i=c(r.default.mark((function e(t,n){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.default.get("/projects/"+t+"/hooks.json",{params:n});case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e,void 0)}))),function(e,t){return i.apply(this,arguments)}),t.getSubEntries=(s=c(r.default.mark((function e(t,n,u){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.default.get("/"+t+"/"+n+"/sub_entries.json",{params:u});case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e,void 0)}))),function(e,t,n){return s.apply(this,arguments)}),t.getUser=(f=c(r.default.mark((function e(t){return r.default.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.default.get("/users/"+t+"/hovercard.json");case 2:return e.abrupt("return",e.sent.data);case 3:case"end":return e.stop()}}),e,void 0)}))),function(e){return f.apply(this,arguments)})}}]);