@bigbinary/neeto-webhooks-frontend 2.2.2 → 2.2.4
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 +9 -6
- package/dist/NeetoWebhooks.js +69 -45
- package/dist/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/NeetoWebhooks.js +69 -45
- package/dist/cjs/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +16 -15
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
"event_one": "Event",
|
|
5
5
|
"event_other": "Events",
|
|
6
6
|
"endpoint": "Endpoint",
|
|
7
|
-
"responseStatus": "Response status"
|
|
7
|
+
"responseStatus": "Response status",
|
|
8
|
+
"webhookWithCount": "{{count}} Webhook",
|
|
9
|
+
"webhookWithCount_other": "{{count}} Webhooks"
|
|
8
10
|
},
|
|
9
11
|
"entity": {
|
|
10
12
|
"webhook": "webhook",
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
"edit": "Edit",
|
|
18
20
|
"viewDetails": "View details",
|
|
19
21
|
"regenerate": "Regenerate",
|
|
20
|
-
"
|
|
22
|
+
"generateSecretKey": "Generate secret key"
|
|
21
23
|
},
|
|
22
24
|
"errors": {
|
|
23
25
|
"webhook": {
|
|
@@ -62,14 +64,15 @@
|
|
|
62
64
|
"secret": "Secret key (optional)",
|
|
63
65
|
"secretkeyHelpTitle": "Securing webhook requests",
|
|
64
66
|
"secretkeyHelpDescription": "Adding a secret key will help you to verify that the webhook request was actually sent from neeto.",
|
|
65
|
-
|
|
66
67
|
"secretPlaceholder": "Enter secret key",
|
|
67
68
|
"edit": "Edit Webhook",
|
|
68
69
|
"active": "Active",
|
|
69
70
|
"activeStatuses": {
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
}
|
|
71
|
+
"active": "Active",
|
|
72
|
+
"inactive": "Inactive"
|
|
73
|
+
},
|
|
74
|
+
"statusActiveHelpDescription": "The webhook is currently active. Toggle to make it inactive.",
|
|
75
|
+
"statusInactiveHelpDescription": "The webhook is currently inactive. Toggle to make it active."
|
|
73
76
|
},
|
|
74
77
|
"operation": {
|
|
75
78
|
"edit": "Edit",
|
package/dist/NeetoWebhooks.js
CHANGED
|
@@ -40,6 +40,7 @@ import Select from '@bigbinary/neetoui/formik/Select';
|
|
|
40
40
|
import Switch from '@bigbinary/neetoui/formik/Switch';
|
|
41
41
|
import Textarea from '@bigbinary/neetoui/formik/Textarea';
|
|
42
42
|
import * as yup from 'yup';
|
|
43
|
+
import SubHeader from '@bigbinary/neeto-molecules/SubHeader';
|
|
43
44
|
|
|
44
45
|
var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
|
|
45
46
|
return "".concat(webhooksPath, "/:webhookId/deliveries");
|
|
@@ -738,7 +739,7 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
738
739
|
title: t$1("neetoWebhooks.common.endpoint"),
|
|
739
740
|
key: "endpoint",
|
|
740
741
|
dataIndex: "endpoint",
|
|
741
|
-
width:
|
|
742
|
+
width: 700,
|
|
742
743
|
render: function render(endpoint, webhook) {
|
|
743
744
|
return /*#__PURE__*/jsxs("div", {
|
|
744
745
|
className: "flex items-center justify-between space-x-3",
|
|
@@ -768,9 +769,15 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
768
769
|
key: "isActive",
|
|
769
770
|
dataIndex: "isActive",
|
|
770
771
|
render: function render(isActive) {
|
|
771
|
-
return isActive ?
|
|
772
|
+
return isActive ? /*#__PURE__*/jsx(Tag, {
|
|
773
|
+
label: t$1("neetoWebhooks.webhook.activeStatuses.active"),
|
|
774
|
+
style: "primary"
|
|
775
|
+
}) : /*#__PURE__*/jsx(Tag, {
|
|
776
|
+
label: t$1("neetoWebhooks.webhook.activeStatuses.inactive"),
|
|
777
|
+
style: "danger"
|
|
778
|
+
});
|
|
772
779
|
},
|
|
773
|
-
width:
|
|
780
|
+
width: 150
|
|
774
781
|
}, {
|
|
775
782
|
title: t$1("neetoWebhooks.common.event", PLURAL),
|
|
776
783
|
dataIndex: "events",
|
|
@@ -778,7 +785,7 @@ var buildColumns = function buildColumns(_ref6) {
|
|
|
778
785
|
render: function render(events) {
|
|
779
786
|
return pluck("label", events).sort().join(", ");
|
|
780
787
|
},
|
|
781
|
-
width:
|
|
788
|
+
width: 300
|
|
782
789
|
}];
|
|
783
790
|
};
|
|
784
791
|
var generateRandomSecret = function generateRandomSecret() {
|
|
@@ -888,14 +895,16 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
888
895
|
}
|
|
889
896
|
},
|
|
890
897
|
children: function children(_ref2) {
|
|
891
|
-
var setFieldValue = _ref2.setFieldValue
|
|
898
|
+
var setFieldValue = _ref2.setFieldValue,
|
|
899
|
+
values = _ref2.values;
|
|
892
900
|
return isLoading ? /*#__PURE__*/jsx("div", {
|
|
893
901
|
className: "flex items-center justify-center",
|
|
894
902
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
895
903
|
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
896
904
|
children: [/*#__PURE__*/jsx(Pane.Body, {
|
|
905
|
+
className: "pb-6",
|
|
897
906
|
children: /*#__PURE__*/jsxs("div", {
|
|
898
|
-
className: "w-full space-y-4",
|
|
907
|
+
className: "w-full space-y-4 md:space-y-6",
|
|
899
908
|
children: [/*#__PURE__*/jsx(Textarea, {
|
|
900
909
|
required: true,
|
|
901
910
|
"data-cy": "endpoint-input-field",
|
|
@@ -913,25 +922,27 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
913
922
|
name: "events",
|
|
914
923
|
options: events,
|
|
915
924
|
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
916
|
-
}),
|
|
917
|
-
className: "
|
|
918
|
-
children: [/*#__PURE__*/
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
925
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
926
|
+
className: "space-y-2",
|
|
927
|
+
children: [/*#__PURE__*/jsxs("span", {
|
|
928
|
+
className: "flex items-center gap-x-2",
|
|
929
|
+
children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsx(HelpPopover, {
|
|
930
|
+
helpLinkProps: {
|
|
931
|
+
href: HELP_LINK_URLS.secrets
|
|
932
|
+
},
|
|
933
|
+
popoverProps: {
|
|
934
|
+
position: "bottom"
|
|
935
|
+
},
|
|
936
|
+
title: t("neetoWebhooks.webhook.secretkeyHelpTitle"),
|
|
937
|
+
description: t("neetoWebhooks.webhook.secretkeyHelpDescription")
|
|
938
|
+
})]
|
|
939
|
+
}), isSecretInputFieldVisible ? /*#__PURE__*/jsxs("div", {
|
|
940
|
+
className: "flex items-center justify-between space-x-2",
|
|
941
|
+
children: [/*#__PURE__*/jsx(Input, {
|
|
942
|
+
"data-cy": "secret-key-input-field",
|
|
943
|
+
name: "secret",
|
|
944
|
+
placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
|
|
945
|
+
}), /*#__PURE__*/jsx(MoreDropdown, {
|
|
935
946
|
menuItems: [{
|
|
936
947
|
key: "regenerate-secret",
|
|
937
948
|
label: t("neetoWebhooks.buttons.regenerate"),
|
|
@@ -947,19 +958,28 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
947
958
|
return handleDelete(setFieldValue);
|
|
948
959
|
}
|
|
949
960
|
}]
|
|
950
|
-
})
|
|
961
|
+
})]
|
|
962
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
963
|
+
"data-cy": "add-secret-key",
|
|
964
|
+
icon: Plus,
|
|
965
|
+
iconPosition: "left",
|
|
966
|
+
label: t("neetoWebhooks.buttons.generateSecretKey"),
|
|
967
|
+
style: "link",
|
|
968
|
+
onClick: function onClick() {
|
|
969
|
+
return handleClick(setFieldValue);
|
|
970
|
+
}
|
|
971
|
+
})]
|
|
972
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
973
|
+
className: "flex gap-2",
|
|
974
|
+
children: [/*#__PURE__*/jsx(Switch, {
|
|
975
|
+
label: t("neetoWebhooks.webhook.active"),
|
|
976
|
+
name: "isActive"
|
|
977
|
+
}), /*#__PURE__*/jsx(HelpPopover, {
|
|
978
|
+
popoverProps: {
|
|
979
|
+
position: "bottom"
|
|
980
|
+
},
|
|
981
|
+
description: values.isActive ? t("neetoWebhooks.webhook.statusActiveHelpDescription") : t("neetoWebhooks.webhook.statusInactiveHelpDescription")
|
|
951
982
|
})]
|
|
952
|
-
}), /*#__PURE__*/jsx(Switch, {
|
|
953
|
-
label: t("neetoWebhooks.webhook.active"),
|
|
954
|
-
name: "isActive"
|
|
955
|
-
}), !isSecretInputFieldVisible && /*#__PURE__*/jsx(Button, {
|
|
956
|
-
"data-cy": "add-secret-key",
|
|
957
|
-
icon: Plus,
|
|
958
|
-
label: t("neetoWebhooks.buttons.addSecretKey"),
|
|
959
|
-
style: "text",
|
|
960
|
-
onClick: function onClick() {
|
|
961
|
-
return handleClick(setFieldValue);
|
|
962
|
-
}
|
|
963
983
|
})]
|
|
964
984
|
})
|
|
965
985
|
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
@@ -980,7 +1000,8 @@ var Header = withT(function (_ref) {
|
|
|
980
1000
|
breadcrumbs = _ref.breadcrumbs,
|
|
981
1001
|
title = _ref.title,
|
|
982
1002
|
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
|
|
983
|
-
headerSize = _ref.headerSize
|
|
1003
|
+
headerSize = _ref.headerSize,
|
|
1004
|
+
webhooks = _ref.webhooks;
|
|
984
1005
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
985
1006
|
children: [/*#__PURE__*/jsx(Header$2, {
|
|
986
1007
|
breadcrumbs: breadcrumbs,
|
|
@@ -1002,12 +1023,14 @@ var Header = withT(function (_ref) {
|
|
|
1002
1023
|
title: t("neetoWebhooks.webhook.title")
|
|
1003
1024
|
})]
|
|
1004
1025
|
})
|
|
1005
|
-
}), /*#__PURE__*/jsx(
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1026
|
+
}), isNotEmpty(webhooks) && /*#__PURE__*/jsx(SubHeader, {
|
|
1027
|
+
leftActionBlock: /*#__PURE__*/jsx(Typography, {
|
|
1028
|
+
component: "h4",
|
|
1029
|
+
style: "h4",
|
|
1030
|
+
children: t("neetoWebhooks.common.webhookWithCount", {
|
|
1031
|
+
count: webhooks.length
|
|
1032
|
+
})
|
|
1033
|
+
})
|
|
1011
1034
|
})]
|
|
1012
1035
|
});
|
|
1013
1036
|
});
|
|
@@ -1090,7 +1113,8 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1090
1113
|
breadcrumbs: breadcrumbs,
|
|
1091
1114
|
headerSize: headerSize,
|
|
1092
1115
|
setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
|
|
1093
|
-
title: title
|
|
1116
|
+
title: title,
|
|
1117
|
+
webhooks: webhooks
|
|
1094
1118
|
}), isNotEmpty(webhooks) ? /*#__PURE__*/jsx(TableWrapper, {
|
|
1095
1119
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
1096
1120
|
children: /*#__PURE__*/jsx(Table, {
|