@bigbinary/neeto-github-frontend 2.2.11 → 2.3.0

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 (59) hide show
  1. package/README.md +20 -12
  2. package/app/javascript/src/translations/ar.json +36 -0
  3. package/app/javascript/src/translations/bg.json +36 -0
  4. package/app/javascript/src/translations/ca.json +36 -0
  5. package/app/javascript/src/translations/cs.json +36 -0
  6. package/app/javascript/src/translations/da.json +36 -0
  7. package/app/javascript/src/translations/de.json +1 -1
  8. package/app/javascript/src/translations/en.json +12 -1
  9. package/app/javascript/src/translations/es-MX.json +36 -0
  10. package/app/javascript/src/translations/es.json +1 -1
  11. package/app/javascript/src/translations/et.json +36 -0
  12. package/app/javascript/src/translations/fi.json +36 -0
  13. package/app/javascript/src/translations/fil.json +36 -0
  14. package/app/javascript/src/translations/fr.json +1 -1
  15. package/app/javascript/src/translations/hi.json +36 -0
  16. package/app/javascript/src/translations/hr.json +36 -0
  17. package/app/javascript/src/translations/id.json +36 -0
  18. package/app/javascript/src/translations/it.json +36 -0
  19. package/app/javascript/src/translations/ja.json +36 -0
  20. package/app/javascript/src/translations/ko.json +36 -0
  21. package/app/javascript/src/translations/nl.json +36 -0
  22. package/app/javascript/src/translations/pl.json +36 -0
  23. package/app/javascript/src/translations/pt-BR.json +36 -0
  24. package/app/javascript/src/translations/pt.json +36 -0
  25. package/app/javascript/src/translations/ro.json +36 -0
  26. package/app/javascript/src/translations/ru.json +36 -0
  27. package/app/javascript/src/translations/sk.json +36 -0
  28. package/app/javascript/src/translations/sl.json +36 -0
  29. package/app/javascript/src/translations/sv.json +36 -0
  30. package/app/javascript/src/translations/th.json +36 -0
  31. package/app/javascript/src/translations/tr.json +36 -0
  32. package/app/javascript/src/translations/uk.json +36 -0
  33. package/app/javascript/src/translations/vi.json +36 -0
  34. package/app/javascript/src/translations/zh-CN.json +36 -0
  35. package/app/javascript/src/translations/zh-TW.json +36 -0
  36. package/dist/NeetoGithubIntegrationsTable.js +18 -9
  37. package/dist/NeetoGithubIntegrationsTable.js.map +1 -1
  38. package/dist/NeetoGithubNanoContainer.js +1 -1
  39. package/dist/NeetoGithubNanoPane.js +1 -1
  40. package/dist/NeetoGithubRepositoryConnectionCard.js +178 -0
  41. package/dist/NeetoGithubRepositoryConnectionCard.js.map +1 -0
  42. package/dist/cjs/NeetoGithubIntegrationsTable.js +18 -9
  43. package/dist/cjs/NeetoGithubIntegrationsTable.js.map +1 -1
  44. package/dist/cjs/NeetoGithubNanoContainer.js +1 -1
  45. package/dist/cjs/NeetoGithubNanoPane.js +1 -1
  46. package/dist/cjs/NeetoGithubRepositoryConnectionCard.js +180 -0
  47. package/dist/cjs/NeetoGithubRepositoryConnectionCard.js.map +1 -0
  48. package/dist/cjs/index.js +7 -2
  49. package/dist/cjs/index.js.map +1 -1
  50. package/dist/{index-DuC4pfWZ.js → index-OybnyWjp.js} +17 -7
  51. package/dist/index-OybnyWjp.js.map +1 -0
  52. package/dist/{index-BoK05c9_.js → index-kiZ2xPC1.js} +18 -8
  53. package/dist/index-kiZ2xPC1.js.map +1 -0
  54. package/dist/index.js +6 -2
  55. package/dist/index.js.map +1 -1
  56. package/package.json +17 -15
  57. package/types.d.ts +32 -1
  58. package/dist/index-BoK05c9_.js.map +0 -1
  59. package/dist/index-DuC4pfWZ.js.map +0 -1
@@ -4,6 +4,7 @@ import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
4
4
  import Button from '@bigbinary/neetoui/Button';
5
5
  import { useTranslation, Trans } from 'react-i18next';
6
6
  import { a as useDestroyGithubIntegration, b as useFetchGithubAppInstallations } from './useGithubAccountsApi-kFn8BvEJ.js';
7
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
7
8
  import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
9
  import { useState } from 'react';
9
10
  import { isNotEmpty } from '@bigbinary/neeto-cist';
@@ -11,7 +12,6 @@ import Table from '@bigbinary/neetoui/Table';
11
12
  import NoData from '@bigbinary/neetoui/NoData';
12
13
  import Alert from '@bigbinary/neetoui/Alert';
13
14
  import { isEmpty } from 'ramda';
14
- import _defineProperty from '@babel/runtime/helpers/defineProperty';
15
15
  import { t } from 'i18next';
16
16
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
17
17
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
@@ -24,10 +24,10 @@ import '@bigbinary/neeto-commons-frontend/react-utils';
24
24
  import 'axios';
25
25
  import '@bigbinary/neeto-commons-frontend/constants';
26
26
 
27
- 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; }
28
- 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; }
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; }
29
29
  var getNewInstallationUrl = function getNewInstallationUrl(integratorParams, redirectPath) {
30
- return buildUrl("/github_integrations/app_installations/new", _objectSpread(_objectSpread({}, integratorParams), {}, {
30
+ return buildUrl("/github_integrations/app_installations/new", _objectSpread$1(_objectSpread$1({}, integratorParams), {}, {
31
31
  redirectPath: redirectPath
32
32
  }));
33
33
  };
@@ -59,11 +59,14 @@ var getGithubAccountsTableColumnData = function getGithubAccountsTableColumnData
59
59
  }];
60
60
  };
61
61
 
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; }
62
64
  var AccountsTable = function AccountsTable(_ref) {
63
65
  var _ref$appInstallations = _ref.appInstallations,
64
66
  appInstallations = _ref$appInstallations === void 0 ? [] : _ref$appInstallations,
65
67
  integratorParams = _ref.integratorParams,
66
- keysToPurgeOnDelete = _ref.keysToPurgeOnDelete;
68
+ keysToPurgeOnDelete = _ref.keysToPurgeOnDelete,
69
+ noDataProps = _ref.noDataProps;
67
70
  var _useTranslation = useTranslation(),
68
71
  t = _useTranslation.t;
69
72
  var _useState = useState({}),
@@ -80,9 +83,9 @@ var AccountsTable = function AccountsTable(_ref) {
80
83
  if (isEmpty(appInstallations)) {
81
84
  return /*#__PURE__*/jsx("div", {
82
85
  className: "flex h-full w-full items-center justify-center",
83
- children: /*#__PURE__*/jsx(NoData, {
86
+ children: /*#__PURE__*/jsx(NoData, _objectSpread({
84
87
  title: t("neetoGithub.integrationTable.noIntegrationFound")
85
- })
88
+ }, noDataProps))
86
89
  });
87
90
  }
88
91
  return /*#__PURE__*/jsxs(Fragment, {
@@ -118,7 +121,11 @@ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
118
121
  integratorParams = _ref.integratorParams,
119
122
  redirectPath = _ref.redirectPath,
120
123
  _ref$keysToPurgeOnDel = _ref.keysToPurgeOnDelete,
121
- keysToPurgeOnDelete = _ref$keysToPurgeOnDel === void 0 ? [] : _ref$keysToPurgeOnDel;
124
+ keysToPurgeOnDelete = _ref$keysToPurgeOnDel === void 0 ? [] : _ref$keysToPurgeOnDel,
125
+ _ref$titleHelpPopover = _ref.titleHelpPopoverProps,
126
+ titleHelpPopoverProps = _ref$titleHelpPopover === void 0 ? {} : _ref$titleHelpPopover,
127
+ _ref$noDataProps = _ref.noDataProps,
128
+ noDataProps = _ref$noDataProps === void 0 ? {} : _ref$noDataProps;
122
129
  var _useTranslation = useTranslation(),
123
130
  t = _useTranslation.t;
124
131
  var _useFetchGithubAppIns = useFetchGithubAppInstallations(integratorParams),
@@ -135,6 +142,7 @@ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
135
142
  return /*#__PURE__*/jsxs(Container, {
136
143
  children: [/*#__PURE__*/jsx(Header, {
137
144
  breadcrumbs: breadcrumbs,
145
+ titleHelpPopoverProps: titleHelpPopoverProps,
138
146
  title: t("neetoGithub.github"),
139
147
  actionBlock: /*#__PURE__*/jsx(Button, {
140
148
  href: newInstallationUrl,
@@ -143,7 +151,8 @@ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
143
151
  }), /*#__PURE__*/jsx(AccountsTable, {
144
152
  appInstallations: appInstallations,
145
153
  integratorParams: integratorParams,
146
- keysToPurgeOnDelete: keysToPurgeOnDelete
154
+ keysToPurgeOnDelete: keysToPurgeOnDelete,
155
+ noDataProps: noDataProps
147
156
  })]
148
157
  });
149
158
  };
@@ -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\nexport const getNewInstallationUrl = (integratorParams, redirectPath) =>\n buildUrl(\"/github_integrations/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}) => {\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 title={t(\"neetoGithub.integrationTable.noIntegrationFound\")} />\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}) => {\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 }}\n title={t(\"neetoGithub.github\")}\n actionBlock={\n <Button\n href={newInstallationUrl}\n label={t(\"neetoGithub.connectGithub\")}\n />\n }\n />\n <AccountsTable\n {...{ appInstallations, integratorParams, keysToPurgeOnDelete }}\n />\n </Container>\n );\n};\n\nexport default NeetoGithubIntegrationsTable;\n"],"names":["getNewInstallationUrl","integratorParams","redirectPath","buildUrl","_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","_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","_useFetchGithubAppIns","useFetchGithubAppInstallations","_useFetchGithubAppIns2","data","isLoading","newInstallationUrl","PageLoader","Container","Header","actionBlock","Button","href"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,gBAAgB,EAAEC,YAAY,EAAA;EAAA,OAClEC,QAAQ,CAAC,4CAA4C,EAAAC,aAAA,CAAAA,aAAA,KAChDH,gBAAgB,CAAA,EAAA,EAAA,EAAA;AACnBC,IAAAA,YAAY,EAAZA;AAAY,GAAA,CACb,CAAC;AAAA,CAAA;AAEG,IAAMG,gCAAgC,GAAG,SAAnCA,gCAAgCA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3CC,sBAAsB,GAAAD,IAAA,CAAtBC,sBAAsB;AAAA,EAAA,OAClB,CACJ;AACEC,IAAAA,KAAK,EAAEC,CAAC,CAAC,qBAAqB,CAAC;AAC/BC,IAAAA,SAAS,EAAE,EAAE;AACbC,IAAAA,GAAG,EAAE,SAAS;AACdC,IAAAA,MAAM,EAAE,SAARA,MAAMA,CAAGC,CAAC,EAAEC,OAAO,EAAA;AAAA,MAAA,oBACjBC,IAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,SAAS,EAAC,2CAA2C;QAAAC,QAAA,EAAA,cACxD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,EAAA;IAAA1D,QAAA,EAAA,cACRC,GAAA,CAAC0D,MAAM,EAAA;AACCV,MAAAA,WAAW,EAAXA,WAAW;AACjB1D,MAAAA,KAAK,EAAEC,CAAC,CAAC,oBAAoB,CAAE;MAC/BoE,WAAW,eACT3D,GAAA,CAAC4D,MAAM,EAAA;AACLC,QAAAA,IAAI,EAAEN,kBAAmB;QACzBhD,KAAK,EAAEhB,CAAC,CAAC,2BAA2B;OACrC;AACF,KACF,CAAC,eACFS,GAAA,CAACS,aAAa,EAAA;AACNE,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAAE5B,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAAE6B,MAAAA,mBAAmB,EAAnBA;AAAmB,KAC9D,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\nexport const getNewInstallationUrl = (integratorParams, redirectPath) =>\n buildUrl(\"/github_integrations/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","_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","data","isLoading","newInstallationUrl","PageLoader","Container","Header","actionBlock","Button","href"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAMA,q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E,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;AAChB5B,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB6B,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,WAAW,EAAXA;AAAW,KAEd,CAAC;AAAA,GACO,CAAC;AAEhB;;;;"}
@@ -2,7 +2,7 @@ import 'classnames';
2
2
  import '@bigbinary/neeto-commons-frontend/initializers';
3
3
  import '@bigbinary/neetoui/Spinner';
4
4
  import './useGithubAccountsApi-kFn8BvEJ.js';
5
- export { N as default } from './index-BoK05c9_.js';
5
+ export { N as default } from './index-kiZ2xPC1.js';
6
6
  import 'react/jsx-runtime';
7
7
  import '@babel/runtime/helpers/toConsumableArray';
8
8
  import '@babel/runtime/helpers/defineProperty';
@@ -4,7 +4,7 @@ import Pane from '@bigbinary/neetoui/Pane';
4
4
  import Typography from '@bigbinary/neetoui/Typography';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import { u as useFetchGithubRepositories } from './useGithubAccountsApi-kFn8BvEJ.js';
7
- import { n, N as NeetoGithubNanoContainer } from './index-BoK05c9_.js';
7
+ import { n, N as NeetoGithubNanoContainer } from './index-kiZ2xPC1.js';
8
8
  import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
9
9
  import * as qs from 'qs';
10
10
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -0,0 +1,178 @@
1
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
3
+ import { useState } from 'react';
4
+ import classnames from 'classnames';
5
+ import { noop } from '@bigbinary/neeto-cist';
6
+ import ExternalLink from '@bigbinary/neeto-icons/ExternalLink';
7
+ import Github from '@bigbinary/neeto-icons/misc/Github';
8
+ import CardLayout from '@bigbinary/neeto-molecules/CardLayout';
9
+ import Button from '@bigbinary/neetoui/Button';
10
+ import Typography from '@bigbinary/neetoui/Typography';
11
+ import Alert from '@bigbinary/neetoui/Alert';
12
+ import Tooltip from '@bigbinary/neetoui/Tooltip';
13
+ import { isNotNil } from 'ramda';
14
+ import { useTranslation, Trans } from 'react-i18next';
15
+ import NeetoGithubNanoPane from './NeetoGithubNanoPane.js';
16
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
17
+ import '@bigbinary/neetoui/Pane';
18
+ import './useGithubAccountsApi-kFn8BvEJ.js';
19
+ import '@babel/runtime/helpers/toConsumableArray';
20
+ import '@tanstack/react-query';
21
+ import '@bigbinary/neeto-commons-frontend/initializers';
22
+ import '@bigbinary/neeto-commons-frontend/react-utils';
23
+ import 'axios';
24
+ import '@bigbinary/neeto-commons-frontend/constants';
25
+ import './index-kiZ2xPC1.js';
26
+ import '@bigbinary/neetoui/Spinner';
27
+ import '@bigbinary/neeto-icons/Building';
28
+ import '@bigbinary/neetoui/Avatar';
29
+ import '@bigbinary/neeto-icons/Plus';
30
+ import '@bigbinary/neeto-icons/Settings';
31
+ import '@bigbinary/neeto-molecules/Search';
32
+ import '@bigbinary/neeto-icons/Lock';
33
+ import '@bigbinary/neeto-molecules/DateFormat';
34
+ import 'qs';
35
+
36
+ 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; }
37
+ 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; }
38
+ var NeetoGithubRepositoryConnectionCard = function NeetoGithubRepositoryConnectionCard(_ref) {
39
+ var className = _ref.className,
40
+ repositoryName = _ref.repositoryName,
41
+ installationUrl = _ref.installationUrl,
42
+ _ref$helpDocUrl = _ref.helpDocUrl,
43
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
44
+ _ref$onConnect = _ref.onConnect,
45
+ _onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
46
+ _ref$onDisconnect = _ref.onDisconnect,
47
+ onDisconnect = _ref$onDisconnect === void 0 ? noop : _ref$onDisconnect,
48
+ _ref$isConnecting = _ref.isConnecting,
49
+ isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
50
+ _ref$isConnected = _ref.isConnected,
51
+ isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
52
+ _ref$isDisconnecting = _ref.isDisconnecting,
53
+ isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
54
+ _ref$isDisconnectingD = _ref.isDisconnectingDisabled,
55
+ isDisconnectingDisabled = _ref$isDisconnectingD === void 0 ? false : _ref$isDisconnectingD,
56
+ _ref$canManageGithubI = _ref.canManageGithubIntegration,
57
+ canManageGithubIntegration = _ref$canManageGithubI === void 0 ? false : _ref$canManageGithubI,
58
+ disconnectButtonDisabledTooltipContent = _ref.disconnectButtonDisabledTooltipContent;
59
+ var _useState = useState(false),
60
+ _useState2 = _slicedToArray(_useState, 2),
61
+ isConnectRepositoryViewOpen = _useState2[0],
62
+ setIsConnectRepositoryViewOpen = _useState2[1];
63
+ var _useState3 = useState(false),
64
+ _useState4 = _slicedToArray(_useState3, 2),
65
+ isDisconnectAlertOpen = _useState4[0],
66
+ setIsDisconnectAlertOpen = _useState4[1];
67
+ var _useTranslation = useTranslation(),
68
+ t = _useTranslation.t;
69
+ var isRepositoryConnected = isNotNil(repositoryName);
70
+ var isDisabled = isRepositoryConnected && isDisconnectingDisabled;
71
+ var style = isRepositoryConnected ? "secondary" : "primary";
72
+ var title = isRepositoryConnected ? t("neetoGithub.connectedRepository") : t("neetoGithub.connectRepository");
73
+ var label = isRepositoryConnected ? t("neetoGithub.disconnect") : t("neetoGithub.connect");
74
+ var tooltipProps = {
75
+ content: disconnectButtonDisabledTooltipContent || t("neetoGithub.disconnectingDisabled"),
76
+ disabled: !isDisconnectingDisabled || !isRepositoryConnected
77
+ };
78
+ var githubRepositoryUrl = function githubRepositoryUrl(repositoryName) {
79
+ return "https://github.com/".concat(repositoryName);
80
+ };
81
+ var renderActionBlockTooltip = function renderActionBlockTooltip() {
82
+ return /*#__PURE__*/jsx(Tooltip, _objectSpread(_objectSpread({}, tooltipProps), {}, {
83
+ children: /*#__PURE__*/jsx("span", {
84
+ children: /*#__PURE__*/jsx(Button, {
85
+ label: label,
86
+ style: style,
87
+ disabled: isDisabled,
88
+ onClick: isRepositoryConnected ? function () {
89
+ return setIsDisconnectAlertOpen(true);
90
+ } : function () {
91
+ return setIsConnectRepositoryViewOpen(true);
92
+ }
93
+ })
94
+ })
95
+ }));
96
+ };
97
+ return /*#__PURE__*/jsxs("div", {
98
+ className: classnames("w-full", className),
99
+ children: [/*#__PURE__*/jsxs(CardLayout, {
100
+ title: title,
101
+ actionBlock: canManageGithubIntegration && renderActionBlockTooltip(),
102
+ icon: /*#__PURE__*/jsx(Github, {}),
103
+ children: [/*#__PURE__*/jsx(Typography, {
104
+ style: "body1",
105
+ children: /*#__PURE__*/jsx(Trans, {
106
+ values: {
107
+ repository: repositoryName
108
+ },
109
+ components: {
110
+ a: /*#__PURE__*/jsx(Button, {
111
+ href: githubRepositoryUrl(repositoryName),
112
+ icon: ExternalLink,
113
+ rel: "noreferrer",
114
+ style: "link",
115
+ target: "_blank"
116
+ }),
117
+ externalLink: /*#__PURE__*/jsx(ExternalLink, {
118
+ size: 20
119
+ })
120
+ },
121
+ i18nKey: isRepositoryConnected ? "neetoGithub.repositoryConnected" : "neetoGithub.repositoryNotConnected"
122
+ })
123
+ }), helpDocUrl && /*#__PURE__*/jsx(Typography, {
124
+ className: "neeto-ui-text-gray-800 mt-4",
125
+ style: "body2",
126
+ weight: "normal",
127
+ children: /*#__PURE__*/jsx(Trans, {
128
+ i18nKey: "neetoGithub.helpDocUrl",
129
+ components: {
130
+ helpLink: /*#__PURE__*/jsx(Button, {
131
+ href: helpDocUrl,
132
+ style: "link",
133
+ target: "_blank"
134
+ })
135
+ }
136
+ })
137
+ })]
138
+ }), canManageGithubIntegration && /*#__PURE__*/jsxs(Fragment, {
139
+ children: [/*#__PURE__*/jsx(NeetoGithubNanoPane, {
140
+ installationUrl: installationUrl,
141
+ isConnected: isConnected,
142
+ isConnecting: isConnecting,
143
+ isOpen: isConnectRepositoryViewOpen,
144
+ projects: [{
145
+ repository: repositoryName
146
+ }],
147
+ title: t("neetoGithub.selectARepository"),
148
+ onClose: function onClose() {
149
+ setIsConnectRepositoryViewOpen(false);
150
+ },
151
+ onConnect: function onConnect(_ref2) {
152
+ var repoType = _ref2.repoType,
153
+ repository = _ref2.repository,
154
+ setIsLoading = _ref2.setIsLoading;
155
+ _onConnect({
156
+ repoType: repoType,
157
+ repository: repository,
158
+ setIsLoading: setIsLoading
159
+ }, setIsConnectRepositoryViewOpen);
160
+ }
161
+ }), /*#__PURE__*/jsx(Alert, {
162
+ isOpen: isDisconnectAlertOpen,
163
+ isSubmitting: isDisconnecting,
164
+ message: t("neetoGithub.disconnectAlert.message"),
165
+ title: t("neetoGithub.disconnectAlert.title"),
166
+ onClose: function onClose() {
167
+ return setIsDisconnectAlertOpen(false);
168
+ },
169
+ onSubmit: function onSubmit() {
170
+ onDisconnect(setIsDisconnectAlertOpen);
171
+ }
172
+ })]
173
+ })]
174
+ });
175
+ };
176
+
177
+ export { NeetoGithubRepositoryConnectionCard as default };
178
+ //# sourceMappingURL=NeetoGithubRepositoryConnectionCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeetoGithubRepositoryConnectionCard.js","sources":["../app/javascript/src/components/NeetoGithubRepositoryConnectionCard/index.jsx"],"sourcesContent":["import { useState } from \"react\";\n\nimport classNames from \"classnames\";\nimport { noop } from \"neetocist\";\nimport { ExternalLink } from \"neetoicons\";\nimport { Github } from \"neetoicons/misc\";\nimport CardLayout from \"neetomolecules/CardLayout\";\nimport { Button, Typography, Alert, Tooltip } from \"neetoui\";\nimport { isNotNil } from \"ramda\";\nimport { Trans, useTranslation } from \"react-i18next\";\n\nimport NeetoGithubNanoPane from \"components/NeetoGithubNanoPane\";\n\nconst NeetoGithubRepositoryConnectionCard = ({\n className,\n repositoryName,\n installationUrl,\n helpDocUrl = \"\",\n onConnect = noop,\n onDisconnect = noop,\n isConnecting = false,\n isConnected = false,\n isDisconnecting = false,\n isDisconnectingDisabled = false,\n canManageGithubIntegration = false,\n disconnectButtonDisabledTooltipContent,\n}) => {\n const [isConnectRepositoryViewOpen, setIsConnectRepositoryViewOpen] =\n useState(false);\n const [isDisconnectAlertOpen, setIsDisconnectAlertOpen] = useState(false);\n\n const { t } = useTranslation();\n\n const isRepositoryConnected = isNotNil(repositoryName);\n const isDisabled = isRepositoryConnected && isDisconnectingDisabled;\n const style = isRepositoryConnected ? \"secondary\" : \"primary\";\n\n const title = isRepositoryConnected\n ? t(\"neetoGithub.connectedRepository\")\n : t(\"neetoGithub.connectRepository\");\n\n const label = isRepositoryConnected\n ? t(\"neetoGithub.disconnect\")\n : t(\"neetoGithub.connect\");\n\n const tooltipProps = {\n content:\n disconnectButtonDisabledTooltipContent ||\n t(\"neetoGithub.disconnectingDisabled\"),\n disabled: !isDisconnectingDisabled || !isRepositoryConnected,\n };\n\n const githubRepositoryUrl = repositoryName =>\n `https://github.com/${repositoryName}`;\n\n const renderActionBlockTooltip = () => (\n <Tooltip {...tooltipProps}>\n <span>\n <Button\n {...{ label, style }}\n disabled={isDisabled}\n onClick={\n isRepositoryConnected\n ? () => setIsDisconnectAlertOpen(true)\n : () => setIsConnectRepositoryViewOpen(true)\n }\n />\n </span>\n </Tooltip>\n );\n\n return (\n <div className={classNames(\"w-full\", className)}>\n <CardLayout\n {...{ title }}\n actionBlock={canManageGithubIntegration && renderActionBlockTooltip()}\n icon={<Github />}\n >\n <Typography style=\"body1\">\n <Trans\n values={{ repository: repositoryName }}\n components={{\n a: (\n <Button\n href={githubRepositoryUrl(repositoryName)}\n icon={ExternalLink}\n rel=\"noreferrer\"\n style=\"link\"\n target=\"_blank\"\n />\n ),\n externalLink: <ExternalLink size={20} />,\n }}\n i18nKey={\n isRepositoryConnected\n ? \"neetoGithub.repositoryConnected\"\n : \"neetoGithub.repositoryNotConnected\"\n }\n />\n </Typography>\n {helpDocUrl && (\n <Typography\n className=\"neeto-ui-text-gray-800 mt-4\"\n style=\"body2\"\n weight=\"normal\"\n >\n <Trans\n i18nKey=\"neetoGithub.helpDocUrl\"\n components={{\n helpLink: (\n <Button href={helpDocUrl} style=\"link\" target=\"_blank\" />\n ),\n }}\n />\n </Typography>\n )}\n </CardLayout>\n {canManageGithubIntegration && (\n <>\n <NeetoGithubNanoPane\n {...{ installationUrl, isConnected, isConnecting }}\n isOpen={isConnectRepositoryViewOpen}\n projects={[{ repository: repositoryName }]}\n title={t(\"neetoGithub.selectARepository\")}\n onClose={() => {\n setIsConnectRepositoryViewOpen(false);\n }}\n onConnect={({ repoType, repository, setIsLoading }) => {\n onConnect(\n { repoType, repository, setIsLoading },\n setIsConnectRepositoryViewOpen\n );\n }}\n />\n <Alert\n isOpen={isDisconnectAlertOpen}\n isSubmitting={isDisconnecting}\n message={t(\"neetoGithub.disconnectAlert.message\")}\n title={t(\"neetoGithub.disconnectAlert.title\")}\n onClose={() => setIsDisconnectAlertOpen(false)}\n onSubmit={() => {\n onDisconnect(setIsDisconnectAlertOpen);\n }}\n />\n </>\n )}\n </div>\n );\n};\n\nexport default NeetoGithubRepositoryConnectionCard;\n"],"names":["NeetoGithubRepositoryConnectionCard","_ref","className","repositoryName","installationUrl","_ref$helpDocUrl","helpDocUrl","_ref$onConnect","onConnect","noop","_ref$onDisconnect","onDisconnect","_ref$isConnecting","isConnecting","_ref$isConnected","isConnected","_ref$isDisconnecting","isDisconnecting","_ref$isDisconnectingD","isDisconnectingDisabled","_ref$canManageGithubI","canManageGithubIntegration","disconnectButtonDisabledTooltipContent","_useState","useState","_useState2","_slicedToArray","isConnectRepositoryViewOpen","setIsConnectRepositoryViewOpen","_useState3","_useState4","isDisconnectAlertOpen","setIsDisconnectAlertOpen","_useTranslation","useTranslation","t","isRepositoryConnected","isNotNil","isDisabled","style","title","label","tooltipProps","content","disabled","githubRepositoryUrl","concat","renderActionBlockTooltip","_jsx","Tooltip","_objectSpread","children","Button","onClick","_jsxs","classNames","CardLayout","actionBlock","icon","Github","Typography","Trans","values","repository","components","a","href","ExternalLink","rel","target","externalLink","size","i18nKey","weight","helpLink","_Fragment","NeetoGithubNanoPane","isOpen","projects","onClose","_ref2","repoType","setIsLoading","Alert","isSubmitting","message","onSubmit"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,IAAMA,mCAAmC,GAAG,SAAtCA,mCAAmCA,CAAAC,IAAA,EAanC;AAAA,EAAA,IAZJC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,cAAc,GAAAF,IAAA,CAAdE,cAAc;IACdC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IAAAC,eAAA,GAAAJ,IAAA,CACfK,UAAU;AAAVA,IAAAA,UAAU,GAAAD,eAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,eAAA;IAAAE,cAAA,GAAAN,IAAA,CACfO,SAAS;AAATA,IAAAA,UAAS,GAAAD,cAAA,KAAGE,KAAAA,CAAAA,GAAAA,IAAI,GAAAF,cAAA;IAAAG,iBAAA,GAAAT,IAAA,CAChBU,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGD,KAAAA,CAAAA,GAAAA,IAAI,GAAAC,iBAAA;IAAAE,iBAAA,GAAAX,IAAA,CACnBY,YAAY;AAA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,CAAC;SAAC;AAC/CsD,QAAAA,QAAQ,EAAE,SAAVA,QAAQA,GAAQ;UACd3E,YAAY,CAACqB,wBAAwB,CAAC;AACxC;AAAE,OACH,CAAC;AAAA,KACF,CACH;AAAA,GACE,CAAC;AAEV;;;;"}
@@ -6,6 +6,7 @@ var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
6
6
  var Button = require('@bigbinary/neetoui/Button');
7
7
  var reactI18next = require('react-i18next');
8
8
  var useGithubAccountsApi = require('../useGithubAccountsApi-C9W-L_-C.js');
9
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
9
10
  var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
10
11
  var react = require('react');
11
12
  var neetoCist = require('@bigbinary/neeto-cist');
@@ -13,7 +14,6 @@ var Table = require('@bigbinary/neetoui/Table');
13
14
  var NoData = require('@bigbinary/neetoui/NoData');
14
15
  var Alert = require('@bigbinary/neetoui/Alert');
15
16
  var ramda = require('ramda');
16
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
17
17
  var i18next = require('i18next');
18
18
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
19
19
  var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
@@ -26,10 +26,10 @@ require('@bigbinary/neeto-commons-frontend/react-utils');
26
26
  require('axios');
27
27
  require('@bigbinary/neeto-commons-frontend/constants');
28
28
 
29
- 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; }
30
- 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; }
29
+ 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; }
30
+ 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; }
31
31
  var getNewInstallationUrl = function getNewInstallationUrl(integratorParams, redirectPath) {
32
- return utils.buildUrl("/github_integrations/app_installations/new", _objectSpread(_objectSpread({}, integratorParams), {}, {
32
+ return utils.buildUrl("/github_integrations/app_installations/new", _objectSpread$1(_objectSpread$1({}, integratorParams), {}, {
33
33
  redirectPath: redirectPath
34
34
  }));
35
35
  };
@@ -61,11 +61,14 @@ var getGithubAccountsTableColumnData = function getGithubAccountsTableColumnData
61
61
  }];
62
62
  };
63
63
 
64
+ 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; }
65
+ 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; }
64
66
  var AccountsTable = function AccountsTable(_ref) {
65
67
  var _ref$appInstallations = _ref.appInstallations,
66
68
  appInstallations = _ref$appInstallations === void 0 ? [] : _ref$appInstallations,
67
69
  integratorParams = _ref.integratorParams,
68
- keysToPurgeOnDelete = _ref.keysToPurgeOnDelete;
70
+ keysToPurgeOnDelete = _ref.keysToPurgeOnDelete,
71
+ noDataProps = _ref.noDataProps;
69
72
  var _useTranslation = reactI18next.useTranslation(),
70
73
  t = _useTranslation.t;
71
74
  var _useState = react.useState({}),
@@ -82,9 +85,9 @@ var AccountsTable = function AccountsTable(_ref) {
82
85
  if (ramda.isEmpty(appInstallations)) {
83
86
  return /*#__PURE__*/jsxRuntime.jsx("div", {
84
87
  className: "flex h-full w-full items-center justify-center",
85
- children: /*#__PURE__*/jsxRuntime.jsx(NoData, {
88
+ children: /*#__PURE__*/jsxRuntime.jsx(NoData, _objectSpread({
86
89
  title: t("neetoGithub.integrationTable.noIntegrationFound")
87
- })
90
+ }, noDataProps))
88
91
  });
89
92
  }
90
93
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
@@ -120,7 +123,11 @@ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
120
123
  integratorParams = _ref.integratorParams,
121
124
  redirectPath = _ref.redirectPath,
122
125
  _ref$keysToPurgeOnDel = _ref.keysToPurgeOnDelete,
123
- keysToPurgeOnDelete = _ref$keysToPurgeOnDel === void 0 ? [] : _ref$keysToPurgeOnDel;
126
+ keysToPurgeOnDelete = _ref$keysToPurgeOnDel === void 0 ? [] : _ref$keysToPurgeOnDel,
127
+ _ref$titleHelpPopover = _ref.titleHelpPopoverProps,
128
+ titleHelpPopoverProps = _ref$titleHelpPopover === void 0 ? {} : _ref$titleHelpPopover,
129
+ _ref$noDataProps = _ref.noDataProps,
130
+ noDataProps = _ref$noDataProps === void 0 ? {} : _ref$noDataProps;
124
131
  var _useTranslation = reactI18next.useTranslation(),
125
132
  t = _useTranslation.t;
126
133
  var _useFetchGithubAppIns = useGithubAccountsApi.useFetchGithubAppInstallations(integratorParams),
@@ -137,6 +144,7 @@ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
137
144
  return /*#__PURE__*/jsxRuntime.jsxs(Container, {
138
145
  children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
139
146
  breadcrumbs: breadcrumbs,
147
+ titleHelpPopoverProps: titleHelpPopoverProps,
140
148
  title: t("neetoGithub.github"),
141
149
  actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
142
150
  href: newInstallationUrl,
@@ -145,7 +153,8 @@ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
145
153
  }), /*#__PURE__*/jsxRuntime.jsx(AccountsTable, {
146
154
  appInstallations: appInstallations,
147
155
  integratorParams: integratorParams,
148
- keysToPurgeOnDelete: keysToPurgeOnDelete
156
+ keysToPurgeOnDelete: keysToPurgeOnDelete,
157
+ noDataProps: noDataProps
149
158
  })]
150
159
  });
151
160
  };
@@ -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\nexport const getNewInstallationUrl = (integratorParams, redirectPath) =>\n buildUrl(\"/github_integrations/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}) => {\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 title={t(\"neetoGithub.integrationTable.noIntegrationFound\")} />\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}) => {\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 }}\n title={t(\"neetoGithub.github\")}\n actionBlock={\n <Button\n href={newInstallationUrl}\n label={t(\"neetoGithub.connectGithub\")}\n />\n }\n />\n <AccountsTable\n {...{ appInstallations, integratorParams, keysToPurgeOnDelete }}\n />\n </Container>\n );\n};\n\nexport default NeetoGithubIntegrationsTable;\n"],"names":["getNewInstallationUrl","integratorParams","redirectPath","buildUrl","_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","_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","_useFetchGithubAppIns","useFetchGithubAppInstallations","_useFetchGithubAppIns2","data","isLoading","newInstallationUrl","PageLoader","Container","Header","actionBlock","Button","href"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAMA,qBAAqB,GAAG,SA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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\nexport const getNewInstallationUrl = (integratorParams, redirectPath) =>\n buildUrl(\"/github_integrations/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","_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","data","isLoading","newInstallationUrl","PageLoader","Container","Header","actionBlock","Button","href"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAMA,qBAAqB,GAAG,SAAxBA,qBAAqBA,CAAIC,gBAAgB,EAAEC,YAAY,EAAA;EAAA,OAClEC,cAAQ,CAAC,4CAA4C,EAAAC,eAAA,CAAAA,eAAA,KAChDH,gBAAgB,CAAA,EAAA,EAAA,EAAA;AACnBC,IAAAA,YAAY,EAAZA;AAAY,GAAA,CACb,CAAC;AAAA,CAAA;AAEG,IAAMG,gCAAgC,GAAG,SAAnCA,gCAAgCA,CAAAC,IAAA,EAAA;AAAA,EAAA,IAC3CC,sBAAsB,GAAAD,IAAA,CAAtBC,sBAAsB;AAAA,EAAA,OAClB,CACJ;AACEC,IAAAA,KAAK,EAAEC,SAAC,CAAC,qBAAqB,CAAC;AAC/BC,IAAAA,SAAS,EAAE,EAAE;AACbC,IAAAA,GAAG,EAAE,SAAS;AACdC,IAAAA,MAAM,EAAE,SAARA,MAAMA,CAAGC,CAAC,EAAEC,OAAO,EAAA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qBAAA,CAD1CG,IAAI;AAAE9C,IAAAA,gBAAgB,GAAA6C,sBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,sBAAA;IAAEE,SAAS,GAAAJ,qBAAA,CAATI,SAAS;AAG9C,EAAA,IAAMC,kBAAkB,GAAG7E,qBAAqB,CAC9CC,gBAAgB,EAChBC,YACF,CAAC;AAED,EAAA,IAAI0E,SAAS,EAAE;AACb,IAAA,oBACE1D,cAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,oDAAoD;AAAAC,MAAAA,QAAA,eACjEC,cAAA,CAAC4D,UAAU,EAAE,EAAA;AAAC,KACX,CAAC;AAEV;EAEA,oBACE/D,eAAA,CAACgE,SAAS,EAAA;IAAA9D,QAAA,EAAA,cACRC,cAAA,CAAC8D,MAAM,EAAA;AACCb,MAAAA,WAAW,EAAXA,WAAW;AAAEG,MAAAA,qBAAqB,EAArBA,qBAAqB;AACxC9D,MAAAA,KAAK,EAAEC,CAAC,CAAC,oBAAoB,CAAE;MAC/BwE,WAAW,eACT/D,cAAA,CAACgE,MAAM,EAAA;AACLC,QAAAA,IAAI,EAAEN,kBAAmB;QACzBpD,KAAK,EAAEhB,CAAC,CAAC,2BAA2B;OACrC;AACF,KACF,CAAC,eACFS,cAAA,CAACS,aAAa,EAAA;AAEVE,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB5B,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAChB6B,MAAAA,mBAAmB,EAAnBA,mBAAmB;AACnBC,MAAAA,WAAW,EAAXA;AAAW,KAEd,CAAC;AAAA,GACO,CAAC;AAEhB;;;;"}
@@ -4,7 +4,7 @@ require('classnames');
4
4
  require('@bigbinary/neeto-commons-frontend/initializers');
5
5
  require('@bigbinary/neetoui/Spinner');
6
6
  require('../useGithubAccountsApi-C9W-L_-C.js');
7
- var NeetoGithubNanoContainer = require('../index-DuC4pfWZ.js');
7
+ var NeetoGithubNanoContainer = require('../index-OybnyWjp.js');
8
8
  require('react/jsx-runtime');
9
9
  require('@babel/runtime/helpers/toConsumableArray');
10
10
  require('@babel/runtime/helpers/defineProperty');
@@ -6,7 +6,7 @@ var Pane = require('@bigbinary/neetoui/Pane');
6
6
  var Typography = require('@bigbinary/neetoui/Typography');
7
7
  var reactI18next = require('react-i18next');
8
8
  var useGithubAccountsApi = require('../useGithubAccountsApi-C9W-L_-C.js');
9
- var NeetoGithubNanoContainer = require('../index-DuC4pfWZ.js');
9
+ var NeetoGithubNanoContainer = require('../index-OybnyWjp.js');
10
10
  var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
11
11
  var qs = require('qs');
12
12
  var jsxRuntime = require('react/jsx-runtime');