@bigbinary/neeto-slack-frontend 2.0.2 → 2.1.1

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.cjs.js CHANGED
@@ -9,7 +9,6 @@ var neetoui = require('@bigbinary/neetoui');
9
9
  var yup = require('yup');
10
10
  var formik = require('@bigbinary/neetoui/formik');
11
11
  var ramda = require('ramda');
12
- var neetoIcons = require('@bigbinary/neeto-icons');
13
12
  var misc = require('@bigbinary/neeto-icons/misc');
14
13
 
15
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -3633,21 +3632,19 @@ function useTranslation(ns) {
3633
3632
  }
3634
3633
 
3635
3634
  var common = {
3636
- saveChanges: "Save changes",
3637
- cancel: "Cancel",
3638
3635
  "continue": "Continue",
3639
3636
  save: "Save",
3640
3637
  edit: "Edit",
3641
- "delete": "Delete",
3638
+ done: "Done",
3642
3639
  required: "{{entity}} is required"
3643
3640
  };
3644
3641
  var slack = {
3645
3642
  placeholder: "Notification Channel",
3646
3643
  channelName: "Channel Name",
3647
3644
  editPane: "Edit slack integration",
3645
+ channelListRefreshToastr: "Slack channels list is updated",
3646
+ channelListRefreshButton: "Refresh channels list",
3648
3647
  steps: {
3649
- connect: "Connect",
3650
- configure: "Configure",
3651
3648
  finish: "Finish"
3652
3649
  },
3653
3650
  connect: {
@@ -3658,14 +3655,11 @@ var slack = {
3658
3655
  configure: {
3659
3656
  title: "You are connecting to <br/><strong>{{teamName}}</strong> workspace <br/>({{slackUrl}}).",
3660
3657
  sendTo: "Send to",
3661
- sendToDescription: "Choose a Slack channel to send the notifications",
3662
- updateType: "Update type",
3658
+ sendToDescription: "Choose a Slack channel that will receive notifications",
3663
3659
  refreshSlackChannelList: "Refresh Slack channel list"
3664
3660
  },
3665
3661
  finish: {
3666
- title: "Slack successfully connected to <br/><strong>{{teamName}}</strong> workspace.",
3667
- account: "Account",
3668
- channel: "Channel"
3662
+ title: "You are successfully connected to the <strong>{{teamName}}</strong> workspace."
3669
3663
  },
3670
3664
  settings: {
3671
3665
  title: "You are connected to <br/><strong>{{teamName}}</strong> workspace <br/>({{slackUrl}})."
@@ -3766,6 +3760,10 @@ var buildValidationSchema = function buildValidationSchema(customValidationSchem
3766
3760
  var toSlackUrl = function toSlackUrl(teamName) {
3767
3761
  return "".concat(teamName === null || teamName === void 0 ? void 0 : teamName.replace(/\s/g, "").toLowerCase(), ".slack.com");
3768
3762
  };
3763
+ var slackChannelRefresh = function slackChannelRefresh(channelRefreshHandler) {
3764
+ channelRefreshHandler();
3765
+ neetoui.Toastr.success(t$2("slack.channelListRefreshToastr"));
3766
+ };
3769
3767
 
3770
3768
  function _extends$1() {
3771
3769
  _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
@@ -3785,20 +3783,18 @@ function _extends$1() {
3785
3783
  var SlackRefreshChannelListButton = function SlackRefreshChannelListButton(_ref) {
3786
3784
  var channelRefreshHandler = _ref.channelRefreshHandler,
3787
3785
  _ref$className = _ref.className,
3788
- className = _ref$className === void 0 ? "" : _ref$className;
3786
+ className = _ref$className === void 0 ? "pl-1" : _ref$className;
3789
3787
  var _useTranslation = useTranslation(),
3790
3788
  t = _useTranslation.t;
3791
3789
  return /*#__PURE__*/React__default["default"].createElement("div", {
3792
3790
  className: "relative top-0 flex justify-center"
3793
3791
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
3794
- icon: neetoIcons.Refresh,
3795
- style: "secondary",
3796
- className: classNames__default["default"]("neeto-ui-border-gray-400 neeto-ui-bg-white border border-solid", className),
3797
- tooltipProps: {
3798
- content: t("slack.configure.refreshSlackChannelList"),
3799
- position: "top"
3800
- },
3801
- onClick: channelRefreshHandler
3792
+ className: className,
3793
+ label: t("slack.channelListRefreshButton"),
3794
+ style: "link",
3795
+ onClick: function onClick() {
3796
+ return slackChannelRefresh(channelRefreshHandler);
3797
+ }
3802
3798
  }));
3803
3799
  };
3804
3800
  var SlackRefreshChannelListButton$1 = /*#__PURE__*/React__default["default"].memo(SlackRefreshChannelListButton);
@@ -3852,9 +3848,10 @@ var EditPane = function EditPane(_ref) {
3852
3848
  style: "body2",
3853
3849
  weight: "bold"
3854
3850
  }, t("slack.configure.sendToDescription"))), /*#__PURE__*/React__default["default"].createElement("div", {
3855
- className: "relative flex gap-x-3"
3851
+ className: "relative flex flex-col items-start gap-y-3"
3856
3852
  }, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
3857
3853
  isSearchable: true,
3854
+ className: "w-full",
3858
3855
  name: "selectedChannel",
3859
3856
  options: formikProps.values.channels,
3860
3857
  placeholder: t("slack.placeholder"),
@@ -3913,6 +3910,8 @@ Settings.EditPane = EditPane;
3913
3910
  var Configure = function Configure(_ref) {
3914
3911
  var children = _ref.children,
3915
3912
  teamName = _ref.teamName,
3913
+ _ref$slackUrl = _ref.slackUrl,
3914
+ slackUrl = _ref$slackUrl === void 0 ? "" : _ref$slackUrl,
3916
3915
  initialFormValues = _ref.initialFormValues,
3917
3916
  handleSubmit = _ref.handleSubmit,
3918
3917
  isSubmitting = _ref.isSubmitting,
@@ -3933,7 +3932,7 @@ var Configure = function Configure(_ref) {
3933
3932
  i18nKey: "slack.configure.title",
3934
3933
  values: {
3935
3934
  teamName: teamName,
3936
- slackUrl: toSlackUrl(teamName)
3935
+ slackUrl: ramda.isEmpty(slackUrl) ? toSlackUrl(teamName) : slackUrl
3937
3936
  }
3938
3937
  }))), /*#__PURE__*/React__default["default"].createElement(formik.Form, {
3939
3938
  className: "neeto-ui-w-full",
@@ -3951,9 +3950,10 @@ var Configure = function Configure(_ref) {
3951
3950
  style: "body2",
3952
3951
  weight: "normal"
3953
3952
  }, ramda.isEmpty(channelSelectLabel) ? t("slack.configure.sendToDescription") : channelSelectLabel), /*#__PURE__*/React__default["default"].createElement("div", {
3954
- className: "relative flex gap-x-3"
3953
+ className: "relative flex flex-col items-start gap-y-3"
3955
3954
  }, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
3956
3955
  isSearchable: true,
3956
+ className: "w-full",
3957
3957
  name: "selectedChannel",
3958
3958
  options: formikProps.values.channels,
3959
3959
  placeholder: t("slack.placeholder"),
@@ -4058,7 +4058,7 @@ var Finish = function Finish(_ref) {
4058
4058
  className: "neeto-ui-flex neeto-ui-w-full neeto-ui-flex-row neeto-ui-mt-6"
4059
4059
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$1({
4060
4060
  className: "neeto-ui-my-1",
4061
- label: t("slack.steps.finish"),
4061
+ label: t("common.done"),
4062
4062
  onClick: onSuccess
4063
4063
  }, buttonProps)), pure.isNotEmpty(secondaryButtonProps) && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, _extends$1({
4064
4064
  className: "neeto-ui-my-1 neeto-ui-ml-2",