@bigbinary/neeto-webhooks-frontend 2.2.3 → 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 +70 -45
- package/dist/NeetoWebhooks.js.map +1 -1
- package/dist/cjs/NeetoWebhooks.js +70 -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 +7 -7
|
@@ -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,16 +769,23 @@ 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",
|
|
777
784
|
key: "events",
|
|
778
785
|
render: function render(events) {
|
|
779
786
|
return pluck("label", events).sort().join(", ");
|
|
780
|
-
}
|
|
787
|
+
},
|
|
788
|
+
width: 300
|
|
781
789
|
}];
|
|
782
790
|
};
|
|
783
791
|
var generateRandomSecret = function generateRandomSecret() {
|
|
@@ -887,14 +895,16 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
887
895
|
}
|
|
888
896
|
},
|
|
889
897
|
children: function children(_ref2) {
|
|
890
|
-
var setFieldValue = _ref2.setFieldValue
|
|
898
|
+
var setFieldValue = _ref2.setFieldValue,
|
|
899
|
+
values = _ref2.values;
|
|
891
900
|
return isLoading ? /*#__PURE__*/jsx("div", {
|
|
892
901
|
className: "flex items-center justify-center",
|
|
893
902
|
children: /*#__PURE__*/jsx(Spinner, {})
|
|
894
903
|
}) : /*#__PURE__*/jsxs(Fragment, {
|
|
895
904
|
children: [/*#__PURE__*/jsx(Pane.Body, {
|
|
905
|
+
className: "pb-6",
|
|
896
906
|
children: /*#__PURE__*/jsxs("div", {
|
|
897
|
-
className: "w-full space-y-4",
|
|
907
|
+
className: "w-full space-y-4 md:space-y-6",
|
|
898
908
|
children: [/*#__PURE__*/jsx(Textarea, {
|
|
899
909
|
required: true,
|
|
900
910
|
"data-cy": "endpoint-input-field",
|
|
@@ -912,25 +922,27 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
912
922
|
name: "events",
|
|
913
923
|
options: events,
|
|
914
924
|
placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
|
|
915
|
-
}),
|
|
916
|
-
className: "
|
|
917
|
-
children: [/*#__PURE__*/
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
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, {
|
|
934
946
|
menuItems: [{
|
|
935
947
|
key: "regenerate-secret",
|
|
936
948
|
label: t("neetoWebhooks.buttons.regenerate"),
|
|
@@ -946,19 +958,28 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
|
|
|
946
958
|
return handleDelete(setFieldValue);
|
|
947
959
|
}
|
|
948
960
|
}]
|
|
949
|
-
})
|
|
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")
|
|
950
982
|
})]
|
|
951
|
-
}), /*#__PURE__*/jsx(Switch, {
|
|
952
|
-
label: t("neetoWebhooks.webhook.active"),
|
|
953
|
-
name: "isActive"
|
|
954
|
-
}), !isSecretInputFieldVisible && /*#__PURE__*/jsx(Button, {
|
|
955
|
-
"data-cy": "add-secret-key",
|
|
956
|
-
icon: Plus,
|
|
957
|
-
label: t("neetoWebhooks.buttons.addSecretKey"),
|
|
958
|
-
style: "text",
|
|
959
|
-
onClick: function onClick() {
|
|
960
|
-
return handleClick(setFieldValue);
|
|
961
|
-
}
|
|
962
983
|
})]
|
|
963
984
|
})
|
|
964
985
|
}), /*#__PURE__*/jsx(Pane.Footer, {
|
|
@@ -979,7 +1000,8 @@ var Header = withT(function (_ref) {
|
|
|
979
1000
|
breadcrumbs = _ref.breadcrumbs,
|
|
980
1001
|
title = _ref.title,
|
|
981
1002
|
setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
|
|
982
|
-
headerSize = _ref.headerSize
|
|
1003
|
+
headerSize = _ref.headerSize,
|
|
1004
|
+
webhooks = _ref.webhooks;
|
|
983
1005
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
984
1006
|
children: [/*#__PURE__*/jsx(Header$2, {
|
|
985
1007
|
breadcrumbs: breadcrumbs,
|
|
@@ -1001,12 +1023,14 @@ var Header = withT(function (_ref) {
|
|
|
1001
1023
|
title: t("neetoWebhooks.webhook.title")
|
|
1002
1024
|
})]
|
|
1003
1025
|
})
|
|
1004
|
-
}), /*#__PURE__*/jsx(
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
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
|
+
})
|
|
1010
1034
|
})]
|
|
1011
1035
|
});
|
|
1012
1036
|
});
|
|
@@ -1089,7 +1113,8 @@ var Webhooks = function Webhooks(_ref) {
|
|
|
1089
1113
|
breadcrumbs: breadcrumbs,
|
|
1090
1114
|
headerSize: headerSize,
|
|
1091
1115
|
setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
|
|
1092
|
-
title: title
|
|
1116
|
+
title: title,
|
|
1117
|
+
webhooks: webhooks
|
|
1093
1118
|
}), isNotEmpty(webhooks) ? /*#__PURE__*/jsx(TableWrapper, {
|
|
1094
1119
|
hasPagination: totalCount > DEFAULT_PAGE_SIZE,
|
|
1095
1120
|
children: /*#__PURE__*/jsx(Table, {
|