@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.
@@ -42,6 +42,7 @@ var Select = require('@bigbinary/neetoui/formik/Select');
42
42
  var Switch = require('@bigbinary/neetoui/formik/Switch');
43
43
  var Textarea = require('@bigbinary/neetoui/formik/Textarea');
44
44
  var yup = require('yup');
45
+ var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
45
46
 
46
47
  function _interopNamespaceDefault(e) {
47
48
  var n = Object.create(null);
@@ -759,7 +760,7 @@ var buildColumns = function buildColumns(_ref6) {
759
760
  title: i18next.t("neetoWebhooks.common.endpoint"),
760
761
  key: "endpoint",
761
762
  dataIndex: "endpoint",
762
- width: 830,
763
+ width: 700,
763
764
  render: function render(endpoint, webhook) {
764
765
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
765
766
  className: "flex items-center justify-between space-x-3",
@@ -789,9 +790,15 @@ var buildColumns = function buildColumns(_ref6) {
789
790
  key: "isActive",
790
791
  dataIndex: "isActive",
791
792
  render: function render(isActive) {
792
- return isActive ? i18next.t("neetoWebhooks.webhook.activeStatuses.yes") : i18next.t("neetoWebhooks.webhook.activeStatuses.no");
793
+ return isActive ? /*#__PURE__*/jsxRuntime.jsx(Tag, {
794
+ label: i18next.t("neetoWebhooks.webhook.activeStatuses.active"),
795
+ style: "primary"
796
+ }) : /*#__PURE__*/jsxRuntime.jsx(Tag, {
797
+ label: i18next.t("neetoWebhooks.webhook.activeStatuses.inactive"),
798
+ style: "danger"
799
+ });
793
800
  },
794
- width: 100
801
+ width: 150
795
802
  }, {
796
803
  title: i18next.t("neetoWebhooks.common.event", constants.PLURAL),
797
804
  dataIndex: "events",
@@ -799,7 +806,7 @@ var buildColumns = function buildColumns(_ref6) {
799
806
  render: function render(events) {
800
807
  return ramda.pluck("label", events).sort().join(", ");
801
808
  },
802
- width: 400
809
+ width: 300
803
810
  }];
804
811
  };
805
812
  var generateRandomSecret = function generateRandomSecret() {
@@ -909,14 +916,16 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
909
916
  }
910
917
  },
911
918
  children: function children(_ref2) {
912
- var setFieldValue = _ref2.setFieldValue;
919
+ var setFieldValue = _ref2.setFieldValue,
920
+ values = _ref2.values;
913
921
  return isLoading ? /*#__PURE__*/jsxRuntime.jsx("div", {
914
922
  className: "flex items-center justify-center",
915
923
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
916
924
  }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
917
925
  children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
926
+ className: "pb-6",
918
927
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
919
- className: "w-full space-y-4",
928
+ className: "w-full space-y-4 md:space-y-6",
920
929
  children: [/*#__PURE__*/jsxRuntime.jsx(Textarea, {
921
930
  required: true,
922
931
  "data-cy": "endpoint-input-field",
@@ -934,25 +943,27 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
934
943
  name: "events",
935
944
  options: events,
936
945
  placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
937
- }), isSecretInputFieldVisible && /*#__PURE__*/jsxRuntime.jsxs("div", {
938
- className: "flex items-center justify-between space-x-3",
939
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
940
- "data-cy": "secret-key-input-field",
941
- name: "secret",
942
- label: /*#__PURE__*/jsxRuntime.jsxs("span", {
943
- className: "flex items-center gap-x-2",
944
- children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
945
- helpLinkProps: {
946
- href: HELP_LINK_URLS.secrets
947
- },
948
- description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
949
- title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
950
- })]
951
- }),
952
- placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
953
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
954
- className: "mt-6",
955
- children: /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
946
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
947
+ className: "space-y-2",
948
+ children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
949
+ className: "flex items-center gap-x-2",
950
+ children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
951
+ helpLinkProps: {
952
+ href: HELP_LINK_URLS.secrets
953
+ },
954
+ popoverProps: {
955
+ position: "bottom"
956
+ },
957
+ title: t("neetoWebhooks.webhook.secretkeyHelpTitle"),
958
+ description: t("neetoWebhooks.webhook.secretkeyHelpDescription")
959
+ })]
960
+ }), isSecretInputFieldVisible ? /*#__PURE__*/jsxRuntime.jsxs("div", {
961
+ className: "flex items-center justify-between space-x-2",
962
+ children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
963
+ "data-cy": "secret-key-input-field",
964
+ name: "secret",
965
+ placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
966
+ }), /*#__PURE__*/jsxRuntime.jsx(MoreDropdown, {
956
967
  menuItems: [{
957
968
  key: "regenerate-secret",
958
969
  label: t("neetoWebhooks.buttons.regenerate"),
@@ -968,19 +979,28 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
968
979
  return handleDelete(setFieldValue);
969
980
  }
970
981
  }]
971
- })
982
+ })]
983
+ }) : /*#__PURE__*/jsxRuntime.jsx(Button, {
984
+ "data-cy": "add-secret-key",
985
+ icon: Plus,
986
+ iconPosition: "left",
987
+ label: t("neetoWebhooks.buttons.generateSecretKey"),
988
+ style: "link",
989
+ onClick: function onClick() {
990
+ return handleClick(setFieldValue);
991
+ }
992
+ })]
993
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
994
+ className: "flex gap-2",
995
+ children: [/*#__PURE__*/jsxRuntime.jsx(Switch, {
996
+ label: t("neetoWebhooks.webhook.active"),
997
+ name: "isActive"
998
+ }), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
999
+ popoverProps: {
1000
+ position: "bottom"
1001
+ },
1002
+ description: values.isActive ? t("neetoWebhooks.webhook.statusActiveHelpDescription") : t("neetoWebhooks.webhook.statusInactiveHelpDescription")
972
1003
  })]
973
- }), /*#__PURE__*/jsxRuntime.jsx(Switch, {
974
- label: t("neetoWebhooks.webhook.active"),
975
- name: "isActive"
976
- }), !isSecretInputFieldVisible && /*#__PURE__*/jsxRuntime.jsx(Button, {
977
- "data-cy": "add-secret-key",
978
- icon: Plus,
979
- label: t("neetoWebhooks.buttons.addSecretKey"),
980
- style: "text",
981
- onClick: function onClick() {
982
- return handleClick(setFieldValue);
983
- }
984
1004
  })]
985
1005
  })
986
1006
  }), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
@@ -1001,7 +1021,8 @@ var Header = reactUtils.withT(function (_ref) {
1001
1021
  breadcrumbs = _ref.breadcrumbs,
1002
1022
  title = _ref.title,
1003
1023
  setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
1004
- headerSize = _ref.headerSize;
1024
+ headerSize = _ref.headerSize,
1025
+ webhooks = _ref.webhooks;
1005
1026
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1006
1027
  children: [/*#__PURE__*/jsxRuntime.jsx(Header$2, {
1007
1028
  breadcrumbs: breadcrumbs,
@@ -1023,12 +1044,14 @@ var Header = reactUtils.withT(function (_ref) {
1023
1044
  title: t("neetoWebhooks.webhook.title")
1024
1045
  })]
1025
1046
  })
1026
- }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
1027
- className: "mb-3",
1028
- "data-cy": "webhook-description-header",
1029
- style: "h5",
1030
- weight: "normal",
1031
- children: t("neetoWebhooks.webhook.description")
1047
+ }), neetoCist.isNotEmpty(webhooks) && /*#__PURE__*/jsxRuntime.jsx(SubHeader, {
1048
+ leftActionBlock: /*#__PURE__*/jsxRuntime.jsx(Typography, {
1049
+ component: "h4",
1050
+ style: "h4",
1051
+ children: t("neetoWebhooks.common.webhookWithCount", {
1052
+ count: webhooks.length
1053
+ })
1054
+ })
1032
1055
  })]
1033
1056
  });
1034
1057
  });
@@ -1111,7 +1134,8 @@ var Webhooks = function Webhooks(_ref) {
1111
1134
  breadcrumbs: breadcrumbs,
1112
1135
  headerSize: headerSize,
1113
1136
  setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
1114
- title: title
1137
+ title: title,
1138
+ webhooks: webhooks
1115
1139
  }), neetoCist.isNotEmpty(webhooks) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper, {
1116
1140
  hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
1117
1141
  children: /*#__PURE__*/jsxRuntime.jsx(Table, {