@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.cjs.js
CHANGED
|
@@ -10,6 +10,8 @@ var yup = require('yup');
|
|
|
10
10
|
var formik = require('@bigbinary/neetoui/formik');
|
|
11
11
|
var ramda = require('ramda');
|
|
12
12
|
var misc = require('@bigbinary/neeto-icons/misc');
|
|
13
|
+
var reactQuery = require('react-query');
|
|
14
|
+
var axios = require('axios');
|
|
13
15
|
|
|
14
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
17
|
|
|
@@ -35,6 +37,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
35
37
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
36
38
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
37
39
|
var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
40
|
+
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
38
41
|
|
|
39
42
|
function _typeof$2(obj) {
|
|
40
43
|
"@babel/helpers - typeof";
|
|
@@ -180,7 +183,7 @@ function _toArray(arr) {
|
|
|
180
183
|
return _arrayWithHoles$1(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableRest$1();
|
|
181
184
|
}
|
|
182
185
|
|
|
183
|
-
function ownKeys$
|
|
186
|
+
function ownKeys$6(object, enumerableOnly) {
|
|
184
187
|
var keys = Object.keys(object);
|
|
185
188
|
if (Object.getOwnPropertySymbols) {
|
|
186
189
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -193,17 +196,17 @@ function ownKeys$5(object, enumerableOnly) {
|
|
|
193
196
|
}
|
|
194
197
|
return keys;
|
|
195
198
|
}
|
|
196
|
-
function _objectSpread$
|
|
199
|
+
function _objectSpread$6(target) {
|
|
197
200
|
for (var i = 1; i < arguments.length; i++) {
|
|
198
201
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
199
202
|
if (i % 2) {
|
|
200
|
-
ownKeys$
|
|
203
|
+
ownKeys$6(Object(source), true).forEach(function (key) {
|
|
201
204
|
_defineProperty$2(target, key, source[key]);
|
|
202
205
|
});
|
|
203
206
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
204
207
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
205
208
|
} else {
|
|
206
|
-
ownKeys$
|
|
209
|
+
ownKeys$6(Object(source)).forEach(function (key) {
|
|
207
210
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
208
211
|
});
|
|
209
212
|
}
|
|
@@ -287,7 +290,7 @@ var Logger = function () {
|
|
|
287
290
|
}, {
|
|
288
291
|
key: "create",
|
|
289
292
|
value: function create(moduleName) {
|
|
290
|
-
return new Logger(this.logger, _objectSpread$
|
|
293
|
+
return new Logger(this.logger, _objectSpread$6(_objectSpread$6({}, {
|
|
291
294
|
prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
|
|
292
295
|
}), this.options));
|
|
293
296
|
}
|
|
@@ -2242,7 +2245,7 @@ function transformOptions(options) {
|
|
|
2242
2245
|
}
|
|
2243
2246
|
return options;
|
|
2244
2247
|
}
|
|
2245
|
-
function ownKeys$6(object, enumerableOnly) {
|
|
2248
|
+
function ownKeys$6$1(object, enumerableOnly) {
|
|
2246
2249
|
var keys = Object.keys(object);
|
|
2247
2250
|
if (Object.getOwnPropertySymbols) {
|
|
2248
2251
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -2255,17 +2258,17 @@ function ownKeys$6(object, enumerableOnly) {
|
|
|
2255
2258
|
}
|
|
2256
2259
|
return keys;
|
|
2257
2260
|
}
|
|
2258
|
-
function _objectSpread$6(target) {
|
|
2261
|
+
function _objectSpread$6$1(target) {
|
|
2259
2262
|
for (var i = 1; i < arguments.length; i++) {
|
|
2260
2263
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
2261
2264
|
if (i % 2) {
|
|
2262
|
-
ownKeys$6(Object(source), true).forEach(function (key) {
|
|
2265
|
+
ownKeys$6$1(Object(source), true).forEach(function (key) {
|
|
2263
2266
|
_defineProperty$2(target, key, source[key]);
|
|
2264
2267
|
});
|
|
2265
2268
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
2266
2269
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
2267
2270
|
} else {
|
|
2268
|
-
ownKeys$6(Object(source)).forEach(function (key) {
|
|
2271
|
+
ownKeys$6$1(Object(source)).forEach(function (key) {
|
|
2269
2272
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2270
2273
|
});
|
|
2271
2274
|
}
|
|
@@ -2354,9 +2357,9 @@ var I18n = function (_EventEmitter) {
|
|
|
2354
2357
|
}
|
|
2355
2358
|
}
|
|
2356
2359
|
var defOpts = get();
|
|
2357
|
-
this.options = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, defOpts), this.options), transformOptions(options));
|
|
2360
|
+
this.options = _objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({}, defOpts), this.options), transformOptions(options));
|
|
2358
2361
|
if (this.options.compatibilityAPI !== 'v1') {
|
|
2359
|
-
this.options.interpolation = _objectSpread$6(_objectSpread$6({}, defOpts.interpolation), this.options.interpolation);
|
|
2362
|
+
this.options.interpolation = _objectSpread$6$1(_objectSpread$6$1({}, defOpts.interpolation), this.options.interpolation);
|
|
2360
2363
|
}
|
|
2361
2364
|
if (options.keySeparator !== undefined) {
|
|
2362
2365
|
this.options.userDefinedKeySeparator = options.keySeparator;
|
|
@@ -2630,7 +2633,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2630
2633
|
}
|
|
2631
2634
|
options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
|
2632
2635
|
} else {
|
|
2633
|
-
options = _objectSpread$6({}, opts);
|
|
2636
|
+
options = _objectSpread$6$1({}, opts);
|
|
2634
2637
|
}
|
|
2635
2638
|
options.lng = options.lng || fixedT.lng;
|
|
2636
2639
|
options.lngs = options.lngs || fixedT.lngs;
|
|
@@ -2748,7 +2751,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2748
2751
|
var _this8 = this;
|
|
2749
2752
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2750
2753
|
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
2751
|
-
var mergedOptions = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, this.options), options), {
|
|
2754
|
+
var mergedOptions = _objectSpread$6$1(_objectSpread$6$1(_objectSpread$6$1({}, this.options), options), {
|
|
2752
2755
|
isClone: true
|
|
2753
2756
|
});
|
|
2754
2757
|
var clone = new I18n(mergedOptions);
|
|
@@ -2756,7 +2759,7 @@ var I18n = function (_EventEmitter) {
|
|
|
2756
2759
|
membersToCopy.forEach(function (m) {
|
|
2757
2760
|
clone[m] = _this8[m];
|
|
2758
2761
|
});
|
|
2759
|
-
clone.services = _objectSpread$6({}, this.services);
|
|
2762
|
+
clone.services = _objectSpread$6$1({}, this.services);
|
|
2760
2763
|
clone.services.utils = {
|
|
2761
2764
|
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
|
2762
2765
|
};
|
|
@@ -2809,7 +2812,7 @@ instance.hasLoadedNamespace;
|
|
|
2809
2812
|
instance.loadNamespaces;
|
|
2810
2813
|
instance.loadLanguages;
|
|
2811
2814
|
|
|
2812
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2815
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) {
|
|
2813
2816
|
if (source == null) return {};
|
|
2814
2817
|
var target = {};
|
|
2815
2818
|
var sourceKeys = Object.keys(source);
|
|
@@ -2822,9 +2825,9 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
2822
2825
|
return target;
|
|
2823
2826
|
}
|
|
2824
2827
|
|
|
2825
|
-
function _objectWithoutProperties(source, excluded) {
|
|
2828
|
+
function _objectWithoutProperties$1(source, excluded) {
|
|
2826
2829
|
if (source == null) return {};
|
|
2827
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
2830
|
+
var target = _objectWithoutPropertiesLoose$1(source, excluded);
|
|
2828
2831
|
var key, i;
|
|
2829
2832
|
if (Object.getOwnPropertySymbols) {
|
|
2830
2833
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -3058,7 +3061,7 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
3058
3061
|
return Constructor;
|
|
3059
3062
|
}
|
|
3060
3063
|
|
|
3061
|
-
function ownKeys$
|
|
3064
|
+
function ownKeys$5(object, enumerableOnly) {
|
|
3062
3065
|
var keys = Object.keys(object);
|
|
3063
3066
|
if (Object.getOwnPropertySymbols) {
|
|
3064
3067
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3071,17 +3074,17 @@ function ownKeys$4(object, enumerableOnly) {
|
|
|
3071
3074
|
}
|
|
3072
3075
|
return keys;
|
|
3073
3076
|
}
|
|
3074
|
-
function _objectSpread$
|
|
3077
|
+
function _objectSpread$5(target) {
|
|
3075
3078
|
for (var i = 1; i < arguments.length; i++) {
|
|
3076
3079
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3077
3080
|
if (i % 2) {
|
|
3078
|
-
ownKeys$
|
|
3081
|
+
ownKeys$5(Object(source), true).forEach(function (key) {
|
|
3079
3082
|
_defineProperty$1(target, key, source[key]);
|
|
3080
3083
|
});
|
|
3081
3084
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
3082
3085
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3083
3086
|
} else {
|
|
3084
|
-
ownKeys$
|
|
3087
|
+
ownKeys$5(Object(source)).forEach(function (key) {
|
|
3085
3088
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3086
3089
|
});
|
|
3087
3090
|
}
|
|
@@ -3101,7 +3104,7 @@ var i18nInstance;
|
|
|
3101
3104
|
var I18nContext = /*#__PURE__*/React__default["default"].createContext();
|
|
3102
3105
|
function setDefaults() {
|
|
3103
3106
|
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3104
|
-
defaultOptions = _objectSpread$
|
|
3107
|
+
defaultOptions = _objectSpread$5(_objectSpread$5({}, defaultOptions), options);
|
|
3105
3108
|
}
|
|
3106
3109
|
function getDefaults() {
|
|
3107
3110
|
return defaultOptions;
|
|
@@ -3208,9 +3211,9 @@ function hasLoadedNamespace(ns, i18n) {
|
|
|
3208
3211
|
});
|
|
3209
3212
|
}
|
|
3210
3213
|
|
|
3211
|
-
var _excluded = ["format"],
|
|
3214
|
+
var _excluded$1 = ["format"],
|
|
3212
3215
|
_excluded2 = ["children", "count", "parent", "i18nKey", "context", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
|
|
3213
|
-
function ownKeys$
|
|
3216
|
+
function ownKeys$4(object, enumerableOnly) {
|
|
3214
3217
|
var keys = Object.keys(object);
|
|
3215
3218
|
if (Object.getOwnPropertySymbols) {
|
|
3216
3219
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3223,17 +3226,17 @@ function ownKeys$3(object, enumerableOnly) {
|
|
|
3223
3226
|
}
|
|
3224
3227
|
return keys;
|
|
3225
3228
|
}
|
|
3226
|
-
function _objectSpread$
|
|
3229
|
+
function _objectSpread$4(target) {
|
|
3227
3230
|
for (var i = 1; i < arguments.length; i++) {
|
|
3228
3231
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3229
3232
|
if (i % 2) {
|
|
3230
|
-
ownKeys$
|
|
3233
|
+
ownKeys$4(Object(source), true).forEach(function (key) {
|
|
3231
3234
|
_defineProperty$1(target, key, source[key]);
|
|
3232
3235
|
});
|
|
3233
3236
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
3234
3237
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3235
3238
|
} else {
|
|
3236
|
-
ownKeys$
|
|
3239
|
+
ownKeys$4(Object(source)).forEach(function (key) {
|
|
3237
3240
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3238
3241
|
});
|
|
3239
3242
|
}
|
|
@@ -3260,7 +3263,7 @@ function getAsArray(data) {
|
|
|
3260
3263
|
return Array.isArray(data) ? data : [data];
|
|
3261
3264
|
}
|
|
3262
3265
|
function mergeProps(source, target) {
|
|
3263
|
-
var newTarget = _objectSpread$
|
|
3266
|
+
var newTarget = _objectSpread$4({}, target);
|
|
3264
3267
|
newTarget.props = Object.assign(source.props, target.props);
|
|
3265
3268
|
return newTarget;
|
|
3266
3269
|
}
|
|
@@ -3292,7 +3295,7 @@ function nodesToString(children, i18nOptions) {
|
|
|
3292
3295
|
warn("Trans: the passed in value is invalid - seems you passed in a null child.");
|
|
3293
3296
|
} else if (_typeof$1(child) === 'object') {
|
|
3294
3297
|
var format = child.format,
|
|
3295
|
-
clone = _objectWithoutProperties(child, _excluded);
|
|
3298
|
+
clone = _objectWithoutProperties$1(child, _excluded$1);
|
|
3296
3299
|
var keys = Object.keys(clone);
|
|
3297
3300
|
if (keys.length === 1) {
|
|
3298
3301
|
var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
|
|
@@ -3321,7 +3324,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3321
3324
|
}
|
|
3322
3325
|
getData(children);
|
|
3323
3326
|
var ast = c.parse("<0>".concat(targetString, "</0>"));
|
|
3324
|
-
var opts = _objectSpread$
|
|
3327
|
+
var opts = _objectSpread$4(_objectSpread$4({}, data), combinedTOpts);
|
|
3325
3328
|
function renderInner(child, node, rootReactNode) {
|
|
3326
3329
|
var childs = getChildren(child);
|
|
3327
3330
|
var mappedChildren = mapAST(childs, node.children, rootReactNode);
|
|
@@ -3329,7 +3332,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3329
3332
|
}
|
|
3330
3333
|
function pushTranslatedJSX(child, inner, mem, i, isVoid) {
|
|
3331
3334
|
if (child.dummy) child.children = inner;
|
|
3332
|
-
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$
|
|
3335
|
+
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3333
3336
|
key: i
|
|
3334
3337
|
}), isVoid ? undefined : inner));
|
|
3335
3338
|
}
|
|
@@ -3357,7 +3360,7 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3357
3360
|
pushTranslatedJSX(child, inner, mem, i);
|
|
3358
3361
|
} else if (isEmptyTransWithHTML) {
|
|
3359
3362
|
var _inner = mapAST(reactNodes, node.children, rootReactNode);
|
|
3360
|
-
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$
|
|
3363
|
+
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3361
3364
|
key: i
|
|
3362
3365
|
}), _inner));
|
|
3363
3366
|
} else if (Number.isNaN(parseFloat(node.name))) {
|
|
@@ -3385,11 +3388,11 @@ function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, s
|
|
|
3385
3388
|
var content = node.children[0] ? translationContent : null;
|
|
3386
3389
|
if (content) mem.push(content);
|
|
3387
3390
|
} else if (node.children.length === 1 && translationContent) {
|
|
3388
|
-
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$
|
|
3391
|
+
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3389
3392
|
key: i
|
|
3390
3393
|
}), translationContent));
|
|
3391
3394
|
} else {
|
|
3392
|
-
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$
|
|
3395
|
+
mem.push( /*#__PURE__*/React__default["default"].cloneElement(child, _objectSpread$4(_objectSpread$4({}, child.props), {}, {
|
|
3393
3396
|
key: i
|
|
3394
3397
|
})));
|
|
3395
3398
|
}
|
|
@@ -3428,7 +3431,7 @@ function Trans(_ref) {
|
|
|
3428
3431
|
i18nFromProps = _ref.i18n,
|
|
3429
3432
|
tFromProps = _ref.t,
|
|
3430
3433
|
shouldUnescape = _ref.shouldUnescape,
|
|
3431
|
-
additionalProps = _objectWithoutProperties(_ref, _excluded2);
|
|
3434
|
+
additionalProps = _objectWithoutProperties$1(_ref, _excluded2);
|
|
3432
3435
|
var _ref2 = React.useContext(I18nContext) || {},
|
|
3433
3436
|
i18nFromContext = _ref2.i18n,
|
|
3434
3437
|
defaultNSFromContext = _ref2.defaultNS;
|
|
@@ -3441,19 +3444,19 @@ function Trans(_ref) {
|
|
|
3441
3444
|
return k;
|
|
3442
3445
|
};
|
|
3443
3446
|
if (context) tOptions.context = context;
|
|
3444
|
-
var reactI18nextOptions = _objectSpread$
|
|
3447
|
+
var reactI18nextOptions = _objectSpread$4(_objectSpread$4({}, getDefaults()), i18n.options && i18n.options.react);
|
|
3445
3448
|
var namespaces = ns || t.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
3446
3449
|
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
|
3447
3450
|
var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
|
|
3448
3451
|
var hashTransKey = reactI18nextOptions.hashTransKey;
|
|
3449
3452
|
var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
|
|
3450
3453
|
var interpolationOverride = values ? tOptions.interpolation : {
|
|
3451
|
-
interpolation: _objectSpread$
|
|
3454
|
+
interpolation: _objectSpread$4(_objectSpread$4({}, tOptions.interpolation), {}, {
|
|
3452
3455
|
prefix: '#$?',
|
|
3453
3456
|
suffix: '?$#'
|
|
3454
3457
|
})
|
|
3455
3458
|
};
|
|
3456
|
-
var combinedTOpts = _objectSpread$
|
|
3459
|
+
var combinedTOpts = _objectSpread$4(_objectSpread$4(_objectSpread$4(_objectSpread$4({}, tOptions), {}, {
|
|
3457
3460
|
count: count
|
|
3458
3461
|
}, values), interpolationOverride), {}, {
|
|
3459
3462
|
defaultValue: defaultValue,
|
|
@@ -3520,7 +3523,7 @@ function _slicedToArray(arr, i) {
|
|
|
3520
3523
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
3521
3524
|
}
|
|
3522
3525
|
|
|
3523
|
-
function ownKeys$
|
|
3526
|
+
function ownKeys$3(object, enumerableOnly) {
|
|
3524
3527
|
var keys = Object.keys(object);
|
|
3525
3528
|
if (Object.getOwnPropertySymbols) {
|
|
3526
3529
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -3533,17 +3536,17 @@ function ownKeys$2(object, enumerableOnly) {
|
|
|
3533
3536
|
}
|
|
3534
3537
|
return keys;
|
|
3535
3538
|
}
|
|
3536
|
-
function _objectSpread$
|
|
3539
|
+
function _objectSpread$3(target) {
|
|
3537
3540
|
for (var i = 1; i < arguments.length; i++) {
|
|
3538
3541
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
3539
3542
|
if (i % 2) {
|
|
3540
|
-
ownKeys$
|
|
3543
|
+
ownKeys$3(Object(source), true).forEach(function (key) {
|
|
3541
3544
|
_defineProperty$1(target, key, source[key]);
|
|
3542
3545
|
});
|
|
3543
3546
|
} else if (Object.getOwnPropertyDescriptors) {
|
|
3544
3547
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3545
3548
|
} else {
|
|
3546
|
-
ownKeys$
|
|
3549
|
+
ownKeys$3(Object(source)).forEach(function (key) {
|
|
3547
3550
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3548
3551
|
});
|
|
3549
3552
|
}
|
|
@@ -3570,7 +3573,7 @@ function useTranslation(ns) {
|
|
|
3570
3573
|
return retNotReady;
|
|
3571
3574
|
}
|
|
3572
3575
|
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.');
|
|
3573
|
-
var i18nOptions = _objectSpread$
|
|
3576
|
+
var i18nOptions = _objectSpread$3(_objectSpread$3(_objectSpread$3({}, getDefaults()), i18n.options.react), props);
|
|
3574
3577
|
var useSuspense = i18nOptions.useSuspense,
|
|
3575
3578
|
keyPrefix = i18nOptions.keyPrefix;
|
|
3576
3579
|
var namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
|
@@ -3752,10 +3755,10 @@ var CHANNEL_NAME_VALIDAITON_SCHEMA = {
|
|
|
3752
3755
|
}).required().nullable()
|
|
3753
3756
|
};
|
|
3754
3757
|
|
|
3755
|
-
function ownKeys$
|
|
3756
|
-
function _objectSpread$
|
|
3758
|
+
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; }
|
|
3759
|
+
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; }
|
|
3757
3760
|
var buildValidationSchema = function buildValidationSchema(customValidationSchema) {
|
|
3758
|
-
return yup__namespace.object().shape(_objectSpread$
|
|
3761
|
+
return yup__namespace.object().shape(_objectSpread$2(_objectSpread$2({}, customValidationSchema), CHANNEL_NAME_VALIDAITON_SCHEMA));
|
|
3759
3762
|
};
|
|
3760
3763
|
var toSlackUrl = function toSlackUrl(teamName) {
|
|
3761
3764
|
return "".concat(teamName === null || teamName === void 0 ? void 0 : teamName.replace(/\s/g, "").toLowerCase(), ".slack.com");
|
|
@@ -3799,8 +3802,8 @@ var SlackRefreshChannelListButton = function SlackRefreshChannelListButton(_ref)
|
|
|
3799
3802
|
};
|
|
3800
3803
|
var SlackRefreshChannelListButton$1 = /*#__PURE__*/React__default["default"].memo(SlackRefreshChannelListButton);
|
|
3801
3804
|
|
|
3802
|
-
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; }
|
|
3803
|
-
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; }
|
|
3805
|
+
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; }
|
|
3806
|
+
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; }
|
|
3804
3807
|
var EditPane = function EditPane(_ref) {
|
|
3805
3808
|
var _ref$isPaneOpen = _ref.isPaneOpen,
|
|
3806
3809
|
isPaneOpen = _ref$isPaneOpen === void 0 ? false : _ref$isPaneOpen,
|
|
@@ -3858,7 +3861,7 @@ var EditPane = function EditPane(_ref) {
|
|
|
3858
3861
|
size: "large"
|
|
3859
3862
|
}), /*#__PURE__*/React__default["default"].createElement(SlackRefreshChannelListButton$1, {
|
|
3860
3863
|
channelRefreshHandler: channelRefreshHandler
|
|
3861
|
-
}))), ramda.is(Function, children) ? children(_objectSpread({}, formikProps)) : children), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3864
|
+
}))), ramda.is(Function, children) ? children(_objectSpread$1({}, formikProps)) : children), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
3862
3865
|
disabled: isSubmitting || formikProps.isSubmitting,
|
|
3863
3866
|
label: t("common.save"),
|
|
3864
3867
|
loading: isSubmitting || formikProps.isSubmitting,
|
|
@@ -4068,6 +4071,78 @@ var Finish = function Finish(_ref) {
|
|
|
4068
4071
|
}, secondaryButtonProps))));
|
|
4069
4072
|
};
|
|
4070
4073
|
|
|
4074
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
4075
|
+
if (source == null) return {};
|
|
4076
|
+
var target = {};
|
|
4077
|
+
var sourceKeys = Object.keys(source);
|
|
4078
|
+
var key, i;
|
|
4079
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
4080
|
+
key = sourceKeys[i];
|
|
4081
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
4082
|
+
target[key] = source[key];
|
|
4083
|
+
}
|
|
4084
|
+
return target;
|
|
4085
|
+
}
|
|
4086
|
+
|
|
4087
|
+
function _objectWithoutProperties(source, excluded) {
|
|
4088
|
+
if (source == null) return {};
|
|
4089
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
4090
|
+
var key, i;
|
|
4091
|
+
if (Object.getOwnPropertySymbols) {
|
|
4092
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
4093
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
4094
|
+
key = sourceSymbolKeys[i];
|
|
4095
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
4096
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
4097
|
+
target[key] = source[key];
|
|
4098
|
+
}
|
|
4099
|
+
}
|
|
4100
|
+
return target;
|
|
4101
|
+
}
|
|
4102
|
+
|
|
4103
|
+
var SLACK_ENGINE_BASE_URL = "/integrations-slack/api/v1/slack";
|
|
4104
|
+
var DEFAULT_SLACK_SETTINGS_STALE_TIME = 120000; // 2 minutes
|
|
4105
|
+
|
|
4106
|
+
var slackApi = {
|
|
4107
|
+
fetchSlackStatus: function fetchSlackStatus(payload) {
|
|
4108
|
+
return axios__default["default"].get("".concat(SLACK_ENGINE_BASE_URL, "/integration_status"), {
|
|
4109
|
+
params: payload
|
|
4110
|
+
});
|
|
4111
|
+
}
|
|
4112
|
+
};
|
|
4113
|
+
|
|
4114
|
+
var QUERY_KEYS = {
|
|
4115
|
+
SLACK_INTEGRATIONS_STATUS: "slack-integrations-status"
|
|
4116
|
+
};
|
|
4117
|
+
|
|
4118
|
+
var _excluded = ["integrableId", "integrableType"];
|
|
4119
|
+
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; }
|
|
4120
|
+
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; }
|
|
4121
|
+
var useFetchSlackIntegrationsStatus = function useFetchSlackIntegrationsStatus(_ref) {
|
|
4122
|
+
var _ref$integrableId = _ref.integrableId,
|
|
4123
|
+
integrableId = _ref$integrableId === void 0 ? "" : _ref$integrableId,
|
|
4124
|
+
_ref$integrableType = _ref.integrableType,
|
|
4125
|
+
integrableType = _ref$integrableType === void 0 ? "" : _ref$integrableType,
|
|
4126
|
+
options = _objectWithoutProperties(_ref, _excluded);
|
|
4127
|
+
return reactQuery.useQuery(QUERY_KEYS.SLACK_INTEGRATIONS_STATUS, function () {
|
|
4128
|
+
return slackApi.fetchSlackStatus(_objectSpread(_objectSpread({}, integrableId && {
|
|
4129
|
+
integrableId: integrableId
|
|
4130
|
+
}), integrableType && {
|
|
4131
|
+
integrableType: integrableType
|
|
4132
|
+
}));
|
|
4133
|
+
}, _objectSpread({
|
|
4134
|
+
staleTime: DEFAULT_SLACK_SETTINGS_STALE_TIME,
|
|
4135
|
+
select: function select(response) {
|
|
4136
|
+
var _integrationStatus$no;
|
|
4137
|
+
var integrationStatus = response.integrationStatus;
|
|
4138
|
+
return {
|
|
4139
|
+
isSlackIntegrated: integrationStatus === null || integrationStatus === void 0 ? void 0 : integrationStatus.integrated,
|
|
4140
|
+
notificationChannel: (_integrationStatus$no = integrationStatus === null || integrationStatus === void 0 ? void 0 : integrationStatus.notificationChannel) !== null && _integrationStatus$no !== void 0 ? _integrationStatus$no : ""
|
|
4141
|
+
};
|
|
4142
|
+
}
|
|
4143
|
+
}, options));
|
|
4144
|
+
};
|
|
4145
|
+
|
|
4071
4146
|
var e = [],
|
|
4072
4147
|
t = [];
|
|
4073
4148
|
function n(n, r) {
|
|
@@ -4097,4 +4172,5 @@ exports.Configure = Configure;
|
|
|
4097
4172
|
exports.Connect = Connect;
|
|
4098
4173
|
exports.Finish = Finish;
|
|
4099
4174
|
exports.Settings = Settings;
|
|
4175
|
+
exports.useFetchSlackIntegrationsStatus = useFetchSlackIntegrationsStatus;
|
|
4100
4176
|
//# sourceMappingURL=index.cjs.js.map
|