@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.cjs.js
CHANGED
|
@@ -11,19 +11,34 @@ 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');
|
|
41
|
+
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
27
42
|
|
|
28
43
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
29
44
|
|
|
@@ -50,10 +65,25 @@ var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
|
50
65
|
var Header__default = /*#__PURE__*/_interopDefaultLegacy(Header$2);
|
|
51
66
|
var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
|
|
52
67
|
var TableWrapper__default = /*#__PURE__*/_interopDefaultLegacy(TableWrapper);
|
|
68
|
+
var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
|
|
69
|
+
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
53
70
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
54
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);
|
|
55
78
|
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
56
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);
|
|
57
87
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
58
88
|
|
|
59
89
|
var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
|
|
@@ -134,6 +164,47 @@ function _slicedToArray(arr, i) {
|
|
|
134
164
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
135
165
|
}
|
|
136
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
|
+
|
|
137
208
|
var queryClient = new reactQuery.QueryClient({
|
|
138
209
|
queryCache: new reactQuery.QueryCache(),
|
|
139
210
|
defaultOptions: {
|
|
@@ -143,15 +214,17 @@ var queryClient = new reactQuery.QueryClient({
|
|
|
143
214
|
}
|
|
144
215
|
});
|
|
145
216
|
|
|
146
|
-
|
|
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; }
|
|
147
219
|
var withReactQuery = function withReactQuery(Component) {
|
|
148
220
|
var QueryWrapper = function QueryWrapper(props) {
|
|
149
|
-
return /*#__PURE__*/
|
|
150
|
-
client: queryClient
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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
|
+
});
|
|
155
228
|
};
|
|
156
229
|
return QueryWrapper;
|
|
157
230
|
};
|
|
@@ -250,9 +323,9 @@ function getDefaultExportFromCjs (x) {
|
|
|
250
323
|
|
|
251
324
|
var regeneratorRuntime$1 = {exports: {}};
|
|
252
325
|
|
|
253
|
-
var _typeof
|
|
326
|
+
var _typeof = {exports: {}};
|
|
254
327
|
|
|
255
|
-
_typeof
|
|
328
|
+
_typeof.exports;
|
|
256
329
|
|
|
257
330
|
(function (module) {
|
|
258
331
|
function _typeof(o) {
|
|
@@ -265,9 +338,9 @@ _typeof$1.exports;
|
|
|
265
338
|
}, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
|
266
339
|
}
|
|
267
340
|
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
268
|
-
} (_typeof
|
|
341
|
+
} (_typeof));
|
|
269
342
|
|
|
270
|
-
var _typeofExports = _typeof
|
|
343
|
+
var _typeofExports = _typeof.exports;
|
|
271
344
|
|
|
272
345
|
regeneratorRuntime$1.exports;
|
|
273
346
|
|
|
@@ -606,10 +679,11 @@ var Snippet = function Snippet(_ref) {
|
|
|
606
679
|
var children = _ref.children,
|
|
607
680
|
_ref$dataCy = _ref.dataCy,
|
|
608
681
|
dataCy = _ref$dataCy === void 0 ? "" : _ref$dataCy;
|
|
609
|
-
return /*#__PURE__*/
|
|
682
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
610
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",
|
|
611
|
-
"data-cy": dataCy
|
|
612
|
-
|
|
684
|
+
"data-cy": dataCy,
|
|
685
|
+
children: children
|
|
686
|
+
});
|
|
613
687
|
};
|
|
614
688
|
|
|
615
689
|
var TransactionDetails = function TransactionDetails(_ref) {
|
|
@@ -630,57 +704,89 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
630
704
|
return "";
|
|
631
705
|
}
|
|
632
706
|
};
|
|
633
|
-
return /*#__PURE__*/
|
|
634
|
-
|
|
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
|
-
|
|
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.identifier"), ":", /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
715
|
+
className: "px-2 font-bold",
|
|
716
|
+
"data-cy": "delivery-identifier",
|
|
717
|
+
style: "body2",
|
|
718
|
+
children: identifier
|
|
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
|
+
});
|
|
684
790
|
};
|
|
685
791
|
|
|
686
792
|
var Details = function Details(_ref) {
|
|
@@ -717,43 +823,57 @@ var Details = function Details(_ref) {
|
|
|
717
823
|
if (neetoCist.isNotPresent(delivery)) {
|
|
718
824
|
return null;
|
|
719
825
|
}
|
|
720
|
-
return /*#__PURE__*/
|
|
826
|
+
return /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"], {
|
|
721
827
|
onClose: onClose,
|
|
722
828
|
isOpen: neetoCist.isPresent(deliveryId),
|
|
723
|
-
size: "large"
|
|
724
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
757
877
|
};
|
|
758
878
|
|
|
759
879
|
var buildColumns$1 = function buildColumns(_ref) {
|
|
@@ -764,17 +884,20 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
764
884
|
dataIndex: "identifier",
|
|
765
885
|
width: 390,
|
|
766
886
|
render: function render(_, delivery) {
|
|
767
|
-
return /*#__PURE__*/
|
|
768
|
-
className: "flex items-center gap-x-3"
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
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.identifier
|
|
896
|
+
}), delivery.redelivery && /*#__PURE__*/jsxRuntime.jsx(Tag__default["default"], {
|
|
897
|
+
style: "info",
|
|
898
|
+
children: i18next.t("neetoWebhooks.delivery.redelivery")
|
|
899
|
+
})]
|
|
900
|
+
});
|
|
778
901
|
}
|
|
779
902
|
}, {
|
|
780
903
|
title: i18next.t("neetoWebhooks.tableHeaders.createdAt"),
|
|
@@ -782,11 +905,14 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
782
905
|
dataIndex: "createdAt",
|
|
783
906
|
width: 280,
|
|
784
907
|
render: function render(createdAt) {
|
|
785
|
-
return /*#__PURE__*/
|
|
786
|
-
className: "flex items-center justify-between space-x-1"
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
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
|
+
});
|
|
790
916
|
}
|
|
791
917
|
}, {
|
|
792
918
|
title: i18next.t("neetoWebhooks.common.responseStatus"),
|
|
@@ -795,14 +921,17 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
795
921
|
render: function render(_ref2) {
|
|
796
922
|
var responseStatusCode = _ref2.responseStatusCode,
|
|
797
923
|
status = _ref2.status;
|
|
798
|
-
return /*#__PURE__*/
|
|
799
|
-
className: "flex items-center"
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
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
|
+
});
|
|
806
935
|
}
|
|
807
936
|
}, {
|
|
808
937
|
title: i18next.t("neetoWebhooks.common.event", constants.SINGULAR),
|
|
@@ -862,35 +991,38 @@ var Deliveries = function Deliveries(_ref) {
|
|
|
862
991
|
webhookId: webhookId
|
|
863
992
|
}));
|
|
864
993
|
};
|
|
865
|
-
if (isLoading) return /*#__PURE__*/
|
|
866
|
-
return /*#__PURE__*/
|
|
867
|
-
className: "w-full"
|
|
868
|
-
|
|
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
|
-
|
|
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
|
+
});
|
|
894
1026
|
};
|
|
895
1027
|
var Deliveries$1 = withReactQuery(Deliveries);
|
|
896
1028
|
|
|
@@ -976,46 +1108,8 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
|
|
|
976
1108
|
});
|
|
977
1109
|
};
|
|
978
1110
|
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
983
|
-
return typeof o;
|
|
984
|
-
} : function (o) {
|
|
985
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
986
|
-
}, _typeof(o);
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
function _toPrimitive(input, hint) {
|
|
990
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
991
|
-
var prim = input[Symbol.toPrimitive];
|
|
992
|
-
if (prim !== undefined) {
|
|
993
|
-
var res = prim.call(input, hint || "default");
|
|
994
|
-
if (_typeof(res) !== "object") return res;
|
|
995
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
996
|
-
}
|
|
997
|
-
return (hint === "string" ? String : Number)(input);
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
function _toPropertyKey(arg) {
|
|
1001
|
-
var key = _toPrimitive(arg, "string");
|
|
1002
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
function _defineProperty(obj, key, value) {
|
|
1006
|
-
key = _toPropertyKey(key);
|
|
1007
|
-
if (key in obj) {
|
|
1008
|
-
Object.defineProperty(obj, key, {
|
|
1009
|
-
value: value,
|
|
1010
|
-
enumerable: true,
|
|
1011
|
-
configurable: true,
|
|
1012
|
-
writable: true
|
|
1013
|
-
});
|
|
1014
|
-
} else {
|
|
1015
|
-
obj[key] = value;
|
|
1016
|
-
}
|
|
1017
|
-
return obj;
|
|
1018
|
-
}
|
|
1111
|
+
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
1112
|
+
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
1019
1113
|
|
|
1020
1114
|
var baseUrl = "/webhooks/events/all";
|
|
1021
1115
|
var all = function all() {
|
|
@@ -1031,9 +1125,6 @@ var useFetchEvents = function useFetchEvents() {
|
|
|
1031
1125
|
});
|
|
1032
1126
|
};
|
|
1033
1127
|
|
|
1034
|
-
var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
|
|
1035
|
-
var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
|
|
1036
|
-
|
|
1037
1128
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
1038
1129
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
1039
1130
|
// generators (like Math.random()).
|
|
@@ -1168,26 +1259,28 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
1168
1259
|
dataIndex: "endpoint",
|
|
1169
1260
|
width: 830,
|
|
1170
1261
|
render: function render(endpoint, webhook) {
|
|
1171
|
-
return /*#__PURE__*/
|
|
1172
|
-
className: "flex items-center justify-between space-x-3"
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
menuItems: getMenuItems({
|
|
1183
|
-
onEdit: function onEdit() {
|
|
1184
|
-
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"
|
|
1185
1273
|
},
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
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
|
+
});
|
|
1191
1284
|
}
|
|
1192
1285
|
}, {
|
|
1193
1286
|
title: i18next.t("neetoWebhooks.webhook.active"),
|
|
@@ -1286,134 +1379,162 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
1286
1379
|
setIsSecretInputFieldVisible(true);
|
|
1287
1380
|
}
|
|
1288
1381
|
}, [webhook]);
|
|
1289
|
-
return /*#__PURE__*/
|
|
1382
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"], {
|
|
1290
1383
|
isOpen: isOpen,
|
|
1291
1384
|
onClose: onClose,
|
|
1292
|
-
initialFocusRef: endpointRef
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
href: WEBHOOK_HELP_URL
|
|
1303
|
-
},
|
|
1304
|
-
title: t("neetoWebhooks.webhook.title")
|
|
1305
|
-
})), /*#__PURE__*/React__default["default"].createElement(formik.Form, {
|
|
1306
|
-
formikProps: {
|
|
1307
|
-
enableReinitialize: true,
|
|
1308
|
-
validationSchema: getValidationSchema(webhooks),
|
|
1309
|
-
initialValues: initialValues,
|
|
1310
|
-
onSubmit: function onSubmit(values) {
|
|
1311
|
-
return handleSubmit(getValidationSchema().cast(values));
|
|
1312
|
-
}
|
|
1313
|
-
}
|
|
1314
|
-
}, function (_ref2) {
|
|
1315
|
-
var setFieldValue = _ref2.setFieldValue;
|
|
1316
|
-
return isLoading ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1317
|
-
className: "flex items-center justify-center"
|
|
1318
|
-
}, /*#__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", {
|
|
1319
|
-
className: "w-full space-y-4"
|
|
1320
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Textarea, {
|
|
1321
|
-
required: true,
|
|
1322
|
-
"data-cy": "endpoint-input-field",
|
|
1323
|
-
label: t("neetoWebhooks.webhook.endpoint"),
|
|
1324
|
-
name: "endpoint",
|
|
1325
|
-
placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
|
|
1326
|
-
ref: endpointRef,
|
|
1327
|
-
rows: 1
|
|
1328
|
-
}), !isLoading && /*#__PURE__*/React__default["default"].createElement(formik.Select, {
|
|
1329
|
-
isMulti: true,
|
|
1330
|
-
required: true,
|
|
1331
|
-
getOptionLabel: ramda.prop("label"),
|
|
1332
|
-
getOptionValue: ramda.prop("identifier"),
|
|
1333
|
-
label: t("neetoWebhooks.common.event", constants.PLURAL),
|
|
1334
|
-
name: "events",
|
|
1335
|
-
options: events,
|
|
1336
|
-
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
1337
|
-
}), isSecretInputFieldVisible && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1338
|
-
className: "flex items-center justify-between space-x-3"
|
|
1339
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Input, {
|
|
1340
|
-
"data-cy": "secret-key-input-field",
|
|
1341
|
-
name: "secret",
|
|
1342
|
-
label: /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1343
|
-
className: "flex items-center gap-x-2"
|
|
1344
|
-
}, 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"),
|
|
1345
1395
|
helpLinkProps: {
|
|
1346
|
-
href:
|
|
1396
|
+
href: WEBHOOK_HELP_URL
|
|
1347
1397
|
},
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
label: t("neetoWebhooks.buttons.regenerate"),
|
|
1358
|
-
"data-cy": "regenerate-secret",
|
|
1359
|
-
onClick: function onClick() {
|
|
1360
|
-
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));
|
|
1361
1407
|
}
|
|
1362
|
-
},
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
}
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
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
|
+
});
|
|
1384
1492
|
}
|
|
1385
|
-
})
|
|
1386
|
-
})
|
|
1493
|
+
})]
|
|
1494
|
+
});
|
|
1387
1495
|
};
|
|
1388
1496
|
|
|
1389
|
-
var Header = function
|
|
1390
|
-
var
|
|
1497
|
+
var Header = reactUtils.withT(function (_ref) {
|
|
1498
|
+
var t = _ref.t,
|
|
1499
|
+
breadcrumbs = _ref.breadcrumbs,
|
|
1500
|
+
title = _ref.title,
|
|
1391
1501
|
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen;
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
}
|
|
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
|
+
});
|
|
1530
|
+
});
|
|
1411
1531
|
var Header$1 = /*#__PURE__*/React__default["default"].memo(Header);
|
|
1412
1532
|
|
|
1413
1533
|
var Webhooks = function Webhooks(_ref) {
|
|
1414
1534
|
var deliveriesPath = _ref.deliveriesPath,
|
|
1415
1535
|
entityType = _ref.entityType,
|
|
1416
1536
|
breadcrumbs = _ref.breadcrumbs,
|
|
1537
|
+
title = _ref.title,
|
|
1417
1538
|
entityId = _ref.entityId,
|
|
1418
1539
|
onCreate = _ref.onCreate,
|
|
1419
1540
|
onDelete = _ref.onDelete;
|
|
@@ -1473,61 +1594,76 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1473
1594
|
setIsDeleteAlertOpen(true);
|
|
1474
1595
|
}, []);
|
|
1475
1596
|
if (isLoading) {
|
|
1476
|
-
return /*#__PURE__*/
|
|
1597
|
+
return /*#__PURE__*/jsxRuntime.jsx(PageLoader__default["default"], {});
|
|
1477
1598
|
}
|
|
1478
|
-
return /*#__PURE__*/
|
|
1479
|
-
className: "w-full"
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
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
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
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
|
+
});
|
|
1664
|
+
}
|
|
1665
|
+
})]
|
|
1666
|
+
});
|
|
1531
1667
|
};
|
|
1532
1668
|
var Webhooks$1 = withReactQuery(Webhooks);
|
|
1533
1669
|
|
|
@@ -1536,6 +1672,7 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1536
1672
|
entityId = _ref.entityId,
|
|
1537
1673
|
_ref$breadcrumbs = _ref.breadcrumbs,
|
|
1538
1674
|
breadcrumbs = _ref$breadcrumbs === void 0 ? [] : _ref$breadcrumbs,
|
|
1675
|
+
title = _ref.title,
|
|
1539
1676
|
onCreate = _ref.onCreate,
|
|
1540
1677
|
onDelete = _ref.onDelete;
|
|
1541
1678
|
var _useRouteMatch = reactRouterDom.useRouteMatch(),
|
|
@@ -1543,37 +1680,40 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1543
1680
|
webhooksUrl = _useRouteMatch.url;
|
|
1544
1681
|
var deliveriesPath = getDeliveriesPath(webhooksUrl);
|
|
1545
1682
|
var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
|
|
1546
|
-
return /*#__PURE__*/
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
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
|
+
});
|
|
1577
1717
|
};
|
|
1578
1718
|
|
|
1579
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}}
|