forked from Gitlink/forgeplus
1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
(this.webpackJsonp=this.webpackJsonp||[]).push([[78],{"3Diz":function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(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=i(u);n("MN5C");var o=i(n("cJAJ")),l=n("i8i4");function i(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){var t=e.projectsId,n=e.branch,i=e.owner,s=e.changeBranch,f=e.branchList,d=e.tagflag,p=void 0===d||d,m=(0,u.useState)(n),h=a(m,2),v=h[0],g=h[1],b=(0,u.useState)(!1),y=a(b,2),E=y[0],x=y[1],w=(0,u.useRef)(null),k=(0,u.useRef)(null);(0,u.useEffect)((function(){document.addEventListener("click",j,!1)}),[]);var j=function(e){var t=e.target,n=(0,l.findDOMNode)(w.current),r=(0,l.findDOMNode)(k.current);if(n&&r){var a=n.contains(t),u=r.contains(t);a||u||x(!1)}};(0,u.useEffect)((function(){g(n)}),[n]);var _=c.default.createElement("div",{ref:w},c.default.createElement(o.default,{visible:E,changeBranch:function(e){x(!1),s(e)},tagflag:p,projectsId:t,owner:i,branchList:f}));return c.default.createElement(r.default,{placement:"bottomLeft",visible:E,overlay:_,overlayClassName:"branch-tagBox-list",trigger:["click"]},c.default.createElement("div",{className:"branch-tagBox",ref:k,onClick:function(){return x(!E)}},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"}},v),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],O=(0,s.useState)(void 0),B=l(O,2),I=B[0],M=B[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],q=e.defaultBranch;(0,s.useEffect)((function(){q&&(b(q),S(q))}),[q]);var W=e.match.params,U=W.projectsId,H=W.owner,R=e.projectDetail;function Q(t){e.history.push("/"+H+"/"+U+"/settings/branches/"+t)}return(0,s.useEffect)((function(){q&&b(q)}),[q]),(0,s.useEffect)((function(){H&&(r(U,H),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){}))}(H,U))}),[H]),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:R&&R.repo_id,projectsId:U,changeBranch:b,owner:H,history:e.history,branchList:w,tagflag:!1}),f.default.createElement("a",{className:"color-blue ml20",onClick:function(){return t="/"+H+"/"+U+".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:R&&R.repo_id,projectsId:U,changeBranch:S,owner:H,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 Q(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 Q(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),O=o(S,2),B=O[0],I=O[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:B},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:16px;\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:16px;\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)})}}]); |