@bigbinary/neeto-webhooks-frontend 1.6.25 → 1.6.27

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/dist/index.js CHANGED
@@ -7,19 +7,34 @@ import Container from '@bigbinary/neeto-molecules/Container';
7
7
  import Header$2 from '@bigbinary/neeto-molecules/Header';
8
8
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
9
9
  import TableWrapper from '@bigbinary/neeto-molecules/TableWrapper';
10
- import { Typography, Tag, Tab, Pane, Button, Table, NoData, Spinner, Alert } from '@bigbinary/neetoui';
10
+ import NoData from '@bigbinary/neetoui/NoData';
11
+ import Table from '@bigbinary/neetoui/Table';
11
12
  import { useTranslation } from 'react-i18next';
12
13
  import { QueryClient, QueryCache, QueryClientProvider, useQuery, useQueryClient, useMutation } from 'react-query';
13
14
  import { ReactQueryDevtools } from 'react-query/devtools';
15
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
14
16
  import axios from 'axios';
15
17
  import DateFormat from '@bigbinary/neeto-molecules/DateFormat';
18
+ import Button from '@bigbinary/neetoui/Button';
19
+ import Pane from '@bigbinary/neetoui/Pane';
20
+ import Typography from '@bigbinary/neetoui/Typography';
21
+ import Tab from '@bigbinary/neetoui/Tab';
22
+ import Tag from '@bigbinary/neetoui/Tag';
16
23
  import { t as t$1 } from 'i18next';
17
24
  import { prop, pluck, assoc } from 'ramda';
25
+ import Alert from '@bigbinary/neetoui/Alert';
18
26
  import { Plus } from '@bigbinary/neeto-icons';
19
27
  import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
20
28
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
21
- import { Form, Textarea, Select, Input, Switch, ActionBlock } from '@bigbinary/neetoui/formik';
29
+ import Spinner from '@bigbinary/neetoui/Spinner';
30
+ import Input from '@bigbinary/neetoui/formik/Input';
31
+ import Form from '@bigbinary/neetoui/formik/Form';
32
+ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
33
+ import Select from '@bigbinary/neetoui/formik/Select';
34
+ import Switch from '@bigbinary/neetoui/formik/Switch';
35
+ import Textarea from '@bigbinary/neetoui/formik/Textarea';
22
36
  import * as yup from 'yup';
37
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
23
38
 
24
39
  var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
25
40
  return "".concat(webhooksPath, "/:webhookId/deliveries");
@@ -99,6 +114,47 @@ function _slicedToArray(arr, i) {
99
114
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
100
115
  }
101
116
 
117
+ function _typeof$1(o) {
118
+ "@babel/helpers - typeof";
119
+
120
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
121
+ return typeof o;
122
+ } : function (o) {
123
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
124
+ }, _typeof$1(o);
125
+ }
126
+
127
+ function _toPrimitive(input, hint) {
128
+ if (_typeof$1(input) !== "object" || input === null) return input;
129
+ var prim = input[Symbol.toPrimitive];
130
+ if (prim !== undefined) {
131
+ var res = prim.call(input, hint || "default");
132
+ if (_typeof$1(res) !== "object") return res;
133
+ throw new TypeError("@@toPrimitive must return a primitive value.");
134
+ }
135
+ return (hint === "string" ? String : Number)(input);
136
+ }
137
+
138
+ function _toPropertyKey(arg) {
139
+ var key = _toPrimitive(arg, "string");
140
+ return _typeof$1(key) === "symbol" ? key : String(key);
141
+ }
142
+
143
+ function _defineProperty(obj, key, value) {
144
+ key = _toPropertyKey(key);
145
+ if (key in obj) {
146
+ Object.defineProperty(obj, key, {
147
+ value: value,
148
+ enumerable: true,
149
+ configurable: true,
150
+ writable: true
151
+ });
152
+ } else {
153
+ obj[key] = value;
154
+ }
155
+ return obj;
156
+ }
157
+
102
158
  var queryClient = new QueryClient({
103
159
  queryCache: new QueryCache(),
104
160
  defaultOptions: {
@@ -108,15 +164,17 @@ var queryClient = new QueryClient({
108
164
  }
109
165
  });
110
166
 
111
- /* eslint-disable @bigbinary/neeto/file-name-and-export-name-standards */
167
+ function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
168
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
112
169
  var withReactQuery = function withReactQuery(Component) {
113
170
  var QueryWrapper = function QueryWrapper(props) {
114
- return /*#__PURE__*/React.createElement(QueryClientProvider, {
115
- client: queryClient
116
- }, /*#__PURE__*/React.createElement(Component, props), /*#__PURE__*/React.createElement(ReactQueryDevtools, {
117
- initialIsOpen: false,
118
- position: "bottom-right"
119
- }));
171
+ return /*#__PURE__*/jsxs(QueryClientProvider, {
172
+ client: queryClient,
173
+ children: [/*#__PURE__*/jsx(Component, _objectSpread$2({}, props)), /*#__PURE__*/jsx(ReactQueryDevtools, {
174
+ initialIsOpen: false,
175
+ position: "bottom-right"
176
+ })]
177
+ });
120
178
  };
121
179
  return QueryWrapper;
122
180
  };
@@ -215,9 +273,9 @@ function getDefaultExportFromCjs (x) {
215
273
 
216
274
  var regeneratorRuntime$1 = {exports: {}};
217
275
 
218
- var _typeof$1 = {exports: {}};
276
+ var _typeof = {exports: {}};
219
277
 
220
- _typeof$1.exports;
278
+ _typeof.exports;
221
279
 
222
280
  (function (module) {
223
281
  function _typeof(o) {
@@ -230,9 +288,9 @@ _typeof$1.exports;
230
288
  }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
231
289
  }
232
290
  module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
233
- } (_typeof$1));
291
+ } (_typeof));
234
292
 
235
- var _typeofExports = _typeof$1.exports;
293
+ var _typeofExports = _typeof.exports;
236
294
 
237
295
  regeneratorRuntime$1.exports;
238
296
 
@@ -571,10 +629,11 @@ var Snippet = function Snippet(_ref) {
571
629
  var children = _ref.children,
572
630
  _ref$dataCy = _ref.dataCy,
573
631
  dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy;
574
- return /*#__PURE__*/React.createElement("div", {
632
+ return /*#__PURE__*/jsx("div", {
575
633
  className: "neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-gray-100 my-2 whitespace-pre-wrap break-all border p-4",
576
- "data-cy": dataCy
577
- }, children);
634
+ "data-cy": dataCy,
635
+ children: children
636
+ });
578
637
  };
579
638
 
580
639
  var TransactionDetails = function TransactionDetails(_ref) {
@@ -595,57 +654,89 @@ var TransactionDetails = function TransactionDetails(_ref) {
595
654
  return "";
596
655
  }
597
656
  };
598
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
599
- className: "neeto-ui-bg-white sticky top-0 mb-2 flex w-full flex-col"
600
- }, /*#__PURE__*/React.createElement("div", {
601
- className: "flex w-full flex-col space-y-2 pb-4"
602
- }, /*#__PURE__*/React.createElement("span", {
603
- className: "flex items-center space-x-1"
604
- }, t("neetoWebhooks.delivery.identifier"), ":", /*#__PURE__*/React.createElement(Typography, {
605
- className: "px-2 font-bold",
606
- "data-cy": "delivery-identifier",
607
- style: "body2"
608
- }, identifier)), /*#__PURE__*/React.createElement("span", {
609
- className: "flex items-center"
610
- }, t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/React.createElement(Typography, {
611
- className: "px-2 font-bold",
612
- "data-cy": "delivery-response-code",
613
- style: "body2"
614
- }, responseStatusCode), /*#__PURE__*/React.createElement(Tag, {
615
- style: status === "success" ? "success" : "warning"
616
- }, status))), /*#__PURE__*/React.createElement(Tab, null, /*#__PURE__*/React.createElement(Tab.Item, {
617
- active: activeHeader === DELIVERY_TAB.request,
618
- onClick: function onClick() {
619
- return setActiveHeader(DELIVERY_TAB.request);
620
- }
621
- }, t("neetoWebhooks.delivery.request")), /*#__PURE__*/React.createElement(Tab.Item, {
622
- active: activeHeader === DELIVERY_TAB.response,
623
- onClick: function onClick() {
624
- return setActiveHeader(DELIVERY_TAB.response);
625
- }
626
- }, t("neetoWebhooks.delivery.response")))), /*#__PURE__*/React.createElement("div", {
627
- className: "mt-2 w-full"
628
- }, activeHeader === DELIVERY_TAB.request ? /*#__PURE__*/React.createElement("div", {
629
- className: "space-y-4"
630
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
631
- style: "h5"
632
- }, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React.createElement(Snippet, {
633
- dataCy: "delivery-request-header"
634
- }, delivery.requestHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
635
- style: "h5"
636
- }, t("neetoWebhooks.delivery.payload")), /*#__PURE__*/React.createElement(Snippet, {
637
- dataCy: "delivery-request-payload"
638
- }, renderPayload()))) : /*#__PURE__*/React.createElement("div", {
639
- className: "space-y-4"
640
- }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
641
- style: "h5"
642
- }, t("neetoWebhooks.delivery.header")), /*#__PURE__*/React.createElement(Snippet, {
643
- dataCy: "delivery-response-header"
644
- }, delivery.responseHeader)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
645
- style: "h5"
646
- }, t("neetoWebhooks.delivery.body")), /*#__PURE__*/React.createElement(Snippet, {
647
- dataCy: "delivery-response-body"
648
- }, delivery.responseBody)))));
657
+ return /*#__PURE__*/jsxs(Fragment, {
658
+ children: [/*#__PURE__*/jsxs("div", {
659
+ className: "neeto-ui-bg-white sticky top-0 mb-2 flex w-full flex-col",
660
+ children: [/*#__PURE__*/jsxs("div", {
661
+ className: "flex w-full flex-col space-y-2 pb-4",
662
+ children: [/*#__PURE__*/jsxs("span", {
663
+ className: "flex items-center space-x-1",
664
+ children: [t("neetoWebhooks.delivery.identifier"), ":", /*#__PURE__*/jsx(Typography, {
665
+ className: "px-2 font-bold",
666
+ "data-cy": "delivery-identifier",
667
+ style: "body2",
668
+ children: identifier
669
+ })]
670
+ }), /*#__PURE__*/jsxs("span", {
671
+ className: "flex items-center",
672
+ children: [t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/jsx(Typography, {
673
+ className: "px-2 font-bold",
674
+ "data-cy": "delivery-response-code",
675
+ style: "body2",
676
+ children: responseStatusCode
677
+ }), /*#__PURE__*/jsx(Tag, {
678
+ style: status === "success" ? "success" : "warning",
679
+ children: status
680
+ })]
681
+ })]
682
+ }), /*#__PURE__*/jsxs(Tab, {
683
+ children: [/*#__PURE__*/jsx(Tab.Item, {
684
+ active: activeHeader === DELIVERY_TAB.request,
685
+ onClick: function onClick() {
686
+ return setActiveHeader(DELIVERY_TAB.request);
687
+ },
688
+ children: t("neetoWebhooks.delivery.request")
689
+ }), /*#__PURE__*/jsx(Tab.Item, {
690
+ active: activeHeader === DELIVERY_TAB.response,
691
+ onClick: function onClick() {
692
+ return setActiveHeader(DELIVERY_TAB.response);
693
+ },
694
+ children: t("neetoWebhooks.delivery.response")
695
+ })]
696
+ })]
697
+ }), /*#__PURE__*/jsx("div", {
698
+ className: "mt-2 w-full",
699
+ children: activeHeader === DELIVERY_TAB.request ? /*#__PURE__*/jsxs("div", {
700
+ className: "space-y-4",
701
+ children: [/*#__PURE__*/jsxs("div", {
702
+ children: [/*#__PURE__*/jsx(Typography, {
703
+ style: "h5",
704
+ children: t("neetoWebhooks.delivery.header")
705
+ }), /*#__PURE__*/jsx(Snippet, {
706
+ dataCy: "delivery-request-header",
707
+ children: delivery.requestHeader
708
+ })]
709
+ }), /*#__PURE__*/jsxs("div", {
710
+ children: [/*#__PURE__*/jsx(Typography, {
711
+ style: "h5",
712
+ children: t("neetoWebhooks.delivery.payload")
713
+ }), /*#__PURE__*/jsx(Snippet, {
714
+ dataCy: "delivery-request-payload",
715
+ children: renderPayload()
716
+ })]
717
+ })]
718
+ }) : /*#__PURE__*/jsxs("div", {
719
+ className: "space-y-4",
720
+ children: [/*#__PURE__*/jsxs("div", {
721
+ children: [/*#__PURE__*/jsx(Typography, {
722
+ style: "h5",
723
+ children: t("neetoWebhooks.delivery.header")
724
+ }), /*#__PURE__*/jsx(Snippet, {
725
+ dataCy: "delivery-response-header",
726
+ children: delivery.responseHeader
727
+ })]
728
+ }), /*#__PURE__*/jsxs("div", {
729
+ children: [/*#__PURE__*/jsx(Typography, {
730
+ style: "h5",
731
+ children: t("neetoWebhooks.delivery.body")
732
+ }), /*#__PURE__*/jsx(Snippet, {
733
+ dataCy: "delivery-response-body",
734
+ children: delivery.responseBody
735
+ })]
736
+ })]
737
+ })
738
+ })]
739
+ });
649
740
  };
650
741
 
651
742
  var Details = function Details(_ref) {
@@ -682,43 +773,57 @@ var Details = function Details(_ref) {
682
773
  if (isNotPresent(delivery)) {
683
774
  return null;
684
775
  }
685
- return /*#__PURE__*/React.createElement(Pane, {
776
+ return /*#__PURE__*/jsx(Pane, {
686
777
  onClose: onClose,
687
778
  isOpen: isPresent(deliveryId),
688
- size: "large"
689
- }, /*#__PURE__*/React.createElement(React.Fragment, null, isLoading ? /*#__PURE__*/React.createElement(PageLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DateFormat.Date, {
690
- date: delivery.createdAt,
691
- tooltipProps: {
692
- disabled: true
693
- },
694
- typographyProps: {
695
- style: "h2",
696
- weight: "semibold"
697
- }
698
- }), /*#__PURE__*/React.createElement("span", null, " \u2022 "), /*#__PURE__*/React.createElement(DateFormat.Time, {
699
- date: delivery.createdAt,
700
- tooltipProps: {
701
- disabled: true
702
- },
703
- typographyProps: {
704
- style: "h2",
705
- weight: "normal"
706
- }
707
- }))), /*#__PURE__*/React.createElement(Pane.Body, null, isPresent(delivery) && /*#__PURE__*/React.createElement(TransactionDetails, {
708
- delivery: delivery
709
- })), /*#__PURE__*/React.createElement(Pane.Footer, {
710
- className: "gap-x-2"
711
- }, event && /*#__PURE__*/React.createElement(Button, {
712
- disabled: isRedelivering,
713
- label: t("neetoWebhooks.delivery.redeliver"),
714
- loading: isRedelivering,
715
- style: "primary",
716
- onClick: handleRedeliverClick
717
- }), /*#__PURE__*/React.createElement(Button, {
718
- label: t("neetoWebhooks.buttons.cancel"),
719
- style: "text",
720
- onClick: onClose
721
- })))));
779
+ size: "large",
780
+ children: /*#__PURE__*/jsx(Fragment, {
781
+ children: isLoading ? /*#__PURE__*/jsx(PageLoader, {}) : /*#__PURE__*/jsxs(Fragment, {
782
+ children: [/*#__PURE__*/jsx(Pane.Header, {
783
+ children: /*#__PURE__*/jsxs(Fragment, {
784
+ children: [/*#__PURE__*/jsx(DateFormat.Date, {
785
+ date: delivery.createdAt,
786
+ tooltipProps: {
787
+ disabled: true
788
+ },
789
+ typographyProps: {
790
+ style: "h2",
791
+ weight: "semibold"
792
+ }
793
+ }), /*#__PURE__*/jsx("span", {
794
+ children: " \u2022 "
795
+ }), /*#__PURE__*/jsx(DateFormat.Time, {
796
+ date: delivery.createdAt,
797
+ tooltipProps: {
798
+ disabled: true
799
+ },
800
+ typographyProps: {
801
+ style: "h2",
802
+ weight: "normal"
803
+ }
804
+ })]
805
+ })
806
+ }), /*#__PURE__*/jsx(Pane.Body, {
807
+ children: isPresent(delivery) && /*#__PURE__*/jsx(TransactionDetails, {
808
+ delivery: delivery
809
+ })
810
+ }), /*#__PURE__*/jsxs(Pane.Footer, {
811
+ className: "gap-x-2",
812
+ children: [event && /*#__PURE__*/jsx(Button, {
813
+ disabled: isRedelivering,
814
+ label: t("neetoWebhooks.delivery.redeliver"),
815
+ loading: isRedelivering,
816
+ style: "primary",
817
+ onClick: handleRedeliverClick
818
+ }), /*#__PURE__*/jsx(Button, {
819
+ label: t("neetoWebhooks.buttons.cancel"),
820
+ style: "text",
821
+ onClick: onClose
822
+ })]
823
+ })]
824
+ })
825
+ })
826
+ });
722
827
  };
723
828
 
724
829
  var buildColumns$1 = function buildColumns(_ref) {
@@ -729,17 +834,20 @@ var buildColumns$1 = function buildColumns(_ref) {
729
834
  dataIndex: "identifier",
730
835
  width: 390,
731
836
  render: function render(_, delivery) {
732
- return /*#__PURE__*/React.createElement("div", {
733
- className: "flex items-center gap-x-3"
734
- }, /*#__PURE__*/React.createElement(Button, {
735
- style: "link",
736
- weight: "semibold",
737
- onClick: function onClick() {
738
- return handleDetailsClick(delivery.sid);
739
- }
740
- }, delivery.identifier), delivery.redelivery && /*#__PURE__*/React.createElement(Tag, {
741
- style: "info"
742
- }, t$1("neetoWebhooks.delivery.redelivery")));
837
+ return /*#__PURE__*/jsxs("div", {
838
+ className: "flex items-center gap-x-3",
839
+ children: [/*#__PURE__*/jsx(Button, {
840
+ style: "link",
841
+ weight: "semibold",
842
+ onClick: function onClick() {
843
+ return handleDetailsClick(delivery.sid);
844
+ },
845
+ children: delivery.identifier
846
+ }), delivery.redelivery && /*#__PURE__*/jsx(Tag, {
847
+ style: "info",
848
+ children: t$1("neetoWebhooks.delivery.redelivery")
849
+ })]
850
+ });
743
851
  }
744
852
  }, {
745
853
  title: t$1("neetoWebhooks.tableHeaders.createdAt"),
@@ -747,11 +855,14 @@ var buildColumns$1 = function buildColumns(_ref) {
747
855
  dataIndex: "createdAt",
748
856
  width: 280,
749
857
  render: function render(createdAt) {
750
- return /*#__PURE__*/React.createElement("div", {
751
- className: "flex items-center justify-between space-x-1"
752
- }, /*#__PURE__*/React.createElement(Typography, null, /*#__PURE__*/React.createElement(DateFormat.DateTime, {
753
- date: createdAt
754
- })));
858
+ return /*#__PURE__*/jsx("div", {
859
+ className: "flex items-center justify-between space-x-1",
860
+ children: /*#__PURE__*/jsx(Typography, {
861
+ children: /*#__PURE__*/jsx(DateFormat.DateTime, {
862
+ date: createdAt
863
+ })
864
+ })
865
+ });
755
866
  }
756
867
  }, {
757
868
  title: t$1("neetoWebhooks.common.responseStatus"),
@@ -760,14 +871,17 @@ var buildColumns$1 = function buildColumns(_ref) {
760
871
  render: function render(_ref2) {
761
872
  var responseStatusCode = _ref2.responseStatusCode,
762
873
  status = _ref2.status;
763
- return /*#__PURE__*/React.createElement("span", {
764
- className: "flex items-center"
765
- }, /*#__PURE__*/React.createElement(Typography, {
766
- className: "px-2",
767
- style: "body2"
768
- }, responseStatusCode), /*#__PURE__*/React.createElement(Tag, {
769
- style: status === "success" ? "success" : "warning"
770
- }, status));
874
+ return /*#__PURE__*/jsxs("span", {
875
+ className: "flex items-center",
876
+ children: [/*#__PURE__*/jsx(Typography, {
877
+ className: "px-2",
878
+ style: "body2",
879
+ children: responseStatusCode
880
+ }), /*#__PURE__*/jsx(Tag, {
881
+ style: status === "success" ? "success" : "warning",
882
+ children: status
883
+ })]
884
+ });
771
885
  }
772
886
  }, {
773
887
  title: t$1("neetoWebhooks.common.event", SINGULAR),
@@ -827,35 +941,38 @@ var Deliveries = function Deliveries(_ref) {
827
941
  webhookId: webhookId
828
942
  }));
829
943
  };
830
- if (isLoading) return /*#__PURE__*/React.createElement(PageLoader, null);
831
- return /*#__PURE__*/React.createElement(Container, {
832
- className: "w-full"
833
- }, /*#__PURE__*/React.createElement(Header$2, {
834
- breadcrumbs: breadcrumbs,
835
- title: t("neetoWebhooks.delivery.title")
836
- }), isNotEmpty(deliveries) ? /*#__PURE__*/React.createElement(TableWrapper, {
837
- hasPagination: totalCount > DEFAULT_PAGE_SIZE
838
- }, /*#__PURE__*/React.createElement(Table, {
839
- totalCount: totalCount,
840
- fixedHeight: true,
841
- columnData: buildColumns$1({
842
- handleDetailsClick: handleDetailsClick
843
- }),
844
- currentPageNumber: pageNumber,
845
- defaultPageSize: DEFAULT_PAGE_SIZE,
846
- handlePageChange: setPageNumber,
847
- loading: isFetching,
848
- rowData: deliveries
849
- })) : /*#__PURE__*/React.createElement("div", {
850
- className: "flex h-full w-full items-center justify-center"
851
- }, /*#__PURE__*/React.createElement(NoData, {
852
- description: t("neetoWebhooks.delivery.empty.description"),
853
- title: t("neetoWebhooks.delivery.empty.title")
854
- })), /*#__PURE__*/React.createElement(Details, {
855
- deliveryId: deliveryId,
856
- webhookSid: webhookId,
857
- onClose: handleClose
858
- }));
944
+ if (isLoading) return /*#__PURE__*/jsx(PageLoader, {});
945
+ return /*#__PURE__*/jsxs(Container, {
946
+ className: "w-full",
947
+ children: [/*#__PURE__*/jsx(Header$2, {
948
+ breadcrumbs: breadcrumbs,
949
+ title: t("neetoWebhooks.delivery.title")
950
+ }), isNotEmpty(deliveries) ? /*#__PURE__*/jsx(TableWrapper, {
951
+ hasPagination: totalCount > DEFAULT_PAGE_SIZE,
952
+ children: /*#__PURE__*/jsx(Table, {
953
+ totalCount: totalCount,
954
+ fixedHeight: true,
955
+ columnData: buildColumns$1({
956
+ handleDetailsClick: handleDetailsClick
957
+ }),
958
+ currentPageNumber: pageNumber,
959
+ defaultPageSize: DEFAULT_PAGE_SIZE,
960
+ handlePageChange: setPageNumber,
961
+ loading: isFetching,
962
+ rowData: deliveries
963
+ })
964
+ }) : /*#__PURE__*/jsx("div", {
965
+ className: "flex h-full w-full items-center justify-center",
966
+ children: /*#__PURE__*/jsx(NoData, {
967
+ description: t("neetoWebhooks.delivery.empty.description"),
968
+ title: t("neetoWebhooks.delivery.empty.title")
969
+ })
970
+ }), /*#__PURE__*/jsx(Details, {
971
+ deliveryId: deliveryId,
972
+ webhookSid: webhookId,
973
+ onClose: handleClose
974
+ })]
975
+ });
859
976
  };
860
977
  var Deliveries$1 = withReactQuery(Deliveries);
861
978
 
@@ -941,46 +1058,8 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
941
1058
  });
942
1059
  };
943
1060
 
944
- function _typeof(o) {
945
- "@babel/helpers - typeof";
946
-
947
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
948
- return typeof o;
949
- } : function (o) {
950
- return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
951
- }, _typeof(o);
952
- }
953
-
954
- function _toPrimitive(input, hint) {
955
- if (_typeof(input) !== "object" || input === null) return input;
956
- var prim = input[Symbol.toPrimitive];
957
- if (prim !== undefined) {
958
- var res = prim.call(input, hint || "default");
959
- if (_typeof(res) !== "object") return res;
960
- throw new TypeError("@@toPrimitive must return a primitive value.");
961
- }
962
- return (hint === "string" ? String : Number)(input);
963
- }
964
-
965
- function _toPropertyKey(arg) {
966
- var key = _toPrimitive(arg, "string");
967
- return _typeof(key) === "symbol" ? key : String(key);
968
- }
969
-
970
- function _defineProperty(obj, key, value) {
971
- key = _toPropertyKey(key);
972
- if (key in obj) {
973
- Object.defineProperty(obj, key, {
974
- value: value,
975
- enumerable: true,
976
- configurable: true,
977
- writable: true
978
- });
979
- } else {
980
- obj[key] = value;
981
- }
982
- return obj;
983
- }
1061
+ var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
1062
+ var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
984
1063
 
985
1064
  var baseUrl = "/webhooks/events/all";
986
1065
  var all = function all() {
@@ -996,9 +1075,6 @@ var useFetchEvents = function useFetchEvents() {
996
1075
  });
997
1076
  };
998
1077
 
999
- var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
1000
- var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
1001
-
1002
1078
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
1003
1079
  // require the crypto API and do not support built-in fallback to lower quality random number
1004
1080
  // generators (like Math.random()).
@@ -1133,26 +1209,28 @@ var buildColumns = function buildColumns(_ref6) {
1133
1209
  dataIndex: "endpoint",
1134
1210
  width: 830,
1135
1211
  render: function render(endpoint, webhook) {
1136
- return /*#__PURE__*/React.createElement("div", {
1137
- className: "flex items-center justify-between space-x-3"
1138
- }, /*#__PURE__*/React.createElement(Button, {
1139
- style: "link",
1140
- to: buildUrl(deliveriesPath, {
1141
- webhookId: webhook.sid
1142
- })
1143
- }, endpoint), /*#__PURE__*/React.createElement(MoreDropdown, {
1144
- dropdownProps: {
1145
- strategy: "fixed"
1146
- },
1147
- menuItems: getMenuItems({
1148
- onEdit: function onEdit() {
1149
- return handleEdit(webhook.id);
1212
+ return /*#__PURE__*/jsxs("div", {
1213
+ className: "flex items-center justify-between space-x-3",
1214
+ children: [/*#__PURE__*/jsx(Button, {
1215
+ style: "link",
1216
+ to: buildUrl(deliveriesPath, {
1217
+ webhookId: webhook.sid
1218
+ }),
1219
+ children: endpoint
1220
+ }), /*#__PURE__*/jsx(MoreDropdown, {
1221
+ dropdownProps: {
1222
+ strategy: "fixed"
1150
1223
  },
1151
- onDelete: function onDelete() {
1152
- return handleDelete(webhook.id);
1153
- }
1154
- })
1155
- }));
1224
+ menuItems: getMenuItems({
1225
+ onEdit: function onEdit() {
1226
+ return handleEdit(webhook.id);
1227
+ },
1228
+ onDelete: function onDelete() {
1229
+ return handleDelete(webhook.id);
1230
+ }
1231
+ })
1232
+ })]
1233
+ });
1156
1234
  }
1157
1235
  }, {
1158
1236
  title: t$1("neetoWebhooks.webhook.active"),
@@ -1251,134 +1329,162 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1251
1329
  setIsSecretInputFieldVisible(true);
1252
1330
  }
1253
1331
  }, [webhook]);
1254
- return /*#__PURE__*/React.createElement(Pane, {
1332
+ return /*#__PURE__*/jsxs(Pane, {
1255
1333
  isOpen: isOpen,
1256
1334
  onClose: onClose,
1257
- initialFocusRef: endpointRef
1258
- }, /*#__PURE__*/React.createElement(Pane.Header, {
1259
- className: "flex items-center gap-x-2"
1260
- }, /*#__PURE__*/React.createElement(Typography, {
1261
- "data-cy": "add-new-webhook-pane-header",
1262
- style: "h2",
1263
- weight: "semibold"
1264
- }, editingWebhookId ? t("neetoWebhooks.webhook.edit") : t("neetoWebhooks.webhook.add")), /*#__PURE__*/React.createElement(HelpPopover, {
1265
- description: t("neetoWebhooks.webhook.helpDescription"),
1266
- helpLinkProps: {
1267
- href: WEBHOOK_HELP_URL
1268
- },
1269
- title: t("neetoWebhooks.webhook.title")
1270
- })), /*#__PURE__*/React.createElement(Form, {
1271
- formikProps: {
1272
- enableReinitialize: true,
1273
- validationSchema: getValidationSchema(webhooks),
1274
- initialValues: initialValues,
1275
- onSubmit: function onSubmit(values) {
1276
- return handleSubmit(getValidationSchema().cast(values));
1277
- }
1278
- }
1279
- }, function (_ref2) {
1280
- var setFieldValue = _ref2.setFieldValue;
1281
- return isLoading ? /*#__PURE__*/React.createElement("div", {
1282
- className: "flex items-center justify-center"
1283
- }, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
1284
- className: "w-full space-y-4"
1285
- }, /*#__PURE__*/React.createElement(Textarea, {
1286
- required: true,
1287
- "data-cy": "endpoint-input-field",
1288
- label: t("neetoWebhooks.webhook.endpoint"),
1289
- name: "endpoint",
1290
- placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
1291
- ref: endpointRef,
1292
- rows: 1
1293
- }), !isLoading && /*#__PURE__*/React.createElement(Select, {
1294
- isMulti: true,
1295
- required: true,
1296
- getOptionLabel: prop("label"),
1297
- getOptionValue: prop("identifier"),
1298
- label: t("neetoWebhooks.common.event", PLURAL),
1299
- name: "events",
1300
- options: events,
1301
- placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
1302
- }), isSecretInputFieldVisible && /*#__PURE__*/React.createElement("div", {
1303
- className: "flex items-center justify-between space-x-3"
1304
- }, /*#__PURE__*/React.createElement(Input, {
1305
- "data-cy": "secret-key-input-field",
1306
- name: "secret",
1307
- label: /*#__PURE__*/React.createElement("span", {
1308
- className: "flex items-center gap-x-2"
1309
- }, t("neetoWebhooks.webhook.secret"), /*#__PURE__*/React.createElement(HelpPopover, {
1335
+ initialFocusRef: endpointRef,
1336
+ children: [/*#__PURE__*/jsxs(Pane.Header, {
1337
+ className: "flex items-center gap-x-2",
1338
+ children: [/*#__PURE__*/jsx(Typography, {
1339
+ "data-cy": "add-new-webhook-pane-header",
1340
+ style: "h2",
1341
+ weight: "semibold",
1342
+ children: editingWebhookId ? t("neetoWebhooks.webhook.edit") : t("neetoWebhooks.webhook.add")
1343
+ }), /*#__PURE__*/jsx(HelpPopover, {
1344
+ description: t("neetoWebhooks.webhook.helpDescription"),
1310
1345
  helpLinkProps: {
1311
- href: WEBHOOK_SECRETS_HELP_URL
1346
+ href: WEBHOOK_HELP_URL
1312
1347
  },
1313
- description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
1314
- title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
1315
- })),
1316
- placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
1317
- }), /*#__PURE__*/React.createElement("div", {
1318
- className: "mt-6"
1319
- }, /*#__PURE__*/React.createElement(MoreDropdown, {
1320
- menuItems: [{
1321
- key: "regenerate-secret",
1322
- label: t("neetoWebhooks.buttons.regenerate"),
1323
- "data-cy": "regenerate-secret",
1324
- onClick: function onClick() {
1325
- return handleRegenerate(setFieldValue);
1326
- }
1327
- }, {
1328
- key: "delete-secret",
1329
- label: t("neetoWebhooks.buttons.delete"),
1330
- "data-cy": "delete-secret",
1331
- onClick: function onClick() {
1332
- return handleDelete(setFieldValue);
1348
+ title: t("neetoWebhooks.webhook.title")
1349
+ })]
1350
+ }), /*#__PURE__*/jsx(Form, {
1351
+ formikProps: {
1352
+ enableReinitialize: true,
1353
+ validationSchema: getValidationSchema(webhooks),
1354
+ initialValues: initialValues,
1355
+ onSubmit: function onSubmit(values) {
1356
+ return handleSubmit(getValidationSchema().cast(values));
1333
1357
  }
1334
- }]
1335
- }))), /*#__PURE__*/React.createElement(Switch, {
1336
- label: t("neetoWebhooks.webhook.active"),
1337
- name: "isActive"
1338
- }), !isSecretInputFieldVisible && /*#__PURE__*/React.createElement(Button, {
1339
- "data-cy": "add-secret-key",
1340
- icon: Plus,
1341
- label: t("neetoWebhooks.buttons.addSecretKey"),
1342
- style: "text",
1343
- onClick: function onClick() {
1344
- return handleClick(setFieldValue);
1345
- }
1346
- }))), /*#__PURE__*/React.createElement(Pane.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
1347
- cancelButtonProps: {
1348
- onClick: onClose
1358
+ },
1359
+ children: function children(_ref2) {
1360
+ var setFieldValue = _ref2.setFieldValue;
1361
+ return isLoading ? /*#__PURE__*/jsx("div", {
1362
+ className: "flex items-center justify-center",
1363
+ children: /*#__PURE__*/jsx(Spinner, {})
1364
+ }) : /*#__PURE__*/jsxs(Fragment, {
1365
+ children: [/*#__PURE__*/jsx(Pane.Body, {
1366
+ children: /*#__PURE__*/jsxs("div", {
1367
+ className: "w-full space-y-4",
1368
+ children: [/*#__PURE__*/jsx(Textarea, {
1369
+ required: true,
1370
+ "data-cy": "endpoint-input-field",
1371
+ label: t("neetoWebhooks.webhook.endpoint"),
1372
+ name: "endpoint",
1373
+ placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
1374
+ ref: endpointRef,
1375
+ rows: 1
1376
+ }), !isLoading && /*#__PURE__*/jsx(Select, {
1377
+ isMulti: true,
1378
+ required: true,
1379
+ getOptionLabel: prop("label"),
1380
+ getOptionValue: prop("identifier"),
1381
+ label: t("neetoWebhooks.common.event", PLURAL),
1382
+ name: "events",
1383
+ options: events,
1384
+ placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
1385
+ }), isSecretInputFieldVisible && /*#__PURE__*/jsxs("div", {
1386
+ className: "flex items-center justify-between space-x-3",
1387
+ children: [/*#__PURE__*/jsx(Input, {
1388
+ "data-cy": "secret-key-input-field",
1389
+ name: "secret",
1390
+ label: /*#__PURE__*/jsxs("span", {
1391
+ className: "flex items-center gap-x-2",
1392
+ children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsx(HelpPopover, {
1393
+ helpLinkProps: {
1394
+ href: WEBHOOK_SECRETS_HELP_URL
1395
+ },
1396
+ description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
1397
+ title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
1398
+ })]
1399
+ }),
1400
+ placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
1401
+ }), /*#__PURE__*/jsx("div", {
1402
+ className: "mt-6",
1403
+ children: /*#__PURE__*/jsx(MoreDropdown, {
1404
+ menuItems: [{
1405
+ key: "regenerate-secret",
1406
+ label: t("neetoWebhooks.buttons.regenerate"),
1407
+ "data-cy": "regenerate-secret",
1408
+ onClick: function onClick() {
1409
+ return handleRegenerate(setFieldValue);
1410
+ }
1411
+ }, {
1412
+ key: "delete-secret",
1413
+ label: t("neetoWebhooks.buttons.delete"),
1414
+ "data-cy": "delete-secret",
1415
+ onClick: function onClick() {
1416
+ return handleDelete(setFieldValue);
1417
+ }
1418
+ }]
1419
+ })
1420
+ })]
1421
+ }), /*#__PURE__*/jsx(Switch, {
1422
+ label: t("neetoWebhooks.webhook.active"),
1423
+ name: "isActive"
1424
+ }), !isSecretInputFieldVisible && /*#__PURE__*/jsx(Button, {
1425
+ "data-cy": "add-secret-key",
1426
+ icon: Plus,
1427
+ label: t("neetoWebhooks.buttons.addSecretKey"),
1428
+ style: "text",
1429
+ onClick: function onClick() {
1430
+ return handleClick(setFieldValue);
1431
+ }
1432
+ })]
1433
+ })
1434
+ }), /*#__PURE__*/jsx(Pane.Footer, {
1435
+ children: /*#__PURE__*/jsx(ActionBlock, {
1436
+ cancelButtonProps: {
1437
+ onClick: onClose
1438
+ }
1439
+ })
1440
+ })]
1441
+ });
1349
1442
  }
1350
- })));
1351
- }));
1443
+ })]
1444
+ });
1352
1445
  };
1353
1446
 
1354
- var Header = function Header(_ref) {
1355
- var breadcrumbs = _ref.breadcrumbs,
1447
+ var Header = withT(function (_ref) {
1448
+ var t = _ref.t,
1449
+ breadcrumbs = _ref.breadcrumbs,
1450
+ title = _ref.title,
1356
1451
  setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen;
1357
- var _useTranslation = useTranslation(),
1358
- t = _useTranslation.t;
1359
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header$2, {
1360
- breadcrumbs: breadcrumbs,
1361
- title: t("neetoWebhooks.webhook.title"),
1362
- actionBlock: /*#__PURE__*/React.createElement(Button, {
1363
- "data-cy": "add-new-webhook-button",
1364
- label: t("neetoWebhooks.webhook.add"),
1365
- onClick: function onClick() {
1366
- return setIsAddWebhookPaneOpen(true);
1367
- }
1368
- })
1369
- }), /*#__PURE__*/React.createElement(Typography, {
1370
- className: "mb-3",
1371
- "data-cy": "webhook-description-header",
1372
- style: "h5",
1373
- weight: "normal"
1374
- }, t("neetoWebhooks.webhook.description")));
1375
- };
1452
+ return /*#__PURE__*/jsxs(Fragment, {
1453
+ children: [/*#__PURE__*/jsx(Header$2, {
1454
+ breadcrumbs: breadcrumbs,
1455
+ actionBlock: /*#__PURE__*/jsx(Button, {
1456
+ "data-cy": "add-new-webhook-button",
1457
+ label: t("neetoWebhooks.webhook.add"),
1458
+ onClick: function onClick() {
1459
+ return setIsAddWebhookPaneOpen(true);
1460
+ }
1461
+ }),
1462
+ title: title || /*#__PURE__*/jsxs("div", {
1463
+ className: "flex items-center gap-x-2",
1464
+ children: [t("neetoWebhooks.webhook.title"), /*#__PURE__*/jsx(HelpPopover, {
1465
+ description: t("neetoWebhooks.webhook.helpDescription"),
1466
+ helpLinkProps: {
1467
+ href: WEBHOOK_HELP_URL
1468
+ },
1469
+ title: t("neetoWebhooks.webhook.title")
1470
+ })]
1471
+ })
1472
+ }), /*#__PURE__*/jsx(Typography, {
1473
+ className: "mb-3",
1474
+ "data-cy": "webhook-description-header",
1475
+ style: "h5",
1476
+ weight: "normal",
1477
+ children: t("neetoWebhooks.webhook.description")
1478
+ })]
1479
+ });
1480
+ });
1376
1481
  var Header$1 = /*#__PURE__*/React.memo(Header);
1377
1482
 
1378
1483
  var Webhooks = function Webhooks(_ref) {
1379
1484
  var deliveriesPath = _ref.deliveriesPath,
1380
1485
  entityType = _ref.entityType,
1381
1486
  breadcrumbs = _ref.breadcrumbs,
1487
+ title = _ref.title,
1382
1488
  entityId = _ref.entityId,
1383
1489
  onCreate = _ref.onCreate,
1384
1490
  onDelete = _ref.onDelete;
@@ -1438,61 +1544,76 @@ var Webhooks = function Webhooks(_ref) {
1438
1544
  setIsDeleteAlertOpen(true);
1439
1545
  }, []);
1440
1546
  if (isLoading) {
1441
- return /*#__PURE__*/React.createElement(PageLoader, null);
1547
+ return /*#__PURE__*/jsx(PageLoader, {});
1442
1548
  }
1443
- return /*#__PURE__*/React.createElement(Container, {
1444
- className: "w-full"
1445
- }, /*#__PURE__*/React.createElement(Header$1, {
1446
- breadcrumbs: breadcrumbs,
1447
- setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen
1448
- }), isNotEmpty(webhooks) ? /*#__PURE__*/React.createElement(TableWrapper, {
1449
- hasPagination: totalCount > DEFAULT_PAGE_SIZE
1450
- }, /*#__PURE__*/React.createElement(Table, {
1451
- totalCount: totalCount,
1452
- fixedHeight: true,
1453
- currentPageNumber: pageNumber,
1454
- defaultPageSize: DEFAULT_PAGE_SIZE,
1455
- handlePageChange: function handlePageChange(page) {
1456
- return setPageNumber(page);
1457
- },
1458
- loading: isFetching,
1459
- rowData: webhooks,
1460
- columnData: buildColumns({
1461
- handleDelete: handleDelete,
1462
- handleEdit: handleEdit,
1463
- deliveriesPath: deliveriesPath
1464
- })
1465
- })) : /*#__PURE__*/React.createElement("div", {
1466
- className: "flex h-full w-full items-center justify-center"
1467
- }, /*#__PURE__*/React.createElement(NoData, {
1468
- title: t("neetoWebhooks.webhook.empty")
1469
- })), /*#__PURE__*/React.createElement(AddWebhookPane, {
1470
- editingWebhookId: editingWebhookId,
1471
- entityId: entityId,
1472
- entityType: entityType,
1473
- onCreate: onCreate,
1474
- webhooks: webhooks,
1475
- isOpen: isAddWebhookPaneOpen,
1476
- onClose: handlePaneClose
1477
- }), /*#__PURE__*/React.createElement(Alert, {
1478
- isOpen: isDeleteAlertOpen,
1479
- isSubmitting: isDeleting,
1480
- submitButtonLabel: t("neetoWebhooks.buttons.delete"),
1481
- message: t("neetoWebhooks.alert.delete.message", {
1482
- entity: t("neetoWebhooks.entity.webhook")
1483
- }),
1484
- title: t("neetoWebhooks.alert.delete.title", {
1485
- entity: t("neetoWebhooks.entity.webhook")
1486
- }),
1487
- onClose: function onClose() {
1488
- return setIsDeleteAlertOpen(false);
1489
- },
1490
- onSubmit: function onSubmit() {
1491
- return destroyWebhook(deletingWebhookId, {
1492
- entityId: entityId
1493
- });
1494
- }
1495
- }));
1549
+ return /*#__PURE__*/jsxs(Container, {
1550
+ className: "w-full",
1551
+ children: [/*#__PURE__*/jsx(Header$1, {
1552
+ breadcrumbs: breadcrumbs,
1553
+ setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
1554
+ title: title
1555
+ }), isNotEmpty(webhooks) ? /*#__PURE__*/jsx(TableWrapper, {
1556
+ hasPagination: totalCount > DEFAULT_PAGE_SIZE,
1557
+ children: /*#__PURE__*/jsx(Table, {
1558
+ totalCount: totalCount,
1559
+ fixedHeight: true,
1560
+ currentPageNumber: pageNumber,
1561
+ defaultPageSize: DEFAULT_PAGE_SIZE,
1562
+ handlePageChange: setPageNumber,
1563
+ loading: isFetching,
1564
+ rowData: webhooks,
1565
+ columnData: buildColumns({
1566
+ handleDelete: handleDelete,
1567
+ handleEdit: handleEdit,
1568
+ deliveriesPath: deliveriesPath
1569
+ })
1570
+ })
1571
+ }) : /*#__PURE__*/jsx("div", {
1572
+ className: "flex h-full w-full items-center justify-center",
1573
+ children: /*#__PURE__*/jsx(NoData, {
1574
+ title: t("neetoWebhooks.webhook.empty"),
1575
+ helpText: /*#__PURE__*/jsx("a", {
1576
+ className: "neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium",
1577
+ href: WEBHOOK_HELP_URL,
1578
+ rel: "noreferrer",
1579
+ target: "_blank",
1580
+ children: t("neetoWebhooks.webhook.emptyHelpText")
1581
+ }),
1582
+ primaryButtonProps: {
1583
+ label: t("neetoWebhooks.webhook.add"),
1584
+ onClick: function onClick() {
1585
+ return setIsAddWebhookPaneOpen(true);
1586
+ }
1587
+ }
1588
+ })
1589
+ }), /*#__PURE__*/jsx(AddWebhookPane, {
1590
+ editingWebhookId: editingWebhookId,
1591
+ entityId: entityId,
1592
+ entityType: entityType,
1593
+ onCreate: onCreate,
1594
+ webhooks: webhooks,
1595
+ isOpen: isAddWebhookPaneOpen,
1596
+ onClose: handlePaneClose
1597
+ }), /*#__PURE__*/jsx(Alert, {
1598
+ isOpen: isDeleteAlertOpen,
1599
+ isSubmitting: isDeleting,
1600
+ submitButtonLabel: t("neetoWebhooks.buttons.delete"),
1601
+ message: t("neetoWebhooks.alert.delete.message", {
1602
+ entity: t("neetoWebhooks.entity.webhook")
1603
+ }),
1604
+ title: t("neetoWebhooks.alert.delete.title", {
1605
+ entity: t("neetoWebhooks.entity.webhook")
1606
+ }),
1607
+ onClose: function onClose() {
1608
+ return setIsDeleteAlertOpen(false);
1609
+ },
1610
+ onSubmit: function onSubmit() {
1611
+ return destroyWebhook(deletingWebhookId, {
1612
+ entityId: entityId
1613
+ });
1614
+ }
1615
+ })]
1616
+ });
1496
1617
  };
1497
1618
  var Webhooks$1 = withReactQuery(Webhooks);
1498
1619
 
@@ -1501,6 +1622,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1501
1622
  entityId = _ref.entityId,
1502
1623
  _ref$breadcrumbs = _ref.breadcrumbs,
1503
1624
  breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
1625
+ title = _ref.title,
1504
1626
  onCreate = _ref.onCreate,
1505
1627
  onDelete = _ref.onDelete;
1506
1628
  var _useRouteMatch = useRouteMatch(),
@@ -1508,37 +1630,40 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
1508
1630
  webhooksUrl = _useRouteMatch.url;
1509
1631
  var deliveriesPath = getDeliveriesPath(webhooksUrl);
1510
1632
  var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
1511
- return /*#__PURE__*/React.createElement(Switch$1, null, /*#__PURE__*/React.createElement(Route, {
1512
- exact: true,
1513
- path: webhooksPath,
1514
- component: function component() {
1515
- return /*#__PURE__*/React.createElement(Webhooks$1, {
1516
- breadcrumbs: breadcrumbs,
1517
- deliveriesPath: deliveriesPath,
1518
- entityId: entityId,
1519
- entityType: entityType,
1520
- onCreate: onCreate,
1521
- onDelete: onDelete
1522
- });
1523
- }
1524
- }), /*#__PURE__*/React.createElement(Route, {
1525
- exact: true,
1526
- path: deliveryDetailsPath,
1527
- render: function render() {
1528
- return /*#__PURE__*/React.createElement(Deliveries$1, {
1529
- breadcrumbs: breadcrumbs,
1530
- webhooksUrl: webhooksUrl
1531
- });
1532
- }
1533
- }), /*#__PURE__*/React.createElement(Route, {
1534
- component: function component() {
1535
- return /*#__PURE__*/React.createElement(Deliveries$1, {
1536
- breadcrumbs: breadcrumbs,
1537
- webhooksUrl: webhooksUrl
1538
- });
1539
- },
1540
- path: deliveriesPath
1541
- }));
1633
+ return /*#__PURE__*/jsxs(Switch$1, {
1634
+ children: [/*#__PURE__*/jsx(Route, {
1635
+ exact: true,
1636
+ path: webhooksPath,
1637
+ component: function component() {
1638
+ return /*#__PURE__*/jsx(Webhooks$1, {
1639
+ breadcrumbs: breadcrumbs,
1640
+ deliveriesPath: deliveriesPath,
1641
+ entityId: entityId,
1642
+ entityType: entityType,
1643
+ onCreate: onCreate,
1644
+ onDelete: onDelete,
1645
+ title: title
1646
+ });
1647
+ }
1648
+ }), /*#__PURE__*/jsx(Route, {
1649
+ exact: true,
1650
+ path: deliveryDetailsPath,
1651
+ render: function render() {
1652
+ return /*#__PURE__*/jsx(Deliveries$1, {
1653
+ breadcrumbs: breadcrumbs,
1654
+ webhooksUrl: webhooksUrl
1655
+ });
1656
+ }
1657
+ }), /*#__PURE__*/jsx(Route, {
1658
+ component: function component() {
1659
+ return /*#__PURE__*/jsx(Deliveries$1, {
1660
+ breadcrumbs: breadcrumbs,
1661
+ webhooksUrl: webhooksUrl
1662
+ });
1663
+ },
1664
+ path: deliveriesPath
1665
+ })]
1666
+ });
1542
1667
  };
1543
1668
 
1544
1669
  var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}