@bigbinary/neeto-github-frontend 2.2.4 → 2.2.6

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.
package/README.md CHANGED
@@ -65,6 +65,8 @@ yarn add @bigbinary/neeto-github-frontend
65
65
  #### Components
66
66
  - [NeetoGithubNanoContainer](./docs/frontend/components/NeetoGithubNanoContainer/README.md)
67
67
  - [NeetoGithubNanoPane](./docs/frontend/components/NeetoGithubNanoPane/README.md)
68
+ - [NeetoGithubIntegrationsTable](./docs/frontend/components/NeetoGithubIntegrationsTable/README.md)
69
+
68
70
 
69
71
  ## Instructions for Publishing
70
72
 
@@ -9,6 +9,7 @@
9
9
  "configureAccount": "Configure account",
10
10
  "connectAccount": "Connect account",
11
11
  "connectGithub": "Connect GitHub",
12
+ "disconnectGitHub": "Disconnect GitHub",
12
13
  "connectARepo": "Connect a repository",
13
14
  "connectRepository": "Connect repository",
14
15
  "continue": "Continue",
@@ -19,6 +20,17 @@
19
20
  "modal": {
20
21
  "title": "Create a new project"
21
22
  },
22
- "troubleshoot": "Can't find a repository that's already connected? <troubleshootLink>Troubleshoot</troubleshootLink> your GitHub connection."
23
+ "troubleshoot": "Can't find a repository that's already connected? <troubleshootLink>Troubleshoot</troubleshootLink> your GitHub connection.",
24
+ "integrationTable": {
25
+ "noIntegrationFound": "There are no GitHub account connected",
26
+ "alert": {
27
+ "title": "Uninstall GitHub account?",
28
+ "message": "You are uninstalling the GitHub app installed by <strong>{{login}}</strong>. This can't be undone."
29
+ }
30
+ },
31
+ "actions": {
32
+ "delete": "Delete"
33
+ },
34
+ "account": "Account"
23
35
  }
24
36
  }
@@ -0,0 +1,152 @@
1
+ import Container from '@bigbinary/neeto-molecules/Container';
2
+ import Header from '@bigbinary/neeto-molecules/Header';
3
+ import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
4
+ import Button from '@bigbinary/neetoui/Button';
5
+ import { useTranslation, Trans } from 'react-i18next';
6
+ import { a as useDestroyGithubIntegration, b as useFetchGithubAppInstallations } from './useGithubAccountsApi-kFn8BvEJ.js';
7
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
+ import { useState } from 'react';
9
+ import { isNotEmpty } from '@bigbinary/neeto-cist';
10
+ import Table from '@bigbinary/neetoui/Table';
11
+ import NoData from '@bigbinary/neetoui/NoData';
12
+ import Alert from '@bigbinary/neetoui/Alert';
13
+ import { isEmpty } from 'ramda';
14
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
15
+ import { t } from 'i18next';
16
+ import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
17
+ import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
18
+ import Typography from '@bigbinary/neetoui/Typography';
19
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
20
+ import '@babel/runtime/helpers/toConsumableArray';
21
+ import '@tanstack/react-query';
22
+ import '@bigbinary/neeto-commons-frontend/initializers';
23
+ import '@bigbinary/neeto-commons-frontend/react-utils';
24
+ import 'axios';
25
+ import '@bigbinary/neeto-commons-frontend/constants';
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; }
29
+ var getNewInstallationUrl = function getNewInstallationUrl(integratorParams, redirectPath) {
30
+ return buildUrl("/github_integrations/app_installations/new", _objectSpread(_objectSpread({}, integratorParams), {}, {
31
+ redirectPath: redirectPath
32
+ }));
33
+ };
34
+ var getGithubAccountsTableColumnData = function getGithubAccountsTableColumnData(_ref) {
35
+ var setAccountToDisconnect = _ref.setAccountToDisconnect;
36
+ return [{
37
+ title: t("neetoGithub.account"),
38
+ dataIndex: "",
39
+ key: "actions",
40
+ render: function render(_, account) {
41
+ return /*#__PURE__*/jsxs("div", {
42
+ className: "flex items-center justify-between gap-x-3",
43
+ children: [/*#__PURE__*/jsx(Typography, {
44
+ children: account.accountLogin
45
+ }), /*#__PURE__*/jsx(MoreDropdown, {
46
+ dropdownProps: {
47
+ strategy: "fixed"
48
+ },
49
+ menuItems: [{
50
+ key: "delete",
51
+ label: t("neetoGithub.actions.delete"),
52
+ onClick: function onClick() {
53
+ return setAccountToDisconnect(account);
54
+ }
55
+ }]
56
+ })]
57
+ });
58
+ }
59
+ }];
60
+ };
61
+
62
+ var AccountsTable = function AccountsTable(_ref) {
63
+ var _ref$appInstallations = _ref.appInstallations,
64
+ appInstallations = _ref$appInstallations === void 0 ? [] : _ref$appInstallations,
65
+ integratorParams = _ref.integratorParams,
66
+ keysToPurgeOnDelete = _ref.keysToPurgeOnDelete;
67
+ var _useTranslation = useTranslation(),
68
+ t = _useTranslation.t;
69
+ var _useState = useState({}),
70
+ _useState2 = _slicedToArray(_useState, 2),
71
+ accountToDisconnect = _useState2[0],
72
+ setAccountToDisconnect = _useState2[1];
73
+ var _useDestroyGithubInte = useDestroyGithubIntegration(integratorParams, keysToPurgeOnDelete, {
74
+ onSuccess: function onSuccess() {
75
+ return setAccountToDisconnect({});
76
+ }
77
+ }),
78
+ deleteGithubAccount = _useDestroyGithubInte.mutate,
79
+ isDeleting = _useDestroyGithubInte.isPending;
80
+ if (isEmpty(appInstallations)) {
81
+ return /*#__PURE__*/jsx("div", {
82
+ className: "flex h-full w-full items-center justify-center",
83
+ children: /*#__PURE__*/jsx(NoData, {
84
+ title: t("neetoGithub.integrationTable.noIntegrationFound")
85
+ })
86
+ });
87
+ }
88
+ return /*#__PURE__*/jsxs(Fragment, {
89
+ children: [/*#__PURE__*/jsx(Table, {
90
+ rowData: appInstallations,
91
+ columnData: getGithubAccountsTableColumnData({
92
+ setAccountToDisconnect: setAccountToDisconnect
93
+ })
94
+ }), /*#__PURE__*/jsx(Alert, {
95
+ isOpen: isNotEmpty(accountToDisconnect),
96
+ isSubmitting: isDeleting,
97
+ submitButtonLabel: t("neetoGithub.disconnectGitHub"),
98
+ title: t("neetoGithub.integrationTable.alert.title"),
99
+ message: /*#__PURE__*/jsx(Trans, {
100
+ i18nKey: "neetoGithub.integrationTable.alert.message",
101
+ values: {
102
+ login: accountToDisconnect === null || accountToDisconnect === void 0 ? void 0 : accountToDisconnect.accountLogin
103
+ }
104
+ }),
105
+ onClose: function onClose() {
106
+ return setAccountToDisconnect({});
107
+ },
108
+ onSubmit: function onSubmit() {
109
+ return deleteGithubAccount(accountToDisconnect === null || accountToDisconnect === void 0 ? void 0 : accountToDisconnect.id);
110
+ }
111
+ })]
112
+ });
113
+ };
114
+
115
+ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
116
+ var _ref$breadcrumbs = _ref.breadcrumbs,
117
+ breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
118
+ integratorParams = _ref.integratorParams,
119
+ redirectPath = _ref.redirectPath,
120
+ _ref$keysToPurgeOnDel = _ref.keysToPurgeOnDelete,
121
+ keysToPurgeOnDelete = _ref$keysToPurgeOnDel === void 0 ? [] : _ref$keysToPurgeOnDel;
122
+ var _useTranslation = useTranslation(),
123
+ t = _useTranslation.t;
124
+ var _useFetchGithubAppIns = useFetchGithubAppInstallations(integratorParams),
125
+ _useFetchGithubAppIns2 = _useFetchGithubAppIns.data,
126
+ appInstallations = _useFetchGithubAppIns2 === void 0 ? [] : _useFetchGithubAppIns2,
127
+ isLoading = _useFetchGithubAppIns.isLoading;
128
+ var newInstallationUrl = getNewInstallationUrl(integratorParams, redirectPath);
129
+ if (isLoading) {
130
+ return /*#__PURE__*/jsx("div", {
131
+ className: "flex h-screen w-screen items-center justify-center",
132
+ children: /*#__PURE__*/jsx(PageLoader, {})
133
+ });
134
+ }
135
+ return /*#__PURE__*/jsxs(Container, {
136
+ children: [/*#__PURE__*/jsx(Header, {
137
+ breadcrumbs: breadcrumbs,
138
+ title: t("neetoGithub.github"),
139
+ actionBlock: /*#__PURE__*/jsx(Button, {
140
+ href: newInstallationUrl,
141
+ label: t("neetoGithub.connectGithub")
142
+ })
143
+ }), /*#__PURE__*/jsx(AccountsTable, {
144
+ appInstallations: appInstallations,
145
+ integratorParams: integratorParams,
146
+ keysToPurgeOnDelete: keysToPurgeOnDelete
147
+ })]
148
+ });
149
+ };
150
+
151
+ export { NeetoGithubIntegrationsTable as default };
152
+ //# sourceMappingURL=NeetoGithubIntegrationsTable.js.map
@@ -0,0 +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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CAAC;AAET,EAAA,IAAA2D,qBAAA,GACEC,8BAA8B,CAACpE,gBAAgB,CAAC;IAAAqE,sBAAA,GAAAF,qBAAA,CAD1CG,IAAI;AAAE1C,IAAAA,gBAAgB,GAAAyC,sBAAA,KAAG,KAAA,CAAA,GAAA,EAAE,GAAAA,sBAAA;IAAEE,SAAS,GAAAJ,qBAAA,CAATI,SAAS;AAG9C,EAAA,IAAMC,kBAAkB,GAAGzE,qBAAqB,CAC9CC,gBAAgB,EAChBC,YACF,CAAC;AAED,EAAA,IAAIsE,SAAS,EAAE;AACb,IAAA,oBACEtD,GAAA,CAAA,KAAA,EAAA;AAAKF,MAAAA,SAAS,EAAC,oDAAoD;AAAAC,MAAAA,QAAA,eACjEC,GAAA,CAACwD,UAAU,EAAE,EAAA;AAAC,KACX,CAAC;AAEV;EAEA,oBACE3D,IAAA,CAAC4D,SAAS,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;;;;"}
@@ -0,0 +1,28 @@
1
+ import 'classnames';
2
+ import '@bigbinary/neeto-commons-frontend/initializers';
3
+ import '@bigbinary/neetoui/Spinner';
4
+ import './useGithubAccountsApi-kFn8BvEJ.js';
5
+ export { N as default } from './index-CF2CmTxA.js';
6
+ import 'react/jsx-runtime';
7
+ import '@babel/runtime/helpers/toConsumableArray';
8
+ import '@babel/runtime/helpers/defineProperty';
9
+ import '@tanstack/react-query';
10
+ import '@bigbinary/neeto-commons-frontend/react-utils';
11
+ import 'ramda';
12
+ import 'axios';
13
+ 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
+ //# sourceMappingURL=NeetoGithubNanoContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeetoGithubNanoContainer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,108 @@
1
+ import { useRef } from 'react';
2
+ import { findBy, isPresent, noop } from '@bigbinary/neeto-cist';
3
+ import Pane from '@bigbinary/neetoui/Pane';
4
+ import Typography from '@bigbinary/neetoui/Typography';
5
+ import { useTranslation } from 'react-i18next';
6
+ import { u as useFetchGithubRepositories } from './useGithubAccountsApi-kFn8BvEJ.js';
7
+ import { n, N as NeetoGithubNanoContainer } from './index-CF2CmTxA.js';
8
+ import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
9
+ import * as qs from 'qs';
10
+ import { jsxs, jsx } from 'react/jsx-runtime';
11
+ import '@babel/runtime/helpers/toConsumableArray';
12
+ import '@babel/runtime/helpers/defineProperty';
13
+ import '@tanstack/react-query';
14
+ import '@bigbinary/neeto-commons-frontend/react-utils';
15
+ import 'ramda';
16
+ import 'axios';
17
+ import '@bigbinary/neeto-commons-frontend/constants';
18
+ import 'classnames';
19
+ import '@bigbinary/neetoui/Spinner';
20
+ import '@bigbinary/neeto-icons/misc/Github';
21
+ import '@bigbinary/neeto-icons/Building';
22
+ import '@bigbinary/neetoui/Avatar';
23
+ import '@bigbinary/neetoui/Button';
24
+ import '@bigbinary/neeto-icons/Plus';
25
+ import '@bigbinary/neeto-icons/Settings';
26
+ import '@babel/runtime/helpers/slicedToArray';
27
+ import '@bigbinary/neeto-molecules/Search';
28
+ import '@bigbinary/neeto-icons/Lock';
29
+ import '@bigbinary/neeto-molecules/DateFormat';
30
+
31
+ var css = ".neeto-github-modal-pane-wrapper{width:min(100%,1280px)}@media (min-width:768px){.neeto-github-modal-pane-wrapper{width:min(90%,1280px)}}@media (min-width:1024px){.neeto-github-modal-pane-wrapper{width:min(60%,1280px)}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvcGFuZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGlDQUNFLHNCQUNGLENBQ0UseUJBSEYsaUNBSUkscUJBRUYsQ0FDRixDQUFFLDBCQVBGLGlDQVFJLHFCQUdGLENBQ0YiLCJzb3VyY2VzQ29udGVudCI6WyIubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oMTAwJSwgMTI4MHB4KTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogbWluKDkwJSwgMTI4MHB4KTtcbiAgfVxuXG4gIEBzY3JlZW4gbGcge1xuICAgIHdpZHRoOiBtaW4oNjAlLCAxMjgwcHgpO1xuICB9XG59XG4iXX0= */";
32
+ n(css,{});
33
+
34
+ var _globalProps$organiza;
35
+ var newInstallationParams = qs.stringify({
36
+ integrator_id: globalProps === null || globalProps === void 0 || (_globalProps$organiza = globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.id,
37
+ integrator_type: "Organization",
38
+ redirect_path: "/projects/new"
39
+ });
40
+ var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
41
+ var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
42
+
43
+ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
44
+ var isOpen = _ref.isOpen,
45
+ onClose = _ref.onClose,
46
+ _ref$isConnecting = _ref.isConnecting,
47
+ isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
48
+ _ref$isConnected = _ref.isConnected,
49
+ isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
50
+ _ref$installationUrl = _ref.installationUrl,
51
+ installationUrl = _ref$installationUrl === void 0 ? NEW_INSTALLATION_URL : _ref$installationUrl,
52
+ _ref$troubleshootUrl = _ref.troubleshootUrl,
53
+ troubleshootUrl = _ref$troubleshootUrl === void 0 ? TROUBLESHOOT_URL : _ref$troubleshootUrl,
54
+ _ref$onConnect = _ref.onConnect,
55
+ onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
56
+ _ref$projects = _ref.projects,
57
+ projects = _ref$projects === void 0 ? [] : _ref$projects,
58
+ _ref$title = _ref.title,
59
+ title = _ref$title === void 0 ? "" : _ref$title;
60
+ var _useTranslation = useTranslation(),
61
+ t = _useTranslation.t;
62
+ var initialFocusRef = useRef(null);
63
+ var _useFetchGithubReposi = useFetchGithubRepositories({
64
+ isConnected: isOpen && isConnected
65
+ }),
66
+ _useFetchGithubReposi2 = _useFetchGithubReposi.data,
67
+ _useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
68
+ _useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
69
+ repositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
70
+ _useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
71
+ accounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
72
+ isPaneLoading = _useFetchGithubReposi.isLoading;
73
+ var paneRepositories = repositories.filter(function (repository) {
74
+ return !findBy({
75
+ repository: repository.fullName
76
+ }, projects);
77
+ });
78
+ var paneAccounts = isConnected ? accounts : [];
79
+ return /*#__PURE__*/jsxs(Pane, {
80
+ initialFocusRef: initialFocusRef,
81
+ isOpen: isOpen,
82
+ onClose: onClose,
83
+ className: "neeto-github-modal-pane-wrapper",
84
+ size: "large",
85
+ children: [/*#__PURE__*/jsx(Pane.Header, {
86
+ children: /*#__PURE__*/jsx(Typography, {
87
+ style: "h2",
88
+ children: isPresent(title) ? title : t("neetoGithub.modal.title")
89
+ })
90
+ }), /*#__PURE__*/jsx(Pane.Body, {
91
+ children: /*#__PURE__*/jsx(NeetoGithubNanoContainer, {
92
+ installationUrl: installationUrl,
93
+ isConnected: isConnected,
94
+ isConnecting: isConnecting,
95
+ isPaneLoading: isPaneLoading,
96
+ onConnect: onConnect,
97
+ paneAccounts: paneAccounts,
98
+ paneRepositories: paneRepositories,
99
+ troubleshootUrl: troubleshootUrl,
100
+ isPane: true,
101
+ shouldFetchRepositories: false
102
+ })
103
+ })]
104
+ });
105
+ };
106
+
107
+ export { NeetoGithubNanoPane as default };
108
+ //# sourceMappingURL=NeetoGithubNanoPane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeetoGithubNanoPane.js","sources":["../app/javascript/src/components/NeetoGithubNanoPane/constants.js","../app/javascript/src/components/NeetoGithubNanoPane/index.jsx"],"sourcesContent":["import { globalProps } from \"neetocommons/initializers\";\nimport * as qs from \"qs\";\n\nconst newInstallationParams = qs.stringify({\n integrator_id: globalProps?.organization?.id,\n integrator_type: \"Organization\",\n redirect_path: \"/projects/new\",\n});\n\nexport const NEW_INSTALLATION_URL = `/github_integrations/app_installations/new?${newInstallationParams}`;\nexport const TROUBLESHOOT_URL =\n \"https://render.com/docs/github#troubleshooting\";\n","import { useRef } from \"react\";\n\nimport { findBy, isPresent, noop } from \"neetocist\";\nimport { Pane, Typography } from \"neetoui\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { useFetchGithubRepositories } from \"hooks/reactQuery/useGithubAccountsApi\";\nimport NeetoGithubNanoContainer from \"src/components/NeetoGithubNanoContainer\";\n// eslint-disable-next-line import/extensions\nimport \"stylesheets/components/pane.scss\";\n\nimport { NEW_INSTALLATION_URL, TROUBLESHOOT_URL } from \"./constants\";\n\nconst NeetoGithubNanoPane = ({\n isOpen,\n onClose,\n isConnecting = false,\n isConnected = false,\n installationUrl = NEW_INSTALLATION_URL,\n troubleshootUrl = TROUBLESHOOT_URL,\n onConnect = noop,\n projects = [],\n title = \"\",\n}) => {\n const { t } = useTranslation();\n\n const initialFocusRef = useRef(null);\n\n const {\n data: { repositories = [], accounts = [] } = {},\n isLoading: isPaneLoading,\n } = useFetchGithubRepositories({ isConnected: isOpen && isConnected });\n\n const paneRepositories = repositories.filter(\n repository => !findBy({ repository: repository.fullName }, projects)\n );\n\n const paneAccounts = isConnected ? accounts : [];\n\n return (\n <Pane\n {...{ initialFocusRef, isOpen, onClose }}\n className=\"neeto-github-modal-pane-wrapper\"\n size=\"large\"\n >\n <Pane.Header>\n <Typography style=\"h2\">\n {isPresent(title) ? title : t(\"neetoGithub.modal.title\")}\n </Typography>\n </Pane.Header>\n <Pane.Body>\n <NeetoGithubNanoContainer\n {...{\n installationUrl,\n isConnected,\n isConnecting,\n isPaneLoading,\n onConnect,\n paneAccounts,\n paneRepositories,\n troubleshootUrl,\n }}\n isPane\n shouldFetchRepositories={false}\n />\n </Pane.Body>\n </Pane>\n );\n};\n\nexport default NeetoGithubNanoPane;\n"],"names":["newInstallationParams","qs","stringify","integrator_id","globalProps","_globalProps$organiza","organization","id","integrator_type","redirect_path","NEW_INSTALLATION_URL","concat","TROUBLESHOOT_URL","NeetoGithubNanoPane","_ref","isOpen","onClose","_ref$isConnecting","isConnecting","_ref$isConnected","isConnected","_ref$installationUrl","installationUrl","_ref$troubleshootUrl","troubleshootUrl","_ref$onConnect","onConnect","noop","_ref$projects","projects","_ref$title","title","_useTranslation","useTranslation","t","initialFocusRef","useRef","_useFetchGithubReposi","useFetchGithubRepositories","_useFetchGithubReposi2","data","_useFetchGithubReposi3","_useFetchGithubReposi4","repositories","_useFetchGithubReposi5","accounts","isPaneLoading","isLoading","paneRepositories","filter","repository","findBy","fullName","paneAccounts","_jsxs","Pane","className","size","children","_jsx","Header","Typography","style","isPresent","Body","NeetoGithubNanoContainer","isPane","shouldFetchRepositories"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAMA,qBAAqB,GAAGC,EAAE,CAACC,SAAS,CAAC;AACzCC,EAAAA,aAAa,EAAEC,WAAW,KAAXA,IAAAA,IAAAA,WAAW,gBAAAC,qBAAA,GAAXD,WAAW,CAAEE,YAAY,MAAAD,IAAAA,IAAAA,qBAAA,KAAzBA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,qBAAA,CAA2BE,EAAE;AAC5CC,EAAAA,eAAe,EAAE,cAAc;AAC/BC,EAAAA,aAAa,EAAE;AACjB,CAAC,CAAC;AAEK,IAAMC,oBAAoB,GAAA,6CAAA,CAAAC,MAAA,CAAiDX,qBAAqB,CAAE;AAClG,IAAMY,gBAAgB,GAC3B,gDAAgD;;ACElD,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAAC,IAAA,EAUnB;AAAA,EAAA,IATJC,MAAM,GAAAD,IAAA,CAANC,MAAM;IACNC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IAAAC,iBAAA,GAAAH,IAAA,CACPI,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,iBAAA;IAAAE,gBAAA,GAAAL,IAAA,CACpBM,WAAW;AAAXA,IAAAA,WAAW,GAAAD,gBAAA,KAAG,KAAA,CAAA,GAAA,KAAK,GAAAA,gBA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0,0 +1,154 @@
1
+ 'use strict';
2
+
3
+ var Container = require('@bigbinary/neeto-molecules/Container');
4
+ var Header = require('@bigbinary/neeto-molecules/Header');
5
+ var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
6
+ var Button = require('@bigbinary/neetoui/Button');
7
+ var reactI18next = require('react-i18next');
8
+ var useGithubAccountsApi = require('../useGithubAccountsApi-C9W-L_-C.js');
9
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
10
+ var react = require('react');
11
+ var neetoCist = require('@bigbinary/neeto-cist');
12
+ var Table = require('@bigbinary/neetoui/Table');
13
+ var NoData = require('@bigbinary/neetoui/NoData');
14
+ var Alert = require('@bigbinary/neetoui/Alert');
15
+ var ramda = require('ramda');
16
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
17
+ var i18next = require('i18next');
18
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
19
+ var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
20
+ var Typography = require('@bigbinary/neetoui/Typography');
21
+ var jsxRuntime = require('react/jsx-runtime');
22
+ require('@babel/runtime/helpers/toConsumableArray');
23
+ require('@tanstack/react-query');
24
+ require('@bigbinary/neeto-commons-frontend/initializers');
25
+ require('@bigbinary/neeto-commons-frontend/react-utils');
26
+ require('axios');
27
+ require('@bigbinary/neeto-commons-frontend/constants');
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; }
31
+ var getNewInstallationUrl = function getNewInstallationUrl(integratorParams, redirectPath) {
32
+ return utils.buildUrl("/github_integrations/app_installations/new", _objectSpread(_objectSpread({}, integratorParams), {}, {
33
+ redirectPath: redirectPath
34
+ }));
35
+ };
36
+ var getGithubAccountsTableColumnData = function getGithubAccountsTableColumnData(_ref) {
37
+ var setAccountToDisconnect = _ref.setAccountToDisconnect;
38
+ return [{
39
+ title: i18next.t("neetoGithub.account"),
40
+ dataIndex: "",
41
+ key: "actions",
42
+ render: function render(_, account) {
43
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
44
+ className: "flex items-center justify-between gap-x-3",
45
+ children: [/*#__PURE__*/jsxRuntime.jsx(Typography, {
46
+ children: account.accountLogin
47
+ }), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
48
+ dropdownProps: {
49
+ strategy: "fixed"
50
+ },
51
+ menuItems: [{
52
+ key: "delete",
53
+ label: i18next.t("neetoGithub.actions.delete"),
54
+ onClick: function onClick() {
55
+ return setAccountToDisconnect(account);
56
+ }
57
+ }]
58
+ })]
59
+ });
60
+ }
61
+ }];
62
+ };
63
+
64
+ var AccountsTable = function AccountsTable(_ref) {
65
+ var _ref$appInstallations = _ref.appInstallations,
66
+ appInstallations = _ref$appInstallations === void 0 ? [] : _ref$appInstallations,
67
+ integratorParams = _ref.integratorParams,
68
+ keysToPurgeOnDelete = _ref.keysToPurgeOnDelete;
69
+ var _useTranslation = reactI18next.useTranslation(),
70
+ t = _useTranslation.t;
71
+ var _useState = react.useState({}),
72
+ _useState2 = _slicedToArray(_useState, 2),
73
+ accountToDisconnect = _useState2[0],
74
+ setAccountToDisconnect = _useState2[1];
75
+ var _useDestroyGithubInte = useGithubAccountsApi.useDestroyGithubIntegration(integratorParams, keysToPurgeOnDelete, {
76
+ onSuccess: function onSuccess() {
77
+ return setAccountToDisconnect({});
78
+ }
79
+ }),
80
+ deleteGithubAccount = _useDestroyGithubInte.mutate,
81
+ isDeleting = _useDestroyGithubInte.isPending;
82
+ if (ramda.isEmpty(appInstallations)) {
83
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
84
+ className: "flex h-full w-full items-center justify-center",
85
+ children: /*#__PURE__*/jsxRuntime.jsx(NoData, {
86
+ title: t("neetoGithub.integrationTable.noIntegrationFound")
87
+ })
88
+ });
89
+ }
90
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
91
+ children: [/*#__PURE__*/jsxRuntime.jsx(Table, {
92
+ rowData: appInstallations,
93
+ columnData: getGithubAccountsTableColumnData({
94
+ setAccountToDisconnect: setAccountToDisconnect
95
+ })
96
+ }), /*#__PURE__*/jsxRuntime.jsx(Alert, {
97
+ isOpen: neetoCist.isNotEmpty(accountToDisconnect),
98
+ isSubmitting: isDeleting,
99
+ submitButtonLabel: t("neetoGithub.disconnectGitHub"),
100
+ title: t("neetoGithub.integrationTable.alert.title"),
101
+ message: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
102
+ i18nKey: "neetoGithub.integrationTable.alert.message",
103
+ values: {
104
+ login: accountToDisconnect === null || accountToDisconnect === void 0 ? void 0 : accountToDisconnect.accountLogin
105
+ }
106
+ }),
107
+ onClose: function onClose() {
108
+ return setAccountToDisconnect({});
109
+ },
110
+ onSubmit: function onSubmit() {
111
+ return deleteGithubAccount(accountToDisconnect === null || accountToDisconnect === void 0 ? void 0 : accountToDisconnect.id);
112
+ }
113
+ })]
114
+ });
115
+ };
116
+
117
+ var NeetoGithubIntegrationsTable = function NeetoGithubIntegrationsTable(_ref) {
118
+ var _ref$breadcrumbs = _ref.breadcrumbs,
119
+ breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
120
+ integratorParams = _ref.integratorParams,
121
+ redirectPath = _ref.redirectPath,
122
+ _ref$keysToPurgeOnDel = _ref.keysToPurgeOnDelete,
123
+ keysToPurgeOnDelete = _ref$keysToPurgeOnDel === void 0 ? [] : _ref$keysToPurgeOnDel;
124
+ var _useTranslation = reactI18next.useTranslation(),
125
+ t = _useTranslation.t;
126
+ var _useFetchGithubAppIns = useGithubAccountsApi.useFetchGithubAppInstallations(integratorParams),
127
+ _useFetchGithubAppIns2 = _useFetchGithubAppIns.data,
128
+ appInstallations = _useFetchGithubAppIns2 === void 0 ? [] : _useFetchGithubAppIns2,
129
+ isLoading = _useFetchGithubAppIns.isLoading;
130
+ var newInstallationUrl = getNewInstallationUrl(integratorParams, redirectPath);
131
+ if (isLoading) {
132
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
133
+ className: "flex h-screen w-screen items-center justify-center",
134
+ children: /*#__PURE__*/jsxRuntime.jsx(PageLoader, {})
135
+ });
136
+ }
137
+ return /*#__PURE__*/jsxRuntime.jsxs(Container, {
138
+ children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
139
+ breadcrumbs: breadcrumbs,
140
+ title: t("neetoGithub.github"),
141
+ actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button, {
142
+ href: newInstallationUrl,
143
+ label: t("neetoGithub.connectGithub")
144
+ })
145
+ }), /*#__PURE__*/jsxRuntime.jsx(AccountsTable, {
146
+ appInstallations: appInstallations,
147
+ integratorParams: integratorParams,
148
+ keysToPurgeOnDelete: keysToPurgeOnDelete
149
+ })]
150
+ });
151
+ };
152
+
153
+ module.exports = NeetoGithubIntegrationsTable;
154
+ //# sourceMappingURL=NeetoGithubIntegrationsTable.js.map
@@ -0,0 +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,cAAQ,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,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;AAAA,MAAA,oBACjBC,eAAA,CAAA,KAAA,EAAA;AAAKC,QAAAA,SAAS,EAAC,2CAA2C;QAAAC,QAAA,EAAA,cACxDC,cAAA,CAACC,UAAU,EAAA;UAAAF,QAAA,EAAEH,OAAO,CAACM;AAAY,SAAa,CAAC,eAC/CF,cAAA,CAACG,YAAY,EAAA;AACXC,UAAAA,aAAa,EAAE;AAAEC,YAAAA,QAAQ,EAAE;WAAU;AACrCC,UAAAA,SAAS,EAAE,CACT;AACEb,YAAAA,GAAG,EAAE,QAAQ;AACbc,YAAAA,KAAK,EAAEhB,SAAC,CAAC,4BAA4B,C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OACrC;AACF,KACF,CAAC,eACFS,cAAA,CAACS,aAAa,EAAA;AACNE,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAAE5B,MAAAA,gBAAgB,EAAhBA,gBAAgB;AAAE6B,MAAAA,mBAAmB,EAAnBA;AAAmB,KAC9D,CAAC;AAAA,GACO,CAAC;AAEhB;;;;"}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ require('classnames');
4
+ require('@bigbinary/neeto-commons-frontend/initializers');
5
+ require('@bigbinary/neetoui/Spinner');
6
+ require('../useGithubAccountsApi-C9W-L_-C.js');
7
+ var NeetoGithubNanoContainer = require('../index-TIidDz1A.js');
8
+ require('react/jsx-runtime');
9
+ require('@babel/runtime/helpers/toConsumableArray');
10
+ require('@babel/runtime/helpers/defineProperty');
11
+ require('@tanstack/react-query');
12
+ require('@bigbinary/neeto-commons-frontend/react-utils');
13
+ require('ramda');
14
+ require('axios');
15
+ require('@bigbinary/neeto-commons-frontend/constants');
16
+ require('@bigbinary/neeto-icons/misc/Github');
17
+ require('@bigbinary/neetoui/Typography');
18
+ require('@bigbinary/neeto-icons/Building');
19
+ require('@bigbinary/neetoui/Avatar');
20
+ require('@bigbinary/neetoui/Button');
21
+ require('@bigbinary/neeto-icons/Plus');
22
+ require('@bigbinary/neeto-icons/Settings');
23
+ require('@babel/runtime/helpers/slicedToArray');
24
+ require('react');
25
+ require('@bigbinary/neeto-cist');
26
+ require('@bigbinary/neeto-molecules/Search');
27
+ require('react-i18next');
28
+ require('@bigbinary/neeto-icons/Lock');
29
+ require('@bigbinary/neeto-molecules/DateFormat');
30
+
31
+
32
+
33
+ module.exports = NeetoGithubNanoContainer.NeetoGithubNanoContainer;
34
+ //# sourceMappingURL=NeetoGithubNanoContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NeetoGithubNanoContainer.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}