@bigbinary/neeto-commons-frontend 2.0.111 → 2.0.113
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/initializers.cjs.js +6 -10
- package/initializers.cjs.js.map +1 -1
- package/initializers.js +6 -10
- package/initializers.js.map +1 -1
- package/package.json +1 -1
- package/utils.cjs.js +1 -5
- package/utils.cjs.js.map +1 -1
- package/utils.js +1 -5
- package/utils.js.map +1 -1
package/initializers.cjs.js
CHANGED
|
@@ -62,8 +62,6 @@ function _defineProperty(obj, key, value) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
var HEADERS_KEYS = {
|
|
65
|
-
xAuthEmail: "X-Auth-Email",
|
|
66
|
-
xAuthToken: "X-Auth-Token",
|
|
67
65
|
xCsrfToken: "X-CSRF-TOKEN",
|
|
68
66
|
contentType: "Content-Type",
|
|
69
67
|
accept: "Accept"
|
|
@@ -76,15 +74,9 @@ var shouldShowToastr = function shouldShowToastr(response) {
|
|
|
76
74
|
return typeof response === "string" || _typeof$1(response) === "object" && ((response === null || response === void 0 ? void 0 : response.notice) || (response === null || response === void 0 ? void 0 : response.noticeCode));
|
|
77
75
|
};
|
|
78
76
|
var setAuthHeaders = function setAuthHeaders() {
|
|
79
|
-
var _document$querySelect, _axios$defaults$heade
|
|
77
|
+
var _document$querySelect, _axios$defaults$heade;
|
|
80
78
|
// @ts-ignore
|
|
81
79
|
axios__default["default"].defaults.headers = (_axios$defaults$heade = {}, _defineProperty(_axios$defaults$heade, HEADERS_KEYS.accept, "application/json"), _defineProperty(_axios$defaults$heade, HEADERS_KEYS.contentType, "application/json"), _defineProperty(_axios$defaults$heade, HEADERS_KEYS.xCsrfToken, (_document$querySelect = document.querySelector('[name="csrf-token"]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute("content")), _axios$defaults$heade);
|
|
82
|
-
var token = (_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.authenticationToken;
|
|
83
|
-
var email = (_globalProps$user2 = globalProps.user) === null || _globalProps$user2 === void 0 ? void 0 : _globalProps$user2.email;
|
|
84
|
-
if (token && email) {
|
|
85
|
-
axios__default["default"].defaults.headers[HEADERS_KEYS.xAuthEmail] = email;
|
|
86
|
-
axios__default["default"].defaults.headers[HEADERS_KEYS.xAuthToken] = token;
|
|
87
|
-
}
|
|
88
80
|
};
|
|
89
81
|
|
|
90
82
|
// pipe function from ramda doesn't accept array of functions.
|
|
@@ -2403,7 +2395,7 @@ var commonsEn = {
|
|
|
2403
2395
|
neetoCommons: neetoCommons
|
|
2404
2396
|
};
|
|
2405
2397
|
|
|
2406
|
-
var packageNames = ["neeto-molecules", "neeto-integrations-frontend", "neeto-team-members-frontend", "neeto-tags-frontend"];
|
|
2398
|
+
var packageNames = ["neeto-molecules", "neeto-integrations-frontend", "neeto-team-members-frontend", "neeto-tags-frontend", "neeto-form-frontend"];
|
|
2407
2399
|
var getPackageTranslations = function getPackageTranslations(language, packageNames) {
|
|
2408
2400
|
var loadTranslations = ramda.curry(function (language, packageName) {
|
|
2409
2401
|
try {
|
|
@@ -2417,12 +2409,16 @@ var getPackageTranslations = function getPackageTranslations(language, packageNa
|
|
|
2417
2409
|
};
|
|
2418
2410
|
var packageEnTranslations = getPackageTranslations("en", packageNames);
|
|
2419
2411
|
var en = ramda.mergeDeepLeft(commonsEn, packageEnTranslations);
|
|
2412
|
+
var de = getPackageTranslations("de", packageNames);
|
|
2420
2413
|
var initializeI18n = function initializeI18n(resources) {
|
|
2421
2414
|
var _i18n$services$format;
|
|
2422
2415
|
i18n__default["default"].use(Browser).use(reactI18next.initReactI18next).init({
|
|
2423
2416
|
resources: ramda.mergeDeepLeft(resources, {
|
|
2424
2417
|
en: {
|
|
2425
2418
|
translation: en
|
|
2419
|
+
},
|
|
2420
|
+
de: {
|
|
2421
|
+
translation: de
|
|
2426
2422
|
}
|
|
2427
2423
|
}),
|
|
2428
2424
|
supportedLngs: ["en", "de"],
|