@bigbinary/neeto-github-frontend 2.4.0-beta1 → 3.0.1

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/.ready +1 -0
  3. package/dist/NeetoGithubIntegrationsTable.js +3 -3
  4. package/dist/NeetoGithubIntegrationsTable.js.map +1 -1
  5. package/dist/NeetoGithubNanoContainer.js +445 -21
  6. package/dist/NeetoGithubNanoContainer.js.map +1 -1
  7. package/dist/NeetoGithubNanoPane.js +4 -5
  8. package/dist/NeetoGithubNanoPane.js.map +1 -1
  9. package/dist/NeetoGithubRepositoryConnectionCard.js +5 -3
  10. package/dist/NeetoGithubRepositoryConnectionCard.js.map +1 -1
  11. package/dist/cjs/NeetoGithubIntegrationsTable.js +3 -3
  12. package/dist/cjs/NeetoGithubIntegrationsTable.js.map +1 -1
  13. package/dist/cjs/NeetoGithubNanoContainer.js +445 -25
  14. package/dist/cjs/NeetoGithubNanoContainer.js.map +1 -1
  15. package/dist/cjs/NeetoGithubNanoPane.js +5 -6
  16. package/dist/cjs/NeetoGithubNanoPane.js.map +1 -1
  17. package/dist/cjs/NeetoGithubRepositoryConnectionCard.js +5 -3
  18. package/dist/cjs/NeetoGithubRepositoryConnectionCard.js.map +1 -1
  19. package/dist/cjs/hooks.js +1 -1
  20. package/dist/cjs/index.js +5 -3
  21. package/dist/cjs/index.js.map +1 -1
  22. package/dist/cjs/v2/NeetoGithubIntegrationsTable.js +157 -0
  23. package/dist/cjs/v2/NeetoGithubIntegrationsTable.js.map +1 -0
  24. package/dist/{index-D1ob5VXc.js → cjs/v2/NeetoGithubNanoContainer.js} +75 -80
  25. package/dist/cjs/v2/NeetoGithubNanoContainer.js.map +1 -0
  26. package/dist/cjs/v2/NeetoGithubNanoPane.js +126 -0
  27. package/dist/cjs/v2/NeetoGithubNanoPane.js.map +1 -0
  28. package/dist/cjs/v2/NeetoGithubRepositoryConnectionCard.js +178 -0
  29. package/dist/cjs/v2/NeetoGithubRepositoryConnectionCard.js.map +1 -0
  30. package/dist/cjs/v2/hooks.js +18 -0
  31. package/dist/cjs/v2/hooks.js.map +1 -0
  32. package/dist/cjs/v2/index.js +53 -0
  33. package/dist/cjs/v2/index.js.map +1 -0
  34. package/dist/hooks.js +1 -1
  35. package/dist/index.js +4 -2
  36. package/dist/index.js.map +1 -1
  37. package/dist/pane-CPRRz6tU.js +5 -0
  38. package/dist/pane-CPRRz6tU.js.map +1 -0
  39. package/dist/pane-DRsC3fwq.js +7 -0
  40. package/dist/pane-DRsC3fwq.js.map +1 -0
  41. package/dist/repository-tile-DxVqVMYY.js +7 -0
  42. package/dist/repository-tile-DxVqVMYY.js.map +1 -0
  43. package/dist/repository-tile-fB8WFACw.js +9 -0
  44. package/dist/repository-tile-fB8WFACw.js.map +1 -0
  45. package/dist/{useGithubAccountsApi-BFnwW6qa.js → useGithubAccountsApi-CBlDaBkA.js} +3 -5
  46. package/dist/useGithubAccountsApi-CBlDaBkA.js.map +1 -0
  47. package/dist/{useGithubAccountsApi-Bs2Imc4V.js → useGithubAccountsApi-Csym3TIW.js} +5 -7
  48. package/dist/useGithubAccountsApi-Csym3TIW.js.map +1 -0
  49. package/dist/v2/NeetoGithubIntegrationsTable.js +155 -0
  50. package/dist/v2/NeetoGithubIntegrationsTable.js.map +1 -0
  51. package/dist/{index-BrvZaXzw.js → v2/NeetoGithubNanoContainer.js} +61 -65
  52. package/dist/v2/NeetoGithubNanoContainer.js.map +1 -0
  53. package/dist/v2/NeetoGithubNanoPane.js +105 -0
  54. package/dist/v2/NeetoGithubNanoPane.js.map +1 -0
  55. package/dist/v2/NeetoGithubRepositoryConnectionCard.js +176 -0
  56. package/dist/v2/NeetoGithubRepositoryConnectionCard.js.map +1 -0
  57. package/dist/v2/hooks.js +10 -0
  58. package/dist/v2/hooks.js.map +1 -0
  59. package/dist/v2/index.js +41 -0
  60. package/dist/v2/index.js.map +1 -0
  61. package/package.json +39 -27
  62. package/dist/index-BrvZaXzw.js.map +0 -1
  63. package/dist/index-D1ob5VXc.js.map +0 -1
  64. package/dist/useGithubAccountsApi-BFnwW6qa.js.map +0 -1
  65. package/dist/useGithubAccountsApi-Bs2Imc4V.js.map +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ ## 3.0.11
4
+
5
+ - Fix: configure Sawyer serializer to use stdlib JSON at boot, preventing LoadError when multi_json >= 1.21.0 resolves `MultiJson.method(:load)` to `Kernel#load` instead of the JSON parser.
6
+
7
+ ## 1.0.2
8
+
9
+ - Changed column name for repository table.
10
+ - Updated Redirect URI logic. Host application can skip redirect route.
11
+ - Security: **BREAKING** Used [JWT](https://github.com/jwt/ruby-jwt) to transfer data securely to GitHub OAuth. (#17)
12
+
13
+ Note: A Private-Public key pair is required to be stored in the environment variables from this release. Please refer [here](https://github.com/bigbinary/neeto-github-integration-engine#add-jwt-private-and-public-keys) for instructions.
package/dist/.ready ADDED
@@ -0,0 +1 @@
1
+ Built at 2026-05-21T10:54:50.928Z
@@ -3,7 +3,7 @@ import Header from '@bigbinary/neeto-molecules/Header';
3
3
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
4
4
  import Button from '@bigbinary/neetoui/Button';
5
5
  import { useTranslation, Trans } from 'react-i18next';
6
- import { N as NEETO_GITHUB_ENGINE_BASE_URL, b as useDestroyGithubIntegration, a as useFetchGithubAppInstallations } from './useGithubAccountsApi-Bs2Imc4V.js';
6
+ import { N as NEETO_GITHUB_ENGINE_BASE_URL, u as useDestroyGithubIntegration, a as useFetchGithubAppInstallations } from './useGithubAccountsApi-Csym3TIW.js';
7
7
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
8
8
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
9
9
  import { useState } from 'react';
@@ -25,7 +25,7 @@ import 'axios';
25
25
  import '@bigbinary/neeto-commons-frontend/constants';
26
26
 
27
27
  function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
28
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
28
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
29
29
  var getNewInstallationUrl = function getNewInstallationUrl(integratorParams, redirectPath) {
30
30
  return buildUrl("".concat(NEETO_GITHUB_ENGINE_BASE_URL, "/app_installations/new"), _objectSpread$1(_objectSpread$1({}, integratorParams), {}, {
31
31
  redirectPath: redirectPath
@@ -60,7 +60,7 @@ var getGithubAccountsTableColumnData = function getGithubAccountsTableColumnData
60
60
  };
61
61
 
62
62
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
63
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
63
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
64
64
  var AccountsTable = function AccountsTable(_ref) {
65
65
  var _ref$appInstallations = _ref.appInstallations,
66
66
  appInstallations = _ref$appInstallations === void 0 ? [] : _ref$appInstallations,
@@ -1 +1 @@
1
- {"version":3,"file":"NeetoGithubIntegrationsTable.js","sources":["../app/javascript/src/components/NeetoGithubIntegrationsTable/utils.jsx","../app/javascript/src/components/NeetoGithubIntegrationsTable/AccountsTable.jsx","../app/javascript/src/components/NeetoGithubIntegrationsTable/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { buildUrl } from \"neetocommons/utils\";\nimport MoreDropdown from \"neetomolecules/MoreDropdown\";\nimport { Typography } from \"neetoui\";\n\nimport { NEETO_GITHUB_ENGINE_BASE_URL } from \"src/constants\";\n\nexport const getNewInstallationUrl = (integratorParams, redirectPath) =>\n buildUrl(`${NEETO_GITHUB_ENGINE_BASE_URL}/app_installations/new`, {\n ...integratorParams,\n redirectPath,\n });\n\nexport const getGithubAccountsTableColumnData = ({\n setAccountToDisconnect,\n}) => [\n {\n title: t(\"neetoGithub.account\"),\n dataIndex: \"\",\n key: \"actions\",\n render: (_, account) => (\n <div className=\"flex items-center justify-between gap-x-3\">\n <Typography>{account.accountLogin}</Typography>\n <MoreDropdown\n dropdownProps={{ strategy: \"fixed\" }}\n menuItems={[\n {\n key: \"delete\",\n label: t(\"neetoGithub.actions.delete\"),\n onClick: () => setAccountToDisconnect(account),\n },\n ]}\n />\n </div>\n ),\n },\n];\n","import { useState } from \"react\";\n\nimport { isNotEmpty } from \"neetocist\";\nimport { Table, NoData, Alert } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation, Trans } from \"react-i18next\";\n\nimport { useDestroyGithubIntegration } from \"hooks/reactQuery/useGithubAccountsApi\";\n\nimport { getGithubAccountsTableColumnData } from \"./utils\";\n\nconst AccountsTable = ({\n appInstallations = [],\n integratorParams,\n keysToPurgeOnDelete,\n noDataProps,\n}) => {\n const { t } = useTranslation();\n const [accountToDisconnect, setAccountToDisconnect] = useState({});\n\n const { mutate: deleteGithubAccount, isPending: isDeleting } =\n useDestroyGithubIntegration(integratorParams, keysToPurgeOnDelete, {\n onSuccess: () => setAccountToDisconnect({}),\n });\n\n if (isEmpty(appInstallations)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <NoData\n title={t(\"neetoGithub.integrationTable.noIntegrationFound\")}\n {...noDataProps}\n />\n </div>\n );\n }\n\n return (\n <>\n <Table\n rowData={appInstallations}\n columnData={getGithubAccountsTableColumnData({\n setAccountToDisconnect,\n })}\n />\n <Alert\n isOpen={isNotEmpty(accountToDisconnect)}\n isSubmitting={isDeleting}\n submitButtonLabel={t(\"neetoGithub.disconnectGitHub\")}\n title={t(\"neetoGithub.integrationTable.alert.title\")}\n message={\n <Trans\n i18nKey=\"neetoGithub.integrationTable.alert.message\"\n values={{ login: accountToDisconnect?.accountLogin }}\n />\n }\n onClose={() => setAccountToDisconnect({})}\n onSubmit={() => deleteGithubAccount(accountToDisconnect?.id)}\n />\n </>\n );\n};\n\nexport default AccountsTable;\n","import Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport PageLoader from \"neetomolecules/PageLoader\";\nimport { Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useFetchGithubAppInstallations } from \"hooks/reactQuery/useGithubAccountsApi\";\n\nimport AccountsTable from \"./AccountsTable\";\nimport { getNewInstallationUrl } from \"./utils\";\n\nconst NeetoGithubIntegrationsTable = ({\n breadcrumbs = [],\n integratorParams,\n redirectPath,\n keysToPurgeOnDelete = [],\n titleHelpPopoverProps = {},\n noDataProps = {},\n}) => {\n const { t } = useTranslation();\n\n const { data: appInstallations = [], isLoading } =\n useFetchGithubAppInstallations(integratorParams);\n\n const newInstallationUrl = getNewInstallationUrl(\n integratorParams,\n redirectPath\n );\n\n if (isLoading) {\n return (\n <div className=\"flex h-screen w-screen items-center justify-center\">\n <PageLoader />\n </div>\n );\n }\n\n return (\n <Container>\n <Header\n {...{ breadcrumbs, titleHelpPopoverProps }}\n title={t(\"neetoGithub.github\")}\n actionBlock={\n <Button\n href={newInstallationUrl}\n label={t(\"neetoGithub.connectGithub\")}\n />\n }\n />\n <AccountsTable\n {...{\n appInstallations,\n integratorParams,\n keysToPurgeOnDelete,\n noDataProps,\n }}\n />\n </Container>\n );\n};\n\nexport default NeetoGithubIntegrationsTable;\n"],"names":["getNewInstallationUrl","integratorParams","redirectPath","buildUrl","concat","NEETO_GITHUB_ENGINE_BASE_URL","_objectSpread","getGithubAccountsTableColumnData","_ref","setAccountToDisconnect","title","t","dataIndex","key","render","_","account","_jsxs","className","children","_jsx","Typography","accountLogin","MoreDropdown","dropdownProps","strategy","menuItems","label","onClick","AccountsTable","_ref$appInstallations","appInstallations","keysToPurgeOnDelete","noDataProps","_useTranslation","useTranslation","_useState","useState","_useState2","_slicedToArray","accountToDisconnect","_useDestroyGithubInte","useDestroyGithubIntegration","onSuccess","deleteGithubAccount","mutate","isDeleting","isPending","isEmpty","NoData","_Fragment","Table","rowData","columnData","Alert","isOpen","isNotEmpty","isSubmitting","submitButtonLabel","message","Trans","i18nKey","values","login","onClose","onSubmit","id","NeetoGithubIntegrationsTable","_ref$breadcrumbs","breadcrumbs","_ref$keysToPurgeOnDel","_ref$titleHelpPopover","titleHelpPopoverProps","_ref$noDataProps","_useFetchGithubAppIns","useFetchGithubAppInstallations","_useFetchGithubAppI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,WAAW,EAAXA,WAAW;AAAEG,MAAAA,qBAAqB,EAArBA,qBAAqB;AACxC9D,MAAAA,KAAK,EAAEC,CAAC,CAAC,oBAAoB,CAAE;MAC/BwE,WAAW,eACT/D,GAAA,CAACgE,MAAM,EAAA;AACLC,QAAAA,IAAI,EAAEN,kBAAmB;QACzBpD,KAAK,EAAEhB,CAAC,CAAC,2BAA2B;OACrC;AACF,KACF,CAAC,eACFS,GAAA,CAACS,aAAa,EAAA;AAEVE,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB9B,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB+B,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,WAAW,EAAXA;AAAW,KAEd,CAAC;AAAA,GACO,CAAC;AAEhB;;;;"}
1
+ {"version":3,"file":"NeetoGithubIntegrationsTable.js","sources":["../app/javascript/src/components/NeetoGithubIntegrationsTable/utils.jsx","../app/javascript/src/components/NeetoGithubIntegrationsTable/AccountsTable.jsx","../app/javascript/src/components/NeetoGithubIntegrationsTable/index.jsx"],"sourcesContent":["import { t } from \"i18next\";\nimport { buildUrl } from \"neetocommons/utils\";\nimport MoreDropdown from \"neetomolecules/MoreDropdown\";\nimport { Typography } from \"neetoui\";\n\nimport { NEETO_GITHUB_ENGINE_BASE_URL } from \"src/constants\";\n\nexport const getNewInstallationUrl = (integratorParams, redirectPath) =>\n buildUrl(`${NEETO_GITHUB_ENGINE_BASE_URL}/app_installations/new`, {\n ...integratorParams,\n redirectPath,\n });\n\nexport const getGithubAccountsTableColumnData = ({\n setAccountToDisconnect,\n}) => [\n {\n title: t(\"neetoGithub.account\"),\n dataIndex: \"\",\n key: \"actions\",\n render: (_, account) => (\n <div className=\"flex items-center justify-between gap-x-3\">\n <Typography>{account.accountLogin}</Typography>\n <MoreDropdown\n dropdownProps={{ strategy: \"fixed\" }}\n menuItems={[\n {\n key: \"delete\",\n label: t(\"neetoGithub.actions.delete\"),\n onClick: () => setAccountToDisconnect(account),\n },\n ]}\n />\n </div>\n ),\n },\n];\n","import { useState } from \"react\";\n\nimport { isNotEmpty } from \"neetocist\";\nimport { Table, NoData, Alert } from \"neetoui\";\nimport { isEmpty } from \"ramda\";\nimport { useTranslation, Trans } from \"react-i18next\";\n\nimport { useDestroyGithubIntegration } from \"hooks/reactQuery/useGithubAccountsApi\";\n\nimport { getGithubAccountsTableColumnData } from \"./utils\";\n\nconst AccountsTable = ({\n appInstallations = [],\n integratorParams,\n keysToPurgeOnDelete,\n noDataProps,\n}) => {\n const { t } = useTranslation();\n const [accountToDisconnect, setAccountToDisconnect] = useState({});\n\n const { mutate: deleteGithubAccount, isPending: isDeleting } =\n useDestroyGithubIntegration(integratorParams, keysToPurgeOnDelete, {\n onSuccess: () => setAccountToDisconnect({}),\n });\n\n if (isEmpty(appInstallations)) {\n return (\n <div className=\"flex h-full w-full items-center justify-center\">\n <NoData\n title={t(\"neetoGithub.integrationTable.noIntegrationFound\")}\n {...noDataProps}\n />\n </div>\n );\n }\n\n return (\n <>\n <Table\n rowData={appInstallations}\n columnData={getGithubAccountsTableColumnData({\n setAccountToDisconnect,\n })}\n />\n <Alert\n isOpen={isNotEmpty(accountToDisconnect)}\n isSubmitting={isDeleting}\n submitButtonLabel={t(\"neetoGithub.disconnectGitHub\")}\n title={t(\"neetoGithub.integrationTable.alert.title\")}\n message={\n <Trans\n i18nKey=\"neetoGithub.integrationTable.alert.message\"\n values={{ login: accountToDisconnect?.accountLogin }}\n />\n }\n onClose={() => setAccountToDisconnect({})}\n onSubmit={() => deleteGithubAccount(accountToDisconnect?.id)}\n />\n </>\n );\n};\n\nexport default AccountsTable;\n","import Container from \"neetomolecules/Container\";\nimport Header from \"neetomolecules/Header\";\nimport PageLoader from \"neetomolecules/PageLoader\";\nimport { Button } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useFetchGithubAppInstallations } from \"hooks/reactQuery/useGithubAccountsApi\";\n\nimport AccountsTable from \"./AccountsTable\";\nimport { getNewInstallationUrl } from \"./utils\";\n\nconst NeetoGithubIntegrationsTable = ({\n breadcrumbs = [],\n integratorParams,\n redirectPath,\n keysToPurgeOnDelete = [],\n titleHelpPopoverProps = {},\n noDataProps = {},\n}) => {\n const { t } = useTranslation();\n\n const { data: appInstallations = [], isLoading } =\n useFetchGithubAppInstallations(integratorParams);\n\n const newInstallationUrl = getNewInstallationUrl(\n integratorParams,\n redirectPath\n );\n\n if (isLoading) {\n return (\n <div className=\"flex h-screen w-screen items-center justify-center\">\n <PageLoader />\n </div>\n );\n }\n\n return (\n <Container>\n <Header\n {...{ breadcrumbs, titleHelpPopoverProps }}\n title={t(\"neetoGithub.github\")}\n actionBlock={\n <Button\n href={newInstallationUrl}\n label={t(\"neetoGithub.connectGithub\")}\n />\n }\n />\n <AccountsTable\n {...{\n appInstallations,\n integratorParams,\n keysToPurgeOnDelete,\n noDataProps,\n }}\n />\n </Container>\n );\n};\n\nexport default NeetoGithubIntegrationsTable;\n"],"names":["getNewInstallationUrl","integratorParams","redirectPath","buildUrl","concat","NEETO_GITHUB_ENGINE_BASE_URL","_objectSpread","getGithubAccountsTableColumnData","_ref","setAccountToDisconnect","title","t","dataIndex","key","render","_","account","_jsxs","className","children","_jsx","Typography","accountLogin","MoreDropdown","dropdownProps","strategy","menuItems","label","onClick","AccountsTable","_ref$appInstallations","appInstallations","keysToPurgeOnDelete","noDataProps","_useTranslation","useTranslation","_useState","useState","_useState2","_slicedToArray","accountToDisconnect","_useDestroyGithubInte","useDestroyGithubIntegration","onSuccess","deleteGithubAccount","mutate","isDeleting","isPending","isEmpty","NoData","_Fragment","Table","rowData","columnData","Alert","isOpen","isNotEmpty","isSubmitting","submitButtonLabel","message","Trans","i18nKey","values","login","onClose","onSubmit","id","NeetoGithubIntegrationsTable","_ref$breadcrumbs","breadcrumbs","_ref$keysToPurgeOnDel","_ref$titleHelpPopover","titleHelpPopoverProps","_ref$noDataProps","_useFetchGithubAppIns","useFetchGithubAppInstallations","_useFetchGithubAppIns2","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AA,qBAAqB,EAArBA,qBAAqB;AACxC9D,MAAAA,KAAK,EAAEC,CAAC,CAAC,oBAAoB,CAAE;MAC/BwE,WAAW,eACT/D,GAAA,CAACgE,MAAM,EAAA;AACLC,QAAAA,IAAI,EAAEN,kBAAmB;QACzBpD,KAAK,EAAEhB,CAAC,CAAC,2BAA2B;OACrC;AACF,KACF,CAAC,eACFS,GAAA,CAACS,aAAa,EAAA;AAEVE,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB9B,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB+B,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,WAAW,EAAXA;AAAW,KAEd,CAAC;AAAA,GACO,CAAC;AAEhB;;;;"}
@@ -1,28 +1,452 @@
1
- import 'classnames';
2
- import '@bigbinary/neeto-commons-frontend/initializers';
3
- import '@bigbinary/neetoui/Spinner';
4
- import './useGithubAccountsApi-Bs2Imc4V.js';
5
- export { N as default } from './index-BrvZaXzw.js';
6
- import 'react/jsx-runtime';
1
+ import classnames from 'classnames';
2
+ import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
3
+ import Spinner from '@bigbinary/neetoui/Spinner';
4
+ import { b as useFetchGithubRepositories } from './useGithubAccountsApi-Csym3TIW.js';
5
+ import { withT, isMetaKeyPressed } from '@bigbinary/neeto-commons-frontend/react-utils';
6
+ import Github from '@bigbinary/neeto-icons/misc/Github';
7
+ import Typography from '@bigbinary/neetoui/Typography';
8
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
+ import Building from '@bigbinary/neeto-icons/Building';
10
+ import Avatar from '@bigbinary/neetoui/Avatar';
11
+ import Button from '@bigbinary/neetoui/Button';
12
+ import Plus from '@bigbinary/neeto-icons/Plus';
13
+ import Settings from '@bigbinary/neeto-icons/Settings';
14
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
15
+ import { useState, createElement } from 'react';
16
+ import { isPresent } from '@bigbinary/neeto-cist';
17
+ import Search from '@bigbinary/neeto-molecules/Search';
18
+ import { Trans, useTranslation } from 'react-i18next';
19
+ import Lock from '@bigbinary/neeto-icons/Lock';
20
+ import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
21
+ import './repository-tile-DxVqVMYY.js';
7
22
  import '@babel/runtime/helpers/toConsumableArray';
8
23
  import '@babel/runtime/helpers/defineProperty';
9
24
  import '@tanstack/react-query';
10
- import '@bigbinary/neeto-commons-frontend/react-utils';
11
25
  import 'ramda';
12
26
  import 'axios';
13
27
  import '@bigbinary/neeto-commons-frontend/constants';
14
- import '@bigbinary/neeto-icons/misc/Github';
15
- import '@bigbinary/neetoui/Typography';
16
- import '@bigbinary/neeto-icons/Building';
17
- import '@bigbinary/neetoui/Avatar';
18
- import '@bigbinary/neetoui/Button';
19
- import '@bigbinary/neeto-icons/Plus';
20
- import '@bigbinary/neeto-icons/Settings';
21
- import '@babel/runtime/helpers/slicedToArray';
22
- import 'react';
23
- import '@bigbinary/neeto-cist';
24
- import '@bigbinary/neeto-molecules/Search';
25
- import 'react-i18next';
26
- import '@bigbinary/neeto-icons/Lock';
27
- import '@bigbinary/neeto-molecules/DateFormat';
28
+
29
+ var Header = withT(function (_ref) {
30
+ var t = _ref.t;
31
+ return /*#__PURE__*/jsxs("div", {
32
+ className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased",
33
+ children: [/*#__PURE__*/jsx(Github, {
34
+ className: "github-icon",
35
+ size: 20
36
+ }), /*#__PURE__*/jsx(Typography, {
37
+ style: "h4",
38
+ children: t("neetoGithub.github")
39
+ })]
40
+ });
41
+ });
42
+
43
+ var Configure = withT(function (_ref) {
44
+ var t = _ref.t,
45
+ isConnected = _ref.isConnected,
46
+ installationUrl = _ref.installationUrl;
47
+ return /*#__PURE__*/jsx("div", {
48
+ className: "neeto-ui-text-gray-900 shrink-0 font-sans text-sm font-normal leading-6 antialiased",
49
+ children: /*#__PURE__*/jsx(Button, {
50
+ href: installationUrl,
51
+ icon: isConnected ? Settings : Plus,
52
+ iconPosition: "left",
53
+ iconSize: 20,
54
+ size: "small",
55
+ style: "link",
56
+ children: isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")
57
+ })
58
+ });
59
+ });
60
+
61
+ var List$1 = withT(function (_ref) {
62
+ var t = _ref.t,
63
+ accounts = _ref.accounts,
64
+ isConnected = _ref.isConnected,
65
+ installationUrl = _ref.installationUrl,
66
+ isPane = _ref.isPane;
67
+ return /*#__PURE__*/jsxs("div", {
68
+ className: classnames("neeto-ui-border-gray-300 flex justify-between gap-3 border-b pb-4 pt-2", {
69
+ "flex-col md:flex-row": isPane,
70
+ "flex-col": !isPane
71
+ }),
72
+ children: [accounts.map(function (_ref2) {
73
+ var id = _ref2.id,
74
+ name = _ref2.name,
75
+ avatarUrl = _ref2.avatarUrl,
76
+ type = _ref2.type,
77
+ profileUrl = _ref2.profileUrl,
78
+ count = _ref2.count;
79
+ return /*#__PURE__*/jsxs("div", {
80
+ className: "flex w-full items-center space-x-2",
81
+ children: [/*#__PURE__*/jsxs("div", {
82
+ className: "flex items-center gap-1",
83
+ children: [type === "Organization" ? /*#__PURE__*/jsx(Building, {
84
+ className: "neeto-ui-text-gray-600",
85
+ size: 24
86
+ }) : /*#__PURE__*/jsx(Avatar, {
87
+ size: "small",
88
+ user: {
89
+ imageUrl: avatarUrl
90
+ }
91
+ }), /*#__PURE__*/jsx(Typography, {
92
+ className: "neeto-ui-text-gray-800",
93
+ style: "body2",
94
+ children: /*#__PURE__*/jsx(Button, {
95
+ className: "neeto-ui-text-gray-800",
96
+ label: "@".concat(name),
97
+ style: "link",
98
+ onClick: function onClick() {
99
+ return window.open(profileUrl, "_blank");
100
+ }
101
+ })
102
+ })]
103
+ }), /*#__PURE__*/jsx("span", {
104
+ className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
105
+ }), /*#__PURE__*/jsx(Typography, {
106
+ className: "neeto-ui-text-black",
107
+ style: "body2",
108
+ children: t("neetoGithub.countOf.repos", {
109
+ count: count
110
+ })
111
+ })]
112
+ }, id);
113
+ }), /*#__PURE__*/jsx(Configure, {
114
+ installationUrl: installationUrl,
115
+ isConnected: isConnected
116
+ })]
117
+ });
118
+ });
119
+
120
+ var Accounts = function Accounts(_ref) {
121
+ var isPane = _ref.isPane,
122
+ accounts = _ref.accounts,
123
+ isConnected = _ref.isConnected,
124
+ onConnect = _ref.onConnect,
125
+ installationUrl = _ref.installationUrl;
126
+ return /*#__PURE__*/jsx("div", {
127
+ className: classnames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
128
+ "order-1": isPane,
129
+ "md:order-2 md:max-w-72 lg:max-w-sm lg:px-6": !isPane
130
+ }),
131
+ children: /*#__PURE__*/jsxs("div", {
132
+ className: "mb-2",
133
+ children: [/*#__PURE__*/jsx(Header, {}), /*#__PURE__*/jsx(List$1, {
134
+ accounts: accounts,
135
+ installationUrl: installationUrl,
136
+ isConnected: isConnected,
137
+ isPane: isPane,
138
+ onConnect: onConnect
139
+ })]
140
+ })
141
+ });
142
+ };
143
+
144
+ var NoRepositories = withT(function (_ref) {
145
+ var t = _ref.t,
146
+ installationUrl = _ref.installationUrl,
147
+ troubleshootUrl = _ref.troubleshootUrl;
148
+ return /*#__PURE__*/jsx("div", {
149
+ className: "flex items-center justify-center py-6",
150
+ children: /*#__PURE__*/jsxs("div", {
151
+ className: "mx-auto flex w-full max-w-sm flex-col items-center justify-center space-y-4 py-4 text-center",
152
+ children: [/*#__PURE__*/jsx(Typography, {
153
+ style: "body2",
154
+ children: t("neetoGithub.noReposDescription")
155
+ }), /*#__PURE__*/jsx(Button, {
156
+ href: installationUrl,
157
+ icon: Github,
158
+ iconPosition: "left",
159
+ label: t("neetoGithub.connectRepository"),
160
+ size: "medium",
161
+ style: "primary"
162
+ }), /*#__PURE__*/jsx("div", {
163
+ className: "text-xs",
164
+ children: /*#__PURE__*/jsx(Trans, {
165
+ i18nKey: t("neetoGithub.troubleshoot"),
166
+ components: {
167
+ troubleshootLink: /*#__PURE__*/jsx("a", {
168
+ className: "text-indigo-600 underline",
169
+ href: troubleshootUrl,
170
+ rel: "noopener noreferrer",
171
+ target: "_blank"
172
+ })
173
+ }
174
+ })
175
+ })]
176
+ })
177
+ });
178
+ });
179
+
180
+ var RepositoryTile = function RepositoryTile(_ref) {
181
+ var isConnecting = _ref.isConnecting,
182
+ onConnect = _ref.onConnect,
183
+ repository = _ref.repository;
184
+ var _useTranslation = useTranslation(),
185
+ t = _useTranslation.t;
186
+ var _useState = useState(false),
187
+ _useState2 = _slicedToArray(_useState, 2),
188
+ isLoading = _useState2[0],
189
+ setIsLoading = _useState2[1];
190
+ var id = repository.id,
191
+ fullName = repository.fullName,
192
+ isPrivate = repository.isPrivate,
193
+ updatedAt = repository.updatedAt;
194
+ return /*#__PURE__*/jsxs("div", {
195
+ className: "connect-repo__row neeto-ui-border-gray-300 flex flex-col justify-between gap-3 border-b border-solid py-3 ps-3 pe-3 last:border-b-0 md:flex-row md:items-center md:ps-5",
196
+ children: [/*#__PURE__*/jsxs("div", {
197
+ className: "connect-repo__info flex items-center space-x-2",
198
+ children: [/*#__PURE__*/jsx(Github, {
199
+ className: "github-icon",
200
+ size: 20
201
+ }), /*#__PURE__*/jsx(Typography, {
202
+ style: "body2",
203
+ children: fullName
204
+ }), isPrivate && /*#__PURE__*/jsx(Lock, {
205
+ className: "shrink-0",
206
+ size: 16
207
+ }), /*#__PURE__*/jsxs("div", {
208
+ className: "hidden lg:inline-block",
209
+ children: [/*#__PURE__*/jsx("span", {
210
+ className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
211
+ }), /*#__PURE__*/jsx(DateFormat.FromNow, {
212
+ date: updatedAt
213
+ })]
214
+ })]
215
+ }), /*#__PURE__*/jsx(Button, {
216
+ className: "w-max",
217
+ disabled: isConnecting,
218
+ loading: isLoading,
219
+ style: "primary",
220
+ type: "button",
221
+ onClick: function onClick() {
222
+ return onConnect({
223
+ repoType: "private",
224
+ repository: repository,
225
+ setIsLoading: setIsLoading
226
+ });
227
+ },
228
+ children: t("neetoGithub.connect")
229
+ })]
230
+ }, id);
231
+ };
232
+
233
+ var List = withT(function (_ref) {
234
+ var t = _ref.t,
235
+ filteredRepositories = _ref.filteredRepositories,
236
+ repositories = _ref.repositories,
237
+ isConnecting = _ref.isConnecting,
238
+ onConnect = _ref.onConnect,
239
+ installationUrl = _ref.installationUrl,
240
+ troubleshootUrl = _ref.troubleshootUrl;
241
+ return /*#__PURE__*/jsx("div", {
242
+ className: "h-full overflow-y-scroll px-4 pb-4 md:px-6 md:pb-6",
243
+ children: isPresent(repositories) ? /*#__PURE__*/jsx("div", {
244
+ className: classnames("neeto-ui-border-gray-300 neeto-ui-rounded-md flex flex-col items-center justify-center border", {
245
+ "h-auto": isPresent(filteredRepositories),
246
+ "h-full": !isPresent(filteredRepositories)
247
+ }),
248
+ children: /*#__PURE__*/jsx("div", {
249
+ className: "m-0 h-full w-full p-0",
250
+ children: isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
251
+ return /*#__PURE__*/createElement(RepositoryTile, {
252
+ isConnecting: isConnecting,
253
+ onConnect: onConnect,
254
+ repository: repository,
255
+ key: index
256
+ });
257
+ }) : /*#__PURE__*/jsx(Typography, {
258
+ className: "flex h-full w-full items-center justify-center",
259
+ style: "body2",
260
+ children: t("neetoGithub.noRepos")
261
+ })
262
+ })
263
+ }) : /*#__PURE__*/jsx(NoRepositories, {
264
+ installationUrl: installationUrl,
265
+ troubleshootUrl: troubleshootUrl
266
+ })
267
+ });
268
+ });
269
+
270
+ var NotConnected = function NotConnected(_ref) {
271
+ var installationUrl = _ref.installationUrl;
272
+ var _useState = useState(false),
273
+ _useState2 = _slicedToArray(_useState, 2),
274
+ isLoading = _useState2[0],
275
+ setIsLoading = _useState2[1];
276
+ var _useTranslation = useTranslation(),
277
+ t = _useTranslation.t;
278
+ return /*#__PURE__*/jsxs("div", {
279
+ className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center",
280
+ children: [/*#__PURE__*/jsx(Typography, {
281
+ style: "body2",
282
+ children: t("neetoGithub.notConnectedDescription", {
283
+ appName: globalProps.appName
284
+ })
285
+ }), /*#__PURE__*/jsx(Button, {
286
+ icon: Github,
287
+ iconPosition: "left",
288
+ label: t("neetoGithub.connectGithub"),
289
+ loading: isLoading,
290
+ size: "medium",
291
+ style: "primary",
292
+ onClick: function onClick(event) {
293
+ setIsLoading(true);
294
+ var target = isMetaKeyPressed(event) ? "_blank" : "_self";
295
+ window.open(installationUrl, target);
296
+ }
297
+ })]
298
+ });
299
+ };
300
+
301
+ var Private = function Private(_ref) {
302
+ var isConnected = _ref.isConnected,
303
+ isConnecting = _ref.isConnecting,
304
+ repositories = _ref.repositories,
305
+ onConnect = _ref.onConnect,
306
+ installationUrl = _ref.installationUrl,
307
+ troubleshootUrl = _ref.troubleshootUrl;
308
+ var _useTranslation = useTranslation(),
309
+ t = _useTranslation.t;
310
+ var _useState = useState(repositories),
311
+ _useState2 = _slicedToArray(_useState, 2),
312
+ filteredRepositories = _useState2[0],
313
+ setFilteredRepositories = _useState2[1];
314
+ var onSearch = function onSearch(searchTerm) {
315
+ if (!isPresent(searchTerm)) {
316
+ setFilteredRepositories(repositories);
317
+ return;
318
+ }
319
+ var filteredRepositories = repositories.filter(function (_ref2) {
320
+ var fullName = _ref2.fullName;
321
+ return fullName.toLowerCase().includes(searchTerm.toLowerCase());
322
+ });
323
+ setFilteredRepositories(filteredRepositories);
324
+ };
325
+ return /*#__PURE__*/jsx("div", {
326
+ className: "connect-repo flex h-full flex-col",
327
+ children: isConnected ? /*#__PURE__*/jsxs(Fragment, {
328
+ children: [/*#__PURE__*/jsxs("div", {
329
+ className: "space-y-3 p-4 md:p-6",
330
+ children: [/*#__PURE__*/jsx(Typography, {
331
+ className: "shrink-0 text-lg font-medium",
332
+ style: "h2",
333
+ children: t("neetoGithub.connectARepo")
334
+ }), isPresent(repositories) && /*#__PURE__*/jsx(Search, {
335
+ onSearch: onSearch,
336
+ className: "w-full",
337
+ unlimitedChars: false,
338
+ suffix: /*#__PURE__*/jsx(Typography, {
339
+ style: "body2",
340
+ children: t("neetoGithub.countOf.repos", {
341
+ count: filteredRepositories.length
342
+ })
343
+ })
344
+ })]
345
+ }), /*#__PURE__*/jsx("div", {
346
+ className: "flex min-h-0 w-full grow flex-col space-y-6",
347
+ children: /*#__PURE__*/jsx(List, {
348
+ filteredRepositories: filteredRepositories,
349
+ installationUrl: installationUrl,
350
+ isConnecting: isConnecting,
351
+ onConnect: onConnect,
352
+ repositories: repositories,
353
+ troubleshootUrl: troubleshootUrl
354
+ })
355
+ })]
356
+ }) : /*#__PURE__*/jsx("div", {
357
+ className: "neeto-ui-text-gray-900 grow font-sans text-sm font-normal leading-6 antialiased",
358
+ children: /*#__PURE__*/jsx("div", {
359
+ className: "flex h-full flex-col items-center justify-center p-4",
360
+ children: /*#__PURE__*/jsx(NotConnected, {
361
+ installationUrl: installationUrl
362
+ })
363
+ })
364
+ })
365
+ });
366
+ };
367
+
368
+ var Repositories = function Repositories(_ref) {
369
+ var isConnected = _ref.isConnected,
370
+ isConnecting = _ref.isConnecting,
371
+ repositories = _ref.repositories,
372
+ onConnect = _ref.onConnect,
373
+ installationUrl = _ref.installationUrl,
374
+ troubleshootUrl = _ref.troubleshootUrl,
375
+ isPane = _ref.isPane;
376
+ return /*#__PURE__*/jsx("div", {
377
+ className: classnames("neeto-ui-rounded-md neeto-ui-border-gray-300 h-full w-full space-y-6 border border-solid", {
378
+ "order-2": isPane,
379
+ "order-1": !isPane
380
+ }),
381
+ children: /*#__PURE__*/jsx(Private, {
382
+ installationUrl: installationUrl,
383
+ isConnected: isConnected,
384
+ isConnecting: isConnecting,
385
+ onConnect: onConnect,
386
+ repositories: repositories,
387
+ troubleshootUrl: troubleshootUrl
388
+ })
389
+ });
390
+ };
391
+
392
+ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
393
+ var _ref$isPaneLoading = _ref.isPaneLoading,
394
+ isPaneLoading = _ref$isPaneLoading === void 0 ? false : _ref$isPaneLoading,
395
+ _ref$shouldFetchRepos = _ref.shouldFetchRepositories,
396
+ shouldFetchRepositories = _ref$shouldFetchRepos === void 0 ? true : _ref$shouldFetchRepos,
397
+ _ref$paneAccounts = _ref.paneAccounts,
398
+ paneAccounts = _ref$paneAccounts === void 0 ? [] : _ref$paneAccounts,
399
+ installationUrl = _ref.installationUrl,
400
+ isConnected = _ref.isConnected,
401
+ _ref$isConnecting = _ref.isConnecting,
402
+ isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
403
+ onConnect = _ref.onConnect,
404
+ _ref$paneRepositories = _ref.paneRepositories,
405
+ paneRepositories = _ref$paneRepositories === void 0 ? [] : _ref$paneRepositories,
406
+ troubleshootUrl = _ref.troubleshootUrl,
407
+ _ref$isPane = _ref.isPane,
408
+ isPane = _ref$isPane === void 0 ? false : _ref$isPane;
409
+ var _useFetchGithubReposi = useFetchGithubRepositories({
410
+ isConnected: shouldFetchRepositories && globalProps.isGithubIntegrated
411
+ }),
412
+ _useFetchGithubReposi2 = _useFetchGithubReposi.data,
413
+ _useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
414
+ _useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
415
+ containerRepositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
416
+ _useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
417
+ containerAccounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
418
+ isContainerLoading = _useFetchGithubReposi.isLoading;
419
+ var repositories = shouldFetchRepositories ? containerRepositories : paneRepositories;
420
+ var accounts = shouldFetchRepositories ? containerAccounts : paneAccounts;
421
+ var isLoading = shouldFetchRepositories ? isContainerLoading : isPaneLoading;
422
+ if (isLoading) {
423
+ return /*#__PURE__*/jsx("div", {
424
+ className: "flex h-full w-full items-center justify-center",
425
+ children: /*#__PURE__*/jsx(Spinner, {})
426
+ });
427
+ }
428
+ return /*#__PURE__*/jsxs("div", {
429
+ className: classnames("flex min-h-0 w-full grow flex-col", {
430
+ "flex-col": isPane,
431
+ "gap-3 md:flex-row md:gap-6": !isPane
432
+ }),
433
+ children: [/*#__PURE__*/jsx(Accounts, {
434
+ accounts: accounts,
435
+ installationUrl: installationUrl,
436
+ isConnected: isConnected,
437
+ isPane: isPane,
438
+ onConnect: onConnect
439
+ }), /*#__PURE__*/jsx(Repositories, {
440
+ installationUrl: installationUrl,
441
+ isConnected: isConnected,
442
+ isConnecting: isConnecting,
443
+ isPane: isPane,
444
+ onConnect: onConnect,
445
+ repositories: repositories,
446
+ troubleshootUrl: troubleshootUrl
447
+ })]
448
+ });
449
+ };
450
+
451
+ export { NeetoGithubNanoContainer as default };
28
452
  //# sourceMappingURL=NeetoGithubNanoContainer.js.map