@bigbinary/neeto-webhooks-frontend 2.0.1 → 2.0.2

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.
@@ -41,6 +41,7 @@
41
41
  "payload": "Payload",
42
42
  "deliveryId": "Delivery ID",
43
43
  "sid": "ID",
44
+ "helpDescription": "Details related to the response received when the product interacts with the endpoint specified in the webhook.",
44
45
  "empty": {
45
46
  "title": "There are no deliveries to show.",
46
47
  "description": "No events have been sent to this webhook"
package/dist/index.cjs.js CHANGED
@@ -3,12 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
+ var ramda = require('ramda');
6
7
  var reactRouterDom = require('react-router-dom');
7
8
  var neetoCist = require('@bigbinary/neeto-cist');
8
9
  var constants = require('@bigbinary/neeto-commons-frontend/constants');
9
10
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
10
11
  var Container = require('@bigbinary/neeto-molecules/Container');
11
12
  var Header$2 = require('@bigbinary/neeto-molecules/Header');
13
+ var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
12
14
  var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
13
15
  var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
14
16
  var NoData = require('@bigbinary/neetoui/NoData');
@@ -26,10 +28,8 @@ var Tab = require('@bigbinary/neetoui/Tab');
26
28
  var Tag = require('@bigbinary/neetoui/Tag');
27
29
  var i18next = require('i18next');
28
30
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
29
- var ramda = require('ramda');
30
31
  var Alert = require('@bigbinary/neetoui/Alert');
31
32
  var Plus = require('@bigbinary/neeto-icons/Plus');
32
- var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
33
33
  var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
34
34
  var Spinner = require('@bigbinary/neetoui/Spinner');
35
35
  var Input = require('@bigbinary/neetoui/formik/Input');
@@ -63,6 +63,7 @@ function _interopNamespace(e) {
63
63
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
64
64
  var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
65
65
  var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header$2);
66
+ var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
66
67
  var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
67
68
  var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
68
69
  var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
@@ -76,7 +77,6 @@ var Tab__default = /*#__PURE__*/_interopDefaultLegacy(Tab);
76
77
  var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
77
78
  var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
78
79
  var Plus__default = /*#__PURE__*/_interopDefaultLegacy(Plus);
79
- var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
80
80
  var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
81
81
  var Spinner__default = /*#__PURE__*/_interopDefaultLegacy(Spinner);
82
82
  var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
@@ -87,6 +87,12 @@ var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
87
87
  var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
88
88
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
89
89
 
90
+ var HELP_LINK_URLS = {
91
+ webhook: "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2",
92
+ secrets: "https://neetocalhelp.neetokb.com/p/a-80de90bd",
93
+ deliveries: "https://help.neetocal.com/articles/managing-webhook-deliveries"
94
+ };
95
+
90
96
  var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
91
97
  return "".concat(webhooksPath, "/:webhookId/deliveries");
92
98
  };
@@ -961,7 +967,8 @@ var buildColumns$1 = function buildColumns(_ref) {
961
967
 
962
968
  var Deliveries = function Deliveries(_ref) {
963
969
  var webhooksUrl = _ref.webhooksUrl,
964
- hostBreadcrumbs = _ref.breadcrumbs;
970
+ hostBreadcrumbs = _ref.breadcrumbs,
971
+ helpLink = _ref.helpLink;
965
972
  var _useRouteMatch = reactRouterDom.useRouteMatch(),
966
973
  deliveriesUrl = _useRouteMatch.url;
967
974
  var history = reactRouterDom.useHistory();
@@ -1001,7 +1008,16 @@ var Deliveries = function Deliveries(_ref) {
1001
1008
  className: "w-full",
1002
1009
  children: [/*#__PURE__*/jsxRuntime.jsx(Header__default["default"], {
1003
1010
  breadcrumbs: breadcrumbs,
1004
- title: t("neetoWebhooks.delivery.title")
1011
+ title: /*#__PURE__*/jsxRuntime.jsxs("div", {
1012
+ className: "flex items-center gap-x-2",
1013
+ children: [t("neetoWebhooks.delivery.title"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1014
+ description: t("neetoWebhooks.delivery.helpDescription"),
1015
+ helpLinkProps: {
1016
+ href: helpLink
1017
+ },
1018
+ title: t("neetoWebhooks.delivery.title")
1019
+ })]
1020
+ })
1005
1021
  }), neetoCist.isNotEmpty(deliveries) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
1006
1022
  hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
1007
1023
  children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
@@ -1113,9 +1129,6 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
1113
1129
  });
1114
1130
  };
1115
1131
 
1116
- var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
1117
- var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
1118
-
1119
1132
  var baseUrl = "/webhooks/events/all";
1120
1133
  var all = function all() {
1121
1134
  return axios__default["default"].get(baseUrl);
@@ -1320,7 +1333,9 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1320
1333
  isOpen = _ref.isOpen,
1321
1334
  onClose = _ref.onClose,
1322
1335
  onCreate = _ref.onCreate,
1323
- webhooks = _ref.webhooks;
1336
+ webhooks = _ref.webhooks,
1337
+ webhookHelpLink = _ref.webhookHelpLink,
1338
+ secretsHelpLink = _ref.secretsHelpLink;
1324
1339
  var _useTranslation = reactI18next.useTranslation(),
1325
1340
  t = _useTranslation.t;
1326
1341
  var _useState = React.useState(false),
@@ -1400,7 +1415,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1400
1415
  }), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1401
1416
  description: t("neetoWebhooks.webhook.helpDescription"),
1402
1417
  helpLinkProps: {
1403
- href: WEBHOOK_HELP_URL
1418
+ href: webhookHelpLink
1404
1419
  },
1405
1420
  title: t("neetoWebhooks.webhook.title")
1406
1421
  })]
@@ -1448,7 +1463,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1448
1463
  className: "flex items-center gap-x-2",
1449
1464
  children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1450
1465
  helpLinkProps: {
1451
- href: WEBHOOK_SECRETS_HELP_URL
1466
+ href: secretsHelpLink
1452
1467
  },
1453
1468
  description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
1454
1469
  title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
@@ -1506,7 +1521,8 @@ var Header = reactUtils.withT(function (_ref) {
1506
1521
  breadcrumbs = _ref.breadcrumbs,
1507
1522
  title = _ref.title,
1508
1523
  setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
1509
- headerSize = _ref.headerSize;
1524
+ headerSize = _ref.headerSize,
1525
+ webhookHelpLink = _ref.webhookHelpLink;
1510
1526
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1511
1527
  children: [/*#__PURE__*/jsxRuntime.jsx(Header__default["default"], {
1512
1528
  breadcrumbs: breadcrumbs,
@@ -1523,7 +1539,7 @@ var Header = reactUtils.withT(function (_ref) {
1523
1539
  children: [t("neetoWebhooks.webhook.title"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1524
1540
  description: t("neetoWebhooks.webhook.helpDescription"),
1525
1541
  helpLinkProps: {
1526
- href: WEBHOOK_HELP_URL
1542
+ href: webhookHelpLink
1527
1543
  },
1528
1544
  title: t("neetoWebhooks.webhook.title")
1529
1545
  })]
@@ -1549,7 +1565,9 @@ var Webhooks = function Webhooks(_ref) {
1549
1565
  onDelete = _ref.onDelete,
1550
1566
  headerSize = _ref.headerSize,
1551
1567
  _ref$containerClassNa = _ref.containerClassName,
1552
- containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa;
1568
+ containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa,
1569
+ webhookHelpLink = _ref.webhookHelpLink,
1570
+ secretsHelpLink = _ref.secretsHelpLink;
1553
1571
  var _useState = React.useState(null),
1554
1572
  _useState2 = _slicedToArray(_useState, 2),
1555
1573
  editingWebhookId = _useState2[0],
@@ -1613,7 +1631,8 @@ var Webhooks = function Webhooks(_ref) {
1613
1631
  breadcrumbs: breadcrumbs,
1614
1632
  headerSize: headerSize,
1615
1633
  setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
1616
- title: title
1634
+ title: title,
1635
+ webhookHelpLink: webhookHelpLink
1617
1636
  }), neetoCist.isNotEmpty(webhooks) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
1618
1637
  hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
1619
1638
  children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
@@ -1634,7 +1653,7 @@ var Webhooks = function Webhooks(_ref) {
1634
1653
  children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], {
1635
1654
  title: t("neetoWebhooks.webhook.empty"),
1636
1655
  helpText: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
1637
- href: WEBHOOK_HELP_URL,
1656
+ href: webhookHelpLink,
1638
1657
  label: t("neetoWebhooks.webhook.emptyHelpText"),
1639
1658
  rel: "noreferrer",
1640
1659
  style: "link",
@@ -1652,6 +1671,8 @@ var Webhooks = function Webhooks(_ref) {
1652
1671
  entityId: entityId,
1653
1672
  entityType: entityType,
1654
1673
  onCreate: onCreate,
1674
+ secretsHelpLink: secretsHelpLink,
1675
+ webhookHelpLink: webhookHelpLink,
1655
1676
  webhooks: webhooks,
1656
1677
  isOpen: isAddWebhookPaneOpen,
1657
1678
  onClose: handlePaneClose
@@ -1687,12 +1708,15 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1687
1708
  onCreate = _ref.onCreate,
1688
1709
  onDelete = _ref.onDelete,
1689
1710
  headerSize = _ref.headerSize,
1711
+ _ref$helpLinkUrls = _ref.helpLinkUrls,
1712
+ helpLinkUrls = _ref$helpLinkUrls === void 0 ? {} : _ref$helpLinkUrls,
1690
1713
  containerClassName = _ref.containerClassName;
1691
1714
  var _useRouteMatch = reactRouterDom.useRouteMatch(),
1692
1715
  webhooksPath = _useRouteMatch.path,
1693
1716
  webhooksUrl = _useRouteMatch.url;
1694
1717
  var deliveriesPath = getDeliveriesPath(webhooksUrl);
1695
1718
  var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
1719
+ var helpLinks = ramda.mergeRight(HELP_LINK_URLS, helpLinkUrls);
1696
1720
  return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
1697
1721
  children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1698
1722
  exact: true,
@@ -1707,7 +1731,9 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1707
1731
  headerSize: headerSize,
1708
1732
  onCreate: onCreate,
1709
1733
  onDelete: onDelete,
1710
- title: title
1734
+ title: title,
1735
+ secretsHelpLink: helpLinks.secrets,
1736
+ webhookHelpLink: helpLinks.webhook
1711
1737
  });
1712
1738
  }
1713
1739
  }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
@@ -1716,17 +1742,19 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1716
1742
  render: function render() {
1717
1743
  return /*#__PURE__*/jsxRuntime.jsx(Deliveries$1, {
1718
1744
  breadcrumbs: breadcrumbs,
1719
- webhooksUrl: webhooksUrl
1745
+ webhooksUrl: webhooksUrl,
1746
+ helpLink: helpLinks.deliveries
1720
1747
  });
1721
1748
  }
1722
1749
  }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1750
+ path: deliveriesPath,
1723
1751
  component: function component() {
1724
1752
  return /*#__PURE__*/jsxRuntime.jsx(Deliveries$1, {
1725
1753
  breadcrumbs: breadcrumbs,
1726
- webhooksUrl: webhooksUrl
1754
+ webhooksUrl: webhooksUrl,
1755
+ helpLink: helpLinks.deliveries
1727
1756
  });
1728
- },
1729
- path: deliveriesPath
1757
+ }
1730
1758
  })]
1731
1759
  });
1732
1760
  };