@beinformed/ui 1.20.9 → 1.21.1
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 +21 -0
- package/esm/constants/Settings.js +2 -0
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/attributes/AttributeDataHelper.js +6 -1
- package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
- package/esm/models/error/ErrorModel.js +12 -1
- package/esm/models/error/ErrorModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +111 -0
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/lib/constants/Settings.js +5 -1
- package/lib/constants/Settings.js.flow +3 -0
- package/lib/constants/Settings.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js +6 -1
- package/lib/models/attributes/AttributeDataHelper.js.flow +5 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/error/ErrorModel.js +11 -0
- package/lib/models/error/ErrorModel.js.flow +9 -1
- package/lib/models/error/ErrorModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +110 -0
- package/lib/models/error/ErrorResponse.js.flow +102 -0
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/types.js.flow +1 -0
- package/lib/models/types.js.map +1 -1
- package/lib/redux/actions/__tests__/Error-server.spec.js.flow +0 -1
- package/package.json +5 -5
- package/src/constants/Settings.js +3 -0
- package/src/models/attributes/AttributeDataHelper.js +5 -1
- package/src/models/error/ErrorModel.js +9 -1
- package/src/models/error/ErrorResponse.js +102 -0
- package/src/models/types.js +1 -0
- package/src/redux/actions/__tests__/Error-server.spec.js +0 -1
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
import Href from "../href/Href";
|
|
3
3
|
|
|
4
4
|
import type { MessageParameters } from "../../i18n/types";
|
|
5
|
+
import LayoutHintCollection from "../layouthint/LayoutHintCollection";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*/
|
|
9
|
+
export type TitleObject = {
|
|
10
|
+
+id: string,
|
|
11
|
+
+properties?: Object,
|
|
12
|
+
+message?: string,
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
*/
|
|
16
|
+
export type RedirectTextObject = {
|
|
17
|
+
+id: string,
|
|
18
|
+
+properties?: Object,
|
|
19
|
+
+message?: string,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*/
|
|
24
|
+
export type RedirectObject = {
|
|
25
|
+
+href: Href,
|
|
26
|
+
+text?: RedirectTextObject,
|
|
27
|
+
};
|
|
5
28
|
|
|
6
29
|
/**
|
|
7
30
|
* Error response model
|
|
@@ -65,6 +88,85 @@ export default class ErrorResponse {
|
|
|
65
88
|
return this.error.message || this.id;
|
|
66
89
|
}
|
|
67
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Return error title
|
|
93
|
+
*/
|
|
94
|
+
get title(): TitleObject {
|
|
95
|
+
return this.error.title || null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Return error title message
|
|
100
|
+
*/
|
|
101
|
+
get titleMessage(): string {
|
|
102
|
+
return this.error.title?.message || undefined;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Return error title Id
|
|
107
|
+
*/
|
|
108
|
+
get titleId(): string {
|
|
109
|
+
return this.error.title?.id || undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Return error title properties
|
|
114
|
+
*/
|
|
115
|
+
get titleProperties(): Object {
|
|
116
|
+
return this.error.title?.properties || null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Return error redirect
|
|
121
|
+
*/
|
|
122
|
+
get redirect(): RedirectObject {
|
|
123
|
+
return this.error.redirect || null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Return error redirect text
|
|
127
|
+
*/
|
|
128
|
+
get redirectText(): RedirectTextObject {
|
|
129
|
+
return this.error.redirect?.text || null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Return error redirect text id
|
|
134
|
+
*/
|
|
135
|
+
get redirectTextID(): string {
|
|
136
|
+
return this.error.redirect?.text?.id || undefined;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Return error redirect text properties
|
|
141
|
+
*/
|
|
142
|
+
get redirectTextProperties(): Object {
|
|
143
|
+
return this.error.redirect?.text?.properties || null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Return error redirect text message
|
|
148
|
+
*/
|
|
149
|
+
get redirectMessage(): string {
|
|
150
|
+
return this.error.redirect?.text?.message || undefined;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Return error redirect href
|
|
155
|
+
*/
|
|
156
|
+
get redirectHref(): Href {
|
|
157
|
+
if (this.error.redirect?.href) {
|
|
158
|
+
return new Href(this.error.redirect.href);
|
|
159
|
+
}
|
|
160
|
+
return new Href();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Return error layouthint
|
|
165
|
+
*/
|
|
166
|
+
get layouthint(): LayoutHintCollection {
|
|
167
|
+
return new LayoutHintCollection(this.error.layouthint);
|
|
168
|
+
}
|
|
169
|
+
|
|
68
170
|
/**
|
|
69
171
|
*/
|
|
70
172
|
get response(): Object {
|
package/src/models/types.js
CHANGED