@bigbinary/neeto-github-frontend 1.0.1 → 1.0.3

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.
@@ -1,25 +1,27 @@
1
1
  {
2
- "connect": "Connect",
3
- "github": "Github",
4
- "noRepos": "No repositories found",
5
- "noReposDescription": "Connect a GitHub repository to begin using your existing repos for new services.",
6
- "notConnectedDescription": "Connect your neetoCI account to GitHub to begin using your existing repos for new services.",
7
- "configureAccount": "Configure account",
8
- "connectAccount": "Connect account",
9
- "connectGithub": "Connect GitHub",
10
- "connectARepo": "Connect a repository",
11
- "connectRepository": "Connect repository",
12
- "continue": "Continue",
13
- "publicGitRepo": "Public Git repository",
14
- "publicGitRepoDescription": "Use a public repository by entering the URL below.",
15
- "publicGitRepoPlaceholder": "https://github.com/bigbinary/example-app",
16
- "countOf": {
17
- "repos_one": "{{count}} repo",
18
- "repos_other": "{{count}} repos"
19
- },
20
- "neetoGithubNanoModal": {
21
- "title": "Create a new project",
22
- "description": "Connect your Git repository or use an existing public repository URL."
23
- },
24
- "troubleshoot": "Can't find a repository that's already connected? <troubleshootLink>Troubleshoot</troubleshootLink> your GitHub connection."
2
+ "neetoGithub": {
3
+ "connect": "Connect",
4
+ "github": "Github",
5
+ "noRepos": "No repositories found",
6
+ "noReposDescription": "Connect a GitHub repository to begin using your existing repos for new services.",
7
+ "notConnectedDescription": "Connect your neetoCI account to GitHub to begin using your existing repos for new services.",
8
+ "configureAccount": "Configure account",
9
+ "connectAccount": "Connect account",
10
+ "connectGithub": "Connect GitHub",
11
+ "connectARepo": "Connect a repository",
12
+ "connectRepository": "Connect repository",
13
+ "continue": "Continue",
14
+ "publicGitRepo": "Public Git repository",
15
+ "publicGitRepoDescription": "Use a public repository by entering the URL below.",
16
+ "publicGitRepoPlaceholder": "https://github.com/bigbinary/example-app",
17
+ "countOf": {
18
+ "repos_one": "{{count}} repo",
19
+ "repos_other": "{{count}} repos"
20
+ },
21
+ "modal": {
22
+ "title": "Create a new project",
23
+ "description": "Connect your Git repository or use an existing public repository URL."
24
+ },
25
+ "troubleshoot": "Can't find a repository that's already connected? <troubleshootLink>Troubleshoot</troubleshootLink> your GitHub connection."
26
+ }
25
27
  }
package/dist/index.cjs.js CHANGED
@@ -12,16 +12,16 @@ var misc = require('@bigbinary/neeto-icons/misc');
12
12
  var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
13
13
  var require$$0 = require('util');
14
14
  var Search = require('@bigbinary/neeto-molecules/Search');
15
- var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
16
15
  var Scrollable = require('@bigbinary/neeto-molecules/Scrollable');
16
+ var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
17
17
 
18
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
19
19
 
20
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
21
  var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
22
22
  var Search__default = /*#__PURE__*/_interopDefaultLegacy(Search);
23
- var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
24
23
  var Scrollable__default = /*#__PURE__*/_interopDefaultLegacy(Scrollable);
24
+ var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
25
25
 
26
26
  var Configure = reactUtils.withT(function (_ref) {
27
27
  var t = _ref.t,
@@ -37,7 +37,7 @@ var Configure = reactUtils.withT(function (_ref) {
37
37
  iconSize: 20,
38
38
  size: "small",
39
39
  style: "text"
40
- }, isConnected ? t("configureAccount") : t("connectAccount")));
40
+ }, isConnected ? t("neetoGithub.configureAccount") : t("neetoGithub.connectAccount")));
41
41
  });
42
42
 
43
43
  var Header = reactUtils.withT(function (_ref) {
@@ -48,7 +48,7 @@ var Header = reactUtils.withT(function (_ref) {
48
48
  size: 16
49
49
  }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
50
50
  style: "h4"
51
- }, t("github")));
51
+ }, t("neetoGithub.github")));
52
52
  });
53
53
 
54
54
  var List$1 = reactUtils.withT(function (_ref) {
@@ -93,7 +93,7 @@ var List$1 = reactUtils.withT(function (_ref) {
93
93
  style: "h3"
94
94
  }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
95
95
  style: "body2"
96
- }, t("countOf.repos", {
96
+ }, t("neetoGithub.countOf.repos", {
97
97
  count: count
98
98
  })));
99
99
  });
@@ -2439,11 +2439,11 @@ var NoRepositories = reactUtils.withT(function (_ref) {
2439
2439
  className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
2440
2440
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2441
2441
  style: "body2"
2442
- }, t("noReposDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2442
+ }, t("neetoGithub.noReposDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2443
2443
  href: installationUrl,
2444
2444
  icon: misc.Github,
2445
2445
  iconPosition: "left",
2446
- label: t("connectRepository"),
2446
+ label: t("neetoGithub.connectRepository"),
2447
2447
  size: "medium",
2448
2448
  style: "primary"
2449
2449
  }), /*#__PURE__*/React__default["default"].createElement("div", {
@@ -2461,6 +2461,45 @@ var NoRepositories = reactUtils.withT(function (_ref) {
2461
2461
  })));
2462
2462
  });
2463
2463
 
2464
+ var RepositoryTile = reactUtils.withT(function (_ref) {
2465
+ var t = _ref.t,
2466
+ onConnect = _ref.onConnect,
2467
+ repository = _ref.repository;
2468
+ var id = repository.id,
2469
+ fullName = repository.fullName,
2470
+ isPrivate = repository.isPrivate,
2471
+ updatedAt = repository.updatedAt;
2472
+ return /*#__PURE__*/React__default["default"].createElement("div", {
2473
+ className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-l-0 border-r-0 border-t-0 border-solid py-3 pl-5 pr-3",
2474
+ key: id
2475
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
2476
+ className: "width-calc flex items-center space-x-2"
2477
+ }, /*#__PURE__*/React__default["default"].createElement(misc.Github, {
2478
+ size: 16
2479
+ }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2480
+ style: "body2"
2481
+ }, fullName), isPrivate && /*#__PURE__*/React__default["default"].createElement(neetoIcons.Lock, {
2482
+ size: 16
2483
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
2484
+ className: "hidden md:inline-block"
2485
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2486
+ className: "neeto-ui-text-gray-900 mx-2 text-sm",
2487
+ component: "span",
2488
+ style: "h3"
2489
+ }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(DateFormat__default["default"].FromNow, {
2490
+ date: updatedAt
2491
+ }))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2492
+ style: "primary",
2493
+ type: "button",
2494
+ onClick: function onClick() {
2495
+ return onConnect({
2496
+ repoType: "private",
2497
+ repository: repository
2498
+ });
2499
+ }
2500
+ }, t("neetoGithub.connect")));
2501
+ });
2502
+
2464
2503
  var List = reactUtils.withT(function (_ref) {
2465
2504
  var t = _ref.t,
2466
2505
  filteredRepositories = _ref.filteredRepositories,
@@ -2472,45 +2511,15 @@ var List = reactUtils.withT(function (_ref) {
2472
2511
  className: "neeto-ui-border-gray-300 neeto-ui-rounded-md m-0 flex h-52 flex-col items-center justify-center border border-solid p-0 2xl:h-96"
2473
2512
  }, neetoCist.isPresent(repositories) ? /*#__PURE__*/React__default["default"].createElement(Scrollable__default["default"], {
2474
2513
  className: "m-0 h-full w-full overflow-y-scroll p-0 shadow-inner"
2475
- }, neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (_ref2) {
2476
- var id = _ref2.id,
2477
- fullName = _ref2.fullName,
2478
- isPrivate = _ref2.isPrivate,
2479
- updatedAt = _ref2.updatedAt;
2480
- return /*#__PURE__*/React__default["default"].createElement("div", {
2481
- className: "neeto-ui-border-gray-300 flex items-center justify-between border-b border-l-0 border-r-0 border-t-0 border-solid py-3 pl-5 pr-3",
2482
- key: id
2483
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2484
- className: "width-calc flex items-center space-x-2"
2485
- }, /*#__PURE__*/React__default["default"].createElement(misc.Github, {
2486
- size: 16
2487
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2488
- style: "body2"
2489
- }, fullName), isPrivate && /*#__PURE__*/React__default["default"].createElement(neetoIcons.Lock, {
2490
- size: 16
2491
- }), /*#__PURE__*/React__default["default"].createElement("div", {
2492
- className: "hidden md:inline-block"
2493
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2494
- className: "neeto-ui-text-gray-900 mx-2 text-sm",
2495
- component: "span",
2496
- style: "h3"
2497
- }, "\u2022"), /*#__PURE__*/React__default["default"].createElement(DateFormat__default["default"].FromNow, {
2498
- date: updatedAt
2499
- }))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2500
- style: "primary",
2501
- type: "button",
2502
- onClick: function onClick() {
2503
- return onConnect("private", {
2504
- id: id,
2505
- fullName: fullName,
2506
- isPrivate: isPrivate
2507
- });
2508
- }
2509
- }, t("connect")));
2514
+ }, neetoCist.isPresent(filteredRepositories) ? filteredRepositories.map(function (repository) {
2515
+ return /*#__PURE__*/React__default["default"].createElement(RepositoryTile, {
2516
+ onConnect: onConnect,
2517
+ repository: repository
2518
+ });
2510
2519
  }) : /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2511
2520
  className: "flex h-full w-full items-center justify-center",
2512
2521
  style: "body2"
2513
- }, t("noRepos"))) : /*#__PURE__*/React__default["default"].createElement(NoRepositories, {
2522
+ }, t("neetoGithub.noRepos"))) : /*#__PURE__*/React__default["default"].createElement(NoRepositories, {
2514
2523
  installationUrl: installationUrl,
2515
2524
  troubleshootUrl: troubleshootUrl
2516
2525
  }));
@@ -2523,11 +2532,11 @@ var NotConnected = reactUtils.withT(function (_ref) {
2523
2532
  className: "flex w-full max-w-sm flex-col items-center justify-center space-y-4 text-center"
2524
2533
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2525
2534
  style: "body2"
2526
- }, t("notConnectedDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2535
+ }, t("neetoGithub.notConnectedDescription")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2527
2536
  href: installationUrl,
2528
2537
  icon: misc.Github,
2529
2538
  iconPosition: "left",
2530
- label: t("connectGithub"),
2539
+ label: t("neetoGithub.connectGithub"),
2531
2540
  size: "medium",
2532
2541
  style: "primary"
2533
2542
  }));
@@ -2561,14 +2570,14 @@ var Private = function Private(_ref) {
2561
2570
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2562
2571
  className: "mb-2 pb-5 text-lg font-medium",
2563
2572
  style: "h2"
2564
- }, t("connectARepo")), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
2573
+ }, t("neetoGithub.connectARepo")), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
2565
2574
  className: "flex w-full flex-col space-y-6"
2566
2575
  }, /*#__PURE__*/React__default["default"].createElement(Search__default["default"], {
2567
2576
  onSearch: onSearch,
2568
2577
  className: "w-full",
2569
2578
  suffix: /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2570
2579
  style: "body2"
2571
- }, t("countOf.repos", {
2580
+ }, t("neetoGithub.countOf.repos", {
2572
2581
  count: filteredRepositories.length
2573
2582
  }))
2574
2583
  }), /*#__PURE__*/React__default["default"].createElement(List, {
@@ -2605,11 +2614,11 @@ var Public = function Public(_ref) {
2605
2614
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2606
2615
  className: "text-lg font-medium",
2607
2616
  style: "h2"
2608
- }, t("publicGitRepo")), /*#__PURE__*/React__default["default"].createElement("div", {
2617
+ }, t("neetoGithub.publicGitRepo")), /*#__PURE__*/React__default["default"].createElement("div", {
2609
2618
  className: "neeto-ui-text-gray-900 mt-2 flex max-w-xl space-x-1 font-sans text-sm font-normal leading-6 antialiased"
2610
2619
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2611
2620
  style: "body2"
2612
- }, t("publicGitRepoDescription")))))), /*#__PURE__*/React__default["default"].createElement("div", {
2621
+ }, t("neetoGithub.publicGitRepoDescription")))))), /*#__PURE__*/React__default["default"].createElement("div", {
2613
2622
  className: "neeto-ui-text-gray-900 font-sans text-sm font-normal leading-6 antialiased"
2614
2623
  }, /*#__PURE__*/React__default["default"].createElement("div", {
2615
2624
  className: "flex"
@@ -2621,7 +2630,7 @@ var Public = function Public(_ref) {
2621
2630
  nakedInput: true,
2622
2631
  autocomplete: "false",
2623
2632
  className: "relative rounded-b rounded-l rounded-r-none rounded-t border-b border-l border-r-0 border-t border-solid px-2",
2624
- placeholder: t("publicGitRepoPlaceholder"),
2633
+ placeholder: t("neetoGithub.publicGitRepoPlaceholder"),
2625
2634
  size: "large",
2626
2635
  spellcheck: "false",
2627
2636
  type: "text",
@@ -2638,15 +2647,19 @@ var Public = function Public(_ref) {
2638
2647
  style: "primary",
2639
2648
  type: "button",
2640
2649
  onClick: function onClick() {
2641
- return onConnect("public", {
2642
- fullName: publicRepoUrl
2650
+ return onConnect({
2651
+ repoType: "public",
2652
+ repository: {
2653
+ fullName: publicRepoUrl
2654
+ }
2643
2655
  });
2644
2656
  }
2645
- }, t("continue"))))));
2657
+ }, t("neetoGithub.continue"))))));
2646
2658
  };
2647
2659
 
2648
2660
  var Repositories = function Repositories(_ref) {
2649
2661
  var isConnected = _ref.isConnected,
2662
+ isPublicRepoAllowed = _ref.isPublicRepoAllowed,
2650
2663
  repositories = _ref.repositories,
2651
2664
  onConnect = _ref.onConnect,
2652
2665
  installationUrl = _ref.installationUrl,
@@ -2659,7 +2672,7 @@ var Repositories = function Repositories(_ref) {
2659
2672
  onConnect: onConnect,
2660
2673
  repositories: repositories,
2661
2674
  troubleshootUrl: troubleshootUrl
2662
- }), /*#__PURE__*/React__default["default"].createElement(Public, {
2675
+ }), isPublicRepoAllowed && /*#__PURE__*/React__default["default"].createElement(Public, {
2663
2676
  onConnect: onConnect
2664
2677
  }));
2665
2678
  };
@@ -2669,6 +2682,8 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
2669
2682
  onClose = _ref.onClose,
2670
2683
  _ref$isConnected = _ref.isConnected,
2671
2684
  isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
2685
+ _ref$isPublicRepoAllo = _ref.isPublicRepoAllowed,
2686
+ isPublicRepoAllowed = _ref$isPublicRepoAllo === void 0 ? false : _ref$isPublicRepoAllo,
2672
2687
  _ref$repositories = _ref.repositories,
2673
2688
  repositories = _ref$repositories === void 0 ? [] : _ref$repositories,
2674
2689
  _ref$accounts = _ref.accounts,
@@ -2690,16 +2705,17 @@ var NeetoGithubNanoModal = function NeetoGithubNanoModal(_ref) {
2690
2705
  size: "large"
2691
2706
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2692
2707
  style: "h2"
2693
- }, t("neetoGithubNanoModal.title")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2708
+ }, t("neetoGithub.modal.title")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2694
2709
  className: "mt-4",
2695
2710
  style: "body2"
2696
- }, t("neetoGithubNanoModal.description"))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement("div", {
2711
+ }, t("neetoGithub.modal.description"))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement("div", {
2697
2712
  className: "w-full 2xl:max-w-7xl"
2698
2713
  }, /*#__PURE__*/React__default["default"].createElement("div", {
2699
2714
  className: "flex flex-col-reverse 2xl:flex-row"
2700
2715
  }, /*#__PURE__*/React__default["default"].createElement(Repositories, {
2701
2716
  installationUrl: installationUrl,
2702
2717
  isConnected: isConnected,
2718
+ isPublicRepoAllowed: isPublicRepoAllowed,
2703
2719
  onConnect: onConnect,
2704
2720
  repositories: repositories,
2705
2721
  troubleshootUrl: troubleshootUrl