@bigbinary/neeto-slack-frontend 2.3.0-beta1 → 3.1.0
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/README.md +326 -279
- package/dist/index.cjs.js +304 -253
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +295 -251
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs.js
CHANGED
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var React = require('react');
|
|
6
5
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
7
6
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
8
7
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
9
8
|
var misc = require('@bigbinary/neeto-icons/misc');
|
|
10
|
-
var
|
|
9
|
+
var Typography = require('@bigbinary/neetoui/Typography');
|
|
10
|
+
var Button = require('@bigbinary/neetoui/Button');
|
|
11
11
|
var ramda = require('ramda');
|
|
12
12
|
var reactI18next = require('react-i18next');
|
|
13
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
14
|
var i18next = require('i18next');
|
|
15
|
+
var Toastr = require('@bigbinary/neetoui/Toastr');
|
|
14
16
|
var yup = require('yup');
|
|
15
|
-
var
|
|
17
|
+
var Pane = require('@bigbinary/neetoui/Pane');
|
|
18
|
+
var Label = require('@bigbinary/neetoui/Label');
|
|
19
|
+
var Select = require('@bigbinary/neetoui/formik/Select');
|
|
20
|
+
var NeetoUIForm = require('@bigbinary/neetoui/formik/Form');
|
|
21
|
+
var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
|
|
22
|
+
var React = require('react');
|
|
16
23
|
var classNames = require('classnames');
|
|
17
24
|
var reactQuery = require('@tanstack/react-query');
|
|
18
25
|
var axios = require('axios');
|
|
@@ -37,9 +44,16 @@ function _interopNamespace(e) {
|
|
|
37
44
|
return Object.freeze(n);
|
|
38
45
|
}
|
|
39
46
|
|
|
40
|
-
var
|
|
41
|
-
var
|
|
47
|
+
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
48
|
+
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
49
|
+
var Toastr__default = /*#__PURE__*/_interopDefaultLegacy(Toastr);
|
|
42
50
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
51
|
+
var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
|
|
52
|
+
var Label__default = /*#__PURE__*/_interopDefaultLegacy(Label);
|
|
53
|
+
var Select__default = /*#__PURE__*/_interopDefaultLegacy(Select);
|
|
54
|
+
var NeetoUIForm__default = /*#__PURE__*/_interopDefaultLegacy(NeetoUIForm);
|
|
55
|
+
var ActionBlock__default = /*#__PURE__*/_interopDefaultLegacy(ActionBlock);
|
|
56
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
43
57
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
44
58
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
45
59
|
|
|
@@ -48,17 +62,20 @@ var Field = function Field(_ref) {
|
|
|
48
62
|
value = _ref.value,
|
|
49
63
|
_ref$className = _ref.className,
|
|
50
64
|
className = _ref$className === void 0 ? "" : _ref$className;
|
|
51
|
-
return /*#__PURE__*/
|
|
52
|
-
className: "neeto-ui-mb-3 neeto-ui-w-full ".concat(className)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
65
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
66
|
+
className: "neeto-ui-mb-3 neeto-ui-w-full ".concat(className),
|
|
67
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
68
|
+
className: "neeto-ui-text-gray-800 neeto-ui-mb-1",
|
|
69
|
+
style: "h5",
|
|
70
|
+
weight: "semibold",
|
|
71
|
+
children: name
|
|
72
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
73
|
+
className: "neeto-ui-text-gray-700",
|
|
74
|
+
style: "body2",
|
|
75
|
+
weight: "normal",
|
|
76
|
+
children: value
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
62
79
|
};
|
|
63
80
|
|
|
64
81
|
function _typeof(o) {
|
|
@@ -111,43 +128,32 @@ var CHANNEL_NAME_VALIDAITON_SCHEMA = {
|
|
|
111
128
|
}).required().nullable()
|
|
112
129
|
};
|
|
113
130
|
|
|
114
|
-
function ownKeys$
|
|
115
|
-
function _objectSpread$
|
|
131
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
132
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
116
133
|
var buildValidationSchema = function buildValidationSchema(customValidationSchema) {
|
|
117
|
-
return yup__namespace.object().shape(_objectSpread$
|
|
134
|
+
return yup__namespace.object().shape(_objectSpread$3(_objectSpread$3({}, customValidationSchema), CHANNEL_NAME_VALIDAITON_SCHEMA));
|
|
118
135
|
};
|
|
119
136
|
var toSlackUrl = function toSlackUrl(teamName) {
|
|
120
137
|
return "https://".concat(teamName === null || teamName === void 0 ? void 0 : teamName.replace(/\s/g, "").toLowerCase(), ".slack.com");
|
|
121
138
|
};
|
|
122
139
|
var slackChannelRefresh = function slackChannelRefresh(channelRefreshHandler) {
|
|
123
140
|
channelRefreshHandler();
|
|
124
|
-
|
|
141
|
+
Toastr__default["default"].success(i18next.t("neetoSlack.slack.channelListRefreshToastr"));
|
|
125
142
|
};
|
|
126
143
|
|
|
127
|
-
function _extends$1() {
|
|
128
|
-
_extends$1 = Object.assign ? Object.assign.bind() : function (target) {
|
|
129
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
130
|
-
var source = arguments[i];
|
|
131
|
-
for (var key in source) {
|
|
132
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
133
|
-
target[key] = source[key];
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return target;
|
|
138
|
-
};
|
|
139
|
-
return _extends$1.apply(this, arguments);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
144
|
var ChannelSelectOption = function ChannelSelectOption(_ref) {
|
|
143
145
|
var label = _ref.label,
|
|
144
146
|
isPrivate = _ref.isPrivate;
|
|
145
|
-
return /*#__PURE__*/
|
|
146
|
-
className: "flex items-center justify-between"
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
148
|
+
className: "flex items-center justify-between",
|
|
149
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
150
|
+
children: label
|
|
151
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
152
|
+
className: "neeto-ui-text-gray-500 italic",
|
|
153
|
+
style: "body3",
|
|
154
|
+
children: isPrivate ? "private" : ""
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
151
157
|
};
|
|
152
158
|
|
|
153
159
|
var SlackRefreshChannelListButton = reactUtils.withT(function (_ref) {
|
|
@@ -155,21 +161,22 @@ var SlackRefreshChannelListButton = reactUtils.withT(function (_ref) {
|
|
|
155
161
|
channelRefreshHandler = _ref.channelRefreshHandler,
|
|
156
162
|
_ref$className = _ref.className,
|
|
157
163
|
className = _ref$className === void 0 ? "pl-1" : _ref$className;
|
|
158
|
-
return /*#__PURE__*/
|
|
159
|
-
className: "relative top-0 flex justify-center"
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
165
|
+
className: "relative top-0 flex justify-center",
|
|
166
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
167
|
+
className: className,
|
|
168
|
+
label: t("neetoSlack.slack.channelListRefreshButton"),
|
|
169
|
+
style: "link",
|
|
170
|
+
onClick: function onClick() {
|
|
171
|
+
return slackChannelRefresh(channelRefreshHandler);
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
});
|
|
168
175
|
});
|
|
169
|
-
var SlackRefreshChannelListButton$1 = /*#__PURE__*/
|
|
176
|
+
var SlackRefreshChannelListButton$1 = /*#__PURE__*/React.memo(SlackRefreshChannelListButton);
|
|
170
177
|
|
|
171
|
-
function ownKeys$
|
|
172
|
-
function _objectSpread$
|
|
178
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
179
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
173
180
|
var EditPane = function EditPane(_ref) {
|
|
174
181
|
var _ref$isPaneOpen = _ref.isPaneOpen,
|
|
175
182
|
isPaneOpen = _ref$isPaneOpen === void 0 ? false : _ref$isPaneOpen,
|
|
@@ -177,7 +184,7 @@ var EditPane = function EditPane(_ref) {
|
|
|
177
184
|
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
178
185
|
_ref$title = _ref.title,
|
|
179
186
|
title = _ref$title === void 0 ? "" : _ref$title,
|
|
180
|
-
|
|
187
|
+
_children = _ref.children,
|
|
181
188
|
_ref$initialFormValue = _ref.initialFormValues,
|
|
182
189
|
initialFormValues = _ref$initialFormValue === void 0 ? {} : _ref$initialFormValue,
|
|
183
190
|
_ref$handleSubmit = _ref.handleSubmit,
|
|
@@ -195,58 +202,77 @@ var EditPane = function EditPane(_ref) {
|
|
|
195
202
|
var handleFormSubmit = function handleFormSubmit(values, formikBag) {
|
|
196
203
|
handleSubmit(values, formikBag);
|
|
197
204
|
};
|
|
198
|
-
return /*#__PURE__*/
|
|
205
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"], _objectSpread$2(_objectSpread$2({
|
|
199
206
|
onClose: onClose,
|
|
200
207
|
isOpen: isPaneOpen
|
|
201
|
-
}, paneProps),
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
enableReinitialize: true,
|
|
208
|
-
initialValues: initialFormValues,
|
|
209
|
-
onSubmit: handleFormSubmit,
|
|
210
|
-
validationSchema: buildValidationSchema(validationSchema)
|
|
211
|
-
}
|
|
212
|
-
}, function (formikProps) {
|
|
213
|
-
var _formikProps$errors;
|
|
214
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
215
|
-
className: "neeto-ui-mb-4 neeto-ui-w-full"
|
|
216
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Label, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
217
|
-
className: "neeto-ui-text-gray-700 neeto-ui-mb-2",
|
|
218
|
-
style: "body2",
|
|
219
|
-
weight: "bold"
|
|
220
|
-
}, t("neetoSlack.slack.configure.sendToDescription"), /*#__PURE__*/React__default["default"].createElement("sup", null, "*"))), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
221
|
-
className: "relative flex flex-col items-start gap-y-3"
|
|
222
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
|
|
223
|
-
isSearchable: true,
|
|
224
|
-
required: true,
|
|
225
|
-
className: "w-full",
|
|
226
|
-
error: formikProps === null || formikProps === void 0 || (_formikProps$errors = formikProps.errors) === null || _formikProps$errors === void 0 ? void 0 : _formikProps$errors.selectedChannel,
|
|
227
|
-
name: "selectedChannel",
|
|
228
|
-
placeholder: t("neetoSlack.slack.placeholder"),
|
|
229
|
-
size: "large",
|
|
230
|
-
options: formikProps.values.channels.map(function (_ref2) {
|
|
231
|
-
var label = _ref2.label,
|
|
232
|
-
value = _ref2.value,
|
|
233
|
-
isPrivate = _ref2.isPrivate;
|
|
234
|
-
return {
|
|
235
|
-
label: /*#__PURE__*/React__default["default"].createElement(ChannelSelectOption, {
|
|
236
|
-
isPrivate: isPrivate,
|
|
237
|
-
label: label
|
|
238
|
-
}),
|
|
239
|
-
value: value
|
|
240
|
-
};
|
|
208
|
+
}, paneProps), {}, {
|
|
209
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Header, {
|
|
210
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
211
|
+
style: "h2",
|
|
212
|
+
weight: "semibold",
|
|
213
|
+
children: ramda.isEmpty(title) ? t("neetoSlack.slack.editPane") : title
|
|
241
214
|
})
|
|
242
|
-
}), /*#__PURE__*/
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
215
|
+
}), /*#__PURE__*/jsxRuntime.jsx(NeetoUIForm__default["default"], {
|
|
216
|
+
className: "neeto-ui-w-full",
|
|
217
|
+
formikProps: {
|
|
218
|
+
enableReinitialize: true,
|
|
219
|
+
initialValues: initialFormValues,
|
|
220
|
+
onSubmit: handleFormSubmit,
|
|
221
|
+
validationSchema: buildValidationSchema(validationSchema)
|
|
247
222
|
},
|
|
248
|
-
|
|
249
|
-
|
|
223
|
+
children: function children(formikProps) {
|
|
224
|
+
var _formikProps$errors;
|
|
225
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
226
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"].Body, {
|
|
227
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
228
|
+
className: "neeto-ui-mb-4 neeto-ui-w-full",
|
|
229
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Label__default["default"], {
|
|
230
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(Typography__default["default"], {
|
|
231
|
+
className: "neeto-ui-text-gray-700 neeto-ui-mb-2",
|
|
232
|
+
style: "body2",
|
|
233
|
+
weight: "bold",
|
|
234
|
+
children: [t("neetoSlack.slack.configure.sendToDescription"), /*#__PURE__*/jsxRuntime.jsx("sup", {
|
|
235
|
+
children: "*"
|
|
236
|
+
})]
|
|
237
|
+
})
|
|
238
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
239
|
+
className: "relative flex flex-col items-start gap-y-3",
|
|
240
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
241
|
+
isSearchable: true,
|
|
242
|
+
required: true,
|
|
243
|
+
className: "w-full",
|
|
244
|
+
error: formikProps === null || formikProps === void 0 || (_formikProps$errors = formikProps.errors) === null || _formikProps$errors === void 0 ? void 0 : _formikProps$errors.selectedChannel,
|
|
245
|
+
name: "selectedChannel",
|
|
246
|
+
placeholder: t("neetoSlack.slack.placeholder"),
|
|
247
|
+
size: "large",
|
|
248
|
+
options: formikProps.values.channels.map(function (_ref2) {
|
|
249
|
+
var label = _ref2.label,
|
|
250
|
+
value = _ref2.value,
|
|
251
|
+
isPrivate = _ref2.isPrivate;
|
|
252
|
+
return {
|
|
253
|
+
label: /*#__PURE__*/jsxRuntime.jsx(ChannelSelectOption, {
|
|
254
|
+
isPrivate: isPrivate,
|
|
255
|
+
label: label
|
|
256
|
+
}),
|
|
257
|
+
value: value
|
|
258
|
+
};
|
|
259
|
+
})
|
|
260
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SlackRefreshChannelListButton$1, {
|
|
261
|
+
channelRefreshHandler: channelRefreshHandler
|
|
262
|
+
})]
|
|
263
|
+
})]
|
|
264
|
+
}), ramda.is(Function, _children) ? _children(_objectSpread$2({}, formikProps)) : _children]
|
|
265
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Pane__default["default"].Footer, {
|
|
266
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionBlock__default["default"], {
|
|
267
|
+
cancelButtonProps: {
|
|
268
|
+
onClick: onClose
|
|
269
|
+
},
|
|
270
|
+
isSubmitting: isSubmitting || formikProps.isSubmitting
|
|
271
|
+
})
|
|
272
|
+
})]
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
})]
|
|
250
276
|
}));
|
|
251
277
|
};
|
|
252
278
|
|
|
@@ -261,51 +287,57 @@ var Settings = reactUtils.withT(function (_ref) {
|
|
|
261
287
|
fields = _ref$fields === void 0 ? [] : _ref$fields,
|
|
262
288
|
_ref$onEdit = _ref.onEdit,
|
|
263
289
|
onEdit = _ref$onEdit === void 0 ? neetoCist.noop : _ref$onEdit;
|
|
264
|
-
return /*#__PURE__*/
|
|
265
|
-
className: "mx-auto w-full max-w-3xl"
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
290
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
291
|
+
className: "mx-auto w-full max-w-3xl",
|
|
292
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
293
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full border p-6",
|
|
294
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
295
|
+
className: "space-y-4",
|
|
296
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(misc.Slack, {
|
|
297
|
+
className: "neeto-ui-text-gray-600",
|
|
298
|
+
size: 48
|
|
299
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
300
|
+
className: "flex items-center space-x-4",
|
|
301
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
302
|
+
style: "h2",
|
|
303
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
304
|
+
i18nKey: "neetoSlack.slack.settings.title",
|
|
305
|
+
values: {
|
|
306
|
+
teamName: teamName
|
|
307
|
+
},
|
|
308
|
+
components: {
|
|
309
|
+
a: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
310
|
+
className: "neeto-ui-text-2xl",
|
|
311
|
+
href: ramda.isEmpty(slackUrl) ? toSlackUrl(teamName) : slackUrl,
|
|
312
|
+
style: "link"
|
|
313
|
+
})
|
|
314
|
+
}
|
|
315
|
+
})
|
|
316
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
317
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1",
|
|
318
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoIcons.Check, {
|
|
319
|
+
size: 24
|
|
320
|
+
})
|
|
321
|
+
})]
|
|
322
|
+
}), fields.map(function (field) {
|
|
323
|
+
return /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
324
|
+
name: field.name,
|
|
325
|
+
value: field.value
|
|
326
|
+
}, field.name);
|
|
327
|
+
}), children]
|
|
328
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
329
|
+
className: "mt-8",
|
|
330
|
+
label: t("neetoSlack.common.edit"),
|
|
331
|
+
onClick: onEdit
|
|
332
|
+
})]
|
|
333
|
+
})
|
|
334
|
+
});
|
|
303
335
|
});
|
|
304
336
|
Settings.EditPane = EditPane;
|
|
305
337
|
|
|
306
338
|
var Configure = reactUtils.withT(function (_ref) {
|
|
307
339
|
var t = _ref.t,
|
|
308
|
-
|
|
340
|
+
_children = _ref.children,
|
|
309
341
|
teamName = _ref.teamName,
|
|
310
342
|
_ref$slackUrl = _ref.slackUrl,
|
|
311
343
|
slackUrl = _ref$slackUrl === void 0 ? "" : _ref$slackUrl,
|
|
@@ -317,92 +349,107 @@ var Configure = reactUtils.withT(function (_ref) {
|
|
|
317
349
|
channelRefreshHandler = _ref.channelRefreshHandler,
|
|
318
350
|
_ref$channelSelectLab = _ref.channelSelectLabel,
|
|
319
351
|
channelSelectLabel = _ref$channelSelectLab === void 0 ? "" : _ref$channelSelectLab;
|
|
320
|
-
return /*#__PURE__*/
|
|
321
|
-
className: classNames__default["default"]("neeto-ui-w-full neeto-ui-space-y-6 mx-auto max-w-lg", className)
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
formikProps: {
|
|
340
|
-
enableReinitialize: true,
|
|
341
|
-
initialValues: initialFormValues,
|
|
342
|
-
onSubmit: handleSubmit,
|
|
343
|
-
validationSchema: buildValidationSchema(validationSchema)
|
|
344
|
-
}
|
|
345
|
-
}, function (formikProps) {
|
|
346
|
-
var _formikProps$errors;
|
|
347
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
348
|
-
className: "neeto-ui-mb-4 neeto-ui-w-full"
|
|
349
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
350
|
-
className: "neeto-ui-text-gray-700 neeto-ui-mb-3",
|
|
351
|
-
style: "body2",
|
|
352
|
-
weight: "normal"
|
|
353
|
-
}, ramda.isEmpty(channelSelectLabel) ? t("neetoSlack.slack.configure.sendToDescription") : channelSelectLabel, /*#__PURE__*/React__default["default"].createElement("sup", null, "*")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
354
|
-
className: "relative flex flex-col items-start gap-y-3"
|
|
355
|
-
}, /*#__PURE__*/React__default["default"].createElement(formik.Select, {
|
|
356
|
-
isSearchable: true,
|
|
357
|
-
required: true,
|
|
358
|
-
className: "w-full",
|
|
359
|
-
error: formikProps === null || formikProps === void 0 || (_formikProps$errors = formikProps.errors) === null || _formikProps$errors === void 0 ? void 0 : _formikProps$errors.selectedChannel,
|
|
360
|
-
name: "selectedChannel",
|
|
361
|
-
placeholder: t("neetoSlack.slack.placeholder"),
|
|
362
|
-
size: "large",
|
|
363
|
-
options: formikProps.values.channels.map(function (_ref2) {
|
|
364
|
-
var label = _ref2.label,
|
|
365
|
-
value = _ref2.value,
|
|
366
|
-
isPrivate = _ref2.isPrivate;
|
|
367
|
-
return {
|
|
368
|
-
label: /*#__PURE__*/React__default["default"].createElement(ChannelSelectOption, {
|
|
369
|
-
isPrivate: isPrivate,
|
|
370
|
-
label: label
|
|
371
|
-
}),
|
|
372
|
-
value: value
|
|
373
|
-
};
|
|
352
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
353
|
+
className: classNames__default["default"]("neeto-ui-w-full neeto-ui-space-y-6 mx-auto max-w-lg", className),
|
|
354
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
355
|
+
className: "neeto-ui-mb-6 neeto-ui-w-full",
|
|
356
|
+
children: /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
357
|
+
style: "h3",
|
|
358
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
359
|
+
i18nKey: "neetoSlack.slack.configure.title",
|
|
360
|
+
values: {
|
|
361
|
+
teamName: teamName
|
|
362
|
+
},
|
|
363
|
+
components: {
|
|
364
|
+
a: /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
365
|
+
className: "neeto-ui-text-xl",
|
|
366
|
+
href: ramda.isEmpty(slackUrl) ? toSlackUrl(teamName) : slackUrl,
|
|
367
|
+
style: "link"
|
|
368
|
+
})
|
|
369
|
+
}
|
|
370
|
+
})
|
|
374
371
|
})
|
|
375
|
-
}), /*#__PURE__*/
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
372
|
+
}), /*#__PURE__*/jsxRuntime.jsx(NeetoUIForm__default["default"], {
|
|
373
|
+
className: "neeto-ui-w-full max-w-md",
|
|
374
|
+
formikProps: {
|
|
375
|
+
enableReinitialize: true,
|
|
376
|
+
initialValues: initialFormValues,
|
|
377
|
+
onSubmit: handleSubmit,
|
|
378
|
+
validationSchema: buildValidationSchema(validationSchema)
|
|
379
|
+
},
|
|
380
|
+
children: function children(formikProps) {
|
|
381
|
+
var _formikProps$errors;
|
|
382
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
383
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
384
|
+
className: "neeto-ui-mb-4 neeto-ui-w-full",
|
|
385
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(Typography__default["default"], {
|
|
386
|
+
className: "neeto-ui-text-gray-700 neeto-ui-mb-3",
|
|
387
|
+
style: "body2",
|
|
388
|
+
weight: "normal",
|
|
389
|
+
children: [ramda.isEmpty(channelSelectLabel) ? t("neetoSlack.slack.configure.sendToDescription") : channelSelectLabel, /*#__PURE__*/jsxRuntime.jsx("sup", {
|
|
390
|
+
children: "*"
|
|
391
|
+
})]
|
|
392
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
393
|
+
className: "relative flex flex-col items-start gap-y-3",
|
|
394
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Select__default["default"], {
|
|
395
|
+
isSearchable: true,
|
|
396
|
+
required: true,
|
|
397
|
+
className: "w-full",
|
|
398
|
+
error: formikProps === null || formikProps === void 0 || (_formikProps$errors = formikProps.errors) === null || _formikProps$errors === void 0 ? void 0 : _formikProps$errors.selectedChannel,
|
|
399
|
+
name: "selectedChannel",
|
|
400
|
+
placeholder: t("neetoSlack.slack.placeholder"),
|
|
401
|
+
size: "large",
|
|
402
|
+
options: formikProps.values.channels.map(function (_ref2) {
|
|
403
|
+
var label = _ref2.label,
|
|
404
|
+
value = _ref2.value,
|
|
405
|
+
isPrivate = _ref2.isPrivate;
|
|
406
|
+
return {
|
|
407
|
+
label: /*#__PURE__*/jsxRuntime.jsx(ChannelSelectOption, {
|
|
408
|
+
isPrivate: isPrivate,
|
|
409
|
+
label: label
|
|
410
|
+
}),
|
|
411
|
+
value: value
|
|
412
|
+
};
|
|
413
|
+
})
|
|
414
|
+
}), /*#__PURE__*/jsxRuntime.jsx(SlackRefreshChannelListButton$1, {
|
|
415
|
+
channelRefreshHandler: channelRefreshHandler
|
|
416
|
+
})]
|
|
417
|
+
})]
|
|
418
|
+
}), ramda.is(Function, _children) ? _children(formikProps) : _children, /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
419
|
+
label: t("neetoSlack.common.continue"),
|
|
420
|
+
loading: isSubmitting,
|
|
421
|
+
type: "submit"
|
|
422
|
+
})]
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
})]
|
|
426
|
+
});
|
|
383
427
|
});
|
|
384
428
|
|
|
385
429
|
var Connect = reactUtils.withT(function (_ref) {
|
|
386
430
|
var t = _ref.t,
|
|
387
431
|
handleRedirectToSlack = _ref.handleRedirectToSlack,
|
|
388
432
|
isAuthorizeUrlFetching = _ref.isAuthorizeUrlFetching;
|
|
389
|
-
return /*#__PURE__*/
|
|
390
|
-
className: "neeto-ui-w-full mx-auto max-w-lg"
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
433
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
434
|
+
className: "neeto-ui-w-full mx-auto max-w-lg",
|
|
435
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(misc.Slack, {
|
|
436
|
+
size: 32
|
|
437
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
438
|
+
className: "neeto-ui-text-gray-800 neeto-ui-mb-0.5 neeto-ui-mt-6",
|
|
439
|
+
style: "h2",
|
|
440
|
+
weight: "semibold",
|
|
441
|
+
children: t("neetoSlack.slack.connect.title")
|
|
442
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
443
|
+
className: "neeto-ui-text-gray-700 neeto-ui-mb-4",
|
|
444
|
+
style: "body1",
|
|
445
|
+
weight: "normal",
|
|
446
|
+
children: t("neetoSlack.slack.connect.description")
|
|
447
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], {
|
|
448
|
+
label: t("neetoSlack.slack.connect.loginButton"),
|
|
449
|
+
loading: isAuthorizeUrlFetching,
|
|
450
|
+
onClick: handleRedirectToSlack
|
|
451
|
+
})]
|
|
452
|
+
});
|
|
406
453
|
});
|
|
407
454
|
|
|
408
455
|
var _path, _defs;
|
|
@@ -431,6 +478,8 @@ const SvgSuccess = props => /*#__PURE__*/React__namespace.createElement("svg", _
|
|
|
431
478
|
height: 344
|
|
432
479
|
}))));
|
|
433
480
|
|
|
481
|
+
function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
482
|
+
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
434
483
|
var Finish = reactUtils.withT(function (_ref) {
|
|
435
484
|
var t = _ref.t,
|
|
436
485
|
children = _ref.children,
|
|
@@ -446,38 +495,40 @@ var Finish = reactUtils.withT(function (_ref) {
|
|
|
446
495
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
|
|
447
496
|
_ref$secondaryButtonP = _ref.secondaryButtonProps,
|
|
448
497
|
secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP;
|
|
449
|
-
return /*#__PURE__*/
|
|
450
|
-
className: "neeto-ui-w-full mx-auto max-w-lg"
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
})), neetoCist.isNotEmpty(fields) && fields.map(function (field, index) {
|
|
461
|
-
return /*#__PURE__*/React__default["default"].createElement(Field, {
|
|
462
|
-
key: field.name,
|
|
463
|
-
name: field.name,
|
|
464
|
-
value: field.value,
|
|
465
|
-
className: classNames__default["default"]("neeto-ui-pt-3 neeto-ui-border-gray-300", {
|
|
466
|
-
"border-t": index !== 0
|
|
498
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
499
|
+
className: "neeto-ui-w-full mx-auto max-w-lg",
|
|
500
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(SvgSuccess, {}), /*#__PURE__*/jsxRuntime.jsx(Typography__default["default"], {
|
|
501
|
+
className: "neeto-ui-text-gray-800 neeto-ui-mb-6 neeto-ui-mt-4",
|
|
502
|
+
style: "h3",
|
|
503
|
+
weight: "bold",
|
|
504
|
+
children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
|
|
505
|
+
i18nKey: "neetoSlack.slack.finish.title",
|
|
506
|
+
values: {
|
|
507
|
+
teamName: teamName
|
|
508
|
+
}
|
|
467
509
|
})
|
|
468
|
-
})
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
510
|
+
}), neetoCist.isNotEmpty(fields) && fields.map(function (field, index) {
|
|
511
|
+
return /*#__PURE__*/jsxRuntime.jsx(Field, {
|
|
512
|
+
name: field.name,
|
|
513
|
+
value: field.value,
|
|
514
|
+
className: classNames__default["default"]("neeto-ui-pt-3 neeto-ui-border-gray-300", {
|
|
515
|
+
"border-t": index !== 0
|
|
516
|
+
})
|
|
517
|
+
}, field.name);
|
|
518
|
+
}), children, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
519
|
+
className: "neeto-ui-flex neeto-ui-w-full neeto-ui-flex-row neeto-ui-mt-6",
|
|
520
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$1({
|
|
521
|
+
className: "neeto-ui-my-1",
|
|
522
|
+
label: t("neetoSlack.common.done"),
|
|
523
|
+
onClick: onSuccess
|
|
524
|
+
}, buttonProps)), neetoCist.isNotEmpty(secondaryButtonProps) && /*#__PURE__*/jsxRuntime.jsx(Button__default["default"], _objectSpread$1({
|
|
525
|
+
className: "neeto-ui-my-1 neeto-ui-ml-2",
|
|
526
|
+
label: t("neetoSlack.common.edit"),
|
|
527
|
+
style: "secondary",
|
|
528
|
+
onClick: onBack
|
|
529
|
+
}, secondaryButtonProps))]
|
|
530
|
+
})]
|
|
531
|
+
});
|
|
481
532
|
});
|
|
482
533
|
|
|
483
534
|
function _objectWithoutPropertiesLoose(source, excluded) {
|