@bigbinary/neeto-webhooks-frontend 3.0.12 → 3.0.14
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/README.md +12 -2
- package/dist/.ready +1 -1
- package/dist/NeetoWebhooks.js +8 -2
- package/dist/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/NeetoWebhooks.js +8 -2
- package/dist/cjs/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/v2/NeetoWebhooks.js +149 -141
- package/dist/cjs/v2/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/v2/index.js +4 -4
- package/dist/index.js +2 -2
- package/dist/{main-CfvmjDDj.js → main-CcNqvzWi.js} +38 -2
- package/dist/main-CcNqvzWi.js.map +1 -0
- package/dist/{main-B8V9tERH.js → main-CuEMguMt.js} +38 -1
- package/dist/main-CuEMguMt.js.map +1 -0
- package/dist/v2/NeetoWebhooks.js +149 -141
- package/dist/v2/NeetoWebhooks.js.map +1 -1
- package/dist/v2/index.js +4 -4
- package/package.json +17 -17
- package/types.d.ts +2 -1
- package/dist/main-B8V9tERH.js.map +0 -1
- package/dist/main-CfvmjDDj.js.map +0 -1
package/dist/v2/NeetoWebhooks.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
import { useState, useRef, useMemo, useEffect, memo, useCallback } from 'react';
|
|
1
2
|
import { pluck, assoc, mergeRight } from 'ramda';
|
|
2
3
|
import { useRouteMatch, useHistory, useParams, Switch as Switch$1, Route } from 'react-router-dom';
|
|
3
|
-
import { q as queryClient, u as useRedeliverWebhook, a as useShowDelivery, b as useFetchDeliveries, g as getDeliveriesPath, c as getDeliveryDetailsPath, d as useUpdateWebhook, v as v4, e as useCreateWebhook, f as useShowWebhook, h as useFetchEvents, i as useFetchWebhooks, j as useDestroyWebhook, H as HELP_LINK_URLS } from '../main-
|
|
4
|
+
import { q as queryClient, u as useRedeliverWebhook, a as useShowDelivery, b as useFetchDeliveries, g as getDeliveriesPath, c as getDeliveryDetailsPath, d as useUpdateWebhook, v as v4, e as useCreateWebhook, f as useShowWebhook, h as useFetchEvents, i as useFetchWebhooks, j as useDestroyWebhook, k as validateEntityProps, H as HELP_LINK_URLS } from '../main-CcNqvzWi.js';
|
|
4
5
|
import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
6
|
+
import { Typography, Badge, Tabs, Sheet, Spinner, Button, DataTable, Empty, Checkbox, Switch, Label, Alert } from '@bigbinary/neeto-atoms';
|
|
7
|
+
import { Send, Plus, Webhook } from 'lucide-react';
|
|
5
8
|
import { isPresent, removeBy, isNotEmpty, findIndexBy, removeById, findBy } from '@bigbinary/neeto-cist';
|
|
6
9
|
import { SINGULAR, DEFAULT_PAGE_SIZE, DEFAULT_PAGE_INDEX, PLURAL } from '@bigbinary/neeto-commons-frontend/v2/constants';
|
|
7
10
|
import { useQueryParams, withT } from '@bigbinary/neeto-commons-frontend/v2/react-utils';
|
|
8
11
|
import { buildUrl } from '@bigbinary/neeto-commons-frontend/v2/utils';
|
|
9
|
-
import { Typography, Badge, Tabs, Sheet, Spinner, Button, DataTable, Empty, Checkbox, Switch, Label, Alert } from '@bigbinary/neeto-atoms';
|
|
10
12
|
import Container from '@bigbinary/neeto-molecules/v2/Container';
|
|
11
13
|
import Header$2 from '@bigbinary/neeto-molecules/v2/Header';
|
|
12
14
|
import TableWrapper from '@bigbinary/neeto-molecules/v2/TableWrapper';
|
|
@@ -19,11 +21,9 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
19
21
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
20
22
|
import DateFormat from '@bigbinary/neeto-molecules/v2/DateFormat';
|
|
21
23
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
22
|
-
import { useState, useRef, useMemo, useEffect, memo, useCallback } from 'react';
|
|
23
24
|
import { t } from 'i18next';
|
|
24
25
|
import { Form, Textarea, Input, ActionBlock } from '@bigbinary/neeto-atoms/formik';
|
|
25
26
|
import { FieldArray, ErrorMessage } from 'formik';
|
|
26
|
-
import { Plus } from 'lucide-react';
|
|
27
27
|
import HelpPopover from '@bigbinary/neeto-molecules/v2/HelpPopover';
|
|
28
28
|
import MoreDropdown from '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
29
29
|
import * as yup from 'yup';
|
|
@@ -58,7 +58,7 @@ var Snippet = function Snippet(_ref) {
|
|
|
58
58
|
_ref$dataTestid = _ref.dataTestid,
|
|
59
59
|
dataTestid = _ref$dataTestid === void 0 ? "" : _ref$dataTestid;
|
|
60
60
|
return /*#__PURE__*/jsx("div", {
|
|
61
|
-
className: "
|
|
61
|
+
className: "my-2 whitespace-pre-wrap break-all rounded-lg border border-border bg-muted p-4",
|
|
62
62
|
"data-testid": dataTestid,
|
|
63
63
|
children: children
|
|
64
64
|
});
|
|
@@ -83,97 +83,98 @@ var TransactionDetails = function TransactionDetails(_ref) {
|
|
|
83
83
|
return "";
|
|
84
84
|
}
|
|
85
85
|
};
|
|
86
|
-
return /*#__PURE__*/
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
})]
|
|
99
|
-
}), /*#__PURE__*/jsxs("span", {
|
|
100
|
-
className: "flex items-center space-x-1",
|
|
101
|
-
children: [t("neetoWebhooks.delivery.deliveryId"), ":", /*#__PURE__*/jsx(Typography, {
|
|
102
|
-
className: "px-2 font-bold",
|
|
103
|
-
"data-testid": "delivery-identifier",
|
|
104
|
-
variant: "body2",
|
|
105
|
-
children: identifier
|
|
106
|
-
})]
|
|
107
|
-
}), /*#__PURE__*/jsxs("span", {
|
|
108
|
-
className: "flex items-center",
|
|
109
|
-
children: [t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/jsx(Typography, {
|
|
110
|
-
className: "px-2 font-bold",
|
|
111
|
-
"data-testid": "delivery-response-code",
|
|
112
|
-
variant: "body2",
|
|
113
|
-
children: responseStatusCode
|
|
114
|
-
}), /*#__PURE__*/jsx(Badge, {
|
|
115
|
-
variant: status === "success" ? "green-subtle" : "amber-subtle",
|
|
116
|
-
children: status
|
|
117
|
-
})]
|
|
86
|
+
return /*#__PURE__*/jsxs("div", {
|
|
87
|
+
className: "sticky top-0 mb-2 flex w-full flex-col bg-background",
|
|
88
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
89
|
+
className: "flex w-full flex-col space-y-2 pb-4",
|
|
90
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
91
|
+
className: "flex items-center space-x-1",
|
|
92
|
+
children: [t("neetoWebhooks.delivery.sid"), ":", /*#__PURE__*/jsx(Typography, {
|
|
93
|
+
className: "px-2",
|
|
94
|
+
"data-testid": "delivery-sid",
|
|
95
|
+
variant: "body2",
|
|
96
|
+
weight: "bold",
|
|
97
|
+
children: sid
|
|
118
98
|
})]
|
|
119
|
-
}), /*#__PURE__*/jsxs(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
99
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
100
|
+
className: "flex items-center space-x-1",
|
|
101
|
+
children: [t("neetoWebhooks.delivery.deliveryId"), ":", /*#__PURE__*/jsx(Typography, {
|
|
102
|
+
className: "px-2",
|
|
103
|
+
"data-testid": "delivery-identifier",
|
|
104
|
+
variant: "body2",
|
|
105
|
+
weight: "bold",
|
|
106
|
+
children: identifier
|
|
107
|
+
})]
|
|
108
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
109
|
+
className: "flex items-center",
|
|
110
|
+
children: [t("neetoWebhooks.common.responseStatus"), ":", /*#__PURE__*/jsx(Typography, {
|
|
111
|
+
className: "px-2",
|
|
112
|
+
"data-testid": "delivery-response-code",
|
|
113
|
+
variant: "body2",
|
|
114
|
+
weight: "bold",
|
|
115
|
+
children: responseStatusCode
|
|
116
|
+
}), /*#__PURE__*/jsx(Badge, {
|
|
117
|
+
variant: status === "success" ? "green" : "amber",
|
|
118
|
+
children: status
|
|
119
|
+
})]
|
|
120
|
+
})]
|
|
121
|
+
}), /*#__PURE__*/jsxs(Tabs, {
|
|
122
|
+
value: activeHeader,
|
|
123
|
+
onValueChange: setActiveHeader,
|
|
124
|
+
children: [/*#__PURE__*/jsxs(Tabs.List, {
|
|
125
|
+
children: [/*#__PURE__*/jsx(Tabs.Item, {
|
|
131
126
|
value: DELIVERY_TAB.request,
|
|
132
|
-
children:
|
|
133
|
-
|
|
134
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
135
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
136
|
-
variant: "h5",
|
|
137
|
-
children: t("neetoWebhooks.delivery.header")
|
|
138
|
-
}), /*#__PURE__*/jsx(Snippet, {
|
|
139
|
-
dataTestid: "delivery-request-header",
|
|
140
|
-
children: delivery.requestHeader
|
|
141
|
-
})]
|
|
142
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
143
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
144
|
-
variant: "h5",
|
|
145
|
-
children: t("neetoWebhooks.delivery.payload")
|
|
146
|
-
}), /*#__PURE__*/jsx(Snippet, {
|
|
147
|
-
dataTestid: "delivery-request-payload",
|
|
148
|
-
children: renderPayload()
|
|
149
|
-
})]
|
|
150
|
-
})]
|
|
151
|
-
})
|
|
152
|
-
}), /*#__PURE__*/jsx(Tabs.Content, {
|
|
127
|
+
children: t("neetoWebhooks.delivery.request")
|
|
128
|
+
}), /*#__PURE__*/jsx(Tabs.Item, {
|
|
153
129
|
value: DELIVERY_TAB.response,
|
|
154
|
-
children:
|
|
155
|
-
className: "mt-2 w-full space-y-4",
|
|
156
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
157
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
158
|
-
variant: "h5",
|
|
159
|
-
children: t("neetoWebhooks.delivery.header")
|
|
160
|
-
}), /*#__PURE__*/jsx(Snippet, {
|
|
161
|
-
dataTestid: "delivery-response-header",
|
|
162
|
-
children: delivery.responseHeader
|
|
163
|
-
})]
|
|
164
|
-
}), /*#__PURE__*/jsxs("div", {
|
|
165
|
-
children: [/*#__PURE__*/jsx(Typography, {
|
|
166
|
-
variant: "h5",
|
|
167
|
-
children: t("neetoWebhooks.delivery.body")
|
|
168
|
-
}), /*#__PURE__*/jsx(Snippet, {
|
|
169
|
-
dataTestid: "delivery-response-body",
|
|
170
|
-
children: delivery.responseBody
|
|
171
|
-
})]
|
|
172
|
-
})]
|
|
173
|
-
})
|
|
130
|
+
children: t("neetoWebhooks.delivery.response")
|
|
174
131
|
})]
|
|
132
|
+
}), /*#__PURE__*/jsx(Tabs.Content, {
|
|
133
|
+
value: DELIVERY_TAB.request,
|
|
134
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
135
|
+
className: "mt-2 w-full space-y-4",
|
|
136
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
137
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
138
|
+
variant: "h5",
|
|
139
|
+
children: t("neetoWebhooks.delivery.header")
|
|
140
|
+
}), /*#__PURE__*/jsx(Snippet, {
|
|
141
|
+
dataTestid: "delivery-request-header",
|
|
142
|
+
children: delivery.requestHeader
|
|
143
|
+
})]
|
|
144
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
145
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
146
|
+
variant: "h5",
|
|
147
|
+
children: t("neetoWebhooks.delivery.payload")
|
|
148
|
+
}), /*#__PURE__*/jsx(Snippet, {
|
|
149
|
+
dataTestid: "delivery-request-payload",
|
|
150
|
+
children: renderPayload()
|
|
151
|
+
})]
|
|
152
|
+
})]
|
|
153
|
+
})
|
|
154
|
+
}), /*#__PURE__*/jsx(Tabs.Content, {
|
|
155
|
+
value: DELIVERY_TAB.response,
|
|
156
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
157
|
+
className: "mt-2 w-full space-y-4",
|
|
158
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
159
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
160
|
+
variant: "h5",
|
|
161
|
+
children: t("neetoWebhooks.delivery.header")
|
|
162
|
+
}), /*#__PURE__*/jsx(Snippet, {
|
|
163
|
+
dataTestid: "delivery-response-header",
|
|
164
|
+
children: delivery.responseHeader
|
|
165
|
+
})]
|
|
166
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
167
|
+
children: [/*#__PURE__*/jsx(Typography, {
|
|
168
|
+
variant: "h5",
|
|
169
|
+
children: t("neetoWebhooks.delivery.body")
|
|
170
|
+
}), /*#__PURE__*/jsx(Snippet, {
|
|
171
|
+
dataTestid: "delivery-response-body",
|
|
172
|
+
children: delivery.responseBody
|
|
173
|
+
})]
|
|
174
|
+
})]
|
|
175
|
+
})
|
|
175
176
|
})]
|
|
176
|
-
})
|
|
177
|
+
})]
|
|
177
178
|
});
|
|
178
179
|
};
|
|
179
180
|
|
|
@@ -219,15 +220,14 @@ var Details = function Details(_ref) {
|
|
|
219
220
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
220
221
|
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
221
222
|
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
222
|
-
children: /*#__PURE__*/jsxs(
|
|
223
|
+
children: /*#__PURE__*/jsxs(Sheet.Title, {
|
|
223
224
|
children: [/*#__PURE__*/jsx(DateFormat.Date, {
|
|
224
225
|
date: delivery.createdAt,
|
|
225
226
|
tooltipProps: {
|
|
226
227
|
disabled: true
|
|
227
228
|
},
|
|
228
229
|
typographyProps: {
|
|
229
|
-
variant:
|
|
230
|
-
weight: "semibold"
|
|
230
|
+
variant: null
|
|
231
231
|
}
|
|
232
232
|
}), /*#__PURE__*/jsx("span", {
|
|
233
233
|
children: " \u2022 "
|
|
@@ -237,7 +237,7 @@ var Details = function Details(_ref) {
|
|
|
237
237
|
disabled: true
|
|
238
238
|
},
|
|
239
239
|
typographyProps: {
|
|
240
|
-
variant:
|
|
240
|
+
variant: null,
|
|
241
241
|
weight: "normal"
|
|
242
242
|
}
|
|
243
243
|
})]
|
|
@@ -278,14 +278,16 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
278
278
|
return /*#__PURE__*/jsxs("div", {
|
|
279
279
|
className: "flex items-center gap-x-3",
|
|
280
280
|
children: [/*#__PURE__*/jsx(Button, {
|
|
281
|
+
className: "min-w-0 shrink justify-start text-left [&>span]:min-w-0 [&>span>span]:truncate",
|
|
282
|
+
title: delivery.identifier,
|
|
281
283
|
variant: "link",
|
|
282
284
|
to: buildUrl(deliveryDetailsPath, {
|
|
283
285
|
deliveryId: delivery.sid,
|
|
284
286
|
page: page
|
|
285
287
|
}),
|
|
286
|
-
weight: "semibold",
|
|
287
288
|
children: delivery.identifier
|
|
288
289
|
}), delivery.redelivery && /*#__PURE__*/jsx(Badge, {
|
|
290
|
+
className: "shrink-0",
|
|
289
291
|
variant: "blue",
|
|
290
292
|
children: t("neetoWebhooks.delivery.redelivery")
|
|
291
293
|
})]
|
|
@@ -298,13 +300,8 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
298
300
|
size: 280,
|
|
299
301
|
cell: function cell(_ref3) {
|
|
300
302
|
var getValue = _ref3.getValue;
|
|
301
|
-
return /*#__PURE__*/jsx(
|
|
302
|
-
|
|
303
|
-
children: /*#__PURE__*/jsx(Typography, {
|
|
304
|
-
children: /*#__PURE__*/jsx(DateFormat.DateTime, {
|
|
305
|
-
date: getValue()
|
|
306
|
-
})
|
|
307
|
-
})
|
|
303
|
+
return /*#__PURE__*/jsx(DateFormat.DateTime, {
|
|
304
|
+
date: getValue()
|
|
308
305
|
});
|
|
309
306
|
}
|
|
310
307
|
}, {
|
|
@@ -317,14 +314,13 @@ var buildColumns$1 = function buildColumns(_ref) {
|
|
|
317
314
|
responseStatusCode = _row$original.responseStatusCode,
|
|
318
315
|
status = _row$original.status;
|
|
319
316
|
return /*#__PURE__*/jsxs("span", {
|
|
320
|
-
className: "flex items-center",
|
|
321
|
-
children: [/*#__PURE__*/jsx(
|
|
322
|
-
className: "px-2",
|
|
323
|
-
variant: "body2",
|
|
324
|
-
children: responseStatusCode
|
|
325
|
-
}), /*#__PURE__*/jsx(Badge, {
|
|
317
|
+
className: "flex items-center gap-x-2",
|
|
318
|
+
children: [/*#__PURE__*/jsx(Badge, {
|
|
326
319
|
variant: status === "success" ? "green" : "amber",
|
|
327
320
|
children: status
|
|
321
|
+
}), /*#__PURE__*/jsx(Typography, {
|
|
322
|
+
variant: "body2",
|
|
323
|
+
children: responseStatusCode
|
|
328
324
|
})]
|
|
329
325
|
});
|
|
330
326
|
}
|
|
@@ -414,6 +410,7 @@ var Deliveries$1 = function Deliveries(_ref) {
|
|
|
414
410
|
className: "flex justify-center items-center w-full h-full",
|
|
415
411
|
children: /*#__PURE__*/jsx(Empty, {
|
|
416
412
|
description: t("neetoWebhooks.delivery.empty.description"),
|
|
413
|
+
icon: Send,
|
|
417
414
|
title: t("neetoWebhooks.delivery.empty.title")
|
|
418
415
|
})
|
|
419
416
|
}), /*#__PURE__*/jsx(Details, {
|
|
@@ -606,17 +603,16 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
606
603
|
getValue = _ref7.getValue;
|
|
607
604
|
var webhook = row.original;
|
|
608
605
|
return /*#__PURE__*/jsxs("div", {
|
|
609
|
-
className: "flex items-center justify-between
|
|
606
|
+
className: "flex items-center justify-between gap-3 w-full",
|
|
610
607
|
children: [/*#__PURE__*/jsx(Button, {
|
|
611
|
-
|
|
608
|
+
className: "min-w-0 justify-start text-left [&>span]:min-w-0 [&>span>span]:truncate shrink",
|
|
609
|
+
title: getValue(),
|
|
612
610
|
to: buildUrl(deliveriesPath, {
|
|
613
611
|
webhookId: webhook.sid
|
|
614
612
|
}),
|
|
613
|
+
variant: "link",
|
|
615
614
|
children: getValue()
|
|
616
615
|
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
617
|
-
dropdownButtonProps: {
|
|
618
|
-
className: "me-1 my-1"
|
|
619
|
-
},
|
|
620
616
|
menuItems: getMenuItems({
|
|
621
617
|
onEdit: function onEdit() {
|
|
622
618
|
return handleEdit(webhook.id);
|
|
@@ -664,10 +660,11 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
664
660
|
variant: "amber",
|
|
665
661
|
children: "deprecated"
|
|
666
662
|
})]
|
|
667
|
-
}), timeMessage && /*#__PURE__*/jsxs(
|
|
668
|
-
|
|
663
|
+
}), timeMessage && /*#__PURE__*/jsxs(Typography, {
|
|
664
|
+
color: "muted",
|
|
665
|
+
variant: "caption",
|
|
669
666
|
children: [timeMessage, ".", " ", /*#__PURE__*/jsx("a", {
|
|
670
|
-
className: "text-
|
|
667
|
+
className: "text-primary underline decoration-primary/40 underline-offset-4 hover:decoration-primary",
|
|
671
668
|
href: webhook.defaultVersionPayloadDocUrl,
|
|
672
669
|
rel: "noopener noreferrer",
|
|
673
670
|
target: "_blank",
|
|
@@ -681,8 +678,8 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
681
678
|
accessorKey: "events",
|
|
682
679
|
header: t("neetoWebhooks.common.event", PLURAL),
|
|
683
680
|
size: 300,
|
|
684
|
-
cell: function cell(
|
|
685
|
-
var getValue =
|
|
681
|
+
cell: function cell(_ref0) {
|
|
682
|
+
var getValue = _ref0.getValue;
|
|
686
683
|
return /*#__PURE__*/jsx("span", {
|
|
687
684
|
className: "whitespace-normal",
|
|
688
685
|
children: pluck("label", getValue()).sort().join(", ")
|
|
@@ -797,21 +794,19 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
797
794
|
isOpen: isOpen,
|
|
798
795
|
onClose: onClose,
|
|
799
796
|
initialFocusRef: endpointRef,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
children:
|
|
803
|
-
|
|
797
|
+
size: "large",
|
|
798
|
+
children: [/*#__PURE__*/jsx(Sheet.Header, {
|
|
799
|
+
children: /*#__PURE__*/jsxs(Sheet.Title, {
|
|
800
|
+
className: "flex items-center gap-2",
|
|
804
801
|
"data-testid": "add-new-webhook-pane-header",
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
title: t("neetoWebhooks.webhook.title")
|
|
814
|
-
})]
|
|
802
|
+
children: [editingWebhookId ? t("neetoWebhooks.webhook.edit") : t("neetoWebhooks.webhook.add"), /*#__PURE__*/jsx(HelpPopover, {
|
|
803
|
+
description: t("neetoWebhooks.webhook.helpDescription"),
|
|
804
|
+
helpLinkProps: {
|
|
805
|
+
href: webhooksHelpLink
|
|
806
|
+
},
|
|
807
|
+
title: t("neetoWebhooks.webhook.title")
|
|
808
|
+
})]
|
|
809
|
+
})
|
|
815
810
|
}), isLoading ? /*#__PURE__*/jsx(Sheet.Body, {
|
|
816
811
|
children: /*#__PURE__*/jsx("div", {
|
|
817
812
|
className: "flex items-center justify-center",
|
|
@@ -823,22 +818,26 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
823
818
|
children: /*#__PURE__*/jsxs("div", {
|
|
824
819
|
className: "w-full space-y-4 md:space-y-6",
|
|
825
820
|
children: [/*#__PURE__*/jsx(Typography, {
|
|
826
|
-
className: "mb-
|
|
821
|
+
className: "mb-4",
|
|
827
822
|
variant: "body2",
|
|
828
823
|
children: t("neetoWebhooks.webhook.postRequestIsSentToEndpointURL")
|
|
829
824
|
}), /*#__PURE__*/jsx(Textarea, {
|
|
830
825
|
required: true,
|
|
826
|
+
className: "[&_textarea]:[field-sizing:content]!",
|
|
831
827
|
"data-testid": "endpoint-input-field",
|
|
832
828
|
label: t("neetoWebhooks.webhook.endpoint"),
|
|
833
829
|
name: "endpoint",
|
|
834
830
|
placeholder: t("neetoWebhooks.webhook.endpointPlaceholder"),
|
|
835
831
|
ref: endpointRef,
|
|
836
|
-
|
|
832
|
+
resize: "none",
|
|
833
|
+
size: "small"
|
|
837
834
|
}), /*#__PURE__*/jsxs("div", {
|
|
838
835
|
className: "space-y-2",
|
|
839
|
-
children: [/*#__PURE__*/jsxs(
|
|
836
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
840
837
|
className: "flex items-center gap-x-2",
|
|
841
|
-
children: [
|
|
838
|
+
children: [/*#__PURE__*/jsx(Label, {
|
|
839
|
+
children: t("neetoWebhooks.webhook.secret")
|
|
840
|
+
}), /*#__PURE__*/jsx(HelpPopover, {
|
|
842
841
|
helpLinkProps: {
|
|
843
842
|
href: secretsHelpLink
|
|
844
843
|
},
|
|
@@ -901,9 +900,11 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
901
900
|
}), /*#__PURE__*/jsx(ErrorMessage, {
|
|
902
901
|
name: "events",
|
|
903
902
|
render: function render(msg) {
|
|
904
|
-
return /*#__PURE__*/jsx(
|
|
905
|
-
className: "
|
|
903
|
+
return /*#__PURE__*/jsx(Typography, {
|
|
904
|
+
className: "mt-1",
|
|
905
|
+
color: "destructive",
|
|
906
906
|
"data-testid": "event-error-text",
|
|
907
|
+
variant: "caption",
|
|
907
908
|
children: msg
|
|
908
909
|
});
|
|
909
910
|
}
|
|
@@ -958,8 +959,8 @@ var Header$1 = withT(function (_ref) {
|
|
|
958
959
|
}, titleHelpPopoverProps)
|
|
959
960
|
}), isNotEmpty(webhooks) && /*#__PURE__*/jsx(SubHeader, {
|
|
960
961
|
leftActionBlock: /*#__PURE__*/jsx(Typography, {
|
|
961
|
-
as: "
|
|
962
|
-
variant: "
|
|
962
|
+
as: "h6",
|
|
963
|
+
variant: "h6",
|
|
963
964
|
children: t("neetoWebhooks.common.webhookWithCount", {
|
|
964
965
|
count: webhooks.length
|
|
965
966
|
})
|
|
@@ -1070,6 +1071,7 @@ var Webhooks$1 = function Webhooks(_ref) {
|
|
|
1070
1071
|
}) : /*#__PURE__*/jsx("div", {
|
|
1071
1072
|
className: "flex justify-center items-center w-full h-full",
|
|
1072
1073
|
children: /*#__PURE__*/jsx(Empty, {
|
|
1074
|
+
icon: Webhook,
|
|
1073
1075
|
title: t("neetoWebhooks.webhook.empty"),
|
|
1074
1076
|
description: /*#__PURE__*/jsx(Button, {
|
|
1075
1077
|
href: webhooksHelpLink,
|
|
@@ -1134,6 +1136,12 @@ var NeetoWebhooks = function NeetoWebhooks(_ref) {
|
|
|
1134
1136
|
var _useRouteMatch = useRouteMatch(),
|
|
1135
1137
|
webhooksPath = _useRouteMatch.path,
|
|
1136
1138
|
webhooksUrl = _useRouteMatch.url;
|
|
1139
|
+
useEffect(function () {
|
|
1140
|
+
return validateEntityProps({
|
|
1141
|
+
entityId: entityId,
|
|
1142
|
+
entityType: entityType
|
|
1143
|
+
});
|
|
1144
|
+
}, [entityId, entityType]);
|
|
1137
1145
|
var deliveriesPath = getDeliveriesPath(webhooksUrl);
|
|
1138
1146
|
var deliveryDetailsPath = getDeliveryDetailsPath(deliveriesPath);
|
|
1139
1147
|
var helpLinks = mergeRight(HELP_LINK_URLS, helpLinkUrls);
|