@bigbinary/neeto-webhooks-frontend 2.1.1 → 2.1.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,7 +1,6 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var ramda = require('ramda');
5
4
  var reactRouterDom = require('react-router-dom');
6
5
  var neetoCist = require('@bigbinary/neeto-cist');
7
6
  var constants = require('@bigbinary/neeto-commons-frontend/constants');
@@ -18,6 +17,7 @@ var reactQuery = require('@tanstack/react-query');
18
17
  var reactQueryDevtools = require('@tanstack/react-query-devtools');
19
18
  var jsxRuntime = require('react/jsx-runtime');
20
19
  var axios = require('axios');
20
+ var initializers = require('@bigbinary/neeto-commons-frontend/initializers');
21
21
  var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
22
22
  var Button = require('@bigbinary/neetoui/Button');
23
23
  var Pane = require('@bigbinary/neetoui/Pane');
@@ -26,6 +26,7 @@ var Tab = require('@bigbinary/neetoui/Tab');
26
26
  var Tag = require('@bigbinary/neetoui/Tag');
27
27
  var i18next = require('i18next');
28
28
  var utils = require('@bigbinary/neeto-commons-frontend/utils');
29
+ var ramda = require('ramda');
29
30
  var Alert = require('@bigbinary/neetoui/Alert');
30
31
  var Plus = require('@bigbinary/neeto-icons/Plus');
31
32
  var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
@@ -85,12 +86,6 @@ var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
85
86
  var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
86
87
  var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
87
88
 
88
- var HELP_LINK_URLS = {
89
- webhook: "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2",
90
- secrets: "https://neetocalhelp.neetokb.com/p/a-80de90bd",
91
- deliveries: "https://help.neetocal.com/articles/managing-webhook-deliveries"
92
- };
93
-
94
89
  var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
95
90
  return "".concat(webhooksPath, "/:webhookId/deliveries");
96
91
  };
@@ -258,6 +253,12 @@ var useRedeliverWebhook = function useRedeliverWebhook(deliveryId, webhookSid) {
258
253
  });
259
254
  };
260
255
 
256
+ var HELP_LINK_URLS = {
257
+ webhook: "https://help.".concat(initializers.globalProps.appName, ".com/articles/creating-a-webhook"),
258
+ secrets: "https://help.".concat(initializers.globalProps.appName, ".com/articles/securing-webhook-requests"),
259
+ deliveries: "https://help.".concat(initializers.globalProps.appName, ".com/articles/managing-webhook-deliveries")
260
+ };
261
+
261
262
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
262
263
  try {
263
264
  var info = gen[key](arg);
@@ -962,8 +963,7 @@ var buildColumns$1 = function buildColumns(_ref) {
962
963
 
963
964
  var Deliveries = function Deliveries(_ref) {
964
965
  var webhooksUrl = _ref.webhooksUrl,
965
- hostBreadcrumbs = _ref.breadcrumbs,
966
- helpLink = _ref.helpLink;
966
+ hostBreadcrumbs = _ref.breadcrumbs;
967
967
  var _useRouteMatch = reactRouterDom.useRouteMatch(),
968
968
  deliveriesUrl = _useRouteMatch.url;
969
969
  var history = reactRouterDom.useHistory();
@@ -1008,7 +1008,7 @@ var Deliveries = function Deliveries(_ref) {
1008
1008
  children: [t("neetoWebhooks.delivery.title"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1009
1009
  description: t("neetoWebhooks.delivery.helpDescription"),
1010
1010
  helpLinkProps: {
1011
- href: helpLink
1011
+ href: HELP_LINK_URLS.deliveries
1012
1012
  },
1013
1013
  title: t("neetoWebhooks.delivery.title")
1014
1014
  })]
@@ -1328,9 +1328,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1328
1328
  isOpen = _ref.isOpen,
1329
1329
  onClose = _ref.onClose,
1330
1330
  onCreate = _ref.onCreate,
1331
- webhooks = _ref.webhooks,
1332
- webhookHelpLink = _ref.webhookHelpLink,
1333
- secretsHelpLink = _ref.secretsHelpLink;
1331
+ webhooks = _ref.webhooks;
1334
1332
  var _useTranslation = reactI18next.useTranslation(),
1335
1333
  t = _useTranslation.t;
1336
1334
  var _useState = React.useState(false),
@@ -1410,7 +1408,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1410
1408
  }), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1411
1409
  description: t("neetoWebhooks.webhook.helpDescription"),
1412
1410
  helpLinkProps: {
1413
- href: webhookHelpLink
1411
+ href: HELP_LINK_URLS.webhook
1414
1412
  },
1415
1413
  title: t("neetoWebhooks.webhook.title")
1416
1414
  })]
@@ -1458,7 +1456,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1458
1456
  className: "flex items-center gap-x-2",
1459
1457
  children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1460
1458
  helpLinkProps: {
1461
- href: secretsHelpLink
1459
+ href: HELP_LINK_URLS.secrets
1462
1460
  },
1463
1461
  description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
1464
1462
  title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
@@ -1516,8 +1514,7 @@ var Header = reactUtils.withT(function (_ref) {
1516
1514
  breadcrumbs = _ref.breadcrumbs,
1517
1515
  title = _ref.title,
1518
1516
  setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
1519
- headerSize = _ref.headerSize,
1520
- webhookHelpLink = _ref.webhookHelpLink;
1517
+ headerSize = _ref.headerSize;
1521
1518
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1522
1519
  children: [/*#__PURE__*/jsxRuntime.jsx(Header__default["default"], {
1523
1520
  breadcrumbs: breadcrumbs,
@@ -1534,7 +1531,7 @@ var Header = reactUtils.withT(function (_ref) {
1534
1531
  children: [t("neetoWebhooks.webhook.title"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
1535
1532
  description: t("neetoWebhooks.webhook.helpDescription"),
1536
1533
  helpLinkProps: {
1537
- href: webhookHelpLink
1534
+ href: HELP_LINK_URLS.webhook
1538
1535
  },
1539
1536
  title: t("neetoWebhooks.webhook.title")
1540
1537
  })]
@@ -1560,9 +1557,7 @@ var Webhooks = function Webhooks(_ref) {
1560
1557
  onDelete = _ref.onDelete,
1561
1558
  headerSize = _ref.headerSize,
1562
1559
  _ref$containerClassNa = _ref.containerClassName,
1563
- containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa,
1564
- webhookHelpLink = _ref.webhookHelpLink,
1565
- secretsHelpLink = _ref.secretsHelpLink;
1560
+ containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa;
1566
1561
  var _useState = React.useState(null),
1567
1562
  _useState2 = _slicedToArray(_useState, 2),
1568
1563
  editingWebhookId = _useState2[0],
@@ -1626,8 +1621,7 @@ var Webhooks = function Webhooks(_ref) {
1626
1621
  breadcrumbs: breadcrumbs,
1627
1622
  headerSize: headerSize,
1628
1623
  setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
1629
- title: title,
1630
- webhookHelpLink: webhookHelpLink
1624
+ title: title
1631
1625
  }), neetoCist.isNotEmpty(webhooks) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
1632
1626
  hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
1633
1627
  children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
@@ -1648,7 +1642,7 @@ var Webhooks = function Webhooks(_ref) {
1648
1642
  children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], {
1649
1643
  title: t("neetoWebhooks.webhook.empty"),
1650
1644
  helpText: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
1651
- href: webhookHelpLink,
1645
+ href: HELP_LINK_URLS.webhook,
1652
1646
  label: t("neetoWebhooks.webhook.emptyHelpText"),
1653
1647
  rel: "noreferrer",
1654
1648
  style: "link",
@@ -1666,8 +1660,6 @@ var Webhooks = function Webhooks(_ref) {
1666
1660
  entityId: entityId,
1667
1661
  entityType: entityType,
1668
1662
  onCreate: onCreate,
1669
- secretsHelpLink: secretsHelpLink,
1670
- webhookHelpLink: webhookHelpLink,
1671
1663
  webhooks: webhooks,
1672
1664
  isOpen: isAddWebhookPaneOpen,
1673
1665
  onClose: handlePaneClose
@@ -1708,15 +1700,12 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1708
1700
  onCreate = _ref.onCreate,
1709
1701
  onDelete = _ref.onDelete,
1710
1702
  headerSize = _ref.headerSize,
1711
- _ref$helpLinkUrls = _ref.helpLinkUrls,
1712
- helpLinkUrls = _ref$helpLinkUrls === void 0 ? {} : _ref$helpLinkUrls,
1713
1703
  containerClassName = _ref.containerClassName;
1714
1704
  var _useRouteMatch = reactRouterDom.useRouteMatch(),
1715
1705
  webhooksPath = _useRouteMatch.path,
1716
1706
  webhooksUrl = _useRouteMatch.url;
1717
1707
  var deliveriesPath = getDeliveriesPath(webhooksUrl);
1718
1708
  var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
1719
- var helpLinks = ramda.mergeRight(HELP_LINK_URLS, helpLinkUrls);
1720
1709
  return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
1721
1710
  children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
1722
1711
  exact: true,
@@ -1731,9 +1720,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1731
1720
  headerSize: headerSize,
1732
1721
  onCreate: onCreate,
1733
1722
  onDelete: onDelete,
1734
- title: title,
1735
- secretsHelpLink: helpLinks.secrets,
1736
- webhookHelpLink: helpLinks.webhook
1723
+ title: title
1737
1724
  });
1738
1725
  }
1739
1726
  }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
@@ -1742,8 +1729,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1742
1729
  render: function render() {
1743
1730
  return /*#__PURE__*/jsxRuntime.jsx(Deliveries$1, {
1744
1731
  breadcrumbs: breadcrumbs,
1745
- webhooksUrl: webhooksUrl,
1746
- helpLink: helpLinks.deliveries
1732
+ webhooksUrl: webhooksUrl
1747
1733
  });
1748
1734
  }
1749
1735
  }), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
@@ -1751,8 +1737,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1751
1737
  render: function render() {
1752
1738
  return /*#__PURE__*/jsxRuntime.jsx(Deliveries$1, {
1753
1739
  breadcrumbs: breadcrumbs,
1754
- webhooksUrl: webhooksUrl,
1755
- helpLink: helpLinks.deliveries
1740
+ webhooksUrl: webhooksUrl
1756
1741
  });
1757
1742
  }
1758
1743
  })]