@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.
@@ -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,16 +790,23 @@ 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",
798
805
  key: "events",
799
806
  render: function render(events) {
800
807
  return ramda.pluck("label", events).sort().join(", ");
801
- }
808
+ },
809
+ width: 300
802
810
  }];
803
811
  };
804
812
  var generateRandomSecret = function generateRandomSecret() {
@@ -908,14 +916,16 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
908
916
  }
909
917
  },
910
918
  children: function children(_ref2) {
911
- var setFieldValue = _ref2.setFieldValue;
919
+ var setFieldValue = _ref2.setFieldValue,
920
+ values = _ref2.values;
912
921
  return isLoading ? /*#__PURE__*/jsxRuntime.jsx("div", {
913
922
  className: "flex items-center justify-center",
914
923
  children: /*#__PURE__*/jsxRuntime.jsx(Spinner, {})
915
924
  }) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
916
925
  children: [/*#__PURE__*/jsxRuntime.jsx(Pane.Body, {
926
+ className: "pb-6",
917
927
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
918
- className: "w-full space-y-4",
928
+ className: "w-full space-y-4 md:space-y-6",
919
929
  children: [/*#__PURE__*/jsxRuntime.jsx(Textarea, {
920
930
  required: true,
921
931
  "data-cy": "endpoint-input-field",
@@ -933,25 +943,27 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
933
943
  name: "events",
934
944
  options: events,
935
945
  placeholder: t("neetoWebhooks.webhook.eventPlaceholder")
936
- }), isSecretInputFieldVisible && /*#__PURE__*/jsxRuntime.jsxs("div", {
937
- className: "flex items-center justify-between space-x-3",
938
- children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
939
- "data-cy": "secret-key-input-field",
940
- name: "secret",
941
- label: /*#__PURE__*/jsxRuntime.jsxs("span", {
942
- className: "flex items-center gap-x-2",
943
- children: [t("neetoWebhooks.webhook.secret"), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
944
- helpLinkProps: {
945
- href: HELP_LINK_URLS.secrets
946
- },
947
- description: t("neetoWebhooks.webhook.secretkeyHelpDescription"),
948
- title: t("neetoWebhooks.webhook.secretkeyHelpTitle")
949
- })]
950
- }),
951
- placeholder: t("neetoWebhooks.webhook.secretPlaceholder")
952
- }), /*#__PURE__*/jsxRuntime.jsx("div", {
953
- className: "mt-6",
954
- 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, {
955
967
  menuItems: [{
956
968
  key: "regenerate-secret",
957
969
  label: t("neetoWebhooks.buttons.regenerate"),
@@ -967,19 +979,28 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
967
979
  return handleDelete(setFieldValue);
968
980
  }
969
981
  }]
970
- })
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")
971
1003
  })]
972
- }), /*#__PURE__*/jsxRuntime.jsx(Switch, {
973
- label: t("neetoWebhooks.webhook.active"),
974
- name: "isActive"
975
- }), !isSecretInputFieldVisible && /*#__PURE__*/jsxRuntime.jsx(Button, {
976
- "data-cy": "add-secret-key",
977
- icon: Plus,
978
- label: t("neetoWebhooks.buttons.addSecretKey"),
979
- style: "text",
980
- onClick: function onClick() {
981
- return handleClick(setFieldValue);
982
- }
983
1004
  })]
984
1005
  })
985
1006
  }), /*#__PURE__*/jsxRuntime.jsx(Pane.Footer, {
@@ -1000,7 +1021,8 @@ var Header = reactUtils.withT(function (_ref) {
1000
1021
  breadcrumbs = _ref.breadcrumbs,
1001
1022
  title = _ref.title,
1002
1023
  setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen,
1003
- headerSize = _ref.headerSize;
1024
+ headerSize = _ref.headerSize,
1025
+ webhooks = _ref.webhooks;
1004
1026
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1005
1027
  children: [/*#__PURE__*/jsxRuntime.jsx(Header$2, {
1006
1028
  breadcrumbs: breadcrumbs,
@@ -1022,12 +1044,14 @@ var Header = reactUtils.withT(function (_ref) {
1022
1044
  title: t("neetoWebhooks.webhook.title")
1023
1045
  })]
1024
1046
  })
1025
- }), /*#__PURE__*/jsxRuntime.jsx(Typography, {
1026
- className: "mb-3",
1027
- "data-cy": "webhook-description-header",
1028
- style: "h5",
1029
- weight: "normal",
1030
- 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
+ })
1031
1055
  })]
1032
1056
  });
1033
1057
  });
@@ -1110,7 +1134,8 @@ var Webhooks = function Webhooks(_ref) {
1110
1134
  breadcrumbs: breadcrumbs,
1111
1135
  headerSize: headerSize,
1112
1136
  setIsAddWebhookPaneOpen: setIsAddWebhookPaneOpen,
1113
- title: title
1137
+ title: title,
1138
+ webhooks: webhooks
1114
1139
  }), neetoCist.isNotEmpty(webhooks) ? /*#__PURE__*/jsxRuntime.jsx(TableWrapper, {
1115
1140
  hasPagination: totalCount > constants.DEFAULT_PAGE_SIZE,
1116
1141
  children: /*#__PURE__*/jsxRuntime.jsx(Table, {