@bigbinary/neeto-github-frontend 1.0.10 → 1.0.13
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/app/javascript/src/translations/en.json +1 -0
- package/dist/index.cjs.js +197 -35
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +196 -36
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/types.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,103 @@
|
|
|
1
1
|
import React, { useState, useRef } from 'react';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
4
|
+
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
5
|
+
import { Trans, useTranslation } from 'react-i18next';
|
|
6
|
+
import { isNotNil } from 'ramda';
|
|
7
|
+
import { useQuery } from 'react-query';
|
|
8
|
+
import axios from 'axios';
|
|
9
|
+
import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
|
|
2
10
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
3
11
|
import { Settings, Plus, Building, User, CannedResponses, Lock } from '@bigbinary/neeto-icons';
|
|
4
12
|
import { Button, Typography, Input, Pane } from '@bigbinary/neetoui';
|
|
5
13
|
import { Github } from '@bigbinary/neeto-icons/misc';
|
|
6
|
-
import
|
|
7
|
-
import { isPresent, noop } from '@bigbinary/neeto-cist';
|
|
14
|
+
import { isPresent, findBy, noop } from '@bigbinary/neeto-cist';
|
|
8
15
|
import Search from '@bigbinary/neeto-molecules/Search';
|
|
9
|
-
import { Trans, useTranslation } from 'react-i18next';
|
|
10
16
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
11
17
|
import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
|
|
12
|
-
import { globalProps } from '@bigbinary/neeto-commons-frontend/initializers';
|
|
13
18
|
import require$$0 from 'util';
|
|
14
19
|
|
|
20
|
+
function _typeof(o) {
|
|
21
|
+
"@babel/helpers - typeof";
|
|
22
|
+
|
|
23
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
24
|
+
return typeof o;
|
|
25
|
+
} : function (o) {
|
|
26
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
27
|
+
}, _typeof(o);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function _toPrimitive(input, hint) {
|
|
31
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
32
|
+
var prim = input[Symbol.toPrimitive];
|
|
33
|
+
if (prim !== undefined) {
|
|
34
|
+
var res = prim.call(input, hint || "default");
|
|
35
|
+
if (_typeof(res) !== "object") return res;
|
|
36
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
37
|
+
}
|
|
38
|
+
return (hint === "string" ? String : Number)(input);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function _toPropertyKey(arg) {
|
|
42
|
+
var key = _toPrimitive(arg, "string");
|
|
43
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _defineProperty(obj, key, value) {
|
|
47
|
+
key = _toPropertyKey(key);
|
|
48
|
+
if (key in obj) {
|
|
49
|
+
Object.defineProperty(obj, key, {
|
|
50
|
+
value: value,
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true
|
|
54
|
+
});
|
|
55
|
+
} else {
|
|
56
|
+
obj[key] = value;
|
|
57
|
+
}
|
|
58
|
+
return obj;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
var _globalProps$organiza$1;
|
|
62
|
+
var GITHUB_INTEGRATIONS_BASE_API_URL = "/github_integrations";
|
|
63
|
+
({
|
|
64
|
+
integrator_id: globalProps === null || globalProps === void 0 || (_globalProps$organiza$1 = globalProps.organization) === null || _globalProps$organiza$1 === void 0 ? void 0 : _globalProps$organiza$1.id,
|
|
65
|
+
integrator_type: "Organization"
|
|
66
|
+
});
|
|
67
|
+
var GITHUB_INTEGRATOR_PARAMS = {
|
|
68
|
+
integratorId: globalProps.organization.id,
|
|
69
|
+
integratorType: "Organization"
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
var baseUrl = "".concat(GITHUB_INTEGRATIONS_BASE_API_URL, "/app_installations");
|
|
73
|
+
var githubAppUrl = function githubAppUrl(id) {
|
|
74
|
+
return "".concat(baseUrl, "/").concat(id);
|
|
75
|
+
};
|
|
76
|
+
var repositories = function repositories() {
|
|
77
|
+
return axios.get("".concat(githubAppUrl(globalProps.githubAppInstallationId), "/repositories"), {
|
|
78
|
+
params: GITHUB_INTEGRATOR_PARAMS
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
var githubAccountsApi = {
|
|
82
|
+
repositories: repositories
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
var QUERY_KEYS = {
|
|
86
|
+
GITHUB_REPOSITORIES_LIST: "github-repositories-list"
|
|
87
|
+
};
|
|
88
|
+
var STALE_TIME_CONFIG = {
|
|
89
|
+
staleTime: DEFAULT_STALE_TIME
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
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; }
|
|
93
|
+
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; }
|
|
94
|
+
var useFetchGithubRepositories = function useFetchGithubRepositories(_ref) {
|
|
95
|
+
var isConnected = _ref.isConnected;
|
|
96
|
+
return useQuery([QUERY_KEYS.GITHUB_REPOSITORIES_LIST], githubAccountsApi.repositories, _objectSpread(_objectSpread({}, STALE_TIME_CONFIG), {}, {
|
|
97
|
+
enabled: isConnected && isNotNil(globalProps.githubAppInstallationId)
|
|
98
|
+
}));
|
|
99
|
+
};
|
|
100
|
+
|
|
15
101
|
var Configure = withT(function (_ref) {
|
|
16
102
|
var t = _ref.t,
|
|
17
103
|
isConnected = _ref.isConnected,
|
|
@@ -77,9 +163,9 @@ var List$1 = withT(function (_ref) {
|
|
|
77
163
|
return window.open(profileUrl, "_blank");
|
|
78
164
|
}
|
|
79
165
|
}), /*#__PURE__*/React.createElement(Typography, {
|
|
80
|
-
className: "neeto-ui-text-gray-900 mx-2 text-
|
|
166
|
+
className: "neeto-ui-text-gray-900 mx-2 text-lg",
|
|
81
167
|
component: "span",
|
|
82
|
-
style: "
|
|
168
|
+
style: "h2"
|
|
83
169
|
}, "\u2022"), /*#__PURE__*/React.createElement(Typography, {
|
|
84
170
|
style: "body2"
|
|
85
171
|
}, t("neetoGithub.countOf.repos", {
|
|
@@ -197,10 +283,15 @@ var NoRepositories = withT(function (_ref) {
|
|
|
197
283
|
});
|
|
198
284
|
|
|
199
285
|
var RepositoryTile = function RepositoryTile(_ref) {
|
|
200
|
-
var
|
|
286
|
+
var isConnecting = _ref.isConnecting,
|
|
287
|
+
onConnect = _ref.onConnect,
|
|
201
288
|
repository = _ref.repository;
|
|
202
289
|
var _useTranslation = useTranslation(),
|
|
203
290
|
t = _useTranslation.t;
|
|
291
|
+
var _useState = useState(false),
|
|
292
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
293
|
+
isLoading = _useState2[0],
|
|
294
|
+
setIsLoading = _useState2[1];
|
|
204
295
|
var id = repository.id,
|
|
205
296
|
fullName = repository.fullName,
|
|
206
297
|
isPrivate = repository.isPrivate,
|
|
@@ -219,18 +310,21 @@ var RepositoryTile = function RepositoryTile(_ref) {
|
|
|
219
310
|
}), /*#__PURE__*/React.createElement("div", {
|
|
220
311
|
className: "hidden md:inline-block"
|
|
221
312
|
}, /*#__PURE__*/React.createElement(Typography, {
|
|
222
|
-
className: "neeto-ui-text-gray-900 mx-2 text-
|
|
313
|
+
className: "neeto-ui-text-gray-900 mx-2 text-lg",
|
|
223
314
|
component: "span",
|
|
224
|
-
style: "
|
|
315
|
+
style: "h2"
|
|
225
316
|
}, "\u2022"), /*#__PURE__*/React.createElement(DateFormat.FromNow, {
|
|
226
317
|
date: updatedAt
|
|
227
318
|
}))), /*#__PURE__*/React.createElement(Button, {
|
|
319
|
+
disabled: isConnecting,
|
|
320
|
+
loading: isLoading,
|
|
228
321
|
style: "primary",
|
|
229
322
|
type: "button",
|
|
230
323
|
onClick: function onClick() {
|
|
231
324
|
return onConnect({
|
|
232
325
|
repoType: "private",
|
|
233
|
-
repository: repository
|
|
326
|
+
repository: repository,
|
|
327
|
+
setIsLoading: setIsLoading
|
|
234
328
|
});
|
|
235
329
|
}
|
|
236
330
|
}, t("neetoGithub.connect")));
|
|
@@ -241,6 +335,7 @@ var List = withT(function (_ref) {
|
|
|
241
335
|
isPublicRepoAllowed = _ref.isPublicRepoAllowed,
|
|
242
336
|
filteredRepositories = _ref.filteredRepositories,
|
|
243
337
|
repositories = _ref.repositories,
|
|
338
|
+
isConnecting = _ref.isConnecting,
|
|
244
339
|
onConnect = _ref.onConnect,
|
|
245
340
|
installationUrl = _ref.installationUrl,
|
|
246
341
|
troubleshootUrl = _ref.troubleshootUrl;
|
|
@@ -251,10 +346,12 @@ var List = withT(function (_ref) {
|
|
|
251
346
|
})
|
|
252
347
|
}, isPresent(repositories) ? /*#__PURE__*/React.createElement(Scrollable, {
|
|
253
348
|
className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
|
|
254
|
-
}, isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
|
|
349
|
+
}, isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
|
|
255
350
|
return /*#__PURE__*/React.createElement(RepositoryTile, {
|
|
351
|
+
isConnecting: isConnecting,
|
|
256
352
|
onConnect: onConnect,
|
|
257
|
-
repository: repository
|
|
353
|
+
repository: repository,
|
|
354
|
+
key: index
|
|
258
355
|
});
|
|
259
356
|
}) : /*#__PURE__*/React.createElement(Typography, {
|
|
260
357
|
className: "flex h-full w-full items-center justify-center",
|
|
@@ -286,6 +383,7 @@ var NotConnected = withT(function (_ref) {
|
|
|
286
383
|
|
|
287
384
|
var Private = function Private(_ref) {
|
|
288
385
|
var isConnected = _ref.isConnected,
|
|
386
|
+
isConnecting = _ref.isConnecting,
|
|
289
387
|
isPublicRepoAllowed = _ref.isPublicRepoAllowed,
|
|
290
388
|
repositories = _ref.repositories,
|
|
291
389
|
onConnect = _ref.onConnect,
|
|
@@ -324,9 +422,10 @@ var Private = function Private(_ref) {
|
|
|
324
422
|
count: filteredRepositories.length
|
|
325
423
|
}))
|
|
326
424
|
}), /*#__PURE__*/React.createElement(List, {
|
|
327
|
-
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
328
425
|
filteredRepositories: filteredRepositories,
|
|
329
426
|
installationUrl: installationUrl,
|
|
427
|
+
isConnecting: isConnecting,
|
|
428
|
+
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
330
429
|
onConnect: onConnect,
|
|
331
430
|
repositories: repositories,
|
|
332
431
|
troubleshootUrl: troubleshootUrl
|
|
@@ -340,13 +439,18 @@ var Private = function Private(_ref) {
|
|
|
340
439
|
};
|
|
341
440
|
|
|
342
441
|
var Public = function Public(_ref) {
|
|
343
|
-
var
|
|
442
|
+
var isConnecting = _ref.isConnecting,
|
|
443
|
+
onConnect = _ref.onConnect;
|
|
344
444
|
var _useTranslation = useTranslation(),
|
|
345
445
|
t = _useTranslation.t;
|
|
346
|
-
var _useState = useState(
|
|
446
|
+
var _useState = useState(false),
|
|
347
447
|
_useState2 = _slicedToArray(_useState, 2),
|
|
348
|
-
|
|
349
|
-
|
|
448
|
+
isLoading = _useState2[0],
|
|
449
|
+
setIsLoading = _useState2[1];
|
|
450
|
+
var _useState3 = useState(""),
|
|
451
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
452
|
+
publicRepoUrl = _useState4[0],
|
|
453
|
+
setPublicRepoUrl = _useState4[1];
|
|
350
454
|
return /*#__PURE__*/React.createElement("div", {
|
|
351
455
|
className: "transition-drop-shadow neeto-ui-border-gray-300 neeto-ui-rounded-md border border-solid px-8 py-7 font-sans transition-colors"
|
|
352
456
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -386,7 +490,8 @@ var Public = function Public(_ref) {
|
|
|
386
490
|
className: "relative"
|
|
387
491
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
388
492
|
className: "rounded-b rounded-l-none rounded-r rounded-t",
|
|
389
|
-
disabled: !isPresent(publicRepoUrl),
|
|
493
|
+
disabled: !isPresent(publicRepoUrl) || isLoading || isConnecting,
|
|
494
|
+
loading: isLoading,
|
|
390
495
|
size: "large",
|
|
391
496
|
style: "primary",
|
|
392
497
|
type: "button",
|
|
@@ -395,7 +500,8 @@ var Public = function Public(_ref) {
|
|
|
395
500
|
repoType: "public",
|
|
396
501
|
repository: {
|
|
397
502
|
fullName: publicRepoUrl
|
|
398
|
-
}
|
|
503
|
+
},
|
|
504
|
+
setIsLoading: setIsLoading
|
|
399
505
|
});
|
|
400
506
|
}
|
|
401
507
|
}, t("neetoGithub.continue"))))));
|
|
@@ -403,6 +509,7 @@ var Public = function Public(_ref) {
|
|
|
403
509
|
|
|
404
510
|
var Repositories = function Repositories(_ref) {
|
|
405
511
|
var isConnected = _ref.isConnected,
|
|
512
|
+
isConnecting = _ref.isConnecting,
|
|
406
513
|
isPublicRepoAllowed = _ref.isPublicRepoAllowed,
|
|
407
514
|
repositories = _ref.repositories,
|
|
408
515
|
onConnect = _ref.onConnect,
|
|
@@ -411,35 +518,69 @@ var Repositories = function Repositories(_ref) {
|
|
|
411
518
|
return /*#__PURE__*/React.createElement("div", {
|
|
412
519
|
className: "w-full space-y-6"
|
|
413
520
|
}, /*#__PURE__*/React.createElement(Private, {
|
|
414
|
-
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
415
521
|
installationUrl: installationUrl,
|
|
416
522
|
isConnected: isConnected,
|
|
523
|
+
isConnecting: isConnecting,
|
|
524
|
+
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
417
525
|
onConnect: onConnect,
|
|
418
526
|
repositories: repositories,
|
|
419
527
|
troubleshootUrl: troubleshootUrl
|
|
420
528
|
}), isPublicRepoAllowed && /*#__PURE__*/React.createElement(Public, {
|
|
529
|
+
isConnecting: isConnecting,
|
|
421
530
|
onConnect: onConnect
|
|
422
531
|
}));
|
|
423
532
|
};
|
|
424
533
|
|
|
425
534
|
var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
426
|
-
var _ref$
|
|
427
|
-
|
|
535
|
+
var _ref$isPaneLoading = _ref.isPaneLoading,
|
|
536
|
+
isPaneLoading = _ref$isPaneLoading === void 0 ? false : _ref$isPaneLoading,
|
|
537
|
+
_ref$shouldFetchRepos = _ref.shouldFetchRepositories,
|
|
538
|
+
shouldFetchRepositories = _ref$shouldFetchRepos === void 0 ? true : _ref$shouldFetchRepos,
|
|
539
|
+
_ref$paneAccounts = _ref.paneAccounts,
|
|
540
|
+
paneAccounts = _ref$paneAccounts === void 0 ? [] : _ref$paneAccounts,
|
|
428
541
|
installationUrl = _ref.installationUrl,
|
|
429
542
|
isConnected = _ref.isConnected,
|
|
543
|
+
_ref$isConnecting = _ref.isConnecting,
|
|
544
|
+
isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
|
|
430
545
|
_ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
|
|
431
546
|
isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
|
|
432
547
|
onConnect = _ref.onConnect,
|
|
433
|
-
_ref$
|
|
434
|
-
|
|
548
|
+
_ref$paneRepositories = _ref.paneRepositories,
|
|
549
|
+
paneRepositories = _ref$paneRepositories === void 0 ? [] : _ref$paneRepositories,
|
|
435
550
|
troubleshootUrl = _ref.troubleshootUrl,
|
|
436
551
|
_ref$isPane = _ref.isPane,
|
|
437
552
|
isPane = _ref$isPane === void 0 ? false : _ref$isPane;
|
|
553
|
+
var _useTranslation = useTranslation(),
|
|
554
|
+
t = _useTranslation.t;
|
|
555
|
+
var _useFetchGithubReposi = useFetchGithubRepositories({
|
|
556
|
+
isConnected: shouldFetchRepositories && globalProps.isGithubIntegrated
|
|
557
|
+
}),
|
|
558
|
+
_useFetchGithubReposi2 = _useFetchGithubReposi.data,
|
|
559
|
+
_useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
|
|
560
|
+
_useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
|
|
561
|
+
containerRepositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
|
|
562
|
+
_useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
|
|
563
|
+
containerAccounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
|
|
564
|
+
isContainerLoading = _useFetchGithubReposi.isLoading;
|
|
565
|
+
var repositories = shouldFetchRepositories ? containerRepositories : paneRepositories;
|
|
566
|
+
var accounts = shouldFetchRepositories ? containerAccounts : paneAccounts;
|
|
567
|
+
var isLoading = shouldFetchRepositories ? isContainerLoading : isPaneLoading;
|
|
568
|
+
if (isLoading) {
|
|
569
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
570
|
+
className: "flex h-96 w-full flex-col items-center"
|
|
571
|
+
}, /*#__PURE__*/React.createElement(PageLoader, {
|
|
572
|
+
text: t("neetoGithub.fetchingRepos")
|
|
573
|
+
}), ";");
|
|
574
|
+
}
|
|
438
575
|
return /*#__PURE__*/React.createElement("div", {
|
|
439
|
-
className: "flex w-full flex-col-reverse
|
|
576
|
+
className: classNames("flex w-full flex-col-reverse", {
|
|
577
|
+
"2xl:flex-row": isPane,
|
|
578
|
+
"xl:flex-row": !isPane
|
|
579
|
+
})
|
|
440
580
|
}, /*#__PURE__*/React.createElement(Repositories, {
|
|
441
581
|
installationUrl: installationUrl,
|
|
442
582
|
isConnected: isConnected,
|
|
583
|
+
isConnecting: isConnecting,
|
|
443
584
|
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
444
585
|
onConnect: onConnect,
|
|
445
586
|
repositories: repositories,
|
|
@@ -448,8 +589,8 @@ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
|
448
589
|
accounts: accounts,
|
|
449
590
|
installationUrl: installationUrl,
|
|
450
591
|
isConnected: isConnected,
|
|
451
|
-
|
|
452
|
-
|
|
592
|
+
isPane: isPane,
|
|
593
|
+
onConnect: onConnect
|
|
453
594
|
}));
|
|
454
595
|
};
|
|
455
596
|
|
|
@@ -2706,23 +2847,23 @@ var newInstallationParams = lib.stringify({
|
|
|
2706
2847
|
var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
|
|
2707
2848
|
var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
|
|
2708
2849
|
|
|
2709
|
-
var
|
|
2850
|
+
var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
|
|
2710
2851
|
var isOpen = _ref.isOpen,
|
|
2711
2852
|
onClose = _ref.onClose,
|
|
2853
|
+
_ref$isConnecting = _ref.isConnecting,
|
|
2854
|
+
isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
|
|
2712
2855
|
_ref$isConnected = _ref.isConnected,
|
|
2713
2856
|
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
2714
2857
|
_ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
|
|
2715
2858
|
isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
|
|
2716
|
-
_ref$repositories = _ref.repositories,
|
|
2717
|
-
repositories = _ref$repositories === void 0 ? [] : _ref$repositories,
|
|
2718
|
-
_ref$accounts = _ref.accounts,
|
|
2719
|
-
accounts = _ref$accounts === void 0 ? [] : _ref$accounts,
|
|
2720
2859
|
_ref$installationUrl = _ref.installationUrl,
|
|
2721
2860
|
installationUrl = _ref$installationUrl === void 0 ? NEW_INSTALLATION_URL : _ref$installationUrl,
|
|
2722
2861
|
_ref$troubleshootUrl = _ref.troubleshootUrl,
|
|
2723
2862
|
troubleshootUrl = _ref$troubleshootUrl === void 0 ? TROUBLESHOOT_URL : _ref$troubleshootUrl,
|
|
2724
2863
|
_ref$onConnect = _ref.onConnect,
|
|
2725
2864
|
onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
|
|
2865
|
+
_ref$projects = _ref.projects,
|
|
2866
|
+
projects = _ref$projects === void 0 ? [] : _ref$projects,
|
|
2726
2867
|
_ref$title = _ref.title,
|
|
2727
2868
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
2728
2869
|
_ref$description = _ref.description,
|
|
@@ -2730,6 +2871,22 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
|
|
|
2730
2871
|
var _useTranslation = useTranslation(),
|
|
2731
2872
|
t = _useTranslation.t;
|
|
2732
2873
|
var initialFocusRef = useRef(null);
|
|
2874
|
+
var _useFetchGithubReposi = useFetchGithubRepositories({
|
|
2875
|
+
isConnected: isOpen && isConnected
|
|
2876
|
+
}),
|
|
2877
|
+
_useFetchGithubReposi2 = _useFetchGithubReposi.data,
|
|
2878
|
+
_useFetchGithubReposi3 = _useFetchGithubReposi2 === void 0 ? {} : _useFetchGithubReposi2,
|
|
2879
|
+
_useFetchGithubReposi4 = _useFetchGithubReposi3.repositories,
|
|
2880
|
+
repositories = _useFetchGithubReposi4 === void 0 ? [] : _useFetchGithubReposi4,
|
|
2881
|
+
_useFetchGithubReposi5 = _useFetchGithubReposi3.accounts,
|
|
2882
|
+
accounts = _useFetchGithubReposi5 === void 0 ? [] : _useFetchGithubReposi5,
|
|
2883
|
+
isPaneLoading = _useFetchGithubReposi.isLoading;
|
|
2884
|
+
var paneRepositories = repositories.filter(function (repository) {
|
|
2885
|
+
return !findBy({
|
|
2886
|
+
repository: repository.fullName
|
|
2887
|
+
}, projects);
|
|
2888
|
+
});
|
|
2889
|
+
var paneAccounts = isConnected ? accounts : [];
|
|
2733
2890
|
return /*#__PURE__*/React.createElement(Pane, {
|
|
2734
2891
|
initialFocusRef: initialFocusRef,
|
|
2735
2892
|
isOpen: isOpen,
|
|
@@ -2742,14 +2899,17 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
|
|
|
2742
2899
|
className: "mt-4",
|
|
2743
2900
|
style: "body2"
|
|
2744
2901
|
}, isPresent(description) ? description : t("neetoGithub.modal.description"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement(NeetoGithubNanoContainer, {
|
|
2745
|
-
accounts: accounts,
|
|
2746
2902
|
installationUrl: installationUrl,
|
|
2747
2903
|
isConnected: isConnected,
|
|
2904
|
+
isConnecting: isConnecting,
|
|
2905
|
+
isPaneLoading: isPaneLoading,
|
|
2748
2906
|
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
2749
2907
|
onConnect: onConnect,
|
|
2750
|
-
|
|
2908
|
+
paneAccounts: paneAccounts,
|
|
2909
|
+
paneRepositories: paneRepositories,
|
|
2751
2910
|
troubleshootUrl: troubleshootUrl,
|
|
2752
|
-
isPane: true
|
|
2911
|
+
isPane: true,
|
|
2912
|
+
shouldFetchRepositories: false
|
|
2753
2913
|
})));
|
|
2754
2914
|
};
|
|
2755
2915
|
|
|
@@ -2758,5 +2918,5 @@ var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r
|
|
|
2758
2918
|
var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{width:min(75%,1280px)}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3JlcG9zaXRvcnktdGlsZS5zY3NzIiwiYXBwL2phdmFzY3JpcHQvc3R5bGVzaGVldHMvYXBwbGljYXRpb24uc2NzcyIsImFwcC9qYXZhc2NyaXB0L3N0eWxlc2hlZXRzL2NvbXBvbmVudHMvX3BhbmUuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxZQUNFLHVCQ0NGLENDRkEsaUNBQ0UscUJES0YiLCJzb3VyY2VzQ29udGVudCI6WyIud2lkdGgtY2FsYyB7XG4gIHdpZHRoOiBjYWxjKDEwMCUgLSA4MnB4KTtcbn1cbiIsIi53aWR0aC1jYWxjIHtcbiAgd2lkdGg6IGNhbGMoMTAwJSAtIDgycHgpO1xufVxuXG4ubmVldG8tZ2l0aHViLW1vZGFsLXBhbmUtd3JhcHBlciB7XG4gIHdpZHRoOiBtaW4oNzUlLCAxMjgwcHgpO1xufSIsIi5uZWV0by1naXRodWItbW9kYWwtcGFuZS13cmFwcGVyIHtcbiAgd2lkdGg6IG1pbig3NSUsIDEyODBweCk7XG59XG4iXX0= */";
|
|
2759
2919
|
n(css,{});
|
|
2760
2920
|
|
|
2761
|
-
export { NeetoGithubNanoContainer,
|
|
2921
|
+
export { NeetoGithubNanoContainer, NeetoGithubNanoPane };
|
|
2762
2922
|
//# sourceMappingURL=index.js.map
|