@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.
- package/app/javascript/src/translations/en.json +1 -0
- package/dist/index.cjs.js +49 -21
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +48 -20
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
+
import { prop, pluck, assoc, mergeRight } from 'ramda';
|
|
2
3
|
import { useRouteMatch, useHistory, useParams, Switch as Switch$1, Route } from 'react-router-dom';
|
|
3
4
|
import { isNotPresent, isPresent, removeBy, isNotEmpty, removeById, findBy } from '@bigbinary/neeto-cist';
|
|
4
5
|
import { DEFAULT_STALE_TIME, SINGULAR, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX, PLURAL } from '@bigbinary/neeto-commons-frontend/constants';
|
|
5
6
|
import { useQueryParams, useMutationWithInvalidation, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
6
7
|
import Container from '@bigbinary/neeto-molecules/Container';
|
|
7
8
|
import Header$2 from '@bigbinary/neeto-molecules/Header';
|
|
9
|
+
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
8
10
|
import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
|
|
9
11
|
import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
|
|
10
12
|
import NoData from '@bigbinary/neetoui/NoData';
|
|
@@ -22,10 +24,8 @@ import Tab from '@bigbinary/neetoui/Tab';
|
|
|
22
24
|
import Tag from '@bigbinary/neetoui/Tag';
|
|
23
25
|
import { t as t$1 } from 'i18next';
|
|
24
26
|
import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
|
|
25
|
-
import { prop, pluck, assoc } from 'ramda';
|
|
26
27
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
27
28
|
import Plus from '@bigbinary/neeto-icons/Plus';
|
|
28
|
-
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
29
29
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
30
30
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
31
31
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
@@ -36,6 +36,12 @@ import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
|
36
36
|
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
37
37
|
import * as yup from 'yup';
|
|
38
38
|
|
|
39
|
+
var HELP_LINK_URLS = {
|
|
40
|
+
webhook: "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2",
|
|
41
|
+
secrets: "https://neetocalhelp.neetokb.com/p/a-80de90bd",
|
|
42
|
+
deliveries: "https://help.neetocal.com/articles/managing-webhook-deliveries"
|
|
43
|
+
};
|
|
44
|
+
|
|
39
45
|
var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
|
|
40
46
|
return "".concat(webhooksPath, "/:webhookId/deliveries");
|
|
41
47
|
};
|
|
@@ -910,7 +916,8 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
910
916
|
|
|
911
917
|
var Deliveries = function Deliveries(_ref) {
|
|
912
918
|
var webhooksUrl = _ref.webhooksUrl,
|
|
913
|
-
hostBreadcrumbs = _ref.breadcrumbs
|
|
919
|
+
hostBreadcrumbs = _ref.breadcrumbs,
|
|
920
|
+
helpLink = _ref.helpLink;
|
|
914
921
|
var _useRouteMatch = useRouteMatch(),
|
|
915
922
|
deliveriesUrl = _useRouteMatch.url;
|
|
916
923
|
var history = useHistory();
|
|
@@ -950,7 +957,16 @@ var Deliveries = function Deliveries(_ref) {
|
|
|
950
957
|
className: "w-full",
|
|
951
958
|
children: [/*#__PURE__*/jsx(Header$2, {
|
|
952
959
|
breadcrumbs: breadcrumbs,
|
|
953
|
-
title:
|
|
960
|
+
title: /*#__PURE__*/jsxs("div", {
|
|
961
|
+
className: "flex items-center gap-x-2",
|
|
962
|
+
children: [t("neetoWebhooks.delivery.title"), /*#__PURE__*/jsx(HelpPopover, {
|
|
963
|
+
description: t("neetoWebhooks.delivery.helpDescription"),
|
|
964
|
+
helpLinkProps: {
|
|
965
|
+
href: helpLink
|
|
966
|
+
},
|
|
967
|
+
title: t("neetoWebhooks.delivery.title")
|
|
968
|
+
})]
|
|
969
|
+
})
|
|
954
970
|
}), isNotEmpty(deliveries) ? /*#__PURE__*/jsx(TableWrapper, {
|
|
955
971
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
956
972
|
children: /*#__PURE__*/jsx(Table, {
|
|
@@ -1062,9 +1078,6 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
|
1062
1078
|
});
|
|
1063
1079
|
};
|
|
1064
1080
|
|
|
1065
|
-
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
1066
|
-
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
1067
|
-
|
|
1068
1081
|
var baseUrl = "/webhooks/events/all";
|
|
1069
1082
|
var all = function all() {
|
|
1070
1083
|
return axios.get(baseUrl);
|
|
@@ -1269,7 +1282,9 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1269
1282
|
isOpen = _ref.isOpen,
|
|
1270
1283
|
onClose = _ref.onClose,
|
|
1271
1284
|
onCreate = _ref.onCreate,
|
|
1272
|
-
webhooks = _ref.webhooks
|
|
1285
|
+
webhooks = _ref.webhooks,
|
|
1286
|
+
webhookHelpLink = _ref.webhookHelpLink,
|
|
1287
|
+
secretsHelpLink = _ref.secretsHelpLink;
|
|
1273
1288
|
var _useTranslation = useTranslation(),
|
|
1274
1289
|
t = _useTranslation.t;
|
|
1275
1290
|
var _useState = useState(false),
|
|
@@ -1349,7 +1364,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1349
1364
|
}), /*#__PURE__*/jsx(HelpPopover, {
|
|
1350
1365
|
description: t("neetoWebhooks.webhook.helpDescription"),
|
|
1351
1366
|
helpLinkProps: {
|
|
1352
|
-
href:
|
|
1367
|
+
href: webhookHelpLink
|
|
1353
1368
|
},
|
|
1354
1369
|
title: t("neetoWebhooks.webhook.title")
|
|
1355
1370
|
})]
|
|
@@ -1397,7 +1412,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1397
1412
|
className: "flex items-center gap-x-2",
|
|
1398
1413
|
children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsx(HelpPopover, {
|
|
1399
1414
|
helpLinkProps: {
|
|
1400
|
-
href:
|
|
1415
|
+
href: secretsHelpLink
|
|
1401
1416
|
},
|
|
1402
1417
|
description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
|
|
1403
1418
|
title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
|
|
@@ -1455,7 +1470,8 @@ var Header = withT(function (_ref) {
|
|
|
1455
1470
|
breadcrumbs = _ref.breadcrumbs,
|
|
1456
1471
|
title = _ref.title,
|
|
1457
1472
|
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
|
|
1458
|
-
headerSize = _ref.headerSize
|
|
1473
|
+
headerSize = _ref.headerSize,
|
|
1474
|
+
webhookHelpLink = _ref.webhookHelpLink;
|
|
1459
1475
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1460
1476
|
children: [/*#__PURE__*/jsx(Header$2, {
|
|
1461
1477
|
breadcrumbs: breadcrumbs,
|
|
@@ -1472,7 +1488,7 @@ var Header = withT(function (_ref) {
|
|
|
1472
1488
|
children: [t("neetoWebhooks.webhook.title"), /*#__PURE__*/jsx(HelpPopover, {
|
|
1473
1489
|
description: t("neetoWebhooks.webhook.helpDescription"),
|
|
1474
1490
|
helpLinkProps: {
|
|
1475
|
-
href:
|
|
1491
|
+
href: webhookHelpLink
|
|
1476
1492
|
},
|
|
1477
1493
|
title: t("neetoWebhooks.webhook.title")
|
|
1478
1494
|
})]
|
|
@@ -1498,7 +1514,9 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1498
1514
|
onDelete = _ref.onDelete,
|
|
1499
1515
|
headerSize = _ref.headerSize,
|
|
1500
1516
|
_ref$containerClassNa = _ref.containerClassName,
|
|
1501
|
-
containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa
|
|
1517
|
+
containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa,
|
|
1518
|
+
webhookHelpLink = _ref.webhookHelpLink,
|
|
1519
|
+
secretsHelpLink = _ref.secretsHelpLink;
|
|
1502
1520
|
var _useState = useState(null),
|
|
1503
1521
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1504
1522
|
editingWebhookId = _useState2[0],
|
|
@@ -1562,7 +1580,8 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1562
1580
|
breadcrumbs: breadcrumbs,
|
|
1563
1581
|
headerSize: headerSize,
|
|
1564
1582
|
setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
|
|
1565
|
-
title: title
|
|
1583
|
+
title: title,
|
|
1584
|
+
webhookHelpLink: webhookHelpLink
|
|
1566
1585
|
}), isNotEmpty(webhooks) ? /*#__PURE__*/jsx(TableWrapper, {
|
|
1567
1586
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
1568
1587
|
children: /*#__PURE__*/jsx(Table, {
|
|
@@ -1583,7 +1602,7 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1583
1602
|
children: /*#__PURE__*/jsx(NoData, {
|
|
1584
1603
|
title: t("neetoWebhooks.webhook.empty"),
|
|
1585
1604
|
helpText: /*#__PURE__*/jsx(Button, {
|
|
1586
|
-
href:
|
|
1605
|
+
href: webhookHelpLink,
|
|
1587
1606
|
label: t("neetoWebhooks.webhook.emptyHelpText"),
|
|
1588
1607
|
rel: "noreferrer",
|
|
1589
1608
|
style: "link",
|
|
@@ -1601,6 +1620,8 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1601
1620
|
entityId: entityId,
|
|
1602
1621
|
entityType: entityType,
|
|
1603
1622
|
onCreate: onCreate,
|
|
1623
|
+
secretsHelpLink: secretsHelpLink,
|
|
1624
|
+
webhookHelpLink: webhookHelpLink,
|
|
1604
1625
|
webhooks: webhooks,
|
|
1605
1626
|
isOpen: isAddWebhookPaneOpen,
|
|
1606
1627
|
onClose: handlePaneClose
|
|
@@ -1636,12 +1657,15 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1636
1657
|
onCreate = _ref.onCreate,
|
|
1637
1658
|
onDelete = _ref.onDelete,
|
|
1638
1659
|
headerSize = _ref.headerSize,
|
|
1660
|
+
_ref$helpLinkUrls = _ref.helpLinkUrls,
|
|
1661
|
+
helpLinkUrls = _ref$helpLinkUrls === void 0 ? {} : _ref$helpLinkUrls,
|
|
1639
1662
|
containerClassName = _ref.containerClassName;
|
|
1640
1663
|
var _useRouteMatch = useRouteMatch(),
|
|
1641
1664
|
webhooksPath = _useRouteMatch.path,
|
|
1642
1665
|
webhooksUrl = _useRouteMatch.url;
|
|
1643
1666
|
var deliveriesPath = getDeliveriesPath(webhooksUrl);
|
|
1644
1667
|
var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
|
|
1668
|
+
var helpLinks = mergeRight(HELP_LINK_URLS, helpLinkUrls);
|
|
1645
1669
|
return /*#__PURE__*/jsxs(Switch$1, {
|
|
1646
1670
|
children: [/*#__PURE__*/jsx(Route, {
|
|
1647
1671
|
exact: true,
|
|
@@ -1656,7 +1680,9 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1656
1680
|
headerSize: headerSize,
|
|
1657
1681
|
onCreate: onCreate,
|
|
1658
1682
|
onDelete: onDelete,
|
|
1659
|
-
title: title
|
|
1683
|
+
title: title,
|
|
1684
|
+
secretsHelpLink: helpLinks.secrets,
|
|
1685
|
+
webhookHelpLink: helpLinks.webhook
|
|
1660
1686
|
});
|
|
1661
1687
|
}
|
|
1662
1688
|
}), /*#__PURE__*/jsx(Route, {
|
|
@@ -1665,17 +1691,19 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1665
1691
|
render: function render() {
|
|
1666
1692
|
return /*#__PURE__*/jsx(Deliveries$1, {
|
|
1667
1693
|
breadcrumbs: breadcrumbs,
|
|
1668
|
-
webhooksUrl: webhooksUrl
|
|
1694
|
+
webhooksUrl: webhooksUrl,
|
|
1695
|
+
helpLink: helpLinks.deliveries
|
|
1669
1696
|
});
|
|
1670
1697
|
}
|
|
1671
1698
|
}), /*#__PURE__*/jsx(Route, {
|
|
1699
|
+
path: deliveriesPath,
|
|
1672
1700
|
component: function component() {
|
|
1673
1701
|
return /*#__PURE__*/jsx(Deliveries$1, {
|
|
1674
1702
|
breadcrumbs: breadcrumbs,
|
|
1675
|
-
webhooksUrl: webhooksUrl
|
|
1703
|
+
webhooksUrl: webhooksUrl,
|
|
1704
|
+
helpLink: helpLinks.deliveries
|
|
1676
1705
|
});
|
|
1677
|
-
}
|
|
1678
|
-
path: deliveriesPath
|
|
1706
|
+
}
|
|
1679
1707
|
})]
|
|
1680
1708
|
});
|
|
1681
1709
|
};
|