plugin-git-manager 1.2.9 → 1.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):"function"==typeof define&&define.amd?define("plugin-git-manager/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/plugin-ai/client"],t):"object"==typeof exports?exports["plugin-git-manager/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):e["plugin-git-manager/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/plugin-ai/client"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,a,u,c={375:function(e){e.exports=r},485:function(t){t.exports=e},75:function(e){e.exports=o},59:function(e){e.exports=n},155:function(e){e.exports=t}},l={};function p(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return c[e].call(n.exports,n,n.exports,p),n.exports}p.m=c,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({326:"42b7b53651ffab3a",434:"5bd7d0a433eaf499",878:"44427151f696954b"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},p.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="plugin-git-manager/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","plugin-git-manager/client-v2:"+n),o.src=e),f[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(s=p.g.location+"");var f,s,g=p.g.document;if(!s&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(s=g.currentScript.src),!s)){var d=g.getElementsByTagName("script");if(d.length)for(var b=d.length-1;b>-1&&(!s||!/^http(s?):/.test(s));)s=d[b--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");p.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},p.f.j=function(e,t){var n=p.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),a=Error();p.l(o,function(t){if(p.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],a=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==i[e]})){for(n in a)p.o(a,n)&&(p.m[n]=a[n]);u&&u(p)}for(e&&e(t);c<o.length;c++)r=o[c],p.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(u=self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).forEach(a.bind(null,0)),u.push=a.bind(null,u.push.bind(u));var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-git-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-git-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client-v2/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return u}});var e=p(485);function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}p(155);function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var u=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.pluginSettingsManager.addMenuItem({key:"git-manager",title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"repositories",title:this.t("Repositories"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("434").then(p.bind(p,33)).then(function(e){return{default:e.RepositoryConfig}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"manage",title:this.t("Manage"),aclSnippet:"pm.plugin-git-manager.manage",componentLoader:function(){return Promise.all([p.e("326"),p.e("878")]).then(p.bind(p,205)).then(function(e){return{default:e.GitManagerSettings}})}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(i(e.Plugin))}(),v}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):"function"==typeof define&&define.amd?define("plugin-git-manager/client-v2",["@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/plugin-ai/client"],t):"object"==typeof exports?exports["plugin-git-manager/client-v2"]=t(require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/plugin-ai/client")):e["plugin-git-manager/client-v2"]=t(e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/plugin-ai/client"])}(self,function(e,t,n,r,o){return function(){"use strict";var i,a,u,c={375:function(e){e.exports=r},485:function(t){t.exports=e},75:function(e){e.exports=o},59:function(e){e.exports=n},155:function(e){e.exports=t}},l={};function p(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return c[e].call(n.exports,n,n.exports,p),n.exports}p.m=c,p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return""+e+"."+({326:"42b7b53651ffab3a",434:"c2f944f911a56da0",878:"295f09c9d77ea6d8"})[e]+".js"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},f={},p.l=function(e,t,n,r){if(f[e])return void f[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="plugin-git-manager/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,p.nc&&o.setAttribute("nonce",p.nc),o.setAttribute("data-rspack","plugin-git-manager/client-v2:"+n),o.src=e),f[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=f[e];if(delete f[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},p.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.g.importScripts&&(s=p.g.location+"");var f,s,g=p.g.document;if(!s&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(s=g.currentScript.src),!s)){var d=g.getElementsByTagName("script");if(d.length)for(var b=d.length-1;b>-1&&(!s||!/^http(s?):/.test(s));)s=d[b--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");p.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i={889:0},p.f.j=function(e,t){var n=p.o(i,e)?i[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),a=Error();p.l(o,function(t){if(p.o(i,e)&&(0!==(n=i[e])&&(i[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}},"chunk-"+e,e)}},a=function(e,t){var n,r,o=t[0],a=t[1],u=t[2],c=0;if(o.some(function(e){return 0!==i[e]})){for(n in a)p.o(a,n)&&(p.m[n]=a[n]);u&&u(p)}for(e&&e(t);c<o.length;c++)r=o[c],p.o(i,r)&&i[r]&&i[r][0](),i[r]=0},(u=self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).forEach(a.bind(null,0)),u.push=a.bind(null,u.push.bind(u));var v={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/plugin-git-manager/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/plugin-git-manager/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/plugin-git-manager/dist/client-v2/"}p.p=e}(),!function(){p.r(v),p.d(v,{default:function(){return u}});var e=p(485);function t(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function n(e,t,r){return(n=a()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&o(i,n.prototype),i}).apply(null,arguments)}p(155);function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function i(e){var t="function"==typeof Map?new Map:void 0;return(i=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return n(e,arguments,r(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(i,e)})(e)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var u=function(e){var n;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function i(){var e,t;if(!(this instanceof i))throw TypeError("Cannot call a class as a function");return e=i,t=arguments,e=r(e),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(e,t||[],r(this).constructor):e.apply(this,t))}return i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),e&&o(i,e),n=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.pluginSettingsManager.addMenuItem({key:"git-manager",title:this.t("Git Manager"),icon:"BranchesOutlined"}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"repositories",title:this.t("Repositories"),aclSnippet:"pm.plugin-git-manager.repositories",componentLoader:function(){return p.e("434").then(p.bind(p,33)).then(function(e){return{default:e.RepositoryConfig}})}}),this.pluginSettingsManager.addPageTabItem({menuKey:"git-manager",key:"manage",title:this.t("Manage"),aclSnippet:"pm.plugin-git-manager.manage",componentLoader:function(){return Promise.all([p.e("326"),p.e("878")]).then(p.bind(p,205)).then(function(e){return{default:e.GitManagerSettings}})}}),[2]})},function(){var n=this,r=arguments;return new Promise(function(o,i){var a=e.apply(n,r);function u(e){t(a,o,i,u,c,"next",e)}function c(e){t(a,o,i,u,c,"throw",e)}u(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(i.prototype,n),i}(i(e.Plugin))}(),v}()});
@@ -11,13 +11,13 @@ module.exports = {
11
11
  "react": "18.2.0",
12
12
  "antd": "5.24.2",
13
13
  "@ant-design/icons": "5.6.1",
14
- "@nocobase/client": "2.1.9",
15
- "@nocobase/plugin-acl": "2.1.9",
16
- "@nocobase/client-v2": "2.1.9",
17
- "@nocobase/server": "2.1.9",
14
+ "@nocobase/client": "2.1.10",
15
+ "@nocobase/plugin-acl": "2.1.10",
16
+ "@nocobase/client-v2": "2.1.10",
17
+ "@nocobase/server": "2.1.10",
18
18
  "sequelize": "6.35.2",
19
19
  "dayjs": "1.11.13",
20
- "@nocobase/plugin-ai": "2.1.9",
21
- "@nocobase/actions": "2.1.9",
22
- "@nocobase/database": "2.1.9"
20
+ "@nocobase/plugin-ai": "2.1.10",
21
+ "@nocobase/actions": "2.1.10",
22
+ "@nocobase/database": "2.1.10"
23
23
  };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Git Manager",
4
4
  "displayName.zh-CN": "Git 管理器",
5
5
  "description": "Manage Git repositories with PAT authentication - pull, push, fetch, diff, file browsing",
6
- "version": "1.2.9",
6
+ "version": "1.2.10",
7
7
  "license": "Apache-2.0",
8
8
  "main": "dist/server/index.js",
9
9
  "files": [
@@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useState } from 'react';
2
2
  import { Table, Button, Modal, Form, Input, Space, Tag, Popconfirm, Switch, Tooltip, Select, message } from 'antd';
3
3
  import { PlusOutlined, DeleteOutlined, LinkOutlined, RobotOutlined } from '@ant-design/icons';
4
4
  import { useApp } from '@nocobase/client-v2';
5
- import { useGitManager } from '../context/GitManagerContext';
5
+ import { GitManagerProvider, useGitManager } from '../context/GitManagerContext';
6
6
  import { useT } from '../locale';
7
7
 
8
8
  export const RepositoryConfig: React.FC = () => {
@@ -33,6 +33,10 @@ export const RepositoryConfig: React.FC = () => {
33
33
  loadReviewFlows().catch(() => undefined);
34
34
  }, [loadReviewFlows]);
35
35
 
36
+ useEffect(() => {
37
+ refreshRepos().catch(() => undefined);
38
+ }, [refreshRepos]);
39
+
36
40
  const getAutoFlowOptions = (repoId: number) =>
37
41
  reviewFlows
38
42
  .filter((flow) => flow.repositoryId === repoId || flow.repositoryId == null)
@@ -102,9 +106,7 @@ export const RepositoryConfig: React.FC = () => {
102
106
  title: t('Repository Name'),
103
107
  dataIndex: 'name',
104
108
  key: 'name',
105
- render: (text: string, record: any) => (
106
- <a onClick={() => setSelectedRepo(record)}>{text}</a>
107
- ),
109
+ render: (text: string, record: any) => <a onClick={() => setSelectedRepo(record)}>{text}</a>,
108
110
  },
109
111
  { title: t('Repository URL'), dataIndex: 'repoUrl', key: 'repoUrl', ellipsis: true },
110
112
  { title: t('Local Path'), dataIndex: 'localPath', key: 'localPath', ellipsis: true },
@@ -134,7 +136,8 @@ export const RepositoryConfig: React.FC = () => {
134
136
  params: { filterByTk: record.id },
135
137
  data: {
136
138
  autoReview: checked,
137
- autoReviewFlowId: checked && !record.autoReviewFlowId ? options[0]?.value ?? null : record.autoReviewFlowId,
139
+ autoReviewFlowId:
140
+ checked && !record.autoReviewFlowId ? options[0]?.value ?? null : record.autoReviewFlowId,
138
141
  },
139
142
  });
140
143
  await refreshRepos();
@@ -269,7 +272,12 @@ export const RepositoryConfig: React.FC = () => {
269
272
  <Form.Item name="repoUrl" label={t('Repository URL')} rules={[{ required: true }]}>
270
273
  <Input placeholder="https://gitlab.com/user/repo.git" />
271
274
  </Form.Item>
272
- <Form.Item name="username" label={t('Username')} rules={[{ required: true }]} extra={t('GitLab username for PAT authentication')}>
275
+ <Form.Item
276
+ name="username"
277
+ label={t('Username')}
278
+ rules={[{ required: true }]}
279
+ extra={t('GitLab username for PAT authentication')}
280
+ >
273
281
  <Input placeholder="gitlab-username" />
274
282
  </Form.Item>
275
283
  <Form.Item name="localPath" label={t('Local Path')} rules={[{ required: true }]}>
@@ -281,7 +289,11 @@ export const RepositoryConfig: React.FC = () => {
281
289
  <Form.Item name="defaultBranch" label={t('Default Branch')}>
282
290
  <Input placeholder="main" />
283
291
  </Form.Item>
284
- <Form.Item name="autoReviewFlowId" label={t('Primary Auto Review Flow')} extra={t('Only flows with automatic trigger modes are shown')}>
292
+ <Form.Item
293
+ name="autoReviewFlowId"
294
+ label={t('Primary Auto Review Flow')}
295
+ extra={t('Only flows with automatic trigger modes are shown')}
296
+ >
285
297
  <Select
286
298
  allowClear
287
299
  placeholder={t('Select a flow')}
@@ -294,3 +306,9 @@ export const RepositoryConfig: React.FC = () => {
294
306
  </div>
295
307
  );
296
308
  };
309
+
310
+ export const RepositoryConfigSettings: React.FC = () => (
311
+ <GitManagerProvider>
312
+ <RepositoryConfig />
313
+ </GitManagerProvider>
314
+ );
@@ -23,10 +23,14 @@ interface GitManagerContextType {
23
23
  refreshBranches: () => Promise<void>;
24
24
  }
25
25
 
26
- const GitManagerContext = createContext<GitManagerContextType>(null);
26
+ const GitManagerContext = createContext<GitManagerContextType | null>(null);
27
27
 
28
28
  export function useGitManager() {
29
- return useContext(GitManagerContext);
29
+ const context = useContext(GitManagerContext);
30
+ if (!context) {
31
+ throw new Error('useGitManager must be used within GitManagerProvider');
32
+ }
33
+ return context;
30
34
  }
31
35
 
32
36
  export const GitManagerProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
@@ -79,7 +83,9 @@ export const GitManagerProvider: React.FC<{ children: React.ReactNode }> = ({ ch
79
83
  }, [api]);
80
84
 
81
85
  return (
82
- <GitManagerContext.Provider value={{ repos, selectedRepo, loading, branches, currentBranch, setSelectedRepo, refreshRepos, refreshBranches }}>
86
+ <GitManagerContext.Provider
87
+ value={{ repos, selectedRepo, loading, branches, currentBranch, setSelectedRepo, refreshRepos, refreshBranches }}
88
+ >
83
89
  {children}
84
90
  </GitManagerContext.Provider>
85
91
  );
@@ -1,65 +1,61 @@
1
- import { Plugin } from '@nocobase/client';
2
- import React from 'react';
3
- import {
4
- GitRepositoryWorkContext,
5
- GitMergeRequestWorkContext,
6
- GitCommitWorkContext,
7
- } from './ai-context';
8
-
9
- const GitManagerSettings = React.lazy(() =>
10
- import('./components/GitManagerSettings').then((m) => ({ default: m.GitManagerSettings })),
11
- );
12
-
13
- const RepositoryConfig = React.lazy(() =>
14
- import('./components/RepositoryConfig').then((m) => ({ default: m.RepositoryConfig })),
15
- );
16
-
17
- import PluginACLClient from '@nocobase/plugin-acl/client';
18
- import { RepositoryPermissions } from './components/RepositoryPermissions';
19
-
20
- export class PluginGitManagerClient extends Plugin {
21
- async load() {
22
- // Parent group with no direct component — acts as a category in settings
23
- this.app.pluginSettingsManager.add('git-manager', {
24
- title: (this as any).t('Git Manager'),
25
- icon: 'BranchesOutlined',
26
- });
27
-
28
- // Repositories config — separate group for ACL-granular access
29
- this.app.pluginSettingsManager.add('git-manager.repositories', {
30
- title: (this as any).t('Repositories'),
31
- Component: RepositoryConfig,
32
- aclSnippet: `pm.plugin-git-manager.repositories`,
33
- });
34
-
35
- // Full management — requires full plugin permission
36
- this.app.pluginSettingsManager.add('git-manager.manage', {
37
- title: (this as any).t('Manage'),
38
- Component: GitManagerSettings,
39
- aclSnippet: `pm.plugin-git-manager.manage`,
40
- });
41
-
42
- const aiManager = ((this as any).app as any).aiManager;
43
- if (aiManager?.registerWorkContext) {
44
- aiManager.registerWorkContext('git-repository', GitRepositoryWorkContext);
45
- aiManager.registerWorkContext('git-merge-request', GitMergeRequestWorkContext);
46
- aiManager.registerWorkContext('git-commit', GitCommitWorkContext);
47
- }
48
-
49
- const aclPlugin = this.app.pm.get(PluginACLClient);
50
- if (aclPlugin) {
51
- aclPlugin.settingsUI.addPermissionsTab(({ t, TabLayout, activeRole }) => ({
52
- key: 'git-manager',
53
- label: 'Git Manager',
54
- sort: 25,
55
- children: (
56
- <TabLayout>
57
- <RepositoryPermissions activeRole={activeRole} />
58
- </TabLayout>
59
- ),
60
- }));
61
- }
62
- }
63
- }
64
-
65
- export default PluginGitManagerClient;
1
+ import { Plugin } from '@nocobase/client';
2
+ import React from 'react';
3
+ import { GitRepositoryWorkContext, GitMergeRequestWorkContext, GitCommitWorkContext } from './ai-context';
4
+
5
+ const GitManagerSettings = React.lazy(() =>
6
+ import('./components/GitManagerSettings').then((m) => ({ default: m.GitManagerSettings })),
7
+ );
8
+
9
+ const RepositoryConfig = React.lazy(() =>
10
+ import('./components/RepositoryConfig').then((m) => ({ default: m.RepositoryConfigSettings })),
11
+ );
12
+
13
+ import PluginACLClient from '@nocobase/plugin-acl/client';
14
+ import { RepositoryPermissions } from './components/RepositoryPermissions';
15
+
16
+ export class PluginGitManagerClient extends Plugin {
17
+ async load() {
18
+ // Parent group with no direct component — acts as a category in settings
19
+ this.app.pluginSettingsManager.add('git-manager', {
20
+ title: (this as any).t('Git Manager'),
21
+ icon: 'BranchesOutlined',
22
+ });
23
+
24
+ // Repositories config — separate group for ACL-granular access
25
+ this.app.pluginSettingsManager.add('git-manager.repositories', {
26
+ title: (this as any).t('Repositories'),
27
+ Component: RepositoryConfig,
28
+ aclSnippet: `pm.plugin-git-manager.repositories`,
29
+ });
30
+
31
+ // Full management — requires full plugin permission
32
+ this.app.pluginSettingsManager.add('git-manager.manage', {
33
+ title: (this as any).t('Manage'),
34
+ Component: GitManagerSettings,
35
+ aclSnippet: `pm.plugin-git-manager.manage`,
36
+ });
37
+
38
+ const aiManager = ((this as any).app as any).aiManager;
39
+ if (aiManager?.registerWorkContext) {
40
+ aiManager.registerWorkContext('git-repository', GitRepositoryWorkContext);
41
+ aiManager.registerWorkContext('git-merge-request', GitMergeRequestWorkContext);
42
+ aiManager.registerWorkContext('git-commit', GitCommitWorkContext);
43
+ }
44
+
45
+ const aclPlugin = this.app.pm.get(PluginACLClient);
46
+ if (aclPlugin) {
47
+ aclPlugin.settingsUI.addPermissionsTab(({ t, TabLayout, activeRole }) => ({
48
+ key: 'git-manager',
49
+ label: 'Git Manager',
50
+ sort: 25,
51
+ children: (
52
+ <TabLayout>
53
+ <RepositoryPermissions activeRole={activeRole} />
54
+ </TabLayout>
55
+ ),
56
+ }));
57
+ }
58
+ }
59
+ }
60
+
61
+ export default PluginGitManagerClient;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunkplugin_git_manager=self.webpackChunkplugin_git_manager||[]).push([["434"],{33:function(e,t,r){r.d(t,{RepositoryConfig:function(){return y}});var n=r(155),a=r.n(n),l=r(59),o=r(375),u=r(866),i=r(602),c=r(578);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t,r,n,a,l,o){try{var u=e[l](o),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function d(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){f(l,n,a,o,u,"next",e)}function u(e){f(l,n,a,o,u,"throw",e)}o(void 0)})}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,u=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){u=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(u)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(o,"next",{value:i(0)}),u(o,"throw",{value:i(1)}),u(o,"return",{value:i(2)}),"function"==typeof Symbol&&u(o,Symbol.iterator,{value:function(){return this}}),o;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var y=function(){var e=(0,c.k)(),t=(0,u.useApp)().apiClient,r=(0,i.B)(),s=r.repos,f=r.refreshRepos,y=r.selectedRepo,h=r.setSelectedRepo,b=p((0,n.useState)(!1),2),v=b[0],g=b[1],w=p((0,n.useState)(null),2),E=w[0],O=w[1],I=p(l.Form.useForm(),1)[0],S=p((0,n.useState)(null),2),k=S[0],R=S[1],P=p((0,n.useState)([]),2),j=P[0],C=P[1],F=(0,n.useCallback)(function(){return d(function(){var e;return m(this,function(r){switch(r.label){case 0:return[4,t.request({url:"gitReviewFlows:list",params:{pageSize:100,filter:{enabled:!0,triggerMode:{$in:["onMergeRequestCreated","both"]}}}})];case 1:return C((null==(e=r.sent().data)?void 0:e.data)||[]),[2]}})})()},[t]);(0,n.useEffect)(function(){F().catch(function(){})},[F]);var x=function(t){return j.filter(function(e){return e.repositoryId===t||null==e.repositoryId}).map(function(t){return{value:t.id,label:"".concat(t.name).concat(null==t.repositoryId?" (".concat(e("global"),")"):"")}})},A=[{title:e("Repository Name"),dataIndex:"name",key:"name",render:function(e,t){return a().createElement("a",{onClick:function(){return h(t)}},e)}},{title:e("Repository URL"),dataIndex:"repoUrl",key:"repoUrl",ellipsis:!0},{title:e("Local Path"),dataIndex:"localPath",key:"localPath",ellipsis:!0},{title:e("Default Branch"),dataIndex:"defaultBranch",key:"defaultBranch",width:120},{title:a().createElement(l.Tooltip,{title:e("Auto-poll new merge requests every 5 minutes")},a().createElement(l.Space,{size:4},a().createElement(o.RobotOutlined,null),e("Auto Review"))),dataIndex:"autoReview",key:"autoReview",width:110,render:function(r,n){return a().createElement(l.Switch,{size:"small",checked:!!r,onChange:function(r){return d(function(){var a,o,u,i;return m(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),u=x(n.id),[4,t.request({url:"gitRepositories:update",method:"post",params:{filterByTk:n.id},data:{autoReview:r,autoReviewFlowId:r&&!n.autoReviewFlowId?null!=(a=null==(o=u[0])?void 0:o.value)?a:null:n.autoReviewFlowId}})];case 1:return c.sent(),[4,f()];case 2:return c.sent(),[3,4];case 3:return i=c.sent(),l.message.error((null==i?void 0:i.message)||e("Failed to save")),[3,4];case 4:return[2]}})})()}})}},{title:e("Primary Auto Flow"),dataIndex:"autoReviewFlowId",key:"autoReviewFlowId",width:220,render:function(r,n){var o=x(n.id);return a().createElement(l.Select,{allowClear:!0,size:"small",style:{width:"100%"},disabled:!n.autoReview,placeholder:e("Select a flow"),value:r||void 0,options:o,notFoundContent:e("No matching flow available"),onChange:function(r){return d(function(){var a;return m(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,t.request({url:"gitRepositories:update",method:"post",params:{filterByTk:n.id},data:{autoReviewFlowId:r||null}})];case 1:return o.sent(),[4,f()];case 2:return o.sent(),[3,4];case 3:return a=o.sent(),l.message.error((null==a?void 0:a.message)||e("Failed to save")),[3,4];case 4:return[2]}})})()}})}},{title:e("Status"),dataIndex:"status",key:"status",width:120,render:function(t){var r={connected:{color:"green",label:e("Connected")},error:{color:"red",label:e("Error")}}[t]||{color:"default",label:e("Disconnected")};return a().createElement(l.Tag,{color:r.color},r.label)}},{title:"",key:"actions",width:200,render:function(r,n){return a().createElement(l.Space,{size:"small"},"connected"!==n.status&&a().createElement(l.Button,{size:"small",icon:a().createElement(o.LinkOutlined,null),loading:k==="clone-".concat(n.id),onClick:function(){return d(function(){var r,a,o,u,i;return m(this,function(c){switch(c.label){case 0:R("clone-".concat(n.id)),c.label=1;case 1:return c.trys.push([1,4,5,6]),[4,t.request({url:"gitManager:clone",method:"post",params:{repositoryId:n.id}})];case 2:return c.sent(),l.message.success(e("Clone successful")),[4,f()];case 3:return c.sent(),[3,6];case 4:return r=c.sent(),l.message.error((null==r||null==(i=r.response)||null==(u=i.data)||null==(o=u.errors)||null==(a=o[0])?void 0:a.message)||e("Clone failed")),[3,6];case 5:return R(null),[7];case 6:return[2]}})})()}},e("Clone")),a().createElement(l.Button,{size:"small",onClick:function(){var e,t;O(n),I.setFieldsValue((e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n),t=t={pat:""},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e)),g(!0)}},e("Edit")),a().createElement(l.Popconfirm,{title:e("Delete this repository?"),onConfirm:function(){var r;return r=n.id,d(function(){return m(this,function(n){switch(n.label){case 0:return[4,t.request({url:"gitRepositories:destroy",method:"post",params:{filterByTk:r}})];case 1:return n.sent(),(null==y?void 0:y.id)===r&&h(null),l.message.success(e("Deleted")),[4,f()];case 2:return n.sent(),[2]}})})()}},a().createElement(l.Button,{size:"small",danger:!0,icon:a().createElement(o.DeleteOutlined,null)})))}}];return a().createElement("div",null,a().createElement("div",{style:{marginBottom:16}},a().createElement(l.Button,{type:"primary",icon:a().createElement(o.PlusOutlined,null),onClick:function(){O(null),I.resetFields(),g(!0)}},e("Add Repository"))),a().createElement(l.Table,{dataSource:s,columns:A,rowKey:"id",size:"small",pagination:!1,rowClassName:function(e){return(null==y?void 0:y.id)===e.id?"ant-table-row-selected":""}}),a().createElement(l.Modal,{title:E?e("Edit Repository"):e("Add Repository"),open:v,onOk:function(){return d(function(){var r,n;return m(this,function(a){switch(a.label){case 0:return[4,I.validateFields()];case 1:r=a.sent(),E&&(!r.pat||"••••••••"===r.pat)&&delete r.pat,a.label=2;case 2:if(a.trys.push([2,8,,9]),!E)return[3,4];return[4,t.request({url:"gitRepositories:update",method:"post",params:{filterByTk:E.id},data:r})];case 3:return a.sent(),l.message.success(e("Repository updated")),[3,6];case 4:return[4,t.request({url:"gitRepositories:create",method:"post",data:r})];case 5:a.sent(),l.message.success(e("Repository added")),a.label=6;case 6:return g(!1),O(null),I.resetFields(),[4,f()];case 7:return a.sent(),[3,9];case 8:return n=a.sent(),l.message.error((null==n?void 0:n.message)||e("Failed to save")),[3,9];case 9:return[2]}})})()},onCancel:function(){g(!1),O(null)},width:520},a().createElement(l.Form,{form:I,layout:"vertical",initialValues:{defaultBranch:"main"}},a().createElement(l.Form.Item,{name:"name",label:e("Repository Name"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:"my-project"})),a().createElement(l.Form.Item,{name:"repoUrl",label:e("Repository URL"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:"https://gitlab.com/user/repo.git"})),a().createElement(l.Form.Item,{name:"username",label:e("Username"),rules:[{required:!0}],extra:e("GitLab username for PAT authentication")},a().createElement(l.Input,{placeholder:"gitlab-username"})),a().createElement(l.Form.Item,{name:"localPath",label:e("Local Path"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:"my-project"})),a().createElement(l.Form.Item,{name:"pat",label:e("Personal Access Token"),rules:E?[]:[{required:!0}]},a().createElement(l.Input.Password,{placeholder:E?"Leave empty to keep current":"ghp_xxxx..."})),a().createElement(l.Form.Item,{name:"defaultBranch",label:e("Default Branch")},a().createElement(l.Input,{placeholder:"main"})),a().createElement(l.Form.Item,{name:"autoReviewFlowId",label:e("Primary Auto Review Flow"),extra:e("Only flows with automatic trigger modes are shown")},a().createElement(l.Select,{allowClear:!0,placeholder:e("Select a flow"),options:x(null==E?void 0:E.id),notFoundContent:e("No matching flow available")})))))}},602:function(e,t,r){r.d(t,{B:function(){return d},N:function(){return p}});var n=r(155),a=r.n(n),l=r(866);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t,r,n,a,l,o){try{var u=e[l](o),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){u(l,n,a,o,i,"next",e)}function i(e){u(l,n,a,o,i,"throw",e)}o(void 0)})}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,u=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){u=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(u)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(o,"next",{value:i(0)}),u(o,"throw",{value:i(1)}),u(o,"return",{value:i(2)}),"function"==typeof Symbol&&u(o,Symbol.iterator,{value:function(){return this}}),o;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var f=(0,n.createContext)(null);function d(){return(0,n.useContext)(f)}var p=function(e){var t=e.children,r=(0,l.useApp)().apiClient,o=c((0,n.useState)([]),2),u=o[0],d=o[1],p=c((0,n.useState)(null),2),m=p[0],y=p[1],h=c((0,n.useState)(!1),2),b=h[0],v=h[1],g=c((0,n.useState)([]),2),w=g[0],E=g[1],O=c((0,n.useState)(""),2),I=O[0],S=O[1],k=(0,n.useRef)(m);k.current=m;var R=(0,n.useCallback)(function(){return i(function(){var e,t,n,a;return s(this,function(l){switch(l.label){case 0:if(!(e=k.current)||"connected"!==e.status)return E([]),S(""),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r.request({url:"gitManager:branches",params:{repositoryId:e.id}})];case 2:return(a=(null==(n=l.sent().data)||null==(t=n.data)?void 0:t.data)||(null==n?void 0:n.data))&&(E(a.all||[]),S(a.current||"")),[3,4];case 3:return l.sent(),E([]),S(""),[3,4];case 4:return[2]}})})()},[r]),P=(0,n.useCallback)(function(){return i(function(){var e,t,n,a;return s(this,function(l){switch(l.label){case 0:v(!0),l.label=1;case 1:return l.trys.push([1,,3,4]),[4,r.request({url:"gitRepositories:list",params:{pageSize:100}})];case 2:return d(t=(null==(e=l.sent().data)?void 0:e.data)||[]),(n=k.current)&&(a=t.find(function(e){return e.id===n.id}))&&y(a),[3,4];case 3:return v(!1),[7];case 4:return[2]}})})()},[r]);return a().createElement(f.Provider,{value:{repos:u,selectedRepo:m,loading:b,branches:w,currentBranch:I,setSelectedRepo:y,refreshRepos:P,refreshBranches:R}},t)}},578:function(e,t,r){r.d(t,{k:function(){return a}});var n=r(866);function a(){var e=(0,n.useApp)();return function(t,r){return e.i18n.t(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({ns:["plugin-git-manager","client"]},r))}}}}]);
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- "use strict";(self.webpackChunkplugin_git_manager_client_v2=self.webpackChunkplugin_git_manager_client_v2||[]).push([["434"],{33:function(e,t,r){r.d(t,{RepositoryConfig:function(){return y}});var n=r(155),a=r.n(n),l=r(59),o=r(375),u=r(485),i=r(602),c=r(578);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function f(e,t,r,n,a,l,o){try{var u=e[l](o),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function d(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){f(l,n,a,o,u,"next",e)}function u(e){f(l,n,a,o,u,"throw",e)}o(void 0)})}}function p(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,u=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){u=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(u)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(o,"next",{value:i(0)}),u(o,"throw",{value:i(1)}),u(o,"return",{value:i(2)}),"function"==typeof Symbol&&u(o,Symbol.iterator,{value:function(){return this}}),o;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var y=function(){var e=(0,c.k)(),t=(0,u.useApp)().apiClient,r=(0,i.B)(),s=r.repos,f=r.refreshRepos,y=r.selectedRepo,h=r.setSelectedRepo,b=p((0,n.useState)(!1),2),v=b[0],g=b[1],w=p((0,n.useState)(null),2),E=w[0],O=w[1],I=p(l.Form.useForm(),1)[0],S=p((0,n.useState)(null),2),k=S[0],R=S[1],P=p((0,n.useState)([]),2),j=P[0],C=P[1],F=(0,n.useCallback)(function(){return d(function(){var e;return m(this,function(r){switch(r.label){case 0:return[4,t.request({url:"gitReviewFlows:list",params:{pageSize:100,filter:{enabled:!0,triggerMode:{$in:["onMergeRequestCreated","both"]}}}})];case 1:return C((null==(e=r.sent().data)?void 0:e.data)||[]),[2]}})})()},[t]);(0,n.useEffect)(function(){F().catch(function(){})},[F]);var x=function(t){return j.filter(function(e){return e.repositoryId===t||null==e.repositoryId}).map(function(t){return{value:t.id,label:"".concat(t.name).concat(null==t.repositoryId?" (".concat(e("global"),")"):"")}})},A=[{title:e("Repository Name"),dataIndex:"name",key:"name",render:function(e,t){return a().createElement("a",{onClick:function(){return h(t)}},e)}},{title:e("Repository URL"),dataIndex:"repoUrl",key:"repoUrl",ellipsis:!0},{title:e("Local Path"),dataIndex:"localPath",key:"localPath",ellipsis:!0},{title:e("Default Branch"),dataIndex:"defaultBranch",key:"defaultBranch",width:120},{title:a().createElement(l.Tooltip,{title:e("Auto-poll new merge requests every 5 minutes")},a().createElement(l.Space,{size:4},a().createElement(o.RobotOutlined,null),e("Auto Review"))),dataIndex:"autoReview",key:"autoReview",width:110,render:function(r,n){return a().createElement(l.Switch,{size:"small",checked:!!r,onChange:function(r){return d(function(){var a,o,u,i;return m(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),u=x(n.id),[4,t.request({url:"gitRepositories:update",method:"post",params:{filterByTk:n.id},data:{autoReview:r,autoReviewFlowId:r&&!n.autoReviewFlowId?null!=(a=null==(o=u[0])?void 0:o.value)?a:null:n.autoReviewFlowId}})];case 1:return c.sent(),[4,f()];case 2:return c.sent(),[3,4];case 3:return i=c.sent(),l.message.error((null==i?void 0:i.message)||e("Failed to save")),[3,4];case 4:return[2]}})})()}})}},{title:e("Primary Auto Flow"),dataIndex:"autoReviewFlowId",key:"autoReviewFlowId",width:220,render:function(r,n){var o=x(n.id);return a().createElement(l.Select,{allowClear:!0,size:"small",style:{width:"100%"},disabled:!n.autoReview,placeholder:e("Select a flow"),value:r||void 0,options:o,notFoundContent:e("No matching flow available"),onChange:function(r){return d(function(){var a;return m(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,t.request({url:"gitRepositories:update",method:"post",params:{filterByTk:n.id},data:{autoReviewFlowId:r||null}})];case 1:return o.sent(),[4,f()];case 2:return o.sent(),[3,4];case 3:return a=o.sent(),l.message.error((null==a?void 0:a.message)||e("Failed to save")),[3,4];case 4:return[2]}})})()}})}},{title:e("Status"),dataIndex:"status",key:"status",width:120,render:function(t){var r={connected:{color:"green",label:e("Connected")},error:{color:"red",label:e("Error")}}[t]||{color:"default",label:e("Disconnected")};return a().createElement(l.Tag,{color:r.color},r.label)}},{title:"",key:"actions",width:200,render:function(r,n){return a().createElement(l.Space,{size:"small"},"connected"!==n.status&&a().createElement(l.Button,{size:"small",icon:a().createElement(o.LinkOutlined,null),loading:k==="clone-".concat(n.id),onClick:function(){return d(function(){var r,a,o,u,i;return m(this,function(c){switch(c.label){case 0:R("clone-".concat(n.id)),c.label=1;case 1:return c.trys.push([1,4,5,6]),[4,t.request({url:"gitManager:clone",method:"post",params:{repositoryId:n.id}})];case 2:return c.sent(),l.message.success(e("Clone successful")),[4,f()];case 3:return c.sent(),[3,6];case 4:return r=c.sent(),l.message.error((null==r||null==(i=r.response)||null==(u=i.data)||null==(o=u.errors)||null==(a=o[0])?void 0:a.message)||e("Clone failed")),[3,6];case 5:return R(null),[7];case 6:return[2]}})})()}},e("Clone")),a().createElement(l.Button,{size:"small",onClick:function(){var e,t;O(n),I.setFieldsValue((e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n),t=t={pat:""},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e)),g(!0)}},e("Edit")),a().createElement(l.Popconfirm,{title:e("Delete this repository?"),onConfirm:function(){var r;return r=n.id,d(function(){return m(this,function(n){switch(n.label){case 0:return[4,t.request({url:"gitRepositories:destroy",method:"post",params:{filterByTk:r}})];case 1:return n.sent(),(null==y?void 0:y.id)===r&&h(null),l.message.success(e("Deleted")),[4,f()];case 2:return n.sent(),[2]}})})()}},a().createElement(l.Button,{size:"small",danger:!0,icon:a().createElement(o.DeleteOutlined,null)})))}}];return a().createElement("div",null,a().createElement("div",{style:{marginBottom:16}},a().createElement(l.Button,{type:"primary",icon:a().createElement(o.PlusOutlined,null),onClick:function(){O(null),I.resetFields(),g(!0)}},e("Add Repository"))),a().createElement(l.Table,{dataSource:s,columns:A,rowKey:"id",size:"small",pagination:!1,rowClassName:function(e){return(null==y?void 0:y.id)===e.id?"ant-table-row-selected":""}}),a().createElement(l.Modal,{title:E?e("Edit Repository"):e("Add Repository"),open:v,onOk:function(){return d(function(){var r,n;return m(this,function(a){switch(a.label){case 0:return[4,I.validateFields()];case 1:r=a.sent(),E&&(!r.pat||"••••••••"===r.pat)&&delete r.pat,a.label=2;case 2:if(a.trys.push([2,8,,9]),!E)return[3,4];return[4,t.request({url:"gitRepositories:update",method:"post",params:{filterByTk:E.id},data:r})];case 3:return a.sent(),l.message.success(e("Repository updated")),[3,6];case 4:return[4,t.request({url:"gitRepositories:create",method:"post",data:r})];case 5:a.sent(),l.message.success(e("Repository added")),a.label=6;case 6:return g(!1),O(null),I.resetFields(),[4,f()];case 7:return a.sent(),[3,9];case 8:return n=a.sent(),l.message.error((null==n?void 0:n.message)||e("Failed to save")),[3,9];case 9:return[2]}})})()},onCancel:function(){g(!1),O(null)},width:520},a().createElement(l.Form,{form:I,layout:"vertical",initialValues:{defaultBranch:"main"}},a().createElement(l.Form.Item,{name:"name",label:e("Repository Name"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:"my-project"})),a().createElement(l.Form.Item,{name:"repoUrl",label:e("Repository URL"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:"https://gitlab.com/user/repo.git"})),a().createElement(l.Form.Item,{name:"username",label:e("Username"),rules:[{required:!0}],extra:e("GitLab username for PAT authentication")},a().createElement(l.Input,{placeholder:"gitlab-username"})),a().createElement(l.Form.Item,{name:"localPath",label:e("Local Path"),rules:[{required:!0}]},a().createElement(l.Input,{placeholder:"my-project"})),a().createElement(l.Form.Item,{name:"pat",label:e("Personal Access Token"),rules:E?[]:[{required:!0}]},a().createElement(l.Input.Password,{placeholder:E?"Leave empty to keep current":"ghp_xxxx..."})),a().createElement(l.Form.Item,{name:"defaultBranch",label:e("Default Branch")},a().createElement(l.Input,{placeholder:"main"})),a().createElement(l.Form.Item,{name:"autoReviewFlowId",label:e("Primary Auto Review Flow"),extra:e("Only flows with automatic trigger modes are shown")},a().createElement(l.Select,{allowClear:!0,placeholder:e("Select a flow"),options:x(null==E?void 0:E.id),notFoundContent:e("No matching flow available")})))))}},602:function(e,t,r){r.d(t,{B:function(){return d},N:function(){return p}});var n=r(155),a=r.n(n),l=r(485);function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function u(e,t,r,n,a,l,o){try{var u=e[l](o),i=u.value}catch(e){r(e);return}u.done?t(i):Promise.resolve(i).then(n,a)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(n,a){var l=e.apply(t,r);function o(e){u(l,n,a,o,i,"next",e)}function i(e){u(l,n,a,o,i,"throw",e)}o(void 0)})}}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var l=[],o=!0,u=!1;try{for(a=a.call(e);!(o=(r=a.next()).done)&&(l.push(r.value),!t||l.length!==t);o=!0);}catch(e){u=!0,n=e}finally{try{o||null==a.return||a.return()}finally{if(u)throw n}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){var r,n,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(o,"next",{value:i(0)}),u(o,"throw",{value:i(1)}),u(o,"return",{value:i(2)}),"function"==typeof Symbol&&u(o,Symbol.iterator,{value:function(){return this}}),o;function i(u){return function(i){var c=[u,i];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(l=0)),l;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return l.label++,{value:c[1],done:!1};case 5:l.label++,n=c[1],c=[0];continue;case 7:c=l.ops.pop(),l.trys.pop();continue;default:if(!(a=(a=l.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){l=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){l.label=c[1];break}if(6===c[0]&&l.label<a[1]){l.label=a[1],a=c;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(c);break}a[2]&&l.ops.pop(),l.trys.pop();continue}c=t.call(e,l)}catch(e){c=[6,e],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var f=(0,n.createContext)(null);function d(){return(0,n.useContext)(f)}var p=function(e){var t=e.children,r=(0,l.useApp)().apiClient,o=c((0,n.useState)([]),2),u=o[0],d=o[1],p=c((0,n.useState)(null),2),m=p[0],y=p[1],h=c((0,n.useState)(!1),2),b=h[0],v=h[1],g=c((0,n.useState)([]),2),w=g[0],E=g[1],O=c((0,n.useState)(""),2),I=O[0],S=O[1],k=(0,n.useRef)(m);k.current=m;var R=(0,n.useCallback)(function(){return i(function(){var e,t,n,a;return s(this,function(l){switch(l.label){case 0:if(!(e=k.current)||"connected"!==e.status)return E([]),S(""),[2];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r.request({url:"gitManager:branches",params:{repositoryId:e.id}})];case 2:return(a=(null==(n=l.sent().data)||null==(t=n.data)?void 0:t.data)||(null==n?void 0:n.data))&&(E(a.all||[]),S(a.current||"")),[3,4];case 3:return l.sent(),E([]),S(""),[3,4];case 4:return[2]}})})()},[r]),P=(0,n.useCallback)(function(){return i(function(){var e,t,n,a;return s(this,function(l){switch(l.label){case 0:v(!0),l.label=1;case 1:return l.trys.push([1,,3,4]),[4,r.request({url:"gitRepositories:list",params:{pageSize:100}})];case 2:return d(t=(null==(e=l.sent().data)?void 0:e.data)||[]),(n=k.current)&&(a=t.find(function(e){return e.id===n.id}))&&y(a),[3,4];case 3:return v(!1),[7];case 4:return[2]}})})()},[r]);return a().createElement(f.Provider,{value:{repos:u,selectedRepo:m,loading:b,branches:w,currentBranch:I,setSelectedRepo:y,refreshRepos:P,refreshBranches:R}},t)}},578:function(e,t,r){r.d(t,{k:function(){return a}});var n=r(485);function a(){var e=(0,n.useApp)();return function(t,r){return e.i18n.t(t,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({ns:["plugin-git-manager","client"]},r))}}}}]);