@bigbinary/neeto-webhooks-frontend 1.6.24 → 1.6.26

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/dist/index.js CHANGED
@@ -20,6 +20,7 @@ import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
20
20
  import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
21
21
  import { Form, Textarea, Select, Input, Switch, ActionBlock } from '@bigbinary/neetoui/formik';
22
22
  import * as yup from 'yup';
23
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
23
24
 
24
25
  var getDeliveriesPath = function getDeliveriesPath(webhooksPath) {
25
26
  return "".concat(webhooksPath, "/:webhookId/deliveries");
@@ -941,6 +942,9 @@ var useDestroyWebhook = function useDestroyWebhook(options) {
941
942
  });
942
943
  };
943
944
 
945
+ var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
946
+ var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
947
+
944
948
  function _typeof(o) {
945
949
  "@babel/helpers - typeof";
946
950
 
@@ -996,9 +1000,6 @@ var useFetchEvents = function useFetchEvents() {
996
1000
  });
997
1001
  };
998
1002
 
999
- var WEBHOOK_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-4bb6c2a2";
1000
- var WEBHOOK_SECRETS_HELP_URL = "https://neetocalhelp.neetokb.com/p/a-80de90bd";
1001
-
1002
1003
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
1003
1004
  // require the crypto API and do not support built-in fallback to lower quality random number
1004
1005
  // generators (like Math.random()).
@@ -1277,10 +1278,7 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1277
1278
  }
1278
1279
  }
1279
1280
  }, function (_ref2) {
1280
- var dirty = _ref2.dirty,
1281
- isSubmitting = _ref2.isSubmitting,
1282
- isValid = _ref2.isValid,
1283
- setFieldValue = _ref2.setFieldValue;
1281
+ var setFieldValue = _ref2.setFieldValue;
1284
1282
  return isLoading ? /*#__PURE__*/React.createElement("div", {
1285
1283
  className: "flex items-center justify-center"
1286
1284
  }, /*#__PURE__*/React.createElement(Spinner, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
@@ -1346,46 +1344,43 @@ var AddWebhookPane = function AddWebhookPane(_ref) {
1346
1344
  onClick: function onClick() {
1347
1345
  return handleClick(setFieldValue);
1348
1346
  }
1349
- }))), /*#__PURE__*/React.createElement(Pane.Footer, {
1350
- className: "flex gap-2"
1351
- }, /*#__PURE__*/React.createElement(ActionBlock, {
1352
- className: "space-x-3",
1347
+ }))), /*#__PURE__*/React.createElement(Pane.Footer, null, /*#__PURE__*/React.createElement(ActionBlock, {
1353
1348
  cancelButtonProps: {
1354
- onClick: onClose,
1355
- disabled: false,
1356
- label: t("neetoWebhooks.buttons.cancel")
1357
- },
1358
- submitButtonProps: {
1359
- label: t("neetoWebhooks.buttons.saveChanges"),
1360
- disabled: !dirty || !isValid,
1361
- loading: isSubmitting
1349
+ onClick: onClose
1362
1350
  }
1363
1351
  })));
1364
1352
  }));
1365
1353
  };
1366
1354
 
1367
- var Header = function Header(_ref) {
1368
- var breadcrumbs = _ref.breadcrumbs,
1355
+ var Header = withT(function (_ref) {
1356
+ var t = _ref.t,
1357
+ breadcrumbs = _ref.breadcrumbs,
1369
1358
  setIsAddWebhookPaneOpen = _ref.setIsAddWebhookPaneOpen;
1370
- var _useTranslation = useTranslation(),
1371
- t = _useTranslation.t;
1372
1359
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header$2, {
1373
1360
  breadcrumbs: breadcrumbs,
1374
- title: t("neetoWebhooks.webhook.title"),
1375
1361
  actionBlock: /*#__PURE__*/React.createElement(Button, {
1376
1362
  "data-cy": "add-new-webhook-button",
1377
1363
  label: t("neetoWebhooks.webhook.add"),
1378
1364
  onClick: function onClick() {
1379
1365
  return setIsAddWebhookPaneOpen(true);
1380
1366
  }
1381
- })
1367
+ }),
1368
+ title: /*#__PURE__*/React.createElement("div", {
1369
+ className: "flex items-center gap-x-2"
1370
+ }, t("neetoWebhooks.webhook.title"), /*#__PURE__*/React.createElement(HelpPopover, {
1371
+ description: t("neetoWebhooks.webhook.helpDescription"),
1372
+ helpLinkProps: {
1373
+ href: WEBHOOK_HELP_URL
1374
+ },
1375
+ title: t("neetoWebhooks.webhook.title")
1376
+ }))
1382
1377
  }), /*#__PURE__*/React.createElement(Typography, {
1383
1378
  className: "mb-3",
1384
1379
  "data-cy": "webhook-description-header",
1385
1380
  style: "h5",
1386
1381
  weight: "normal"
1387
1382
  }, t("neetoWebhooks.webhook.description")));
1388
- };
1383
+ });
1389
1384
  var Header$1 = /*#__PURE__*/React.memo(Header);
1390
1385
 
1391
1386
  var Webhooks = function Webhooks(_ref) {
@@ -1465,9 +1460,7 @@ var Webhooks = function Webhooks(_ref) {
1465
1460
  fixedHeight: true,
1466
1461
  currentPageNumber: pageNumber,
1467
1462
  defaultPageSize: DEFAULT_PAGE_SIZE,
1468
- handlePageChange: function handlePageChange(page) {
1469
- return setPageNumber(page);
1470
- },
1463
+ handlePageChange: setPageNumber,
1471
1464
  loading: isFetching,
1472
1465
  rowData: webhooks,
1473
1466
  columnData: buildColumns({
@@ -1478,7 +1471,19 @@ var Webhooks = function Webhooks(_ref) {
1478
1471
  })) : /*#__PURE__*/React.createElement("div", {
1479
1472
  className: "flex h-full w-full items-center justify-center"
1480
1473
  }, /*#__PURE__*/React.createElement(NoData, {
1481
- title: t("neetoWebhooks.webhook.empty")
1474
+ title: t("neetoWebhooks.webhook.empty"),
1475
+ helpText: /*#__PURE__*/React.createElement("a", {
1476
+ className: "neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium",
1477
+ href: WEBHOOK_HELP_URL,
1478
+ rel: "noreferrer",
1479
+ target: "_blank"
1480
+ }, t("neetoWebhooks.webhook.emptyHelpText")),
1481
+ primaryButtonProps: {
1482
+ label: t("neetoWebhooks.webhook.add"),
1483
+ onClick: function onClick() {
1484
+ return setIsAddWebhookPaneOpen(true);
1485
+ }
1486
+ }
1482
1487
  })), /*#__PURE__*/React.createElement(AddWebhookPane, {
1483
1488
  editingWebhookId: editingWebhookId,
1484
1489
  entityId: entityId,