@beinformed/ui 1.20.3 → 1.20.4
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/CHANGELOG.md +7 -0
- package/esm/hooks/useAuthentication.js +1 -0
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js +3 -2
- package/esm/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js +4 -3
- package/esm/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/esm/redux/_modularui/actions.js +1 -1
- package/esm/redux/_modularui/actions.js.map +1 -1
- package/esm/redux/actions/Authorization.js +4 -9
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/SignIn.js +7 -0
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/types.js.map +1 -1
- package/lib/hooks/useAuthentication.js +2 -0
- package/lib/hooks/useAuthentication.js.flow +2 -0
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js +3 -2
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.flow +3 -2
- package/lib/i18n/translations/beinformed_error_messages_en.nl.js.map +1 -1
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js +4 -3
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.flow +4 -3
- package/lib/i18n/translations/beinformed_error_messages_nl.nl.js.map +1 -1
- package/lib/redux/_modularui/actions.js +1 -1
- package/lib/redux/_modularui/actions.js.flow +1 -4
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/actions/Authorization.js +4 -10
- package/lib/redux/actions/Authorization.js.flow +3 -16
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/SignIn.js +12 -2
- package/lib/redux/actions/SignIn.js.flow +11 -2
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/__tests__/Authorization.spec.js.flow +4 -18
- package/lib/redux/types.js.flow +2 -2
- package/lib/redux/types.js.map +1 -1
- package/package.json +16 -16
- package/src/hooks/useAuthentication.js +2 -0
- package/src/i18n/translations/beinformed_error_messages_en.nl.js +3 -2
- package/src/i18n/translations/beinformed_error_messages_nl.nl.js +4 -3
- package/src/redux/_modularui/actions.js +1 -4
- package/src/redux/actions/Authorization.js +3 -16
- package/src/redux/actions/SignIn.js +11 -2
- package/src/redux/actions/__tests__/Authorization.spec.js +4 -18
- package/src/redux/types.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.4",
|
|
4
4
|
"description": "Toolbox for be informed javascript layouts",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bugs": "http://support.beinformed.com",
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"styled-components": "^5.0.0"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@babel/runtime-corejs3": "^7.18.
|
|
81
|
+
"@babel/runtime-corejs3": "^7.18.6",
|
|
82
82
|
"big.js": "^6.2.0",
|
|
83
83
|
"date-fns": "^2.28.0",
|
|
84
84
|
"deepmerge": "^4.2.2",
|
|
@@ -95,18 +95,18 @@
|
|
|
95
95
|
"setimmediate": "^1.0.5"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
|
-
"@babel/cli": "^7.
|
|
99
|
-
"@babel/core": "^7.18.
|
|
98
|
+
"@babel/cli": "^7.18.6",
|
|
99
|
+
"@babel/core": "^7.18.6",
|
|
100
100
|
"@babel/eslint-parser": "^7.18.2",
|
|
101
101
|
"@babel/eslint-plugin": "^7.16.5",
|
|
102
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
102
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
103
103
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
104
|
-
"@babel/plugin-transform-runtime": "^7.18.
|
|
105
|
-
"@babel/preset-env": "^7.18.
|
|
106
|
-
"@babel/preset-flow": "^7.
|
|
107
|
-
"@babel/preset-react": "^7.
|
|
108
|
-
"@commitlint/cli": "^17.0.
|
|
109
|
-
"@commitlint/config-conventional": "^17.0.
|
|
104
|
+
"@babel/plugin-transform-runtime": "^7.18.6",
|
|
105
|
+
"@babel/preset-env": "^7.18.6",
|
|
106
|
+
"@babel/preset-flow": "^7.18.6",
|
|
107
|
+
"@babel/preset-react": "^7.18.6",
|
|
108
|
+
"@commitlint/cli": "^17.0.3",
|
|
109
|
+
"@commitlint/config-conventional": "^17.0.3",
|
|
110
110
|
"@testing-library/react": "^13.3.0",
|
|
111
111
|
"auditjs": "^4.0.37",
|
|
112
112
|
"babel-jest": "^28.1.1",
|
|
@@ -121,20 +121,20 @@
|
|
|
121
121
|
"eslint-plugin-import": "^2.26.0",
|
|
122
122
|
"eslint-plugin-jest": "^26.5.3",
|
|
123
123
|
"eslint-plugin-jsdoc": "^39.3.3",
|
|
124
|
-
"eslint-plugin-react": "^7.30.
|
|
124
|
+
"eslint-plugin-react": "^7.30.1",
|
|
125
125
|
"eslint-plugin-react-hooks": "^4.5.0",
|
|
126
|
-
"flow-bin": "^0.
|
|
126
|
+
"flow-bin": "^0.181.1",
|
|
127
127
|
"flow-copy-source": "^2.0.9",
|
|
128
|
-
"flow-typed": "^3.
|
|
128
|
+
"flow-typed": "^3.8.0",
|
|
129
129
|
"glob": "^8.0.3",
|
|
130
130
|
"history": "^4.0.0",
|
|
131
131
|
"husky": "^8.0.1",
|
|
132
132
|
"jest": "^28.1.1",
|
|
133
133
|
"jest-environment-jsdom": "^28.1.1",
|
|
134
|
-
"jest-junit": "^
|
|
134
|
+
"jest-junit": "^14.0.0",
|
|
135
135
|
"jest-sonar-reporter": "^2.0.0",
|
|
136
136
|
"jscodeshift": "^0.13.1",
|
|
137
|
-
"lint-staged": "^13.0.
|
|
137
|
+
"lint-staged": "^13.0.3",
|
|
138
138
|
"polished": "^4.0.0",
|
|
139
139
|
"prettier": "^2.7.1",
|
|
140
140
|
"react": "^18.0.0",
|
|
@@ -31,6 +31,7 @@ export default {
|
|
|
31
31
|
"Constraint.File.InvalidFormat": "Must meet the requirements of the file name",
|
|
32
32
|
"Constraint.File.InvalidMimeType": "Allowed mime types are: ${mime-types}",
|
|
33
33
|
"Constraint.File.MaxFileSizeExceeded": "Maximum file upload size is ${max-filesize}",
|
|
34
|
+
"Constraint.File.OnlyAllowsOneFile": "Only one file is allowed",
|
|
34
35
|
"Constraint.IBAN.InvalidFormat": "Must be a valid IBAN number",
|
|
35
36
|
"Constraint.InvalidLengthBetween": "Length must be between ${min-length} and ${max-length} characters",
|
|
36
37
|
"Constraint.InvalidLengthExact": "Length must be precisely ${length} characters",
|
|
@@ -65,7 +66,7 @@ export default {
|
|
|
65
66
|
"Constraint.TimeStampRange.InvalidRange": "Start value must be before end value",
|
|
66
67
|
"Constraint.TimeStampRange.Mandatory": "Field is mandatory: must contain at least a start or end value",
|
|
67
68
|
"Constraint.XML.InvalidFormat": "Must be well-formed XML",
|
|
68
|
-
"Constraint.ZipCode.InvalidFormat": "Must be a valid Dutch ZIP code, e.g.
|
|
69
|
+
"Constraint.ZipCode.InvalidFormat": "Must be a valid Dutch ZIP code, e.g. 1234AB",
|
|
69
70
|
"Error.AcceptHeaderRequired": "The 'Accept' request-header field must be provided",
|
|
70
71
|
"Error.Authentication.BlockedUser": "You have been logged out, because your account has been blocked",
|
|
71
72
|
"Error.Authentication.ConcurrentUser": "You have been logged out, since your username has been used at a different location.",
|
|
@@ -76,7 +77,7 @@ export default {
|
|
|
76
77
|
"Error.ChangePasswordRequired": "User password is initial or expired, and must be changed ",
|
|
77
78
|
"Error.CodemapLookup.InvalidToken": "Token for codemap lookup is not valid",
|
|
78
79
|
"Error.DataStore.ConcurrentModification": "Another user has updated a record used in this task",
|
|
79
|
-
"Error.DataStore.RecordAlreadyExists": "
|
|
80
|
+
"Error.DataStore.RecordAlreadyExists": "",
|
|
80
81
|
"Error.DataStore.RowCannotBeLocked": "Another user has already locked a record used in this task",
|
|
81
82
|
"Error.Form.DataNotAvailableForId": "Service can not be completed, data not available for mandatory element ${elementid}",
|
|
82
83
|
"Error.Form.ObjectNotAllowed": "Object '${objectid}' is not allowed",
|
|
@@ -31,6 +31,7 @@ export default {
|
|
|
31
31
|
"Constraint.File.InvalidFormat": "Voldoet niet aan de voorwaarden van een bestandsnaam",
|
|
32
32
|
"Constraint.File.InvalidMimeType": "Toegestane mime-types zijn: ${mime-types}",
|
|
33
33
|
"Constraint.File.MaxFileSizeExceeded": "De maximum file grootte voor upload is ${max-filesize}",
|
|
34
|
+
"Constraint.File.OnlyAllowsOneFile": "Er is slechts één bestand toegestaan",
|
|
34
35
|
"Constraint.IBAN.InvalidFormat": "Moet een geldig IBAN nummer zijn",
|
|
35
36
|
"Constraint.InvalidLengthBetween": "Lengte moet tussen ${min-length} en ${max-length} karakters liggen",
|
|
36
37
|
"Constraint.InvalidLengthExact": "Lengte moet precies ${length} karakters zijn",
|
|
@@ -65,18 +66,18 @@ export default {
|
|
|
65
66
|
"Constraint.TimeStampRange.InvalidRange": "De beginwaarde dient voor de eindwaarde te liggen",
|
|
66
67
|
"Constraint.TimeStampRange.Mandatory": "Veld is verplicht: moet tenminste begin- of eindwaarde bevatten",
|
|
67
68
|
"Constraint.XML.InvalidFormat": "Moet geldige XML zijn",
|
|
68
|
-
"Constraint.ZipCode.InvalidFormat": "Moet een geldige postcode zijn, bijvoorbeeld
|
|
69
|
+
"Constraint.ZipCode.InvalidFormat": "Moet een geldige postcode zijn, bijvoorbeeld 1234AB",
|
|
69
70
|
"Error.AcceptHeaderRequired": "De 'Accept' request-header moet worden meegegeven",
|
|
70
71
|
"Error.Authentication.BlockedUser": "U bent uitgelogd omdat uw account geblokkeerd is",
|
|
71
72
|
"Error.Authentication.ConcurrentUser": "U bent uitgelogd omdat uw gebruikersnaam op een andere locatie is gebruikt om in te loggen.",
|
|
72
73
|
"Error.Authentication.InvalidCredentials": "Inloggen is mislukt",
|
|
73
|
-
"Error.Authentication.InvalidUsername": "
|
|
74
|
+
"Error.Authentication.InvalidUsername": "U bent uitgelogd omdat uw gebruikersnaam niet meer geldig is",
|
|
74
75
|
"Error.Authentication.Required": "Autorisatie is vereist",
|
|
75
76
|
"Error.Case.ConcurrentModification": "Een andere gebruiker heeft het dossier aangepast waardoor deze taak nu niet meer is toegestaan",
|
|
76
77
|
"Error.ChangePasswordRequired": "Gebruikerswachtwoord is initieel of verlopen, en moet worden aangepast",
|
|
77
78
|
"Error.CodemapLookup.InvalidToken": "Token voor keuzelijst lookup is niet valide",
|
|
78
79
|
"Error.DataStore.ConcurrentModification": "Een andere gebruiker heeft de rij in de datastore reeds aangepast",
|
|
79
|
-
"Error.DataStore.RecordAlreadyExists": "
|
|
80
|
+
"Error.DataStore.RecordAlreadyExists": "",
|
|
80
81
|
"Error.DataStore.RowCannotBeLocked": "Een andere gebruiker heeft de rij in bewerking en daarom kan deze taak niet worden volbracht.",
|
|
81
82
|
"Error.Form.DataNotAvailableForId": "Service kan niet worden afgrond, data voor verplicht element ${elementid} is niet beschikbaar",
|
|
82
83
|
"Error.Form.ObjectNotAllowed": "Object '${objectid}' is niet toegestaan",
|
|
@@ -116,10 +116,7 @@ export const loadModel = (
|
|
|
116
116
|
return {
|
|
117
117
|
type: "NO_ACTION",
|
|
118
118
|
};
|
|
119
|
-
} else if (
|
|
120
|
-
errorResponse.isResourceNotFoundAfterReload ||
|
|
121
|
-
errorResponse.isInvalidUsername
|
|
122
|
-
) {
|
|
119
|
+
} else if (errorResponse.isResourceNotFoundAfterReload) {
|
|
123
120
|
return removeModelByKey(key);
|
|
124
121
|
}
|
|
125
122
|
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import { NOTIFICATION_TYPES } from "../../constants/Constants";
|
|
3
|
-
|
|
4
2
|
import ErrorResponse from "../../models/error/ErrorResponse";
|
|
5
3
|
|
|
6
4
|
import { replace } from "../_router/actions";
|
|
7
5
|
import { logoutSuccess } from "./SignOut";
|
|
8
|
-
import { showNotification } from "./Notification";
|
|
9
6
|
|
|
10
7
|
import Cache from "../../utils/browser/Cache";
|
|
11
8
|
|
|
@@ -16,6 +13,7 @@ import { reloadApplication } from "./Application";
|
|
|
16
13
|
import { getSetting } from "../../constants";
|
|
17
14
|
|
|
18
15
|
import type { ThunkAction } from "../types";
|
|
16
|
+
import { sendAuthenticationError } from "./SignIn";
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
*/
|
|
@@ -40,24 +38,13 @@ export const handleUnauthorized =
|
|
|
40
38
|
dispatch(reloadApplication());
|
|
41
39
|
}
|
|
42
40
|
|
|
43
|
-
// set logged
|
|
41
|
+
// set logged out
|
|
44
42
|
dispatch(logoutSuccess());
|
|
45
43
|
|
|
46
44
|
Cache.removeItem("auth");
|
|
47
45
|
|
|
48
46
|
if (errorResponse.isInvalidUsername) {
|
|
49
|
-
|
|
50
|
-
dispatch(
|
|
51
|
-
showNotification(
|
|
52
|
-
NOTIFICATION_TYPES.WARNING,
|
|
53
|
-
{
|
|
54
|
-
id: errorResponse.id,
|
|
55
|
-
defaultMessage: errorResponse.message,
|
|
56
|
-
},
|
|
57
|
-
null,
|
|
58
|
-
WARNING_TIMEOUT
|
|
59
|
-
)
|
|
60
|
-
);
|
|
47
|
+
dispatch(sendAuthenticationError(errorResponse.message));
|
|
61
48
|
}
|
|
62
49
|
|
|
63
50
|
// add current location as from location before redirect
|
|
@@ -9,7 +9,7 @@ import { push } from "../_router/actions";
|
|
|
9
9
|
import { CHANGEPASSWORD_PATH } from "../../constants/Constants";
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
|
-
|
|
12
|
+
SendAuthenticationErrorAction,
|
|
13
13
|
ResetAuthErrorsAction,
|
|
14
14
|
LoginSuccessAction,
|
|
15
15
|
ThunkAction,
|
|
@@ -18,7 +18,16 @@ import type {
|
|
|
18
18
|
/**
|
|
19
19
|
* Send login failed action
|
|
20
20
|
*/
|
|
21
|
-
export const loginFailed = (
|
|
21
|
+
export const loginFailed = (
|
|
22
|
+
errorMessage: string
|
|
23
|
+
): SendAuthenticationErrorAction => sendAuthenticationError(errorMessage);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Send authentication error action
|
|
27
|
+
*/
|
|
28
|
+
export const sendAuthenticationError = (
|
|
29
|
+
errorMessage: string
|
|
30
|
+
): SendAuthenticationErrorAction => ({
|
|
22
31
|
type: "AUTHENTICATION_ERROR",
|
|
23
32
|
payload: errorMessage,
|
|
24
33
|
});
|
|
@@ -60,15 +60,8 @@ describe("authorization actions", () => {
|
|
|
60
60
|
type: "AUTHENTICATION_LOGOUT",
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
type: "
|
|
64
|
-
payload:
|
|
65
|
-
error: null,
|
|
66
|
-
message: {
|
|
67
|
-
defaultMessage: "Error.Authentication.InvalidUsername",
|
|
68
|
-
id: "Error.Authentication.InvalidUsername",
|
|
69
|
-
},
|
|
70
|
-
type: "WARNING",
|
|
71
|
-
},
|
|
63
|
+
type: "AUTHENTICATION_ERROR",
|
|
64
|
+
payload: "Error.Authentication.InvalidUsername",
|
|
72
65
|
},
|
|
73
66
|
{
|
|
74
67
|
type: "ROUTER/REPLACE",
|
|
@@ -114,15 +107,8 @@ describe("authorization actions", () => {
|
|
|
114
107
|
type: "AUTHENTICATION_LOGOUT",
|
|
115
108
|
},
|
|
116
109
|
{
|
|
117
|
-
type: "
|
|
118
|
-
payload:
|
|
119
|
-
error: null,
|
|
120
|
-
message: {
|
|
121
|
-
defaultMessage: "Error.Authentication.InvalidUsername",
|
|
122
|
-
id: "Error.Authentication.InvalidUsername",
|
|
123
|
-
},
|
|
124
|
-
type: "WARNING",
|
|
125
|
-
},
|
|
110
|
+
type: "AUTHENTICATION_ERROR",
|
|
111
|
+
payload: "Error.Authentication.InvalidUsername",
|
|
126
112
|
},
|
|
127
113
|
{
|
|
128
114
|
type: "ROUTER/REPLACE",
|
package/src/redux/types.js
CHANGED
|
@@ -103,7 +103,7 @@ export type UpdateProgressAction = {
|
|
|
103
103
|
payload: { percentComplete: number },
|
|
104
104
|
};
|
|
105
105
|
|
|
106
|
-
export type
|
|
106
|
+
export type SendAuthenticationErrorAction = {
|
|
107
107
|
type: "AUTHENTICATION_ERROR",
|
|
108
108
|
payload: string,
|
|
109
109
|
};
|
|
@@ -151,8 +151,8 @@ export type ReduxAction =
|
|
|
151
151
|
| FinishProgressAction
|
|
152
152
|
| ResetProgressAction
|
|
153
153
|
| UpdateProgressAction
|
|
154
|
-
| LoginFailedAction
|
|
155
154
|
| ResetAuthErrorsAction
|
|
155
|
+
| SendAuthenticationErrorAction
|
|
156
156
|
| LoginSuccessAction
|
|
157
157
|
| ChangePasswordAction
|
|
158
158
|
| LogoutSuccessAction
|