@beinformed/ui 1.19.1 → 1.19.5

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/esm/constants/Settings.js +6 -0
  3. package/esm/constants/Settings.js.map +1 -1
  4. package/esm/models/application/ApplicationModel.js +9 -0
  5. package/esm/models/application/ApplicationModel.js.map +1 -1
  6. package/esm/models/types.js.map +1 -1
  7. package/esm/redux/actions/Application.js +2 -1
  8. package/esm/redux/actions/Application.js.map +1 -1
  9. package/esm/redux/actions/Authorization.js +5 -2
  10. package/esm/redux/actions/Authorization.js.map +1 -1
  11. package/esm/redux/actions/SignOut.js +1 -1
  12. package/esm/redux/actions/SignOut.js.map +1 -1
  13. package/lib/constants/Settings.js +6 -0
  14. package/lib/constants/Settings.js.flow +9 -0
  15. package/lib/constants/Settings.js.map +1 -1
  16. package/lib/hooks/__tests__/useAuthentication.spec.js.flow +8 -0
  17. package/lib/models/application/ApplicationModel.js +9 -0
  18. package/lib/models/application/ApplicationModel.js.flow +7 -1
  19. package/lib/models/application/ApplicationModel.js.map +1 -1
  20. package/lib/models/types.js.flow +7 -0
  21. package/lib/models/types.js.map +1 -1
  22. package/lib/redux/actions/Application.js +1 -0
  23. package/lib/redux/actions/Application.js.flow +3 -1
  24. package/lib/redux/actions/Application.js.map +1 -1
  25. package/lib/redux/actions/Authorization.js +6 -2
  26. package/lib/redux/actions/Authorization.js.flow +4 -2
  27. package/lib/redux/actions/Authorization.js.map +1 -1
  28. package/lib/redux/actions/SignOut.js.flow +1 -1
  29. package/lib/redux/actions/SignOut.js.map +1 -1
  30. package/lib/redux/actions/__tests__/Application.spec.js.flow +8 -0
  31. package/lib/redux/actions/__tests__/Authorization.spec.js.flow +4 -0
  32. package/package.json +1 -1
  33. package/src/constants/Settings.js +9 -0
  34. package/src/hooks/__tests__/useAuthentication.spec.js +8 -0
  35. package/src/models/application/ApplicationModel.js +7 -1
  36. package/src/models/types.js +7 -0
  37. package/src/redux/actions/Application.js +3 -1
  38. package/src/redux/actions/Authorization.js +4 -2
  39. package/src/redux/actions/SignOut.js +1 -1
  40. package/src/redux/actions/__tests__/Application.spec.js +8 -0
  41. package/src/redux/actions/__tests__/Authorization.spec.js +4 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [1.19.5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.19.4...v1.19.5) (2022-06-17)
6
+
7
+ ### [1.19.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.19.3...v1.19.4) (2022-06-17)
8
+
9
+ ### Bug Fixes
10
+
11
+ - **authentication:** improve isLoggedIn on application model ([b078c7d](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/b078c7dc03bfeb2b3d65643dce1b1da8ddd2cc90))
12
+
13
+ ### [1.19.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.19.2...v1.19.3) (2022-06-17)
14
+
15
+ ### [1.19.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.19.1...v1.19.2) (2022-06-17)
16
+
5
17
  ### [1.19.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.19.0...v1.19.1) (2022-06-16)
6
18
 
7
19
  ### Bug Fixes
@@ -22,6 +22,12 @@ var defaultSettings = {
22
22
  USE_INSTANT_SERVER_VALIDATION: true,
23
23
  // Indicates which locales are enabled
24
24
  ENABLED_LOCALES: ["en", "nl"],
25
+ // Renders the global log in page
26
+ RENDER_GLOBAL_LOGIN_PAGE: false,
27
+ // Renders the global log out page
28
+ RENDER_GLOBAL_LOGOUT_PAGE: false,
29
+ // Renders the login variants as option on the global logout page
30
+ RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,
25
31
  // Render forms in a modal
26
32
  RENDER_FORMS_IN_MODAL: true,
27
33
  // Wait timeout before rendering submit wait icon
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.js","names":["isPlainObject","has","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","defaultSettings","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","hasAllContentInData","loginType","loginPath","loginUsernameField","loginPasswordField","logoutPath"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst defaultSettings = {\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n */\nexport const loginType = (): string => getSetting(LOGIN_TYPE, \"JAAS\");\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/j_security_check\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/Logoff\");\n"],"mappings":";AACA,SAASA,aAAT,EAAwBC,GAAxB,QAAmC,0BAAnC;AACA,SACEC,2BADF,EAEEC,UAFF,EAGEC,kBAHF,EAIEC,sBAJF,EAKEC,sBALF,EAMEC,mBANF,QAOO,aAPP;AAWA,IAAMC,eAAe,GA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AA,CAAnB"}
1
+ {"version":3,"file":"Settings.js","names":["isPlainObject","has","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","defaultSettings","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","hasAllContentInData","loginType","loginPath","loginUsernameField","loginPasswordField","logoutPath"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst defaultSettings = {\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n */\nexport const loginType = (): string => getSetting(LOGIN_TYPE, \"JAAS\");\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/j_security_check\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \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X,UAAU,CAAClC,sBAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;AACA,OAAO,IAAM8C,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCZ,UAAU,CAACjC,sBAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;AACA,OAAO,IAAM8C,UAAU,GAAG,SAAbA,UAAa;EAAA,OACxBb,UAAU,CAAChC,mBAAD,EAAsB,SAAtB,CADc;AAAA,CAAnB"}
@@ -93,6 +93,15 @@ var ApplicationModel = /*#__PURE__*/function (_ResourceModel) {
93
93
  get: function get() {
94
94
  return this.getContribution("label", "");
95
95
  }
96
+ /**
97
+ * Getting the authentication types of the application
98
+ */
99
+
100
+ }, {
101
+ key: "authenticationTypes",
102
+ get: function get() {
103
+ return this.getContribution("security", []);
104
+ }
96
105
  /**
97
106
  * Getting the tab links
98
107
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationModel.js","names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","ApplicationModel","userService","links","getLinkByKey","href","path","models","userServiceModel","model","type","userServices","getContribution","getLinksByGroup","create","_userServices","isLoggedIn","userLink","data","contributions","resourcetype"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AACA,OAAOA,aAAP,MAA0B,uBAA1B;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AAEA,SAASC,sBAAT,QAAuC,kBAAvC;;AAOA;AACA;AACA;IACqBC,gB;;;;;;;;;;;;;;;;;;;;;;;;;;IAGnB;AACF;AACA;IACE,eAAmB;MACjB,OAAO,aAAP;IACD;IAED;AACF;;;;;IAQE;AACF;IACE,qCAA8C;MAC5C,IAAM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B,IAA6B,KAAKA,YAAL,CAAkBM,QAAlB,IAA8B,IAA/D,EAAqE;QACnE,OAAO,KAAKN,YAAL,CAAkBM,QAAlB,CAA2BZ,IAAlC;MACD;;MAED,OAAO,IAAP;IACD;;;WApFD,2BAAyBa,IAAzB,EAA2D;MACzD,OACEA,IAAI,CAACC,aAAL,CAAmBC,YAAnB,IACAF,IAAI,CAACC,aAAL,CAAmBC,YAAnB,KAAoC,aAFtC;IAID;;;;EAjB2CvB,a;;SAAzBI,gB"}
1
+ {"version":3,"file":"ApplicationModel.js","names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","ApplicationModel","userService","links","getLinkByKey","href","path","models","userServiceModel","model","type","userServices","getContribution","getLinksByGroup","create","_userServices","isLoggedIn","userLink","data","contributions","resourcetype"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n return this.getContribution(\"security\", []);\n }\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AACA,OAAOA,aAAP,MAA0B,uBAA1B;AACA,OAAOC,SAAP,MAAsB,oBAAtB;AACA,OAAOC,iBAAP,MAA8B,2BAA9B;AAEA,SAASC,sBAAT,QAAuC,kBAAvC;;AAOA;AACA;AACA;IACqBC,gB;;;;;;;;;;;;;;;;;;;;;;;;;;IAGnB;AACF;AACA;IACE,eAAmB;MACjB,OAAO,aAAP;IACD;IAED;AACF;;;;;IAQE;AACF;IACE,qCAA8C;MAC5C,IAAMC,WAAW,GAAG,KAAKC,KAAL,CAAWC,YAAX,CAAwB,cAAxB,CAApB;;MACA,IAAIF,WAAW,IAAIA,WAAW,CAACG,IAAZ,CAAiBC,IAAjB,KAA0B,QAA7C,EAAuD;QACrD,MAAM,IAAIN,sBAA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AKN,YAAL,CAAkBM,QAAlB,CAA2BZ,IAAlC;MACD;;MAED,OAAO,IAAP;IACD;;;WA1FD,2BAAyBa,IAAzB,EAA2D;MACzD,OACEA,IAAI,CAACC,aAAL,CAAmBC,YAAnB,IACAF,IAAI,CAACC,aAAL,CAAmBC,YAAnB,KAAoC,aAFtC;IAID;;;;EAjB2CvB,a;;SAAzBI,gB"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {|\n _id: string,\n label: string,\n value: string,\n|};\n\nexport type propertyJSON = {|\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n|};\n\nexport type textfragmentJSON = {|\n label: string,\n text: string,\n type: string,\n|};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {|\n _id: string,\n label: string,\n value: string,\n|};\n\nexport type propertyJSON = {|\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n|};\n\nexport type textfragmentJSON = {|\n label: string,\n text: string,\n type: string,\n|};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { loadModularUI } from "../_modularui/actions";
1
+ import { loadModularUI, removeModelByKey } from "../_modularui/actions";
2
2
  import { keyByHref } from "../_modularui/selectors";
3
3
  import { ApplicationModel, Href } from "../../models";
4
4
 
@@ -15,6 +15,7 @@ export var reloadApplication = function reloadApplication() {
15
15
  modelKey = "application(/)(".concat(locale, ")");
16
16
  }
17
17
 
18
+ dispatch(removeModelByKey(modelKey));
18
19
  return dispatch(loadModularUI(modelKey, new Href("/", "Application"), {
19
20
  targetModel: ApplicationModel
20
21
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"Application.js","names":["loadModularUI","keyByHref","ApplicationModel","Href","reloadApplication","dispatch","getState","modelKey","locale","i18n","targetModel"],"sources":["../../../src/redux/actions/Application.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/actions\";\nimport { keyByHref } from \"../_modularui/selectors\";\nimport { ApplicationModel, Href } from \"../../models\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\n\n/**\n */\nexport const reloadApplication =\n (): ThunkAction => (dispatch: Dispatch, getState: GetState) => {\n let modelKey = keyByHref(getState(), \"/\");\n\n if (!modelKey) {\n const locale = getState().i18n?.locale;\n modelKey = `application(/)(${locale})`;\n }\n\n return dispatch(\n loadModularUI(modelKey, new Href(\"/\", \"Application\"), {\n targetModel: ApplicationModel,\n })\n );\n };\n"],"mappings":"AACA,SAASA,aAAT,QAA8B,uBAA9B;AACA,SAASC,SAAT,QAA0B,yBAA1B;AACA,SAASC,gBAAT,EAA2BC,IAA3B,QAAuC,cAAvC;;AAIA;AACA;AACA,OAAO,IAAMC,iBAAiB,GAC5B,SADWA,iBACX;EAAA,OAAmB,UAACC,QAAD,EAAqBC,QAArB,EAA4C;IAC7D,IAAIC,QAAQ,GAAGN,SAAS,CAACK,QAAQ,EAAT,EAAa,GAAb,CAAxB;;IAEA,IAAI,CAACC,QAAL,EAAe;MAAA;;MACb,IAAMC,MAAM,qBAAGF,QAAQ,GAAGG,IAAd,mDAAG,eAAiBD,MAAhC;MACAD,QAAQ,4BAAqBC,MAArB,MAAR;IACD;;IAED,OAAOH,QAAQ,CACbL,aAAa,CAACO,QAAD,EAAW,IAAIJ,IAAJ,CAAS,GAAT,EAAc,aAAd,CAAX,EAAyC;MACpDO,WAAW,EAAER;IADuC,CAAzC,CADA,CAAf;EAKD,CAbD;AAAA,CADK"}
1
+ {"version":3,"file":"Application.js","names":["loadModularUI","removeModelByKey","keyByHref","ApplicationModel","Href","reloadApplication","dispatch","getState","modelKey","locale","i18n","targetModel"],"sources":["../../../src/redux/actions/Application.js"],"sourcesContent":["// @flow\nimport { loadModularUI, removeModelByKey } from \"../_modularui/actions\";\nimport { keyByHref } from \"../_modularui/selectors\";\nimport { ApplicationModel, Href } from \"../../models\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\n\n/**\n */\nexport const reloadApplication =\n (): ThunkAction => (dispatch: Dispatch, getState: GetState) => {\n let modelKey = keyByHref(getState(), \"/\");\n\n if (!modelKey) {\n const locale = getState().i18n?.locale;\n modelKey = `application(/)(${locale})`;\n }\n\n dispatch(removeModelByKey(modelKey));\n\n return dispatch(\n loadModularUI(modelKey, new Href(\"/\", \"Application\"), {\n targetModel: ApplicationModel,\n })\n );\n };\n"],"mappings":"AACA,SAASA,aAAT,EAAwBC,gBAAxB,QAAgD,uBAAhD;AACA,SAASC,SAAT,QAA0B,yBAA1B;AACA,SAASC,gBAAT,EAA2BC,IAA3B,QAAuC,cAAvC;;AAIA;AACA;AACA,OAAO,IAAMC,iBAAiB,GAC5B,SADWA,iBACX;EAAA,OAAmB,UAACC,QAAD,EAAqBC,QAArB,EAA4C;IAC7D,IAAIC,QAAQ,GAAGN,SAAS,CAACK,QAAQ,EAAT,EAAa,GAAb,CAAxB;;IAEA,IAAI,CAACC,QAAL,EAAe;MAAA;;MACb,IAAMC,MAAM,qBAAGF,QAAQ,GAAGG,IAAd,mDAAG,eAAiBD,MAAhC;MACAD,QAAQ,4BAAqBC,MAArB,MAAR;IACD;;IAEDH,QAAQ,CAACL,gBAAgB,CAACO,QAAD,CAAjB,CAAR;IAEA,OAAOF,QAAQ,CACbN,aAAa,CAACQ,QAAD,EAAW,IAAIJ,IAAJ,CAAS,GAAT,EAAc,aAAd,CAAX,EAAyC;MACpDO,WAAW,EAAER;IADuC,CAAzC,CADA,CAAf;EAKD,CAfD;AAAA,CADK"}
@@ -5,6 +5,7 @@ import { logoutSuccess } from "./SignOut";
5
5
  import { showNotification } from "./Notification";
6
6
  import Cache from "../../utils/browser/Cache";
7
7
  import { removeModelByKey } from "../_modularui/actions";
8
+ import { getApplication } from "../_modularui/selectors";
8
9
  import { reloadApplication } from "./Application";
9
10
  import { getSetting } from "../../constants";
10
11
 
@@ -21,10 +22,12 @@ export var handleUnauthorized = function handleUnauthorized(errorResponse) {
21
22
  if (getSetting("PAGE_RELOAD_ON_UNAUTHORIZED_ERROR", false) && (_errorResponse$respon = errorResponse.response) !== null && _errorResponse$respon !== void 0 && _errorResponse$respon.error) {
22
23
  window.location.reload();
23
24
  return;
24
- } // reload application when flag auth is set
25
+ } // reload application when flag auth is set or isLogged
25
26
 
26
27
 
27
- if (Cache.getItem("auth")) {
28
+ var application = getApplication(getState());
29
+
30
+ if (Cache.getItem("auth") || application !== null && application !== void 0 && application.isLoggedIn) {
28
31
  dispatch(reloadApplication());
29
32
  } // set logged auth
30
33
 
@@ -1 +1 @@
1
- {"version":3,"file":"Authorization.js","names":["LOGIN_PATH","NOTIFICATION_TYPES","ErrorResponse","replace","logoutSuccess","showNotification","Cache","removeModelByKey","reloadApplication","getSetting","handleUnauthorized","errorResponse","dispatch","getState","connectKey","response","error","window","location","reload","getItem","removeItem","isInvalidUsername","WARNING_TIMEOUT","WARNING","id","defaultMessage","message","router","pathname","locationFrom","state","from","modal","type"],"sources":["../../../src/redux/actions/Authorization.js"],"sourcesContent":["// @flow\nimport { LOGIN_PATH, NOTIFICATION_TYPES } from \"../../constants/Constants\";\n\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\n\nimport { replace } from \"../_router/actions\";\nimport { logoutSuccess } from \"./SignOut\";\nimport { showNotification } from \"./Notification\";\n\nimport Cache from \"../../utils/browser/Cache\";\n\nimport { removeModelByKey } from \"../_modularui/actions\";\nimport { reloadApplication } from \"./Application\";\n\nimport { getSetting } from \"../../constants\";\n\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const handleUnauthorized =\n (errorResponse: ErrorResponse): ThunkAction =>\n (dispatch, getState) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response?.error\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set\n if (Cache.getItem(\"auth\")) {\n dispatch(reloadApplication());\n }\n\n // set logged auth\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n const WARNING_TIMEOUT = 4000;\n dispatch(\n showNotification(\n NOTIFICATION_TYPES.WARNING,\n {\n id: errorResponse.id,\n defaultMessage: errorResponse.message,\n },\n null,\n WARNING_TIMEOUT\n )\n );\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n return dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n })\n );\n }\n\n return { type: \"NO_ACTION\" };\n };\n"],"mappings":"AACA,SAASA,UAAT,EAAqBC,kBAArB,QAA+C,2BAA/C;AAEA,OAAOC,aAAP,MAA0B,kCAA1B;AAEA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,aAAT,QAA8B,WAA9B;AACA,SAASC,gBAAT,QAAiC,gBAAjC;AAEA,OAAOC,KAAP,MAAkB,2BAAlB;AAEA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASC,iBAAT,QAAkC,eAA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,UAAD,EAAa;QAClBgC,IAAI,EAAEF,YAAY,GAAGA,YAAH,GAAkBjB,QAAQ,GAAGe,MAAX,CAAkBV,QADpC;QAElB;QACAe,KAAK,EAAE;MAHW,CAAb,CADM,CAAf;IAOD;;IAED,OAAO;MAAEC,IAAI,EAAE;IAAR,CAAP;EACD,CArDD;AAAA,CADK"}
1
+ {"version":3,"file":"Authorization.js","names":["LOGIN_PATH","NOTIFICATION_TYPES","ErrorResponse","replace","logoutSuccess","showNotification","Cache","removeModelByKey","getApplication","reloadApplication","getSetting","handleUnauthorized","errorResponse","dispatch","getState","connectKey","response","error","window","location","reload","application","getItem","isLoggedIn","removeItem","isInvalidUsername","WARNING_TIMEOUT","WARNING","id","defaultMessage","message","router","pathname","locationFrom","state","from","modal","type"],"sources":["../../../src/redux/actions/Authorization.js"],"sourcesContent":["// @flow\nimport { LOGIN_PATH, NOTIFICATION_TYPES } from \"../../constants/Constants\";\n\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\n\nimport { replace } from \"../_router/actions\";\nimport { logoutSuccess } from \"./SignOut\";\nimport { showNotification } from \"./Notification\";\n\nimport Cache from \"../../utils/browser/Cache\";\n\nimport { removeModelByKey } from \"../_modularui/actions\";\nimport { getApplication } from \"../_modularui/selectors\";\nimport { reloadApplication } from \"./Application\";\n\nimport { getSetting } from \"../../constants\";\n\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const handleUnauthorized =\n (errorResponse: ErrorResponse): ThunkAction =>\n (dispatch, getState) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response?.error\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set or isLogged\n const application = getApplication(getState());\n if (Cache.getItem(\"auth\") || application?.isLoggedIn) {\n dispatch(reloadApplication());\n }\n\n // set logged auth\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n const WARNING_TIMEOUT = 4000;\n dispatch(\n showNotification(\n NOTIFICATION_TYPES.WARNING,\n {\n id: errorResponse.id,\n defaultMessage: errorResponse.message,\n },\n null,\n WARNING_TIMEOUT\n )\n );\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n return dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n })\n );\n }\n\n return { type: \"NO_ACTION\" };\n };\n"],"mappings":"AACA,SAASA,UAAT,EAAqBC,kBAArB,QAA+C,2BAA/C;AAEA,OAAOC,aAAP,MAA0B,kCAA1B;AAEA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,aAAT,QAA8B,WAA9B;AACA,SAASC,gBAAT,QAAiC,gBAAjC;AAEA,OAAOC,KAAP,MAAkB,2BAAlB;AAEA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASC,cAAT,QAA+B,yBAA/B;AACA,SAASC,iBAAT,QAAkC,eAAlC;AAEA,SAASC,UAAT,QAA2B,iBAA3B;;AAIA;AACA;AACA,OAAO,IAAMC,kBAAkB,GAC7B,SADWA,kBACX,CAACC,aAAD;EAAA,OACA,UAACC,QAAD,EAAWC,QAAX,EAAwB;IAAA;;IACtB,IAAIF,aAAa,CAACG,UAAlB,EAA8B;MAC5BF,QAAQ,CAACN,gBAAgB,CAACK,aAAa,CAACG,UAAf,CAAjB,CAAR;IACD;;IAED,IACEL,UAAU,CAAC,mCAAD,EAAsC,KAAtC,CAAV,6BACAE,aAAa,CAACI,QADd,kDACA,sBAAwBC,KAF1B,EAGE;MACAC,MAAM,CAACC,QAAP,CAAgBC,MAAhB;MACA;IACD,CAXqB,CAatB;;;IACA,IAAMC,WAAW,GAAGb,cAAc,CAACM,QAAQ,EAAT,CAAlC;;IACA,IAAIR,KAAK,CAACgB,OAAN,CAAc,MAAd,KAAyBD,WAAzB,aAAyBA,WAAzB,eAAyBA,WAAW,CAAEE,UAA1C,EAAsD;MACpDV,QAAQ,CAACJ,iBAAiB,EAAlB,CAAR;IACD,CAjBqB,CAmBtB;;;IACAI,QAAQ,CAACT,aAAa,EAAd,CAAR;IAEAE,KAAK,CAACkB,UAAN,CAAiB,MAAjB;;IAEA,IAAIZ,aAAa,CAACa,iBAAlB,EAAqC;MACnC,IAAMC,eAAe,GAAG,IAAxB;MACAb,QAAQ,CACNR,gBAAgB,CACdJ,kBAAkB,CAAC0B,OADL,EAEd;QACEC,EAAE,EAAEhB,aAAa,CAACgB,EADpB;QAEEC,cAAc,EAAEjB,aAAa,CAACkB;MAFhC,CAFc,EAMd,IANc,EAOdJ,eAPc,CADV,CAAR;IAWD,CArCqB,CAuCtB;;;IACA,IAAMP,QAAQ,GAAGL,QAAQ,GAAGiB,MAAX,CAAkBZ,QAAnC;;IACA,IAAI,CAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEa,QAAV,MAAuBhC,UAA3B,EAAuC;MAAA;;MACrC,IAAMiC,YAAY,GAAGd,QAAH,aAAGA,QAAH,0CAAGA,QAAQ,CAAEe,KAAb,oDAAG,gBAAiBC,IAAtC;MACA,OAAOtB,QAAQ,CACbV,OAAO,CAACH,UAAD,EAAa;QAClBmC,IAAI,EAAEF,YAAY,GAAGA,YAAH,GAAkBnB,QAAQ,GAAGiB,MAAX,CAAkBZ,QADpC;QAElB;QACAiB,KAAK,EAAE;MAHW,CAAb,CADM,CAAf;IAOD;;IAED,OAAO;MAAEC,IAAI,EAAE;IAAR,CAAP;EACD,CAtDD;AAAA,CADK"}
@@ -2,10 +2,10 @@ import Authenticate from "../../modularui/Authenticate";
2
2
  import { startProgress, finishProgress } from "./ProgressIndicator";
3
3
  import { resetModularUI } from "../_modularui/actions";
4
4
  import { reloadApplication } from "./Application";
5
+
5
6
  /**
6
7
  * Send logout success action
7
8
  */
8
-
9
9
  export var logoutSuccess = function logoutSuccess() {
10
10
  return {
11
11
  type: "AUTHENTICATION_LOGOUT"
@@ -1 +1 @@
1
- {"version":3,"file":"SignOut.js","names":["Authenticate","startProgress","finishProgress","resetModularUI","reloadApplication","logoutSuccess","type","logout","dispatch","then"],"sources":["../../../src/redux/actions/SignOut.js"],"sourcesContent":["// @flow\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { resetModularUI } from \"../_modularui/actions\";\n\nimport type { Dispatch, LogoutSuccessAction, ThunkAction } from \"../types\";\nimport { reloadApplication } from \"./Application\";\n\n/**\n * Send logout success action\n */\nexport const logoutSuccess = (): LogoutSuccessAction => ({\n type: \"AUTHENTICATION_LOGOUT\",\n});\n\n/**\n */\nexport const logout = (): ThunkAction => (dispatch: Dispatch) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .logout()\n .then(() => dispatch(resetModularUI()))\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n dispatch(logoutSuccess());\n return dispatch(finishProgress());\n });\n};\n"],"mappings":"AACA,OAAOA,YAAP,MAAyB,8BAAzB;AACA,SAASC,aAAT,EAAwBC,cAAxB,QAA8C,qBAA9C;AACA,SAASC,cAAT,QAA+B,uBAA/B;AAGA,SAASC,iBAAT,QAAkC,eAAlC;AAEA;AACA;AACA;;AACA,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAgB;EAAA,OAA4B;IACvDC,IAAI,EAAE;EADiD,CAA5B;AAAA,CAAtB;AAIP;AACA;;AACA,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAS;EAAA,OAAmB,UAACC,QAAD,EAAwB;IAC/DA,QAAQ,CAACP,aAAa,EAAd,CAAR;IAEA,OAAO,IAAID,YAAJ,GACJO,MADI,GAEJE,IAFI,CAEC;MAAA,OAAMD,QAAQ,CAACL,cAAc,EAAf,CAAd;IAAA,CAFD,EAGJM,IAHI,CAGC;MAAA,OAAMD,QAAQ,CAACJ,iBAAiB,EAAlB,CAAd;IAAA,CAHD,EAIJK,IAJI,CAIC,YAAM;MACVD,QAAQ,CAACH,aAAa,EAAd,CAAR;MACA,OAAOG,QAAQ,CAACN,cAAc,EAAf,CAAf;IACD,CAPI,CAAP;EAQD,CAXqB;AAAA,CAAf"}
1
+ {"version":3,"file":"SignOut.js","names":["Authenticate","startProgress","finishProgress","resetModularUI","reloadApplication","logoutSuccess","type","logout","dispatch","then"],"sources":["../../../src/redux/actions/SignOut.js"],"sourcesContent":["// @flow\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { resetModularUI } from \"../_modularui/actions\";\nimport { reloadApplication } from \"./Application\";\n\nimport type { Dispatch, LogoutSuccessAction, ThunkAction } from \"../types\";\n\n/**\n * Send logout success action\n */\nexport const logoutSuccess = (): LogoutSuccessAction => ({\n type: \"AUTHENTICATION_LOGOUT\",\n});\n\n/**\n */\nexport const logout = (): ThunkAction => (dispatch: Dispatch) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .logout()\n .then(() => dispatch(resetModularUI()))\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n dispatch(logoutSuccess());\n return dispatch(finishProgress());\n });\n};\n"],"mappings":"AACA,OAAOA,YAAP,MAAyB,8BAAzB;AACA,SAASC,aAAT,EAAwBC,cAAxB,QAA8C,qBAA9C;AACA,SAASC,cAAT,QAA+B,uBAA/B;AACA,SAASC,iBAAT,QAAkC,eAAlC;;AAIA;AACA;AACA;AACA,OAAO,IAAMC,aAAa,GAAG,SAAhBA,aAAgB;EAAA,OAA4B;IACvDC,IAAI,EAAE;EADiD,CAA5B;AAAA,CAAtB;AAIP;AACA;;AACA,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAS;EAAA,OAAmB,UAACC,QAAD,EAAwB;IAC/DA,QAAQ,CAACP,aAAa,EAAd,CAAR;IAEA,OAAO,IAAID,YAAJ,GACJO,MADI,GAEJE,IAFI,CAEC;MAAA,OAAMD,QAAQ,CAACL,cAAc,EAAf,CAAd;IAAA,CAFD,EAGJM,IAHI,CAGC;MAAA,OAAMD,QAAQ,CAACJ,iBAAiB,EAAlB,CAAd;IAAA,CAHD,EAIJK,IAJI,CAIC,YAAM;MACVD,QAAQ,CAACH,aAAa,EAAd,CAAR;MACA,OAAOG,QAAQ,CAACN,cAAc,EAAf,CAAf;IACD,CAPI,CAAP;EAQD,CAXqB;AAAA,CAAf"}
@@ -34,6 +34,12 @@ var defaultSettings = {
34
34
  USE_INSTANT_SERVER_VALIDATION: true,
35
35
  // Indicates which locales are enabled
36
36
  ENABLED_LOCALES: ["en", "nl"],
37
+ // Renders the global log in page
38
+ RENDER_GLOBAL_LOGIN_PAGE: false,
39
+ // Renders the global log out page
40
+ RENDER_GLOBAL_LOGOUT_PAGE: false,
41
+ // Renders the login variants as option on the global logout page
42
+ RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,
37
43
  // Render forms in a modal
38
44
  RENDER_FORMS_IN_MODAL: true,
39
45
  // Wait timeout before rendering submit wait icon
@@ -42,6 +42,15 @@ const defaultSettings = {
42
42
  // Indicates which locales are enabled
43
43
  ENABLED_LOCALES: ["en", "nl"],
44
44
 
45
+ // Renders the global log in page
46
+ RENDER_GLOBAL_LOGIN_PAGE: false,
47
+
48
+ // Renders the global log out page
49
+ RENDER_GLOBAL_LOGOUT_PAGE: false,
50
+
51
+ // Renders the login variants as option on the global logout page
52
+ RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,
53
+
45
54
  // Render forms in a modal
46
55
  RENDER_FORMS_IN_MODAL: true,
47
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"Settings.js","names":["defaultSettings","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","settings","setSettings","config","isPlainObject","getSetting","key","defaultValue","has","undefined","Error","setSetting","value","allSettings","hasAllContentInData","ALL_CONTENT_IN_DATA_SETTING","loginType","LOGIN_TYPE","loginPath","LOGIN_PATH_SETTING","loginUsernameField","LOGIN_USERNAME_SETTING","loginPasswordField","LOGIN_PASSWORD_SETTING","logoutPath","LOGOUT_PATH_SETTING"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst defaultSettings = {\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n */\nexport const loginType = (): string => getSetting(LOGIN_TYPE, \"JAAS\");\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/j_security_check\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/Logoff\");\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AAWA,IAAMA,eAAe,GAAG;EACtB;EACAC,4BAA4B,EAAE,IAFR;EAItB;EACAC,yBAAyB,EAAE,IALL;EAOtB;EACAC,kBAAkB,EAAE,KARE;EAUtB;EACAC,sBAAsB,EAAE,IAXF;EAatB;EACAC,qCAAqC,EAAE,IAdjB;EAgBtB;EACAC,oCAAoC,EAAE,KAjBhB;EAmBtB;EACAC,oBAAoB,EAAE,CAAC,UAAD,EAAa,WAAb,CApBA;EAsBtB;EACAC,yBAAyB,EAAE,IAvBL;EAyBtB;EACAC,6BAA6B,EAAE,IA1BT;EA4BtB;EACAC,eAAe,EAAE,CAAC,IAAD,EAAO,IAAP,CA7BK;EA+BtB;EACAC,qBAAqB,EAAE,IAh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GAAG,SAAdA,WAAc;EAAA,OAAmCZ,QAAnC;AAAA,CAApB;AAEP;AACA;;;;;AACO,IAAMa,mBAAmB,GAAG,SAAtBA,mBAAsB;EAAA,OACjCT,UAAU,CAACU,sCAAD,EAA8B,IAA9B,CADuB;AAAA,CAA5B;AAGP;AACA;AACA;;;;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA,OAAcX,UAAU,CAACY,qBAAD,EAAa,MAAb,CAAxB;AAAA,CAAlB;AAEP;AACA;;;;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA,OACvBb,UAAU,CAACc,6BAAD,EAAqB,mBAArB,CADa;AAAA,CAAlB;AAEP;AACA;;;;;AACO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCf,UAAU,CAACgB,iCAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;;;;AACO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCjB,UAAU,CAACkB,iCAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;;;;AACO,IAAMC,UAAU,GAAG,SAAbA,UAAa;EAAA,OACxBnB,UAAU,CAACoB,8BAAD,EAAsB,SAAtB,CADc;AAAA,CAAnB"}
1
+ {"version":3,"file":"Settings.js","names":["defaultSettings","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","settings","setSettings","config","isPlainObject","getSetting","key","defaultValue","has","undefined","Error","setSetting","value","allSettings","hasAllContentInData","ALL_CONTENT_IN_DATA_SETTING","loginType","LOGIN_TYPE","loginPath","LOGIN_PATH_SETTING","loginUsernameField","LOGIN_USERNAME_SETTING","loginPasswordField","LOGIN_PASSWORD_SETTING","logoutPath","LOGOUT_PATH_SETTING"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst defaultSettings = {\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n */\nexport const loginType = (): string => getSetting(LOGIN_TYPE, \"JAAS\");\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/j_security_check\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/Logoff\");\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AAWA,IAAMA,eAAe,GAAG;EACtB;EACAC,4BAA4B,EAAE,IAFR;EAItB;EACAC,yBAAyB,EAAE,IALL;EAOtB;EACAC,kBAAkB,EAAE,KARE;EAUtB;EACAC,sBAAsB,EAAE,IAXF;EAatB;EACAC,qCAAqC,EAAE,IAdjB;EAgBtB;EACAC,oCAAoC,EAAE,KAjBhB;EAmBtB;EACAC,oBAAoB,EAAE,CAAC,UAAD,EAAa,WAAb,CApBA;EAsBtB;EACAC,yBAAyB,EAAE,IAvBL;EAyBtB;EACAC,6BAA6B,EAAE,IA1BT;EA4BtB;EACAC,eAAe,EAAE,CAAC,IAAD,EAAO,IAA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AMI,UAAU,GAAG,SAAbA,UAAa,CAACL,GAAD,EAAcM,KAAd,EAA6B;EACrDX,QAAQ,CAACK,GAAD,CAAR,GAAgBM,KAAhB;AACD,CAFM;AAIP;AACA;;;;;AACO,IAAMC,WAAW,GAAG,SAAdA,WAAc;EAAA,OAAmCZ,QAAnC;AAAA,CAApB;AAEP;AACA;;;;;AACO,IAAMa,mBAAmB,GAAG,SAAtBA,mBAAsB;EAAA,OACjCT,UAAU,CAACU,sCAAD,EAA8B,IAA9B,CADuB;AAAA,CAA5B;AAGP;AACA;AACA;;;;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA,OAAcX,UAAU,CAACY,qBAAD,EAAa,MAAb,CAAxB;AAAA,CAAlB;AAEP;AACA;;;;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA,OACvBb,UAAU,CAACc,6BAAD,EAAqB,mBAArB,CADa;AAAA,CAAlB;AAEP;AACA;;;;;AACO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCf,UAAU,CAACgB,iCAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;;;;AACO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCjB,UAAU,CAACkB,iCAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;;;;AACO,IAAMC,UAAU,GAAG,SAAbA,UAAa;EAAA,OACxBnB,UAAU,CAACoB,8BAAD,EAAsB,SAAtB,CADc;AAAA,CAAnB"}
@@ -61,6 +61,10 @@ describe("authentication hooks", () => {
61
61
 
62
62
  expect(store.getActions()).toStrictEqual([
63
63
  { type: "START_PROGRESS" },
64
+ {
65
+ type: "MODULARUI/REMOVE_KEY",
66
+ payload: "application(/)(en)",
67
+ },
64
68
  {
65
69
  type: "MODULARUI/STATUS",
66
70
  payload: { key: "application(/)(en)", status: "LOADING" },
@@ -108,6 +112,10 @@ describe("authentication hooks", () => {
108
112
  expect(store.getActions()).toStrictEqual([
109
113
  { type: "START_PROGRESS" },
110
114
  { type: "MODULARUI/RESET" },
115
+ {
116
+ type: "MODULARUI/REMOVE_KEY",
117
+ payload: "application(/)(en)",
118
+ },
111
119
  {
112
120
  type: "MODULARUI/STATUS",
113
121
  payload: { key: "application(/)(en)", status: "LOADING" },
@@ -112,6 +112,15 @@ var ApplicationModel = /*#__PURE__*/function (_ResourceModel) {
112
112
  get: function get() {
113
113
  return this.getContribution("label", "");
114
114
  }
115
+ /**
116
+ * Getting the authentication types of the application
117
+ */
118
+
119
+ }, {
120
+ key: "authenticationTypes",
121
+ get: function get() {
122
+ return this.getContribution("security", []);
123
+ }
115
124
  /**
116
125
  * Getting the tab links
117
126
  */
@@ -5,7 +5,7 @@ import UserServicesModel from "../user/UserServicesModel";
5
5
 
6
6
  import { NotAllowedUriException } from "../../exceptions";
7
7
 
8
- import type { ModularUIModel } from "../types";
8
+ import type { ModularUIModel, AuthenticationType } from "../types";
9
9
  import type { ModularUIResponse } from "../../modularui";
10
10
  import type LinkCollection from "../links/LinkCollection";
11
11
  import type Href from "../href/Href";
@@ -64,6 +64,12 @@ export default class ApplicationModel extends ResourceModel {
64
64
  return this.getContribution("label", "");
65
65
  }
66
66
 
67
+ /**
68
+ * Getting the authentication types of the application
69
+ */
70
+ get authenticationTypes(): Array<AuthenticationType> {
71
+ return this.getContribution("security", []);
72
+ }
67
73
  /**
68
74
  * Getting the tab links
69
75
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ApplicationModel.js","names":["ApplicationModel","userService","links","getLinkByKey","href","path","NotAllowedUriException","models","userServiceModel","model","type","userServices","getContribution","getLinksByGroup","LinkModel","create","_userServices","UserServicesModel","isLoggedIn","userLink","data","contributions","resourcetype","ResourceModel"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null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AKO,aAAL,GAAqBP,KAAK,YAAYQ,0BAAjB,GAAqCR,KAArC,GAA6C,IAAlE;IACD;;;SAYD,eAA0B;MAAA;;MACxB,sDAAO,KAAKE,YAAZ,uDAAO,mBAAmBO,UAA1B,yEAAwC,KAAxC;IACD;IAED;AACF;AACA;AACA;;;;SACE,eAA4B;MAC1B,IAAI,KAAKP,YAAL,IAAqB,IAArB,IAA6B,KAAKA,YAAL,CAAkBQ,QAAlB,IAA8B,IAA/D,EAAqE;QACnE,OAAO,KAAKR,YAAL,CAAkBQ,QAAlB,CAA2Bf,IAAlC;MACD;;MAED,OAAO,IAAP;IACD;;;WApFD,2BAAyBgB,IAAzB,EAA2D;MACzD,OACEA,IAAI,CAACC,aAAL,CAAmBC,YAAnB,IACAF,IAAI,CAACC,aAAL,CAAmBC,YAAnB,KAAoC,aAFtC;IAID;;;EAjB2CC,uB"}
1
+ {"version":3,"file":"ApplicationModel.js","names":["ApplicationModel","userService","links","getLinkByKey","href","path","NotAllowedUriException","models","userServiceModel","model","type","userServices","getContribution","getLinksByGroup","LinkModel","create","_userServices","UserServicesModel","isLoggedIn","userLink","data","contributions","resourcetype","ResourceModel"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n return this.getContribution(\"security\", []);\n }\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AACA;;AACA;;AAEA;;;;;;AAOA;AACA;AACA;IACqBA,gB;;;;;;;;;;;;;;;;;;;;;;;;IAGnB;AACF;AACA;IACE,eAAmB;MACjB,OAAO,aAAP;IACD;IAED;AACF;;;;;IAQE;AACF;IACE,qCAA8C;MAC5C,IAAMC,WAAW,GAAG,KAAKC,KAAL,CA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ACF;AACA;AACA;;;;SACE,eAA4B;MAC1B,IAAI,KAAKP,YAAL,IAAqB,IAArB,IAA6B,KAAKA,YAAL,CAAkBQ,QAAlB,IAA8B,IAA/D,EAAqE;QACnE,OAAO,KAAKR,YAAL,CAAkBQ,QAAlB,CAA2Bf,IAAlC;MACD;;MAED,OAAO,IAAP;IACD;;;WA1FD,2BAAyBgB,IAAzB,EAA2D;MACzD,OACEA,IAAI,CAACC,aAAL,CAAmBC,YAAnB,IACAF,IAAI,CAACC,aAAL,CAAmBC,YAAnB,KAAoC,aAFtC;IAID;;;EAjB2CC,uB"}
@@ -153,6 +153,13 @@ export interface IModelWithChildModels {
153
153
  setChildModels(models: Array<ModularUIModel>): void;
154
154
  }
155
155
 
156
+ export type AuthenticationType = {
157
+ name: string,
158
+ authentication: string,
159
+ redirectUri: string,
160
+ isPrimary: boolean,
161
+ };
162
+
156
163
  export type FileEntryType = {
157
164
  name: string,
158
165
  size?: number,
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {|\n _id: string,\n label: string,\n value: string,\n|};\n\nexport type propertyJSON = {|\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n|};\n\nexport type textfragmentJSON = {|\n label: string,\n text: string,\n type: string,\n|};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {|\n _id: string,\n label: string,\n value: string,\n|};\n\nexport type propertyJSON = {|\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n|};\n\nexport type textfragmentJSON = {|\n label: string,\n text: string,\n type: string,\n|};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
@@ -24,6 +24,7 @@ var reloadApplication = function reloadApplication() {
24
24
  modelKey = "application(/)(".concat(locale, ")");
25
25
  }
26
26
 
27
+ dispatch((0, _actions.removeModelByKey)(modelKey));
27
28
  return dispatch((0, _actions.loadModularUI)(modelKey, new _models.Href("/", "Application"), {
28
29
  targetModel: _models.ApplicationModel
29
30
  }));
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import { loadModularUI } from "../_modularui/actions";
2
+ import { loadModularUI, removeModelByKey } from "../_modularui/actions";
3
3
  import { keyByHref } from "../_modularui/selectors";
4
4
  import { ApplicationModel, Href } from "../../models";
5
5
 
@@ -16,6 +16,8 @@ export const reloadApplication =
16
16
  modelKey = `application(/)(${locale})`;
17
17
  }
18
18
 
19
+ dispatch(removeModelByKey(modelKey));
20
+
19
21
  return dispatch(
20
22
  loadModularUI(modelKey, new Href("/", "Application"), {
21
23
  targetModel: ApplicationModel,
@@ -1 +1 @@
1
- {"version":3,"file":"Application.js","names":["reloadApplication","dispatch","getState","modelKey","keyByHref","locale","i18n","loadModularUI","Href","targetModel","ApplicationModel"],"sources":["../../../src/redux/actions/Application.js"],"sourcesContent":["// @flow\nimport { loadModularUI } from \"../_modularui/actions\";\nimport { keyByHref } from \"../_modularui/selectors\";\nimport { ApplicationModel, Href } from \"../../models\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\n\n/**\n */\nexport const reloadApplication =\n (): ThunkAction => (dispatch: Dispatch, getState: GetState) => {\n let modelKey = keyByHref(getState(), \"/\");\n\n if (!modelKey) {\n const locale = getState().i18n?.locale;\n modelKey = `application(/)(${locale})`;\n }\n\n return dispatch(\n loadModularUI(modelKey, new Href(\"/\", \"Application\"), {\n targetModel: ApplicationModel,\n })\n );\n };\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AAIA;AACA;AACO,IAAMA,iBAAiB,GAC5B,SADWA,iBACX;EAAA,OAAmB,UAACC,QAAD,EAAqBC,QAArB,EAA4C;IAC7D,IAAIC,QAAQ,GAAG,IAAAC,oBAAA,EAAUF,QAAQ,EAAlB,EAAsB,GAAtB,CAAf;;IAEA,IAAI,CAACC,QAAL,EAAe;MAAA;;MACb,IAAME,MAAM,qBAAGH,QAAQ,GAAGI,IAAd,mDAAG,eAAiBD,MAAhC;MACAF,QAAQ,4BAAqBE,MAArB,MAAR;IACD;;IAED,OAAOJ,QAAQ,CACb,IAAAM,sBAAA,EAAcJ,QAAd,EAAwB,IAAIK,YAAJ,CAAS,GAAT,EAAc,aAAd,CAAxB,EAAsD;MACpDC,WAAW,EAAEC;IADuC,CAAtD,CADa,CAAf;EAKD,CAbD;AAAA,CADK"}
1
+ {"version":3,"file":"Application.js","names":["reloadApplication","dispatch","getState","modelKey","keyByHref","locale","i18n","removeModelByKey","loadModularUI","Href","targetModel","ApplicationModel"],"sources":["../../../src/redux/actions/Application.js"],"sourcesContent":["// @flow\nimport { loadModularUI, removeModelByKey } from \"../_modularui/actions\";\nimport { keyByHref } from \"../_modularui/selectors\";\nimport { ApplicationModel, Href } from \"../../models\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\n\n/**\n */\nexport const reloadApplication =\n (): ThunkAction => (dispatch: Dispatch, getState: GetState) => {\n let modelKey = keyByHref(getState(), \"/\");\n\n if (!modelKey) {\n const locale = getState().i18n?.locale;\n modelKey = `application(/)(${locale})`;\n }\n\n dispatch(removeModelByKey(modelKey));\n\n return dispatch(\n loadModularUI(modelKey, new Href(\"/\", \"Application\"), {\n targetModel: ApplicationModel,\n })\n );\n };\n"],"mappings":";;;;;;;AACA;;AACA;;AACA;;AAIA;AACA;AACO,IAAMA,iBAAiB,GAC5B,SADWA,iBACX;EAAA,OAAmB,UAACC,QAAD,EAAqBC,QAArB,EAA4C;IAC7D,IAAIC,QAAQ,GAAG,IAAAC,oBAAA,EAAUF,QAAQ,EAAlB,EAAsB,GAAtB,CAAf;;IAEA,IAAI,CAACC,QAAL,EAAe;MAAA;;MACb,IAAME,MAAM,qBAAGH,QAAQ,GAAGI,IAAd,mDAAG,eAAiBD,MAAhC;MACAF,QAAQ,4BAAqBE,MAArB,MAAR;IACD;;IAEDJ,QAAQ,CAAC,IAAAM,yBAAA,EAAiBJ,QAAjB,CAAD,CAAR;IAEA,OAAOF,QAAQ,CACb,IAAAO,sBAAA,EAAcL,QAAd,EAAwB,IAAIM,YAAJ,CAAS,GAAT,EAAc,aAAd,CAAxB,EAAsD;MACpDC,WAAW,EAAEC;IADuC,CAAtD,CADa,CAAf;EAKD,CAfD;AAAA,CADK"}
@@ -21,6 +21,8 @@ var _Cache = _interopRequireDefault(require("../../utils/browser/Cache"));
21
21
 
22
22
  var _actions2 = require("../_modularui/actions");
23
23
 
24
+ var _selectors = require("../_modularui/selectors");
25
+
24
26
  var _Application = require("./Application");
25
27
 
26
28
  var _constants = require("../../constants");
@@ -38,10 +40,12 @@ var handleUnauthorized = function handleUnauthorized(errorResponse) {
38
40
  if ((0, _constants.getSetting)("PAGE_RELOAD_ON_UNAUTHORIZED_ERROR", false) && (_errorResponse$respon = errorResponse.response) !== null && _errorResponse$respon !== void 0 && _errorResponse$respon.error) {
39
41
  window.location.reload();
40
42
  return;
41
- } // reload application when flag auth is set
43
+ } // reload application when flag auth is set or isLogged
44
+
42
45
 
46
+ var application = (0, _selectors.getApplication)(getState());
43
47
 
44
- if (_Cache.default.getItem("auth")) {
48
+ if (_Cache.default.getItem("auth") || application !== null && application !== void 0 && application.isLoggedIn) {
45
49
  dispatch((0, _Application.reloadApplication)());
46
50
  } // set logged auth
47
51
 
@@ -10,6 +10,7 @@ import { showNotification } from "./Notification";
10
10
  import Cache from "../../utils/browser/Cache";
11
11
 
12
12
  import { removeModelByKey } from "../_modularui/actions";
13
+ import { getApplication } from "../_modularui/selectors";
13
14
  import { reloadApplication } from "./Application";
14
15
 
15
16
  import { getSetting } from "../../constants";
@@ -33,8 +34,9 @@ export const handleUnauthorized =
33
34
  return;
34
35
  }
35
36
 
36
- // reload application when flag auth is set
37
- if (Cache.getItem("auth")) {
37
+ // reload application when flag auth is set or isLogged
38
+ const application = getApplication(getState());
39
+ if (Cache.getItem("auth") || application?.isLoggedIn) {
38
40
  dispatch(reloadApplication());
39
41
  }
40
42
 
@@ -1 +1 @@
1
- {"version":3,"file":"Authorization.js","names":["handleUnauthorized","errorResponse","dispatch","getState","connectKey","removeModelByKey","getSetting","response","error","window","location","reload","Cache","getItem","reloadApplication","logoutSuccess","removeItem","isInvalidUsername","WARNING_TIMEOUT","showNotification","NOTIFICATION_TYPES","WARNING","id","defaultMessage","message","router","pathname","LOGIN_PATH","locationFrom","state","from","replace","modal","type"],"sources":["../../../src/redux/actions/Authorization.js"],"sourcesContent":["// @flow\nimport { LOGIN_PATH, NOTIFICATION_TYPES } from \"../../constants/Constants\";\n\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\n\nimport { replace } from \"../_router/actions\";\nimport { logoutSuccess } from \"./SignOut\";\nimport { showNotification } from \"./Notification\";\n\nimport Cache from \"../../utils/browser/Cache\";\n\nimport { removeModelByKey } from \"../_modularui/actions\";\nimport { reloadApplication } from \"./Application\";\n\nimport { getSetting } from \"../../constants\";\n\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const handleUnauthorized =\n (errorResponse: ErrorResponse): ThunkAction =>\n (dispatch, getState) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response?.error\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set\n if (Cache.getItem(\"auth\")) {\n dispatch(reloadApplication());\n }\n\n // set logged auth\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n const WARNING_TIMEOUT = 4000;\n dispatch(\n showNotification(\n NOTIFICATION_TYPES.WARNING,\n {\n id: errorResponse.id,\n defaultMessage: errorResponse.message,\n },\n null,\n WARNING_TIMEOUT\n )\n );\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n return dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n })\n );\n }\n\n return { type: \"NO_ACTION\" };\n };\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AAEA;;AAIA;AACA;AACO,IAAMA,kBAAkB,GAC7B,SADWA,kBACX,CAACC,aAAD;EAAA,OACA,UAACC,QAAD,EAAWC,QAAX,EAAwB;IAAA;;IACtB,IAAIF,aAAa,CAACG,UAAlB,EAA8B;MAC5BF,QAAQ,CAAC,IAAAG,0BAAA,EAAiBJ,aAAa,CAACG,UAA/B,CAAD,CAAR;IACD;;IAED,IACE,IAAAE,qBAAA,EAAW,mCAAX,EAAgD,KAAhD,8BACAL,aAAa,CAACM,QADd,kDACA,sBAAwBC,KAF1B,EAGE;MACAC,MAAM,CAACC,QAAP,CAAgBC,MAAhB;MACA;IACD,CAXqB,CAatB;;;IACA,IAAIC,cAAA,CAAMC,OAAN,CAAc,MAAd,CAAJ,EAA2B;MACzBX,QAAQ,CAAC,IAAAY,8BAAA,GAAD,CAAR;IACD,CAhBqB,CAkBtB;;;IACAZ,QAAQ,CAAC,IAAAa,sBAAA,GAAD,CAAR;;IAEAH,cAAA,CAAMI,UAAN,CAAiB,MAAjB;;IAEA,IAAIf,aAAa,CAACgB,iBAAlB,EAAqC;MACnC,IAAMC,eAAe,GAAG,IAAxB;MACAhB,QAAQ,CACN,IAAAiB,8BAAA,EACEC,6BAAA,CAAmBC,OADrB,EAEE;QACEC,EAAE,EAAErB,aAAa,CAACqB,EADpB;QAEEC,cAAc,EAAEtB,aAAa,CAACuB;MAFhC,CAFF,EAME,IANF,EAOEN,eAPF,CADM,CAAR;IAWD,CApCqB,CAsCtB;;;IACA,IAAMR,QAAQ,GAAGP,QAAQ,GAAGsB,MAAX,CAAkBf,QAAnC;;IACA,IAAI,CAAAA,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEgB,QAAV,MAAuBC,qBAA3B,EAAuC;MAAA;;MACrC,IAAMC,YAAY,GAAGlB,QAAH,aAAGA,QAAH,0CAAGA,QAAQ,CAAEmB,KAAb,oDAAG,gBAAiBC,IAAtC;MACA,OAAO5B,QAAQ,CACb,IAAA6B,gBAAA,EAAQJ,qBAAR,EAAoB;QAClBG,IAAI,EAAEF,YAAY,GAAGA,YAAH,GAAkBzB,QAAQ,GAAGsB,MAAX,CAAkBf,QADpC;QAElB;QACAsB,KAAK,EAAE;MAHW,CAApB,CADa,CAAf;IAOD;;IAED,OAAO;MAAEC,IAAI,EAAE;IAAR,CAAP;EACD,CArDD;AAAA,CADK"}
1
+ {"version":3,"file":"Authorization.js","names":["handleUnauthorized","errorResponse","dispatch","getState","connectKey","removeModelByKey","getSetting","response","error","window","location","reload","application","getApplication","Cache","getItem","isLoggedIn","reloadApplication","logoutSuccess","removeItem","isInvalidUsername","WARNING_TIMEOUT","showNotification","NOTIFICATION_TYPES","WARNING","id","defaultMessage","message","router","pathname","LOGIN_PATH","locationFrom","state","from","replace","modal","type"],"sources":["../../../src/redux/actions/Authorization.js"],"sourcesContent":["// @flow\nimport { LOGIN_PATH, NOTIFICATION_TYPES } from \"../../constants/Constants\";\n\nimport ErrorResponse from \"../../models/error/ErrorResponse\";\n\nimport { replace } from \"../_router/actions\";\nimport { logoutSuccess } from \"./SignOut\";\nimport { showNotification } from \"./Notification\";\n\nimport Cache from \"../../utils/browser/Cache\";\n\nimport { removeModelByKey } from \"../_modularui/actions\";\nimport { getApplication } from \"../_modularui/selectors\";\nimport { reloadApplication } from \"./Application\";\n\nimport { getSetting } from \"../../constants\";\n\nimport type { ThunkAction } from \"../types\";\n\n/**\n */\nexport const handleUnauthorized =\n (errorResponse: ErrorResponse): ThunkAction =>\n (dispatch, getState) => {\n if (errorResponse.connectKey) {\n dispatch(removeModelByKey(errorResponse.connectKey));\n }\n\n if (\n getSetting(\"PAGE_RELOAD_ON_UNAUTHORIZED_ERROR\", false) &&\n errorResponse.response?.error\n ) {\n window.location.reload();\n return;\n }\n\n // reload application when flag auth is set or isLogged\n const application = getApplication(getState());\n if (Cache.getItem(\"auth\") || application?.isLoggedIn) {\n dispatch(reloadApplication());\n }\n\n // set logged auth\n dispatch(logoutSuccess());\n\n Cache.removeItem(\"auth\");\n\n if (errorResponse.isInvalidUsername) {\n const WARNING_TIMEOUT = 4000;\n dispatch(\n showNotification(\n NOTIFICATION_TYPES.WARNING,\n {\n id: errorResponse.id,\n defaultMessage: errorResponse.message,\n },\n null,\n WARNING_TIMEOUT\n )\n );\n }\n\n // add current location as from location before redirect\n const location = getState().router.location;\n if (location?.pathname !== LOGIN_PATH) {\n const locationFrom = location?.state?.from;\n return dispatch(\n replace(LOGIN_PATH, {\n from: locationFrom ? locationFrom : getState().router.location,\n // cannot open login in a modal, because of previous locations that might be secure\n modal: false,\n })\n );\n }\n\n return { type: \"NO_ACTION\" };\n };\n"],"mappings":";;;;;;;;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;AACA;;AAEA;;AAIA;AACA;AACO,IAAMA,kBAAkB,GAC7B,SADWA,kBACX,CAACC,aAAD;EAAA,OACA,UAACC,QAAD,EAAWC,QAAX,EAAwB;IAAA;;IACtB,IAAIF,aAAa,CAACG,UAAlB,EAA8B;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,IAAI,EAAEF,YAAY,GAAGA,YAAH,GAAkB5B,QAAQ,GAAGyB,MAAX,CAAkBlB,QADpC;QAElB;QACAyB,KAAK,EAAE;MAHW,CAApB,CADa,CAAf;IAOD;;IAED,OAAO;MAAEC,IAAI,EAAE;IAAR,CAAP;EACD,CAtDD;AAAA,CADK"}
@@ -2,9 +2,9 @@
2
2
  import Authenticate from "../../modularui/Authenticate";
3
3
  import { startProgress, finishProgress } from "./ProgressIndicator";
4
4
  import { resetModularUI } from "../_modularui/actions";
5
+ import { reloadApplication } from "./Application";
5
6
 
6
7
  import type { Dispatch, LogoutSuccessAction, ThunkAction } from "../types";
7
- import { reloadApplication } from "./Application";
8
8
 
9
9
  /**
10
10
  * Send logout success action
@@ -1 +1 @@
1
- {"version":3,"file":"SignOut.js","names":["logoutSuccess","type","logout","dispatch","startProgress","Authenticate","then","resetModularUI","reloadApplication","finishProgress"],"sources":["../../../src/redux/actions/SignOut.js"],"sourcesContent":["// @flow\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { resetModularUI } from \"../_modularui/actions\";\n\nimport type { Dispatch, LogoutSuccessAction, ThunkAction } from \"../types\";\nimport { reloadApplication } from \"./Application\";\n\n/**\n * Send logout success action\n */\nexport const logoutSuccess = (): LogoutSuccessAction => ({\n type: \"AUTHENTICATION_LOGOUT\",\n});\n\n/**\n */\nexport const logout = (): ThunkAction => (dispatch: Dispatch) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .logout()\n .then(() => dispatch(resetModularUI()))\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n dispatch(logoutSuccess());\n return dispatch(finishProgress());\n });\n};\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AAGA;;AAEA;AACA;AACA;AACO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;EAAA,OAA4B;IACvDC,IAAI,EAAE;EADiD,CAA5B;AAAA,CAAtB;AAIP;AACA;;;;;AACO,IAAMC,MAAM,GAAG,SAATA,MAAS;EAAA,OAAmB,UAACC,QAAD,EAAwB;IAC/DA,QAAQ,CAAC,IAAAC,gCAAA,GAAD,CAAR;IAEA,OAAO,IAAIC,qBAAJ,GACJH,MADI,GAEJI,IAFI,CAEC;MAAA,OAAMH,QAAQ,CAAC,IAAAI,uBAAA,GAAD,CAAd;IAAA,CAFD,EAGJD,IAHI,CAGC;MAAA,OAAMH,QAAQ,CAAC,IAAAK,8BAAA,GAAD,CAAd;IAAA,CAHD,EAIJF,IAJI,CAIC,YAAM;MACVH,QAAQ,CAACH,aAAa,EAAd,CAAR;MACA,OAAOG,QAAQ,CAAC,IAAAM,iCAAA,GAAD,CAAf;IACD,CAPI,CAAP;EAQD,CAXqB;AAAA,CAAf"}
1
+ {"version":3,"file":"SignOut.js","names":["logoutSuccess","type","logout","dispatch","startProgress","Authenticate","then","resetModularUI","reloadApplication","finishProgress"],"sources":["../../../src/redux/actions/SignOut.js"],"sourcesContent":["// @flow\nimport Authenticate from \"../../modularui/Authenticate\";\nimport { startProgress, finishProgress } from \"./ProgressIndicator\";\nimport { resetModularUI } from \"../_modularui/actions\";\nimport { reloadApplication } from \"./Application\";\n\nimport type { Dispatch, LogoutSuccessAction, ThunkAction } from \"../types\";\n\n/**\n * Send logout success action\n */\nexport const logoutSuccess = (): LogoutSuccessAction => ({\n type: \"AUTHENTICATION_LOGOUT\",\n});\n\n/**\n */\nexport const logout = (): ThunkAction => (dispatch: Dispatch) => {\n dispatch(startProgress());\n\n return new Authenticate()\n .logout()\n .then(() => dispatch(resetModularUI()))\n .then(() => dispatch(reloadApplication()))\n .then(() => {\n dispatch(logoutSuccess());\n return dispatch(finishProgress());\n });\n};\n"],"mappings":";;;;;;;;;AACA;;AACA;;AACA;;AACA;;AAIA;AACA;AACA;AACO,IAAMA,aAAa,GAAG,SAAhBA,aAAgB;EAAA,OAA4B;IACvDC,IAAI,EAAE;EADiD,CAA5B;AAAA,CAAtB;AAIP;AACA;;;;;AACO,IAAMC,MAAM,GAAG,SAATA,MAAS;EAAA,OAAmB,UAACC,QAAD,EAAwB;IAC/DA,QAAQ,CAAC,IAAAC,gCAAA,GAAD,CAAR;IAEA,OAAO,IAAIC,qBAAJ,GACJH,MADI,GAEJI,IAFI,CAEC;MAAA,OAAMH,QAAQ,CAAC,IAAAI,uBAAA,GAAD,CAAd;IAAA,CAFD,EAGJD,IAHI,CAGC;MAAA,OAAMH,QAAQ,CAAC,IAAAK,8BAAA,GAAD,CAAd;IAAA,CAHD,EAIJF,IAJI,CAIC,YAAM;MACVH,QAAQ,CAACH,aAAa,EAAd,CAAR;MACA,OAAOG,QAAQ,CAAC,IAAAM,iCAAA,GAAD,CAAf;IACD,CAPI,CAAP;EAQD,CAXqB;AAAA,CAAf"}
@@ -16,6 +16,10 @@ describe("application actions", () => {
16
16
  await store.dispatch(reloadApplication());
17
17
 
18
18
  expect(store.getActions()).toStrictEqual([
19
+ {
20
+ type: "MODULARUI/REMOVE_KEY",
21
+ payload: "application(/)(en)",
22
+ },
19
23
  {
20
24
  type: "MODULARUI/STATUS",
21
25
  payload: { key: "application(/)(en)", status: "LOADING" },
@@ -39,6 +43,10 @@ describe("application actions", () => {
39
43
  store.dispatch(reloadApplication());
40
44
 
41
45
  expect(store.getActions()).toStrictEqual([
46
+ {
47
+ type: "MODULARUI/REMOVE_KEY",
48
+ payload: "/",
49
+ },
42
50
  {
43
51
  type: "MODULARUI/STATUS",
44
52
  payload: { key: "/", status: "LOADING" },
@@ -35,6 +35,10 @@ describe("authorization actions", () => {
35
35
  store.dispatch(handleUnauthorized(errorResponse));
36
36
 
37
37
  expect(store.getActions()).toStrictEqual([
38
+ {
39
+ type: "MODULARUI/REMOVE_KEY",
40
+ payload: "/",
41
+ },
38
42
  {
39
43
  type: "MODULARUI/REMOVE_KEY",
40
44
  payload: "/",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.19.1",
3
+ "version": "1.19.5",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -42,6 +42,15 @@ const defaultSettings = {
42
42
  // Indicates which locales are enabled
43
43
  ENABLED_LOCALES: ["en", "nl"],
44
44
 
45
+ // Renders the global log in page
46
+ RENDER_GLOBAL_LOGIN_PAGE: false,
47
+
48
+ // Renders the global log out page
49
+ RENDER_GLOBAL_LOGOUT_PAGE: false,
50
+
51
+ // Renders the login variants as option on the global logout page
52
+ RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,
53
+
45
54
  // Render forms in a modal
46
55
  RENDER_FORMS_IN_MODAL: true,
47
56
 
@@ -61,6 +61,10 @@ describe("authentication hooks", () => {
61
61
 
62
62
  expect(store.getActions()).toStrictEqual([
63
63
  { type: "START_PROGRESS" },
64
+ {
65
+ type: "MODULARUI/REMOVE_KEY",
66
+ payload: "application(/)(en)",
67
+ },
64
68
  {
65
69
  type: "MODULARUI/STATUS",
66
70
  payload: { key: "application(/)(en)", status: "LOADING" },
@@ -108,6 +112,10 @@ describe("authentication hooks", () => {
108
112
  expect(store.getActions()).toStrictEqual([
109
113
  { type: "START_PROGRESS" },
110
114
  { type: "MODULARUI/RESET" },
115
+ {
116
+ type: "MODULARUI/REMOVE_KEY",
117
+ payload: "application(/)(en)",
118
+ },
111
119
  {
112
120
  type: "MODULARUI/STATUS",
113
121
  payload: { key: "application(/)(en)", status: "LOADING" },
@@ -5,7 +5,7 @@ import UserServicesModel from "../user/UserServicesModel";
5
5
 
6
6
  import { NotAllowedUriException } from "../../exceptions";
7
7
 
8
- import type { ModularUIModel } from "../types";
8
+ import type { ModularUIModel, AuthenticationType } from "../types";
9
9
  import type { ModularUIResponse } from "../../modularui";
10
10
  import type LinkCollection from "../links/LinkCollection";
11
11
  import type Href from "../href/Href";
@@ -64,6 +64,12 @@ export default class ApplicationModel extends ResourceModel {
64
64
  return this.getContribution("label", "");
65
65
  }
66
66
 
67
+ /**
68
+ * Getting the authentication types of the application
69
+ */
70
+ get authenticationTypes(): Array<AuthenticationType> {
71
+ return this.getContribution("security", []);
72
+ }
67
73
  /**
68
74
  * Getting the tab links
69
75
  */
@@ -153,6 +153,13 @@ export interface IModelWithChildModels {
153
153
  setChildModels(models: Array<ModularUIModel>): void;
154
154
  }
155
155
 
156
+ export type AuthenticationType = {
157
+ name: string,
158
+ authentication: string,
159
+ redirectUri: string,
160
+ isPrimary: boolean,
161
+ };
162
+
156
163
  export type FileEntryType = {
157
164
  name: string,
158
165
  size?: number,
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import { loadModularUI } from "../_modularui/actions";
2
+ import { loadModularUI, removeModelByKey } from "../_modularui/actions";
3
3
  import { keyByHref } from "../_modularui/selectors";
4
4
  import { ApplicationModel, Href } from "../../models";
5
5
 
@@ -16,6 +16,8 @@ export const reloadApplication =
16
16
  modelKey = `application(/)(${locale})`;
17
17
  }
18
18
 
19
+ dispatch(removeModelByKey(modelKey));
20
+
19
21
  return dispatch(
20
22
  loadModularUI(modelKey, new Href("/", "Application"), {
21
23
  targetModel: ApplicationModel,
@@ -10,6 +10,7 @@ import { showNotification } from "./Notification";
10
10
  import Cache from "../../utils/browser/Cache";
11
11
 
12
12
  import { removeModelByKey } from "../_modularui/actions";
13
+ import { getApplication } from "../_modularui/selectors";
13
14
  import { reloadApplication } from "./Application";
14
15
 
15
16
  import { getSetting } from "../../constants";
@@ -33,8 +34,9 @@ export const handleUnauthorized =
33
34
  return;
34
35
  }
35
36
 
36
- // reload application when flag auth is set
37
- if (Cache.getItem("auth")) {
37
+ // reload application when flag auth is set or isLogged
38
+ const application = getApplication(getState());
39
+ if (Cache.getItem("auth") || application?.isLoggedIn) {
38
40
  dispatch(reloadApplication());
39
41
  }
40
42
 
@@ -2,9 +2,9 @@
2
2
  import Authenticate from "../../modularui/Authenticate";
3
3
  import { startProgress, finishProgress } from "./ProgressIndicator";
4
4
  import { resetModularUI } from "../_modularui/actions";
5
+ import { reloadApplication } from "./Application";
5
6
 
6
7
  import type { Dispatch, LogoutSuccessAction, ThunkAction } from "../types";
7
- import { reloadApplication } from "./Application";
8
8
 
9
9
  /**
10
10
  * Send logout success action
@@ -16,6 +16,10 @@ describe("application actions", () => {
16
16
  await store.dispatch(reloadApplication());
17
17
 
18
18
  expect(store.getActions()).toStrictEqual([
19
+ {
20
+ type: "MODULARUI/REMOVE_KEY",
21
+ payload: "application(/)(en)",
22
+ },
19
23
  {
20
24
  type: "MODULARUI/STATUS",
21
25
  payload: { key: "application(/)(en)", status: "LOADING" },
@@ -39,6 +43,10 @@ describe("application actions", () => {
39
43
  store.dispatch(reloadApplication());
40
44
 
41
45
  expect(store.getActions()).toStrictEqual([
46
+ {
47
+ type: "MODULARUI/REMOVE_KEY",
48
+ payload: "/",
49
+ },
42
50
  {
43
51
  type: "MODULARUI/STATUS",
44
52
  payload: { key: "/", status: "LOADING" },
@@ -35,6 +35,10 @@ describe("authorization actions", () => {
35
35
  store.dispatch(handleUnauthorized(errorResponse));
36
36
 
37
37
  expect(store.getActions()).toStrictEqual([
38
+ {
39
+ type: "MODULARUI/REMOVE_KEY",
40
+ payload: "/",
41
+ },
38
42
  {
39
43
  type: "MODULARUI/REMOVE_KEY",
40
44
  payload: "/",