@beinformed/ui 1.45.3 → 1.46.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 +20 -0
- package/esm/models/application/ApplicationModel.js +7 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js +2 -2
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +2 -2
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +2 -2
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +2 -2
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/base/ResourceCollection.js +2 -2
- package/esm/models/base/ResourceCollection.js.map +1 -1
- package/esm/models/base/ResourceModel.js +8 -7
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +2 -2
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +2 -2
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +2 -2
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +2 -2
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +2 -3
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/detail/DetailModel.js +2 -2
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/form/FormModel.js +3 -4
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +2 -2
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +4 -4
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +16 -1
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +7 -3
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/react-client/rehydrate.js +1 -1
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/redux/actions/SignIn.js +8 -2
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/store/configureStore.js +5 -0
- package/esm/redux/store/configureStore.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +7 -1
- package/lib/models/application/ApplicationModel.js.flow +7 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +2 -1
- package/lib/models/attributes/AttributeModel.js.flow +5 -1
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +2 -2
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +3 -2
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +2 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +3 -2
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +2 -2
- package/lib/models/attributes/CompositeAttributeModel.js.flow +3 -2
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/base/ResourceCollection.js +2 -2
- package/lib/models/base/ResourceCollection.js.flow +3 -2
- package/lib/models/base/ResourceCollection.js.map +1 -1
- package/lib/models/base/ResourceModel.js +8 -7
- package/lib/models/base/ResourceModel.js.flow +12 -4
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +2 -2
- package/lib/models/caseview/CaseViewModel.js.flow +3 -2
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +2 -2
- package/lib/models/concepts/BusinessScenarioModel.js.flow +3 -2
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +2 -2
- package/lib/models/concepts/ConceptDetailModel.js.flow +3 -2
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +2 -2
- package/lib/models/concepts/ConceptIndexModel.js.flow +3 -2
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +2 -2
- package/lib/models/content/ContentIndexModel.js.flow +4 -3
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/detail/DetailModel.js +2 -2
- package/lib/models/detail/DetailModel.js.flow +3 -2
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/form/FormModel.js +3 -3
- package/lib/models/form/FormModel.js.flow +6 -5
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +2 -2
- package/lib/models/form/FormObjectModel.js.flow +3 -2
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +4 -4
- package/lib/models/list/ListDetailModel.js.flow +5 -4
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/types.js.flow +5 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +16 -1
- package/lib/models/user/UserServicesModel.js.flow +18 -1
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +7 -3
- package/lib/modularui/ModularUIRequest.js.flow +7 -3
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/react-client/rehydrate.js +1 -1
- package/lib/react-client/rehydrate.js.flow +1 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/redux/actions/SignIn.js +8 -2
- package/lib/redux/actions/SignIn.js.flow +8 -3
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/store/configureStore.js +5 -0
- package/lib/redux/store/configureStore.js.flow +8 -0
- package/lib/redux/store/configureStore.js.map +1 -1
- package/package.json +7 -7
- package/src/models/application/ApplicationModel.js +7 -1
- package/src/models/attributes/AttributeModel.js +5 -1
- package/src/models/attributes/ChoiceAttributeModel.js +3 -2
- package/src/models/attributes/ChoiceAttributeOptionModel.js +3 -2
- package/src/models/attributes/CompositeAttributeModel.js +3 -2
- package/src/models/base/ResourceCollection.js +3 -2
- package/src/models/base/ResourceModel.js +12 -4
- package/src/models/caseview/CaseViewModel.js +3 -2
- package/src/models/concepts/BusinessScenarioModel.js +3 -2
- package/src/models/concepts/ConceptDetailModel.js +3 -2
- package/src/models/concepts/ConceptIndexModel.js +3 -2
- package/src/models/content/ContentIndexModel.js +4 -3
- package/src/models/detail/DetailModel.js +3 -2
- package/src/models/form/FormModel.js +6 -5
- package/src/models/form/FormObjectModel.js +3 -2
- package/src/models/list/ListDetailModel.js +5 -4
- package/src/models/types.js +5 -1
- package/src/models/user/UserServicesModel.js +18 -1
- package/src/modularui/ModularUIRequest.js +7 -3
- package/src/react-client/rehydrate.js +1 -1
- package/src/redux/actions/SignIn.js +8 -3
- package/src/redux/store/configureStore.js +8 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehydrate.js","names":["_objects","require","_Locales","_interopRequireDefault","_resolveModel","_ModularUIResponse","recreateModel","data","modelData","ModularUIResponse","rehydrate","Model","resolveModel","_context","model","childModels","_map","default","call","childModel","addChildModels","isModularUIModelData","has","rehydratedValue","stateKey","stateValue","Array","isArray","stateItem","locales","Locales","locale","noFurtherRehydration","_includes","state","mappedState","_keys","forEach","_default","exports"],"sources":["../../src/react-client/rehydrate.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\nimport Locales from \"../i18n/Locales\";\n\nimport resolveModel from \"../models/resolveModel\";\n\nimport ModularUIResponse from \"../modularui/ModularUIResponse\";\n\n/**\n * Recreate a model from dehydrated data obtained after a server render.\n */\nconst recreateModel = (data: Object) => {\n const modelData = ModularUIResponse.rehydrate(data);\n\n const Model = resolveModel(modelData);\n\n if (Model) {\n const model = new Model(modelData);\n model.rehydrate(data);\n\n const childModels = data.childModels.map((childModel) =>\n recreateModel(childModel),\n );\n\n model.addChildModels(childModels);\n\n return model;\n }\n\n return data;\n};\n\n/**\n */\nconst isModularUIModelData = (data: any) =>\n data != null &&\n typeof data === \"object\" &&\n has(data, \"data\") &&\n has(data, \"contributions\");\n\n/**\n */\nconst rehydratedValue = (stateKey: string, stateValue: any) => {\n if (Array.isArray(stateValue)) {\n return stateValue.map((stateItem) => rehydrate(stateItem)); // NOSONAR\n }\n\n if (isModularUIModelData(stateValue)) {\n return recreateModel(stateValue);\n }\n\n if (\n stateKey === \"i18n\" &&\n has(stateValue, \"locales\") &&\n has(stateValue, \"locale\")\n ) {\n return {\n locales: Locales.rehydrate(stateValue.locales),\n locale: stateValue?.locale,\n };\n }\n\n const noFurtherRehydration = [\"preferences\", \"router\", \"progressindicator\"];\n if (noFurtherRehydration.includes(stateKey)) {\n return stateValue;\n }\n\n if (stateValue !== null && typeof stateValue === \"object\") {\n return rehydrate(stateValue); // NOSONAR\n }\n\n return stateValue;\n};\n\n/**\n * Maps dehydrated state to models that can be used to rehydrated the application.\n */\nconst rehydrate = (state: Object): { ... } => {\n const mappedState: { [string]: any } = {};\n\n Object.keys(state).forEach((stateKey) => {\n const stateValue = state[stateKey];\n mappedState[stateKey] = rehydratedValue(stateKey, stateValue);\n });\n\n return mappedState;\n};\n\nexport default rehydrate;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,kBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA;AACA,MAAMK,aAAa,GAAIC,IAAY,IAAK;EACtC,MAAMC,SAAS,GAAGC,0BAAiB,CAACC,SAAS,CAACH,IAAI,CAAC;EAEnD,MAAMI,KAAK,GAAG,IAAAC,qBAAY,EAACJ,SAAS,CAAC;EAErC,IAAIG,KAAK,EAAE;IAAA,IAAAE,QAAA;IACT,MAAMC,KAAK,GAAG,IAAIH,KAAK,CAACH,SAAS,CAAC;IAClCM,KAAK,CAACJ,SAAS,CAACH,IAAI,CAAC;IAErB,MAAMQ,WAAW,GAAG,IAAAC,IAAA,CAAAC,OAAA,EAAAJ,QAAA,GAAAN,IAAI,CAACQ,WAAW,EAAAG,IAAA,CAAAL,QAAA,EAAMM,UAAU,IAClDb,aAAa,CAACa,UAAU,CAC1B,CAAC;IAEDL,KAAK,CAACM,cAAc,CAACL,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"rehydrate.js","names":["_objects","require","_Locales","_interopRequireDefault","_resolveModel","_ModularUIResponse","recreateModel","data","modelData","ModularUIResponse","rehydrate","Model","resolveModel","_context","model","childModels","_map","default","call","childModel","addChildModels","isModularUIModelData","has","rehydratedValue","stateKey","stateValue","Array","isArray","stateItem","locales","Locales","locale","noFurtherRehydration","_includes","state","mappedState","_keys","forEach","_default","exports"],"sources":["../../src/react-client/rehydrate.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\nimport Locales from \"../i18n/Locales\";\n\nimport resolveModel from \"../models/resolveModel\";\n\nimport ModularUIResponse from \"../modularui/ModularUIResponse\";\n\n/**\n * Recreate a model from dehydrated data obtained after a server render.\n */\nconst recreateModel = (data: Object) => {\n const modelData = ModularUIResponse.rehydrate(data);\n\n const Model = resolveModel(modelData);\n\n if (Model) {\n const model = new Model(modelData);\n model.rehydrate(data);\n\n const childModels = data.childModels.map((childModel) =>\n recreateModel(childModel),\n );\n\n model.addChildModels(childModels, []);\n\n return model;\n }\n\n return data;\n};\n\n/**\n */\nconst isModularUIModelData = (data: any) =>\n data != null &&\n typeof data === \"object\" &&\n has(data, \"data\") &&\n has(data, \"contributions\");\n\n/**\n */\nconst rehydratedValue = (stateKey: string, stateValue: any) => {\n if (Array.isArray(stateValue)) {\n return stateValue.map((stateItem) => rehydrate(stateItem)); // NOSONAR\n }\n\n if (isModularUIModelData(stateValue)) {\n return recreateModel(stateValue);\n }\n\n if (\n stateKey === \"i18n\" &&\n has(stateValue, \"locales\") &&\n has(stateValue, \"locale\")\n ) {\n return {\n locales: Locales.rehydrate(stateValue.locales),\n locale: stateValue?.locale,\n };\n }\n\n const noFurtherRehydration = [\"preferences\", \"router\", \"progressindicator\"];\n if (noFurtherRehydration.includes(stateKey)) {\n return stateValue;\n }\n\n if (stateValue !== null && typeof stateValue === \"object\") {\n return rehydrate(stateValue); // NOSONAR\n }\n\n return stateValue;\n};\n\n/**\n * Maps dehydrated state to models that can be used to rehydrated the application.\n */\nconst rehydrate = (state: Object): { ... } => {\n const mappedState: { [string]: any } = {};\n\n Object.keys(state).forEach((stateKey) => {\n const stateValue = state[stateKey];\n mappedState[stateKey] = rehydratedValue(stateKey, stateValue);\n });\n\n return mappedState;\n};\n\nexport default rehydrate;\n"],"mappings":";;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,kBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA;AACA;AACA;AACA,MAAMK,aAAa,GAAIC,IAAY,IAAK;EACtC,MAAMC,SAAS,GAAGC,0BAAiB,CAACC,SAAS,CAACH,IAAI,CAAC;EAEnD,MAAMI,KAAK,GAAG,IAAAC,qBAAY,EAACJ,SAAS,CAAC;EAErC,IAAIG,KAAK,EAAE;IAAA,IAAAE,QAAA;IACT,MAAMC,KAAK,GAAG,IAAIH,KAAK,CAACH,SAAS,CAAC;IAClCM,KAAK,CAACJ,SAAS,CAACH,IAAI,CAAC;IAErB,MAAMQ,WAAW,GAAG,IAAAC,IAAA,CAAAC,OAAA,EAAAJ,QAAA,GAAAN,IAAI,CAACQ,WAAW,EAAAG,IAAA,CAAAL,QAAA,EAAMM,UAAU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I,IAAI,OAAOA,UAAU,KAAK,QAAQ,EAAE;IACzD,OAAOf,SAAS,CAACe,UAAU,CAAC,CAAC,CAAC;EAChC;EAEA,OAAOA,UAAU;AACnB,CAAC;;AAED;AACA;AACA;AACA,MAAMf,SAAS,GAAIwB,KAAa,IAAc;EAC5C,MAAMC,WAA8B,GAAG,CAAC,CAAC;EAEzC,IAAAC,KAAA,CAAAnB,OAAA,EAAYiB,KAAK,CAAC,CAACG,OAAO,CAAEb,QAAQ,IAAK;IACvC,MAAMC,UAAU,GAAGS,KAAK,CAACV,QAAQ,CAAC;IAClCW,WAAW,CAACX,QAAQ,CAAC,GAAGD,eAAe,CAACC,QAAQ,EAAEC,UAAU,CAAC;EAC/D,CAAC,CAAC;EAEF,OAAOU,WAAW;AACpB,CAAC;AAAC,IAAAG,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEaP,SAAS","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ exports.sendAuthenticationError = exports.resetAuthErrors = exports.loginSuccess
|
|
|
8
8
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
9
9
|
var _Cache = _interopRequireDefault(require("../../utils/browser/Cache"));
|
|
10
10
|
var _Authenticate = _interopRequireDefault(require("../../modularui/Authenticate"));
|
|
11
|
+
var _ModularUISelectors = require("../_modularui/ModularUISelectors");
|
|
11
12
|
var _Application = require("./Application");
|
|
12
13
|
var _ProgressIndicator = require("./ProgressIndicator");
|
|
13
14
|
var _RouterActions = require("../_router/RouterActions");
|
|
@@ -61,11 +62,16 @@ const changePassword = () => (dispatch, getState) => {
|
|
|
61
62
|
/**
|
|
62
63
|
*/
|
|
63
64
|
exports.changePassword = changePassword;
|
|
64
|
-
const login = (username, password) => dispatch => {
|
|
65
|
+
const login = (username, password) => (dispatch, getState) => {
|
|
65
66
|
dispatch((0, _ProgressIndicator.startProgress)());
|
|
66
67
|
return new _Authenticate.default().login(username, password).then(() => dispatch((0, _Application.reloadApplication)())).then(() => {
|
|
67
68
|
_Cache.default.addItem("auth", true);
|
|
68
|
-
|
|
69
|
+
const application = (0, _ModularUISelectors.getApplication)(getState());
|
|
70
|
+
if (application?.userMustChangePassword) {
|
|
71
|
+
dispatch(changePassword());
|
|
72
|
+
} else {
|
|
73
|
+
dispatch(loginSuccess());
|
|
74
|
+
}
|
|
69
75
|
return dispatch((0, _ProgressIndicator.finishProgress)());
|
|
70
76
|
}).catch(error => {
|
|
71
77
|
if (error.id === "Error.ChangePasswordRequired") {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import Cache from "../../utils/browser/Cache";
|
|
3
3
|
import Authenticate from "../../modularui/Authenticate";
|
|
4
|
+
import { getApplication } from "../_modularui/ModularUISelectors";
|
|
4
5
|
|
|
5
6
|
import { reloadApplication } from "./Application";
|
|
6
7
|
|
|
@@ -68,7 +69,7 @@ export const changePassword = (): ThunkAction => (dispatch, getState) => {
|
|
|
68
69
|
*/
|
|
69
70
|
export const login =
|
|
70
71
|
(username: string, password: string): ThunkAction =>
|
|
71
|
-
(dispatch) => {
|
|
72
|
+
(dispatch, getState) => {
|
|
72
73
|
dispatch(startProgress());
|
|
73
74
|
|
|
74
75
|
return new Authenticate()
|
|
@@ -76,8 +77,12 @@ export const login =
|
|
|
76
77
|
.then(() => dispatch(reloadApplication()))
|
|
77
78
|
.then(() => {
|
|
78
79
|
Cache.addItem("auth", true);
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
const application = getApplication(getState());
|
|
81
|
+
if (application?.userMustChangePassword) {
|
|
82
|
+
dispatch(changePassword());
|
|
83
|
+
} else {
|
|
84
|
+
dispatch(loginSuccess());
|
|
85
|
+
}
|
|
81
86
|
return dispatch(finishProgress());
|
|
82
87
|
})
|
|
83
88
|
.catch((error) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignIn.js","names":["_Cache","_interopRequireDefault","require","_Authenticate","_Application","_ProgressIndicator","_RouterActions","_Constants","loginFailed","errorMessage","sendAuthenticationError","exports","type","payload","resetAuthErrors","loginSuccess","changePassword","dispatch","getState","isModal","router","location","state","modal","locationFrom","from","push","CHANGEPASSWORD_PATH","login","username","password","startProgress","Authenticate","then","reloadApplication","Cache","addItem","finishProgress","catch","error","id","dispatchedReloadApplication","_promise","default","resolve"],"sources":["../../../src/redux/actions/SignIn.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\nimport Authenticate from \"../../modularui/Authenticate\";\n\nimport { reloadApplication } from \"./Application\";\n\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { push } from \"../_router/RouterActions\";\nimport { CHANGEPASSWORD_PATH } from \"../../constants/Constants\";\n\nimport type {\n SendAuthenticationErrorAction,\n ResetAuthErrorsAction,\n LoginSuccessAction,\n ThunkAction,\n} from \"../types\";\n\n/**\n * Send login failed action\n */\nexport const loginFailed = (\n errorMessage: string,\n): SendAuthenticationErrorAction => sendAuthenticationError(errorMessage);\n\n/**\n * Send authentication error action\n */\nexport const sendAuthenticationError = (\n errorMessage: string,\n): SendAuthenticationErrorAction => ({\n type: \"AUTHENTICATION_ERROR\",\n payload: errorMessage,\n});\n\n/**\n * Resets any authentication errors\n */\nexport const resetAuthErrors = (): ResetAuthErrorsAction => ({\n type: \"AUTHENTICATION_RESET_ERRORS\",\n});\n\n/**\n * Send login success action\n */\nexport const loginSuccess = (): LoginSuccessAction => ({\n type: \"AUTHENTICATION_SUCCESS\",\n});\n\n/**\n * Send change password action\n */\nexport const changePassword = (): ThunkAction => (dispatch, getState) => {\n dispatch({\n type: \"CHANGE_PASSWORD\",\n });\n\n const isModal = getState().router.location?.state?.modal;\n const locationFrom = getState().router.location?.state?.from;\n return dispatch(\n push(CHANGEPASSWORD_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n modal: isModal,\n }),\n );\n};\n\n/**\n */\nexport const login =\n (username: string, password: string): ThunkAction =>\n (dispatch) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .login(username, password)\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n Cache.addItem(\"auth\", true);\n dispatch(loginSuccess());\n\n return dispatch(finishProgress());\n })\n .catch((error) => {\n if (error.id === \"Error.ChangePasswordRequired\") {\n const dispatchedReloadApplication = dispatch(reloadApplication());\n\n return Promise.resolve(dispatchedReloadApplication).then(() => {\n Cache.addItem(\"auth\", true);\n dispatch(changePassword());\n return dispatch(finishProgress());\n });\n }\n\n dispatch(loginFailed(error.id));\n return dispatch(finishProgress());\n });\n };\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;
|
|
1
|
+
{"version":3,"file":"SignIn.js","names":["_Cache","_interopRequireDefault","require","_Authenticate","_ModularUISelectors","_Application","_ProgressIndicator","_RouterActions","_Constants","loginFailed","errorMessage","sendAuthenticationError","exports","type","payload","resetAuthErrors","loginSuccess","changePassword","dispatch","getState","isModal","router","location","state","modal","locationFrom","from","push","CHANGEPASSWORD_PATH","login","username","password","startProgress","Authenticate","then","reloadApplication","Cache","addItem","application","getApplication","userMustChangePassword","finishProgress","catch","error","id","dispatchedReloadApplication","_promise","default","resolve"],"sources":["../../../src/redux/actions/SignIn.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { getApplication } from \"../_modularui/ModularUISelectors\";\n\nimport { reloadApplication } from \"./Application\";\n\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { push } from \"../_router/RouterActions\";\nimport { CHANGEPASSWORD_PATH } from \"../../constants/Constants\";\n\nimport type {\n SendAuthenticationErrorAction,\n ResetAuthErrorsAction,\n LoginSuccessAction,\n ThunkAction,\n} from \"../types\";\n\n/**\n * Send login failed action\n */\nexport const loginFailed = (\n errorMessage: string,\n): SendAuthenticationErrorAction => sendAuthenticationError(errorMessage);\n\n/**\n * Send authentication error action\n */\nexport const sendAuthenticationError = (\n errorMessage: string,\n): SendAuthenticationErrorAction => ({\n type: \"AUTHENTICATION_ERROR\",\n payload: errorMessage,\n});\n\n/**\n * Resets any authentication errors\n */\nexport const resetAuthErrors = (): ResetAuthErrorsAction => ({\n type: \"AUTHENTICATION_RESET_ERRORS\",\n});\n\n/**\n * Send login success action\n */\nexport const loginSuccess = (): LoginSuccessAction => ({\n type: \"AUTHENTICATION_SUCCESS\",\n});\n\n/**\n * Send change password action\n */\nexport const changePassword = (): ThunkAction => (dispatch, getState) => {\n dispatch({\n type: \"CHANGE_PASSWORD\",\n });\n\n const isModal = getState().router.location?.state?.modal;\n const locationFrom = getState().router.location?.state?.from;\n return dispatch(\n push(CHANGEPASSWORD_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n modal: isModal,\n }),\n );\n};\n\n/**\n */\nexport const login =\n (username: string, password: string): ThunkAction =>\n (dispatch, getState) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .login(username, password)\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n Cache.addItem(\"auth\", true);\n const application = getApplication(getState());\n if (application?.userMustChangePassword) {\n dispatch(changePassword());\n } else {\n dispatch(loginSuccess());\n }\n return dispatch(finishProgress());\n })\n .catch((error) => {\n if (error.id === \"Error.ChangePasswordRequired\") {\n const dispatchedReloadApplication = dispatch(reloadApplication());\n\n return Promise.resolve(dispatchedReloadApplication).then(() => {\n Cache.addItem(\"auth\", true);\n dispatch(changePassword());\n return dispatch(finishProgress());\n });\n }\n\n dispatch(loginFailed(error.id));\n return dispatch(finishProgress());\n });\n };\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AAEA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,U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AAC;AAAC7B,OAAA,CAAAiB,KAAA,GAAAA,KAAA","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ var _RouterMiddleware = require("../_router/RouterMiddleware");
|
|
|
11
11
|
var _ModularUIMiddleware = require("../_modularui/ModularUIMiddleware");
|
|
12
12
|
var _createReducer = require("../reducers/createReducer");
|
|
13
13
|
var _RouterActions = require("../_router/RouterActions");
|
|
14
|
+
var _I18nActions = require("../_i18n/I18nActions");
|
|
14
15
|
/**
|
|
15
16
|
*/
|
|
16
17
|
const configureStore = (routerHistory, customReducers, initialState) => {
|
|
@@ -28,6 +29,10 @@ const configureStore = (routerHistory, customReducers, initialState) => {
|
|
|
28
29
|
if (!initialState?.router) {
|
|
29
30
|
store.dispatch((0, _RouterActions.locationChange)(routerHistory.location, "PUSH"));
|
|
30
31
|
}
|
|
32
|
+
const locale = initialState?.i18n.locale;
|
|
33
|
+
if (locale) {
|
|
34
|
+
store.dispatch((0, _I18nActions.updateLocale)(locale));
|
|
35
|
+
}
|
|
31
36
|
return {
|
|
32
37
|
routerHistory,
|
|
33
38
|
store
|
|
@@ -13,6 +13,8 @@ import { modularUIMiddleware } from "../_modularui/ModularUIMiddleware";
|
|
|
13
13
|
import { createReducer } from "../reducers/createReducer";
|
|
14
14
|
import { locationChange } from "../_router/RouterActions";
|
|
15
15
|
|
|
16
|
+
import { updateLocale } from "../_i18n/I18nActions";
|
|
17
|
+
|
|
16
18
|
import type { RouterHistory } from "react-router";
|
|
17
19
|
import type { ReduxAction, ReduxState, ReduxStore } from "../types";
|
|
18
20
|
import type { Reducer } from "redux";
|
|
@@ -52,6 +54,12 @@ const configureStore = (
|
|
|
52
54
|
if (!initialState?.router) {
|
|
53
55
|
store.dispatch(locationChange(routerHistory.location, "PUSH"));
|
|
54
56
|
}
|
|
57
|
+
|
|
58
|
+
const locale = initialState?.i18n.locale;
|
|
59
|
+
if (locale) {
|
|
60
|
+
store.dispatch(updateLocale(locale));
|
|
61
|
+
}
|
|
62
|
+
|
|
55
63
|
return { routerHistory, store };
|
|
56
64
|
};
|
|
57
65
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configureStore.js","names":["_redux","require","_reduxThunk","_interopRequireDefault","_RouterMiddleware","_ModularUIMiddleware","_createReducer","_RouterActions","configureStore","routerHistory","customReducers","initialState","composeEnhancers","compose","process","env","NODE_ENV","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","combinedReducers","combineReducers","createReducer","middleware","applyMiddleware","modularUIMiddleware","routerMiddleware","thunk","enhancers","store","createReduxStore","router","dispatch","locationChange","location","_default","exports","default"],"sources":["../../../src/redux/store/configureStore.js"],"sourcesContent":["// @flow\nimport {\n applyMiddleware,\n compose,\n combineReducers,\n createStore as createReduxStore,\n} from \"redux\";\nimport thunk from \"redux-thunk\";\n\nimport { routerMiddleware } from \"../_router/RouterMiddleware\";\nimport { modularUIMiddleware } from \"../_modularui/ModularUIMiddleware\";\n\nimport { createReducer } from \"../reducers/createReducer\";\nimport { locationChange } from \"../_router/RouterActions\";\n\nimport type { RouterHistory } from \"react-router\";\nimport type { ReduxAction, ReduxState, ReduxStore } from \"../types\";\nimport type { Reducer } from \"redux\";\n\n/**\n */\nconst configureStore = (\n routerHistory: RouterHistory,\n customReducers?: Object,\n initialState?: $Shape<ReduxState>,\n): { routerHistory: RouterHistory, store: ReduxStore } => {\n let composeEnhancers = compose;\n\n if (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n }\n\n const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({\n ...customReducers,\n ...createReducer(),\n });\n\n const middleware = applyMiddleware(\n modularUIMiddleware,\n routerMiddleware(routerHistory),\n thunk,\n );\n\n const enhancers = composeEnhancers(middleware);\n\n const store: ReduxStore = createReduxStore(\n combinedReducers,\n initialState,\n enhancers,\n );\n\n if (!initialState?.router) {\n store.dispatch(locationChange(routerHistory.location, \"PUSH\"));\n }\n return { routerHistory, store };\n};\n\nexport default configureStore;\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAEA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAMA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"configureStore.js","names":["_redux","require","_reduxThunk","_interopRequireDefault","_RouterMiddleware","_ModularUIMiddleware","_createReducer","_RouterActions","_I18nActions","configureStore","routerHistory","customReducers","initialState","composeEnhancers","compose","process","env","NODE_ENV","window","__REDUX_DEVTOOLS_EXTENSION_COMPOSE__","combinedReducers","combineReducers","createReducer","middleware","applyMiddleware","modularUIMiddleware","routerMiddleware","thunk","enhancers","store","createReduxStore","router","dispatch","locationChange","location","locale","i18n","updateLocale","_default","exports","default"],"sources":["../../../src/redux/store/configureStore.js"],"sourcesContent":["// @flow\nimport {\n applyMiddleware,\n compose,\n combineReducers,\n createStore as createReduxStore,\n} from \"redux\";\nimport thunk from \"redux-thunk\";\n\nimport { routerMiddleware } from \"../_router/RouterMiddleware\";\nimport { modularUIMiddleware } from \"../_modularui/ModularUIMiddleware\";\n\nimport { createReducer } from \"../reducers/createReducer\";\nimport { locationChange } from \"../_router/RouterActions\";\n\nimport { updateLocale } from \"../_i18n/I18nActions\";\n\nimport type { RouterHistory } from \"react-router\";\nimport type { ReduxAction, ReduxState, ReduxStore } from \"../types\";\nimport type { Reducer } from \"redux\";\n\n/**\n */\nconst configureStore = (\n routerHistory: RouterHistory,\n customReducers?: Object,\n initialState?: $Shape<ReduxState>,\n): { routerHistory: RouterHistory, store: ReduxStore } => {\n let composeEnhancers = compose;\n\n if (process.env.NODE_ENV !== \"production\" && typeof window !== \"undefined\") {\n composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n }\n\n const combinedReducers: Reducer<ReduxState, ReduxAction> = combineReducers({\n ...customReducers,\n ...createReducer(),\n });\n\n const middleware = applyMiddleware(\n modularUIMiddleware,\n routerMiddleware(routerHistory),\n thunk,\n );\n\n const enhancers = composeEnhancers(middleware);\n\n const store: ReduxStore = createReduxStore(\n combinedReducers,\n initialState,\n enhancers,\n );\n\n if (!initialState?.router) {\n store.dispatch(locationChange(routerHistory.location, \"PUSH\"));\n }\n\n const locale = initialState?.i18n.locale;\n if (locale) {\n store.dispatch(updateLocale(locale));\n }\n\n return { routerHistory, store };\n};\n\nexport default configureStore;\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAMA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAEA,IAAAK,cAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AAEA,IAAAO,YAAA,GAAAP,OAAA;AAMA;AACA;AACA,MAAMQ,cAAc,GAAGA,CACrBC,aAA4B,EAC5BC,cAAuB,EACvBC,YAAiC,KACuB;EACxD,IAAIC,gBAAgB,GAAGC,cAAO;EAE9B,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,IAAI,OAAOC,MAAM,KAAK,WAAW,EAAE;IAC1EL,gBAAgB,GAAGK,MAAM,CAACC,oCAAoC,IAAIL,cAAO;EAC3E;EAEA,MAAMM,gBAAkD,GAAG,IAAAC,sBAAe,EAAC;IACzE,GAAGV,cAAc;IACjB,GAAG,IAAAW,4BAAa,EAAC;EACnB,CAAC,CAAC;EAEF,MAAMC,UAAU,GAAG,IAAAC,sBAAe,EAChCC,wCAAmB,EACnB,IAAAC,kCAAgB,EAAChB,aAAa,CAAC,EAC/BiB,mBACF,CAAC;EAED,MAAMC,SAAS,GAAGf,gBAAgB,CAACU,UAAU,CAAC;EAE9C,MAAMM,KAAiB,GAAG,IAAAC,kBAAgB,EACxCV,gBAAgB,EAChBR,YAAY,EACZgB,SACF,CAAC;EAED,IAAI,CAAChB,YAAY,EAAEmB,MAAM,EAAE;IACzBF,KAAK,CAACG,QAAQ,CAAC,IAAAC,6BAAc,EAACvB,aAAa,CAACwB,QAAQ,EAAE,MAAM,CAAC,CAAC;EAChE;EAEA,MAAMC,MAAM,GAAGvB,YAAY,EAAEwB,IAAI,CAACD,MAAM;EACxC,IAAIA,MAAM,EAAE;IACVN,KAAK,CAACG,QAAQ,CAAC,IAAAK,yBAAY,EAACF,MAAM,CAAC,CAAC;EACtC;EAEA,OAAO;IAAEzB,aAAa;IAAEmB;EAAM,CAAC;AACjC,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa/B,cAAc","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.46.1",
|
|
4
4
|
"description": "Toolbox for be informed javascript layouts",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bugs": "http://support.beinformed.com",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"styled-components": "^5.0.0"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@babel/runtime-corejs3": "^7.24.
|
|
85
|
+
"@babel/runtime-corejs3": "^7.24.4",
|
|
86
86
|
"big.js": "^6.2.1",
|
|
87
87
|
"date-fns": "^3.6.0",
|
|
88
88
|
"deepmerge": "^4.3.1",
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@babel/cli": "^7.24.1",
|
|
102
|
-
"@babel/core": "^7.24.
|
|
102
|
+
"@babel/core": "^7.24.4",
|
|
103
103
|
"@babel/eslint-parser": "^7.24.1",
|
|
104
104
|
"@babel/eslint-plugin": "^7.23.5",
|
|
105
105
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
106
106
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
107
107
|
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
108
|
-
"@babel/preset-env": "^7.24.
|
|
108
|
+
"@babel/preset-env": "^7.24.4",
|
|
109
109
|
"@babel/preset-flow": "^7.24.1",
|
|
110
110
|
"@babel/preset-react": "^7.24.1",
|
|
111
111
|
"@commitlint/cli": "^18.5.0",
|
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
"babel-jest": "^29.7.0",
|
|
116
116
|
"babel-plugin-styled-components": "^2.1.4",
|
|
117
117
|
"cherry-pick": "^0.5.0",
|
|
118
|
-
"commit-and-tag-version": "^12.
|
|
118
|
+
"commit-and-tag-version": "^12.3.0",
|
|
119
119
|
"cross-env": "^7.0.3",
|
|
120
120
|
"documentation": "^14.0.2",
|
|
121
121
|
"eslint": "^8.57.0",
|
|
@@ -124,10 +124,10 @@
|
|
|
124
124
|
"eslint-plugin-ft-flow": "^3.0.7",
|
|
125
125
|
"eslint-plugin-import": "^2.29.1",
|
|
126
126
|
"eslint-plugin-jest": "^27.9.0",
|
|
127
|
-
"eslint-plugin-jsdoc": "^48.2.
|
|
127
|
+
"eslint-plugin-jsdoc": "^48.2.3",
|
|
128
128
|
"eslint-plugin-react": "^7.34.1",
|
|
129
129
|
"eslint-plugin-react-hooks": "^4.5.0",
|
|
130
|
-
"eslint-plugin-you-dont-need-lodash-underscore": "^6.
|
|
130
|
+
"eslint-plugin-you-dont-need-lodash-underscore": "^6.14.0",
|
|
131
131
|
"flow-bin": "^0.200.1",
|
|
132
132
|
"flow-copy-source": "^2.0.9",
|
|
133
133
|
"flow-typed": "^3.9.0",
|
|
@@ -131,10 +131,16 @@ export default class ApplicationModel extends ResourceModel {
|
|
|
131
131
|
* only available when the user services are available
|
|
132
132
|
*/
|
|
133
133
|
get userHref(): Href | null {
|
|
134
|
-
if (this.userServices
|
|
134
|
+
if (this.userServices?.userLink) {
|
|
135
135
|
return this.userServices.userLink.href;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
return null;
|
|
139
139
|
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
*/
|
|
143
|
+
get userMustChangePassword(): boolean {
|
|
144
|
+
return this.userServices?.mustChangePassword ?? false;
|
|
145
|
+
}
|
|
140
146
|
}
|
|
@@ -38,6 +38,7 @@ import type ContentConfigurationElements from "../contentconfiguration/ContentCo
|
|
|
38
38
|
import type LayoutHintRuleCollection from "./layouthint-rules/LayoutHintRuleCollection";
|
|
39
39
|
import type AttributeCollection from "./AttributeCollection";
|
|
40
40
|
import AttributeContent from "./AttributeContent";
|
|
41
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
41
42
|
|
|
42
43
|
/**
|
|
43
44
|
* Attribute model, base model for all kind of attributes
|
|
@@ -144,7 +145,10 @@ export default class AttributeModel
|
|
|
144
145
|
|
|
145
146
|
/**
|
|
146
147
|
*/
|
|
147
|
-
setChildModels(
|
|
148
|
+
setChildModels(
|
|
149
|
+
models: Array<ModularUIModel>,
|
|
150
|
+
errors: Array<ErrorResponse>, // eslint-disable-line no-unused-vars
|
|
151
|
+
): void {
|
|
148
152
|
const conceptHref = this.conceptLink?.href;
|
|
149
153
|
if (conceptHref) {
|
|
150
154
|
this.concept = models.find((model) =>
|
|
@@ -15,6 +15,7 @@ import { ATTRIBUTE_WIDTH } from "../../constants";
|
|
|
15
15
|
|
|
16
16
|
import type { ModularUIModel, AttributeType, FormErrorAnchor } from "../types";
|
|
17
17
|
import type LinkModel from "../links/LinkModel";
|
|
18
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Model for a choice attribute
|
|
@@ -101,7 +102,7 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
104
|
*/
|
|
104
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
105
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
105
106
|
const conceptLinkHref = this.conceptLink?.href;
|
|
106
107
|
if (conceptLinkHref) {
|
|
107
108
|
this.concept = models.find(
|
|
@@ -111,7 +112,7 @@ export default class ChoiceAttributeModel extends AttributeModel {
|
|
|
111
112
|
);
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
this.options.setChildModels(models);
|
|
115
|
+
this.options.setChildModels(models, errors);
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
/**
|
|
@@ -16,6 +16,7 @@ import AttributeContent from "./AttributeContent";
|
|
|
16
16
|
import type { IModelWithChildModels, ModularUIModel } from "../types";
|
|
17
17
|
import type ListItemModel from "../list/ListItemModel";
|
|
18
18
|
import type LinkModel from "../links/LinkModel";
|
|
19
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
*/
|
|
@@ -101,7 +102,7 @@ class ChoiceAttributeOptionModel
|
|
|
101
102
|
|
|
102
103
|
/**
|
|
103
104
|
*/
|
|
104
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
105
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
105
106
|
if (this.conceptLink !== null) {
|
|
106
107
|
const conceptHref = this.conceptLink.href;
|
|
107
108
|
|
|
@@ -111,7 +112,7 @@ class ChoiceAttributeOptionModel
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
if (this.children) {
|
|
114
|
-
this.children.setChildModels(models);
|
|
115
|
+
this.children.setChildModels(models, errors);
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
|
|
@@ -15,6 +15,7 @@ import DatetimeAttributeModel from "./DatetimeAttributeModel";
|
|
|
15
15
|
import type { ModularUIModel, AttributeType } from "../types";
|
|
16
16
|
import type ContentConfiguration from "../contentconfiguration/ContentConfiguration";
|
|
17
17
|
import type LinkModel from "../links/LinkModel";
|
|
18
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
*/
|
|
@@ -49,8 +50,8 @@ class CompositeAttributeModel extends AttributeModel {
|
|
|
49
50
|
|
|
50
51
|
/**
|
|
51
52
|
*/
|
|
52
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
53
|
-
this.children.setChildModels(models);
|
|
53
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
54
|
+
this.children.setChildModels(models, errors);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
/**
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import BaseCollection from "./BaseCollection";
|
|
3
3
|
|
|
4
4
|
import type { ModularUIModel, IModelWithChildModels } from "../types";
|
|
5
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
5
6
|
import type LinkModel from "../links/LinkModel";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -28,11 +29,11 @@ class ResourceCollection<T: IModelWithChildModels> extends BaseCollection<T> {
|
|
|
28
29
|
/**
|
|
29
30
|
* Pass through models for setchildmodels to items of this collection
|
|
30
31
|
*/
|
|
31
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
32
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
32
33
|
this.collection.forEach((item) => {
|
|
33
34
|
// $FlowFixMe[prop-missing]
|
|
34
35
|
if (typeof item["setChildModels"] === "function") {
|
|
35
|
-
item.setChildModels(models);
|
|
36
|
+
item.setChildModels(models, errors);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import type LinkModel from "../links/LinkModel";
|
|
13
13
|
import type Href from "../href/Href";
|
|
14
14
|
import type { ModularUIModel, IModelWithChildModels } from "../types";
|
|
15
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Base model, this the foundation for models that represent modular ui services, e.g. application, tab, caseview, etc
|
|
@@ -189,12 +190,16 @@ class ResourceModel extends BaseModel implements IModelWithChildModels {
|
|
|
189
190
|
/**
|
|
190
191
|
* Add child models to this model
|
|
191
192
|
*/
|
|
192
|
-
addChildModels(
|
|
193
|
+
addChildModels(
|
|
194
|
+
models: Array<ModularUIModel>,
|
|
195
|
+
errors: Array<ErrorResponse>,
|
|
196
|
+
): this {
|
|
193
197
|
const flattenModels = [].concat(...models);
|
|
198
|
+
const flattenErrors = [].concat(errors);
|
|
194
199
|
|
|
195
200
|
this._childModels = flattenModels;
|
|
196
201
|
|
|
197
|
-
this.setChildModels(flattenModels);
|
|
202
|
+
this.setChildModels(flattenModels, flattenErrors);
|
|
198
203
|
|
|
199
204
|
return this;
|
|
200
205
|
}
|
|
@@ -206,8 +211,11 @@ class ResourceModel extends BaseModel implements IModelWithChildModels {
|
|
|
206
211
|
* @abstract
|
|
207
212
|
* @example <caption>Put all models of instance List and GroupingPanel into the panels property</caption>
|
|
208
213
|
*/
|
|
209
|
-
setChildModels(
|
|
210
|
-
|
|
214
|
+
setChildModels(
|
|
215
|
+
models: Array<ModularUIModel>,
|
|
216
|
+
errors: Array<ErrorResponse>,
|
|
217
|
+
): void {
|
|
218
|
+
if (!models && !errors) {
|
|
211
219
|
throw new IllegalArgumentException("No models send to setChildModels");
|
|
212
220
|
}
|
|
213
221
|
}
|
|
@@ -12,6 +12,7 @@ import type { ModularUIModel, AttributeType } from "../types";
|
|
|
12
12
|
import type { ModularUIResponse } from "../../modularui";
|
|
13
13
|
import type LinkCollection from "../links/LinkCollection";
|
|
14
14
|
import type LinkModel from "../links/LinkModel";
|
|
15
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Model containing the details of one case.
|
|
@@ -63,8 +64,8 @@ export default class CaseViewModel extends DetailModel {
|
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
*/
|
|
66
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
67
|
-
super.setChildModels(models);
|
|
67
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
68
|
+
super.setChildModels(models, errors);
|
|
68
69
|
|
|
69
70
|
const taskGroupModels = [];
|
|
70
71
|
for (let i = 0; i < models.length; i++) {
|
|
@@ -7,6 +7,7 @@ import type { ModularUIResponse } from "../../modularui";
|
|
|
7
7
|
import type { ModularUIModel } from "../types";
|
|
8
8
|
import type LinkModel from "../links/LinkModel";
|
|
9
9
|
import type ConceptLinkModel from "./ConceptLinkModel";
|
|
10
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
*/
|
|
@@ -92,7 +93,7 @@ class BusinessScenarioModel extends ConceptDetailModel {
|
|
|
92
93
|
|
|
93
94
|
/**
|
|
94
95
|
*/
|
|
95
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
96
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
96
97
|
// $FlowExpectedError[incompatible-type]
|
|
97
98
|
const conceptTypeModel: ?ConceptTypeDetailModel = models.find(
|
|
98
99
|
(model) => model instanceof ConceptTypeDetailModel,
|
|
@@ -102,7 +103,7 @@ class BusinessScenarioModel extends ConceptDetailModel {
|
|
|
102
103
|
this.conceptType = conceptTypeModel;
|
|
103
104
|
}
|
|
104
105
|
|
|
105
|
-
this.relationsCollection.setChildModels(models);
|
|
106
|
+
this.relationsCollection.setChildModels(models, errors);
|
|
106
107
|
|
|
107
108
|
const scenarioSteps = [];
|
|
108
109
|
for (let i = 0; i < models.length; i++) {
|
|
@@ -15,6 +15,7 @@ import type {
|
|
|
15
15
|
import type { ModularUIResponse } from "../../modularui";
|
|
16
16
|
import type Href from "../href/Href";
|
|
17
17
|
import type LinkModel from "../links/LinkModel";
|
|
18
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Model for concept details, available through modelcatalog
|
|
@@ -73,7 +74,7 @@ export default class ConceptDetailModel extends ResourceModel {
|
|
|
73
74
|
|
|
74
75
|
/**
|
|
75
76
|
*/
|
|
76
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
77
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
77
78
|
// $FlowExpectedError[incompatible-type]
|
|
78
79
|
const conceptTypeModel: ?ConceptTypeDetailModel = models.find(
|
|
79
80
|
(model) => model instanceof ConceptTypeDetailModel,
|
|
@@ -83,7 +84,7 @@ export default class ConceptDetailModel extends ResourceModel {
|
|
|
83
84
|
this.conceptType = conceptTypeModel;
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
this.relationsCollection.setChildModels(models);
|
|
87
|
+
this.relationsCollection.setChildModels(models, errors);
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
/**
|
|
@@ -10,6 +10,7 @@ import type { ModularUIResponse } from "../../modularui";
|
|
|
10
10
|
import type { FilterType, ModularUIModel } from "../types";
|
|
11
11
|
import type LinkModel from "../links/LinkModel";
|
|
12
12
|
import type Href from "../href/Href";
|
|
13
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Get Index of concepts, to filter model catalog
|
|
@@ -69,8 +70,8 @@ export default class ConceptIndexModel extends ResourceModel {
|
|
|
69
70
|
|
|
70
71
|
/**
|
|
71
72
|
*/
|
|
72
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
73
|
-
this.items.setChildModels(models);
|
|
73
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
74
|
+
this.items.setChildModels(models, errors);
|
|
74
75
|
}
|
|
75
76
|
|
|
76
77
|
/**
|
|
@@ -4,11 +4,12 @@ import ResourceCollection from "../base/ResourceCollection";
|
|
|
4
4
|
import FilterCollection from "../filters/FilterCollection";
|
|
5
5
|
import ContentLinkModel from "./ContentLinkModel";
|
|
6
6
|
import Href from "../href/Href";
|
|
7
|
+
import ChoiceAttributeModel from "../attributes/ChoiceAttributeModel";
|
|
7
8
|
|
|
8
9
|
import type { FilterType, ModularUIModel } from "../types";
|
|
9
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
10
11
|
import type LinkModel from "../links/LinkModel";
|
|
11
|
-
import
|
|
12
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Get Index of concepts, to filter model catalog
|
|
@@ -64,8 +65,8 @@ export default class ContentIndexModel extends ResourceModel {
|
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
67
|
*/
|
|
67
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
68
|
-
this.items.setChildModels(models);
|
|
68
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
69
|
+
this.items.setChildModels(models, errors);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
/**
|
|
@@ -10,6 +10,7 @@ import { AVATAR, AVATAR_IN_TITLE, TITLE } from "../../constants/LayoutHints";
|
|
|
10
10
|
import type { ModularUIResponse } from "../../modularui";
|
|
11
11
|
import type { ModularUIModel, AttributeType } from "../types";
|
|
12
12
|
import type LinkModel from "../links/LinkModel";
|
|
13
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* Base class for details<br/>
|
|
@@ -64,8 +65,8 @@ export default class DetailModel extends ResourceModel {
|
|
|
64
65
|
|
|
65
66
|
/**
|
|
66
67
|
*/
|
|
67
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
68
|
-
this._attributeCollection.setChildModels(models);
|
|
68
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
69
|
+
this._attributeCollection.setChildModels(models, errors);
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
/**
|
|
@@ -22,12 +22,13 @@ import {
|
|
|
22
22
|
UPDATE_ACTION,
|
|
23
23
|
} from "../../constants/LayoutHints";
|
|
24
24
|
|
|
25
|
+
import LayoutHintCollection from "../layouthint/LayoutHintCollection";
|
|
26
|
+
import AttributeSetModel from "../attributes/AttributeSetModel";
|
|
27
|
+
|
|
25
28
|
import type { AttributeType, ModularUIModel } from "../types";
|
|
26
29
|
import type { ModularUIResponse } from "../../modularui";
|
|
27
30
|
import type ErrorResponse from "../error/ErrorResponse";
|
|
28
31
|
import type LinkModel from "../links/LinkModel";
|
|
29
|
-
import LayoutHintCollection from "../layouthint/LayoutHintCollection";
|
|
30
|
-
import AttributeSetModel from "../attributes/AttributeSetModel";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
*/
|
|
@@ -135,13 +136,13 @@ class FormModel extends ResourceModel {
|
|
|
135
136
|
|
|
136
137
|
/**
|
|
137
138
|
*/
|
|
138
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
139
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
139
140
|
if (this.currentFormObject) {
|
|
140
|
-
this.currentFormObject.setChildModels(models);
|
|
141
|
+
this.currentFormObject.setChildModels(models, errors);
|
|
141
142
|
}
|
|
142
143
|
|
|
143
144
|
this.endResultFormObjects.forEach((endResultFormObject) => {
|
|
144
|
-
endResultFormObject.setChildModels(models);
|
|
145
|
+
endResultFormObject.setChildModels(models, errors);
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
148
|
|
|
@@ -12,6 +12,7 @@ import type { AttributeType, ModularUIModel, FormErrorAnchor } from "../types";
|
|
|
12
12
|
import type LinkModel from "../links/LinkModel";
|
|
13
13
|
import LayoutHintCollection from "../layouthint/LayoutHintCollection";
|
|
14
14
|
import type { MessageParameters } from "../../i18n";
|
|
15
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Form Object
|
|
@@ -192,8 +193,8 @@ export default class FormObjectModel extends BaseModel {
|
|
|
192
193
|
|
|
193
194
|
/**
|
|
194
195
|
*/
|
|
195
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
196
|
-
this._attributeCollection.setChildModels(models);
|
|
196
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
197
|
+
this._attributeCollection.setChildModels(models, errors);
|
|
197
198
|
}
|
|
198
199
|
|
|
199
200
|
/**
|
|
@@ -14,6 +14,7 @@ import type { ModularUIResponse } from "../../modularui";
|
|
|
14
14
|
import type LinkCollection from "../links/LinkCollection";
|
|
15
15
|
import type ListItemModel from "../list/ListItemModel";
|
|
16
16
|
import type LinkModel from "../links/LinkModel";
|
|
17
|
+
import type ErrorResponse from "../error/ErrorResponse";
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Detail of a list item
|
|
@@ -65,15 +66,15 @@ export default class ListDetailModel extends DetailModel {
|
|
|
65
66
|
|
|
66
67
|
/**
|
|
67
68
|
*/
|
|
68
|
-
setChildModels(models: Array<ModularUIModel>) {
|
|
69
|
-
this._attributeCollection.setChildModels(models);
|
|
69
|
+
setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {
|
|
70
|
+
this._attributeCollection.setChildModels(models, errors);
|
|
70
71
|
|
|
71
72
|
if (this.results) {
|
|
72
|
-
this.results.setChildModels(models);
|
|
73
|
+
this.results.setChildModels(models, errors);
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
if (this.givenAnswers) {
|
|
76
|
-
this.givenAnswers.setChildModels(models);
|
|
77
|
+
this.givenAnswers.setChildModels(models, errors);
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
80
|
|