tenjin-ui-kit 0.2.196 → 0.2.197
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.
|
@@ -75,19 +75,20 @@ var SimpleSelect = function SimpleSelect(_ref) {
|
|
|
75
75
|
return false;
|
|
76
76
|
};
|
|
77
77
|
var displayedOptions = (0, _react.useMemo)(function () {
|
|
78
|
-
var filteredOptions = options.filter(function (option) {
|
|
79
|
-
return containsText(option.label, searchText);
|
|
78
|
+
var filteredOptions = options === null || options === void 0 ? void 0 : options.filter(function (option) {
|
|
79
|
+
return containsText(option === null || option === void 0 ? void 0 : option.label, searchText);
|
|
80
80
|
});
|
|
81
81
|
if (isSearch) {
|
|
82
|
-
setNoDataAvailable(filteredOptions.length === 0);
|
|
82
|
+
setNoDataAvailable((filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.length) === 0);
|
|
83
83
|
}
|
|
84
|
-
var sortedOptions = filteredOptions.sort(function (a, b) {
|
|
85
|
-
|
|
84
|
+
var sortedOptions = filteredOptions === null || filteredOptions === void 0 ? void 0 : filteredOptions.sort(function (a, b) {
|
|
85
|
+
var _a$label;
|
|
86
|
+
return a === null || a === void 0 ? void 0 : (_a$label = a.label) === null || _a$label === void 0 ? void 0 : _a$label.localeCompare(b.label);
|
|
86
87
|
});
|
|
87
88
|
return sortedOptions.map(function (option) {
|
|
88
89
|
return {
|
|
89
|
-
label: option.label,
|
|
90
|
-
value: option.value
|
|
90
|
+
label: option === null || option === void 0 ? void 0 : option.label,
|
|
91
|
+
value: option === null || option === void 0 ? void 0 : option.value
|
|
91
92
|
};
|
|
92
93
|
});
|
|
93
94
|
}, [options, searchText, isSearch]);
|
package/http/index.js
CHANGED
|
@@ -20,7 +20,7 @@ var getApiAccessToken = _authenticationProvider.default.getApiAccessToken;
|
|
|
20
20
|
var getClient = function getClient() {
|
|
21
21
|
return _axios.default.create({
|
|
22
22
|
headers: {
|
|
23
|
-
|
|
23
|
+
'Content-Type': 'application/json'
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
};
|
|
@@ -28,7 +28,7 @@ exports.getClient = getClient;
|
|
|
28
28
|
var getSecureClient = function getSecureClient() {
|
|
29
29
|
return _axios.default.create({
|
|
30
30
|
headers: {
|
|
31
|
-
|
|
31
|
+
'Content-Type': 'application/json',
|
|
32
32
|
Authorization: "Bearer ".concat(getApiAccessToken())
|
|
33
33
|
}
|
|
34
34
|
});
|
|
@@ -210,15 +210,14 @@ exports.doDelete = doDelete;
|
|
|
210
210
|
var parseAxiosError = function parseAxiosError(error) {
|
|
211
211
|
var parsedError = {
|
|
212
212
|
status: 500,
|
|
213
|
-
statusText:
|
|
214
|
-
message:
|
|
213
|
+
statusText: 'Internal Server Error',
|
|
214
|
+
message: 'An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support'
|
|
215
215
|
};
|
|
216
216
|
if (error && error.response) {
|
|
217
|
-
var _error$response$data$;
|
|
218
217
|
parsedError = _objectSpread(_objectSpread({}, parsedError), {}, {
|
|
219
218
|
status: error.response.status,
|
|
220
219
|
statusText: error.response.statusText,
|
|
221
|
-
message: error.response.status === 503 ?
|
|
220
|
+
message: error.response.status === 503 ? 'A network error occurred. Please try again' : error.response.status === 401 ? 'Authentication Failed' : error.response.data ? error.response.data.message ? error.response.data.message : 'An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support' : 'An unexpected error occurred while processing your request. Please try again. If problem persists, please contact Tenjin support'
|
|
222
221
|
});
|
|
223
222
|
}
|
|
224
223
|
return parsedError;
|