@bigbinary/neeto-webhooks-frontend 1.7.0-beta1 → 2.0.0
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 +2 -1
- package/dist/index.cjs.js +48 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +46 -27
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/types.d.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ import { t as t$1 } from 'i18next';
|
|
|
24
24
|
import { prop, pluck, assoc } from 'ramda';
|
|
25
25
|
import Alert from '@bigbinary/neetoui/Alert';
|
|
26
26
|
import { useMutationWithInvalidation, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
27
|
-
import
|
|
27
|
+
import Plus from '@bigbinary/neeto-icons/Plus';
|
|
28
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';
|
|
@@ -653,7 +653,8 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
653
653
|
t = _useTranslation.t;
|
|
654
654
|
var status = delivery.status,
|
|
655
655
|
identifier = delivery.identifier,
|
|
656
|
-
responseStatusCode = delivery.responseStatusCode
|
|
656
|
+
responseStatusCode = delivery.responseStatusCode,
|
|
657
|
+
sid = delivery.sid;
|
|
657
658
|
var renderPayload = function renderPayload() {
|
|
658
659
|
try {
|
|
659
660
|
return JSON.stringify(JSON.parse(delivery.requestBody), null, 2);
|
|
@@ -668,7 +669,15 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
668
669
|
className: "flex w-full flex-col space-y-2 pb-4",
|
|
669
670
|
children: [/*#__PURE__*/jsxs("span", {
|
|
670
671
|
className: "flex items-center space-x-1",
|
|
671
|
-
children: [t("neetoWebhooks.delivery.
|
|
672
|
+
children: [t("neetoWebhooks.delivery.sid"), ":", /*#__PURE__*/jsx(Typography, {
|
|
673
|
+
className: "px-2 font-bold",
|
|
674
|
+
"data-cy": "delivery-sid",
|
|
675
|
+
style: "body2",
|
|
676
|
+
children: sid
|
|
677
|
+
})]
|
|
678
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
679
|
+
className: "flex items-center space-x-1",
|
|
680
|
+
children: [t("neetoWebhooks.delivery.deliveryId"), ":", /*#__PURE__*/jsx(Typography, {
|
|
672
681
|
className: "px-2 font-bold",
|
|
673
682
|
"data-cy": "delivery-identifier",
|
|
674
683
|
style: "body2",
|
|
@@ -834,9 +843,9 @@ var Details = function Details(_ref) {
|
|
|
834
843
|
};
|
|
835
844
|
|
|
836
845
|
var buildColumns$1 = function buildColumns(_ref) {
|
|
837
|
-
var
|
|
846
|
+
var deliveryDetailsPath = _ref.deliveryDetailsPath;
|
|
838
847
|
return [{
|
|
839
|
-
title: t$1("neetoWebhooks.delivery.
|
|
848
|
+
title: t$1("neetoWebhooks.delivery.deliveryId"),
|
|
840
849
|
key: "identifier",
|
|
841
850
|
dataIndex: "identifier",
|
|
842
851
|
width: 390,
|
|
@@ -845,10 +854,10 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
845
854
|
className: "flex items-center gap-x-3",
|
|
846
855
|
children: [/*#__PURE__*/jsx(Button, {
|
|
847
856
|
style: "link",
|
|
857
|
+
to: buildUrl(deliveryDetailsPath, {
|
|
858
|
+
deliveryId: delivery.sid
|
|
859
|
+
}),
|
|
848
860
|
weight: "semibold",
|
|
849
|
-
onClick: function onClick() {
|
|
850
|
-
return handleDetailsClick(delivery.sid);
|
|
851
|
-
},
|
|
852
861
|
children: delivery.identifier
|
|
853
862
|
}), delivery.redelivery && /*#__PURE__*/jsx(Tag, {
|
|
854
863
|
style: "info",
|
|
@@ -938,11 +947,6 @@ var Deliveries = function Deliveries(_ref) {
|
|
|
938
947
|
link: window.location.pathname,
|
|
939
948
|
text: endpoint
|
|
940
949
|
}]);
|
|
941
|
-
var handleDetailsClick = function handleDetailsClick(sid) {
|
|
942
|
-
return history.push(buildUrl(deliveryDetailsPath, {
|
|
943
|
-
deliveryId: sid
|
|
944
|
-
}));
|
|
945
|
-
};
|
|
946
950
|
var handleClose = function handleClose() {
|
|
947
951
|
history.push(buildUrl(deliveriesPath, {
|
|
948
952
|
webhookId: webhookId
|
|
@@ -960,7 +964,7 @@ var Deliveries = function Deliveries(_ref) {
|
|
|
960
964
|
totalCount: totalCount,
|
|
961
965
|
fixedHeight: true,
|
|
962
966
|
columnData: buildColumns$1({
|
|
963
|
-
|
|
967
|
+
deliveryDetailsPath: deliveryDetailsPath
|
|
964
968
|
}),
|
|
965
969
|
currentPageNumber: pageNumber,
|
|
966
970
|
defaultPageSize: DEFAULT_PAGE_SIZE,
|
|
@@ -1024,7 +1028,7 @@ var useFetchWebhooks = function useFetchWebhooks(params) {
|
|
|
1024
1028
|
};
|
|
1025
1029
|
var useCreateWebhook = function useCreateWebhook(options) {
|
|
1026
1030
|
return useMutationWithInvalidation(webhooksApi.create, {
|
|
1027
|
-
keysToInvalidate: [QUERY_KEYS.WEBHOOK_LIST],
|
|
1031
|
+
keysToInvalidate: [[QUERY_KEYS.WEBHOOK_LIST]],
|
|
1028
1032
|
onSuccess: function onSuccess() {
|
|
1029
1033
|
var _options$onSuccess;
|
|
1030
1034
|
options === null || options === void 0 || (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 || _options$onSuccess.call(options);
|
|
@@ -1056,7 +1060,7 @@ var useUpdateWebhook = function useUpdateWebhook(id, options) {
|
|
|
1056
1060
|
};
|
|
1057
1061
|
var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
1058
1062
|
return useMutationWithInvalidation(webhooksApi.destroy, {
|
|
1059
|
-
keysToInvalidate: [QUERY_KEYS.WEBHOOK_LIST],
|
|
1063
|
+
keysToInvalidate: [[QUERY_KEYS.WEBHOOK_LIST]],
|
|
1060
1064
|
onSuccess: function onSuccess() {
|
|
1061
1065
|
var _options$onSuccess3;
|
|
1062
1066
|
options === null || options === void 0 || (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 || _options$onSuccess3.call(options);
|
|
@@ -1455,10 +1459,13 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1455
1459
|
var Header = withT(function (_ref) {
|
|
1456
1460
|
var t = _ref.t,
|
|
1457
1461
|
breadcrumbs = _ref.breadcrumbs,
|
|
1458
|
-
|
|
1462
|
+
title = _ref.title,
|
|
1463
|
+
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
|
|
1464
|
+
headerSize = _ref.headerSize;
|
|
1459
1465
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
1460
1466
|
children: [/*#__PURE__*/jsx(Header$2, {
|
|
1461
1467
|
breadcrumbs: breadcrumbs,
|
|
1468
|
+
size: headerSize,
|
|
1462
1469
|
actionBlock: /*#__PURE__*/jsx(Button, {
|
|
1463
1470
|
"data-cy": "add-new-webhook-button",
|
|
1464
1471
|
label: t("neetoWebhooks.webhook.add"),
|
|
@@ -1466,7 +1473,7 @@ var Header = withT(function (_ref) {
|
|
|
1466
1473
|
return setIsAddWebhookPaneOpen(true);
|
|
1467
1474
|
}
|
|
1468
1475
|
}),
|
|
1469
|
-
title: /*#__PURE__*/jsxs("div", {
|
|
1476
|
+
title: title || /*#__PURE__*/jsxs("div", {
|
|
1470
1477
|
className: "flex items-center gap-x-2",
|
|
1471
1478
|
children: [t("neetoWebhooks.webhook.title"), /*#__PURE__*/jsx(HelpPopover, {
|
|
1472
1479
|
description: t("neetoWebhooks.webhook.helpDescription"),
|
|
@@ -1491,9 +1498,13 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1491
1498
|
var deliveriesPath = _ref.deliveriesPath,
|
|
1492
1499
|
entityType = _ref.entityType,
|
|
1493
1500
|
breadcrumbs = _ref.breadcrumbs,
|
|
1501
|
+
title = _ref.title,
|
|
1494
1502
|
entityId = _ref.entityId,
|
|
1495
1503
|
onCreate = _ref.onCreate,
|
|
1496
|
-
onDelete = _ref.onDelete
|
|
1504
|
+
onDelete = _ref.onDelete,
|
|
1505
|
+
headerSize = _ref.headerSize,
|
|
1506
|
+
_ref$containerClassNa = _ref.containerClassName,
|
|
1507
|
+
containerClassName = _ref$containerClassNa === void 0 ? "" : _ref$containerClassNa;
|
|
1497
1508
|
var _useState = useState(null),
|
|
1498
1509
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1499
1510
|
editingWebhookId = _useState2[0],
|
|
@@ -1553,10 +1564,12 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1553
1564
|
return /*#__PURE__*/jsx(PageLoader, {});
|
|
1554
1565
|
}
|
|
1555
1566
|
return /*#__PURE__*/jsxs(Container, {
|
|
1556
|
-
className:
|
|
1567
|
+
className: containerClassName,
|
|
1557
1568
|
children: [/*#__PURE__*/jsx(Header$1, {
|
|
1558
1569
|
breadcrumbs: breadcrumbs,
|
|
1559
|
-
|
|
1570
|
+
headerSize: headerSize,
|
|
1571
|
+
setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
|
|
1572
|
+
title: title
|
|
1560
1573
|
}), isNotEmpty(webhooks) ? /*#__PURE__*/jsx(TableWrapper, {
|
|
1561
1574
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
1562
1575
|
children: /*#__PURE__*/jsx(Table, {
|
|
@@ -1577,12 +1590,12 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1577
1590
|
className: "flex h-full w-full items-center justify-center",
|
|
1578
1591
|
children: /*#__PURE__*/jsx(NoData, {
|
|
1579
1592
|
title: t("neetoWebhooks.webhook.empty"),
|
|
1580
|
-
helpText: /*#__PURE__*/jsx(
|
|
1581
|
-
className: "neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium",
|
|
1593
|
+
helpText: /*#__PURE__*/jsx(Button, {
|
|
1582
1594
|
href: WEBHOOK_HELP_URL,
|
|
1595
|
+
label: t("neetoWebhooks.webhook.emptyHelpText"),
|
|
1583
1596
|
rel: "noreferrer",
|
|
1584
|
-
|
|
1585
|
-
|
|
1597
|
+
style: "link",
|
|
1598
|
+
target: "_blank"
|
|
1586
1599
|
}),
|
|
1587
1600
|
primaryButtonProps: {
|
|
1588
1601
|
label: t("neetoWebhooks.webhook.add"),
|
|
@@ -1627,8 +1640,11 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1627
1640
|
entityId = _ref.entityId,
|
|
1628
1641
|
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
1629
1642
|
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
1643
|
+
title = _ref.title,
|
|
1630
1644
|
onCreate = _ref.onCreate,
|
|
1631
|
-
onDelete = _ref.onDelete
|
|
1645
|
+
onDelete = _ref.onDelete,
|
|
1646
|
+
headerSize = _ref.headerSize,
|
|
1647
|
+
containerClassName = _ref.containerClassName;
|
|
1632
1648
|
var _useRouteMatch = useRouteMatch(),
|
|
1633
1649
|
webhooksPath = _useRouteMatch.path,
|
|
1634
1650
|
webhooksUrl = _useRouteMatch.url;
|
|
@@ -1641,11 +1657,14 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1641
1657
|
component: function component() {
|
|
1642
1658
|
return /*#__PURE__*/jsx(Webhooks$1, {
|
|
1643
1659
|
breadcrumbs: breadcrumbs,
|
|
1660
|
+
containerClassName: containerClassName,
|
|
1644
1661
|
deliveriesPath: deliveriesPath,
|
|
1645
1662
|
entityId: entityId,
|
|
1646
1663
|
entityType: entityType,
|
|
1664
|
+
headerSize: headerSize,
|
|
1647
1665
|
onCreate: onCreate,
|
|
1648
|
-
onDelete: onDelete
|
|
1666
|
+
onDelete: onDelete,
|
|
1667
|
+
title: title
|
|
1649
1668
|
});
|
|
1650
1669
|
}
|
|
1651
1670
|
}), /*#__PURE__*/jsx(Route, {
|