@bigbinary/neeto-slack-frontend 2.1.3 → 2.1.5
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 +125 -49
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +124 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +10 -0
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ import * as yup from 'yup';
|
|
|
7
7
|
import { Form, Select } from '@bigbinary/neetoui/formik';
|
|
8
8
|
import { isEmpty, is } from 'ramda';
|
|
9
9
|
import { Slack } from '@bigbinary/neeto-icons/misc';
|
|
10
|
+
import { useQuery } from 'react-query';
|
|
11
|
+
import axios from 'axios';
|
|
10
12
|
|
|
11
13
|
function _typeof$2(obj) {
|
|
12
14
|
"@babel/helpers - typeof";
|
|
@@ -152,7 +154,7 @@ function _toArray(arr) {
|
|
|
152
154
|
return _arrayWithHoles$1(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableRest$1();
|
|
153
155
|
}
|
|
154
156
|
|
|
155
|
-
function ownKeys$
|
|
157
|
+
function ownKeys$6(object, enumerableOnly) {
|
|
156
158
|
var keys = Object.keys(object);
|
|
157
159
|
if (Object.getOwnPropertySymbols) {
|
|
158
160
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -165,17 +167,17 @@ function ownKeys$5(object, enumerableOnly) {
|
|
|
165
167
|
}
|
|
166
168
|
return keys;
|
|
167
169
|
}
|
|
168
|
-
function _objectSpread$
|
|
170
|
+
function _objectSpread$6(target) {
|
|
169
171
|
for (var i = 1; i < arguments.length; i++) {
|
|
170
172
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
171
173
|
if (i % 2) {
|
|
172
|
-
ownKeys$
|
|
174
|
+
ownKeys$6(Object(source), true).forEach(function (key) {
|
|
173
175
|
_defineProperty$2(target, key, source[key]);
|
|
174
176
|
});
|
|
175
177
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
176
178
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
177
179
|
} else {
|
|
178
|
-
ownKeys$
|
|
180
|
+
ownKeys$6(Object(source)).forEach(function (key) {
|
|
179
181
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
180
182
|
});
|
|
181
183
|
}
|
|
@@ -259,7 +261,7 @@ var Logger = function () {
|
|
|
259
261
|
}, {
|
|
260
262
|
key: "create",
|
|
261
263
|
value: function create(moduleName) {
|
|
262
|
-
return new Logger(this.logger, _objectSpread$
|
|
264
|
+
return new Logger(this.logger, _objectSpread$6(_objectSpread$6({}, {
|
|
263
265
|
prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
|
|
264
266
|
}), this.options));
|
|
265
267
|
}
|
|
@@ -2214,7 +2216,7 @@ function transformOptions(options) {
|
|
|
2214
2216
|
}
|
|
2215
2217
|
return options;
|
|
2216
2218
|
}
|
|
2217
|
-
function ownKeys$6(object, enumerableOnly) {
|
|
2219
|
+
function ownKeys$6$1(object, enumerableOnly) {
|
|
2218
2220
|
var keys = Object.keys(object);
|
|
2219
2221
|
if (Object.getOwnPropertySymbols) {
|
|
2220
2222
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2227,17 +2229,17 @@ function ownKeys$6(object, enumerableOnly) {
|
|
|
2227
2229
|
}
|
|
2228
2230
|
return keys;
|
|
2229
2231
|
}
|
|
2230
|
-
function _objectSpread$6(target) {
|
|
2232
|
+
function _objectSpread$6$1(target) {
|
|
2231
2233
|
for (var i = 1; i < arguments.length; i++) {
|
|
2232
2234
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2233
2235
|
if (i % 2) {
|
|
2234
|
-
ownKeys$6(Object(source), true).forEach(function (key) {
|
|
2236
|
+
ownKeys$6$1(Object(source), true).forEach(function (key) {
|
|
2235
2237
|
_defineProperty$2(target, key, source[key]);
|
|
2236
2238
|
});
|
|
2237
2239
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
2238
2240
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2239
2241
|
} else {
|
|
2240
|
-
ownKeys$6(Object(source)).forEach(function (key) {
|
|
2242
|
+
ownKeys$6$1(Object(source)).forEach(function (key) {
|
|
2241
2243
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2242
2244
|
});
|
|
2243
2245
|
}
|
|
@@ -2326,9 +2328,9 @@ var I18n = function (_EventEmitter) {
|
|
|
2326
2328
|
}
|
|
2327
2329
|
}
|
|
2328
2330
|
var defOpts = get();
|
|
2329
|
-
this.options = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, defOpts), this.options), transformOptions(options));
|
|
2331
|
+
this.options = _objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({}, defOpts), this.options), transformOptions(options));
|
|
2330
2332
|
if (this.options.compatibilityAPI !== 'v1') {
|
|
2331
|
-
this.options.interpolation = _objectSpread$6(_objectSpread$6({}, defOpts.interpolation), this.options.interpolation);
|
|
2333
|
+
this.options.interpolation = _objectSpread$6$1(_objectSpread$6$1({}, defOpts.interpolation), this.options.interpolation);
|
|
2332
2334
|
}
|
|
2333
2335
|
if (options.keySeparator !== undefined) {
|
|
2334
2336
|
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
@@ -2602,7 +2604,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2602
2604
|
}
|
|
2603
2605
|
options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2604
2606
|
} else {
|
|
2605
|
-
options = _objectSpread$6({}, opts);
|
|
2607
|
+
options = _objectSpread$6$1({}, opts);
|
|
2606
2608
|
}
|
|
2607
2609
|
options.lng = options.lng || fixedT.lng;
|
|
2608
2610
|
options.lngs = options.lngs || fixedT.lngs;
|
|
@@ -2720,7 +2722,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2720
2722
|
var _this8 = this;
|
|
2721
2723
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2722
2724
|
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2723
|
-
var mergedOptions = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, this.options), options), {
|
|
2725
|
+
var mergedOptions = _objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({}, this.options), options), {
|
|
2724
2726
|
isClone: true
|
|
2725
2727
|
});
|
|
2726
2728
|
var clone = new I18n(mergedOptions);
|
|
@@ -2728,7 +2730,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2728
2730
|
membersToCopy.forEach(function (m) {
|
|
2729
2731
|
clone[m] = _this8[m];
|
|
2730
2732
|
});
|
|
2731
|
-
clone.services = _objectSpread$6({}, this.services);
|
|
2733
|
+
clone.services = _objectSpread$6$1({}, this.services);
|
|
2732
2734
|
clone.services.utils = {
|
|
2733
2735
|
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2734
2736
|
};
|
|
@@ -2781,7 +2783,7 @@ instance.hasLoadedNamespace;
|
|
|
2781
2783
|
instance.loadNamespaces;
|
|
2782
2784
|
instance.loadLanguages;
|
|
2783
2785
|
|
|
2784
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2786
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
2785
2787
|
if (source == null) return {};
|
|
2786
2788
|
var target = {};
|
|
2787
2789
|
var sourceKeys = Object.keys(source);
|
|
@@ -2794,9 +2796,9 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
2794
2796
|
return target;
|
|
2795
2797
|
}
|
|
2796
2798
|
|
|
2797
|
-
function _objectWithoutProperties(source, excluded) {
|
|
2799
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
2798
2800
|
if (source == null) return {};
|
|
2799
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
2801
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
2800
2802
|
var key, i;
|
|
2801
2803
|
if (Object.getOwnPropertySymbols) {
|
|
2802
2804
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3030,7 +3032,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
3030
3032
|
return Constructor;
|
|
3031
3033
|
}
|
|
3032
3034
|
|
|
3033
|
-
function ownKeys$
|
|
3035
|
+
function ownKeys$5(object, enumerableOnly) {
|
|
3034
3036
|
var keys = Object.keys(object);
|
|
3035
3037
|
if (Object.getOwnPropertySymbols) {
|
|
3036
3038
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3043,17 +3045,17 @@ function ownKeys$4(object, enumerableOnly) {
|
|
|
3043
3045
|
}
|
|
3044
3046
|
return keys;
|
|
3045
3047
|
}
|
|
3046
|
-
function _objectSpread$
|
|
3048
|
+
function _objectSpread$5(target) {
|
|
3047
3049
|
for (var i = 1; i < arguments.length; i++) {
|
|
3048
3050
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3049
3051
|
if (i % 2) {
|
|
3050
|
-
ownKeys$
|
|
3052
|
+
ownKeys$5(Object(source), true).forEach(function (key) {
|
|
3051
3053
|
_defineProperty$1(target, key, source[key]);
|
|
3052
3054
|
});
|
|
3053
3055
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
3054
3056
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3055
3057
|
} else {
|
|
3056
|
-
ownKeys$
|
|
3058
|
+
ownKeys$5(Object(source)).forEach(function (key) {
|
|
3057
3059
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3058
3060
|
});
|
|
3059
3061
|
}
|
|
@@ -3073,7 +3075,7 @@ var i18nInstance;
|
|
|
3073
3075
|
var I18nContext = /*#__PURE__*/React__default.createContext();
|
|
3074
3076
|
function setDefaults() {
|
|
3075
3077
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3076
|
-
defaultOptions = _objectSpread$
|
|
3078
|
+
defaultOptions = _objectSpread$5(_objectSpread$5({}, defaultOptions), options);
|
|
3077
3079
|
}
|
|
3078
3080
|
function getDefaults() {
|
|
3079
3081
|
return defaultOptions;
|
|
@@ -3180,9 +3182,9 @@ function hasLoadedNamespace(ns, i18n) {
|
|
|
3180
3182
|
});
|
|
3181
3183
|
}
|
|
3182
3184
|
|
|
3183
|
-
var _excluded = ["format"],
|
|
3185
|
+
var _excluded$1 = ["format"],
|
|
3184
3186
|
_excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
|
|
3185
|
-
function ownKeys$
|
|
3187
|
+
function ownKeys$4(object, enumerableOnly) {
|
|
3186
3188
|
var keys = Object.keys(object);
|
|
3187
3189
|
if (Object.getOwnPropertySymbols) {
|
|
3188
3190
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3195,17 +3197,17 @@ function ownKeys$3(object, enumerableOnly) {
|
|
|
3195
3197
|
}
|
|
3196
3198
|
return keys;
|
|
3197
3199
|
}
|
|
3198
|
-
function _objectSpread$
|
|
3200
|
+
function _objectSpread$4(target) {
|
|
3199
3201
|
for (var i = 1; i < arguments.length; i++) {
|
|
3200
3202
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3201
3203
|
if (i % 2) {
|
|
3202
|
-
ownKeys$
|
|
3204
|
+
ownKeys$4(Object(source), true).forEach(function (key) {
|
|
3203
3205
|
_defineProperty$1(target, key, source[key]);
|
|
3204
3206
|
});
|
|
3205
3207
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
3206
3208
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3207
3209
|
} else {
|
|
3208
|
-
ownKeys$
|
|
3210
|
+
ownKeys$4(Object(source)).forEach(function (key) {
|
|
3209
3211
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3210
3212
|
});
|
|
3211
3213
|
}
|
|
@@ -3232,7 +3234,7 @@ function getAsArray(data) {
|
|
|
3232
3234
|
return Array.isArray(data) ? data : [data];
|
|
3233
3235
|
}
|
|
3234
3236
|
function mergeProps(source, target) {
|
|
3235
|
-
var newTarget = _objectSpread$
|
|
3237
|
+
var newTarget = _objectSpread$4({}, target);
|
|
3236
3238
|
newTarget.props = Object.assign(source.props, target.props);
|
|
3237
3239
|
return newTarget;
|
|
3238
3240
|
}
|
|
@@ -3264,7 +3266,7 @@ function nodesToString(children, i18nOptions) {
|
|
|
3264
3266
|
warn("Trans: the passed in value is invalid - seems you passed in a null child.");
|
|
3265
3267
|
} else if (_typeof$1(child) === 'object') {
|
|
3266
3268
|
var format = child.format,
|
|
3267
|
-
clone = _objectWithoutProperties(child, _excluded);
|
|
3269
|
+
clone = _objectWithoutProperties$1(child, _excluded$1);
|
|
3268
3270
|
var keys = Object.keys(clone);
|
|
3269
3271
|
if (keys.length === 1) {
|
|
3270
3272
|
var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
|
|
@@ -3293,7 +3295,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3293
3295
|
}
|
|
3294
3296
|
getData(children);
|
|
3295
3297
|
var ast = c.parse("<0>".concat(targetString, "</0>"));
|
|
3296
|
-
var opts = _objectSpread$
|
|
3298
|
+
var opts = _objectSpread$4(_objectSpread$4({}, data), combinedTOpts);
|
|
3297
3299
|
function renderInner(child, node, rootReactNode) {
|
|
3298
3300
|
var childs = getChildren(child);
|
|
3299
3301
|
var mappedChildren = mapAST(childs, node.children, rootReactNode);
|
|
@@ -3301,7 +3303,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3301
3303
|
}
|
|
3302
3304
|
function pushTranslatedJSX(child, inner, mem, i, isVoid) {
|
|
3303
3305
|
if (child.dummy) child.children = inner;
|
|
3304
|
-
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$
|
|
3306
|
+
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3305
3307
|
key: i
|
|
3306
3308
|
}), isVoid ? undefined : inner));
|
|
3307
3309
|
}
|
|
@@ -3329,7 +3331,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3329
3331
|
pushTranslatedJSX(child, inner, mem, i);
|
|
3330
3332
|
} else if (isEmptyTransWithHTML) {
|
|
3331
3333
|
var _inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
3332
|
-
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$
|
|
3334
|
+
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3333
3335
|
key: i
|
|
3334
3336
|
}), _inner));
|
|
3335
3337
|
} else if (Number.isNaN(parseFloat(node.name))) {
|
|
@@ -3357,11 +3359,11 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3357
3359
|
var content = node.children[0] ? translationContent : null;
|
|
3358
3360
|
if (content) mem.push(content);
|
|
3359
3361
|
} else if (node.children.length === 1 && translationContent) {
|
|
3360
|
-
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$
|
|
3362
|
+
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3361
3363
|
key: i
|
|
3362
3364
|
}), translationContent));
|
|
3363
3365
|
} else {
|
|
3364
|
-
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$
|
|
3366
|
+
mem.push( /*#__PURE__*/React__default.cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3365
3367
|
key: i
|
|
3366
3368
|
})));
|
|
3367
3369
|
}
|
|
@@ -3400,7 +3402,7 @@ function Trans(_ref) {
|
|
|
3400
3402
|
i18nFromProps = _ref.i18n,
|
|
3401
3403
|
tFromProps = _ref.t,
|
|
3402
3404
|
shouldUnescape = _ref.shouldUnescape,
|
|
3403
|
-
additionalProps = _objectWithoutProperties(_ref, _excluded2);
|
|
3405
|
+
additionalProps = _objectWithoutProperties$1(_ref, _excluded2);
|
|
3404
3406
|
var _ref2 = useContext(I18nContext) || {},
|
|
3405
3407
|
i18nFromContext = _ref2.i18n,
|
|
3406
3408
|
defaultNSFromContext = _ref2.defaultNS;
|
|
@@ -3413,19 +3415,19 @@ function Trans(_ref) {
|
|
|
3413
3415
|
return k;
|
|
3414
3416
|
};
|
|
3415
3417
|
if (context) tOptions.context = context;
|
|
3416
|
-
var reactI18nextOptions = _objectSpread$
|
|
3418
|
+
var reactI18nextOptions = _objectSpread$4(_objectSpread$4({}, getDefaults()), i18n.options && i18n.options.react);
|
|
3417
3419
|
var namespaces = ns || t.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
3418
3420
|
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
3419
3421
|
var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
|
|
3420
3422
|
var hashTransKey = reactI18nextOptions.hashTransKey;
|
|
3421
3423
|
var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
|
|
3422
3424
|
var interpolationOverride = values ? tOptions.interpolation : {
|
|
3423
|
-
interpolation: _objectSpread$
|
|
3425
|
+
interpolation: _objectSpread$4(_objectSpread$4({}, tOptions.interpolation), {}, {
|
|
3424
3426
|
prefix: '#$?',
|
|
3425
3427
|
suffix: '?$#'
|
|
3426
3428
|
})
|
|
3427
3429
|
};
|
|
3428
|
-
var combinedTOpts = _objectSpread$
|
|
3430
|
+
var combinedTOpts = _objectSpread$4(_objectSpread$4(_objectSpread$4(_objectSpread$4({}, tOptions), {}, {
|
|
3429
3431
|
count: count
|
|
3430
3432
|
}, values), interpolationOverride), {}, {
|
|
3431
3433
|
defaultValue: defaultValue,
|
|
@@ -3492,7 +3494,7 @@ function _slicedToArray(arr, i) {
|
|
|
3492
3494
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3493
3495
|
}
|
|
3494
3496
|
|
|
3495
|
-
function ownKeys$
|
|
3497
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
3496
3498
|
var keys = Object.keys(object);
|
|
3497
3499
|
if (Object.getOwnPropertySymbols) {
|
|
3498
3500
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3505,17 +3507,17 @@ function ownKeys$2(object, enumerableOnly) {
|
|
|
3505
3507
|
}
|
|
3506
3508
|
return keys;
|
|
3507
3509
|
}
|
|
3508
|
-
function _objectSpread$
|
|
3510
|
+
function _objectSpread$3(target) {
|
|
3509
3511
|
for (var i = 1; i < arguments.length; i++) {
|
|
3510
3512
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3511
3513
|
if (i % 2) {
|
|
3512
|
-
ownKeys$
|
|
3514
|
+
ownKeys$3(Object(source), true).forEach(function (key) {
|
|
3513
3515
|
_defineProperty$1(target, key, source[key]);
|
|
3514
3516
|
});
|
|
3515
3517
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
3516
3518
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3517
3519
|
} else {
|
|
3518
|
-
ownKeys$
|
|
3520
|
+
ownKeys$3(Object(source)).forEach(function (key) {
|
|
3519
3521
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3520
3522
|
});
|
|
3521
3523
|
}
|
|
@@ -3542,7 +3544,7 @@ function useTranslation(ns) {
|
|
|
3542
3544
|
return retNotReady;
|
|
3543
3545
|
}
|
|
3544
3546
|
if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
|
|
3545
|
-
var i18nOptions = _objectSpread$
|
|
3547
|
+
var i18nOptions = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, getDefaults()), i18n.options.react), props);
|
|
3546
3548
|
var useSuspense = i18nOptions.useSuspense,
|
|
3547
3549
|
keyPrefix = i18nOptions.keyPrefix;
|
|
3548
3550
|
var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
@@ -3724,10 +3726,10 @@ var CHANNEL_NAME_VALIDAITON_SCHEMA = {
|
|
|
3724
3726
|
}).required().nullable()
|
|
3725
3727
|
};
|
|
3726
3728
|
|
|
3727
|
-
function ownKeys$
|
|
3728
|
-
function _objectSpread$
|
|
3729
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3730
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3729
3731
|
var buildValidationSchema = function buildValidationSchema(customValidationSchema) {
|
|
3730
|
-
return yup.object().shape(_objectSpread$
|
|
3732
|
+
return yup.object().shape(_objectSpread$2(_objectSpread$2({}, customValidationSchema), CHANNEL_NAME_VALIDAITON_SCHEMA));
|
|
3731
3733
|
};
|
|
3732
3734
|
var toSlackUrl = function toSlackUrl(teamName) {
|
|
3733
3735
|
return "".concat(teamName === null || teamName === void 0 ? void 0 : teamName.replace(/\s/g, "").toLowerCase(), ".slack.com");
|
|
@@ -3771,8 +3773,8 @@ var SlackRefreshChannelListButton = function SlackRefreshChannelListButton(_ref)
|
|
|
3771
3773
|
};
|
|
3772
3774
|
var SlackRefreshChannelListButton$1 = /*#__PURE__*/React__default.memo(SlackRefreshChannelListButton);
|
|
3773
3775
|
|
|
3774
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3775
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3776
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3777
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3776
3778
|
var EditPane = function EditPane(_ref) {
|
|
3777
3779
|
var _ref$isPaneOpen = _ref.isPaneOpen,
|
|
3778
3780
|
isPaneOpen = _ref$isPaneOpen === void 0 ? false : _ref$isPaneOpen,
|
|
@@ -3830,7 +3832,7 @@ var EditPane = function EditPane(_ref) {
|
|
|
3830
3832
|
size: "large"
|
|
3831
3833
|
}), /*#__PURE__*/React__default.createElement(SlackRefreshChannelListButton$1, {
|
|
3832
3834
|
channelRefreshHandler: channelRefreshHandler
|
|
3833
|
-
}))), is(Function, children) ? children(_objectSpread({}, formikProps)) : children), /*#__PURE__*/React__default.createElement(Pane.Footer, null, /*#__PURE__*/React__default.createElement(Button, {
|
|
3835
|
+
}))), is(Function, children) ? children(_objectSpread$1({}, formikProps)) : children), /*#__PURE__*/React__default.createElement(Pane.Footer, null, /*#__PURE__*/React__default.createElement(Button, {
|
|
3834
3836
|
disabled: isSubmitting || formikProps.isSubmitting,
|
|
3835
3837
|
label: t("common.save"),
|
|
3836
3838
|
loading: isSubmitting || formikProps.isSubmitting,
|
|
@@ -4040,6 +4042,78 @@ var Finish = function Finish(_ref) {
|
|
|
4040
4042
|
}, secondaryButtonProps))));
|
|
4041
4043
|
};
|
|
4042
4044
|
|
|
4045
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4046
|
+
if (source == null) return {};
|
|
4047
|
+
var target = {};
|
|
4048
|
+
var sourceKeys = Object.keys(source);
|
|
4049
|
+
var key, i;
|
|
4050
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
4051
|
+
key = sourceKeys[i];
|
|
4052
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
4053
|
+
target[key] = source[key];
|
|
4054
|
+
}
|
|
4055
|
+
return target;
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
function _objectWithoutProperties(source, excluded) {
|
|
4059
|
+
if (source == null) return {};
|
|
4060
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
4061
|
+
var key, i;
|
|
4062
|
+
if (Object.getOwnPropertySymbols) {
|
|
4063
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
4064
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
4065
|
+
key = sourceSymbolKeys[i];
|
|
4066
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
4067
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
4068
|
+
target[key] = source[key];
|
|
4069
|
+
}
|
|
4070
|
+
}
|
|
4071
|
+
return target;
|
|
4072
|
+
}
|
|
4073
|
+
|
|
4074
|
+
var SLACK_ENGINE_BASE_URL = "/integrations-slack/api/v1/slack";
|
|
4075
|
+
var DEFAULT_SLACK_SETTINGS_STALE_TIME = 120000; // 2 minutes
|
|
4076
|
+
|
|
4077
|
+
var slackApi = {
|
|
4078
|
+
fetchSlackStatus: function fetchSlackStatus(payload) {
|
|
4079
|
+
return axios.get("".concat(SLACK_ENGINE_BASE_URL, "/integration_status"), {
|
|
4080
|
+
params: payload
|
|
4081
|
+
});
|
|
4082
|
+
}
|
|
4083
|
+
};
|
|
4084
|
+
|
|
4085
|
+
var QUERY_KEYS = {
|
|
4086
|
+
SLACK_INTEGRATIONS_STATUS: "slack-integrations-status"
|
|
4087
|
+
};
|
|
4088
|
+
|
|
4089
|
+
var _excluded = ["integrableId", "integrableType"];
|
|
4090
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4091
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4092
|
+
var useFetchSlackIntegrationsStatus = function useFetchSlackIntegrationsStatus(_ref) {
|
|
4093
|
+
var _ref$integrableId = _ref.integrableId,
|
|
4094
|
+
integrableId = _ref$integrableId === void 0 ? "" : _ref$integrableId,
|
|
4095
|
+
_ref$integrableType = _ref.integrableType,
|
|
4096
|
+
integrableType = _ref$integrableType === void 0 ? "" : _ref$integrableType,
|
|
4097
|
+
options = _objectWithoutProperties(_ref, _excluded);
|
|
4098
|
+
return useQuery(QUERY_KEYS.SLACK_INTEGRATIONS_STATUS, function () {
|
|
4099
|
+
return slackApi.fetchSlackStatus(_objectSpread(_objectSpread({}, integrableId && {
|
|
4100
|
+
integrableId: integrableId
|
|
4101
|
+
}), integrableType && {
|
|
4102
|
+
integrableType: integrableType
|
|
4103
|
+
}));
|
|
4104
|
+
}, _objectSpread({
|
|
4105
|
+
staleTime: DEFAULT_SLACK_SETTINGS_STALE_TIME,
|
|
4106
|
+
select: function select(response) {
|
|
4107
|
+
var _integrationStatus$no;
|
|
4108
|
+
var integrationStatus = response.integrationStatus;
|
|
4109
|
+
return {
|
|
4110
|
+
isSlackIntegrated: integrationStatus === null || integrationStatus === void 0 ? void 0 : integrationStatus.integrated,
|
|
4111
|
+
notificationChannel: (_integrationStatus$no = integrationStatus === null || integrationStatus === void 0 ? void 0 : integrationStatus.notificationChannel) !== null && _integrationStatus$no !== void 0 ? _integrationStatus$no : ""
|
|
4112
|
+
};
|
|
4113
|
+
}
|
|
4114
|
+
}, options));
|
|
4115
|
+
};
|
|
4116
|
+
|
|
4043
4117
|
var e = [],
|
|
4044
4118
|
t = [];
|
|
4045
4119
|
function n(n, r) {
|
|
@@ -4065,5 +4139,5 @@ function n(n, r) {
|
|
|
4065
4139
|
var css = ".w-screen-imp{width:100vw!important}@media (max-height:1000px){.neeto-ui-react-select__menu-list{max-height:calc(40vh - 50px)!important}}.border-t{border-top:1px solid}.border-gray-300{border-color:#d1d5db}";
|
|
4066
4140
|
n(css,{});
|
|
4067
4141
|
|
|
4068
|
-
export { Configure, Connect, Finish, Settings };
|
|
4142
|
+
export { Configure, Connect, Finish, Settings, useFetchSlackIntegrationsStatus };
|
|
4069
4143
|
//# sourceMappingURL=index.js.map
|