@bigbinary/neeto-github-frontend 1.0.10 → 1.0.11
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/dist/index.cjs.js +54 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +54 -22
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/types.d.ts +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var classNames = require('classnames');
|
|
6
7
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
7
8
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
8
9
|
var neetoui = require('@bigbinary/neetoui');
|
|
9
10
|
var misc = require('@bigbinary/neeto-icons/misc');
|
|
10
|
-
var classNames = require('classnames');
|
|
11
11
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
12
12
|
var Search = require('@bigbinary/neeto-molecules/Search');
|
|
13
13
|
var reactI18next = require('react-i18next');
|
|
@@ -90,9 +90,9 @@ var List$1 = reactUtils.withT(function (_ref) {
|
|
|
90
90
|
return window.open(profileUrl, "_blank");
|
|
91
91
|
}
|
|
92
92
|
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
93
|
-
className: "neeto-ui-text-gray-900 mx-2 text-
|
|
93
|
+
className: "neeto-ui-text-gray-900 mx-2 text-lg",
|
|
94
94
|
component: "span",
|
|
95
|
-
style: "
|
|
95
|
+
style: "h2"
|
|
96
96
|
}, "\u2022"), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
97
97
|
style: "body2"
|
|
98
98
|
}, t("neetoGithub.countOf.repos", {
|
|
@@ -210,10 +210,15 @@ var NoRepositories = reactUtils.withT(function (_ref) {
|
|
|
210
210
|
});
|
|
211
211
|
|
|
212
212
|
var RepositoryTile = function RepositoryTile(_ref) {
|
|
213
|
-
var
|
|
213
|
+
var isConnecting = _ref.isConnecting,
|
|
214
|
+
onConnect = _ref.onConnect,
|
|
214
215
|
repository = _ref.repository;
|
|
215
216
|
var _useTranslation = reactI18next.useTranslation(),
|
|
216
217
|
t = _useTranslation.t;
|
|
218
|
+
var _useState = React.useState(false),
|
|
219
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
220
|
+
isLoading = _useState2[0],
|
|
221
|
+
setIsLoading = _useState2[1];
|
|
217
222
|
var id = repository.id,
|
|
218
223
|
fullName = repository.fullName,
|
|
219
224
|
isPrivate = repository.isPrivate,
|
|
@@ -232,18 +237,21 @@ var RepositoryTile = function RepositoryTile(_ref) {
|
|
|
232
237
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
233
238
|
className: "hidden md:inline-block"
|
|
234
239
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
235
|
-
className: "neeto-ui-text-gray-900 mx-2 text-
|
|
240
|
+
className: "neeto-ui-text-gray-900 mx-2 text-lg",
|
|
236
241
|
component: "span",
|
|
237
|
-
style: "
|
|
242
|
+
style: "h2"
|
|
238
243
|
}, "\u2022"), /*#__PURE__*/React__default["default"].createElement(DateFormat__default["default"].FromNow, {
|
|
239
244
|
date: updatedAt
|
|
240
245
|
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
246
|
+
disabled: isConnecting,
|
|
247
|
+
loading: isLoading,
|
|
241
248
|
style: "primary",
|
|
242
249
|
type: "button",
|
|
243
250
|
onClick: function onClick() {
|
|
244
251
|
return onConnect({
|
|
245
252
|
repoType: "private",
|
|
246
|
-
repository: repository
|
|
253
|
+
repository: repository,
|
|
254
|
+
setIsLoading: setIsLoading
|
|
247
255
|
});
|
|
248
256
|
}
|
|
249
257
|
}, t("neetoGithub.connect")));
|
|
@@ -254,6 +262,7 @@ var List = reactUtils.withT(function (_ref) {
|
|
|
254
262
|
isPublicRepoAllowed = _ref.isPublicRepoAllowed,
|
|
255
263
|
filteredRepositories = _ref.filteredRepositories,
|
|
256
264
|
repositories = _ref.repositories,
|
|
265
|
+
isConnecting = _ref.isConnecting,
|
|
257
266
|
onConnect = _ref.onConnect,
|
|
258
267
|
installationUrl = _ref.installationUrl,
|
|
259
268
|
troubleshootUrl = _ref.troubleshootUrl;
|
|
@@ -264,10 +273,12 @@ var List = reactUtils.withT(function (_ref) {
|
|
|
264
273
|
})
|
|
265
274
|
}, neetoCist.isPresent(repositories) ? /*#__PURE__*/React__default["default"].createElement(Scrollable__default["default"], {
|
|
266
275
|
className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
|
|
267
|
-
}, neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
|
|
276
|
+
}, neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (repository, index) {
|
|
268
277
|
return /*#__PURE__*/React__default["default"].createElement(RepositoryTile, {
|
|
278
|
+
isConnecting: isConnecting,
|
|
269
279
|
onConnect: onConnect,
|
|
270
|
-
repository: repository
|
|
280
|
+
repository: repository,
|
|
281
|
+
key: index
|
|
271
282
|
});
|
|
272
283
|
}) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
273
284
|
className: "flex h-full w-full items-center justify-center",
|
|
@@ -299,6 +310,7 @@ var NotConnected = reactUtils.withT(function (_ref) {
|
|
|
299
310
|
|
|
300
311
|
var Private = function Private(_ref) {
|
|
301
312
|
var isConnected = _ref.isConnected,
|
|
313
|
+
isConnecting = _ref.isConnecting,
|
|
302
314
|
isPublicRepoAllowed = _ref.isPublicRepoAllowed,
|
|
303
315
|
repositories = _ref.repositories,
|
|
304
316
|
onConnect = _ref.onConnect,
|
|
@@ -337,9 +349,10 @@ var Private = function Private(_ref) {
|
|
|
337
349
|
count: filteredRepositories.length
|
|
338
350
|
}))
|
|
339
351
|
}), /*#__PURE__*/React__default["default"].createElement(List, {
|
|
340
|
-
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
341
352
|
filteredRepositories: filteredRepositories,
|
|
342
353
|
installationUrl: installationUrl,
|
|
354
|
+
isConnecting: isConnecting,
|
|
355
|
+
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
343
356
|
onConnect: onConnect,
|
|
344
357
|
repositories: repositories,
|
|
345
358
|
troubleshootUrl: troubleshootUrl
|
|
@@ -353,13 +366,18 @@ var Private = function Private(_ref) {
|
|
|
353
366
|
};
|
|
354
367
|
|
|
355
368
|
var Public = function Public(_ref) {
|
|
356
|
-
var
|
|
369
|
+
var isConnecting = _ref.isConnecting,
|
|
370
|
+
onConnect = _ref.onConnect;
|
|
357
371
|
var _useTranslation = reactI18next.useTranslation(),
|
|
358
372
|
t = _useTranslation.t;
|
|
359
|
-
var _useState = React.useState(
|
|
373
|
+
var _useState = React.useState(false),
|
|
360
374
|
_useState2 = _slicedToArray(_useState, 2),
|
|
361
|
-
|
|
362
|
-
|
|
375
|
+
isLoading = _useState2[0],
|
|
376
|
+
setIsLoading = _useState2[1];
|
|
377
|
+
var _useState3 = React.useState(""),
|
|
378
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
379
|
+
publicRepoUrl = _useState4[0],
|
|
380
|
+
setPublicRepoUrl = _useState4[1];
|
|
363
381
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
364
382
|
className: "transition-drop-shadow neeto-ui-border-gray-300 neeto-ui-rounded-md border border-solid px-8 py-7 font-sans transition-colors"
|
|
365
383
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -399,7 +417,8 @@ var Public = function Public(_ref) {
|
|
|
399
417
|
className: "relative"
|
|
400
418
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
401
419
|
className: "rounded-b rounded-l-none rounded-r rounded-t",
|
|
402
|
-
disabled: !neetoCist.isPresent(publicRepoUrl),
|
|
420
|
+
disabled: !neetoCist.isPresent(publicRepoUrl) || isLoading || isConnecting,
|
|
421
|
+
loading: isLoading,
|
|
403
422
|
size: "large",
|
|
404
423
|
style: "primary",
|
|
405
424
|
type: "button",
|
|
@@ -408,7 +427,8 @@ var Public = function Public(_ref) {
|
|
|
408
427
|
repoType: "public",
|
|
409
428
|
repository: {
|
|
410
429
|
fullName: publicRepoUrl
|
|
411
|
-
}
|
|
430
|
+
},
|
|
431
|
+
setIsLoading: setIsLoading
|
|
412
432
|
});
|
|
413
433
|
}
|
|
414
434
|
}, t("neetoGithub.continue"))))));
|
|
@@ -416,6 +436,7 @@ var Public = function Public(_ref) {
|
|
|
416
436
|
|
|
417
437
|
var Repositories = function Repositories(_ref) {
|
|
418
438
|
var isConnected = _ref.isConnected,
|
|
439
|
+
isConnecting = _ref.isConnecting,
|
|
419
440
|
isPublicRepoAllowed = _ref.isPublicRepoAllowed,
|
|
420
441
|
repositories = _ref.repositories,
|
|
421
442
|
onConnect = _ref.onConnect,
|
|
@@ -424,13 +445,15 @@ var Repositories = function Repositories(_ref) {
|
|
|
424
445
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
425
446
|
className: "w-full space-y-6"
|
|
426
447
|
}, /*#__PURE__*/React__default["default"].createElement(Private, {
|
|
427
|
-
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
428
448
|
installationUrl: installationUrl,
|
|
429
449
|
isConnected: isConnected,
|
|
450
|
+
isConnecting: isConnecting,
|
|
451
|
+
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
430
452
|
onConnect: onConnect,
|
|
431
453
|
repositories: repositories,
|
|
432
454
|
troubleshootUrl: troubleshootUrl
|
|
433
455
|
}), isPublicRepoAllowed && /*#__PURE__*/React__default["default"].createElement(Public, {
|
|
456
|
+
isConnecting: isConnecting,
|
|
434
457
|
onConnect: onConnect
|
|
435
458
|
}));
|
|
436
459
|
};
|
|
@@ -440,6 +463,8 @@ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
|
440
463
|
accounts = _ref$accounts === void 0 ? [] : _ref$accounts,
|
|
441
464
|
installationUrl = _ref.installationUrl,
|
|
442
465
|
isConnected = _ref.isConnected,
|
|
466
|
+
_ref$isConnecting = _ref.isConnecting,
|
|
467
|
+
isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
|
|
443
468
|
_ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
|
|
444
469
|
isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
|
|
445
470
|
onConnect = _ref.onConnect,
|
|
@@ -449,10 +474,14 @@ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
|
449
474
|
_ref$isPane = _ref.isPane,
|
|
450
475
|
isPane = _ref$isPane === void 0 ? false : _ref$isPane;
|
|
451
476
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
452
|
-
className: "flex w-full flex-col-reverse
|
|
477
|
+
className: classNames__default["default"]("flex w-full flex-col-reverse", {
|
|
478
|
+
"2xl:flex-row": isPane,
|
|
479
|
+
"xl:flex-row": !isPane
|
|
480
|
+
})
|
|
453
481
|
}, /*#__PURE__*/React__default["default"].createElement(Repositories, {
|
|
454
482
|
installationUrl: installationUrl,
|
|
455
483
|
isConnected: isConnected,
|
|
484
|
+
isConnecting: isConnecting,
|
|
456
485
|
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
457
486
|
onConnect: onConnect,
|
|
458
487
|
repositories: repositories,
|
|
@@ -461,8 +490,8 @@ var NeetoGithubNanoContainer = function NeetoGithubNanoContainer(_ref) {
|
|
|
461
490
|
accounts: accounts,
|
|
462
491
|
installationUrl: installationUrl,
|
|
463
492
|
isConnected: isConnected,
|
|
464
|
-
|
|
465
|
-
|
|
493
|
+
isPane: isPane,
|
|
494
|
+
onConnect: onConnect
|
|
466
495
|
}));
|
|
467
496
|
};
|
|
468
497
|
|
|
@@ -2719,9 +2748,11 @@ var newInstallationParams = lib.stringify({
|
|
|
2719
2748
|
var NEW_INSTALLATION_URL = "/github_integrations/app_installations/new?".concat(newInstallationParams);
|
|
2720
2749
|
var TROUBLESHOOT_URL = "https://render.com/docs/github#troubleshooting";
|
|
2721
2750
|
|
|
2722
|
-
var
|
|
2751
|
+
var NeetoGithubNanoPane = function NeetoGithubNanoPane(_ref) {
|
|
2723
2752
|
var isOpen = _ref.isOpen,
|
|
2724
2753
|
onClose = _ref.onClose,
|
|
2754
|
+
_ref$isConnecting = _ref.isConnecting,
|
|
2755
|
+
isConnecting = _ref$isConnecting === void 0 ? false : _ref$isConnecting,
|
|
2725
2756
|
_ref$isConnected = _ref.isConnected,
|
|
2726
2757
|
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
2727
2758
|
_ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
|
|
@@ -2758,6 +2789,7 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
|
|
|
2758
2789
|
accounts: accounts,
|
|
2759
2790
|
installationUrl: installationUrl,
|
|
2760
2791
|
isConnected: isConnected,
|
|
2792
|
+
isConnecting: isConnecting,
|
|
2761
2793
|
isPublicRepoAllowed: isPublicRepoAllowed,
|
|
2762
2794
|
onConnect: onConnect,
|
|
2763
2795
|
repositories: repositories,
|
|
@@ -2772,5 +2804,5 @@ var css = ".width-calc{width:calc(100% - 82px)}.neeto-github-modal-pane-wrapper{
|
|
|
2772
2804
|
n(css,{});
|
|
2773
2805
|
|
|
2774
2806
|
exports.NeetoGithubNanoContainer = NeetoGithubNanoContainer;
|
|
2775
|
-
exports.
|
|
2807
|
+
exports.NeetoGithubNanoPane = NeetoGithubNanoPane;
|
|
2776
2808
|
//# sourceMappingURL=index.cjs.js.map
|