@beinformed/ui 1.18.3 → 1.18.6

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 (236) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/esm/constants/Constants.js +1 -0
  3. package/esm/constants/Constants.js.map +1 -1
  4. package/esm/constants/Settings.js +10 -3
  5. package/esm/constants/Settings.js.map +1 -1
  6. package/esm/hooks/useAuthentication.js +7 -50
  7. package/esm/hooks/useAuthentication.js.map +1 -1
  8. package/esm/i18n/Locales.js.map +1 -1
  9. package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
  10. package/esm/models/form/FormModel.js +3 -1
  11. package/esm/models/form/FormModel.js.map +1 -1
  12. package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
  13. package/esm/models/tab/TabModel.js.map +1 -1
  14. package/esm/modularui/Authenticate.js +100 -21
  15. package/esm/modularui/Authenticate.js.map +1 -1
  16. package/esm/redux/actions/Preferences.js +2 -2
  17. package/esm/redux/actions/Preferences.js.map +1 -1
  18. package/esm/redux/actions/SignOut.js +6 -2
  19. package/esm/redux/actions/SignOut.js.map +1 -1
  20. package/esm/redux/connectors/SignIn.js +3 -2
  21. package/esm/redux/connectors/SignIn.js.map +1 -1
  22. package/esm/redux/connectors/SignOut.js +4 -1
  23. package/esm/redux/connectors/SignOut.js.map +1 -1
  24. package/esm/redux/reducers/AuthReducer.js +0 -10
  25. package/esm/redux/reducers/AuthReducer.js.map +1 -1
  26. package/esm/redux/types.js.map +1 -1
  27. package/esm/utils/helpers/checkResource.js +2 -0
  28. package/esm/utils/helpers/checkResource.js.map +1 -1
  29. package/lib/constants/Constants.js +3 -1
  30. package/lib/constants/Constants.js.flow +1 -0
  31. package/lib/constants/Constants.js.map +1 -1
  32. package/lib/constants/LayoutHints.js.map +1 -1
  33. package/lib/constants/Settings.js +13 -3
  34. package/lib/constants/Settings.js.flow +8 -3
  35. package/lib/constants/Settings.js.map +1 -1
  36. package/lib/exceptions/FetchException.js.map +1 -1
  37. package/lib/hooks/__tests__/useAuthentication.spec.js.flow +15 -1
  38. package/lib/hooks/useAllFormsOnModel.js.map +1 -1
  39. package/lib/hooks/useAuthentication.js +7 -55
  40. package/lib/hooks/useAuthentication.js.flow +4 -37
  41. package/lib/hooks/useAuthentication.js.map +1 -1
  42. package/lib/hooks/useContent.js.map +1 -1
  43. package/lib/hooks/useDeepCompareEffect.js.map +1 -1
  44. package/lib/hooks/useForm.js.map +1 -1
  45. package/lib/hooks/useI18n.js.map +1 -1
  46. package/lib/hooks/useModal.js.map +1 -1
  47. package/lib/hooks/useModelCatalog.js.map +1 -1
  48. package/lib/hooks/useModels.js.map +1 -1
  49. package/lib/hooks/useModularUI.js.map +1 -1
  50. package/lib/hooks/useModularUIBasic.js.map +1 -1
  51. package/lib/hooks/useModularUIModel.js.map +1 -1
  52. package/lib/hooks/useModularUIRequest.js.map +1 -1
  53. package/lib/hooks/useNotification.js.map +1 -1
  54. package/lib/hooks/usePreference.js.map +1 -1
  55. package/lib/hooks/useProgressIndicator.js.map +1 -1
  56. package/lib/hooks/useRouter.js.map +1 -1
  57. package/lib/i18n/Locale.js.map +1 -1
  58. package/lib/i18n/Locales.js.map +1 -1
  59. package/lib/i18n/Message.js.map +1 -1
  60. package/lib/i18n/withMessage.js.map +1 -1
  61. package/lib/models/actions/ActionModel.js.map +1 -1
  62. package/lib/models/application/ApplicationModel.js.map +1 -1
  63. package/lib/models/attributes/AttributeCollection.js.map +1 -1
  64. package/lib/models/attributes/AttributeContent.js.map +1 -1
  65. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  66. package/lib/models/attributes/AttributeModel.js.map +1 -1
  67. package/lib/models/attributes/AttributeSetModel.js.map +1 -1
  68. package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
  69. package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
  70. package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
  71. package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
  72. package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
  73. package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
  74. package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
  75. package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
  76. package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
  77. package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
  78. package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
  79. package/lib/models/attributes/StringAttributeModel.js.map +1 -1
  80. package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
  81. package/lib/models/attributes/_createAttribute.js.map +1 -1
  82. package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
  83. package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
  84. package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
  85. package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
  86. package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
  87. package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
  88. package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
  89. package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
  90. package/lib/models/base/BaseCollection.js.map +1 -1
  91. package/lib/models/base/BaseModel.js.map +1 -1
  92. package/lib/models/caseview/CaseViewModel.js.map +1 -1
  93. package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
  94. package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
  95. package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
  96. package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
  97. package/lib/models/content/ContentLinkModel.js.map +1 -1
  98. package/lib/models/content/ContentTOCModel.js.map +1 -1
  99. package/lib/models/content/SectionModel.js.map +1 -1
  100. package/lib/models/content/SubSectionModel.js.map +1 -1
  101. package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
  102. package/lib/models/detail/DetailModel.js.map +1 -1
  103. package/lib/models/filters/BaseFilterModel.js.map +1 -1
  104. package/lib/models/form/FormModel.js +3 -1
  105. package/lib/models/form/FormModel.js.flow +1 -1
  106. package/lib/models/form/FormModel.js.map +1 -1
  107. package/lib/models/form/FormObjectModel.js.map +1 -1
  108. package/lib/models/href/Href.js.map +1 -1
  109. package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
  110. package/lib/models/links/LinkCollection.js.map +1 -1
  111. package/lib/models/links/LinkModel.js.map +1 -1
  112. package/lib/models/list/ListDetailModel.js.map +1 -1
  113. package/lib/models/list/ListHeaderModel.js.map +1 -1
  114. package/lib/models/list/ListItemCollection.js.map +1 -1
  115. package/lib/models/list/ListModel.js.map +1 -1
  116. package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
  117. package/lib/models/paging/PagingModel.js.map +1 -1
  118. package/lib/models/panels/GroupingPanelModel.js.map +1 -1
  119. package/lib/models/parameter/Parameter.js.map +1 -1
  120. package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
  121. package/lib/models/resolveModel.js.map +1 -1
  122. package/lib/models/sorting/SortingModel.js.map +1 -1
  123. package/lib/models/tab/TabModel.js.map +1 -1
  124. package/lib/models/user/UserProfileModel.js.map +1 -1
  125. package/lib/models/user/UserServicesModel.js.map +1 -1
  126. package/lib/modularui/Authenticate.js +102 -21
  127. package/lib/modularui/Authenticate.js.flow +75 -20
  128. package/lib/modularui/Authenticate.js.map +1 -1
  129. package/lib/modularui/ModularUIRequest.js.map +1 -1
  130. package/lib/modularui/ModularUIResponse.js.map +1 -1
  131. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  132. package/lib/react-client/client.js.map +1 -1
  133. package/lib/react-client/rehydrate.js.map +1 -1
  134. package/lib/react-server/__tests__/serverUtil.spec.js.flow +6 -4
  135. package/lib/react-server/createSSRComplete.js.map +1 -1
  136. package/lib/react-server/renderSSRComplete.js.map +1 -1
  137. package/lib/react-server/renderSSRMinimal.js.map +1 -1
  138. package/lib/react-server/serverNoSSR.js.map +1 -1
  139. package/lib/react-server/serverSSR.js.map +1 -1
  140. package/lib/react-server/serverUtil.js.map +1 -1
  141. package/lib/react-theme/ThemeProvider.js.map +1 -1
  142. package/lib/react-theme/createTheme.js.map +1 -1
  143. package/lib/react-theme/useTheme.js.map +1 -1
  144. package/lib/react-theme/utils/background.js.map +1 -1
  145. package/lib/react-theme/utils/colors.js.map +1 -1
  146. package/lib/react-theme/utils/contrast.js.map +1 -1
  147. package/lib/react-theme/utils/corners.js.map +1 -1
  148. package/lib/react-theme/utils/spacers.js.map +1 -1
  149. package/lib/react-theme/utils/themeProps.js.map +1 -1
  150. package/lib/redux/_i18n/actions.js.map +1 -1
  151. package/lib/redux/_i18n/reducer.js.map +1 -1
  152. package/lib/redux/_modularui/actions.js.map +1 -1
  153. package/lib/redux/_modularui/connector.js.map +1 -1
  154. package/lib/redux/_modularui/middleware.js.map +1 -1
  155. package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
  156. package/lib/redux/_modularui/reducer.js.map +1 -1
  157. package/lib/redux/_modularui/selectors.js.map +1 -1
  158. package/lib/redux/_modularui/withModularUI.js.map +1 -1
  159. package/lib/redux/_router/connectors.js.map +1 -1
  160. package/lib/redux/actions/Application.js.map +1 -1
  161. package/lib/redux/actions/Authorization.js.map +1 -1
  162. package/lib/redux/actions/Error.js.map +1 -1
  163. package/lib/redux/actions/Form.js.map +1 -1
  164. package/lib/redux/actions/FormAttributeSet.js.map +1 -1
  165. package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
  166. package/lib/redux/actions/FormAutosave.js.map +1 -1
  167. package/lib/redux/actions/FormAutosubmit.js.map +1 -1
  168. package/lib/redux/actions/FormValidations.js.map +1 -1
  169. package/lib/redux/actions/Notification.js.map +1 -1
  170. package/lib/redux/actions/Preferences.js +1 -1
  171. package/lib/redux/actions/Preferences.js.flow +7 -3
  172. package/lib/redux/actions/Preferences.js.map +1 -1
  173. package/lib/redux/actions/SignIn.js.map +1 -1
  174. package/lib/redux/actions/SignOut.js +6 -1
  175. package/lib/redux/actions/SignOut.js.flow +9 -5
  176. package/lib/redux/actions/SignOut.js.map +1 -1
  177. package/lib/redux/connectors/Application.js.map +1 -1
  178. package/lib/redux/connectors/Breadcrumb.js.map +1 -1
  179. package/lib/redux/connectors/CaseView.js.map +1 -1
  180. package/lib/redux/connectors/ConceptDetail.js.map +1 -1
  181. package/lib/redux/connectors/ContentBrowser.js.map +1 -1
  182. package/lib/redux/connectors/ContentDetail.js.map +1 -1
  183. package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
  184. package/lib/redux/connectors/Form.js.map +1 -1
  185. package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
  186. package/lib/redux/connectors/ListDetail.js.map +1 -1
  187. package/lib/redux/connectors/Modal.js.map +1 -1
  188. package/lib/redux/connectors/ModelCatalog.js.map +1 -1
  189. package/lib/redux/connectors/Notification.js.map +1 -1
  190. package/lib/redux/connectors/PanelRenderer.js.map +1 -1
  191. package/lib/redux/connectors/Preferences.js.map +1 -1
  192. package/lib/redux/connectors/Progress.js.map +1 -1
  193. package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
  194. package/lib/redux/connectors/QuickSearch.js.map +1 -1
  195. package/lib/redux/connectors/SignIn.js +3 -5
  196. package/lib/redux/connectors/SignIn.js.flow +1 -6
  197. package/lib/redux/connectors/SignIn.js.map +1 -1
  198. package/lib/redux/connectors/SignOut.js +5 -1
  199. package/lib/redux/connectors/SignOut.js.flow +2 -1
  200. package/lib/redux/connectors/SignOut.js.map +1 -1
  201. package/lib/redux/connectors/Tab.js.map +1 -1
  202. package/lib/redux/reducers/AuthReducer.js +0 -11
  203. package/lib/redux/reducers/AuthReducer.js.flow +0 -11
  204. package/lib/redux/reducers/AuthReducer.js.map +1 -1
  205. package/lib/redux/reducers/__tests__/AuthReducer.spec.js.flow +0 -9
  206. package/lib/redux/store/configureStore.js.map +1 -1
  207. package/lib/redux/types.js.flow +0 -1
  208. package/lib/redux/types.js.map +1 -1
  209. package/lib/utils/browser/Cookies.js.map +1 -1
  210. package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
  211. package/lib/utils/fetch/universalFetch.js.map +1 -1
  212. package/lib/utils/fetch/xhr.js.map +1 -1
  213. package/lib/utils/helpers/checkResource.js +2 -0
  214. package/lib/utils/helpers/checkResource.js.flow +3 -0
  215. package/lib/utils/helpers/checkResource.js.map +1 -1
  216. package/lib/utils/helpers/objects.js.map +1 -1
  217. package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
  218. package/lib/utils/helpers/text.js.map +1 -1
  219. package/lib/utils/number/formatValue.js.map +1 -1
  220. package/lib/utils/number/parseNumbers.js.map +1 -1
  221. package/package.json +22 -22
  222. package/src/constants/Constants.js +1 -0
  223. package/src/constants/Settings.js +8 -3
  224. package/src/hooks/__tests__/useAuthentication.spec.js +15 -1
  225. package/src/hooks/useAuthentication.js +4 -37
  226. package/src/models/form/FormModel.js +1 -1
  227. package/src/modularui/Authenticate.js +75 -20
  228. package/src/react-server/__tests__/serverUtil.spec.js +6 -4
  229. package/src/redux/actions/Preferences.js +7 -3
  230. package/src/redux/actions/SignOut.js +9 -5
  231. package/src/redux/connectors/SignIn.js +1 -6
  232. package/src/redux/connectors/SignOut.js +2 -1
  233. package/src/redux/reducers/AuthReducer.js +0 -11
  234. package/src/redux/reducers/__tests__/AuthReducer.spec.js +0 -9
  235. package/src/redux/types.js +0 -1
  236. package/src/utils/helpers/checkResource.js +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"Preferences.js","names":["isPlainObject","JsonParseException","setSetting","setSettings","BASE","ALL_CONTENT_IN_DATA_SETTING","LOGIN_PASSWORD_SETTING","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGOUT_PATH_SETTING","getServerPreferenceValue","preferenceName","defaultValue","type","value","preferencesProvider","getPreferenceByName","split","val","setServerPreference","propertyName","setPreference","propertyValue","payload","setPreferences","preferences","setThemePreference","configTheme","themeData","JSON","parse","error","settings","setAllContentInDataSetting","state","allContentInDataSetting","getModularUIContentInData","setLoginPreferences","loginSettings"],"sources":["../../../src/redux/actions/Preferences.js"],"sourcesContent":["// @flow\nimport { isPlainObject } from \"../../utils/helpers/objects\";\n\nimport { JsonParseException } from \"../../exceptions\";\nimport { setSetting, setSettings } from \"../../constants/Settings\";\n\nimport type {\n PreferenceValue,\n ReduxState,\n SetPreferenceAction,\n SetPreferencesAction,\n} from \"../types\";\n\nimport {\n BASE,\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"../../constants\";\n\n/**\n */\nconst getServerPreferenceValue = (\n preferenceName: string,\n defaultValue: PreferenceValue = null,\n type?: string\n) => {\n let value = null;\n if (typeof preferencesProvider !== \"undefined\") {\n value = preferencesProvider.getPreferenceByName(preferenceName);\n }\n\n if (value == null) {\n value = defaultValue;\n }\n\n if (typeof value === \"string\" && type !== \"string\" && value.includes(\",\")) {\n value = value.split(\",\").map((val) => val.trim());\n }\n\n return value;\n};\n\n/**\n */\nexport const setServerPreference = (\n propertyName: string,\n defaultValue: PreferenceValue = null,\n type?: string\n): SetPreferenceAction => {\n const value = getServerPreferenceValue(propertyName, defaultValue, type);\n return setPreference(propertyName, value);\n};\n\n/**\n */\nexport const setPreference = (\n propertyName: string,\n propertyValue: PreferenceValue = null\n): SetPreferenceAction => ({\n type: \"SET_PREFERENCE\",\n payload: {\n [propertyName]: propertyValue,\n },\n});\n\n/**\n */\nexport const setPreferences = (preferences: Object): SetPreferencesAction => ({\n type: \"SET_PREFERENCES\",\n payload: {\n ...preferences,\n },\n});\n\n/**\n */\nexport const setThemePreference = (\n configTheme: string\n): SetPreferenceAction => {\n let themeData = {};\n\n try {\n themeData = configTheme ? JSON.parse(configTheme) : null;\n } catch (error) {\n throw new JsonParseException(`Theme file contains invalid JSON: ${error}`);\n }\n\n if (themeData && isPlainObject(themeData)) {\n setSettings(themeData.settings);\n }\n\n return setPreference(\"theme\", themeData);\n};\n\n/**\n * Make modular-ui-content-in-data preference available client side\n */\nexport const setAllContentInDataSetting = (\n state?: ReduxState\n): SetPreferenceAction => {\n let allContentInDataSetting = false;\n\n if (\n typeof preferencesProvider !== \"undefined\" &&\n typeof preferencesProvider.getModularUIContentInData !== \"undefined\"\n ) {\n allContentInDataSetting = preferencesProvider.getModularUIContentInData();\n } else if (typeof state !== \"undefined\") {\n allContentInDataSetting = state.preferences[ALL_CONTENT_IN_DATA_SETTING];\n }\n\n setSetting(ALL_CONTENT_IN_DATA_SETTING, !!allContentInDataSetting);\n return setPreference(ALL_CONTENT_IN_DATA_SETTING, allContentInDataSetting);\n};\n\n/**\n * Retrieves login settings from runtime preferences and sets them as setting in the preference reducer\n */\nexport const setLoginPreferences = (\n state?: ReduxState\n): SetPreferencesAction => {\n const loginSettings = {\n [LOGIN_PATH_SETTING]: getServerPreferenceValue(\n LOGIN_PATH_SETTING,\n state?.preferences[LOGIN_PATH_SETTING] ?? `${BASE}/j_security_check`\n ),\n [LOGIN_USERNAME_SETTING]: getServerPreferenceValue(\n LOGIN_USERNAME_SETTING,\n state?.preferences[LOGIN_USERNAME_SETTING] ?? \"j_username\"\n ),\n [LOGIN_PASSWORD_SETTING]: getServerPreferenceValue(\n LOGIN_PASSWORD_SETTING,\n state?.preferences[LOGIN_PASSWORD_SETTING] ?? \"j_password\"\n ),\n [LOGOUT_PATH_SETTING]: getServerPreferenceValue(\n LOGOUT_PATH_SETTING,\n state?.preferences[LOGOUT_PATH_SETTING] ?? `${BASE}/Logoff`\n ),\n };\n\n setSettings(loginSettings);\n return setPreferences(loginSettings);\n};\n"],"mappings":";;;;;;;;;;;;;;AACA,SAASA,aAAT,QAA8B,6BAA9B;AAEA,SAASC,kBAAT,QAAmC,kBAAnC;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,0B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;AACA,OAAO,IAAME,mBAAmB,GAAG,SAAtBA,mBAAsB,CACjCH,KADiC,EAER;EAAA;;EACzB,IAAMI,aAAa,yDAChB/B,kBADgB,EACKG,wBAAwB,CAC5CH,kBAD4C,2BAE5C2B,KAF4C,aAE5CA,KAF4C,uBAE5CA,KAAK,CAAET,WAAP,CAAmBlB,kBAAnB,CAF4C,mFAECH,IAFD,uBAD7B,mCAKhBI,sBALgB,EAKSE,wBAAwB,CAChDF,sBADgD,4BAEhD0B,KAFgD,aAEhDA,KAFgD,uBAEhDA,KAAK,CAAET,WAAP,CAAmBjB,sBAAnB,CAFgD,2EAEF,YAFE,CALjC,mCAShBF,sBATgB,EASSI,wBAAwB,CAChDJ,sBADgD,4BAEhD4B,KAFgD,aAEhDA,KAFgD,uBAEhDA,KAAK,CAAET,WAAP,CAAmBnB,sBAAnB,CAFgD,2EAEF,YAFE,CATjC,mCAahBG,mBAbgB,EAaMC,wBAAwB,CAC7CD,mBAD6C,4BAE7CyB,KAF6C,aAE7CA,KAF6C,uBAE7CA,KAAK,CAAET,WAAP,CAAmBhB,mBAAnB,CAF6C,qFAECL,IAFD,aAb9B,kBAAnB;EAmBAD,WAAW,CAACmC,aAAD,CAAX;EACA,OAAOd,cAAc,CAACc,aAAD,CAArB;AACD,CAxBM"}
1
+ {"version":3,"file":"Preferences.js","names":["isPlainObject","JsonParseException","setSetting","setSettings","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PASSWORD_SETTING","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGOUT_PATH_SETTING","getServerPreferenceValue","preferenceName","defaultValue","type","value","preferencesProvider","getPreferenceByName","split","val","setServerPreference","propertyName","setPreference","propertyValue","payload","setPreferences","preferences","setThemePreference","configTheme","themeData","JSON","parse","error","settings","setAllContentInDataSetting","state","allContentInDataSetting","getModularUIContentInData","setLoginPreferences","loginSettings"],"sources":["../../../src/redux/actions/Preferences.js"],"sourcesContent":["// @flow\nimport { isPlainObject } from \"../../utils/helpers/objects\";\n\nimport { JsonParseException } from \"../../exceptions\";\nimport { setSetting, setSettings } from \"../../constants/Settings\";\n\nimport type {\n PreferenceValue,\n ReduxState,\n SetPreferenceAction,\n SetPreferencesAction,\n} from \"../types\";\n\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PASSWORD_SETTING,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"../../constants\";\n\n/**\n */\nconst getServerPreferenceValue = (\n preferenceName: string,\n defaultValue: PreferenceValue = null,\n type?: string\n) => {\n let value = null;\n if (typeof preferencesProvider !== \"undefined\") {\n value = preferencesProvider.getPreferenceByName(preferenceName);\n }\n\n if (value == null) {\n value = defaultValue;\n }\n\n if (typeof value === \"string\" && type !== \"string\" && value.includes(\",\")) {\n value = value.split(\",\").map((val) => val.trim());\n }\n\n return value;\n};\n\n/**\n */\nexport const setServerPreference = (\n propertyName: string,\n defaultValue: PreferenceValue = null,\n type?: string\n): SetPreferenceAction => {\n const value = getServerPreferenceValue(propertyName, defaultValue, type);\n return setPreference(propertyName, value);\n};\n\n/**\n */\nexport const setPreference = (\n propertyName: string,\n propertyValue: PreferenceValue = null\n): SetPreferenceAction => ({\n type: \"SET_PREFERENCE\",\n payload: {\n [propertyName]: propertyValue,\n },\n});\n\n/**\n */\nexport const setPreferences = (preferences: Object): SetPreferencesAction => ({\n type: \"SET_PREFERENCES\",\n payload: {\n ...preferences,\n },\n});\n\n/**\n */\nexport const setThemePreference = (\n configTheme: string\n): SetPreferenceAction => {\n let themeData = {};\n\n try {\n themeData = configTheme ? JSON.parse(configTheme) : null;\n } catch (error) {\n throw new JsonParseException(`Theme file contains invalid JSON: ${error}`);\n }\n\n if (themeData && isPlainObject(themeData)) {\n setSettings(themeData.settings);\n }\n\n return setPreference(\"theme\", themeData);\n};\n\n/**\n * Make modular-ui-content-in-data preference available client side\n */\nexport const setAllContentInDataSetting = (\n state?: ReduxState\n): SetPreferenceAction => {\n let allContentInDataSetting = false;\n\n if (\n typeof preferencesProvider !== \"undefined\" &&\n typeof preferencesProvider.getModularUIContentInData !== \"undefined\"\n ) {\n allContentInDataSetting = preferencesProvider.getModularUIContentInData();\n } else if (typeof state !== \"undefined\") {\n allContentInDataSetting = state.preferences[ALL_CONTENT_IN_DATA_SETTING];\n }\n\n setSetting(ALL_CONTENT_IN_DATA_SETTING, !!allContentInDataSetting);\n return setPreference(ALL_CONTENT_IN_DATA_SETTING, allContentInDataSetting);\n};\n\n/**\n * Retrieves login settings from runtime preferences and sets them as setting in the preference reducer\n */\nexport const setLoginPreferences = (\n state?: ReduxState\n): SetPreferencesAction => {\n const loginSettings = {\n [LOGIN_TYPE]: getServerPreferenceValue(\n LOGIN_TYPE,\n state?.preferences[LOGIN_TYPE]\n ),\n [LOGIN_PATH_SETTING]: getServerPreferenceValue(\n LOGIN_PATH_SETTING,\n state?.preferences[LOGIN_PATH_SETTING] ?? `/j_security_check`\n ),\n [LOGIN_USERNAME_SETTING]: getServerPreferenceValue(\n LOGIN_USERNAME_SETTING,\n state?.preferences[LOGIN_USERNAME_SETTING] ?? \"j_username\"\n ),\n [LOGIN_PASSWORD_SETTING]: getServerPreferenceValue(\n LOGIN_PASSWORD_SETTING,\n state?.preferences[LOGIN_PASSWORD_SETTING] ?? \"j_password\"\n ),\n [LOGOUT_PATH_SETTING]: getServerPreferenceValue(\n LOGOUT_PATH_SETTING,\n state?.preferences[LOGOUT_PATH_SETTING] ?? `/Logoff`\n ),\n };\n\n setSettings(loginSettings);\n return setPreferences(loginSettings);\n};\n"],"mappings":";;;;;;;;;;;;;;AACA,SAASA,aAAT,QAA8B,6BAA9B;AAEA,SAASC,kBAAT,QAAmC,kBAAnC;AACA,SAASC,UAAT,EAAqBC,WAArB,QAAwC,0BAAxC;AASA,SACEC,2BADF,EAEEC,UAFF,EAGEC,sBAHF,EAIEC,kBAJF,EAKEC,sBALF,EAMEC,mBANF,QAOO,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ChBjC,UADgB,EACHK,wBAAwB,CACpCL,UADoC,EAEpC6B,KAFoC,aAEpCA,KAFoC,uBAEpCA,KAAK,CAAET,WAAP,CAAmBpB,UAAnB,CAFoC,CADrB,mCAKhBE,kBALgB,EAKKG,wBAAwB,CAC5CH,kBAD4C,2BAE5C2B,KAF4C,aAE5CA,KAF4C,uBAE5CA,KAAK,CAAET,WAAP,CAAmBlB,kBAAnB,CAF4C,6FAL7B,mCAShBC,sBATgB,EASSE,wBAAwB,CAChDF,sBADgD,4BAEhD0B,KAFgD,aAEhDA,KAFgD,uBAEhDA,KAAK,CAAET,WAAP,CAAmBjB,sBAAnB,CAFgD,2EAEF,YAFE,CATjC,mCAahBF,sBAbgB,EAaSI,wBAAwB,CAChDJ,sBADgD,4BAEhD4B,KAFgD,aAEhDA,KAFgD,uBAEhDA,KAAK,CAAET,WAAP,CAAmBnB,sBAAnB,CAFgD,2EAEF,YAFE,CAbjC,mCAiBhBG,mBAjBgB,EAiBMC,wBAAwB,CAC7CD,mBAD6C,4BAE7CyB,KAF6C,aAE7CA,KAF6C,uBAE7CA,KAAK,CAAET,WAAP,CAAmBhB,mBAAnB,CAF6C,qFAjB9B,kBAAnB;EAuBAN,WAAW,CAACmC,aAAD,CAAX;EACA,OAAOd,cAAc,CAACc,aAAD,CAArB;AACD,CA5BM"}
@@ -1,10 +1,11 @@
1
1
  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
  * Send logout success action
7
7
  */
8
+
8
9
  export var logoutSuccess = function logoutSuccess() {
9
10
  return {
10
11
  type: "AUTHENTICATION_LOGOUT"
@@ -17,7 +18,10 @@ export var logout = function logout() {
17
18
  return function (dispatch) {
18
19
  dispatch(startProgress());
19
20
  return new Authenticate().logout().then(function () {
20
- dispatch(resetModularUI());
21
+ return dispatch(resetModularUI());
22
+ }).then(function () {
23
+ return dispatch(reloadApplication());
24
+ }).then(function () {
21
25
  dispatch(logoutSuccess());
22
26
  return dispatch(finishProgress());
23
27
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SignOut.js","names":["Authenticate","startProgress","finishProgress","resetModularUI","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\";\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().logout().then(() => {\n dispatch(resetModularUI());\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;;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,CAACN,aAAa,EAAd,CAAR;IAEA,OAAO,IAAID,YAAJ,GAAmBM,MAAnB,GAA4BE,IAA5B,CAAiC,YAAM;MAC5CD,QAAQ,CAACJ,cAAc,EAAf,CAAR;MACAI,QAAQ,CAACH,aAAa,EAAd,CAAR;MACA,OAAOG,QAAQ,CAACL,cAAc,EAAf,CAAf;IACD,CAJM,CAAP;EAKD,CARqB;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\";\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,12 +1,13 @@
1
1
  import { connect } from "react-redux";
2
2
  import { login } from "../actions/SignIn";
3
3
  import { getApplication } from "../_modularui/selectors";
4
- import UserServicesModel from "../../models/user/UserServicesModel";
5
4
 
6
5
  var mapStateToProps = function mapStateToProps(state) {
6
+ var _application$isLogged;
7
+
7
8
  var application = getApplication(state);
8
9
  return {
9
- isAuthenticated: state.auth.isAuthenticated && (application === null || application === void 0 ? void 0 : application.userServices) instanceof UserServicesModel && application.userServices.isLoggedIn,
10
+ isAuthenticated: (_application$isLogged = application === null || application === void 0 ? void 0 : application.isLoggedIn) !== null && _application$isLogged !== void 0 ? _application$isLogged : false,
10
11
  errorMessage: state.auth.error
11
12
  };
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"SignIn.js","names":["connect","login","getApplication","UserServicesModel","mapStateToProps","state","application","isAuthenticated","auth","userServices","isLoggedIn","errorMessage","error","mapDispatchToProps","onSubmit","connectSignIn"],"sources":["../../../src/redux/connectors/SignIn.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { login } from \"../actions/SignIn\";\n\nimport { getApplication } from \"../_modularui/selectors\";\n\nimport UserServicesModel from \"../../models/user/UserServicesModel\";\n\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n errorMessage: ?string,\n};\n\ntype DispatchProps = {\n onSubmit: (username: string, password: string) => ThunkAction,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state: ReduxState): StateProps => {\n const application = getApplication(state);\n\n return {\n isAuthenticated:\n state.auth.isAuthenticated &&\n application?.userServices instanceof UserServicesModel &&\n application.userServices.isLoggedIn,\n errorMessage: state.auth.error,\n };\n};\n\nconst mapDispatchToProps: DispatchProps = {\n onSubmit: login,\n};\n\n/**\n */\nexport const connectSignIn: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAT,QAAwB,aAAxB;AAEA,SAASC,KAAT,QAAsB,mBAAtB;AAEA,SAASC,cAAT,QAA+B,yBAA/B;AAEA,OAAOC,iBAAP,MAA8B,qCAA9B;;AAmBA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAmC;EACzD,IAAMC,WAAW,GAAGJ,cAAc,CAACG,KAAD,CAAlC;EAEA,OAAO;IACLE,eAAe,EACbF,KAAK,CAACG,IAAN,CAAWD,eAAX,IACA,CAAAD,WAAW,SAAX,IAAAA,WAAW,WAAX,YAAAA,WAAW,CAAEG,YAAb,aAAqCN,iBADrC,IAEAG,WAAW,CAACG,YAAZ,CAAyBC,UAJtB;IAKLC,YAAY,EAAEN,KAAK,CAACG,IAAN,CAAWI;EALpB,CAAP;AAOD,CAVD;;AAYA,IAAMC,kBAAiC,GAAG;EACxCC,QAAQ,EAAEb;AAD8B,CAA1C;AAIA;AACA;;AACA,OAAO,IAAMc,aAAiC,GAAGf,OAAO,CAOtDI,eAPsD,EAOrCS,kBAPqC,CAAjD"}
1
+ {"version":3,"file":"SignIn.js","names":["connect","login","getApplication","mapStateToProps","state","application","isAuthenticated","isLoggedIn","errorMessage","auth","error","mapDispatchToProps","onSubmit","connectSignIn"],"sources":["../../../src/redux/connectors/SignIn.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { login } from \"../actions/SignIn\";\n\nimport { getApplication } from \"../_modularui/selectors\";\n\nimport type { ReduxState, ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n errorMessage: ?string,\n};\n\ntype DispatchProps = {\n onSubmit: (username: string, password: string) => ThunkAction,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state: ReduxState): StateProps => {\n const application = getApplication(state);\n\n return {\n isAuthenticated: application?.isLoggedIn ?? false,\n errorMessage: state.auth.error,\n };\n};\n\nconst mapDispatchToProps: DispatchProps = {\n onSubmit: login,\n};\n\n/**\n */\nexport const connectSignIn: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAT,QAAwB,aAAxB;AAEA,SAASC,KAAT,QAAsB,mBAAtB;AAEA,SAASC,cAAT,QAA+B,yBAA/B;;AAmBA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAmC;EAAA;;EACzD,IAAMC,WAAW,GAAGH,cAAc,CAACE,KAAD,CAAlC;EAEA,OAAO;IACLE,eAAe,2BAAED,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAEE,UAAf,yEAA6B,KADvC;IAELC,YAAY,EAAEJ,KAAK,CAACK,IAAN,CAAWC;EAFpB,CAAP;AAID,CAPD;;AASA,IAAMC,kBAAiC,GAAG;EACxCC,QAAQ,EAAEX;AAD8B,CAA1C;AAIA;AACA;;AACA,OAAO,IAAMY,aAAiC,GAAGb,OAAO,CAOtDG,eAPsD,EAOrCQ,kBAPqC,CAAjD"}
@@ -1,9 +1,12 @@
1
1
  import { connect } from "react-redux";
2
2
  import { logout } from "../actions/SignOut";
3
+ import { getApplication } from "../_modularui";
3
4
 
4
5
  var mapStateToProps = function mapStateToProps(state) {
6
+ var _getApplication$isLog, _getApplication;
7
+
5
8
  return {
6
- isAuthenticated: state.auth.isAuthenticated
9
+ isAuthenticated: (_getApplication$isLog = (_getApplication = getApplication(state)) === null || _getApplication === void 0 ? void 0 : _getApplication.isLoggedIn) !== null && _getApplication$isLog !== void 0 ? _getApplication$isLog : false
7
10
  };
8
11
  };
9
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"SignOut.js","names":["connect","logout","mapStateToProps","state","isAuthenticated","auth","mapDispatchToProps","doLogout","connectSignOut"],"sources":["../../../src/redux/connectors/SignOut.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { logout } from \"../actions/SignOut\";\n\nimport type { ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n};\n\ntype DispatchProps = {\n doLogout: () => ThunkAction,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state): StateProps => ({\n isAuthenticated: state.auth.isAuthenticated,\n});\n\nconst mapDispatchToProps = { doLogout: logout };\n\n/**\n */\nexport const connectSignOut: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAT,QAAwB,aAAxB;AAEA,SAASC,MAAT,QAAuB,oBAAvB;;AAkBA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD;EAAA,OAAwB;IAC9CC,eAAe,EAAED,KAAK,CAACE,IAAN,CAAWD;EADkB,CAAxB;AAAA,CAAxB;;AAIA,IAAME,kBAAkB,GAAG;EAAEC,QAAQ,EAAEN;AAAZ,CAA3B;AAEA;AACA;;AACA,OAAO,IAAMO,cAAkC,GAAGR,OAAO,CAOvDE,eAPuD,EAOtCI,kBAPsC,CAAlD"}
1
+ {"version":3,"file":"SignOut.js","names":["connect","logout","getApplication","mapStateToProps","state","isAuthenticated","isLoggedIn","mapDispatchToProps","doLogout","connectSignOut"],"sources":["../../../src/redux/connectors/SignOut.js"],"sourcesContent":["// @flow\nimport { connect } from \"react-redux\";\n\nimport { logout } from \"../actions/SignOut\";\n\nimport type { ThunkAction } from \"../types\";\nimport type { ComponentType } from \"react\";\nimport { getApplication } from \"../_modularui\";\n\ntype StateProps = {\n isAuthenticated: boolean,\n};\n\ntype DispatchProps = {\n doLogout: () => ThunkAction,\n};\n\ntype Props = {\n ...StateProps,\n ...DispatchProps,\n};\n\nconst mapStateToProps = (state): StateProps => ({\n isAuthenticated: getApplication(state)?.isLoggedIn ?? false,\n});\n\nconst mapDispatchToProps = { doLogout: logout };\n\n/**\n */\nexport const connectSignOut: ComponentType<any> = connect<\n Props,\n {},\n StateProps,\n _,\n _,\n _\n>(mapStateToProps, mapDispatchToProps);\n"],"mappings":"AACA,SAASA,OAAT,QAAwB,aAAxB;AAEA,SAASC,MAAT,QAAuB,oBAAvB;AAIA,SAASC,cAAT,QAA+B,eAA/B;;AAeA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD;EAAA;;EAAA,OAAwB;IAC9CC,eAAe,8CAAEH,cAAc,CAACE,KAAD,CAAhB,oDAAE,gBAAuBE,UAAzB,yEAAuC;EADR,CAAxB;AAAA,CAAxB;;AAIA,IAAMC,kBAAkB,GAAG;EAAEC,QAAQ,EAAEP;AAAZ,CAA3B;AAEA;AACA;;AACA,OAAO,IAAMQ,cAAkC,GAAGT,OAAO,CAOvDG,eAPuD,EAOtCI,kBAPsC,CAAlD"}
@@ -9,10 +9,8 @@ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (
9
9
 
10
10
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? Object.defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
11
11
 
12
- import Cache from "../../utils/browser/Cache";
13
12
  // REDUCER
14
13
  var initialState = {
15
- isAuthenticated: false,
16
14
  mustChangePassword: false,
17
15
  error: null
18
16
  };
@@ -31,7 +29,6 @@ var AuthReducer = function AuthReducer() {
31
29
  switch (action.type) {
32
30
  case "AUTHENTICATION_SUCCESS":
33
31
  return _objectSpread(_objectSpread({}, state), {}, {
34
- isAuthenticated: true,
35
32
  error: null,
36
33
  mustChangePassword: false
37
34
  });
@@ -49,21 +46,14 @@ var AuthReducer = function AuthReducer() {
49
46
 
50
47
  case "AUTHENTICATION_LOGOUT":
51
48
  {
52
- // clear cache because of cached contributions
53
- if (state.isAuthenticated) {
54
- Cache.clear();
55
- }
56
-
57
49
  return _objectSpread(_objectSpread({}, state), {}, {
58
50
  mustChangePassword: false,
59
- isAuthenticated: false,
60
51
  error: null
61
52
  });
62
53
  }
63
54
 
64
55
  case "CHANGE_PASSWORD":
65
56
  return _objectSpread(_objectSpread({}, state), {}, {
66
- isAuthenticated: true,
67
57
  mustChangePassword: true,
68
58
  error: null
69
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AuthReducer.js","names":["Cache","initialState","isAuthenticated","mustChangePassword","error","AuthReducer","state","action","type","payload","clear"],"sources":["../../../src/redux/reducers/AuthReducer.js"],"sourcesContent":["// @flow\nimport Cache from \"../../utils/browser/Cache\";\n\nimport type { Reducer } from \"redux\";\nimport type { AuthState, ReduxAction } from \"../types\";\n\n// REDUCER\nconst initialState: AuthState = {\n isAuthenticated: false,\n mustChangePassword: false,\n error: null,\n};\n\n/**\n * Auth reducer\n */\nconst AuthReducer: Reducer<AuthState, ReduxAction> = (\n state = initialState,\n action\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"AUTHENTICATION_SUCCESS\":\n return {\n ...state,\n isAuthenticated: true,\n error: null,\n mustChangePassword: false,\n };\n\n case \"AUTHENTICATION_ERROR\":\n return { ...state, mustChangePassword: false, error: action.payload };\n\n case \"AUTHENTICATION_RESET_ERRORS\":\n return { ...state, error: null };\n\n case \"AUTHENTICATION_LOGOUT\": {\n // clear cache because of cached contributions\n if (state.isAuthenticated) {\n Cache.clear();\n }\n\n return {\n ...state,\n mustChangePassword: false,\n isAuthenticated: false,\n error: null,\n };\n }\n\n case \"CHANGE_PASSWORD\":\n return {\n ...state,\n isAuthenticated: true,\n mustChangePassword: true,\n error: null,\n };\n\n default:\n return state;\n }\n};\n\nexport default AuthReducer;\n"],"mappings":";;;;;;;;;;;AACA,OAAOA,KAAP,MAAkB,2BAAlB;AAKA;AACA,IAAMC,YAAuB,GAAG;EAC9BC,eAAe,EAAE,KADa;EAE9BC,kBAAkB,EAAE,KAFU;EAG9BC,KAAK,EAAE;AAHuB,CAAhC;AAMA;AACA;AACA;;AACA,IAAMC,WAA4C,GAAG,SAA/CA,WAA+C,GAGhD;EAAA,IAFHC,KAEG,uEAFKL,YAEL;EAAA,IADHM,MACG;;EACH,IAAI,CAACA,MAAL,EAAa;IACX,OAAOD,KAAP;EACD;;EAED,QAAQC,MAAM,CAACC,IAAf;IACE,KAAK,wBAAL;MACE,uCACKF,KADL;QAEEJ,eAAe,EAAE,IAFnB;QAGEE,KAAK,EAAE,IAHT;QAIED,kBAAkB,EAAE;MAJtB;;IAOF,KAAK,sBAAL;MACE,uCAAYG,KAAZ;QAAmBH,kBAAkB,EAAE,KAAvC;QAA8CC,KAAK,EAAEG,MAAM,CAACE;MAA5D;;IAEF,KAAK,6BAAL;MACE,uCAAYH,KAAZ;QAAmBF,KAAK,EAAE;MAA1B;;IAEF,KAAK,uBAAL;MAA8B;QAC5B;QACA,IAAIE,KAAK,CAACJ,eAAV,EAA2B;UACzBF,KAAK,CAACU,KAAN;QACD;;QAED,uCACKJ,KADL;UAEEH,kBAAkB,EAAE,KAFtB;UAGED,eAAe,EAAE,KAHnB;UAIEE,KAAK,EAAE;QAJT;MAMD;;IAED,KAAK,iBAAL;MACE,uCACKE,KADL;QAEEJ,eAAe,EAAE,IAFnB;QAGEC,kBAAkB,EAAE,IAHtB;QAIEC,KAAK,EAAE;MAJT;;IAOF;MACE,OAAOE,KAAP;EAtCJ;AAwCD,CAhDD;;AAkDA,eAAeD,WAAf"}
1
+ {"version":3,"file":"AuthReducer.js","names":["initialState","mustChangePassword","error","AuthReducer","state","action","type","payload"],"sources":["../../../src/redux/reducers/AuthReducer.js"],"sourcesContent":["// @flow\nimport type { Reducer } from \"redux\";\nimport type { AuthState, ReduxAction } from \"../types\";\n\n// REDUCER\nconst initialState: AuthState = {\n mustChangePassword: false,\n error: null,\n};\n\n/**\n * Auth reducer\n */\nconst AuthReducer: Reducer<AuthState, ReduxAction> = (\n state = initialState,\n action\n) => {\n if (!action) {\n return state;\n }\n\n switch (action.type) {\n case \"AUTHENTICATION_SUCCESS\":\n return {\n ...state,\n error: null,\n mustChangePassword: false,\n };\n\n case \"AUTHENTICATION_ERROR\":\n return { ...state, mustChangePassword: false, error: action.payload };\n\n case \"AUTHENTICATION_RESET_ERRORS\":\n return { ...state, error: null };\n\n case \"AUTHENTICATION_LOGOUT\": {\n return {\n ...state,\n mustChangePassword: false,\n error: null,\n };\n }\n\n case \"CHANGE_PASSWORD\":\n return {\n ...state,\n mustChangePassword: true,\n error: null,\n };\n\n default:\n return state;\n }\n};\n\nexport default AuthReducer;\n"],"mappings":";;;;;;;;;;;AAIA;AACA,IAAMA,YAAuB,GAAG;EAC9BC,kBAAkB,EAAE,KADU;EAE9BC,KAAK,EAAE;AAFuB,CAAhC;AAKA;AACA;AACA;;AACA,IAAMC,WAA4C,GAAG,SAA/CA,WAA+C,GAGhD;EAAA,IAFHC,KAEG,uEAFKJ,YAEL;EAAA,IADHK,MACG;;EACH,IAAI,CAACA,MAAL,EAAa;IACX,OAAOD,KAAP;EACD;;EAED,QAAQC,MAAM,CAACC,IAAf;IACE,KAAK,wBAAL;MACE,uCACKF,KADL;QAEEF,KAAK,EAAE,IAFT;QAGED,kBAAkB,EAAE;MAHtB;;IAMF,KAAK,sBAAL;MACE,uCAAYG,KAAZ;QAAmBH,kBAAkB,EAAE,KAAvC;QAA8CC,KAAK,EAAEG,MAAM,CAACE;MAA5D;;IAEF,KAAK,6BAAL;MACE,uCAAYH,KAAZ;QAAmBF,KAAK,EAAE;MAA1B;;IAEF,KAAK,uBAAL;MAA8B;QAC5B,uCACKE,KADL;UAEEH,kBAAkB,EAAE,KAFtB;UAGEC,KAAK,EAAE;QAHT;MAKD;;IAED,KAAK,iBAAL;MACE,uCACKE,KADL;QAEEH,kBAAkB,EAAE,IAFtB;QAGEC,KAAK,EAAE;MAHT;;IAMF;MACE,OAAOE,KAAP;EA9BJ;AAgCD,CAxCD;;AA0CA,eAAeD,WAAf"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type LoginFailedAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | UpdateModelAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | LoginFailedAction\n | ResetAuthErrorsAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +isAuthenticated: boolean,\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":""}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/redux/types.js"],"sourcesContent":["// @flow\nimport type { Store, DispatchAPI } from \"redux\";\n\nimport type ErrorResponse from \"../models/error/ErrorResponse\";\n\nimport type FormModel from \"../models/form/FormModel\";\nimport typeof {\n NOTIFICATION_TYPES,\n AUTOSAVE_STATUS,\n} from \"../constants/Constants\";\n\nimport type { MessageObject } from \"../i18n/types\";\nimport type {\n I18nState,\n UpdateLocaleAction,\n SetLocalesAction,\n} from \"./_i18n/types\";\nimport type {\n ModularUIState,\n ModularUIAction,\n UpdateStatusAction,\n SetModelAction,\n UpdateModelAction,\n RemoveModelByKeyAction,\n ResetModularUIAction,\n} from \"./_modularui/types\";\nimport type {\n RouterState,\n LocationChangeAction,\n PushAction,\n ReplaceAction,\n GoAction,\n GoBackAction,\n GoForwardAction,\n} from \"./_router/types\";\n\nexport type PreferenceValue =\n | null\n | string\n | boolean\n | { [key: string]: any }\n | Array<PreferenceValue>;\n\nexport type UpdateFormOptions = {\n autosubmit: boolean,\n autosave: boolean,\n forceUpdate?: boolean,\n /** Default true: Activate/deactivate the form object validate by an update */\n validate?: boolean,\n};\n\nexport type NoAction = {\n type: \"NO_ACTION\",\n};\n\nexport type SaveErrorAction = {\n type: \"SAVE_ERROR\",\n payload: ErrorResponse,\n};\n\nexport type ShowModalAction = {\n type: \"SHOW_MODAL\",\n payload: string,\n};\n\nexport type CloseModalAction = {\n type: \"CLOSE_MODAL\",\n payload: string,\n};\n\nexport type DismissNotificationAction = {\n type: \"DISMISS_NOTIFICATION\",\n};\nexport type ShowNotificationAction = {\n type: \"SHOW_NOTIFICATION\",\n payload: {\n type: $Keys<NOTIFICATION_TYPES>,\n message: MessageObject,\n error: ?ErrorResponse,\n },\n};\n\nexport type SetPreferenceAction = {\n type: \"SET_PREFERENCE\",\n payload: { [name: string]: PreferenceValue },\n};\nexport type SetPreferencesAction = {\n type: \"SET_PREFERENCES\",\n payload: { [name: string]: PreferenceValue },\n};\n\nexport type StartProgressAction = {\n type: \"START_PROGRESS\",\n};\nexport type FinishProgressAction = {\n type: \"FINISH_PROGRESS\",\n};\nexport type ResetProgressAction = {\n type: \"RESET_PROGRESS\",\n};\nexport type UpdateProgressAction = {\n type: \"UPDATE_PROGRESS\",\n payload: { percentComplete: number },\n};\n\nexport type LoginFailedAction = {\n type: \"AUTHENTICATION_ERROR\",\n payload: string,\n};\n\nexport type ResetAuthErrorsAction = {\n type: \"AUTHENTICATION_RESET_ERRORS\",\n};\n\nexport type LoginSuccessAction = {\n type: \"AUTHENTICATION_SUCCESS\",\n};\n\nexport type ChangePasswordAction = {\n type: \"CHANGE_PASSWORD\",\n};\n\nexport type LogoutSuccessAction = {\n type: \"AUTHENTICATION_LOGOUT\",\n};\n\nexport type UpdateAutosaveAction = {\n type: \"UPDATE_AUTOSAVE_STATUS\",\n payload: {\n status: $Keys<AUTOSAVE_STATUS>,\n model: FormModel,\n },\n};\n\nexport type ReduxAction =\n | UpdateStatusAction\n | SetModelAction\n | UpdateModelAction\n | RemoveModelByKeyAction\n | ResetModularUIAction\n | SaveErrorAction\n | UpdateLocaleAction\n | SetLocalesAction\n | ShowModalAction\n | CloseModalAction\n | DismissNotificationAction\n | ShowNotificationAction\n | SetPreferenceAction\n | SetPreferencesAction\n | StartProgressAction\n | FinishProgressAction\n | ResetProgressAction\n | UpdateProgressAction\n | LoginFailedAction\n | ResetAuthErrorsAction\n | LoginSuccessAction\n | ChangePasswordAction\n | LogoutSuccessAction\n | UpdateAutosaveAction\n | LocationChangeAction\n | PushAction\n | ReplaceAction\n | GoAction\n | GoBackAction\n | GoForwardAction\n | ModularUIAction\n | NoAction;\n\n// Redux state\nexport type AuthState = {\n +mustChangePassword: boolean,\n +error: ?string,\n};\n\nexport type ErrorState = null | ErrorResponse;\n\nexport type ModalState = {\n +key: string,\n +visible: boolean,\n +size?: string,\n};\n\nexport type ModalsState = {\n +modals: Array<ModalState>,\n};\n\nexport type NotificationState = {\n +render: boolean,\n +messageType: string | null,\n +message: MessageObject | null,\n +error: ?ErrorResponse | null,\n};\n\nexport type PreferencesState = {\n +[name: string]: PreferenceValue,\n};\n\nexport type ProgressIndicatorState = {\n +count: number,\n +timestamp: number,\n +percentComplete: number,\n};\n\nexport type ReduxState = {\n +router: RouterState,\n +modularui: ModularUIState,\n +i18n: I18nState,\n +auth: AuthState,\n +error: ErrorState,\n +modals: ModalsState,\n +notification: NotificationState,\n +progressindicator: ProgressIndicatorState,\n +preferences: PreferencesState,\n ...\n};\n\nexport type GetState = () => ReduxState;\nexport type ThunkAction = (dispatch: Dispatch, getState: GetState) => any;\nexport type PromiseAction = Promise<PossibleAction>;\nexport type Dispatch = DispatchAPI<PossibleAction>;\nexport type ReduxStore = Store<ReduxState, ReduxAction, Dispatch>;\n\nexport type PossibleAction = ReduxAction | ThunkAction | PromiseAction;\n\nexport type CustomReducers = { [reducerKey: string]: any };\n"],"mappings":""}
@@ -15,6 +15,7 @@ export var resourceExists = function resourceExists(url) {
15
15
  xhr.open("HEAD", fullUrl, false);
16
16
  xhr.setRequestHeader("Accept", "application/json");
17
17
  xhr.setRequestHeader("Content-Type", "application/json");
18
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
18
19
  xhr.send();
19
20
  return xhr.status !== 404;
20
21
  };
@@ -32,6 +33,7 @@ export var resourceRedirectsToSecureLogin = function resourceRedirectsToSecureLo
32
33
  xhr.open("HEAD", fullUrl, false);
33
34
  xhr.setRequestHeader("Accept", "application/json");
34
35
  xhr.setRequestHeader("Content-Type", "application/json");
36
+ xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
35
37
  xhr.send();
36
38
  var responseURL = (_xhr$responseURL = xhr.responseURL) !== null && _xhr$responseURL !== void 0 ? _xhr$responseURL : "";
37
39
  return xhr.status === 400 && _endsWithInstanceProperty(responseURL).call(responseURL, "/secureLogin");
@@ -1 +1 @@
1
- {"version":3,"file":"checkResource.js","names":["Href","resourceExists","url","fullUrl","absolutehref","xhr","XMLHttpRequest","open","setRequestHeader","send","status","resourceRedirectsToSecureLogin","responseURL"],"sources":["../../../src/utils/helpers/checkResource.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n *\n * @param url\n * @returns {boolean}\n */\nexport const resourceExists = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n // const fullUrl = `${BASE}/${url}`.replace(/\\/\\//g, \"/\");\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n\n return xhr.status !== 404;\n};\n\n/**\n * Indicates if a request to the given url resuls in a redirect to /secureRedirect\n * @param url\n * @returns {boolean}\n */\nexport const resourceRedirectsToSecureLogin = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n\n const responseURL = xhr.responseURL ?? \"\";\n\n return xhr.status === 400 && responseURL.endsWith(\"/secureLogin\");\n};\n"],"mappings":";AACA,OAAOA,IAAP,MAAiB,wBAAjB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,cAAc,GAAG,SAAjBA,cAAiB,CAACC,GAAD,EAAiC;EAC7D,IAAMC,OAAO,GAAG,IAAIH,IAAJ,CAASE,GAAT,EAAcE,YAA9B,CAD6D,CAG7D;;EAEA,IAAMC,GAAG,GAAG,IAAIC,cAAJ,EAAZ;EACAD,GAAG,CAACE,IAAJ,CAAS,MAAT,EAAiBJ,OAAjB,EAA0B,KAA1B;EACAE,GAAG,CAACG,gBAAJ,CAAqB,QAArB,EAA+B,kBAA/B;EACAH,GAAG,CAACG,gBAAJ,CAAqB,cAArB,EAAqC,kBAArC;EACAH,GAAG,CAACI,IAAJ;EAEA,OAAOJ,GAAG,CAACK,MAAJ,KAAe,GAAtB;AACD,CAZM;AAcP;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,8BAA8B,GAAG,SAAjCA,8BAAiC,CAACT,GAAD,EAAiC;EAAA;;EAC7E,IAAMC,OAAO,GAAG,IAAIH,IAAJ,CAASE,GAAT,EAAcE,YAA9B;EAEA,IAAMC,GAAG,GAAG,IAAIC,cAAJ,EAAZ;EACAD,GAAG,CAACE,IAAJ,CAAS,MAAT,EAAiBJ,OAAjB,EAA0B,KAA1B;EACAE,GAAG,CAACG,gBAAJ,CAAqB,QAArB,EAA+B,kBAA/B;EACAH,GAAG,CAACG,gBAAJ,CAAqB,cAArB,EAAqC,kBAArC;EACAH,GAAG,CAACI,IAAJ;EAEA,IAAMG,WAAW,uBAAGP,GAAG,CAACO,WAAP,+DAAsB,EAAvC;EAEA,OAAOP,GAAG,CAACK,MAAJ,KAAe,GAAf,IAAsB,0BAAAE,WAAW,MAAX,CAAAA,WAAW,EAAU,cAAV,CAAxC;AACD,CAZM"}
1
+ {"version":3,"file":"checkResource.js","names":["Href","resourceExists","url","fullUrl","absolutehref","xhr","XMLHttpRequest","open","setRequestHeader","send","status","resourceRedirectsToSecureLogin","responseURL"],"sources":["../../../src/utils/helpers/checkResource.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\n/**\n * Checks if a given url to a modular ui resource exists using a HEAD request to the resource (synchronous)\n * When the resource returns a 404, the resource does not exists and the method returns false\n *\n * @param url\n * @returns {boolean}\n */\nexport const resourceExists = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n // const fullUrl = `${BASE}/${url}`.replace(/\\/\\//g, \"/\");\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n\n xhr.send();\n\n return xhr.status !== 404;\n};\n\n/**\n * Indicates if a request to the given url resuls in a redirect to /secureRedirect\n * @param url\n * @returns {boolean}\n */\nexport const resourceRedirectsToSecureLogin = (url: string | Href): boolean => {\n const fullUrl = new Href(url).absolutehref;\n\n const xhr = new XMLHttpRequest();\n xhr.open(\"HEAD\", fullUrl, false);\n xhr.setRequestHeader(\"Accept\", \"application/json\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\n xhr.send();\n\n const responseURL = xhr.responseURL ?? \"\";\n\n return xhr.status === 400 && responseURL.endsWith(\"/secureLogin\");\n};\n"],"mappings":";AAC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bM"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.VALIDATE_DEBOUNCE_TIMEOUT = exports.USE_CACHE = exports.USERPROFILE_PATH = exports.UPLOAD_PATH = exports.TIMEVERSION_FILTER_NAME = exports.PARAMETER_SEPARATOR = exports.NOTIFICATION_TYPES = exports.MODULARUI_STATUS = exports.MODULARUI_CONTRIBUTIONS = exports.LOGOUT_PATH_SETTING = exports.LOGOUT_PATH = exports.LOGIN_USERNAME_SETTING = exports.LOGIN_PATH_SETTING = exports.LOGIN_PATH = exports.LOGIN_PASSWORD_SETTING = exports.KEYCODES = exports.IS_SYNC = exports.IS_SERVER = exports.ISO_TIME_FORMAT = exports.ISO_TIMESTAMP_FORMAT = exports.ISO_DATE_FORMAT = exports.ISO_DATETIME_FORMAT = exports.INPUT_DEBOUNCE_TIMEOUT = exports.HTTP_METHODS = exports.DEFAULT_WEEK_STARTS_ON = exports.DEFAULT_UI_PARAMETERS = exports.DEFAULT_FIRST_WEEK_CONTAINS_DATE = exports.CONTENT_PATH = exports.CHANGEPASSWORD_PATH = exports.CAPTCHA_PATH = exports.BASE = exports.AUTOSAVE_STATUS = exports.ATTRIBUTE_WIDTH = exports.APPLICATION_PATH = exports.ALL_CONTENT_IN_DATA_SETTING = void 0;
6
+ exports.VALIDATE_DEBOUNCE_TIMEOUT = exports.USE_CACHE = exports.USERPROFILE_PATH = exports.UPLOAD_PATH = exports.TIMEVERSION_FILTER_NAME = exports.PARAMETER_SEPARATOR = exports.NOTIFICATION_TYPES = exports.MODULARUI_STATUS = exports.MODULARUI_CONTRIBUTIONS = exports.LOGOUT_PATH_SETTING = exports.LOGOUT_PATH = exports.LOGIN_USERNAME_SETTING = exports.LOGIN_TYPE = exports.LOGIN_PATH_SETTING = exports.LOGIN_PATH = exports.LOGIN_PASSWORD_SETTING = exports.KEYCODES = exports.IS_SYNC = exports.IS_SERVER = exports.ISO_TIME_FORMAT = exports.ISO_TIMESTAMP_FORMAT = exports.ISO_DATE_FORMAT = exports.ISO_DATETIME_FORMAT = exports.INPUT_DEBOUNCE_TIMEOUT = exports.HTTP_METHODS = exports.DEFAULT_WEEK_STARTS_ON = exports.DEFAULT_UI_PARAMETERS = exports.DEFAULT_FIRST_WEEK_CONTAINS_DATE = exports.CONTENT_PATH = exports.CHANGEPASSWORD_PATH = exports.CAPTCHA_PATH = exports.BASE = exports.AUTOSAVE_STATUS = exports.ATTRIBUTE_WIDTH = exports.APPLICATION_PATH = exports.ALL_CONTENT_IN_DATA_SETTING = void 0;
7
7
 
8
8
  /**
9
9
  * Indicates if contributions should be cached
@@ -230,6 +230,8 @@ var ATTRIBUTE_WIDTH = {
230
230
  exports.ATTRIBUTE_WIDTH = ATTRIBUTE_WIDTH;
231
231
  var ALL_CONTENT_IN_DATA_SETTING = "hasAllContentInData";
232
232
  exports.ALL_CONTENT_IN_DATA_SETTING = ALL_CONTENT_IN_DATA_SETTING;
233
+ var LOGIN_TYPE = "security.clients";
234
+ exports.LOGIN_TYPE = LOGIN_TYPE;
233
235
  var LOGIN_PATH_SETTING = "FormClient.login_url";
234
236
  exports.LOGIN_PATH_SETTING = LOGIN_PATH_SETTING;
235
237
  var LOGIN_USERNAME_SETTING = "FormClient.username_field_name";
@@ -198,6 +198,7 @@ export const ATTRIBUTE_WIDTH = {
198
198
 
199
199
  export const ALL_CONTENT_IN_DATA_SETTING = "hasAllContentInData";
200
200
 
201
+ export const LOGIN_TYPE = "security.clients";
201
202
  export const LOGIN_PATH_SETTING = "FormClient.login_url";
202
203
  export const LOGIN_USERNAME_SETTING = "FormClient.username_field_name";
203
204
  export const LOGIN_PASSWORD_SETTING = "FormClient.password_field_name";
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","names":["USE_CACHE","serverBase","__CONTEXT_PATH__","BASE","window","contextPath","MODULARUI_CONTRIBUTIONS","APPLICATION_URI","APPLICATION_PATH","CONTENT_PATH","UPLOAD_PATH","CAPTCHA_PATH","LOGIN_PATH","LOGOUT_PATH","CHANGEPASSWORD_PATH","USERPROFILE_PATH","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","PARAMETER_OVERVIEW_VIEWTYPE","DEFAULT_UI_PARAMETERS","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","KEYCODES","TAB","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","IS_SYNC","dataFetcher","IS_SERVER","NOTIFICATION_TYPES","SUCCESS","INFO","WARNING","ERROR","HTTP_METHODS","GET","POST","MODULARUI_STATUS","LOADING","FINISHED","AUTOSAVE_STATUS","START","INPUT_DEBOUNCE_TIMEOUT","VALIDATE_DEBOUNCE_TIMEOUT","ATTRIBUTE_WIDTH","EXTRA_SMALL","SMALL","MEDIUM","LARGE","EXTRA_LARGE","ALL_CONTENT_IN_DATA_SETTING","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING"],"sources":["../../src/constants/Constants.js"],"sourcesContent":["// @flow\n/**\n * Indicates if contributions should be cached\n */\nexport const USE_CACHE = true;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const BASE: string =\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\");\n\n/**\n * Path to the contributions api end point\n * /contributions uri part is added through the _links in the data service\n */\nexport const MODULARUI_CONTRIBUTIONS = \"/contributions\";\n\n/**\n * Application uri\n * @private\n */\nconst APPLICATION_URI = \"/\";\n\n/**\n * Base Path\n */\nexport const APPLICATION_PATH: string = BASE + APPLICATION_URI;\n\n/**\n * path to content service\n */\nexport const CONTENT_PATH = `${BASE}/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `${BASE}/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `${BASE}/captchaServices`;\n\n/**\n * Path to login page / component\n */\nexport const LOGIN_PATH = \"/signin\";\n\n/**\n * Path to logout page / component\n */\nexport const LOGOUT_PATH = \"/signout\";\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nconst PARAMETER_OVERVIEW_VIEWTYPE = \"viewType\";\n/**\n * Parameter name for the viewtype toggle\n */\nexport const DEFAULT_UI_PARAMETERS: Array<string> = [\n PARAMETER_OVERVIEW_VIEWTYPE,\n];\n\n/**\n */\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\n/**\n */\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n/**\n */\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\n/**\n */\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * Key codes\n * @type {{SPACE: number, PAGE_DOWN: number, TAB: number, ARROW_RIGHT: number, ARROW_DOWN: number, ENTER: number, ARROW_UP: number, ARROW_LEFT: number, PAGE_UP: number, ESCAPE: number}}\n */\nexport const KEYCODES = {\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\n/**\n * @type {boolean}\n */\nexport const IS_SYNC = typeof dataFetcher !== \"undefined\";\n/**\n * @type {boolean}\n */\nexport const IS_SERVER = IS_SYNC;\n\n/**\n * @type {{SUCCESS: string, ERROR: string, INFO: string, WARNING: string}}\n */\nexport const NOTIFICATION_TYPES = {\n SUCCESS: \"SUCCESS\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n ERROR: \"ERROR\",\n};\n\n/**\n * SUPPORTED HTTP METHODS\n * @type {{POST: string, GET: string}}\n */\nexport const HTTP_METHODS = {\n GET: \"GET\",\n POST: \"POST\",\n};\n\n/**\n * POSSIBLE MODULARUI STATUSSES\n * @type {{LOADING: string, ERROR: string, FINISHED: string}}\n */\nexport const MODULARUI_STATUS = {\n LOADING: \"LOADING\",\n FINISHED: \"FINISHED\",\n ERROR: \"ERROR\",\n};\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport const AUTOSAVE_STATUS = {\n START: \"START\",\n FINISHED: \"FINISHED\",\n};\n\n/**\n * DEBOUNCE INPUT TIMEOUT\n */\nexport const INPUT_DEBOUNCE_TIMEOUT = 100;\n\n/**\n * DEBOUNCE VALIDATION TIMEOUT\n */\nexport const VALIDATE_DEBOUNCE_TIMEOUT = 500;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport const ATTRIBUTE_WIDTH = {\n EXTRA_SMALL: \"EXTRA_SMALL\",\n SMALL: \"SMALL\",\n MEDIUM: \"MEDIUM\",\n LARGE: \"LARGE\",\n EXTRA_LARGE: \"EXTRA_LARGE\",\n};\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\n\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n"],"mappings":";;;;;;;AACA;AACA;AACA;AACO,IAAMA,SAAS,GAAG,IAAlB;;AAEP,IAAMC,UAAU,GACd,OAAOC,gBAAP,KAA4B,WAA5B,GAA0C,IAA1C,GAAiDA,gBADnD;AAGA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,IAAY,GACvBF,UADuB,aACvBA,UADuB,cACvBA,UADuB,GAEtB,OAAOG,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACC,WAAxC,GACGD,MAAM,CAACC,WADV,GAEG,aAJC;AAMP;AACA;AACA;AACA;;;AACO,IAAMC,uBAAuB,GAAG,gBAAhC;AAEP;AACA;AACA;AACA;;;AACA,IAAMC,eAAe,GAAG,GAAxB;AAEA;AACA;AACA;;AACO,IAAMC,gBAAwB,GAAGL,IAAI,GAAGI,eAAxC;AAEP;AACA;AACA;;;AACO,IAAME,YAAY,aAAMN,IAAN,aAAlB;AAEP;AACA;AACA;;;AACO,IAAMO,WAAW,aAAMP,IAAN,gBAAjB;AAEP;AACA;AACA;;;AACO,IAAMQ,YAAY,aAAMR,IAAN,qBAAlB;AAEP;AACA;AACA;;;AACO,IAAMS,UAAU,GAAG,SAAnB;AAEP;AACA;AACA;;;AACO,IAAMC,WAAW,GAAG,UAApB;AAEP;AACA;AACA;;;AACO,IAAMC,mBAAmB,GAAG,kBAA5B;AAEP;AACA;AACA;;;AACO,IAAMC,gBAAgB,GAAG,OAAzB;AAEP;AACA;AACA;;;AACO,IAAMC,mBAAmB,GAAG,GAA5B;AAEP;AACA;AACA;;;AACO,IAAMC,uBAAuB,GAAG,WAAhC;;AAEP,IAAMC,2BAA2B,GAAG,UAApC;AACA;AACA;AACA;;AACO,IAAMC,qBAAoC,GAAG,CAClDD,2BADkD,CAA7C;AAIP;AAC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;AACA;;;AACO,IAAMG,sBAAsB,GAAG,GAA/B;AAEP;AACA;AACA;;;AACO,IAAMC,yBAAyB,GAAG,GAAlC;AAEP;AACA;AACA;;;AACO,IAAMC,eAAe,GAAG;EAC7BC,WAAW,EAAE,aADgB;EAE7BC,KAAK,EAAE,OAFsB;EAG7BC,MAAM,EAAE,QAHqB;EAI7BC,KAAK,EAAE,OAJsB;EAK7BC,WAAW,EAAE;AALgB,CAAxB;;AAQA,IAAMC,2BAA2B,GAAG,qBAApC;;AAEA,IAAMC,kBAAkB,GAAG,sBAA3B;;AACA,IAAMC,sBAAsB,GAAG,gCAA/B;;AACA,IAAMC,sBAAsB,GAAG,gCAA/B;;AACA,IAAMC,mBAAmB,GAAG,uBAA5B"}
1
+ {"version":3,"file":"Constants.js","names":["USE_CACHE","serverBase","__CONTEXT_PATH__","BASE","window","contextPath","MODULARUI_CONTRIBUTIONS","APPLICATION_URI","APPLICATION_PATH","CONTENT_PATH","UPLOAD_PATH","CAPTCHA_PATH","LOGIN_PATH","LOGOUT_PATH","CHANGEPASSWORD_PATH","USERPROFILE_PATH","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","PARAMETER_OVERVIEW_VIEWTYPE","DEFAULT_UI_PARAMETERS","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","KEYCODES","TAB","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","IS_SYNC","dataFetcher","IS_SERVER","NOTIFICATION_TYPES","SUCCESS","INFO","WARNING","ERROR","HTTP_METHODS","GET","POST","MODULARUI_STATUS","LOADING","FINISHED","AUTOSAVE_STATUS","START","INPUT_DEBOUNCE_TIMEOUT","VALIDATE_DEBOUNCE_TIMEOUT","ATTRIBUTE_WIDTH","EXTRA_SMALL","SMALL","MEDIUM","LARGE","EXTRA_LARGE","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING"],"sources":["../../src/constants/Constants.js"],"sourcesContent":["// @flow\n/**\n * Indicates if contributions should be cached\n */\nexport const USE_CACHE = true;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const BASE: string =\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\");\n\n/**\n * Path to the contributions api end point\n * /contributions uri part is added through the _links in the data service\n */\nexport const MODULARUI_CONTRIBUTIONS = \"/contributions\";\n\n/**\n * Application uri\n * @private\n */\nconst APPLICATION_URI = \"/\";\n\n/**\n * Base Path\n */\nexport const APPLICATION_PATH: string = BASE + APPLICATION_URI;\n\n/**\n * path to content service\n */\nexport const CONTENT_PATH = `${BASE}/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `${BASE}/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `${BASE}/captchaServices`;\n\n/**\n * Path to login page / component\n */\nexport const LOGIN_PATH = \"/signin\";\n\n/**\n * Path to logout page / component\n */\nexport const LOGOUT_PATH = \"/signout\";\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nconst PARAMETER_OVERVIEW_VIEWTYPE = \"viewType\";\n/**\n * Parameter name for the viewtype toggle\n */\nexport const DEFAULT_UI_PARAMETERS: Array<string> = [\n PARAMETER_OVERVIEW_VIEWTYPE,\n];\n\n/**\n */\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\n/**\n */\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n/**\n */\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\n/**\n */\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * Key codes\n * @type {{SPACE: number, PAGE_DOWN: number, TAB: number, ARROW_RIGHT: number, ARROW_DOWN: number, ENTER: number, ARROW_UP: number, ARROW_LEFT: number, PAGE_UP: number, ESCAPE: number}}\n */\nexport const KEYCODES = {\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\n/**\n * @type {boolean}\n */\nexport const IS_SYNC = typeof dataFetcher !== \"undefined\";\n/**\n * @type {boolean}\n */\nexport const IS_SERVER = IS_SYNC;\n\n/**\n * @type {{SUCCESS: string, ERROR: string, INFO: string, WARNING: string}}\n */\nexport const NOTIFICATION_TYPES = {\n SUCCESS: \"SUCCESS\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n ERROR: \"ERROR\",\n};\n\n/**\n * SUPPORTED HTTP METHODS\n * @type {{POST: string, GET: string}}\n */\nexport const HTTP_METHODS = {\n GET: \"GET\",\n POST: \"POST\",\n};\n\n/**\n * POSSIBLE MODULARUI STATUSSES\n * @type {{LOADING: string, ERROR: string, FINISHED: string}}\n */\nexport const MODULARUI_STATUS = {\n LOADING: \"LOADING\",\n FINISHED: \"FINISHED\",\n ERROR: \"ERROR\",\n};\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport const AUTOSAVE_STATUS = {\n START: \"START\",\n FINISHED: \"FINISHED\",\n};\n\n/**\n * DEBOUNCE INPUT TIMEOUT\n */\nexport const INPUT_DEBOUNCE_TIMEOUT = 100;\n\n/**\n * DEBOUNCE VALIDATION TIMEOUT\n */\nexport const VALIDATE_DEBOUNCE_TIMEOUT = 500;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport const ATTRIBUTE_WIDTH = {\n EXTRA_SMALL: \"EXTRA_SMALL\",\n SMALL: \"SMALL\",\n MEDIUM: \"MEDIUM\",\n LARGE: \"LARGE\",\n EXTRA_LARGE: \"EXTRA_LARGE\",\n};\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\n\nexport const LOGIN_TYPE = \"security.clients\";\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n"],"mappings":";;;;;;;AACA;AACA;AACA;AACO,IAAMA,SAAS,GAAG,IAAlB;;AAEP,IAAMC,UAAU,GACd,OAAOC,gBAAP,KAA4B,WAA5B,GAA0C,IAA1C,GAAiDA,gBADnD;AAGA;AACA;AACA;AACA;AACA;AACA;;AACO,IAAMC,IAAY,GACvBF,UADuB,aACvBA,UADuB,cACvBA,UADuB,GAEtB,OAAOG,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACC,WAAxC,GACGD,MAAM,CAACC,WADV,GAEG,aAJC;AAMP;AACA;AACA;AACA;;;AACO,IAAMC,uBAAuB,GAAG,gBAAhC;AAEP;AACA;AACA;AACA;;;AACA,IAAMC,e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MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","IGNORE_FORMAT_SETTING","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","getLayoutHintConfiguration"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n/**\n * Layout-hint: Ignore the global input format for specific attribute\n */\nexport const IGNORE_FORMAT_SETTING: string = getHint(\"IGNORE_FORMAT_SETTING\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\"\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"mappings":";;;;;;;AACA;;AAE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B,OAAO,CACtD,2BADsD,CAAjD;AAGP;AACA;AACA;;;AACO,IAAMiB,eAAuB,GAAGjB,OAAO,CAAC,iBAAD,CAAvC;AACP;AACA;AACA;;;AACO,IAAMkB,cAAsB,GAAG,iBAA/B;AACP;AACA;AACA;;;AACO,IAAMC,aAAqB,GAAGnB,OAAO,CAAC,eAAD,CAArC;AAEP;AACA;AACA;;;AACO,IAAMoB,oBAAoB,GAAG,sBAA7B;AAEP;AACA;;;;AACO,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA6B;EAAA,OAAcnB,yCAAd;AAAA,CAAnC;;;eAEQF,O"}
1
+ {"version":3,"file":"LayoutHints.js","names":["getHint","hint","LayoutHintConfiguration","MANDATORY","DISABLED","DEPENDENT_ATTRIBUTE_CONTROL","DEPENDENT_ATTRIBUTE","CONFIRM_PASSWORD","SORT_OPTIONS","TITLE","IGNORE_FORMAT_SETTING","DELETE_ACTION","UPDATE_ACTION","CREATE_ACTION","INITIAL_TOTAL_FILESIZE","MAX_TOTAL_FILESIZE","SHOW_ONE_RESULT_AS_DETAIL","HIDE_WHEN_EMPTY","INITIAL_FILTER","CASEVIEW_LINK","RENDER_SECTION_LABEL","getLayoutHintConfiguration"],"sources":["../../src/constants/LayoutHints.js"],"sourcesContent":["// @flow\nimport { LayoutHintConfiguration } from \"./LayoutHintConfig\";\n\n/**\n * Retrieve layout hint by id from the layout hint configuration\n */\nconst getHint = (hint: string): string => {\n if (LayoutHintConfiguration[hint]) {\n return LayoutHintConfiguration[hint].hint;\n }\n\n return \"\";\n};\n\n/**\n * Layout-hint: Indicates a mandatory attribute. Should be used together with the dependency hint.\n */\nexport const MANDATORY: string = getHint(\"MANDATORY\");\n\n/**\n * Layout-hint: Indicates a disabled attribute.\n * @constant\n */\nexport const DISABLED: string = getHint(\"DISABLED\");\n\n/*\n * --------------------------------\n * SELECT DEPENDENT ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Marks the choice attribute where other attributes depend on. The unique control id is a unique id that can be used in the hint for the show|hide action on the dependent attribute.\n */\nexport const DEPENDENT_ATTRIBUTE_CONTROL = \"dependent-control\";\n/**\n */\nexport const DEPENDENT_ATTRIBUTE = \"dependent-attribute:\";\n\n/*\n * --------------------------------\n * ATTRIBUTES\n * --------------------------------\n */\n/**\n * Layout-hint: Password attribute must be confirmed using a second password attribute.\n */\nexport const CONFIRM_PASSWORD: string = getHint(\"CONFIRM_PASSWORD\");\n/**\n * Layout-hint: Sort options alphabetically\n */\nexport const SORT_OPTIONS: string = getHint(\"SORT_OPTIONS\");\n/**\n * Layout-hint: Marks an attribute as a title attribute\n */\nexport const TITLE: string = getHint(\"TITLE\");\n/**\n * Layout-hint: Ignore the global input format for specific attribute\n */\nexport const IGNORE_FORMAT_SETTING: string = getHint(\"IGNORE_FORMAT_SETTING\");\n\n/*\n * --------------------------------\n * FORM\n * --------------------------------\n */\n/**\n * Layout-hint: Mark task as delete task\n */\nexport const DELETE_ACTION: string = getHint(\"DELETE_ACTION\");\n/**\n * Layout-hint: Mark task as update task\n */\nexport const UPDATE_ACTION: string = getHint(\"UPDATE_ACTION\");\n/**\n * Layout-hint: Mark task as create task\n */\nexport const CREATE_ACTION: string = getHint(\"CREATE_ACTION\");\n\n/*\n * --------------------------------\n * UPLOAD TOTAL FILE SIZE\n * --------------------------------\n */\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the file size currently used.\n */\nexport const INITIAL_TOTAL_FILESIZE: string = getHint(\"INITIAL_TOTAL_FILESIZE\");\n/**\n * Layout-hint: Used in conjunction with an upload attribute, this hint is set on a read only attribute containing the maximum allowed total file size.\n */\nexport const MAX_TOTAL_FILESIZE: string = getHint(\"MAX_TOTAL_FILESIZE\");\n\n/*\n * --------------------------------\n * LISTS\n * --------------------------------\n */\n/**\n * Layout-hint: A list with only one detail must be shown as a detail\n */\nexport const SHOW_ONE_RESULT_AS_DETAIL: string = getHint(\n \"SHOW_ONE_RESULT_AS_DETAIL\"\n);\n/**\n * Layout-hint: A list without list-items and list-tasks should not be shown.\n */\nexport const HIDE_WHEN_EMPTY: string = getHint(\"HIDE_WHEN_EMPTY\");\n/**\n * Layout-hint: Sets a default value on a filter\n */\nexport const INITIAL_FILTER: string = \"initial-filter:\";\n/**\n * Layout-hint: Mark a case id reference attribute as the reference to the case view. Replaces the self link of a list item\n */\nexport const CASEVIEW_LINK: string = getHint(\"CASEVIEW_LINK\");\n\n/**\n * Layout-hint: Set on configuration of instruments to show content in a popover on a label\n */\nexport const RENDER_SECTION_LABEL = \"render-section-label\";\n\n/**\n */\nexport const getLayoutHintConfiguration = (): Object => LayoutHintConfiguration;\n\nexport default getHint;\n"],"mappings":";;;;;;;AACA;;AAEA;AACA;AACA;AACA,IAAMA,OAAO,GAAG,SAAVA,OAAU,CAACC,IAAD,EAA0B;EACxC,IAAIC,yCAAA,CAAwBD,IAAxB,CAAJ,EAAmC;IACjC,OAAOC,yCAAA,CAAwBD,IAAxB,EAA8BA,IAArC;EACD;;EAED,OAAO,EAAP;AACD,CAND;AAQA;AACA;AACA;;;AACO,IAAME,SAAiB,GAAGH,OAAO,CAAC,WAAD,CAAjC;AAEP;AACA;AACA;AACA;;;AACO,IAAMI,QAAgB,GAAGJ,OAAO,CAAC,UAAD,CAAhC;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMK,2BAA2B,GAAG,mBAApC;AACP;AACA;;;AACO,IAAMC,mBAAmB,GAAG,sBAA5B;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMC,gBAAwB,GAAGP,OAAO,CAAC,kBAAD,CAAxC;AACP;AACA;AACA;;;AACO,IAAMQ,YAAoB,GAAGR,OAAO,CAAC,cAAD,CAApC;AACP;AACA;AACA;;;AACO,IAAMS,KAAa,GAAGT,OAAO,CAAC,OAAD,CAA7B;AACP;AACA;AACA;;;AACO,IAAMU,qBAA6B,GAAGV,OAAO,CAAC,uBAAD,CAA7C;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMW,aAAqB,GAAGX,OAAO,CAAC,eAAD,CAArC;AACP;AACA;AACA;;;AACO,IAAMY,aAAqB,GAAGZ,OAAO,CAAC,eAAD,CAArC;AACP;AACA;AACA;;;AACO,IAAMa,aAAqB,GAAGb,OAAO,CAAC,eAAD,CAArC;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMc,sBAA8B,GAAGd,OAAO,CAAC,wBAAD,CAA9C;AACP;AACA;AACA;;;AACO,IAAMe,kBAA0B,GAAGf,OAAO,CAAC,oBAAD,CAA1C;AAEP;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;;;AACO,IAAMgB,yBAAiC,GAAGhB,OAAO,CACtD,2BADsD,CAAjD;AAGP;AACA;AACA;;;AACO,IAAMiB,eAAuB,GAAGjB,OAAO,CAAC,iBAAD,CAAvC;AACP;AACA;AACA;;;AACO,IAAMkB,cAAsB,GAAG,iBAA/B;AACP;AACA;AACA;;;AACO,IAAMC,aAAqB,GAAGnB,OAAO,CAAC,eAAD,CAArC;AAEP;AACA;AACA;;;AACO,IAAMoB,oBAAoB,GAAG,sBAA7B;AAEP;AACA;;;;AACO,IAAMC,0BAA0B,GAAG,SAA7BA,0BAA6B;EAAA,OAAcnB,yCAAd;AAAA,CAAnC;;;eAEQF,O"}
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.setSettings = exports.setSetting = exports.logoutPath = exports.loginUsernameField = exports.loginPath = exports.loginPasswordField = exports.hasAllContentInData = exports.getSetting = exports.allSettings = void 0;
8
+ exports.setSettings = exports.setSetting = exports.logoutPath = exports.loginUsernameField = exports.loginType = exports.loginPath = exports.loginPasswordField = exports.hasAllContentInData = exports.getSetting = exports.allSettings = void 0;
9
9
 
10
10
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign"));
11
11
 
@@ -112,13 +112,23 @@ var hasAllContentInData = function hasAllContentInData() {
112
112
  return getSetting(_Constants.ALL_CONTENT_IN_DATA_SETTING, true);
113
113
  };
114
114
  /**
115
+ * Login type, only available when pac4j is configured
115
116
  */
116
117
 
117
118
 
118
119
  exports.hasAllContentInData = hasAllContentInData;
119
120
 
121
+ var loginType = function loginType() {
122
+ return getSetting(_Constants.LOGIN_TYPE, "JAAS");
123
+ };
124
+ /**
125
+ */
126
+
127
+
128
+ exports.loginType = loginType;
129
+
120
130
  var loginPath = function loginPath() {
121
- return getSetting(_Constants.LOGIN_PATH_SETTING, "".concat(_Constants.BASE, "/j_security_check"));
131
+ return getSetting(_Constants.LOGIN_PATH_SETTING, "/j_security_check");
122
132
  };
123
133
  /**
124
134
  */
@@ -145,7 +155,7 @@ var loginPasswordField = function loginPasswordField() {
145
155
  exports.loginPasswordField = loginPasswordField;
146
156
 
147
157
  var logoutPath = function logoutPath() {
148
- return getSetting(_Constants.LOGOUT_PATH_SETTING, "".concat(_Constants.BASE, "/Logoff"));
158
+ return getSetting(_Constants.LOGOUT_PATH_SETTING, "/Logoff");
149
159
  };
150
160
 
151
161
  exports.logoutPath = logoutPath;
@@ -1,8 +1,8 @@
1
1
  // @flow
2
2
  import { isPlainObject, has } from "../utils/helpers/objects";
3
3
  import {
4
- BASE,
5
4
  ALL_CONTENT_IN_DATA_SETTING,
5
+ LOGIN_TYPE,
6
6
  LOGIN_PATH_SETTING,
7
7
  LOGIN_USERNAME_SETTING,
8
8
  LOGIN_PASSWORD_SETTING,
@@ -123,10 +123,15 @@ export const allSettings = (): { [name: string]: Setting } => settings;
123
123
  export const hasAllContentInData = (): boolean =>
124
124
  getSetting(ALL_CONTENT_IN_DATA_SETTING, true);
125
125
 
126
+ /**
127
+ * Login type, only available when pac4j is configured
128
+ */
129
+ export const loginType = (): string => getSetting(LOGIN_TYPE, "JAAS");
130
+
126
131
  /**
127
132
  */
128
133
  export const loginPath = (): string =>
129
- getSetting(LOGIN_PATH_SETTING, `${BASE}/j_security_check`);
134
+ getSetting(LOGIN_PATH_SETTING, "/j_security_check");
130
135
  /**
131
136
  */
132
137
  export const loginUsernameField = (): string =>
@@ -138,4 +143,4 @@ export const loginPasswordField = (): string =>
138
143
  /**
139
144
  */
140
145
  export const logoutPath = (): string =>
141
- getSetting(LOGOUT_PATH_SETTING, `${BASE}/Logoff`);
146
+ getSetting(LOGOUT_PATH_SETTING, "/Logoff");
@@ -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","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","hasAllContentInData","ALL_CONTENT_IN_DATA_SETTING","loginPath","LOGIN_PATH_SETTING","BASE","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 BASE,\n ALL_CONTENT_IN_DATA_SETTING,\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 */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, `${BASE}/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, `${BASE}/Logoff`);\n"],"mappings":";;;;;;;;;;;AACA;;AACA;;AAWA,IAAMA,eAAe,GAAG;EACtB;EACAC,4B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,IAAI,CAAC,kBAAIL,QAAJ,EAAcI,GAAd,CAAD,IAAuBC,YAAY,KAAKC,SAA5C,EAAuD;IACrD,MAAM,IAAIC,KAAJ,6BACiBH,GADjB,0CAAN;EAGD;;EAED,wBAAOJ,QAAQ,CAACI,GAAD,CAAf,yDAAwBC,YAAxB;AACD,CARM;AAUP;AACA;;;;;AACO,IAAMG,UAAU,GAAG,SAAbA,UAAa,CAACJ,GAAD,EAAcK,KAAd,EAA6B;EACrDT,QAAQ,CAACI,GAAD,CAAR,GAAgBK,KAAhB;AACD,CAFM;AAIP;AACA;;;;;AACO,IAAMC,WAAW,GAAG,SAAdA,WAAc;EAAA,OAAmCV,QAAnC;AAAA,CAApB;AAEP;AACA;;;;;AACO,IAAMW,mBAAmB,GAAG,SAAtBA,mBAAsB;EAAA,OACjCR,UAAU,CAACS,sCAAD,EAA8B,IAA9B,CADuB;AAAA,CAA5B;AAGP;AACA;;;;;AACO,IAAMC,SAAS,GAAG,SAAZA,SAAY;EAAA,OACvBV,UAAU,CAACW,6BAAD,YAAwBC,eAAxB,uBADa;AAAA,CAAlB;AAEP;AACA;;;;;AACO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCb,UAAU,CAACc,iCAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;;;;AACO,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB;EAAA,OAChCf,UAAU,CAACgB,iCAAD,EAAyB,YAAzB,CADsB;AAAA,CAA3B;AAEP;AACA;;;;;AACO,IAAMC,UAAU,GAAG,SAAbA,UAAa;EAAA,OACxBjB,UAAU,CAACkB,8BAAD,YAAyBN,eAAzB,aADc;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_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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P;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"}
@@ -1 +1 @@
1
- {"version":3,"file":"FetchException.js","names":["CLIENT_ERROR_CODE","getErrorInfo","errorResponse","requestOptions","defaultErrorInfo","id","defaultMessage","url","method","HTTP_METHODS","GET","properties","param","error","key","errors","FetchException","failedRequest","errorInfo","name","request","status","response","parameters","Error","captureStackTrace"],"sources":["../../src/exceptions/FetchException.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport type { MessageParameters } from \"../i18n/types\";\nimport type { RequestOptions } from \"../utils/fetch/types\";\n\nexport type ModularUIErrorResponse = {\n error: {\n id: string,\n properties: {\n [propertyName: string]: string | number,\n ...\n },\n },\n};\n\ntype RequestResult = { status: number };\ntype RequestParameters = { [key: string]: any };\n\nconst CLIENT_ERROR_CODE = 400;\n\n/**\n * @private\n */\nconst getErrorInfo = (\n errorResponse: ?ModularUIErrorResponse,\n requestOptions: ?RequestOptions\n) => {\n const defaultErrorInfo = {\n id: \"Error.CannotRequestResource\",\n defaultMessage: `Cannot request resource ${\n requestOptions?.url ?? \"\"\n } with method ${requestOptions?.method ?? HTTP_METHODS.GET}`,\n properties: {},\n param: null,\n };\n\n if (!errorResponse) {\n return defaultErrorInfo;\n }\n\n if (has(errorResponse, \"error\")) {\n return {\n ...defaultErrorInfo,\n ...errorResponse.error,\n };\n }\n\n const [key] = Object.keys(errorResponse);\n if (has(errorResponse[key], \"errors\")) {\n return {\n ...defaultErrorInfo,\n // $FlowFixMe[prop-missing] - not sure in what case this could happen\n ...errorResponse[key].errors,\n };\n }\n\n return defaultErrorInfo;\n};\n\n/**\n * FetchException\n */\nexport default class FetchException extends Error {\n request: ?RequestResult | XMLHttpRequest;\n status: number;\n response: ?ModularUIErrorResponse;\n parameters: ?RequestParameters;\n properties: MessageParameters;\n requestOptions: ?RequestOptions;\n id: string;\n\n constructor(\n errorResponse: ?ModularUIErrorResponse,\n failedRequest?: ?RequestResult | XMLHttpRequest,\n requestOptions?: RequestOptions\n ) {\n const errorInfo = getErrorInfo(errorResponse, requestOptions);\n super(errorInfo.id);\n\n this.name = errorInfo.id;\n this.id = errorInfo.id;\n this.request = failedRequest;\n this.requestOptions = requestOptions;\n\n this.status =\n failedRequest && failedRequest.status\n ? failedRequest.status\n : CLIENT_ERROR_CODE;\n\n this.response = errorResponse;\n this.properties = errorInfo.properties ?? {};\n this.parameters = errorInfo.param ?? null;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FetchException);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;;;;;;;;;AAkBA,IA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,aAAa,IAAIA,aAAa,CAACI,MAA/B,GACIJ,aAAa,CAACI,MADlB,GAEIrB,iBAHN;IAKA,MAAKsB,QAAL,GAAgBpB,aAAhB;IACA,MAAKS,UAAL,4BAAkBO,SAAS,CAACP,UAA5B,yEAA0C,EAA1C;IACA,MAAKY,UAAL,uBAAkBL,SAAS,CAACN,KAA5B,+DAAqC,IAArC;;IAEA,IAAIY,KAAK,CAACC,iBAAV,EAA6B;MAC3BD,KAAK,CAACC,iBAAN,8CAA8BT,cAA9B;IACD;;IApBD;EAqBD;;;+CAlCyCQ,K"}
1
+ {"version":3,"file":"FetchException.js","names":["CLIENT_ERROR_CODE","getErrorInfo","errorResponse","requestOptions","defaultErrorInfo","id","defaultMessage","url","method","HTTP_METHODS","GET","properties","param","has","error","key","errors","FetchException","failedRequest","errorInfo","name","request","status","response","parameters","Error","captureStackTrace"],"sources":["../../src/exceptions/FetchException.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport type { MessageParameters } from \"../i18n/types\";\nimport type { RequestOptions } from \"../utils/fetch/types\";\n\nexport type ModularUIErrorResponse = {\n error: {\n id: string,\n properties: {\n [propertyName: string]: string | number,\n ...\n },\n },\n};\n\ntype RequestResult = { status: number };\ntype RequestParameters = { [key: string]: any };\n\nconst CLIENT_ERROR_CODE = 400;\n\n/**\n * @private\n */\nconst getErrorInfo = (\n errorResponse: ?ModularUIErrorResponse,\n requestOptions: ?RequestOptions\n) => {\n const defaultErrorInfo = {\n id: \"Error.CannotRequestResource\",\n defaultMessage: `Cannot request resource ${\n requestOptions?.url ?? \"\"\n } with method ${requestOptions?.method ?? HTTP_METHODS.GET}`,\n properties: {},\n param: null,\n };\n\n if (!errorResponse) {\n return defaultErrorInfo;\n }\n\n if (has(errorResponse, \"error\")) {\n return {\n ...defaultErrorInfo,\n ...errorResponse.error,\n };\n }\n\n const [key] = Object.keys(errorResponse);\n if (has(errorResponse[key], \"errors\")) {\n return {\n ...defaultErrorInfo,\n // $FlowFixMe[prop-missing] - not sure in what case this could happen\n ...errorResponse[key].errors,\n };\n }\n\n return defaultErrorInfo;\n};\n\n/**\n * FetchException\n */\nexport default class FetchException extends Error {\n request: ?RequestResult | XMLHttpRequest;\n status: number;\n response: ?ModularUIErrorResponse;\n parameters: ?RequestParameters;\n properties: MessageParameters;\n requestOptions: ?RequestOptions;\n id: string;\n\n constructor(\n errorResponse: ?ModularUIErrorResponse,\n failedRequest?: ?RequestResult | XMLHttpRequest,\n requestOptions?: RequestOptions\n ) {\n const errorInfo = getErrorInfo(errorResponse, requestOptions);\n super(errorInfo.id);\n\n this.name = errorInfo.id;\n this.id = errorInfo.id;\n this.request = failedRequest;\n this.requestOptions = requestOptions;\n\n this.status =\n failedRequest && failedRequest.status\n ? failedRequest.status\n : CLIENT_ERROR_CODE;\n\n this.response = errorResponse;\n this.properties = errorInfo.properties ?? {};\n this.parameters = errorInfo.param ?? null;\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, FetchException);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;;;;;;;;;AAkBA,IAAMA,iBAAiB,GAAG,GAA1B;AAEA;AACA;AACA;;AACA,IAAMC,YAAY,GAAG,SAAfA,YAAe,CACnBC,aADmB,EAEnBC,cAFmB,EAGhB;EAAA;;EACH,IAAMC,gBAAgB,GAAG;IACvBC,EAAE,EAAE,6BADmB;IAEvBC,cAAc,2FACZH,cADY,aACZA,cADY,uBACZA,cAAc,CAAEI,GADJ,qEACW,EADX,4DAEEJ,cAFF,aAEEA,cAFF,uBAEEA,cAAc,CAAEK,MAFlB,yEAE4BC,uBAAA,CAAaC,GAFzC,CAFS;IAKvBC,UAAU,EAAE,EALW;IAMvBC,KAAK,EAAE;EANgB,CAAzB;;EASA,IAAI,CAACV,aAAL,EAAoB;IAClB,OAAOE,gBAAP;EACD;;EAED,IAAI,I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91
- const store = mockStore({ auth: {} });
91
+ const store = mockStore({ auth: {}, i18n: { locale: "en" } });
92
+
92
93
  /**
93
94
  */
94
95
  const wrapper = ({ children }) => (
@@ -107,6 +108,19 @@ describe("authentication hooks", () => {
107
108
  expect(store.getActions()).toStrictEqual([
108
109
  { type: "START_PROGRESS" },
109
110
  { type: "MODULARUI/RESET" },
111
+ {
112
+ type: "MODULARUI/STATUS",
113
+ payload: { key: "application(/)(en)", status: "LOADING" },
114
+ },
115
+ { type: "START_PROGRESS" },
116
+ expect.objectContaining({
117
+ type: "MODULARUI/FETCH",
118
+ payload: expect.objectContaining({
119
+ href: new Href("/", "Application"),
120
+ }),
121
+ }),
122
+ { type: "FINISH_PROGRESS" },
123
+
110
124
  { type: "AUTHENTICATION_LOGOUT" },
111
125
  { type: "FINISH_PROGRESS" },
112
126
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"useAllFormsOnModel.js","names":["useRetrieveFormsOnModel","model","modularui","forms","setForms","requestCount","setRequestCount","responseCount","setResponseCount","requests","getActions","action","href","selfhref","addParameter","method","HTTP_METHODS","POST","fetch","then","form","FormModel","tokens","name","length","all","responses","actionForms","Object","actionCollection","createActions","getActionsByType","isDisabled","allActions","ListModel","listItemCollection","forEach","listItem","updateActions","push","actions","unique"],"sources":["../../src/hooks/useAllFormsOnModel.js"],"sourcesContent":["// @flow\nimport { useState, useEffect } from \"react\";\n\nimport { useModularUIRequest } from \"./useModularUIRequest\";\n\nimport { HTTP_METHODS } from \"../constants\";\n\nimport ListModel from \"../models/list/ListModel\";\nimport FormModel from \"../models/form/FormModel\";\n\nimport type DetailModel from \"../models/detail/DetailModel\";\nimport type TabModel from \"../models/tab/TabModel\";\nimport type ActionModel from \"../models/actions/ActionModel\";\n\n/**\n * Retrieve all forms configured on a model with actions\n * @param model\n * @returns Object - { actionName: FormModel }\n */\nexport const useRetrieveFormsOnModel = (\n model: ListModel | DetailModel | TabModel\n): null | { [actionName: string]: FormModel } => {\n const modularui = useModularUIRequest();\n const [forms, setForms] = useState(null);\n const [requestCount, setRequestCount] = useState(0);\n const [responseCount, setResponseCount] = useState(0);\n\n useEffect(() => {\n const requests = getActions(model).map((action) => {\n const href = action.selfhref.addParameter(\"commit\", \"false\");\n\n return modularui(href, { method: HTTP_METHODS.POST })\n .fetch()\n .then((form) => {\n if (form instanceof FormModel) {\n form.tokens = [];\n }\n return { [action.name]: form };\n });\n });\n\n setRequestCount(requests.length);\n\n Promise.all(requests).then((responses) => {\n // put response array in object\n const actionForms = Object.assign({}, ...responses);\n setForms(actionForms);\n setResponseCount(responses.length);\n });\n }, [model, modularui]);\n\n if (responseCount === requestCount) {\n return forms;\n }\n\n return null;\n};\n\nconst getActions = (\n model: ListModel | DetailModel | TabModel\n): Array<ActionModel> => {\n if (!model.actionCollection) {\n return [];\n }\n\n const createActions = model.actionCollection\n .getActionsByType(\"create\")\n .filter((action) => !action.isDisabled);\n\n const allActions = [...createActions];\n\n if (model instanceof ListModel) {\n model.listItemCollection.forEach((listItem) => {\n const updateActions = listItem.actionCollection\n .getActionsByType(\"update\")\n .filter((action) => !action.isDisabled);\n\n allActions.push(...updateActions);\n });\n }\n\n const actions = [];\n const unique = [];\n allActions.forEach((action) => {\n if (!unique.includes(action.name)) {\n unique.push(action.name);\n actions.push(action);\n }\n });\n\n return actions;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,IAAMA,uBAAuB,GAAG,SAA1BA,uBAA0B,CACrCC,KADqC,EAEU;EAC/C,IAAMC,SAAS,GAAG,+CAAlB;;EACA,gBAA0B,qBAAS,IAAT,CAA1B;EAAA;EAAA,IAAOC,KAAP;EAAA,IAAcC,QAAd;;EACA,iBAAwC,qBAAS,CAAT,CAAxC;EAAA;EAAA,IAAOC,YAAP;EAAA,IAAqBC,eAArB;;EACA,iBAA0C,qBAAS,CAAT,CAA1C;EAAA;EAAA,IAAOC,aAA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;IAAA,OAAY,CAACA,MAAM,CAACqB,UAApB;EAAA,CAFY,CAAtB;EAIA,IAAMC,UAAU,oCAAOH,aAAP,CAAhB;;EAEA,IAAI7B,KAAK,YAAYiC,kBAArB,EAAgC;IAC9BjC,KAAK,CAACkC,kBAAN,CAAyBC,OAAzB,CAAiC,UAACC,QAAD,EAAc;MAAA;;MAC7C,IAAMC,aAAa,GAAG,iCAAAD,QAAQ,CAACR,gBAAT,CACnBE,gBADmB,CACF,QADE,mBAEZ,UAACpB,MAAD;QAAA,OAAY,CAACA,MAAM,CAACqB,UAApB;MAAA,CAFY,CAAtB;MAIAC,UAAU,CAACM,IAAX,OAAAN,UAAU,mCAASK,aAAT,EAAV;IACD,CAND;EAOD;;EAED,IAAME,OAAO,GAAG,EAAhB;EACA,IAAMC,MAAM,GAAG,EAAf;EACAR,UAAU,CAACG,OAAX,CAAmB,UAACzB,MAAD,EAAY;IAC7B,IAAI,CAAC,uBAAA8B,MAAM,MAAN,CAAAA,MAAM,EAAU9B,MAAM,CAACY,IAAjB,CAAX,EAAmC;MACjCkB,MAAM,CAACF,IAAP,CAAY5B,MAAM,CAACY,IAAnB;MACAiB,OAAO,CAACD,IAAR,CAAa5B,MAAb;IACD;EACF,CALD;EAOA,OAAO6B,OAAP;AACD,CAjCD"}
1
+ {"version":3,"file":"useAllFormsOnModel.js","names":["useRetrieveFormsOnModel","model","modularui","useModularUIRequest","useState","forms","setForms","requestCount","setRequestCount","responseCount","setResponseCount","useEffect","requests","getActions","action","href","selfhref","addParameter","method","HTTP_METHODS","POST","fetch","then","form","FormModel","tokens","name","length","all","responses","actionForms","Object","actionCollection","createActions","getActionsByType","isDisabled","allActions","ListModel","listItemCollection","forEach","listItem","updateActions","push","actions","unique"],"sources":["../../src/hooks/useAllFormsOnModel.js"],"sourcesContent":["// @flow\nimport { useState, useEffect } from \"react\";\n\nimport { useModularUIRequest } from \"./useModularUIRequest\";\n\nimport { HTTP_METHODS } from \"../constants\";\n\nimport ListModel from \"../models/list/ListModel\";\nimport FormModel from \"../models/form/FormModel\";\n\nimport type DetailModel from \"../models/detail/DetailModel\";\nimport type TabModel from \"../models/tab/TabModel\";\nimport type ActionModel from \"../models/actions/ActionModel\";\n\n/**\n * Retrieve all forms configured on a model with actions\n * @param model\n * @returns Object - { actionName: FormModel }\n */\nexport const useRetrieveFormsOnModel = (\n model: ListModel | DetailModel | TabModel\n): null | { [actionName: string]: FormModel } => {\n const modularui = useModularUIRequest();\n const [forms, setForms] = useState(null);\n const [requestCount, setRequestCount] = useState(0);\n const [responseCount, setResponseCount] = useState(0);\n\n useEffect(() => {\n const requests = getActions(model).map((action) => {\n const href = action.selfhref.addParameter(\"commit\", \"false\");\n\n return modularui(href, { method: HTTP_METHODS.POST })\n .fetch()\n .then((form) => {\n if (form instanceof FormModel) {\n form.tokens = [];\n }\n return { [action.name]: form };\n });\n });\n\n setRequestCount(requests.length);\n\n Promise.all(requests).then((responses) => {\n // put response array in object\n const actionForms = Object.assign({}, ...responses);\n setForms(actionForms);\n setResponseCount(responses.length);\n });\n }, [model, modularui]);\n\n if (responseCount === requestCount) {\n return forms;\n }\n\n return null;\n};\n\nconst getActions = (\n model: ListModel | DetailModel | TabModel\n): Array<ActionModel> => {\n if (!model.actionCollection) {\n return [];\n }\n\n const createActions = model.actionCollection\n .getActionsByType(\"create\")\n .filter((action) => !action.isDisabled);\n\n const allActions = [...createActions];\n\n if (model instanceof ListModel) {\n model.listItemCollection.forEach((listItem) => {\n const updateActions = listItem.actionCollection\n .getActionsByType(\"update\")\n .filter((action) => !action.isDisabled);\n\n allActions.push(...updateActions);\n });\n }\n\n const actions = [];\n const unique = [];\n allActions.forEach((action) => {\n if (!unique.includes(action.name)) {\n unique.push(action.name);\n actions.push(action);\n }\n });\n\n return actions;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AAMA;AACA;AACA;AACA;AACA;AACO,IAAMA,uBAAuB,GAAG,SAA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