@bigbinary/neeto-webhooks-frontend 1.6.26 → 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.cjs.js +547 -425
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +532 -425
- package/dist/index.js.map +1 -1
- package/package.json +13 -12
- package/types.d.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -7,18 +7,32 @@ 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';
|
|
23
37
|
import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
24
38
|
|
|
@@ -100,6 +114,47 @@ function _slicedToArray(arr, i) {
|
|
|
100
114
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
101
115
|
}
|
|
102
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
|
+
|
|
103
158
|
var queryClient = new QueryClient({
|
|
104
159
|
queryCache: new QueryCache(),
|
|
105
160
|
defaultOptions: {
|
|
@@ -109,15 +164,17 @@ var queryClient = new QueryClient({
|
|
|
109
164
|
}
|
|
110
165
|
});
|
|
111
166
|
|
|
112
|
-
|
|
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; }
|
|
113
169
|
var withReactQuery = function withReactQuery(Component) {
|
|
114
170
|
var QueryWrapper = function QueryWrapper(props) {
|
|
115
|
-
return /*#__PURE__*/
|
|
116
|
-
client: queryClient
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
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
|
+
});
|
|
121
178
|
};
|
|
122
179
|
return QueryWrapper;
|
|
123
180
|
};
|
|
@@ -216,9 +273,9 @@ function getDefaultExportFromCjs (x) {
|
|
|
216
273
|
|
|
217
274
|
var regeneratorRuntime$1 = {exports: {}};
|
|
218
275
|
|
|
219
|
-
var _typeof
|
|
276
|
+
var _typeof = {exports: {}};
|
|
220
277
|
|
|
221
|
-
_typeof
|
|
278
|
+
_typeof.exports;
|
|
222
279
|
|
|
223
280
|
(function (module) {
|
|
224
281
|
function _typeof(o) {
|
|
@@ -231,9 +288,9 @@ _typeof$1.exports;
|
|
|
231
288
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
232
289
|
}
|
|
233
290
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
234
|
-
} (_typeof
|
|
291
|
+
} (_typeof));
|
|
235
292
|
|
|
236
|
-
var _typeofExports = _typeof
|
|
293
|
+
var _typeofExports = _typeof.exports;
|
|
237
294
|
|
|
238
295
|
regeneratorRuntime$1.exports;
|
|
239
296
|
|
|
@@ -572,10 +629,11 @@ var Snippet = function Snippet(_ref) {
|
|
|
572
629
|
var children = _ref.children,
|
|
573
630
|
_ref$dataCy = _ref.dataCy,
|
|
574
631
|
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy;
|
|
575
|
-
return /*#__PURE__*/
|
|
632
|
+
return /*#__PURE__*/jsx("div", {
|
|
576
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",
|
|
577
|
-
"data-cy": dataCy
|
|
578
|
-
|
|
634
|
+
"data-cy": dataCy,
|
|
635
|
+
children: children
|
|
636
|
+
});
|
|
579
637
|
};
|
|
580
638
|
|
|
581
639
|
var TransactionDetails = function TransactionDetails(_ref) {
|
|
@@ -596,57 +654,89 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
596
654
|
return "";
|
|
597
655
|
}
|
|
598
656
|
};
|
|
599
|
-
return /*#__PURE__*/
|
|
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
|
-
|
|
649
|
-
|
|
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
|
+
});
|
|
650
740
|
};
|
|
651
741
|
|
|
652
742
|
var Details = function Details(_ref) {
|
|
@@ -683,43 +773,57 @@ var Details = function Details(_ref) {
|
|
|
683
773
|
if (isNotPresent(delivery)) {
|
|
684
774
|
return null;
|
|
685
775
|
}
|
|
686
|
-
return /*#__PURE__*/
|
|
776
|
+
return /*#__PURE__*/jsx(Pane, {
|
|
687
777
|
onClose: onClose,
|
|
688
778
|
isOpen: isPresent(deliveryId),
|
|
689
|
-
size: "large"
|
|
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
|
-
|
|
722
|
-
|
|
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
|
+
});
|
|
723
827
|
};
|
|
724
828
|
|
|
725
829
|
var buildColumns$1 = function buildColumns(_ref) {
|
|
@@ -730,17 +834,20 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
730
834
|
dataIndex: "identifier",
|
|
731
835
|
width: 390,
|
|
732
836
|
render: function render(_, delivery) {
|
|
733
|
-
return /*#__PURE__*/
|
|
734
|
-
className: "flex items-center gap-x-3"
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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
|
+
});
|
|
744
851
|
}
|
|
745
852
|
}, {
|
|
746
853
|
title: t$1("neetoWebhooks.tableHeaders.createdAt"),
|
|
@@ -748,11 +855,14 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
748
855
|
dataIndex: "createdAt",
|
|
749
856
|
width: 280,
|
|
750
857
|
render: function render(createdAt) {
|
|
751
|
-
return /*#__PURE__*/
|
|
752
|
-
className: "flex items-center justify-between space-x-1"
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
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
|
+
});
|
|
756
866
|
}
|
|
757
867
|
}, {
|
|
758
868
|
title: t$1("neetoWebhooks.common.responseStatus"),
|
|
@@ -761,14 +871,17 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
761
871
|
render: function render(_ref2) {
|
|
762
872
|
var responseStatusCode = _ref2.responseStatusCode,
|
|
763
873
|
status = _ref2.status;
|
|
764
|
-
return /*#__PURE__*/
|
|
765
|
-
className: "flex items-center"
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
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
|
+
});
|
|
772
885
|
}
|
|
773
886
|
}, {
|
|
774
887
|
title: t$1("neetoWebhooks.common.event", SINGULAR),
|
|
@@ -828,35 +941,38 @@ var Deliveries = function Deliveries(_ref) {
|
|
|
828
941
|
webhookId: webhookId
|
|
829
942
|
}));
|
|
830
943
|
};
|
|
831
|
-
if (isLoading) return /*#__PURE__*/
|
|
832
|
-
return /*#__PURE__*/
|
|
833
|
-
className: "w-full"
|
|
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
|
-
|
|
859
|
-
|
|
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
|
+
});
|
|
860
976
|
};
|
|
861
977
|
var Deliveries$1 = withReactQuery(Deliveries);
|
|
862
978
|
|
|
@@ -945,47 +1061,6 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
|
945
1061
|
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
946
1062
|
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
947
1063
|
|
|
948
|
-
function _typeof(o) {
|
|
949
|
-
"@babel/helpers - typeof";
|
|
950
|
-
|
|
951
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
952
|
-
return typeof o;
|
|
953
|
-
} : function (o) {
|
|
954
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
955
|
-
}, _typeof(o);
|
|
956
|
-
}
|
|
957
|
-
|
|
958
|
-
function _toPrimitive(input, hint) {
|
|
959
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
960
|
-
var prim = input[Symbol.toPrimitive];
|
|
961
|
-
if (prim !== undefined) {
|
|
962
|
-
var res = prim.call(input, hint || "default");
|
|
963
|
-
if (_typeof(res) !== "object") return res;
|
|
964
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
965
|
-
}
|
|
966
|
-
return (hint === "string" ? String : Number)(input);
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
function _toPropertyKey(arg) {
|
|
970
|
-
var key = _toPrimitive(arg, "string");
|
|
971
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
function _defineProperty(obj, key, value) {
|
|
975
|
-
key = _toPropertyKey(key);
|
|
976
|
-
if (key in obj) {
|
|
977
|
-
Object.defineProperty(obj, key, {
|
|
978
|
-
value: value,
|
|
979
|
-
enumerable: true,
|
|
980
|
-
configurable: true,
|
|
981
|
-
writable: true
|
|
982
|
-
});
|
|
983
|
-
} else {
|
|
984
|
-
obj[key] = value;
|
|
985
|
-
}
|
|
986
|
-
return obj;
|
|
987
|
-
}
|
|
988
|
-
|
|
989
1064
|
var baseUrl = "/webhooks/events/all";
|
|
990
1065
|
var all = function all() {
|
|
991
1066
|
return axios.get(baseUrl);
|
|
@@ -1134,26 +1209,28 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1134
1209
|
dataIndex: "endpoint",
|
|
1135
1210
|
width: 830,
|
|
1136
1211
|
render: function render(endpoint, webhook) {
|
|
1137
|
-
return /*#__PURE__*/
|
|
1138
|
-
className: "flex items-center justify-between space-x-3"
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
menuItems: getMenuItems({
|
|
1149
|
-
onEdit: function onEdit() {
|
|
1150
|
-
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"
|
|
1151
1223
|
},
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
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
|
+
});
|
|
1157
1234
|
}
|
|
1158
1235
|
}, {
|
|
1159
1236
|
title: t$1("neetoWebhooks.webhook.active"),
|
|
@@ -1252,134 +1329,154 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1252
1329
|
setIsSecretInputFieldVisible(true);
|
|
1253
1330
|
}
|
|
1254
1331
|
}, [webhook]);
|
|
1255
|
-
return /*#__PURE__*/
|
|
1332
|
+
return /*#__PURE__*/jsxs(Pane, {
|
|
1256
1333
|
isOpen: isOpen,
|
|
1257
1334
|
onClose: onClose,
|
|
1258
|
-
initialFocusRef: endpointRef
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
href: WEBHOOK_HELP_URL
|
|
1269
|
-
},
|
|
1270
|
-
title: t("neetoWebhooks.webhook.title")
|
|
1271
|
-
})), /*#__PURE__*/React.createElement(Form, {
|
|
1272
|
-
formikProps: {
|
|
1273
|
-
enableReinitialize: true,
|
|
1274
|
-
validationSchema: getValidationSchema(webhooks),
|
|
1275
|
-
initialValues: initialValues,
|
|
1276
|
-
onSubmit: function onSubmit(values) {
|
|
1277
|
-
return handleSubmit(getValidationSchema().cast(values));
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}, function (_ref2) {
|
|
1281
|
-
var setFieldValue = _ref2.setFieldValue;
|
|
1282
|
-
return isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
1283
|
-
className: "flex items-center justify-center"
|
|
1284
|
-
}, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
|
|
1285
|
-
className: "w-full space-y-4"
|
|
1286
|
-
}, /*#__PURE__*/React.createElement(Textarea, {
|
|
1287
|
-
required: true,
|
|
1288
|
-
"data-cy": "endpoint-input-field",
|
|
1289
|
-
label: t("neetoWebhooks.webhook.endpoint"),
|
|
1290
|
-
name: "endpoint",
|
|
1291
|
-
placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
|
|
1292
|
-
ref: endpointRef,
|
|
1293
|
-
rows: 1
|
|
1294
|
-
}), !isLoading && /*#__PURE__*/React.createElement(Select, {
|
|
1295
|
-
isMulti: true,
|
|
1296
|
-
required: true,
|
|
1297
|
-
getOptionLabel: prop("label"),
|
|
1298
|
-
getOptionValue: prop("identifier"),
|
|
1299
|
-
label: t("neetoWebhooks.common.event", PLURAL),
|
|
1300
|
-
name: "events",
|
|
1301
|
-
options: events,
|
|
1302
|
-
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
1303
|
-
}), isSecretInputFieldVisible && /*#__PURE__*/React.createElement("div", {
|
|
1304
|
-
className: "flex items-center justify-between space-x-3"
|
|
1305
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
1306
|
-
"data-cy": "secret-key-input-field",
|
|
1307
|
-
name: "secret",
|
|
1308
|
-
label: /*#__PURE__*/React.createElement("span", {
|
|
1309
|
-
className: "flex items-center gap-x-2"
|
|
1310
|
-
}, 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"),
|
|
1311
1345
|
helpLinkProps: {
|
|
1312
|
-
href:
|
|
1346
|
+
href: WEBHOOK_HELP_URL
|
|
1313
1347
|
},
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
label: t("neetoWebhooks.buttons.regenerate"),
|
|
1324
|
-
"data-cy": "regenerate-secret",
|
|
1325
|
-
onClick: function onClick() {
|
|
1326
|
-
return handleRegenerate(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));
|
|
1327
1357
|
}
|
|
1328
|
-
},
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
}
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
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
|
+
});
|
|
1350
1442
|
}
|
|
1351
|
-
})
|
|
1352
|
-
})
|
|
1443
|
+
})]
|
|
1444
|
+
});
|
|
1353
1445
|
};
|
|
1354
1446
|
|
|
1355
1447
|
var Header = withT(function (_ref) {
|
|
1356
1448
|
var t = _ref.t,
|
|
1357
1449
|
breadcrumbs = _ref.breadcrumbs,
|
|
1450
|
+
title = _ref.title,
|
|
1358
1451
|
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen;
|
|
1359
|
-
return /*#__PURE__*/
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
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
|
+
});
|
|
1383
1480
|
});
|
|
1384
1481
|
var Header$1 = /*#__PURE__*/React.memo(Header);
|
|
1385
1482
|
|
|
@@ -1387,6 +1484,7 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1387
1484
|
var deliveriesPath = _ref.deliveriesPath,
|
|
1388
1485
|
entityType = _ref.entityType,
|
|
1389
1486
|
breadcrumbs = _ref.breadcrumbs,
|
|
1487
|
+
title = _ref.title,
|
|
1390
1488
|
entityId = _ref.entityId,
|
|
1391
1489
|
onCreate = _ref.onCreate,
|
|
1392
1490
|
onDelete = _ref.onDelete;
|
|
@@ -1446,71 +1544,76 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1446
1544
|
setIsDeleteAlertOpen(true);
|
|
1447
1545
|
}, []);
|
|
1448
1546
|
if (isLoading) {
|
|
1449
|
-
return /*#__PURE__*/
|
|
1547
|
+
return /*#__PURE__*/jsx(PageLoader, {});
|
|
1450
1548
|
}
|
|
1451
|
-
return /*#__PURE__*/
|
|
1452
|
-
className: "w-full"
|
|
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
|
-
|
|
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
|
+
});
|
|
1485
1614
|
}
|
|
1486
|
-
}
|
|
1487
|
-
})
|
|
1488
|
-
editingWebhookId: editingWebhookId,
|
|
1489
|
-
entityId: entityId,
|
|
1490
|
-
entityType: entityType,
|
|
1491
|
-
onCreate: onCreate,
|
|
1492
|
-
webhooks: webhooks,
|
|
1493
|
-
isOpen: isAddWebhookPaneOpen,
|
|
1494
|
-
onClose: handlePaneClose
|
|
1495
|
-
}), /*#__PURE__*/React.createElement(Alert, {
|
|
1496
|
-
isOpen: isDeleteAlertOpen,
|
|
1497
|
-
isSubmitting: isDeleting,
|
|
1498
|
-
submitButtonLabel: t("neetoWebhooks.buttons.delete"),
|
|
1499
|
-
message: t("neetoWebhooks.alert.delete.message", {
|
|
1500
|
-
entity: t("neetoWebhooks.entity.webhook")
|
|
1501
|
-
}),
|
|
1502
|
-
title: t("neetoWebhooks.alert.delete.title", {
|
|
1503
|
-
entity: t("neetoWebhooks.entity.webhook")
|
|
1504
|
-
}),
|
|
1505
|
-
onClose: function onClose() {
|
|
1506
|
-
return setIsDeleteAlertOpen(false);
|
|
1507
|
-
},
|
|
1508
|
-
onSubmit: function onSubmit() {
|
|
1509
|
-
return destroyWebhook(deletingWebhookId, {
|
|
1510
|
-
entityId: entityId
|
|
1511
|
-
});
|
|
1512
|
-
}
|
|
1513
|
-
}));
|
|
1615
|
+
})]
|
|
1616
|
+
});
|
|
1514
1617
|
};
|
|
1515
1618
|
var Webhooks$1 = withReactQuery(Webhooks);
|
|
1516
1619
|
|
|
@@ -1519,6 +1622,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1519
1622
|
entityId = _ref.entityId,
|
|
1520
1623
|
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
1521
1624
|
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
1625
|
+
title = _ref.title,
|
|
1522
1626
|
onCreate = _ref.onCreate,
|
|
1523
1627
|
onDelete = _ref.onDelete;
|
|
1524
1628
|
var _useRouteMatch = useRouteMatch(),
|
|
@@ -1526,37 +1630,40 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1526
1630
|
webhooksUrl = _useRouteMatch.url;
|
|
1527
1631
|
var deliveriesPath = getDeliveriesPath(webhooksUrl);
|
|
1528
1632
|
var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
|
|
1529
|
-
return /*#__PURE__*/
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
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
|
+
});
|
|
1560
1667
|
};
|
|
1561
1668
|
|
|
1562
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}}
|