@bigbinary/neeto-webhooks-frontend 1.6.26 → 1.6.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/javascript/src/translations/en.json +1 -0
- package/dist/index.cjs.js +552 -430
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +537 -430
- package/dist/index.js.map +1 -1
- package/package.json +15 -14
- package/types.d.ts +1 -0
package/dist/index.cjs.js
CHANGED
|
@@ -11,18 +11,32 @@ var Container = require('@bigbinary/neeto-molecules/Container');
|
|
|
11
11
|
var Header$2 = require('@bigbinary/neeto-molecules/Header');
|
|
12
12
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
13
13
|
var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
|
|
14
|
-
var
|
|
14
|
+
var NoData = require('@bigbinary/neetoui/NoData');
|
|
15
|
+
var Table = require('@bigbinary/neetoui/Table');
|
|
15
16
|
var reactI18next = require('react-i18next');
|
|
16
17
|
var reactQuery = require('react-query');
|
|
17
18
|
var devtools = require('react-query/devtools');
|
|
19
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
18
20
|
var axios = require('axios');
|
|
19
21
|
var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
|
|
22
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
23
|
+
var Pane = require('@bigbinary/neetoui/Pane');
|
|
24
|
+
var Typography = require('@bigbinary/neetoui/Typography');
|
|
25
|
+
var Tab = require('@bigbinary/neetoui/Tab');
|
|
26
|
+
var Tag = require('@bigbinary/neetoui/Tag');
|
|
20
27
|
var i18next = require('i18next');
|
|
21
28
|
var ramda = require('ramda');
|
|
29
|
+
var Alert = require('@bigbinary/neetoui/Alert');
|
|
22
30
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
23
31
|
var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
|
|
24
32
|
var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
|
|
25
|
-
var
|
|
33
|
+
var Spinner = require('@bigbinary/neetoui/Spinner');
|
|
34
|
+
var Input = require('@bigbinary/neetoui/formik/Input');
|
|
35
|
+
var Form = require('@bigbinary/neetoui/formik/Form');
|
|
36
|
+
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
37
|
+
var Select = require('@bigbinary/neetoui/formik/Select');
|
|
38
|
+
var Switch = require('@bigbinary/neetoui/formik/Switch');
|
|
39
|
+
var Textarea = require('@bigbinary/neetoui/formik/Textarea');
|
|
26
40
|
var yup = require('yup');
|
|
27
41
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
28
42
|
|
|
@@ -51,10 +65,25 @@ var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
|
51
65
|
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header$2);
|
|
52
66
|
var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
|
|
53
67
|
var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
|
|
68
|
+
var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
|
|
69
|
+
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
54
70
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
55
71
|
var DateFormat__default = /*#__PURE__*/_interopDefaultLegacy(DateFormat);
|
|
72
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
73
|
+
var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
|
|
74
|
+
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
75
|
+
var Tab__default = /*#__PURE__*/_interopDefaultLegacy(Tab);
|
|
76
|
+
var Tag__default = /*#__PURE__*/_interopDefaultLegacy(Tag);
|
|
77
|
+
var Alert__default = /*#__PURE__*/_interopDefaultLegacy(Alert);
|
|
56
78
|
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
57
79
|
var MoreDropdown__default = /*#__PURE__*/_interopDefaultLegacy(MoreDropdown);
|
|
80
|
+
var Spinner__default = /*#__PURE__*/_interopDefaultLegacy(Spinner);
|
|
81
|
+
var Input__default = /*#__PURE__*/_interopDefaultLegacy(Input);
|
|
82
|
+
var Form__default = /*#__PURE__*/_interopDefaultLegacy(Form);
|
|
83
|
+
var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
|
|
84
|
+
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
85
|
+
var Switch__default = /*#__PURE__*/_interopDefaultLegacy(Switch);
|
|
86
|
+
var Textarea__default = /*#__PURE__*/_interopDefaultLegacy(Textarea);
|
|
58
87
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
59
88
|
|
|
60
89
|
var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
|
|
@@ -135,6 +164,47 @@ function _slicedToArray(arr, i) {
|
|
|
135
164
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
136
165
|
}
|
|
137
166
|
|
|
167
|
+
function _typeof$1(o) {
|
|
168
|
+
"@babel/helpers - typeof";
|
|
169
|
+
|
|
170
|
+
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
171
|
+
return typeof o;
|
|
172
|
+
} : function (o) {
|
|
173
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
174
|
+
}, _typeof$1(o);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function _toPrimitive(input, hint) {
|
|
178
|
+
if (_typeof$1(input) !== "object" || input === null) return input;
|
|
179
|
+
var prim = input[Symbol.toPrimitive];
|
|
180
|
+
if (prim !== undefined) {
|
|
181
|
+
var res = prim.call(input, hint || "default");
|
|
182
|
+
if (_typeof$1(res) !== "object") return res;
|
|
183
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
184
|
+
}
|
|
185
|
+
return (hint === "string" ? String : Number)(input);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function _toPropertyKey(arg) {
|
|
189
|
+
var key = _toPrimitive(arg, "string");
|
|
190
|
+
return _typeof$1(key) === "symbol" ? key : String(key);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function _defineProperty(obj, key, value) {
|
|
194
|
+
key = _toPropertyKey(key);
|
|
195
|
+
if (key in obj) {
|
|
196
|
+
Object.defineProperty(obj, key, {
|
|
197
|
+
value: value,
|
|
198
|
+
enumerable: true,
|
|
199
|
+
configurable: true,
|
|
200
|
+
writable: true
|
|
201
|
+
});
|
|
202
|
+
} else {
|
|
203
|
+
obj[key] = value;
|
|
204
|
+
}
|
|
205
|
+
return obj;
|
|
206
|
+
}
|
|
207
|
+
|
|
138
208
|
var queryClient = new reactQuery.QueryClient({
|
|
139
209
|
queryCache: new reactQuery.QueryCache(),
|
|
140
210
|
defaultOptions: {
|
|
@@ -144,15 +214,17 @@ var queryClient = new reactQuery.QueryClient({
|
|
|
144
214
|
}
|
|
145
215
|
});
|
|
146
216
|
|
|
147
|
-
|
|
217
|
+
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; }
|
|
218
|
+
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; }
|
|
148
219
|
var withReactQuery = function withReactQuery(Component) {
|
|
149
220
|
var QueryWrapper = function QueryWrapper(props) {
|
|
150
|
-
return /*#__PURE__*/
|
|
151
|
-
client: queryClient
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
221
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactQuery.QueryClientProvider, {
|
|
222
|
+
client: queryClient,
|
|
223
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$2({}, props)), /*#__PURE__*/jsxRuntime.jsx(devtools.ReactQueryDevtools, {
|
|
224
|
+
initialIsOpen: false,
|
|
225
|
+
position: "bottom-right"
|
|
226
|
+
})]
|
|
227
|
+
});
|
|
156
228
|
};
|
|
157
229
|
return QueryWrapper;
|
|
158
230
|
};
|
|
@@ -251,9 +323,9 @@ function getDefaultExportFromCjs (x) {
|
|
|
251
323
|
|
|
252
324
|
var regeneratorRuntime$1 = {exports: {}};
|
|
253
325
|
|
|
254
|
-
var _typeof
|
|
326
|
+
var _typeof = {exports: {}};
|
|
255
327
|
|
|
256
|
-
_typeof
|
|
328
|
+
_typeof.exports;
|
|
257
329
|
|
|
258
330
|
(function (module) {
|
|
259
331
|
function _typeof(o) {
|
|
@@ -266,9 +338,9 @@ _typeof$1.exports;
|
|
|
266
338
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
267
339
|
}
|
|
268
340
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
269
|
-
} (_typeof
|
|
341
|
+
} (_typeof));
|
|
270
342
|
|
|
271
|
-
var _typeofExports = _typeof
|
|
343
|
+
var _typeofExports = _typeof.exports;
|
|
272
344
|
|
|
273
345
|
regeneratorRuntime$1.exports;
|
|
274
346
|
|
|
@@ -607,10 +679,11 @@ var Snippet = function Snippet(_ref) {
|
|
|
607
679
|
var children = _ref.children,
|
|
608
680
|
_ref$dataCy = _ref.dataCy,
|
|
609
681
|
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy;
|
|
610
|
-
return /*#__PURE__*/
|
|
682
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
611
683
|
className: "neeto-ui-rounded neeto-ui-border-gray-300 neeto-ui-bg-gray-100 my-2 whitespace-pre-wrap break-all border p-4",
|
|
612
|
-
"data-cy": dataCy
|
|
613
|
-
|
|
684
|
+
"data-cy": dataCy,
|
|
685
|
+
children: children
|
|
686
|
+
});
|
|
614
687
|
};
|
|
615
688
|
|
|
616
689
|
var TransactionDetails = function TransactionDetails(_ref) {
|
|
@@ -622,8 +695,8 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
622
695
|
var _useTranslation = reactI18next.useTranslation(),
|
|
623
696
|
t = _useTranslation.t;
|
|
624
697
|
var status = delivery.status,
|
|
625
|
-
|
|
626
|
-
|
|
698
|
+
responseStatusCode = delivery.responseStatusCode,
|
|
699
|
+
sid = delivery.sid;
|
|
627
700
|
var renderPayload = function renderPayload() {
|
|
628
701
|
try {
|
|
629
702
|
return JSON.stringify(JSON.parse(delivery.requestBody), null, 2);
|
|
@@ -631,57 +704,89 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
631
704
|
return "";
|
|
632
705
|
}
|
|
633
706
|
};
|
|
634
|
-
return /*#__PURE__*/
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
707
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
708
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
709
|
+
className: "neeto-ui-bg-white sticky top-0 mb-2 flex w-full flex-col",
|
|
710
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
711
|
+
className: "flex w-full flex-col space-y-2 pb-4",
|
|
712
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
713
|
+
className: "flex items-center space-x-1",
|
|
714
|
+
children: [t("neetoWebhooks.delivery.sid"), ":", /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
715
|
+
className: "px-2 font-bold",
|
|
716
|
+
"data-cy": "delivery-identifier",
|
|
717
|
+
style: "body2",
|
|
718
|
+
children: sid
|
|
719
|
+
})]
|
|
720
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
721
|
+
className: "flex items-center",
|
|
722
|
+
children: [t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
723
|
+
className: "px-2 font-bold",
|
|
724
|
+
"data-cy": "delivery-response-code",
|
|
725
|
+
style: "body2",
|
|
726
|
+
children: responseStatusCode
|
|
727
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
|
|
728
|
+
style: status === "success" ? "success" : "warning",
|
|
729
|
+
children: status
|
|
730
|
+
})]
|
|
731
|
+
})]
|
|
732
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Tab__default["default"], {
|
|
733
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Tab__default["default"].Item, {
|
|
734
|
+
active: activeHeader === DELIVERY_TAB.request,
|
|
735
|
+
onClick: function onClick() {
|
|
736
|
+
return setActiveHeader(DELIVERY_TAB.request);
|
|
737
|
+
},
|
|
738
|
+
children: t("neetoWebhooks.delivery.request")
|
|
739
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Tab__default["default"].Item, {
|
|
740
|
+
active: activeHeader === DELIVERY_TAB.response,
|
|
741
|
+
onClick: function onClick() {
|
|
742
|
+
return setActiveHeader(DELIVERY_TAB.response);
|
|
743
|
+
},
|
|
744
|
+
children: t("neetoWebhooks.delivery.response")
|
|
745
|
+
})]
|
|
746
|
+
})]
|
|
747
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
748
|
+
className: "mt-2 w-full",
|
|
749
|
+
children: activeHeader === DELIVERY_TAB.request ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
750
|
+
className: "space-y-4",
|
|
751
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
752
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
753
|
+
style: "h5",
|
|
754
|
+
children: t("neetoWebhooks.delivery.header")
|
|
755
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Snippet, {
|
|
756
|
+
dataCy: "delivery-request-header",
|
|
757
|
+
children: delivery.requestHeader
|
|
758
|
+
})]
|
|
759
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
760
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
761
|
+
style: "h5",
|
|
762
|
+
children: t("neetoWebhooks.delivery.payload")
|
|
763
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Snippet, {
|
|
764
|
+
dataCy: "delivery-request-payload",
|
|
765
|
+
children: renderPayload()
|
|
766
|
+
})]
|
|
767
|
+
})]
|
|
768
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
769
|
+
className: "space-y-4",
|
|
770
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
771
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
772
|
+
style: "h5",
|
|
773
|
+
children: t("neetoWebhooks.delivery.header")
|
|
774
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Snippet, {
|
|
775
|
+
dataCy: "delivery-response-header",
|
|
776
|
+
children: delivery.responseHeader
|
|
777
|
+
})]
|
|
778
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
779
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
780
|
+
style: "h5",
|
|
781
|
+
children: t("neetoWebhooks.delivery.body")
|
|
782
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Snippet, {
|
|
783
|
+
dataCy: "delivery-response-body",
|
|
784
|
+
children: delivery.responseBody
|
|
785
|
+
})]
|
|
786
|
+
})]
|
|
787
|
+
})
|
|
788
|
+
})]
|
|
789
|
+
});
|
|
685
790
|
};
|
|
686
791
|
|
|
687
792
|
var Details = function Details(_ref) {
|
|
@@ -718,64 +823,81 @@ var Details = function Details(_ref) {
|
|
|
718
823
|
if (neetoCist.isNotPresent(delivery)) {
|
|
719
824
|
return null;
|
|
720
825
|
}
|
|
721
|
-
return /*#__PURE__*/
|
|
826
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"], {
|
|
722
827
|
onClose: onClose,
|
|
723
828
|
isOpen: neetoCist.isPresent(deliveryId),
|
|
724
|
-
size: "large"
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
829
|
+
size: "large",
|
|
830
|
+
children: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
831
|
+
children: isLoading ? /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
832
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Header, {
|
|
833
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
834
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DateFormat__default["default"].Date, {
|
|
835
|
+
date: delivery.createdAt,
|
|
836
|
+
tooltipProps: {
|
|
837
|
+
disabled: true
|
|
838
|
+
},
|
|
839
|
+
typographyProps: {
|
|
840
|
+
style: "h2",
|
|
841
|
+
weight: "semibold"
|
|
842
|
+
}
|
|
843
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
844
|
+
children: " \u2022 "
|
|
845
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DateFormat__default["default"].Time, {
|
|
846
|
+
date: delivery.createdAt,
|
|
847
|
+
tooltipProps: {
|
|
848
|
+
disabled: true
|
|
849
|
+
},
|
|
850
|
+
typographyProps: {
|
|
851
|
+
style: "h2",
|
|
852
|
+
weight: "normal"
|
|
853
|
+
}
|
|
854
|
+
})]
|
|
855
|
+
})
|
|
856
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Body, {
|
|
857
|
+
children: neetoCist.isPresent(delivery) && /*#__PURE__*/jsxRuntime.jsx(TransactionDetails, {
|
|
858
|
+
delivery: delivery
|
|
859
|
+
})
|
|
860
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"].Footer, {
|
|
861
|
+
className: "gap-x-2",
|
|
862
|
+
children: [event && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
863
|
+
disabled: isRedelivering,
|
|
864
|
+
label: t("neetoWebhooks.delivery.redeliver"),
|
|
865
|
+
loading: isRedelivering,
|
|
866
|
+
style: "primary",
|
|
867
|
+
onClick: handleRedeliverClick
|
|
868
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
869
|
+
label: t("neetoWebhooks.buttons.cancel"),
|
|
870
|
+
style: "text",
|
|
871
|
+
onClick: onClose
|
|
872
|
+
})]
|
|
873
|
+
})]
|
|
874
|
+
})
|
|
875
|
+
})
|
|
876
|
+
});
|
|
758
877
|
};
|
|
759
878
|
|
|
760
879
|
var buildColumns$1 = function buildColumns(_ref) {
|
|
761
880
|
var handleDetailsClick = _ref.handleDetailsClick;
|
|
762
881
|
return [{
|
|
763
|
-
title: i18next.t("neetoWebhooks.delivery.
|
|
764
|
-
key: "
|
|
765
|
-
dataIndex: "
|
|
882
|
+
title: i18next.t("neetoWebhooks.delivery.sid", constants.SINGULAR),
|
|
883
|
+
key: "sid",
|
|
884
|
+
dataIndex: "sid",
|
|
766
885
|
width: 390,
|
|
767
886
|
render: function render(_, delivery) {
|
|
768
|
-
return /*#__PURE__*/
|
|
769
|
-
className: "flex items-center gap-x-3"
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
887
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
888
|
+
className: "flex items-center gap-x-3",
|
|
889
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
890
|
+
style: "link",
|
|
891
|
+
weight: "semibold",
|
|
892
|
+
onClick: function onClick() {
|
|
893
|
+
return handleDetailsClick(delivery.sid);
|
|
894
|
+
},
|
|
895
|
+
children: delivery.sid
|
|
896
|
+
}), delivery.redelivery && /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
|
|
897
|
+
style: "info",
|
|
898
|
+
children: i18next.t("neetoWebhooks.delivery.redelivery")
|
|
899
|
+
})]
|
|
900
|
+
});
|
|
779
901
|
}
|
|
780
902
|
}, {
|
|
781
903
|
title: i18next.t("neetoWebhooks.tableHeaders.createdAt"),
|
|
@@ -783,11 +905,14 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
783
905
|
dataIndex: "createdAt",
|
|
784
906
|
width: 280,
|
|
785
907
|
render: function render(createdAt) {
|
|
786
|
-
return /*#__PURE__*/
|
|
787
|
-
className: "flex items-center justify-between space-x-1"
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
908
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
909
|
+
className: "flex items-center justify-between space-x-1",
|
|
910
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
911
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DateFormat__default["default"].DateTime, {
|
|
912
|
+
date: createdAt
|
|
913
|
+
})
|
|
914
|
+
})
|
|
915
|
+
});
|
|
791
916
|
}
|
|
792
917
|
}, {
|
|
793
918
|
title: i18next.t("neetoWebhooks.common.responseStatus"),
|
|
@@ -796,14 +921,17 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
796
921
|
render: function render(_ref2) {
|
|
797
922
|
var responseStatusCode = _ref2.responseStatusCode,
|
|
798
923
|
status = _ref2.status;
|
|
799
|
-
return /*#__PURE__*/
|
|
800
|
-
className: "flex items-center"
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
924
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
925
|
+
className: "flex items-center",
|
|
926
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
927
|
+
className: "px-2",
|
|
928
|
+
style: "body2",
|
|
929
|
+
children: responseStatusCode
|
|
930
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
|
|
931
|
+
style: status === "success" ? "success" : "warning",
|
|
932
|
+
children: status
|
|
933
|
+
})]
|
|
934
|
+
});
|
|
807
935
|
}
|
|
808
936
|
}, {
|
|
809
937
|
title: i18next.t("neetoWebhooks.common.event", constants.SINGULAR),
|
|
@@ -863,35 +991,38 @@ var Deliveries = function Deliveries(_ref) {
|
|
|
863
991
|
webhookId: webhookId
|
|
864
992
|
}));
|
|
865
993
|
};
|
|
866
|
-
if (isLoading) return /*#__PURE__*/
|
|
867
|
-
return /*#__PURE__*/
|
|
868
|
-
className: "w-full"
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
994
|
+
if (isLoading) return /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {});
|
|
995
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container__default["default"], {
|
|
996
|
+
className: "w-full",
|
|
997
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Header__default["default"], {
|
|
998
|
+
breadcrumbs: breadcrumbs,
|
|
999
|
+
title: t("neetoWebhooks.delivery.title")
|
|
1000
|
+
}), neetoCist.isNotEmpty(deliveries) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
|
|
1001
|
+
hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
|
|
1002
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
|
|
1003
|
+
totalCount: totalCount,
|
|
1004
|
+
fixedHeight: true,
|
|
1005
|
+
columnData: buildColumns$1({
|
|
1006
|
+
handleDetailsClick: handleDetailsClick
|
|
1007
|
+
}),
|
|
1008
|
+
currentPageNumber: pageNumber,
|
|
1009
|
+
defaultPageSize: constants.DEFAULT_PAGE_SIZE,
|
|
1010
|
+
handlePageChange: setPageNumber,
|
|
1011
|
+
loading: isFetching,
|
|
1012
|
+
rowData: deliveries
|
|
1013
|
+
})
|
|
1014
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1015
|
+
className: "flex h-full w-full items-center justify-center",
|
|
1016
|
+
children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], {
|
|
1017
|
+
description: t("neetoWebhooks.delivery.empty.description"),
|
|
1018
|
+
title: t("neetoWebhooks.delivery.empty.title")
|
|
1019
|
+
})
|
|
1020
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Details, {
|
|
1021
|
+
deliveryId: deliveryId,
|
|
1022
|
+
webhookSid: webhookId,
|
|
1023
|
+
onClose: handleClose
|
|
1024
|
+
})]
|
|
1025
|
+
});
|
|
895
1026
|
};
|
|
896
1027
|
var Deliveries$1 = withReactQuery(Deliveries);
|
|
897
1028
|
|
|
@@ -980,47 +1111,6 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
|
980
1111
|
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
981
1112
|
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
982
1113
|
|
|
983
|
-
function _typeof(o) {
|
|
984
|
-
"@babel/helpers - typeof";
|
|
985
|
-
|
|
986
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
987
|
-
return typeof o;
|
|
988
|
-
} : function (o) {
|
|
989
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
990
|
-
}, _typeof(o);
|
|
991
|
-
}
|
|
992
|
-
|
|
993
|
-
function _toPrimitive(input, hint) {
|
|
994
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
995
|
-
var prim = input[Symbol.toPrimitive];
|
|
996
|
-
if (prim !== undefined) {
|
|
997
|
-
var res = prim.call(input, hint || "default");
|
|
998
|
-
if (_typeof(res) !== "object") return res;
|
|
999
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1000
|
-
}
|
|
1001
|
-
return (hint === "string" ? String : Number)(input);
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
function _toPropertyKey(arg) {
|
|
1005
|
-
var key = _toPrimitive(arg, "string");
|
|
1006
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
function _defineProperty(obj, key, value) {
|
|
1010
|
-
key = _toPropertyKey(key);
|
|
1011
|
-
if (key in obj) {
|
|
1012
|
-
Object.defineProperty(obj, key, {
|
|
1013
|
-
value: value,
|
|
1014
|
-
enumerable: true,
|
|
1015
|
-
configurable: true,
|
|
1016
|
-
writable: true
|
|
1017
|
-
});
|
|
1018
|
-
} else {
|
|
1019
|
-
obj[key] = value;
|
|
1020
|
-
}
|
|
1021
|
-
return obj;
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
1114
|
var baseUrl = "/webhooks/events/all";
|
|
1025
1115
|
var all = function all() {
|
|
1026
1116
|
return axios__default["default"].get(baseUrl);
|
|
@@ -1169,26 +1259,28 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1169
1259
|
dataIndex: "endpoint",
|
|
1170
1260
|
width: 830,
|
|
1171
1261
|
render: function render(endpoint, webhook) {
|
|
1172
|
-
return /*#__PURE__*/
|
|
1173
|
-
className: "flex items-center justify-between space-x-3"
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
menuItems: getMenuItems({
|
|
1184
|
-
onEdit: function onEdit() {
|
|
1185
|
-
return handleEdit(webhook.id);
|
|
1262
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1263
|
+
className: "flex items-center justify-between space-x-3",
|
|
1264
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
1265
|
+
style: "link",
|
|
1266
|
+
to: utils.buildUrl(deliveriesPath, {
|
|
1267
|
+
webhookId: webhook.sid
|
|
1268
|
+
}),
|
|
1269
|
+
children: endpoint
|
|
1270
|
+
}), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
1271
|
+
dropdownProps: {
|
|
1272
|
+
strategy: "fixed"
|
|
1186
1273
|
},
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1274
|
+
menuItems: getMenuItems({
|
|
1275
|
+
onEdit: function onEdit() {
|
|
1276
|
+
return handleEdit(webhook.id);
|
|
1277
|
+
},
|
|
1278
|
+
onDelete: function onDelete() {
|
|
1279
|
+
return handleDelete(webhook.id);
|
|
1280
|
+
}
|
|
1281
|
+
})
|
|
1282
|
+
})]
|
|
1283
|
+
});
|
|
1192
1284
|
}
|
|
1193
1285
|
}, {
|
|
1194
1286
|
title: i18next.t("neetoWebhooks.webhook.active"),
|
|
@@ -1287,134 +1379,154 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1287
1379
|
setIsSecretInputFieldVisible(true);
|
|
1288
1380
|
}
|
|
1289
1381
|
}, [webhook]);
|
|
1290
|
-
return /*#__PURE__*/
|
|
1382
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"], {
|
|
1291
1383
|
isOpen: isOpen,
|
|
1292
1384
|
onClose: onClose,
|
|
1293
|
-
initialFocusRef: endpointRef
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
href: WEBHOOK_HELP_URL
|
|
1304
|
-
},
|
|
1305
|
-
title: t("neetoWebhooks.webhook.title")
|
|
1306
|
-
})), /*#__PURE__*/React__default["default"].createElement(formik.Form, {
|
|
1307
|
-
formikProps: {
|
|
1308
|
-
enableReinitialize: true,
|
|
1309
|
-
validationSchema: getValidationSchema(webhooks),
|
|
1310
|
-
initialValues: initialValues,
|
|
1311
|
-
onSubmit: function onSubmit(values) {
|
|
1312
|
-
return handleSubmit(getValidationSchema().cast(values));
|
|
1313
|
-
}
|
|
1314
|
-
}
|
|
1315
|
-
}, function (_ref2) {
|
|
1316
|
-
var setFieldValue = _ref2.setFieldValue;
|
|
1317
|
-
return isLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1318
|
-
className: "flex items-center justify-center"
|
|
1319
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Spinner, null)) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1320
|
-
className: "w-full space-y-4"
|
|
1321
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Textarea, {
|
|
1322
|
-
required: true,
|
|
1323
|
-
"data-cy": "endpoint-input-field",
|
|
1324
|
-
label: t("neetoWebhooks.webhook.endpoint"),
|
|
1325
|
-
name: "endpoint",
|
|
1326
|
-
placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
|
|
1327
|
-
ref: endpointRef,
|
|
1328
|
-
rows: 1
|
|
1329
|
-
}), !isLoading && /*#__PURE__*/React__default["default"].createElement(formik.Select, {
|
|
1330
|
-
isMulti: true,
|
|
1331
|
-
required: true,
|
|
1332
|
-
getOptionLabel: ramda.prop("label"),
|
|
1333
|
-
getOptionValue: ramda.prop("identifier"),
|
|
1334
|
-
label: t("neetoWebhooks.common.event", constants.PLURAL),
|
|
1335
|
-
name: "events",
|
|
1336
|
-
options: events,
|
|
1337
|
-
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
1338
|
-
}), isSecretInputFieldVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1339
|
-
className: "flex items-center justify-between space-x-3"
|
|
1340
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
1341
|
-
"data-cy": "secret-key-input-field",
|
|
1342
|
-
name: "secret",
|
|
1343
|
-
label: /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1344
|
-
className: "flex items-center gap-x-2"
|
|
1345
|
-
}, t("neetoWebhooks.webhook.secret"), /*#__PURE__*/React__default["default"].createElement(HelpPopover__default["default"], {
|
|
1385
|
+
initialFocusRef: endpointRef,
|
|
1386
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"].Header, {
|
|
1387
|
+
className: "flex items-center gap-x-2",
|
|
1388
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
1389
|
+
"data-cy": "add-new-webhook-pane-header",
|
|
1390
|
+
style: "h2",
|
|
1391
|
+
weight: "semibold",
|
|
1392
|
+
children: editingWebhookId ? t("neetoWebhooks.webhook.edit") : t("neetoWebhooks.webhook.add")
|
|
1393
|
+
}), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
|
|
1394
|
+
description: t("neetoWebhooks.webhook.helpDescription"),
|
|
1346
1395
|
helpLinkProps: {
|
|
1347
|
-
href:
|
|
1396
|
+
href: WEBHOOK_HELP_URL
|
|
1348
1397
|
},
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
label: t("neetoWebhooks.buttons.regenerate"),
|
|
1359
|
-
"data-cy": "regenerate-secret",
|
|
1360
|
-
onClick: function onClick() {
|
|
1361
|
-
return handleRegenerate(setFieldValue);
|
|
1398
|
+
title: t("neetoWebhooks.webhook.title")
|
|
1399
|
+
})]
|
|
1400
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Form__default["default"], {
|
|
1401
|
+
formikProps: {
|
|
1402
|
+
enableReinitialize: true,
|
|
1403
|
+
validationSchema: getValidationSchema(webhooks),
|
|
1404
|
+
initialValues: initialValues,
|
|
1405
|
+
onSubmit: function onSubmit(values) {
|
|
1406
|
+
return handleSubmit(getValidationSchema().cast(values));
|
|
1362
1407
|
}
|
|
1363
|
-
},
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1408
|
+
},
|
|
1409
|
+
children: function children(_ref2) {
|
|
1410
|
+
var setFieldValue = _ref2.setFieldValue;
|
|
1411
|
+
return isLoading ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1412
|
+
className: "flex items-center justify-center",
|
|
1413
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Spinner__default["default"], {})
|
|
1414
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1415
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Body, {
|
|
1416
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1417
|
+
className: "w-full space-y-4",
|
|
1418
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Textarea__default["default"], {
|
|
1419
|
+
required: true,
|
|
1420
|
+
"data-cy": "endpoint-input-field",
|
|
1421
|
+
label: t("neetoWebhooks.webhook.endpoint"),
|
|
1422
|
+
name: "endpoint",
|
|
1423
|
+
placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
|
|
1424
|
+
ref: endpointRef,
|
|
1425
|
+
rows: 1
|
|
1426
|
+
}), !isLoading && /*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
1427
|
+
isMulti: true,
|
|
1428
|
+
required: true,
|
|
1429
|
+
getOptionLabel: ramda.prop("label"),
|
|
1430
|
+
getOptionValue: ramda.prop("identifier"),
|
|
1431
|
+
label: t("neetoWebhooks.common.event", constants.PLURAL),
|
|
1432
|
+
name: "events",
|
|
1433
|
+
options: events,
|
|
1434
|
+
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
1435
|
+
}), isSecretInputFieldVisible && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1436
|
+
className: "flex items-center justify-between space-x-3",
|
|
1437
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Input__default["default"], {
|
|
1438
|
+
"data-cy": "secret-key-input-field",
|
|
1439
|
+
name: "secret",
|
|
1440
|
+
label: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
1441
|
+
className: "flex items-center gap-x-2",
|
|
1442
|
+
children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
|
|
1443
|
+
helpLinkProps: {
|
|
1444
|
+
href: WEBHOOK_SECRETS_HELP_URL
|
|
1445
|
+
},
|
|
1446
|
+
description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
|
|
1447
|
+
title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
|
|
1448
|
+
})]
|
|
1449
|
+
}),
|
|
1450
|
+
placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
|
|
1451
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1452
|
+
className: "mt-6",
|
|
1453
|
+
children: /*#__PURE__*/jsxRuntime.jsx(MoreDropdown__default["default"], {
|
|
1454
|
+
menuItems: [{
|
|
1455
|
+
key: "regenerate-secret",
|
|
1456
|
+
label: t("neetoWebhooks.buttons.regenerate"),
|
|
1457
|
+
"data-cy": "regenerate-secret",
|
|
1458
|
+
onClick: function onClick() {
|
|
1459
|
+
return handleRegenerate(setFieldValue);
|
|
1460
|
+
}
|
|
1461
|
+
}, {
|
|
1462
|
+
key: "delete-secret",
|
|
1463
|
+
label: t("neetoWebhooks.buttons.delete"),
|
|
1464
|
+
"data-cy": "delete-secret",
|
|
1465
|
+
onClick: function onClick() {
|
|
1466
|
+
return handleDelete(setFieldValue);
|
|
1467
|
+
}
|
|
1468
|
+
}]
|
|
1469
|
+
})
|
|
1470
|
+
})]
|
|
1471
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Switch__default["default"], {
|
|
1472
|
+
label: t("neetoWebhooks.webhook.active"),
|
|
1473
|
+
name: "isActive"
|
|
1474
|
+
}), !isSecretInputFieldVisible && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
1475
|
+
"data-cy": "add-secret-key",
|
|
1476
|
+
icon: neetoIcons.Plus,
|
|
1477
|
+
label: t("neetoWebhooks.buttons.addSecretKey"),
|
|
1478
|
+
style: "text",
|
|
1479
|
+
onClick: function onClick() {
|
|
1480
|
+
return handleClick(setFieldValue);
|
|
1481
|
+
}
|
|
1482
|
+
})]
|
|
1483
|
+
})
|
|
1484
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
|
|
1485
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
1486
|
+
cancelButtonProps: {
|
|
1487
|
+
onClick: onClose
|
|
1488
|
+
}
|
|
1489
|
+
})
|
|
1490
|
+
})]
|
|
1491
|
+
});
|
|
1385
1492
|
}
|
|
1386
|
-
})
|
|
1387
|
-
})
|
|
1493
|
+
})]
|
|
1494
|
+
});
|
|
1388
1495
|
};
|
|
1389
1496
|
|
|
1390
1497
|
var Header = reactUtils.withT(function (_ref) {
|
|
1391
1498
|
var t = _ref.t,
|
|
1392
1499
|
breadcrumbs = _ref.breadcrumbs,
|
|
1500
|
+
title = _ref.title,
|
|
1393
1501
|
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen;
|
|
1394
|
-
return /*#__PURE__*/
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1502
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
1503
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Header__default["default"], {
|
|
1504
|
+
breadcrumbs: breadcrumbs,
|
|
1505
|
+
actionBlock: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
1506
|
+
"data-cy": "add-new-webhook-button",
|
|
1507
|
+
label: t("neetoWebhooks.webhook.add"),
|
|
1508
|
+
onClick: function onClick() {
|
|
1509
|
+
return setIsAddWebhookPaneOpen(true);
|
|
1510
|
+
}
|
|
1511
|
+
}),
|
|
1512
|
+
title: title || /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1513
|
+
className: "flex items-center gap-x-2",
|
|
1514
|
+
children: [t("neetoWebhooks.webhook.title"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover__default["default"], {
|
|
1515
|
+
description: t("neetoWebhooks.webhook.helpDescription"),
|
|
1516
|
+
helpLinkProps: {
|
|
1517
|
+
href: WEBHOOK_HELP_URL
|
|
1518
|
+
},
|
|
1519
|
+
title: t("neetoWebhooks.webhook.title")
|
|
1520
|
+
})]
|
|
1521
|
+
})
|
|
1522
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
1523
|
+
className: "mb-3",
|
|
1524
|
+
"data-cy": "webhook-description-header",
|
|
1525
|
+
style: "h5",
|
|
1526
|
+
weight: "normal",
|
|
1527
|
+
children: t("neetoWebhooks.webhook.description")
|
|
1528
|
+
})]
|
|
1529
|
+
});
|
|
1418
1530
|
});
|
|
1419
1531
|
var Header$1 = /*#__PURE__*/React__default["default"].memo(Header);
|
|
1420
1532
|
|
|
@@ -1422,6 +1534,7 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1422
1534
|
var deliveriesPath = _ref.deliveriesPath,
|
|
1423
1535
|
entityType = _ref.entityType,
|
|
1424
1536
|
breadcrumbs = _ref.breadcrumbs,
|
|
1537
|
+
title = _ref.title,
|
|
1425
1538
|
entityId = _ref.entityId,
|
|
1426
1539
|
onCreate = _ref.onCreate,
|
|
1427
1540
|
onDelete = _ref.onDelete;
|
|
@@ -1481,71 +1594,76 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1481
1594
|
setIsDeleteAlertOpen(true);
|
|
1482
1595
|
}, []);
|
|
1483
1596
|
if (isLoading) {
|
|
1484
|
-
return /*#__PURE__*/
|
|
1597
|
+
return /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {});
|
|
1485
1598
|
}
|
|
1486
|
-
return /*#__PURE__*/
|
|
1487
|
-
className: "w-full"
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1599
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Container__default["default"], {
|
|
1600
|
+
className: "w-full",
|
|
1601
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Header$1, {
|
|
1602
|
+
breadcrumbs: breadcrumbs,
|
|
1603
|
+
setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
|
|
1604
|
+
title: title
|
|
1605
|
+
}), neetoCist.isNotEmpty(webhooks) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper__default["default"], {
|
|
1606
|
+
hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
|
|
1607
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Table__default["default"], {
|
|
1608
|
+
totalCount: totalCount,
|
|
1609
|
+
fixedHeight: true,
|
|
1610
|
+
currentPageNumber: pageNumber,
|
|
1611
|
+
defaultPageSize: constants.DEFAULT_PAGE_SIZE,
|
|
1612
|
+
handlePageChange: setPageNumber,
|
|
1613
|
+
loading: isFetching,
|
|
1614
|
+
rowData: webhooks,
|
|
1615
|
+
columnData: buildColumns({
|
|
1616
|
+
handleDelete: handleDelete,
|
|
1617
|
+
handleEdit: handleEdit,
|
|
1618
|
+
deliveriesPath: deliveriesPath
|
|
1619
|
+
})
|
|
1620
|
+
})
|
|
1621
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1622
|
+
className: "flex h-full w-full items-center justify-center",
|
|
1623
|
+
children: /*#__PURE__*/jsxRuntime.jsx(NoData__default["default"], {
|
|
1624
|
+
title: t("neetoWebhooks.webhook.empty"),
|
|
1625
|
+
helpText: /*#__PURE__*/jsxRuntime.jsx("a", {
|
|
1626
|
+
className: "neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium",
|
|
1627
|
+
href: WEBHOOK_HELP_URL,
|
|
1628
|
+
rel: "noreferrer",
|
|
1629
|
+
target: "_blank",
|
|
1630
|
+
children: t("neetoWebhooks.webhook.emptyHelpText")
|
|
1631
|
+
}),
|
|
1632
|
+
primaryButtonProps: {
|
|
1633
|
+
label: t("neetoWebhooks.webhook.add"),
|
|
1634
|
+
onClick: function onClick() {
|
|
1635
|
+
return setIsAddWebhookPaneOpen(true);
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
})
|
|
1639
|
+
}), /*#__PURE__*/jsxRuntime.jsx(AddWebhookPane, {
|
|
1640
|
+
editingWebhookId: editingWebhookId,
|
|
1641
|
+
entityId: entityId,
|
|
1642
|
+
entityType: entityType,
|
|
1643
|
+
onCreate: onCreate,
|
|
1644
|
+
webhooks: webhooks,
|
|
1645
|
+
isOpen: isAddWebhookPaneOpen,
|
|
1646
|
+
onClose: handlePaneClose
|
|
1647
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Alert__default["default"], {
|
|
1648
|
+
isOpen: isDeleteAlertOpen,
|
|
1649
|
+
isSubmitting: isDeleting,
|
|
1650
|
+
submitButtonLabel: t("neetoWebhooks.buttons.delete"),
|
|
1651
|
+
message: t("neetoWebhooks.alert.delete.message", {
|
|
1652
|
+
entity: t("neetoWebhooks.entity.webhook")
|
|
1653
|
+
}),
|
|
1654
|
+
title: t("neetoWebhooks.alert.delete.title", {
|
|
1655
|
+
entity: t("neetoWebhooks.entity.webhook")
|
|
1656
|
+
}),
|
|
1657
|
+
onClose: function onClose() {
|
|
1658
|
+
return setIsDeleteAlertOpen(false);
|
|
1659
|
+
},
|
|
1660
|
+
onSubmit: function onSubmit() {
|
|
1661
|
+
return destroyWebhook(deletingWebhookId, {
|
|
1662
|
+
entityId: entityId
|
|
1663
|
+
});
|
|
1520
1664
|
}
|
|
1521
|
-
}
|
|
1522
|
-
})
|
|
1523
|
-
editingWebhookId: editingWebhookId,
|
|
1524
|
-
entityId: entityId,
|
|
1525
|
-
entityType: entityType,
|
|
1526
|
-
onCreate: onCreate,
|
|
1527
|
-
webhooks: webhooks,
|
|
1528
|
-
isOpen: isAddWebhookPaneOpen,
|
|
1529
|
-
onClose: handlePaneClose
|
|
1530
|
-
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Alert, {
|
|
1531
|
-
isOpen: isDeleteAlertOpen,
|
|
1532
|
-
isSubmitting: isDeleting,
|
|
1533
|
-
submitButtonLabel: t("neetoWebhooks.buttons.delete"),
|
|
1534
|
-
message: t("neetoWebhooks.alert.delete.message", {
|
|
1535
|
-
entity: t("neetoWebhooks.entity.webhook")
|
|
1536
|
-
}),
|
|
1537
|
-
title: t("neetoWebhooks.alert.delete.title", {
|
|
1538
|
-
entity: t("neetoWebhooks.entity.webhook")
|
|
1539
|
-
}),
|
|
1540
|
-
onClose: function onClose() {
|
|
1541
|
-
return setIsDeleteAlertOpen(false);
|
|
1542
|
-
},
|
|
1543
|
-
onSubmit: function onSubmit() {
|
|
1544
|
-
return destroyWebhook(deletingWebhookId, {
|
|
1545
|
-
entityId: entityId
|
|
1546
|
-
});
|
|
1547
|
-
}
|
|
1548
|
-
}));
|
|
1665
|
+
})]
|
|
1666
|
+
});
|
|
1549
1667
|
};
|
|
1550
1668
|
var Webhooks$1 = withReactQuery(Webhooks);
|
|
1551
1669
|
|
|
@@ -1554,6 +1672,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1554
1672
|
entityId = _ref.entityId,
|
|
1555
1673
|
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
1556
1674
|
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
1675
|
+
title = _ref.title,
|
|
1557
1676
|
onCreate = _ref.onCreate,
|
|
1558
1677
|
onDelete = _ref.onDelete;
|
|
1559
1678
|
var _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
@@ -1561,37 +1680,40 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1561
1680
|
webhooksUrl = _useRouteMatch.url;
|
|
1562
1681
|
var deliveriesPath = getDeliveriesPath(webhooksUrl);
|
|
1563
1682
|
var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
|
|
1564
|
-
return /*#__PURE__*/
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1683
|
+
return /*#__PURE__*/jsxRuntime.jsxs(reactRouterDom.Switch, {
|
|
1684
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1685
|
+
exact: true,
|
|
1686
|
+
path: webhooksPath,
|
|
1687
|
+
component: function component() {
|
|
1688
|
+
return /*#__PURE__*/jsxRuntime.jsx(Webhooks$1, {
|
|
1689
|
+
breadcrumbs: breadcrumbs,
|
|
1690
|
+
deliveriesPath: deliveriesPath,
|
|
1691
|
+
entityId: entityId,
|
|
1692
|
+
entityType: entityType,
|
|
1693
|
+
onCreate: onCreate,
|
|
1694
|
+
onDelete: onDelete,
|
|
1695
|
+
title: title
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1699
|
+
exact: true,
|
|
1700
|
+
path: deliveryDetailsPath,
|
|
1701
|
+
render: function render() {
|
|
1702
|
+
return /*#__PURE__*/jsxRuntime.jsx(Deliveries$1, {
|
|
1703
|
+
breadcrumbs: breadcrumbs,
|
|
1704
|
+
webhooksUrl: webhooksUrl
|
|
1705
|
+
});
|
|
1706
|
+
}
|
|
1707
|
+
}), /*#__PURE__*/jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1708
|
+
component: function component() {
|
|
1709
|
+
return /*#__PURE__*/jsxRuntime.jsx(Deliveries$1, {
|
|
1710
|
+
breadcrumbs: breadcrumbs,
|
|
1711
|
+
webhooksUrl: webhooksUrl
|
|
1712
|
+
});
|
|
1713
|
+
},
|
|
1714
|
+
path: deliveriesPath
|
|
1715
|
+
})]
|
|
1716
|
+
});
|
|
1595
1717
|
};
|
|
1596
1718
|
|
|
1597
1719
|
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}}
|