@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/app/javascript/src/translations/en.json +2 -1
- package/dist/index.cjs.js +555 -415
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +540 -415
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/types.d.ts +1 -0
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
|
|
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
|
|
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
|
-
|
|
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__*/
|
|
115
|
-
client: queryClient
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
|
276
|
+
var _typeof = {exports: {}};
|
|
219
277
|
|
|
220
|
-
_typeof
|
|
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
|
|
291
|
+
} (_typeof));
|
|
234
292
|
|
|
235
|
-
var _typeofExports = _typeof
|
|
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__*/
|
|
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
|
-
|
|
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__*/
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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__*/
|
|
776
|
+
return /*#__PURE__*/jsx(Pane, {
|
|
686
777
|
onClose: onClose,
|
|
687
778
|
isOpen: isPresent(deliveryId),
|
|
688
|
-
size: "large"
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
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__*/
|
|
733
|
-
className: "flex items-center gap-x-3"
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
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__*/
|
|
751
|
-
className: "flex items-center justify-between space-x-1"
|
|
752
|
-
|
|
753
|
-
|
|
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__*/
|
|
764
|
-
className: "flex items-center"
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
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__*/
|
|
831
|
-
return /*#__PURE__*/
|
|
832
|
-
className: "w-full"
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
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
|
-
|
|
945
|
-
|
|
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__*/
|
|
1137
|
-
className: "flex items-center justify-between space-x-3"
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
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
|
-
|
|
1152
|
-
|
|
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__*/
|
|
1332
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
1255
1333
|
isOpen: isOpen,
|
|
1256
1334
|
onClose: onClose,
|
|
1257
|
-
initialFocusRef: endpointRef
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
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:
|
|
1346
|
+
href: WEBHOOK_HELP_URL
|
|
1312
1347
|
},
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
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
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
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
|
|
1355
|
-
var
|
|
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
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
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__*/
|
|
1547
|
+
return /*#__PURE__*/jsx(PageLoader, {});
|
|
1442
1548
|
}
|
|
1443
|
-
return /*#__PURE__*/
|
|
1444
|
-
className: "w-full"
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
}),
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
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__*/
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
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}}
|