@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.
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+ var neetoCist = require('@bigbinary/neeto-cist');
5
+ var Pane = require('@bigbinary/neetoui/Pane');
6
+ var Typography = require('@bigbinary/neetoui/Typography');
7
+ var reactI18next = require('react-i18next');
8
+ var useGithubAccountsApi = require('../useGithubAccountsApi-C9W-L_-C.js');
9
+ var NeetoGithubNanoContainer = require('../index-TIidDz1A.js');
10
+ var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
11
+ var qs = require('qs');
12
+ var jsxRuntime = require('react/jsx-runtime');
13
+ require('@babel/runtime/helpers/toConsumableArray');
14
+ require('@babel/runtime/helpers/defineProperty');
15
+ require('@tanstack/react-query');
16
+ require('@bigbinary/neeto-commons-frontend/react-utils');
17
+ require('ramda');
18
+ require('axios');
19
+ require('@bigbinary/neeto-commons-frontend/constants');
20
+ require('classnames');
21
+ require('@bigbinary/neetoui/Spinner');
22
+ require('@bigbinary/neeto-icons/misc/Github');
23
+ require('@bigbinary/neeto-icons/Building');
24
+ require('@bigbinary/neetoui/Avatar');
25
+ require('@bigbinary/neetoui/Button');
26
+ require('@bigbinary/neeto-icons/Plus');
27
+ require('@bigbinary/neeto-icons/Settings');
28
+ require('@babel/runtime/helpers/slicedToArray');
29
+ require('@bigbinary/neeto-molecules/Search');
30
+ require('@bigbinary/neeto-icons/Lock');
31
+ require('@bigbinary/neeto-molecules/DateFormat');
32
+
33
+ function _interopNamespaceDefault(e) {
34
+ var n = Object.create(null);
35
+ if (e) {
36
+ Object.keys(e).forEach(function (k) {
37
+ if (k !== 'default') {
38
+ var d = Object.getOwnPropertyDescriptor(e, k);
39
+ Object.defineProperty(n, k, d.get ? d : {
40
+ enumerable: true,
41
+ get: function () { return e[k]; }
42
+ });
43
+ }
44
+ });
45
+ }
46
+ n.default = e;
47
+ return Object.freeze(n);
48
+ }
49
+
50
+ var qs__namespace = /*#__PURE__*/_interopNamespaceDefault(qs);
51
+
52
+ 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= */";
53
+ NeetoGithubNanoContainer.n(css,{});
54
+
55
+ var _globalProps$organiza;
56
+ var newInstallationParams = qs__namespace.stringify({
57
+ integrator_id: initializers.globalProps === null || initializers.globalProps === void 0 || (_globalProps$organiza = initializers.globalProps.organization) === null || _globalProps$organiza === void 0 ? void 0 : _globalProps$organiza.id,
58
+ integrator_type: "Organization",
59
+ redirect_path: "/projects/new"
60
+ });
61
+ var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
62
+ var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
63
+
64
+ var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
65
+ var isOpen = _ref.isOpen,
66
+ onClose = _ref.onClose,
67
+ _ref$isConnecting = _ref.isConnecting,
68
+ isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
69
+ _ref$isConnected = _ref.isConnected,
70
+ isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
71
+ _ref$installationUrl = _ref.installationUrl,
72
+ installationUrl = _ref$installationUrl === void 0 ? NEW_INSTALLATION_URL : _ref$installationUrl,
73
+ _ref$troubleshootUrl = _ref.troubleshootUrl,
74
+ troubleshootUrl = _ref$troubleshootUrl === void 0 ? TROUBLESHOOT_URL : _ref$troubleshootUrl,
75
+ _ref$onConnect = _ref.onConnect,
76
+ onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
77
+ _ref$projects = _ref.projects,
78
+ projects = _ref$projects === void 0 ? [] : _ref$projects,
79
+ _ref$title = _ref.title,
80
+ title = _ref$title === void 0 ? "" : _ref$title;
81
+ var _useTranslation = reactI18next.useTranslation(),
82
+ t = _useTranslation.t;
83
+ var initialFocusRef = react.useRef(null);
84
+ var _useFetchGithubReposi = useGithubAccountsApi.useFetchGithubRepositories({
85
+ isConnected: isOpen && isConnected
86
+ }),
87
+ _useFetchGithubReposi2 = _useFetchGithubReposi.data,
88
+ _useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
89
+ _useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
90
+ repositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
91
+ _useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
92
+ accounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
93
+ isPaneLoading = _useFetchGithubReposi.isLoading;
94
+ var paneRepositories = repositories.filter(function (repository) {
95
+ return !neetoCist.findBy({
96
+ repository: repository.fullName
97
+ }, projects);
98
+ });
99
+ var paneAccounts = isConnected ? accounts : [];
100
+ return /*#__PURE__*/jsxRuntime.jsxs(Pane, {
101
+ initialFocusRef: initialFocusRef,
102
+ isOpen: isOpen,
103
+ onClose: onClose,
104
+ className: "neeto-github-modal-pane-wrapper",
105
+ size: "large",
106
+ children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Header, {
107
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography, {
108
+ style: "h2",
109
+ children: neetoCist.isPresent(title) ? title : t("neetoGithub.modal.title")
110
+ })
111
+ }), /*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
112
+ children: /*#__PURE__*/jsxRuntime.jsx(NeetoGithubNanoContainer.NeetoGithubNanoContainer, {
113
+ installationUrl: installationUrl,
114
+ isConnected: isConnected,
115
+ isConnecting: isConnecting,
116
+ isPaneLoading: isPaneLoading,
117
+ onConnect: onConnect,
118
+ paneAccounts: paneAccounts,
119
+ paneRepositories: paneRepositories,
120
+ troubleshootUrl: troubleshootUrl,
121
+ isPane: true,
122
+ shouldFetchRepositories: false
123
+ })
124
+ })]
125
+ });
126
+ };
127
+
128
+ module.exports = NeetoGithubNanoPane;
129
+ //# 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,aAAE,CAACC,SAAS,CAAC;AACzCC,EAAAA,aAAa,EAAEC,wBAAW,KAAXA,IAAAA,IAAAA,wBAAW,gBAAAC,qBAAA,GAAXD,wBAAW,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,gBAAA;IAAAE,oBAAA,GAAAP,IAAA,CACnBQ,eAAe;AAAfA,IAAAA,eAAe,GAAAD,oBAAA,KAAGX,KAAAA,CAAAA,GAAA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ainer = require('../index-TIidDz1A.js');
5
+ var NeetoGithubNanoPane = require('./NeetoGithubNanoPane.js');
6
+ require('@bigbinary/neeto-molecules/Container');
7
+ require('@bigbinary/neeto-molecules/Header');
8
+ require('@bigbinary/neeto-molecules/PageLoader');
9
+ require('@bigbinary/neetoui/Button');
10
+ require('react-i18next');
11
+ require('../useGithubAccountsApi-C9W-L_-C.js');
12
+ require('@babel/runtime/helpers/toConsumableArray');
13
+ require('@babel/runtime/helpers/defineProperty');
14
+ require('@tanstack/react-query');
15
+ require('@bigbinary/neeto-commons-frontend/initializers');
16
+ require('@bigbinary/neeto-commons-frontend/react-utils');
17
+ require('ramda');
18
+ require('axios');
19
+ require('@bigbinary/neeto-commons-frontend/constants');
20
+ require('@babel/runtime/helpers/slicedToArray');
21
+ require('react');
22
+ require('@bigbinary/neeto-cist');
23
+ require('@bigbinary/neetoui/Table');
24
+ require('@bigbinary/neetoui/NoData');
25
+ require('@bigbinary/neetoui/Alert');
26
+ require('i18next');
27
+ require('@bigbinary/neeto-commons-frontend/utils');
28
+ require('@bigbinary/neeto-molecules/MoreDropdown');
29
+ require('@bigbinary/neetoui/Typography');
30
+ require('react/jsx-runtime');
31
+ require('classnames');
32
+ require('@bigbinary/neetoui/Spinner');
33
+ require('@bigbinary/neeto-icons/misc/Github');
34
+ require('@bigbinary/neeto-icons/Building');
35
+ require('@bigbinary/neetoui/Avatar');
36
+ require('@bigbinary/neeto-icons/Plus');
37
+ require('@bigbinary/neeto-icons/Settings');
38
+ require('@bigbinary/neeto-molecules/Search');
39
+ require('@bigbinary/neeto-icons/Lock');
40
+ require('@bigbinary/neeto-molecules/DateFormat');
41
+ require('@bigbinary/neetoui/Pane');
42
+ require('qs');
43
+
44
+
45
+
46
+ exports.NeetoGithubIntegrationsTable = NeetoGithubIntegrationsTable;
47
+ exports.NeetoGithubNanoContainer = NeetoGithubNanoContainer.NeetoGithubNanoContainer;
48
+ exports.NeetoGithubNanoPane = NeetoGithubNanoPane;
49
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,439 @@
1
+ import classnames from 'classnames';
2
+ import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
3
+ import Spinner from '@bigbinary/neetoui/Spinner';
4
+ import { u as useFetchGithubRepositories } from './useGithubAccountsApi-kFn8BvEJ.js';
5
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
6
+ import Github from '@bigbinary/neeto-icons/misc/Github';
7
+ import Typography from '@bigbinary/neetoui/Typography';
8
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
9
+ import Building from '@bigbinary/neeto-icons/Building';
10
+ import Avatar from '@bigbinary/neetoui/Avatar';
11
+ import Button from '@bigbinary/neetoui/Button';
12
+ import Plus from '@bigbinary/neeto-icons/Plus';
13
+ import Settings from '@bigbinary/neeto-icons/Settings';
14
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
15
+ import { useState, createElement } from 'react';
16
+ import { isPresent } from '@bigbinary/neeto-cist';
17
+ import Search from '@bigbinary/neeto-molecules/Search';
18
+ import { Trans, useTranslation } from 'react-i18next';
19
+ import Lock from '@bigbinary/neeto-icons/Lock';
20
+ import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
21
+
22
+ var Header = withT(function (_ref) {
23
+ var t = _ref.t;
24
+ return /*#__PURE__*/jsxs("div", {
25
+ className: "neeto-ui-text-gray-800 mb-1 flex w-full flex-row items-center space-x-2 font-sans text-lg font-medium leading-6 antialiased",
26
+ children: [/*#__PURE__*/jsx(Github, {
27
+ size: 16
28
+ }), /*#__PURE__*/jsx(Typography, {
29
+ style: "h4",
30
+ children: t("neetoGithub.github")
31
+ })]
32
+ });
33
+ });
34
+
35
+ var Configure = withT(function (_ref) {
36
+ var t = _ref.t,
37
+ isConnected = _ref.isConnected,
38
+ installationUrl = _ref.installationUrl;
39
+ return /*#__PURE__*/jsx("div", {
40
+ className: "neeto-ui-text-gray-900 flex-shrink-0 font-sans text-sm font-normal leading-6 antialiased",
41
+ children: /*#__PURE__*/jsx(Button, {
42
+ href: installationUrl,
43
+ icon: isConnected ? Settings : Plus,
44
+ iconPosition: "left",
45
+ iconSize: 20,
46
+ size: "small",
47
+ style: "link",
48
+ children: isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")
49
+ })
50
+ });
51
+ });
52
+
53
+ var List$1 = withT(function (_ref) {
54
+ var t = _ref.t,
55
+ accounts = _ref.accounts,
56
+ isConnected = _ref.isConnected,
57
+ installationUrl = _ref.installationUrl,
58
+ isPane = _ref.isPane;
59
+ return /*#__PURE__*/jsxs("div", {
60
+ className: classnames("neeto-ui-border-gray-300 flex justify-between gap-3 border-b pb-4 pt-2", {
61
+ "flex-col md:flex-row": isPane,
62
+ "flex-col": !isPane
63
+ }),
64
+ children: [accounts.map(function (_ref2) {
65
+ var id = _ref2.id,
66
+ name = _ref2.name,
67
+ avatarUrl = _ref2.avatarUrl,
68
+ type = _ref2.type,
69
+ profileUrl = _ref2.profileUrl,
70
+ count = _ref2.count;
71
+ return /*#__PURE__*/jsxs("div", {
72
+ className: "flex w-full items-center space-x-2",
73
+ children: [/*#__PURE__*/jsxs("div", {
74
+ className: "flex items-center gap-1",
75
+ children: [type === "Organization" ? /*#__PURE__*/jsx(Building, {
76
+ className: "neeto-ui-text-gray-600",
77
+ size: 24
78
+ }) : /*#__PURE__*/jsx(Avatar, {
79
+ size: "small",
80
+ user: {
81
+ imageUrl: avatarUrl
82
+ }
83
+ }), /*#__PURE__*/jsx(Typography, {
84
+ className: "neeto-ui-text-gray-800",
85
+ style: "body2",
86
+ children: /*#__PURE__*/jsx(Button, {
87
+ className: "neeto-ui-text-gray-800",
88
+ label: "@".concat(name),
89
+ style: "link",
90
+ onClick: function onClick() {
91
+ return window.open(profileUrl, "_blank");
92
+ }
93
+ })
94
+ })]
95
+ }), /*#__PURE__*/jsx("span", {
96
+ className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
97
+ }), /*#__PURE__*/jsx(Typography, {
98
+ className: "neeto-ui-text-black",
99
+ style: "body2",
100
+ children: t("neetoGithub.countOf.repos", {
101
+ count: count
102
+ })
103
+ })]
104
+ }, id);
105
+ }), /*#__PURE__*/jsx(Configure, {
106
+ installationUrl: installationUrl,
107
+ isConnected: isConnected
108
+ })]
109
+ });
110
+ });
111
+
112
+ var Accounts = function Accounts(_ref) {
113
+ var isPane = _ref.isPane,
114
+ accounts = _ref.accounts,
115
+ isConnected = _ref.isConnected,
116
+ onConnect = _ref.onConnect,
117
+ installationUrl = _ref.installationUrl;
118
+ return /*#__PURE__*/jsx("div", {
119
+ className: classnames("flex w-full flex-col border border-solid border-transparent px-0 py-2", {
120
+ "order-1": isPane,
121
+ "md:order-2 md:max-w-72 lg:max-w-sm lg:px-6": !isPane
122
+ }),
123
+ children: /*#__PURE__*/jsxs("div", {
124
+ className: "mb-2",
125
+ children: [/*#__PURE__*/jsx(Header, {}), /*#__PURE__*/jsx(List$1, {
126
+ accounts: accounts,
127
+ installationUrl: installationUrl,
128
+ isConnected: isConnected,
129
+ isPane: isPane,
130
+ onConnect: onConnect
131
+ })]
132
+ })
133
+ });
134
+ };
135
+
136
+ var NoRepositories = withT(function (_ref) {
137
+ var t = _ref.t,
138
+ installationUrl = _ref.installationUrl,
139
+ troubleshootUrl = _ref.troubleshootUrl;
140
+ return /*#__PURE__*/jsx("div", {
141
+ className: "flex items-center justify-center py-6",
142
+ children: /*#__PURE__*/jsxs("div", {
143
+ className: "mx-auto flex w-full max-w-sm flex-col items-center justify-center space-y-4 py-4 text-center",
144
+ children: [/*#__PURE__*/jsx(Typography, {
145
+ style: "body2",
146
+ children: t("neetoGithub.noReposDescription")
147
+ }), /*#__PURE__*/jsx(Button, {
148
+ href: installationUrl,
149
+ icon: Github,
150
+ iconPosition: "left",
151
+ label: t("neetoGithub.connectRepository"),
152
+ size: "medium",
153
+ style: "primary"
154
+ }), /*#__PURE__*/jsx("div", {
155
+ className: "text-xs",
156
+ children: /*#__PURE__*/jsx(Trans, {
157
+ i18nKey: t("neetoGithub.troubleshoot"),
158
+ components: {
159
+ troubleshootLink: /*#__PURE__*/jsx("a", {
160
+ className: "text-indigo-600 underline",
161
+ href: troubleshootUrl,
162
+ rel: "noopener noreferrer",
163
+ target: "_blank"
164
+ })
165
+ }
166
+ })
167
+ })]
168
+ })
169
+ });
170
+ });
171
+
172
+ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
173
+
174
+ var css = ".width-calc{width:100%}@media (min-width:768px){.width-calc{width:calc(100% - 82px)}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvcmVwb3NpdG9yeS10aWxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsWUFDRSxVQUNGLENBQ0UseUJBSEYsWUFJSSx1QkFFRixDQUNGIiwic291cmNlc0NvbnRlbnQiOlsiLndpZHRoLWNhbGMge1xuICB3aWR0aDogMTAwJTtcblxuICBAc2NyZWVuIG1kIHtcbiAgICB3aWR0aDogY2FsYygxMDAlIC0gODJweCk7XG4gIH1cbn1cbiJdfQ== */";
175
+ n(css,{});
176
+
177
+ var RepositoryTile = function RepositoryTile(_ref) {
178
+ var isConnecting = _ref.isConnecting,
179
+ onConnect = _ref.onConnect,
180
+ repository = _ref.repository;
181
+ var _useTranslation = useTranslation(),
182
+ t = _useTranslation.t;
183
+ var _useState = useState(false),
184
+ _useState2 = _slicedToArray(_useState, 2),
185
+ isLoading = _useState2[0],
186
+ setIsLoading = _useState2[1];
187
+ var id = repository.id,
188
+ fullName = repository.fullName,
189
+ isPrivate = repository.isPrivate,
190
+ updatedAt = repository.updatedAt;
191
+ return /*#__PURE__*/jsxs("div", {
192
+ className: "neeto-ui-border-gray-300 flex flex-col justify-between gap-3 border-b border-solid py-3 pl-3 pr-3 last:border-b-0 md:flex-row md:items-center md:pl-5",
193
+ children: [/*#__PURE__*/jsxs("div", {
194
+ className: "width-calc flex items-center space-x-2",
195
+ children: [/*#__PURE__*/jsx(Github, {
196
+ className: "flex-shrink-0",
197
+ size: 16
198
+ }), /*#__PURE__*/jsx(Typography, {
199
+ style: "body2",
200
+ children: fullName
201
+ }), isPrivate && /*#__PURE__*/jsx(Lock, {
202
+ className: "flex-shrink-0",
203
+ size: 16
204
+ }), /*#__PURE__*/jsxs("div", {
205
+ className: "hidden lg:inline-block",
206
+ children: [/*#__PURE__*/jsx("span", {
207
+ className: "neeto-ui-bg-gray-800 neeto-ui-rounded-full h-1 w-1"
208
+ }), /*#__PURE__*/jsx(DateFormat.FromNow, {
209
+ date: updatedAt
210
+ })]
211
+ })]
212
+ }), /*#__PURE__*/jsx(Button, {
213
+ className: "w-max",
214
+ disabled: isConnecting,
215
+ loading: isLoading,
216
+ style: "primary",
217
+ type: "button",
218
+ onClick: function onClick() {
219
+ return onConnect({
220
+ repoType: "private",
221
+ repository: repository,
222
+ setIsLoading: setIsLoading
223
+ });
224
+ },
225
+ children: t("neetoGithub.connect")
226
+ })]
227
+ }, id);
228
+ };
229
+
230
+ var List = withT(function (_ref) {
231
+ var t = _ref.t,
232
+ filteredRepositories = _ref.filteredRepositories,
233
+ repositories = _ref.repositories,
234
+ isConnecting = _ref.isConnecting,
235
+ onConnect = _ref.onConnect,
236
+ installationUrl = _ref.installationUrl,
237
+ troubleshootUrl = _ref.troubleshootUrl;
238
+ return /*#__PURE__*/jsx("div", {
239
+ className: "h-full overflow-y-scroll px-4 pb-4 md:px-6 md:pb-6",
240
+ children: isPresent(repositories) ? /*#__PURE__*/jsx("div", {
241
+ className: classnames("neeto-ui-border-gray-300 neeto-ui-rounded-md flex flex-col items-center justify-center border", {
242
+ "h-auto": isPresent(filteredRepositories),
243
+ "h-full": !isPresent(filteredRepositories)
244
+ }),
245
+ children: /*#__PURE__*/jsx("div", {
246
+ className: "m-0 h-full w-full p-0",
247
+ children: isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
248
+ return /*#__PURE__*/createElement(RepositoryTile, {
249
+ isConnecting: isConnecting,
250
+ onConnect: onConnect,
251
+ repository: repository,
252
+ key: index
253
+ });
254
+ }) : /*#__PURE__*/jsx(Typography, {
255
+ className: "flex h-full w-full items-center justify-center",
256
+ style: "body2",
257
+ children: t("neetoGithub.noRepos")
258
+ })
259
+ })
260
+ }) : /*#__PURE__*/jsx(NoRepositories, {
261
+ installationUrl: installationUrl,
262
+ troubleshootUrl: troubleshootUrl
263
+ })
264
+ });
265
+ });
266
+
267
+ var NotConnected = withT(function (_ref) {
268
+ var t = _ref.t,
269
+ installationUrl = _ref.installationUrl;
270
+ return /*#__PURE__*/jsxs("div", {
271
+ className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center",
272
+ children: [/*#__PURE__*/jsx(Typography, {
273
+ style: "body2",
274
+ children: t("neetoGithub.notConnectedDescription", {
275
+ appName: globalProps.appName
276
+ })
277
+ }), /*#__PURE__*/jsx(Button, {
278
+ href: installationUrl,
279
+ icon: Github,
280
+ iconPosition: "left",
281
+ label: t("neetoGithub.connectGithub"),
282
+ size: "medium",
283
+ style: "primary"
284
+ })]
285
+ });
286
+ });
287
+
288
+ var Private = function Private(_ref) {
289
+ var isConnected = _ref.isConnected,
290
+ isConnecting = _ref.isConnecting,
291
+ repositories = _ref.repositories,
292
+ onConnect = _ref.onConnect,
293
+ installationUrl = _ref.installationUrl,
294
+ troubleshootUrl = _ref.troubleshootUrl;
295
+ var _useTranslation = useTranslation(),
296
+ t = _useTranslation.t;
297
+ var _useState = useState(repositories),
298
+ _useState2 = _slicedToArray(_useState, 2),
299
+ filteredRepositories = _useState2[0],
300
+ setFilteredRepositories = _useState2[1];
301
+ var onSearch = function onSearch(searchTerm) {
302
+ if (!isPresent(searchTerm)) {
303
+ setFilteredRepositories(repositories);
304
+ return;
305
+ }
306
+ var filteredRepositories = repositories.filter(function (_ref2) {
307
+ var fullName = _ref2.fullName;
308
+ return fullName.toLowerCase().includes(searchTerm.toLowerCase());
309
+ });
310
+ setFilteredRepositories(filteredRepositories);
311
+ };
312
+ return /*#__PURE__*/jsx("div", {
313
+ className: "connect-repo flex h-full flex-col",
314
+ children: isConnected ? /*#__PURE__*/jsxs(Fragment, {
315
+ children: [/*#__PURE__*/jsxs("div", {
316
+ className: "space-y-3 p-4 md:p-6",
317
+ children: [/*#__PURE__*/jsx(Typography, {
318
+ className: "flex-shrink-0 text-lg font-medium",
319
+ style: "h2",
320
+ children: t("neetoGithub.connectARepo")
321
+ }), isPresent(repositories) && /*#__PURE__*/jsx(Search, {
322
+ onSearch: onSearch,
323
+ className: "w-full",
324
+ unlimitedChars: false,
325
+ suffix: /*#__PURE__*/jsx(Typography, {
326
+ style: "body2",
327
+ children: t("neetoGithub.countOf.repos", {
328
+ count: filteredRepositories.length
329
+ })
330
+ })
331
+ })]
332
+ }), /*#__PURE__*/jsx("div", {
333
+ className: "flex min-h-0 w-full flex-grow flex-col space-y-6",
334
+ children: /*#__PURE__*/jsx(List, {
335
+ filteredRepositories: filteredRepositories,
336
+ installationUrl: installationUrl,
337
+ isConnecting: isConnecting,
338
+ onConnect: onConnect,
339
+ repositories: repositories,
340
+ troubleshootUrl: troubleshootUrl
341
+ })
342
+ })]
343
+ }) : /*#__PURE__*/jsx("div", {
344
+ className: "neeto-ui-text-gray-900 flex-grow font-sans text-sm font-normal leading-6 antialiased",
345
+ children: /*#__PURE__*/jsx("div", {
346
+ className: "flex h-full flex-col items-center justify-center p-4",
347
+ children: /*#__PURE__*/jsx(NotConnected, {
348
+ installationUrl: installationUrl
349
+ })
350
+ })
351
+ })
352
+ });
353
+ };
354
+
355
+ var Repositories = function Repositories(_ref) {
356
+ var isConnected = _ref.isConnected,
357
+ isConnecting = _ref.isConnecting,
358
+ repositories = _ref.repositories,
359
+ onConnect = _ref.onConnect,
360
+ installationUrl = _ref.installationUrl,
361
+ troubleshootUrl = _ref.troubleshootUrl,
362
+ isPane = _ref.isPane;
363
+ return /*#__PURE__*/jsx("div", {
364
+ className: classnames("neeto-ui-rounded-md neeto-ui-border-gray-300 h-full w-full space-y-6 border border-solid", {
365
+ "order-2": isPane,
366
+ "order-1": !isPane
367
+ }),
368
+ children: /*#__PURE__*/jsx(Private, {
369
+ installationUrl: installationUrl,
370
+ isConnected: isConnected,
371
+ isConnecting: isConnecting,
372
+ onConnect: onConnect,
373
+ repositories: repositories,
374
+ troubleshootUrl: troubleshootUrl
375
+ })
376
+ });
377
+ };
378
+
379
+ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
380
+ var _ref$isPaneLoading = _ref.isPaneLoading,
381
+ isPaneLoading = _ref$isPaneLoading === void 0 ? false : _ref$isPaneLoading,
382
+ _ref$shouldFetchRepos = _ref.shouldFetchRepositories,
383
+ shouldFetchRepositories = _ref$shouldFetchRepos === void 0 ? true : _ref$shouldFetchRepos,
384
+ _ref$paneAccounts = _ref.paneAccounts,
385
+ paneAccounts = _ref$paneAccounts === void 0 ? [] : _ref$paneAccounts,
386
+ installationUrl = _ref.installationUrl,
387
+ isConnected = _ref.isConnected,
388
+ _ref$isConnecting = _ref.isConnecting,
389
+ isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
390
+ onConnect = _ref.onConnect,
391
+ _ref$paneRepositories = _ref.paneRepositories,
392
+ paneRepositories = _ref$paneRepositories === void 0 ? [] : _ref$paneRepositories,
393
+ troubleshootUrl = _ref.troubleshootUrl,
394
+ _ref$isPane = _ref.isPane,
395
+ isPane = _ref$isPane === void 0 ? false : _ref$isPane;
396
+ var _useFetchGithubReposi = useFetchGithubRepositories({
397
+ isConnected: shouldFetchRepositories && globalProps.isGithubIntegrated
398
+ }),
399
+ _useFetchGithubReposi2 = _useFetchGithubReposi.data,
400
+ _useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
401
+ _useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
402
+ containerRepositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
403
+ _useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
404
+ containerAccounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
405
+ isContainerLoading = _useFetchGithubReposi.isLoading;
406
+ var repositories = shouldFetchRepositories ? containerRepositories : paneRepositories;
407
+ var accounts = shouldFetchRepositories ? containerAccounts : paneAccounts;
408
+ var isLoading = shouldFetchRepositories ? isContainerLoading : isPaneLoading;
409
+ if (isLoading) {
410
+ return /*#__PURE__*/jsx("div", {
411
+ className: "flex h-full w-full items-center justify-center",
412
+ children: /*#__PURE__*/jsx(Spinner, {})
413
+ });
414
+ }
415
+ return /*#__PURE__*/jsxs("div", {
416
+ className: classnames("flex min-h-0 w-full flex-grow flex-col", {
417
+ "flex-col": isPane,
418
+ "gap-3 md:flex-row md:gap-6": !isPane
419
+ }),
420
+ children: [/*#__PURE__*/jsx(Accounts, {
421
+ accounts: accounts,
422
+ installationUrl: installationUrl,
423
+ isConnected: isConnected,
424
+ isPane: isPane,
425
+ onConnect: onConnect
426
+ }), /*#__PURE__*/jsx(Repositories, {
427
+ installationUrl: installationUrl,
428
+ isConnected: isConnected,
429
+ isConnecting: isConnecting,
430
+ isPane: isPane,
431
+ onConnect: onConnect,
432
+ repositories: repositories,
433
+ troubleshootUrl: troubleshootUrl
434
+ })]
435
+ });
436
+ };
437
+
438
+ export { NeetoGithubNanoContainer as N, n };
439
+ //# sourceMappingURL=index-CF2CmTxA.js.map