@bigbinary/neeto-commons-frontend 0.0.1 → 2.0.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 +41 -9
- package/initializers.js +136 -14
- package/package.json +1 -1
- package/pure.js +4 -2
- package/react.js +84 -18
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ The commons frontend library for Neeto Applications.
|
|
|
7
7
|
Install from npm:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
yarn add "@bigbinary/neeto-commons-frontend@0.0
|
|
10
|
+
yarn add "@bigbinary/neeto-commons-frontend@2.0.0"
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
This package relies on the host project's tailwind configuration. So add
|
|
@@ -32,7 +32,39 @@ them to read more:
|
|
|
32
32
|
|
|
33
33
|
1. [Initializers](./docs/initializers/README.md)
|
|
34
34
|
2. [React utilities](./docs/react/README.md)
|
|
35
|
-
3. [
|
|
35
|
+
3. [Pure utility functions](./docs/pure/README.md)
|
|
36
|
+
4. [Web utility functions](./docs/utils/README.md)
|
|
37
|
+
|
|
38
|
+
## Migrating from version 1 to 2
|
|
39
|
+
|
|
40
|
+
There is only a single breaking change from version 1 to version 2. The pure
|
|
41
|
+
functions (which has only ramda as its peerDependency) have been moved to a
|
|
42
|
+
separate bundle (named pure). You can import them from
|
|
43
|
+
`@bigbinary/neeto-commons-frontend/pure` instead of
|
|
44
|
+
`@bigbinary/neeto-commons-frontend/utils`.
|
|
45
|
+
|
|
46
|
+
Here is a list of functions that have been moved:
|
|
47
|
+
|
|
48
|
+
`removeById`, `findById`, `replaceById`, `modifyById`, `findBy`, `removeBy`,
|
|
49
|
+
`replaceBy`,`modifyBy`, `existsById`, `existsBy`, `findLastBy`, `findIndexById`,
|
|
50
|
+
`findIndexBy`,`findLastIndexBy`, `filterBy`, `countBy`, `copyKeys`,
|
|
51
|
+
`renameKeys`, `copyKeysDeep`
|
|
52
|
+
|
|
53
|
+
`noop`, `toLabelAndValue`, `getRandomInt`, `randomPick`, `dynamicArray`,
|
|
54
|
+
`isNotNil`, `isNotEmpty`, `notEquals`, `isNot`, `notEqualsDeep`,
|
|
55
|
+
`isNotEqualDeep`
|
|
56
|
+
|
|
57
|
+
`transformObjectDeep`, `keysToCamelCase`, `keysToSnakeCase`, `deepFreezeObject`,
|
|
58
|
+
`matches`, `filterNonNull`
|
|
59
|
+
|
|
60
|
+
`slugify`, `humanize`, `snakeToCamelCase`, `camelToSnakeCase`, `capitalize`,
|
|
61
|
+
`truncate`
|
|
62
|
+
|
|
63
|
+
When you are migrating from version 1 to version 2, do the following:
|
|
64
|
+
|
|
65
|
+
1. Search for all imports from `@bigbinary/neeto-commons-frontend/utils` and
|
|
66
|
+
delete the above mentioned functions from those imports.
|
|
67
|
+
2. Import these functions from `@bigbinary/neeto-commons-frontend/pure` instead.
|
|
36
68
|
|
|
37
69
|
## Development instructions
|
|
38
70
|
|
|
@@ -46,7 +78,7 @@ them to read more:
|
|
|
46
78
|
neeto-commons-frontend to the local yalc store.
|
|
47
79
|
6. Run `yalc install` to install the neeto-commons-frontend to the host
|
|
48
80
|
application.
|
|
49
|
-
7. After making all changes to `neeto-commons-frontend`, run `
|
|
81
|
+
7. After making all changes to `neeto-commons-frontend`, run `yalc push` to push
|
|
50
82
|
the changes to the host application.
|
|
51
83
|
8. Video explanation on how to use yalc: https://vimeo.com/722958162/9e931b640c
|
|
52
84
|
|
|
@@ -62,7 +94,7 @@ This is how releases are managed in this repo.
|
|
|
62
94
|
[package.json](https://github.com/bigbinary/neeto-commons-frontend/blob/master/package.json#L3)
|
|
63
95
|
will be updated to the current branch name.
|
|
64
96
|
- From now on, we can install the package to neeto-applications using the
|
|
65
|
-
version `
|
|
97
|
+
version `2.X.Y`.
|
|
66
98
|
- We will create a draft PR of this branch targeting master. This keeps the
|
|
67
99
|
branch in sync with master branch (bot-bigbinary will auto-merge the changes).
|
|
68
100
|
- When all features have been built, we will deploy it to all neeto-applications
|
|
@@ -75,19 +107,19 @@ This is how releases are managed in this repo.
|
|
|
75
107
|
the latest changes.
|
|
76
108
|
- Once everything is fine and the verification is complete, we will create a
|
|
77
109
|
[new github release](https://github.com/bigbinary/neeto-commons-frontend/releases/new)
|
|
78
|
-
from `
|
|
79
|
-
branch will be kept as `
|
|
110
|
+
from `2.X.Y` branch with the exact same name for the tag (`2.X.Y`). The target
|
|
111
|
+
branch will be kept as `2.X.Y`. This will create a tag from the latest `2.X.Y`
|
|
80
112
|
branch and this ensures that the latest commit on that branch will remain
|
|
81
113
|
intact even if that branch gets deleted.
|
|
82
114
|
- Whenever a new release is created with a new version number, the github
|
|
83
115
|
actions will automatically publish the built package to npm.
|
|
84
|
-
- Now we will squash and merge the PR `
|
|
116
|
+
- Now we will squash and merge the PR `2.X.Y` to master and delete its source
|
|
85
117
|
branch. This will delete all commits except the top one (since we have created
|
|
86
118
|
a tag with it).
|
|
87
|
-
- Immediately, we will open another branch with the next version (`
|
|
119
|
+
- Immediately, we will open another branch with the next version (`2.X.Y`) and
|
|
88
120
|
the cycle will continue.
|
|
89
121
|
- Now we can run `yalc remove neeto-commons-frontend` to remove yalc based
|
|
90
|
-
package and run `yarn add neeto-commons-frontend@
|
|
122
|
+
package and run `yarn add neeto-commons-frontend@2.X.Y` to fetch the latest
|
|
91
123
|
changes from npm in all repos and raise PR. You might be able to slightly
|
|
92
124
|
tweak this script to get the job done:
|
|
93
125
|
https://gist.github.com/jagannathBhat/42a584748d97fe134f0abadb191ef29a
|
package/initializers.js
CHANGED
|
@@ -1,22 +1,95 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var objects = require('pure/objects');
|
|
4
|
+
var neetoui = require('@bigbinary/neetoui');
|
|
4
5
|
var axios = require('axios');
|
|
6
|
+
var i18next = require('i18next');
|
|
7
|
+
var strings = require('pure/strings');
|
|
5
8
|
var ramda = require('ramda');
|
|
6
9
|
var mixpanel = require('mixpanel-browser');
|
|
7
|
-
var i18n = require('i18next');
|
|
8
10
|
var reactI18next = require('react-i18next');
|
|
9
11
|
|
|
10
12
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
13
|
|
|
12
14
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
15
|
+
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
13
16
|
var mixpanel__default = /*#__PURE__*/_interopDefaultLegacy(mixpanel);
|
|
14
|
-
var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
|
|
15
17
|
|
|
16
18
|
var _document$getElements, _document$getElements2;
|
|
17
19
|
window.globalProps = objects.keysToCamelCase(JSON.parse(((_document$getElements = document.getElementsByClassName("root-container")[0]) === null || _document$getElements === void 0 ? void 0 : (_document$getElements2 = _document$getElements.dataset) === null || _document$getElements2 === void 0 ? void 0 : _document$getElements2.reactProps) || "{}"));
|
|
18
20
|
objects.deepFreezeObject(window.globalProps);
|
|
19
21
|
|
|
22
|
+
function _arrayWithHoles(arr) {
|
|
23
|
+
if (Array.isArray(arr)) return arr;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function _iterableToArrayLimit(arr, i) {
|
|
27
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
28
|
+
|
|
29
|
+
if (_i == null) return;
|
|
30
|
+
var _arr = [];
|
|
31
|
+
var _n = true;
|
|
32
|
+
var _d = false;
|
|
33
|
+
|
|
34
|
+
var _s, _e;
|
|
35
|
+
|
|
36
|
+
try {
|
|
37
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
38
|
+
_arr.push(_s.value);
|
|
39
|
+
|
|
40
|
+
if (i && _arr.length === i) break;
|
|
41
|
+
}
|
|
42
|
+
} catch (err) {
|
|
43
|
+
_d = true;
|
|
44
|
+
_e = err;
|
|
45
|
+
} finally {
|
|
46
|
+
try {
|
|
47
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
48
|
+
} finally {
|
|
49
|
+
if (_d) throw _e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return _arr;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function _arrayLikeToArray(arr, len) {
|
|
57
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
58
|
+
|
|
59
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
60
|
+
arr2[i] = arr[i];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return arr2;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
67
|
+
if (!o) return;
|
|
68
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
69
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
70
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
71
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
72
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _nonIterableRest() {
|
|
76
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function _slicedToArray(arr, i) {
|
|
80
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function _typeof(obj) {
|
|
84
|
+
"@babel/helpers - typeof";
|
|
85
|
+
|
|
86
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
87
|
+
return typeof obj;
|
|
88
|
+
} : function (obj) {
|
|
89
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
90
|
+
}, _typeof(obj);
|
|
91
|
+
}
|
|
92
|
+
|
|
20
93
|
function _defineProperty(obj, key, value) {
|
|
21
94
|
if (key in obj) {
|
|
22
95
|
Object.defineProperty(obj, key, {
|
|
@@ -71,26 +144,51 @@ var handleSuccessResponse = function handleSuccessResponse(response) {
|
|
|
71
144
|
_response$config$tran = _response$config.transformResponseCase,
|
|
72
145
|
transformResponseCase = _response$config$tran === void 0 ? true : _response$config$tran,
|
|
73
146
|
_response$config$incl = _response$config.includeMetadataInResponse,
|
|
74
|
-
includeMetadataInResponse = _response$config$incl === void 0 ? false : _response$config$incl
|
|
147
|
+
includeMetadataInResponse = _response$config$incl === void 0 ? false : _response$config$incl,
|
|
148
|
+
_response$config$show = _response$config.showToastr,
|
|
149
|
+
showToastr = _response$config$show === void 0 ? true : _response$config$show;
|
|
150
|
+
|
|
151
|
+
if (response.data) {
|
|
152
|
+
if (transformResponseCase) response.data = objects.keysToCamelCase(response.data);
|
|
75
153
|
|
|
76
|
-
|
|
77
|
-
|
|
154
|
+
if (showToastr && typeof response.data.notice === "string") {
|
|
155
|
+
neetoui.Toastr.success(response.data.notice);
|
|
156
|
+
}
|
|
78
157
|
}
|
|
79
158
|
|
|
80
159
|
return includeMetadataInResponse ? response : response.data;
|
|
81
160
|
};
|
|
82
161
|
|
|
162
|
+
var handleUnauthorizedErrorResponse = function handleUnauthorizedErrorResponse() {
|
|
163
|
+
resetAuthTokens();
|
|
164
|
+
setTimeout(function () {
|
|
165
|
+
var redirectTo = window.location.pathname === "/login" ? "/login" : "/login?redirect_uri=".concat(encodeURIComponent(window.location.href));
|
|
166
|
+
window.location.href = redirectTo;
|
|
167
|
+
}, 300);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
var showErrorToastr = function showErrorToastr(error) {
|
|
171
|
+
if (axios__default["default"].isCancel(error)) {
|
|
172
|
+
neetoui.Toastr.error(i18next__default["default"].t("neetoCommons.toastr.error.requestCanceled"));
|
|
173
|
+
} else if (error.message === "Network Error") {
|
|
174
|
+
neetoui.Toastr.error(i18next__default["default"].t("neetoCommons.toastr.error.networkError"));
|
|
175
|
+
} else {
|
|
176
|
+
neetoui.Toastr.error(error);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
83
180
|
var handleErrorResponse = function handleErrorResponse(error) {
|
|
84
181
|
var _error$response, _error$response2;
|
|
85
182
|
|
|
183
|
+
var _error$config$showToa = error.config.showToastr,
|
|
184
|
+
showToastr = _error$config$showToa === void 0 ? true : _error$config$showToa;
|
|
185
|
+
|
|
86
186
|
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 404) {
|
|
87
187
|
window.location.href = "/page-not-found";
|
|
88
188
|
} else if (((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 401) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
window.location.href = redirectTo;
|
|
93
|
-
}, 300);
|
|
189
|
+
handleUnauthorizedErrorResponse();
|
|
190
|
+
} else if (showToastr) {
|
|
191
|
+
showErrorToastr(error);
|
|
94
192
|
}
|
|
95
193
|
|
|
96
194
|
return Promise.reject(error);
|
|
@@ -104,13 +202,28 @@ var cleanupCredentialsForCrossOrigin = function cleanupCredentialsForCrossOrigin
|
|
|
104
202
|
})(request);
|
|
105
203
|
};
|
|
106
204
|
|
|
205
|
+
var serializeKeysToSnakeCase = function serializeKeysToSnakeCase(object) {
|
|
206
|
+
if (Array.isArray(object)) {
|
|
207
|
+
return object.map(serializeKeysToSnakeCase);
|
|
208
|
+
} else if (object === null || _typeof(object) !== "object") {
|
|
209
|
+
return object;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return Object.fromEntries(Object.entries(object).map(function (_ref) {
|
|
213
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
214
|
+
key = _ref2[0],
|
|
215
|
+
value = _ref2[1];
|
|
216
|
+
|
|
217
|
+
var val = typeof (value === null || value === void 0 ? void 0 : value.toJSON) === "function" ? value.toJSON() : value;
|
|
218
|
+
return [strings.camelToSnakeCase(key), serializeKeysToSnakeCase(val)];
|
|
219
|
+
}));
|
|
220
|
+
};
|
|
221
|
+
|
|
107
222
|
var transformDataToSnakeCase = function transformDataToSnakeCase(request) {
|
|
108
223
|
var _request$transformReq = request.transformRequestCase,
|
|
109
224
|
transformRequestCase = _request$transformReq === void 0 ? true : _request$transformReq;
|
|
110
225
|
if (!transformRequestCase || !request.data) return request;
|
|
111
|
-
return ramda.
|
|
112
|
-
data: objects.keysToSnakeCase
|
|
113
|
-
})(request);
|
|
226
|
+
return ramda.modify("data", serializeKeysToSnakeCase, request);
|
|
114
227
|
};
|
|
115
228
|
|
|
116
229
|
var registerIntercepts = function registerIntercepts() {
|
|
@@ -145,6 +258,11 @@ var neetoCommons = {
|
|
|
145
258
|
pageDoesNotExist: "Page does not exist.",
|
|
146
259
|
goToHome: "Go home"
|
|
147
260
|
},
|
|
261
|
+
fallbackComponent: {
|
|
262
|
+
somethingWentWrong: "Sorry, something went wrong.",
|
|
263
|
+
tryReloading: "Please try reloading the page.",
|
|
264
|
+
reload: "Reload"
|
|
265
|
+
},
|
|
148
266
|
sidebar: {
|
|
149
267
|
profile: "Profile",
|
|
150
268
|
orgSettings: "Organization Settings",
|
|
@@ -160,6 +278,10 @@ var neetoCommons = {
|
|
|
160
278
|
toastr: {
|
|
161
279
|
success: {
|
|
162
280
|
copiedToClipboard: "Copied to clipboard!"
|
|
281
|
+
},
|
|
282
|
+
error: {
|
|
283
|
+
requestCanceled: "Request cancelled",
|
|
284
|
+
networkError: "No Internet Connection"
|
|
163
285
|
}
|
|
164
286
|
},
|
|
165
287
|
notice: {
|
|
@@ -171,7 +293,7 @@ var en = {
|
|
|
171
293
|
};
|
|
172
294
|
|
|
173
295
|
var initializeI18n = function initializeI18n(resources) {
|
|
174
|
-
|
|
296
|
+
i18next__default["default"].use(reactI18next.initReactI18next).init({
|
|
175
297
|
resources: ramda.mergeDeepLeft({
|
|
176
298
|
en: {
|
|
177
299
|
translation: en
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
package/pure.js
CHANGED
|
@@ -146,8 +146,10 @@ var deepFreezeObject = function deepFreezeObject(object) {
|
|
|
146
146
|
return object;
|
|
147
147
|
};
|
|
148
148
|
var matches = ramda.curry(function (pattern, object) {
|
|
149
|
+
var __parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : object;
|
|
150
|
+
|
|
149
151
|
if (object === pattern) return true;
|
|
150
|
-
if (typeof pattern === "function" && pattern(object)) return true;
|
|
152
|
+
if (typeof pattern === "function" && pattern(object, __parent)) return true;
|
|
151
153
|
if (ramda.isNil(pattern) || ramda.isNil(object)) return false;
|
|
152
154
|
if (_typeof(pattern) !== "object") return false;
|
|
153
155
|
return Object.entries(pattern).every(function (_ref3) {
|
|
@@ -155,7 +157,7 @@ var matches = ramda.curry(function (pattern, object) {
|
|
|
155
157
|
key = _ref4[0],
|
|
156
158
|
value = _ref4[1];
|
|
157
159
|
|
|
158
|
-
return matches(value, object[key]);
|
|
160
|
+
return matches(value, object[key], __parent);
|
|
159
161
|
});
|
|
160
162
|
});
|
|
161
163
|
var filterNonNull = function filterNonNull(object) {
|
package/react.js
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
+
var neetoui = require('@bigbinary/neetoui');
|
|
6
7
|
var react = require('@honeybadger-io/react');
|
|
8
|
+
var reactI18next = require('react-i18next');
|
|
7
9
|
var reactRouterDom = require('react-router-dom');
|
|
8
10
|
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
9
11
|
var layouts = require('@bigbinary/neetoui/layouts');
|
|
@@ -11,8 +13,6 @@ var i18next = require('i18next');
|
|
|
11
13
|
var ramda = require('ramda');
|
|
12
14
|
var strings = require('src/pure/strings');
|
|
13
15
|
var axios = require('axios');
|
|
14
|
-
var neetoui = require('@bigbinary/neetoui');
|
|
15
|
-
var reactI18next = require('react-i18next');
|
|
16
16
|
var Yup = require('yup');
|
|
17
17
|
var formik = require('@bigbinary/neetoui/formik');
|
|
18
18
|
var formik$1 = require('formik');
|
|
@@ -20,35 +20,68 @@ var formik$1 = require('formik');
|
|
|
20
20
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
21
21
|
|
|
22
22
|
function _interopNamespace(e) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
if (e && e.__esModule) return e;
|
|
24
|
+
var n = Object.create(null);
|
|
25
|
+
if (e) {
|
|
26
|
+
Object.keys(e).forEach(function (k) {
|
|
27
|
+
if (k !== 'default') {
|
|
28
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
29
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function () { return e[k]; }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
32
34
|
});
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
n["default"] = e;
|
|
37
|
-
return Object.freeze(n);
|
|
35
|
+
}
|
|
36
|
+
n["default"] = e;
|
|
37
|
+
return Object.freeze(n);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
41
40
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
41
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
42
42
|
var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
|
|
43
43
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
44
44
|
var Yup__namespace = /*#__PURE__*/_interopNamespace(Yup);
|
|
45
45
|
|
|
46
|
+
var _path$2, _path2$1, _path3$1, _path4$1, _path5$1, _path6$1;
|
|
47
|
+
|
|
48
|
+
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
49
|
+
|
|
50
|
+
var SvgFallbackComponent = function SvgFallbackComponent(props) {
|
|
51
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
52
|
+
width: 230,
|
|
53
|
+
height: 230,
|
|
54
|
+
viewBox: "0 0 317 320",
|
|
55
|
+
fill: "none",
|
|
56
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
57
|
+
}, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
58
|
+
d: "M271.071 28.008c-8.563-12.544-25.317-10.81-38.577-10.717-30.899.206-159.103.047-168.105.497-13.866.713-27.79 6.33-30.041 20.132-1.216 7.456-.14 15.427.139 22.94 1.118 30.417 1.953 68.044 5.7 95.148 1.016 7.372 2.35 14.761 6.936 20.853 7.238 9.618 21.581 12.998 33.616 13.2.141.236 110.261 2.828 150.068-.154 11.579-.87 25.682-1.74 33.488-11.652 3.913-4.971 4.246-12.136 5.028-18.171 2.816-21.653 4.695-58.296 7.156-97.59.703-11.222 1.25-24.736-5.408-34.486Zm3.044 27.34c-.082 4.493-3.429 57.629-3.648 60.853-.746 10.901-3.144 45.195-6.244 55.905-3.064 10.571-16.833 13.173-26.189 14.167-7.926.857-15.906 1.35-23.877 1.608-40.911 1.322-129.772 1.044-133.332.949-14.415-.663-30.588-4.888-36.021-19.843a81.026 81.026 0 0 1-3.298-20.918c-2.712-32.616-2.294-42.461-4.372-92.667-.293-7.188-1.76-15.638 1.536-22.356C45.898 18.356 67.727 20.417 81.1 20.27c15.73-.172 149.231-.271 157.495-.338 7.347-.06 15.278-.433 22.12 2.756 12.343 5.744 13.613 20.671 13.399 32.649v.01Z",
|
|
59
|
+
fill: "#2F3941"
|
|
60
|
+
})), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
61
|
+
d: "M220.642 50.4a1.586 1.586 0 0 0-.415-1.21 1.607 1.607 0 0 0-1.177-.52c-35.537-.183-99.035-.669-135.303-.466a1.056 1.056 0 0 0-.76.238 1.044 1.044 0 0 0-.373.699c-.43 34.284-.24 68.58-.24 102.862 0 1.636.685 2.122 1.643 2.162 45.113 2.049 92.2.763 137.476.91a2.342 2.342 0 0 0 1.518-.675c.405-.403.648-.94.68-1.509-.443-33.909-1.227-68.635-3.049-102.49Zm-2.277.78c1.187 24.763 1.712 49.901 2.264 74.806-45.853 1.664-90.202.658-135.787.522 0-24.642-.313-50.868 0-76.093 43.482.375 89.992.537 133.523.764ZM91.463 151.855l16.27-22.423 18.964.294c-3.709 5.108-12.138 17.321-14.959 22.512-6.749-.114-20.275-.383-20.275-.383Zm42.769.671 15.24-22.699c6.347 0 12.699-.04 19.055-.12-3.627 6.705-10.492 16.8-14.739 22.976-6.51-.007-13.028-.059-19.556-.157Zm42.469.228c5.503-8.232 10.238-15.419 16.186-23.434 6.993-.163 13.993-.365 20.998-.605-4.761 6.22-12.597 17.04-15.361 23.986-7.274.037-14.548.054-21.823.053Z",
|
|
62
|
+
fill: "#2F3941"
|
|
63
|
+
})), _path3$1 || (_path3$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
64
|
+
d: "M153.904 69.903c-3.722-.185-22.748 30.824-20.049 34.788 2.493 3.664 37.821 2.965 39.914 0 2.39-3.436-16.031-34.596-19.865-34.788Zm.745 10.224c.19 2.645.576 11.328.205 13.546-.27 1.633-1.778.747-1.796-.113-.065-4.437-.177-8.883-.27-13.32a.957.957 0 0 1 .224-.699.925.925 0 0 1 1.551.221.973.973 0 0 1 .086.365Zm.707 18.984c-.727 2.011-2.791 1.389-2.791-.259-.057-3.119 3.572-1.901 2.791.26v-.001ZM155.392 199.891c1.926 4.35 9.139 2.15 6.621-3.658a3.653 3.653 0 0 0-2.338-2.083 3.669 3.669 0 0 0-3.092.487c-1.534 1.051-2.876 3.875-1.144 5.376a.499.499 0 0 0 .85-.353c.107-1.148-.119-2.371.838-3.231a2.288 2.288 0 0 1 3.549.378 2.661 2.661 0 0 1-.467 3.601 3.032 3.032 0 0 1-4.019-.994c-.313-.517-1.037-.06-.798.477ZM145.571 226.664c3.876.66 7.809.928 11.739.798 4.292.127 8.604.273 12.894.248a1.103 1.103 0 0 0 0-2.204c-4.29-.174-8.602-.186-12.894-.206a57.817 57.817 0 0 0-11.739.39.508.508 0 0 0 0 .974Z",
|
|
65
|
+
fill: "#2F3941"
|
|
66
|
+
})), _path4$1 || (_path4$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
67
|
+
d: "M290.099 17.651a26.343 26.343 0 0 0-14.443-13.727c-8.184-3.209-17.301-2.702-25.923-2.622-36.725.338-187.491.226-197.868.656a46.93 46.93 0 0 0-23.035 6.39c-15.658 9.89-12.084 26.386-11.458 44.885 1.203 35.566 2.12 79.713 6.107 111.322 1.049 8.324 2.204 16.755 6.676 24.05 7.983 13.016 24.148 17.93 39.357 17.867.586 0 34.396.811 73.168 1.099.06 2.045.465 4.305.694 6.462-.845-.102-23.612.467-30.303 1.419a.956.956 0 0 0-.771.893.982.982 0 0 0 .07.415c-3.429 2.898-6.462 6.492-9.588 9.661-3.848 3.879-7.906 7.645-11.5 11.758a.822.822 0 0 0 1.163 1.163c4.026-3.696 7.685-7.846 11.473-11.786 3.151-3.283 6.762-6.462 9.603-10.051a284.168 284.168 0 0 1 30.012-1.086c.02 1.633-.067 3.567 1.553 4.394.249.132.684.04.731-.3.119-2.158.03-4.322-.266-6.463a20.308 20.308 0 0 0-1.205-6.462c9.037.065 18.32.097 27.494.082a22.04 22.04 0 0 0-.498 11.488.589.589 0 0 0 .558.411.583.583 0 0 0 .558-.411c.323-1.081.516-2.196.575-3.323 5.085.679 9.298.204 22.997 1.059 2.081.132 5.048.161 6.8.151a49.891 49.891 0 0 0 9.03 9.507 126.265 126.265 0 0 0 10.551 9.276c.89.671 1.988-.798 1.188-1.541-3.547-3.244-7.275-6.278-10.814-9.542a93.19 93.19 0 0 0-8.62-8.122.687.687 0 0 0-.296-.8 16.466 16.466 0 0 0-6.571-1.034 303.46 303.46 0 0 0-8.896-.433 119.194 119.194 0 0 0-15.245-.532c.139-2.202.522-4.237.539-6.156 26.179-.057 51.28-.512 67.03-1.762 13.367-1.064 29.723-1.842 38.877-13.173 4.737-5.858 5.182-13.963 6.112-21.166 3.929-30.407 5.575-77.387 8.06-112.188.997-13.655 2.17-28.933-3.676-41.728Zm1.613 31.317c-.146 4.2-3.837 64.939-4.225 70.999-.84 12.757-3.594 52.564-7.069 65.039-3.355 12.052-18.191 15.578-28.953 16.886-9.22 1.123-18.553 1.715-27.836 2.028-47.201 1.6-152.146 1.016-154.02.947-17.12-.746-35.33-6.288-41.204-24.174-2.597-7.906-2.91-16.548-3.567-24.799-2.594-32.741-2.42-43.205-4.722-107.053-.313-8.463-1.814-17.863.596-26.12C26.38 3.355 51.897 4.623 67.642 4.416c18.621-.248 177.824-.437 187.33-.497 8.565-.045 17.791.174 25.046 5.349 12.02 8.565 12.159 26.432 11.694 39.692v.008ZM2.113 306.233c1.504-2.13 36.665-41.756 38.413-43.727a10.606 10.606 0 0 1 9.066-3.728c23.95-.139 47.907-.29 71.857.095 44.688.73 142.992-1.775 146.288-1.74 3.231.032 7.399-.711 9.864 1.66 2.352 2.264 26.674 35.343 35.177 44.204 1.322 1.374 3.407-.716 2.093-2.093-8.324-8.682-29.105-36.658-32.5-40.888a17.18 17.18 0 0 0-4.722-5.016c-4.243-2.115-53.46.465-74.499.942-24.904.57-18.499.127-150.918.092-5.858 0-10.004.249-13.864 5.043-4.439 5.52-35.989 42.114-37.403 44.477-.44.751.663 1.365 1.148.679ZM310.594 315.641c2.172-3.694 6.668-9.738 4.511-10.439-3.336-1.064-312.387 1.784-312.387 1.784s-5.946.154-.249 5.456c5.697 5.301 5.965 6.656 16.25 6.258 10.284-.397 262.609-1.203 269.642-1.091 7.034.112 20.856.37 22.233-1.968Z",
|
|
68
|
+
fill: "#2F3941"
|
|
69
|
+
})), _path5$1 || (_path5$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
70
|
+
d: "M34.938 281.227c-2.187 2.709-11.898 12.69-12.29 15.161a1.074 1.074 0 0 0 .471 1.163c1.328.85 41.622 0 50.602-.032 18.968-.08 153.463.745 156.865.79 2.603.032 4.444-.519 3.169-3.435-4.347-9.942-8.664-19.883-13.081-29.795-1.123-2.513-2.02-2.851-4.722-2.839 0 0-161.347 0-166.45-.059a.918.918 0 0 0-.874.921.92.92 0 0 0 .874.92c31.896.311 159.016-.087 167.966.445.724.045-.248-1.638 13.958 30.395.199.445.147 1.242-2.207 1.3-1.633.034-157.686-.624-193.429-.358-1.899 0-9.956.338-9.897-.14.2-1.6 12.619-14.798 23.217-31.038.365-.559-.497-1.016-.875-.512-.02-.007-8.443 11.098-13.297 17.113ZM238.084 290.689a39.103 39.103 0 0 0 3.124 6.895c.746 1.022 1.243 1.009 2.486 1.049 6.929.216 26.206-.664 45.483-.286 1.275.027 6.532.83 6.463-1.243-.102-3.042-9.343-13.789-22.084-33.67-1.454-2.272-2.08-2.411-4.956-2.284-4.702.199-32.4 1.195-41.541 1.491-1.216.04-1.223 1.934 0 1.894 47.176-1.491 43.545-1.605 43.833-1.422.93.592 1.862 2.879 2.458 3.793 1.33 2.021 17.513 26.115 18.981 28.222.878 1.256.02 1.183-1.739 1.149-1.989-.045-45.168.233-46.573.221-1.739-.022-2.589-3.415-3.3-4.931-9.112-19.476-10.563-22.476-13.054-26.54-.392-.638-1.409-.445-1.131.207 4.36 10.205 7.591 16.5 11.55 25.455ZM285.242 112.053v.445c0 .04.067.04.067 0 0-.147 0-.298.02-.445-.002-.047-.087-.052-.087 0ZM91.163 240.165s131.381-1.695 132.656-1.416c1.275.278-.313 8.776-4.226 8.751-3.912-.025-121.276.922-123.175.171-1.9-.75-7.28-7.478-5.255-7.506Z",
|
|
71
|
+
fill: "#2F3941"
|
|
72
|
+
})), _path6$1 || (_path6$1 = /*#__PURE__*/React__namespace.createElement("path", {
|
|
73
|
+
d: "M45.82 293.676a.023.023 0 0 0 .014-.01.025.025 0 0 0 .005-.016.027.027 0 0 0-.019-.026.027.027 0 0 0-.014.042.023.023 0 0 0 .014.01ZM220.834 284.323c-2.237-.034-6-.062-10.973-.082-1.198-2.995.522 1.459-4.325-10.759 4.354 0 7.692 0 9.735.025a.767.767 0 0 0 .545-.226.767.767 0 0 0 0-1.09.77.77 0 0 0-.545-.225c-2.09-.03-5.666-.057-10.376-.077-1.134-2.734-1.506-3.154-2.411-3.637a.552.552 0 0 0-.798.319c-.291.832-.328 1.339.355 3.308-8.714-.03-20.504-.047-33.677-.05a23.38 23.38 0 0 0-2.021-4.446.51.51 0 0 0-.566-.224.509.509 0 0 0-.383.472c.033 1.409.199 2.811.497 4.188-11.212 0-23.326 0-35.336.027a706.988 706.988 0 0 0-.186-3.171.582.582 0 0 0-1.161 0 442.255 442.255 0 0 0-.313 3.174c-12.514.017-24.854.045-35.902.079a6.379 6.379 0 0 0-.378-2.835c-.107-.266-.457-.443-.676-.187a6.309 6.309 0 0 0-1.322 3.03c-12.572.042-23.276.094-30.335.154a18.732 18.732 0 0 0 1.8-3.577c.372-1.061-1.22-2.03-1.954-1.128-1.223 1.511-2.374 3.112-3.495 4.742-2.634.03-4.386.062-5.067.095a.503.503 0 0 0-.357.861.503.503 0 0 0 .357.148c1.155.087 2.55.164 4.158.236-5.903 8.771-5.418 7.829-7.526 11.008-3.607.032-5.985.067-6.83.104a.503.503 0 0 0-.505.505.505.505 0 0 0 .505.504c1.39.1 3.4.184 5.94.249a48.466 48.466 0 0 0-3.343 6.094.431.431 0 0 0 .746.433c1.491-2.168 3.149-4.337 4.859-6.462 8.45.191 21.417.268 36.556.28a22.934 22.934 0 0 0-1.295 5.891c-.048.723.89.823 1.242.338a22.61 22.61 0 0 0 2.963-6.214c12.082 0 25.401-.03 38.835-.079a13.904 13.904 0 0 0 .698 6.238.857.857 0 0 0 .746.429.857.857 0 0 0 .746-.429 13.875 13.875 0 0 0 .952-6.251c13.227-.052 26.474-.116 38.666-.171a25.556 25.556 0 0 0 2.281 5.572.781.781 0 0 0 1.442-.392 24.472 24.472 0 0 0-.816-5.193c13.586-.062 25.705-.111 34.797-.114a27.226 27.226 0 0 0 3.362 6.462c.353.47 1.362.41 1.283-.345a25.886 25.886 0 0 0-1.554-6.119c4.439 0 7.974.022 10.37.059a.761.761 0 0 0 .543-.229.766.766 0 0 0 .222-.546.77.77 0 0 0-.775-.766Zm-170.101.139c3.142-3.859 6.303-7.563 8.562-10.853 7.58.248 18.36.358 30.772.4a97.23 97.23 0 0 1-3.278 10.287c-15.024.045-27.84.102-36.056.166Zm38.892-.173c2.341-7.884 2.585-7.954 3.072-10.273 11.167.028 23.527 0 35.999-.057-.562 6.246-.38 6.529-.691 10.247-13.287.02-26.457.048-38.38.083Zm41.303-.087c-.144-3.319.03-4.226-.263-10.253 12.178-.057 24.392-.142 35.668-.221.621 2.423-.107-.639 2.838 10.439-12.059.01-25.167.017-38.243.035Zm41.164-.023c-.072-.248-3.022-10.14-3.122-10.471 13.235-.094 25.019-.181 33.668-.216 1.941 5.087 1.325 3.139 4.136 10.737-9.003-.032-21.099-.047-34.682-.05ZM281.202 286.259c-1.339-.479-2.53-.671-8.326-.591a140.94 140.94 0 0 0-7.491-12.89 25.902 25.902 0 0 0 7.379-.656.778.778 0 0 0 .398-1.209.778.778 0 0 0-.398-.282c-2.98-.66-6.05-.813-9.081-.452a201.697 201.697 0 0 0-2.486-3.634.674.674 0 0 0-1.163.679l1.695 3.022c-4.143.151-10.849.437-15.243.636a24.566 24.566 0 0 0-3.679-4.576.437.437 0 0 0-.251-.114.444.444 0 0 0-.479.539 25.034 25.034 0 0 0 1.613 4.28 45.342 45.342 0 0 0-8.833.763.515.515 0 0 0-.365.489.511.511 0 0 0 .365.488c3.286.677 6.655.86 9.996.542 1.327 2.443 2.833 4.824 4.079 7.126 1.006 1.854 1.953 3.842 2.965 5.798a40.865 40.865 0 0 0-9.527.716.499.499 0 0 0-.405.488.496.496 0 0 0 .405.489c3.549.665 7.169.868 10.769.604a28.675 28.675 0 0 0 3.542 5.078c.37.412.962-.035.868-.498a23.462 23.462 0 0 0-1.452-4.583 1830.64 1830.64 0 0 0 15.658-.134 30.665 30.665 0 0 0 2.662 4.012c.378.497 1.283.248 1.076-.45a29.948 29.948 0 0 0-1.337-3.587 23.018 23.018 0 0 0 7.071-.599.775.775 0 0 0 .542-.756.78.78 0 0 0-.567-.738Zm-26.223-.126c-1.213-2.414-2.63-4.75-3.865-6.989-1.029-1.859-2.068-3.91-3.211-5.911 3.728-.082 8.656-.218 15.263-.4 3.599 6.462 5.696 10.337 7.091 12.882-3.291.047-6.51.157-15.278.408v.01Z",
|
|
74
|
+
fill: "#2F3941"
|
|
75
|
+
})));
|
|
76
|
+
};
|
|
77
|
+
|
|
46
78
|
react.Honeybadger.beforeNotify(function (notice) {
|
|
47
79
|
return !/ResizeObserver/.test(notice.message);
|
|
48
80
|
});
|
|
49
81
|
var honeybadger = react.Honeybadger.configure({
|
|
50
82
|
apiKey: globalProps.honeybadgerApiKey,
|
|
51
83
|
environment: globalProps.nodeEnv,
|
|
84
|
+
revision: globalProps.honeybadgerRevision,
|
|
52
85
|
developmentEnvironments: ["development", "test"],
|
|
53
86
|
enableUncaught: true,
|
|
54
87
|
async: true,
|
|
@@ -56,9 +89,42 @@ var honeybadger = react.Honeybadger.configure({
|
|
|
56
89
|
projectRoot: "webpack:///./"
|
|
57
90
|
});
|
|
58
91
|
|
|
92
|
+
var FallbackComponent = function FallbackComponent() {
|
|
93
|
+
var _useTranslation = reactI18next.useTranslation(),
|
|
94
|
+
t = _useTranslation.t;
|
|
95
|
+
|
|
96
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
97
|
+
className: "flex h-screen w-full flex-row items-start justify-start"
|
|
98
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
99
|
+
className: "m-auto text-center"
|
|
100
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
101
|
+
className: "m-auto mb-8 flex items-center justify-center"
|
|
102
|
+
}, /*#__PURE__*/React__default["default"].createElement(SvgFallbackComponent, null)), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
103
|
+
component: "h2",
|
|
104
|
+
style: "h2",
|
|
105
|
+
weight: "semibold",
|
|
106
|
+
className: "mb-4"
|
|
107
|
+
}, t("neetoCommons.fallbackComponent.somethingWentWrong")), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
108
|
+
component: "p",
|
|
109
|
+
style: "body1",
|
|
110
|
+
weight: "normal",
|
|
111
|
+
className: "mb-8 text-gray-600"
|
|
112
|
+
}, t("neetoCommons.fallbackComponent.tryReloading")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
113
|
+
className: "flex flex-row items-center justify-center"
|
|
114
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
115
|
+
style: "primary",
|
|
116
|
+
size: "large",
|
|
117
|
+
onClick: function onClick() {
|
|
118
|
+
return window.location.reload(false);
|
|
119
|
+
},
|
|
120
|
+
label: t("neetoCommons.fallbackComponent.reload")
|
|
121
|
+
}))));
|
|
122
|
+
};
|
|
123
|
+
|
|
59
124
|
var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
|
|
60
125
|
var children = _ref.children,
|
|
61
|
-
ErrorComponent = _ref.ErrorComponent
|
|
126
|
+
_ref$ErrorComponent = _ref.ErrorComponent,
|
|
127
|
+
ErrorComponent = _ref$ErrorComponent === void 0 ? FallbackComponent : _ref$ErrorComponent;
|
|
62
128
|
return /*#__PURE__*/React__default["default"].createElement(react.HoneybadgerErrorBoundary, {
|
|
63
129
|
honeybadger: honeybadger,
|
|
64
130
|
ErrorComponent: ErrorComponent
|