@bigbinary/neeto-slack-frontend 0.3.7 → 0.3.9
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 +42 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +43 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +2 -0
package/dist/index.cjs.js
CHANGED
|
@@ -7,6 +7,7 @@ var classNames = require('classnames');
|
|
|
7
7
|
var neetoui = require('@bigbinary/neetoui');
|
|
8
8
|
var formik = require('@bigbinary/neetoui/formik');
|
|
9
9
|
var ramda = require('ramda');
|
|
10
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
10
11
|
var yup = require('yup');
|
|
11
12
|
var misc = require('@bigbinary/neeto-icons/misc');
|
|
12
13
|
var pure = require('@bigbinary/neeto-commons-frontend/pure');
|
|
@@ -3215,7 +3216,8 @@ var slack = {
|
|
|
3215
3216
|
configure: {
|
|
3216
3217
|
sendTo: "Send to",
|
|
3217
3218
|
sendToDescription: "Choose a Slack channel or contact to send the notifications",
|
|
3218
|
-
updateType: "Update type"
|
|
3219
|
+
updateType: "Update type",
|
|
3220
|
+
refreshSlackChannelList: "Refresh Slack Channel list"
|
|
3219
3221
|
},
|
|
3220
3222
|
finish: {
|
|
3221
3223
|
title: "Slack successfully connected",
|
|
@@ -3338,6 +3340,26 @@ function _slicedToArray(arr, i) {
|
|
|
3338
3340
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3339
3341
|
}
|
|
3340
3342
|
|
|
3343
|
+
var SlackRefreshChannelListButton = function SlackRefreshChannelListButton(_ref) {
|
|
3344
|
+
var channelRefreshHandler = _ref.channelRefreshHandler,
|
|
3345
|
+
_ref$className = _ref.className,
|
|
3346
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
|
3347
|
+
var _useTranslation = useTranslation(),
|
|
3348
|
+
t = _useTranslation.t;
|
|
3349
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3350
|
+
className: "relative top-0 flex justify-center"
|
|
3351
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3352
|
+
icon: neetoIcons.Refresh,
|
|
3353
|
+
style: "secondary",
|
|
3354
|
+
className: classNames__default["default"]("border border-solid border-gray-400 bg-white", className),
|
|
3355
|
+
tooltipProps: {
|
|
3356
|
+
content: t("slack.configure.refreshSlackChannelList"),
|
|
3357
|
+
position: "top"
|
|
3358
|
+
},
|
|
3359
|
+
onClick: channelRefreshHandler
|
|
3360
|
+
}));
|
|
3361
|
+
};
|
|
3362
|
+
|
|
3341
3363
|
var CHANNEL_NAME_VALIDAITON_SCHEMA = {
|
|
3342
3364
|
selectedChannel: yup__namespace.object().shape({
|
|
3343
3365
|
label: yup__namespace.string(),
|
|
@@ -3365,7 +3387,8 @@ var Settings = function Settings(_ref) {
|
|
|
3365
3387
|
handleSubmit = _ref.handleSubmit,
|
|
3366
3388
|
isSubmitting = _ref.isSubmitting,
|
|
3367
3389
|
className = _ref.className,
|
|
3368
|
-
validationSchema = _ref.validationSchema
|
|
3390
|
+
validationSchema = _ref.validationSchema,
|
|
3391
|
+
channelRefreshHandler = _ref.channelRefreshHandler;
|
|
3369
3392
|
var _useState = React.useState(false),
|
|
3370
3393
|
_useState2 = _slicedToArray(_useState, 2),
|
|
3371
3394
|
isEditable = _useState2[0],
|
|
@@ -3405,14 +3428,18 @@ var Settings = function Settings(_ref) {
|
|
|
3405
3428
|
className: "neeto-ui-text-gray-700 neeto-ui-mb-3",
|
|
3406
3429
|
style: "body2",
|
|
3407
3430
|
weight: "normal"
|
|
3408
|
-
}, t("slack.configure.sendToDescription")), /*#__PURE__*/React__default["default"].createElement(
|
|
3431
|
+
}, t("slack.configure.sendToDescription")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3432
|
+
className: "relative flex"
|
|
3433
|
+
}, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
|
|
3409
3434
|
isSearchable: true,
|
|
3410
3435
|
isDisabled: ramda.not(isEditable),
|
|
3411
3436
|
name: "selectedChannel",
|
|
3412
3437
|
options: formikProps.values.channels,
|
|
3413
3438
|
placeholder: t("slack.placeholder"),
|
|
3414
3439
|
size: "large"
|
|
3415
|
-
})
|
|
3440
|
+
}), /*#__PURE__*/React__default["default"].createElement(SlackRefreshChannelListButton, {
|
|
3441
|
+
channelRefreshHandler: channelRefreshHandler
|
|
3442
|
+
}))), ramda.is(Function, children) ? children(_objectSpread(_objectSpread({}, formikProps), {}, {
|
|
3416
3443
|
isDisabled: ramda.not(isEditable)
|
|
3417
3444
|
})) : children, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3418
3445
|
className: "neeto-ui-mt-4"
|
|
@@ -3440,7 +3467,8 @@ var Configure = function Configure(_ref) {
|
|
|
3440
3467
|
handleSubmit = _ref.handleSubmit,
|
|
3441
3468
|
isSubmitting = _ref.isSubmitting,
|
|
3442
3469
|
className = _ref.className,
|
|
3443
|
-
validationSchema = _ref.validationSchema
|
|
3470
|
+
validationSchema = _ref.validationSchema,
|
|
3471
|
+
channelRefreshHandler = _ref.channelRefreshHandler;
|
|
3444
3472
|
var _useTranslation = useTranslation(),
|
|
3445
3473
|
t = _useTranslation.t;
|
|
3446
3474
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -3471,13 +3499,17 @@ var Configure = function Configure(_ref) {
|
|
|
3471
3499
|
className: "neeto-ui-text-gray-700 neeto-ui-mb-3",
|
|
3472
3500
|
style: "body2",
|
|
3473
3501
|
weight: "normal"
|
|
3474
|
-
}, t("slack.configure.sendToDescription")), /*#__PURE__*/React__default["default"].createElement(
|
|
3502
|
+
}, t("slack.configure.sendToDescription")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3503
|
+
className: "relative flex"
|
|
3504
|
+
}, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
|
|
3475
3505
|
isSearchable: true,
|
|
3476
3506
|
name: "selectedChannel",
|
|
3477
3507
|
options: formikProps.values.channels,
|
|
3478
3508
|
placeholder: t("slack.placeholder"),
|
|
3479
3509
|
size: "large"
|
|
3480
|
-
})
|
|
3510
|
+
}), /*#__PURE__*/React__default["default"].createElement(SlackRefreshChannelListButton, {
|
|
3511
|
+
channelRefreshHandler: channelRefreshHandler
|
|
3512
|
+
}))), ramda.is(Function, children) ? children(formikProps) : children, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3481
3513
|
label: t("common.continue"),
|
|
3482
3514
|
loading: isSubmitting,
|
|
3483
3515
|
type: "submit"
|
|
@@ -3486,7 +3518,8 @@ var Configure = function Configure(_ref) {
|
|
|
3486
3518
|
};
|
|
3487
3519
|
|
|
3488
3520
|
var Connect = function Connect(_ref) {
|
|
3489
|
-
var handleRedirectToSlack = _ref.handleRedirectToSlack
|
|
3521
|
+
var handleRedirectToSlack = _ref.handleRedirectToSlack,
|
|
3522
|
+
isAuthorizeUrlFetching = _ref.isAuthorizeUrlFetching;
|
|
3490
3523
|
var _useTranslation = useTranslation(),
|
|
3491
3524
|
t = _useTranslation.t;
|
|
3492
3525
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -3503,6 +3536,7 @@ var Connect = function Connect(_ref) {
|
|
|
3503
3536
|
weight: "normal"
|
|
3504
3537
|
}, t("slack.connect.description")), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3505
3538
|
label: t("slack.connect.loginButton"),
|
|
3539
|
+
loading: isAuthorizeUrlFetching,
|
|
3506
3540
|
onClick: handleRedirectToSlack
|
|
3507
3541
|
}));
|
|
3508
3542
|
};
|