@beinformed/ui 1.27.1 → 1.27.3

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 (78) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/esm/constants/Constants.js +5 -0
  3. package/esm/constants/Constants.js.map +1 -1
  4. package/esm/constants/Settings.js +6 -4
  5. package/esm/constants/Settings.js.map +1 -1
  6. package/esm/models/application/ApplicationModel.js +6 -3
  7. package/esm/models/application/ApplicationModel.js.map +1 -1
  8. package/esm/models/attributes/AttributeDataHelper.js +2 -2
  9. package/esm/models/attributes/AttributeDataHelper.js.map +1 -1
  10. package/esm/models/attributes/_createAttribute.js +2 -2
  11. package/esm/models/attributes/_createAttribute.js.map +1 -1
  12. package/esm/models/base/BaseCollection.js +3 -9
  13. package/esm/models/base/BaseCollection.js.map +1 -1
  14. package/esm/models/base/BaseModel.js +2 -8
  15. package/esm/models/base/BaseModel.js.map +1 -1
  16. package/esm/modularui/Authenticate.js +25 -13
  17. package/esm/modularui/Authenticate.js.map +1 -1
  18. package/esm/react/ErrorBoundaryFallback.js +3 -0
  19. package/esm/react/ErrorBoundaryFallback.js.map +1 -1
  20. package/esm/react-server/serverUtil.js +1 -0
  21. package/esm/react-server/serverUtil.js.map +1 -1
  22. package/esm/redux/actions/FormValidations.js +1 -1
  23. package/esm/redux/actions/FormValidations.js.map +1 -1
  24. package/lib/constants/Constants.js +7 -1
  25. package/lib/constants/Constants.js.flow +5 -0
  26. package/lib/constants/Constants.js.map +1 -1
  27. package/lib/constants/Settings.js +5 -3
  28. package/lib/constants/Settings.js.flow +7 -3
  29. package/lib/constants/Settings.js.map +1 -1
  30. package/lib/models/application/ApplicationModel.js +6 -3
  31. package/lib/models/application/ApplicationModel.js.flow +10 -5
  32. package/lib/models/application/ApplicationModel.js.map +1 -1
  33. package/lib/models/attributes/AttributeDataHelper.js +2 -2
  34. package/lib/models/attributes/AttributeDataHelper.js.flow +2 -2
  35. package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
  36. package/lib/models/attributes/__tests__/ChoiceAttributeModel.spec.js.flow +3 -0
  37. package/lib/models/attributes/__tests__/CompositeAttributeModel.spec.js.flow +3 -0
  38. package/lib/models/attributes/_createAttribute.js +2 -2
  39. package/lib/models/attributes/_createAttribute.js.flow +2 -2
  40. package/lib/models/attributes/_createAttribute.js.map +1 -1
  41. package/lib/models/base/BaseCollection.js +3 -9
  42. package/lib/models/base/BaseCollection.js.flow +4 -10
  43. package/lib/models/base/BaseCollection.js.map +1 -1
  44. package/lib/models/base/BaseModel.js +2 -8
  45. package/lib/models/base/BaseModel.js.flow +3 -9
  46. package/lib/models/base/BaseModel.js.map +1 -1
  47. package/lib/models/base/__tests__/BaseModel.spec.js.flow +3 -7
  48. package/lib/modularui/Authenticate.js +24 -12
  49. package/lib/modularui/Authenticate.js.flow +30 -13
  50. package/lib/modularui/Authenticate.js.map +1 -1
  51. package/lib/react/ErrorBoundaryFallback.js +3 -0
  52. package/lib/react/ErrorBoundaryFallback.js.flow +2 -0
  53. package/lib/react/ErrorBoundaryFallback.js.map +1 -1
  54. package/lib/react-server/serverUtil.js +1 -0
  55. package/lib/react-server/serverUtil.js.flow +2 -0
  56. package/lib/react-server/serverUtil.js.map +1 -1
  57. package/lib/redux/actions/FormValidations.js +1 -1
  58. package/lib/redux/actions/FormValidations.js.flow +1 -1
  59. package/lib/redux/actions/FormValidations.js.map +1 -1
  60. package/package.json +11 -10
  61. package/src/constants/Constants.js +5 -0
  62. package/src/constants/Settings.js +7 -3
  63. package/src/models/application/ApplicationModel.js +10 -5
  64. package/src/models/attributes/AttributeDataHelper.js +2 -2
  65. package/src/models/attributes/__tests__/ChoiceAttributeModel.spec.js +3 -0
  66. package/src/models/attributes/__tests__/CompositeAttributeModel.spec.js +3 -0
  67. package/src/models/attributes/_createAttribute.js +2 -2
  68. package/src/models/base/BaseCollection.js +4 -10
  69. package/src/models/base/BaseModel.js +3 -9
  70. package/src/models/base/__tests__/BaseModel.spec.js +3 -7
  71. package/src/modularui/Authenticate.js +30 -13
  72. package/src/react/ErrorBoundaryFallback.js +2 -0
  73. package/src/react-server/serverUtil.js +2 -0
  74. package/src/redux/actions/FormValidations.js +1 -1
  75. package/types/constants/Constants.d.ts +5 -0
  76. package/types/models/base/BaseCollection.d.ts +2 -2
  77. package/types/models/base/BaseModel.d.ts +1 -1
  78. package/types/modularui/Authenticate.d.ts +8 -1
@@ -1 +1 @@
1
- {"version":3,"file":"serverUtil.js","names":["createReduxStore","requestHref","customReducers","initialState","history","createMemoryHistory","initialEntries","toString","store","configureStore","setI18n","locales","request","Array","isArray","IllegalArgumentException","mergedLocales","availableLocales","locale","code","customLocale","custLocale","deepmerge","forEach","some","push","enabledLocales","getSetting","localesInstance","Locales","preferredLocale","getPreferredLocale","dispatch","setLocales","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreference","setServerPreferences","setAllContentInDataSetting","setLoginPreferences","preferencesProvider","isStudioContext","setPreference","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","dataFetcher","fetch","setThemePreference","Error","setApplication","getLocale","getState","application","ModularUIRequest","fetchSync","initModels","key","model","e","console","info","handleErrors","state","error","shouldThrowOnServer","has","dehydrate","modularui","status","lastModification","undefined","filteredState","replace","createHead","sheet","UUID","helmetContext","style","getStyleTags","meta","helmet"],"sources":["../../src/react-server/serverUtil.js"],"sourcesContent":["// @flow\nimport { createMemoryHistory } from \"history\";\nimport { has } from \"../utils/helpers/objects\";\nimport deepmerge from \"deepmerge\";\n\nimport configureStore from \"../redux/store/configureStore\";\n\nimport { availableLocales } from \"../i18n/Locales\";\nimport Locales from \"../i18n/Locales\";\n\nimport { getPreferredLocale } from \"./requestInformation\";\nimport { setLocales } from \"../redux/_i18n/I18nActions\";\n\nimport {\n setServerPreference,\n setThemePreference,\n setPreference,\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport { initModels } from \"../redux\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\n\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { ReduxState, ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { RouterHistory } from \"react-router\";\n\nexport type PreferenceValue = {\n name: string,\n defaultValue?: string | null,\n type?: string,\n};\n\n/**\n */\nconst createReduxStore = (\n requestHref: Href,\n customReducers: Object,\n initialState?: $Shape<ReduxState>\n): ReduxStore => {\n // $FlowExpectedError\n const history: RouterHistory = createMemoryHistory({\n initialEntries: [requestHref.toString()],\n });\n\n const { store } = configureStore(history, customReducers, initialState);\n\n return store;\n};\n\n/**\n */\nconst setI18n = (\n store: ReduxStore,\n locales: Array<LocaleConfiguration> = [],\n request: HttpServletRequestJava\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getSetting(\"ENABLED_LOCALES\").includes(locale.code)\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n\nconst setServerPreferencesFromArray = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n store.dispatch(setServerPreference(name, defaultValue, type));\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nconst setServerPreferences = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n\n/**\n */\nconst setConfigurationTheme = (store: ReduxStore) => {\n let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`\n );\n }\n }\n};\n\n/**\n */\nconst setApplication = (store: ReduxStore) => {\n try {\n const locale = getLocale(store.getState());\n const application = new ModularUIRequest(\"/\", {\n locale: locale,\n }).fetchSync();\n\n store.dispatch(\n initModels([\n {\n key: `application(/)(${locale})`,\n model: application,\n },\n ])\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.info(\"Could not load webapplication on server\");\n }\n};\n\n/**\n */\nconst handleErrors = (store: ReduxStore) => {\n const state = store.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\n/**\n */\nconst dehydrate = (store: ReduxStore): string => {\n const state = store.getState();\n\n const modularui: {\n [key: string]: { status: string, lastModification: number, model: ?Object },\n } = {};\n\n for (const key in state.modularui) {\n const { status, model, lastModification } = state.modularui[key];\n\n if (model) {\n modularui[key] = {\n status,\n lastModification,\n model: model.dehydrate(),\n };\n } else {\n modularui[key] = {\n status,\n lastModification,\n model: undefined,\n };\n }\n }\n\n const filteredState = {\n ...state,\n modularui,\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n\n/**\n */\nconst createHead = (\n sheet: any,\n UUID: string,\n helmetContext?: Object\n): Object => {\n const style = sheet.getStyleTags();\n const meta = helmetContext ? [...helmetContext.helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmetContext.helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n\nexport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n createHead,\n handleErrors,\n dehydrate,\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AAEA;AAQA;AAEA;AAEA;AACA;AAEA;AAA6D;AAAA;AAa7D;AACA;AACA,MAAMA,gBAAgB,GAAG,CACvBC,WAAiB,EACjBC,cAAsB,EACtBC,YAAiC,KAClB;EACf;EACA,MAAMC,OAAsB,GAAG,IAAAC,4BAAmB,EAAC;IACjDC,cAAc,EAAE,CAACL,WAAW,CAACM,QAAQ,EAAE;EACzC,CAAC,CAAC;EAEF,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,uBAAc,EAACL,OAAO,EAAEF,cAAc,EAAEC,YAAY,CAAC;EAEvE,OAAOK,KAAK;AACd,CAAC;;AAED;AACA;AADA;AAEA,MAAME,OAAO,GAAG,UACdF,KAAiB,EAGd;EAAA,IAFHG,OAAmC,uEAAG,EAAE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;;AAED;AACA;AADA;AAEA,MAAMG,SAAS,GAAIjE,KAAiB,IAAa;EAC/C,MAAM6D,KAAK,GAAG7D,KAAK,CAACkD,QAAQ,EAAE;EAE9B,MAAMgB,SAEL,GAAG,CAAC,CAAC;EAEN,KAAK,MAAMX,GAAG,IAAIM,KAAK,CAACK,SAAS,EAAE;IACjC,MAAM;MAAEC,MAAM;MAAEX,KAAK;MAAEY;IAAiB,CAAC,GAAGP,KAAK,CAACK,SAAS,CAACX,GAAG,CAAC;IAEhE,IAAIC,KAAK,EAAE;MACTU,SAAS,CAACX,GAAG,CAAC,GAAG;QACfY,MAAM;QACNC,gBAAgB;QAChBZ,KAAK,EAAEA,KAAK,CAACS,SAAS;MACxB,CAAC;IACH,CAAC,MAAM;MACLC,SAAS,CAACX,GAAG,CAAC,GAAG;QACfY,MAAM;QACNC,gBAAgB;QAChBZ,KAAK,EAAEa;MACT,CAAC;IACH;EACF;EAEA,MAAMC,aAAa,GAAG;IACpB,GAAGT,KAAK;IACRK;EACF,CAAC;EAED,OAAO,wBAAeI,aAAa,CAAC,CAACC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC/D,CAAC;;AAED;AACA;AADA;AAEA,MAAMC,UAAU,GAAG,CACjBC,KAAU,EACVC,IAAY,EACZC,aAAsB,KACX;EACX,MAAMC,KAAK,GAAGH,KAAK,CAACI,YAAY,EAAE;EAClC,MAAMC,IAAI,GAAGH,aAAa,GAAG,CAAC,GAAGA,aAAa,CAACI,MAAM,CAACD,IAAI,CAAC,GAAG,EAAE;EAEhE,IAAIH,aAAa,EAAE;IACjB,OAAO;MACL,GAAGA,aAAa,CAACI,MAAM;MACvBH,KAAK;MACLE;IACF,CAAC;EACH;EAEA,OAAO;IACLF,KAAK;IACLE;EACF,CAAC;AACH,CAAC;AAAC"}
1
+ {"version":3,"file":"serverUtil.js","names":["createReduxStore","requestHref","customReducers","initialState","history","createMemoryHistory","initialEntries","toString","store","configureStore","setI18n","locales","request","Array","isArray","IllegalArgumentException","mergedLocales","availableLocales","locale","code","customLocale","custLocale","deepmerge","forEach","some","push","enabledLocales","getSetting","localesInstance","Locales","preferredLocale","getPreferredLocale","dispatch","setLocales","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreference","setServerPreferences","setAllContentInDataSetting","setLoginPreferences","preferencesProvider","isStudioContext","setPreference","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","dataFetcher","fetch","setThemePreference","Error","setApplication","getLocale","getState","application","ModularUIRequest","fetchSync","connectKey","initModels","key","model","e","console","info","handleErrors","state","error","shouldThrowOnServer","has","dehydrate","modularui","status","lastModification","undefined","filteredState","replace","createHead","sheet","UUID","helmetContext","style","getStyleTags","meta","helmet"],"sources":["../../src/react-server/serverUtil.js"],"sourcesContent":["// @flow\nimport { createMemoryHistory } from \"history\";\nimport { has } from \"../utils/helpers/objects\";\nimport deepmerge from \"deepmerge\";\n\nimport configureStore from \"../redux/store/configureStore\";\n\nimport { availableLocales } from \"../i18n/Locales\";\nimport Locales from \"../i18n/Locales\";\n\nimport { getPreferredLocale } from \"./requestInformation\";\nimport { setLocales } from \"../redux/_i18n/I18nActions\";\n\nimport {\n setServerPreference,\n setThemePreference,\n setPreference,\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport { initModels } from \"../redux\";\nimport { getLocale } from \"../redux/selectors/i18n\";\n\nimport ModularUIRequest from \"../modularui/ModularUIRequest\";\n\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { ReduxState, ReduxStore } from \"../redux/types\";\nimport type Href from \"../models/href/Href\";\nimport type { RouterHistory } from \"react-router\";\n\nexport type PreferenceValue = {\n name: string,\n defaultValue?: string | null,\n type?: string,\n};\n\n/**\n */\nconst createReduxStore = (\n requestHref: Href,\n customReducers: Object,\n initialState?: $Shape<ReduxState>\n): ReduxStore => {\n // $FlowExpectedError\n const history: RouterHistory = createMemoryHistory({\n initialEntries: [requestHref.toString()],\n });\n\n const { store } = configureStore(history, customReducers, initialState);\n\n return store;\n};\n\n/**\n */\nconst setI18n = (\n store: ReduxStore,\n locales: Array<LocaleConfiguration> = [],\n request: HttpServletRequestJava\n) => {\n if (!Array.isArray(locales)) {\n throw new IllegalArgumentException(\"locales must be an array of objects\");\n }\n if (!request) {\n throw new IllegalArgumentException(\"missing request argument\");\n }\n\n const mergedLocales = availableLocales.map((locale) => {\n const code = locale.code;\n const customLocale = locales.find((custLocale) => custLocale.code === code);\n\n if (customLocale) {\n return deepmerge(locale, customLocale);\n }\n\n return locale;\n });\n\n locales.forEach((customLocale) => {\n if (!mergedLocales.some((locale) => locale.code === customLocale.code)) {\n mergedLocales.push(customLocale);\n }\n });\n\n const enabledLocales = mergedLocales.filter((locale: LocaleConfiguration) =>\n getSetting(\"ENABLED_LOCALES\").includes(locale.code)\n );\n\n const localesInstance = new Locales(enabledLocales);\n const preferredLocale = getPreferredLocale(request, localesInstance);\n store.dispatch(setLocales(localesInstance, preferredLocale ?? \"en\"));\n};\n\nconst setServerPreferencesFromArray = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n serverPreferences.forEach((serverPreference) => {\n if (typeof serverPreference === \"object\") {\n const { name, defaultValue, type } = serverPreference;\n store.dispatch(setServerPreference(name, defaultValue, type));\n } else {\n store.dispatch(setServerPreference(serverPreference, null));\n }\n });\n};\n\n/**\n * Server preferences can be suplied by an array of preference names,\n * or an array of objects which has the name, an optional default value and an optional type.<br>\n * When the type is set to string, a comma separated value is not converted to an array:\n *\n * @example\n * // value becomes an array [default1, default2]\n * { name: \"prefName\", defaultValue: \"default1, default2\" }\n * // value remains a string \"default1, default2\"\n * { name: \"prefName\", defaultValue: \"default1, default2\", type: \"string\" }\n *\n * @param store\n * @param serverPreferences\n */\nconst setServerPreferences = (\n store: ReduxStore,\n serverPreferences: Array<string | PreferenceValue>\n) => {\n if (Array.isArray(serverPreferences)) {\n setServerPreferencesFromArray(store, serverPreferences);\n }\n\n store.dispatch(setAllContentInDataSetting());\n store.dispatch(setLoginPreferences());\n\n if (\n preferencesProvider &&\n preferencesProvider.isStudioContext &&\n preferencesProvider.isStudioContext()\n ) {\n store.dispatch(setPreference(\"isStudioContext\", true));\n }\n};\n\n/**\n */\nconst setConfigurationTheme = (store: ReduxStore) => {\n let configTheme = null;\n\n const configFileLocation = preferencesProvider.getLayoutConfigFileLocation();\n if (typeof configFileLocation === \"string\") {\n const configFilePath = configFileLocation.startsWith(\"/\")\n ? `/resource${configFileLocation}`\n : `/resource/${configFileLocation}`;\n\n configTheme = dataFetcher.fetch(configFilePath);\n\n if (configTheme) {\n store.dispatch(setThemePreference(configTheme));\n } else {\n throw new Error(\n `Could not read theme configuration file from: ${configFilePath}`\n );\n }\n }\n};\n\n/**\n */\nconst setApplication = (store: ReduxStore) => {\n try {\n const locale = getLocale(store.getState());\n const application = new ModularUIRequest(\"/\", {\n locale: locale,\n }).fetchSync();\n\n application.connectKey = `application(/)(${locale})`;\n\n store.dispatch(\n initModels([\n {\n key: `application(/)(${locale})`,\n model: application,\n },\n ])\n );\n } catch (e) {\n // eslint-disable-next-line no-console\n console.info(\"Could not load webapplication on server\");\n }\n};\n\n/**\n */\nconst handleErrors = (store: ReduxStore) => {\n const state = store.getState();\n\n if (\n state.error &&\n (state.error.shouldThrowOnServer ||\n !has(state.error, \"shouldThrowOnServer\"))\n ) {\n throw state.error;\n }\n};\n\n/**\n */\nconst dehydrate = (store: ReduxStore): string => {\n const state = store.getState();\n\n const modularui: {\n [key: string]: { status: string, lastModification: number, model: ?Object },\n } = {};\n\n for (const key in state.modularui) {\n const { status, model, lastModification } = state.modularui[key];\n\n if (model) {\n modularui[key] = {\n status,\n lastModification,\n model: model.dehydrate(),\n };\n } else {\n modularui[key] = {\n status,\n lastModification,\n model: undefined,\n };\n }\n }\n\n const filteredState = {\n ...state,\n modularui,\n };\n\n return JSON.stringify(filteredState).replace(/</g, \"\\\\u003c\");\n};\n\n/**\n */\nconst createHead = (\n sheet: any,\n UUID: string,\n helmetContext?: Object\n): Object => {\n const style = sheet.getStyleTags();\n const meta = helmetContext ? [...helmetContext.helmet.meta] : [];\n\n if (helmetContext) {\n return {\n ...helmetContext.helmet,\n style,\n meta,\n };\n }\n\n return {\n style,\n meta,\n };\n};\n\nexport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n createHead,\n handleErrors,\n dehydrate,\n};\n"],"mappings":";;;;;;;;;;;;;;;AACA;AACA;AACA;AAEA;AAEA;AAGA;AACA;AAEA;AAQA;AAEA;AAEA;AACA;AAEA;AAA6D;AAAA;AAa7D;AACA;AACA,MAAMA,gBAAgB,GAAG,CACvBC,WAAiB,EACjBC,cAAsB,EACtBC,YAAiC,KAClB;EACf;EACA,MAAMC,OAAsB,GAAG,IAAAC,4BAAmB,EAAC;IACjDC,cAAc,EAAE,CAACL,WAAW,CAACM,QAAQ,EAAE;EACzC,CAAC,CAAC;EAEF,MAAM;IAAEC;EAAM,CAAC,GAAG,IAAAC,uBAAc,EAACL,OAAO,EAAEF,cAAc,EAAEC,YAAY,CAAC;EAEvE,OAAOK,KAAK;AACd,CAAC;;AAED;AACA;AADA;AAEA,MAAME,OAAO,GAAG,UACdF,KAAiB,EAGd;EAAA,IAFHG,OAAmC,uEAAG,EAAE;EAAA,IACxCC,OAA+B;EAE/B,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EAAE;IAC3B,MAAM,IAAII,oCAAwB,CAAC,qCAAqC,CAAC;EAC3E;EACA,IAAI,CAACH,OAAO,EAAE;IACZ,MAAM,IAAIG,oCAAwB,CAAC,0BAA0B,CAAC;EAChE;EAEA,MAAMC,aAAa,GAAG,kBAAAC,yBAAgB,OAAhBA,yBAAgB,EAAMC,MAAM,IAAK;IACrD,MAAMC,IAAI,GAAGD,MAAM,CAACC,IAAI;IACxB,MAAMC,YA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,CAAC;IAEhE,IAAIC,KAAK,EAAE;MACTU,SAAS,CAACX,GAAG,CAAC,GAAG;QACfY,MAAM;QACNC,gBAAgB;QAChBZ,KAAK,EAAEA,KAAK,CAACS,SAAS;MACxB,CAAC;IACH,CAAC,MAAM;MACLC,SAAS,CAACX,GAAG,CAAC,GAAG;QACfY,MAAM;QACNC,gBAAgB;QAChBZ,KAAK,EAAEa;MACT,CAAC;IACH;EACF;EAEA,MAAMC,aAAa,GAAG;IACpB,GAAGT,KAAK;IACRK;EACF,CAAC;EAED,OAAO,wBAAeI,aAAa,CAAC,CAACC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC/D,CAAC;;AAED;AACA;AADA;AAEA,MAAMC,UAAU,GAAG,CACjBC,KAAU,EACVC,IAAY,EACZC,aAAsB,KACX;EACX,MAAMC,KAAK,GAAGH,KAAK,CAACI,YAAY,EAAE;EAClC,MAAMC,IAAI,GAAGH,aAAa,GAAG,CAAC,GAAGA,aAAa,CAACI,MAAM,CAACD,IAAI,CAAC,GAAG,EAAE;EAEhE,IAAIH,aAAa,EAAE;IACjB,OAAO;MACL,GAAGA,aAAa,CAACI,MAAM;MACvBH,KAAK;MACLE;IACF,CAAC;EACH;EAEA,OAAO;IACLF,KAAK;IACLE;EACF,CAAC;AACH,CAAC;AAAC"}
@@ -17,7 +17,7 @@ var _FormModel = _interopRequireDefault(require("../../models/form/FormModel"));
17
17
  const updateValidations = (form, formWithValidations) => (dispatch, getState) => {
18
18
  const currentForm = getState().modularui[form.connectKey];
19
19
  if (currentForm) {
20
- const validatedForm = currentForm.model.clone(true);
20
+ const validatedForm = currentForm.model.clone();
21
21
  if (validatedForm instanceof _FormModel.default) {
22
22
  validatedForm.updateValidations(formWithValidations.data);
23
23
  }
@@ -25,7 +25,7 @@ const updateValidations =
25
25
  const currentForm = getState().modularui[form.connectKey];
26
26
 
27
27
  if (currentForm) {
28
- const validatedForm = currentForm.model.clone(true);
28
+ const validatedForm = currentForm.model.clone();
29
29
  if (validatedForm instanceof FormModel) {
30
30
  validatedForm.updateValidations(formWithValidations.data);
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FormValidations.js","names":["updateValidations","form","formWithValidations","dispatch","getState","currentForm","modularui","connectKey","validatedForm","model","clone","FormModel","data","updateModel","debouncedValidateFormObject","debounce","ModularUIRequest","selfhref","setParameter","method","HTTP_METHODS","POST","validationData","childmodels","isValidationRequest","locale","fetch","then","VALIDATE_DEBOUNCE_TIMEOUT","leading","trailing","validateFormObject"],"sources":["../../../src/redux/actions/FormValidations.js"],"sourcesContent":["// @flow\nimport debounce from \"lodash/debounce\";\n\nimport { updateModel } from \"../_modularui/ModularUIActions\";\n\nimport ModularUIRequest from \"../../modularui/ModularUIRequest\";\n\nimport {\n HTTP_METHODS,\n VALIDATE_DEBOUNCE_TIMEOUT,\n} from \"../../constants/Constants\";\n\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\nimport type { ModularUIModel } from \"../../models\";\n\n/**\n * Update validations of the form currently in the reducer\n * because of the debounce timeout there might have been an update on the form during validation\n */\nconst updateValidations =\n (form: FormModel, formWithValidations: ModularUIModel) =>\n (dispatch: Dispatch, getState: GetState) => {\n const currentForm = getState().modularui[form.connectKey];\n\n if (currentForm) {\n const validatedForm = currentForm.model.clone(true);\n if (validatedForm instanceof FormModel) {\n validatedForm.updateValidations(formWithValidations.data);\n }\n\n dispatch(updateModel(validatedForm));\n }\n };\n\n/**\n * Validates form objects debounced to prevent overloading the (form) service\n * When a form with new errors (or complete) arrives, we send the validations\n * to the current form model where the errors are processed\n * A new form with the new constraints is send to the store\n */\nconst debouncedValidateFormObject = debounce<\n (dispatch: Dispatch, form: FormModel) => void\n>(\n (dispatch, form: FormModel) => {\n new ModularUIRequest(form.selfhref.setParameter(\"commit\", \"false\"), {\n method: HTTP_METHODS.POST,\n data: form.validationData,\n childmodels: false,\n isValidationRequest: true,\n locale: form.locale,\n })\n .fetch()\n .then((formWithValidations) =>\n dispatch(updateValidations(form, formWithValidations))\n );\n },\n VALIDATE_DEBOUNCE_TIMEOUT,\n {\n leading: true,\n trailing: true,\n }\n);\n\n/**\n */\nexport const validateFormObject =\n (form: FormModel): ThunkAction =>\n (dispatch) =>\n debouncedValidateFormObject(dispatch, form);\n"],"mappings":";;;;;;;AACA;AAEA;AAEA;AAEA;AAKA;AAKA;AACA;AACA;AACA;AACA,MAAMA,iBAAiB,GACrB,CAACC,IAAe,EAAEC,mBAAmC,KACrD,CAACC,QAAkB,EAAEC,QAAkB,KAAK;EAC1C,MAAMC,WAAW,GAAGD,QAAQ,EAAE,CAACE,SAAS,CAACL,IAAI,CAACM,UAAU,CAAC;EAEzD,IAAIF,WAAW,EAAE;IACf,MAAMG,aAAa,GAAGH,WAAW,CAACI,KAAK,CAACC,KAAK,CAAC,IAAI,CAAC;IACnD,IAAIF,aAAa,YAAYG,kBAAS,EAAE;MACtCH,aAAa,CAACR,iBAAiB,CAACE,mBAAmB,CAACU,IAAI,CAAC;IAC3D;IAEAT,QAAQ,CAAC,IAAAU,6BAAW,EAACL,aAAa,CAAC,CAAC;EACtC;AACF,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,2BAA2B,GAAG,IAAAC,iBAAQ,EAG1C,CAACZ,QAAQ,EAAEF,IAAe,KAAK;EAC7B,IAAIe,yBAAgB,CAACf,IAAI,CAACgB,QAAQ,CAACC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;IAClEC,MAAM,EAAEC,uBAAY,CAACC,IAAI;IACzBT,IAAI,EAAEX,IAAI,CAACqB,cAAc;IACzBC,WAAW,EAAE,KAAK;IAClBC,mBAAmB,EAAE,IAAI;IACzBC,MAAM,EAAExB,IAAI,CAACwB;EACf,CAAC,CAAC,CACCC,KAAK,EAAE,CACPC,IAAI,CAAEzB,mBAAmB,IACxBC,QAAQ,CAACH,iBAAiB,CAACC,IAAI,EAAEC,mBAAmB,CAAC,CAAC,CACvD;AACL,CAAC,EACD0B,oCAAyB,EACzB;EACEC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;AACZ,CAAC,CACF;;AAED;AACA;AACO,MAAMC,kBAAkB,GAC5B9B,IAAe,IACfE,QAAQ,IACPW,2BAA2B,CAACX,QAAQ,EAAEF,IAAI,CAAC;AAAC"}
1
+ {"version":3,"file":"FormValidations.js","names":["updateValidations","form","formWithValidations","dispatch","getState","currentForm","modularui","connectKey","validatedForm","model","clone","FormModel","data","updateModel","debouncedValidateFormObject","debounce","ModularUIRequest","selfhref","setParameter","method","HTTP_METHODS","POST","validationData","childmodels","isValidationRequest","locale","fetch","then","VALIDATE_DEBOUNCE_TIMEOUT","leading","trailing","validateFormObject"],"sources":["../../../src/redux/actions/FormValidations.js"],"sourcesContent":["// @flow\nimport debounce from \"lodash/debounce\";\n\nimport { updateModel } from \"../_modularui/ModularUIActions\";\n\nimport ModularUIRequest from \"../../modularui/ModularUIRequest\";\n\nimport {\n HTTP_METHODS,\n VALIDATE_DEBOUNCE_TIMEOUT,\n} from \"../../constants/Constants\";\n\nimport FormModel from \"../../models/form/FormModel\";\n\nimport type { Dispatch, GetState, ThunkAction } from \"../types\";\nimport type { ModularUIModel } from \"../../models\";\n\n/**\n * Update validations of the form currently in the reducer\n * because of the debounce timeout there might have been an update on the form during validation\n */\nconst updateValidations =\n (form: FormModel, formWithValidations: ModularUIModel) =>\n (dispatch: Dispatch, getState: GetState) => {\n const currentForm = getState().modularui[form.connectKey];\n\n if (currentForm) {\n const validatedForm = currentForm.model.clone();\n if (validatedForm instanceof FormModel) {\n validatedForm.updateValidations(formWithValidations.data);\n }\n\n dispatch(updateModel(validatedForm));\n }\n };\n\n/**\n * Validates form objects debounced to prevent overloading the (form) service\n * When a form with new errors (or complete) arrives, we send the validations\n * to the current form model where the errors are processed\n * A new form with the new constraints is send to the store\n */\nconst debouncedValidateFormObject = debounce<\n (dispatch: Dispatch, form: FormModel) => void\n>(\n (dispatch, form: FormModel) => {\n new ModularUIRequest(form.selfhref.setParameter(\"commit\", \"false\"), {\n method: HTTP_METHODS.POST,\n data: form.validationData,\n childmodels: false,\n isValidationRequest: true,\n locale: form.locale,\n })\n .fetch()\n .then((formWithValidations) =>\n dispatch(updateValidations(form, formWithValidations))\n );\n },\n VALIDATE_DEBOUNCE_TIMEOUT,\n {\n leading: true,\n trailing: true,\n }\n);\n\n/**\n */\nexport const validateFormObject =\n (form: FormModel): ThunkAction =>\n (dispatch) =>\n debouncedValidateFormObject(dispatch, form);\n"],"mappings":";;;;;;;AACA;AAEA;AAEA;AAEA;AAKA;AAKA;AACA;AACA;AACA;AACA,MAAMA,iBAAiB,GACrB,CAACC,IAAe,EAAEC,mBAAmC,KACrD,CAACC,QAAkB,EAAEC,QAAkB,KAAK;EAC1C,MAAMC,WAAW,GAAGD,QAAQ,EAAE,CAACE,SAAS,CAACL,IAAI,CAACM,UAAU,CAAC;EAEzD,IAAIF,WAAW,EAAE;IACf,MAAMG,aAAa,GAAGH,WAAW,CAACI,KAAK,CAACC,KAAK,EAAE;IAC/C,IAAIF,aAAa,YAAYG,kBAAS,EAAE;MACtCH,aAAa,CAACR,iBAAiB,CAACE,mBAAmB,CAACU,IAAI,CAAC;IAC3D;IAEAT,QAAQ,CAAC,IAAAU,6BAAW,EAACL,aAAa,CAAC,CAAC;EACtC;AACF,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,2BAA2B,GAAG,IAAAC,iBAAQ,EAG1C,CAACZ,QAAQ,EAAEF,IAAe,KAAK;EAC7B,IAAIe,yBAAgB,CAACf,IAAI,CAACgB,QAAQ,CAACC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE;IAClEC,MAAM,EAAEC,uBAAY,CAACC,IAAI;IACzBT,IAAI,EAAEX,IAAI,CAACqB,cAAc;IACzBC,WAAW,EAAE,KAAK;IAClBC,mBAAmB,EAAE,IAAI;IACzBC,MAAM,EAAExB,IAAI,CAACwB;EACf,CAAC,CAAC,CACCC,KAAK,EAAE,CACPC,IAAI,CAAEzB,mBAAmB,IACxBC,QAAQ,CAACH,iBAAiB,CAACC,IAAI,EAAEC,mBAAmB,CAAC,CAAC,CACvD;AACL,CAAC,EACD0B,oCAAyB,EACzB;EACEC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE;AACZ,CAAC,CACF;;AAED;AACA;AACO,MAAMC,kBAAkB,GAC5B9B,IAAe,IACfE,QAAQ,IACPW,2BAA2B,CAACX,QAAQ,EAAEF,IAAI,CAAC;AAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.27.1",
3
+ "version": "1.27.3",
4
4
  "description": "Toolbox for be informed javascript layouts",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "bugs": "http://support.beinformed.com",
@@ -85,7 +85,7 @@
85
85
  "@babel/runtime-corejs3": "^7.20.13",
86
86
  "big.js": "^6.2.1",
87
87
  "date-fns": "^2.29.3",
88
- "deepmerge": "^4.2.2",
88
+ "deepmerge": "^4.3.0",
89
89
  "dequal": "^2.0.3",
90
90
  "element-closest": "^3.0.2",
91
91
  "file-size": "^1.0.0",
@@ -94,6 +94,7 @@
94
94
  "he": "^1.2.0",
95
95
  "iban": "^0.0.14",
96
96
  "js-cookie": "^3.0.1",
97
+ "klona": "^2.0.6",
97
98
  "lodash": "^4.17.21",
98
99
  "reselect": "^4.1.7",
99
100
  "setimmediate": "^1.0.5"
@@ -113,29 +114,29 @@
113
114
  "@commitlint/config-conventional": "^17.4.2",
114
115
  "@testing-library/react": "^13.4.0",
115
116
  "auditjs": "^4.0.39",
116
- "babel-jest": "^29.4.0",
117
+ "babel-jest": "^29.4.1",
117
118
  "babel-plugin-styled-components": "^2.0.7",
118
119
  "cherry-pick": "^0.5.0",
119
120
  "cross-env": "^7.0.3",
120
121
  "documentation": "^14.0.1",
121
- "eslint": "^8.32.0",
122
+ "eslint": "^8.33.0",
122
123
  "eslint-config-prettier": "^8.6.0",
123
124
  "eslint-plugin-babel": "^5.3.1",
124
125
  "eslint-plugin-ft-flow": "^2.0.3",
125
126
  "eslint-plugin-import": "^2.27.5",
126
127
  "eslint-plugin-jest": "^27.2.1",
127
- "eslint-plugin-jsdoc": "^39.6.8",
128
- "eslint-plugin-react": "^7.32.1",
128
+ "eslint-plugin-jsdoc": "^39.8.0",
129
+ "eslint-plugin-react": "^7.32.2",
129
130
  "eslint-plugin-react-hooks": "^4.5.0",
130
131
  "eslint-plugin-you-dont-need-lodash-underscore": "^6.12.0",
131
- "flow-bin": "^0.198.1",
132
+ "flow-bin": "^0.199.1",
132
133
  "flow-copy-source": "^2.0.9",
133
134
  "flow-typed": "^3.8.0",
134
135
  "glob": "^8.1.0",
135
136
  "history": "^4.0.0",
136
137
  "husky": "^8.0.3",
137
- "jest": "^29.4.0",
138
- "jest-environment-jsdom": "^29.4.0",
138
+ "jest": "^29.4.1",
139
+ "jest-environment-jsdom": "^29.4.1",
139
140
  "jest-junit": "^15.0.0",
140
141
  "jest-sonar-reporter": "^2.0.0",
141
142
  "jscodeshift": "^0.14.0",
@@ -148,7 +149,7 @@
148
149
  "react-redux": "^8.0.5",
149
150
  "react-router": "^5.0.0",
150
151
  "react-test-renderer": "^18.1.0",
151
- "redux": "^4.0.0",
152
+ "redux": "^4.2.1",
152
153
  "redux-mock-store": "^1.5.4",
153
154
  "redux-thunk": "^2.4.2",
154
155
  "rimraf": "^4.1.2",
@@ -156,6 +156,11 @@ export const ATTRIBUTE_WIDTH = {
156
156
 
157
157
  export const ALL_CONTENT_IN_DATA_SETTING = "hasAllContentInData";
158
158
 
159
+ export const INTERNAL_LOGIN_TYPE = {
160
+ JAAS: "JAAS",
161
+ PAC4J_FORM: "PAC4J_FORM",
162
+ PAC4J_BASIC: "PAC4J_BASIC",
163
+ };
159
164
  export const LOGIN_TYPE = "security.clients";
160
165
  export const LOGIN_PATH_SETTING = "FormClient.login_url";
161
166
  export const LOGIN_USERNAME_SETTING = "FormClient.username_field_name";
@@ -3,6 +3,7 @@ import { isPlainObject, has } from "../utils/helpers/objects";
3
3
  import { getRepositoryResourceUrl } from "../utils/helpers/repositoryResource";
4
4
  import {
5
5
  ALL_CONTENT_IN_DATA_SETTING,
6
+ INTERNAL_LOGIN_TYPE,
6
7
  LOGIN_TYPE,
7
8
  LOGIN_PATH_SETTING,
8
9
  LOGIN_USERNAME_SETTING,
@@ -186,13 +187,16 @@ export const hasAllContentInData = (): boolean =>
186
187
 
187
188
  /**
188
189
  * Login type, only available when pac4j is configured
190
+ *
191
+ * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS
189
192
  */
190
- export const loginType = (): string => getSetting(LOGIN_TYPE, "JAAS");
193
+ export const loginType = (): string =>
194
+ getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);
191
195
 
192
196
  /**
193
197
  */
194
198
  export const loginPath = (): string =>
195
- getSetting(LOGIN_PATH_SETTING, "/j_security_check");
199
+ getSetting(LOGIN_PATH_SETTING, "/callback?client_name=FormClient");
196
200
  /**
197
201
  */
198
202
  export const loginUsernameField = (): string =>
@@ -204,7 +208,7 @@ export const loginPasswordField = (): string =>
204
208
  /**
205
209
  */
206
210
  export const logoutPath = (): string =>
207
- getSetting(LOGOUT_PATH_SETTING, "/Logoff");
211
+ getSetting(LOGOUT_PATH_SETTING, "/logout");
208
212
 
209
213
  export const LOGIN_PATH: string = loginPath();
210
214
  export const LOGOUT_PATH: string = logoutPath();
@@ -80,12 +80,17 @@ export default class ApplicationModel extends ResourceModel {
80
80
  DEFAULT_AUTHENTICATION_TYPE,
81
81
  ]);
82
82
 
83
- //put primary first
84
- return authenticationTypes?.sort(
85
- (a: AuthenticationType, b: AuthenticationType) =>
86
- a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1
87
- );
83
+ if (authenticationTypes) {
84
+ //put primary first
85
+ return authenticationTypes?.sort(
86
+ (a: AuthenticationType, b: AuthenticationType) =>
87
+ a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1
88
+ );
89
+ }
90
+
91
+ return [DEFAULT_AUTHENTICATION_TYPE];
88
92
  }
93
+
89
94
  /**
90
95
  * Getting the tab links
91
96
  */
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import cloneDeep from "lodash/cloneDeep";
2
+ import { klona } from "klona/full";
3
3
  import pick from "lodash/pick";
4
4
 
5
5
  import { has, isPlainObject } from "../../utils/helpers/objects";
@@ -33,7 +33,7 @@ class AttributeDataHelper {
33
33
  ) || {};
34
34
  this._value = this.getValue(this._attribute);
35
35
  } else {
36
- const attributeData = cloneDeep(data);
36
+ const attributeData = klona(data);
37
37
  attributeData._links = pick(data._links, [
38
38
  "concept",
39
39
  "download",
@@ -130,6 +130,9 @@ describe("choiceAttributeModel", () => {
130
130
  expect(attribute.format).toBeNull();
131
131
 
132
132
  expect(attribute.options).toHaveLength(4);
133
+
134
+ const clonedAttribute = attribute.clone();
135
+ expect(clonedAttribute).toStrictEqual(attribute);
133
136
  });
134
137
 
135
138
  it("handles sort-options hint", () => {
@@ -202,6 +202,9 @@ describe("compositeAttributeModel", () => {
202
202
  PrintingHouse: "Printers united",
203
203
  Title: "Matilda",
204
204
  });
205
+
206
+ const clonedAttribute = attribute.clone();
207
+ expect(clonedAttribute).toStrictEqual(attribute);
205
208
  });
206
209
 
207
210
  it("creates a composite attribute for a choice attribute with a table codemap on a list, multiple choice", () => {
@@ -1,5 +1,5 @@
1
1
  // @flow
2
- import cloneDeep from "lodash/cloneDeep";
2
+ import { klona } from "klona/full";
3
3
 
4
4
  import { has, isPlainObject } from "../../utils/helpers/objects";
5
5
 
@@ -105,7 +105,7 @@ const updateData = (
105
105
  data: Object,
106
106
  contributions: Object
107
107
  ): Object => {
108
- const newData = cloneDeep(data);
108
+ const newData = klona(data);
109
109
 
110
110
  if (contributions.dynamicschemaId) {
111
111
  newData.dynamicschemaId = contributions.dynamicschemaId;
@@ -1,6 +1,5 @@
1
1
  // @flow
2
- import clone from "lodash/clone";
3
- import cloneDeep from "lodash/cloneDeep";
2
+ import { klona } from "klona/full";
4
3
 
5
4
  /**
6
5
  * Base class for collections of models
@@ -182,15 +181,10 @@ class BaseCollection<T> {
182
181
  }
183
182
 
184
183
  /**
185
- * Returns a clone of the model (this is not a deep copy)
184
+ * Returns a clone of the model
186
185
  */
187
- clone(deepcopy: boolean = false): this {
188
- // deepcopy can be expensive, use with care!
189
- if (deepcopy) {
190
- return cloneDeep(this);
191
- }
192
-
193
- return clone(this);
186
+ clone(): this {
187
+ return klona(this);
194
188
  }
195
189
  }
196
190
 
@@ -1,6 +1,5 @@
1
1
  // @flow
2
- import clone from "lodash/clone";
3
- import cloneDeep from "lodash/cloneDeep";
2
+ import { klona } from "klona/full";
4
3
 
5
4
  import LayoutHintCollection from "../layouthint/LayoutHintCollection";
6
5
 
@@ -118,13 +117,8 @@ class BaseModel {
118
117
  /**
119
118
  * Returns a clone of the model
120
119
  */
121
- clone(deepcopy: boolean = false): any {
122
- // deepcopy can be expensive, use with care!
123
- if (deepcopy) {
124
- return cloneDeep(this);
125
- }
126
-
127
- return clone(this);
120
+ clone(): any {
121
+ return klona(this);
128
122
  }
129
123
  }
130
124
 
@@ -11,7 +11,8 @@ describe("baseModel", () => {
11
11
  expect(model.contributions).toStrictEqual({});
12
12
  expect(model.hasData).toBeFalsy();
13
13
 
14
- expect(model.clone()).toStrictEqual(model);
14
+ const clonedModel = model.clone();
15
+ expect(clonedModel).toStrictEqual(model);
15
16
  });
16
17
 
17
18
  it("should handle data without contributions", () => {
@@ -72,12 +73,7 @@ describe("baseModel", () => {
72
73
  },
73
74
  });
74
75
 
75
- const shallowClone = model.clone();
76
- expect(model).not.toBe(shallowClone);
77
- expect(model.data.prop).toBe(shallowClone.data.prop);
78
- expect(model.data.prop.child).toBe(shallowClone.data.prop.child);
79
-
80
- const deepClone = model.clone(true);
76
+ const deepClone = model.clone();
81
77
  expect(model).not.toBe(deepClone);
82
78
  expect(model.data.prop === deepClone.data.prop).toBeFalsy();
83
79
  expect(model.data.prop.child).toBe(deepClone.data.prop.child);
@@ -6,6 +6,7 @@ import Cache from "../utils/browser/Cache";
6
6
 
7
7
  import { UnauthorizedException } from "../exceptions";
8
8
  import {
9
+ INTERNAL_LOGIN_TYPE,
9
10
  loginType,
10
11
  loginPath,
11
12
  loginPasswordField,
@@ -27,16 +28,17 @@ class Authenticate {
27
28
 
28
29
  /**
29
30
  */
30
- get authenticationType(): "JAAS" | "PAC4J_FORM" | "PAC4J_BASIC" {
31
+ get authenticationType(): $Keys<typeof INTERNAL_LOGIN_TYPE> {
31
32
  const type = loginType();
32
33
 
33
- if (!type || type === "JAAS") {
34
- return "JAAS";
34
+ if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {
35
+ return INTERNAL_LOGIN_TYPE.JAAS;
35
36
  }
37
+
36
38
  if (type.includes("FormClient")) {
37
- return "PAC4J_FORM";
39
+ return INTERNAL_LOGIN_TYPE.PAC4J_FORM;
38
40
  } else if (type.includes("BasicClient")) {
39
- return "PAC4J_BASIC";
41
+ return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;
40
42
  }
41
43
 
42
44
  throw new Error(`Unsupported login type found: ${type}`);
@@ -45,7 +47,10 @@ class Authenticate {
45
47
  /**
46
48
  */
47
49
  get isBasicAuthentication(): boolean {
48
- return this._isBasic || this.authenticationType === "PAC4J_BASIC";
50
+ return (
51
+ this._isBasic ||
52
+ this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC
53
+ );
49
54
  }
50
55
 
51
56
  /**
@@ -90,9 +95,9 @@ class Authenticate {
90
95
  */
91
96
  login(username: string, password: string): Promise<any> {
92
97
  switch (this.authenticationType) {
93
- case "PAC4J_FORM":
98
+ case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
94
99
  return this.doFormLogin(username, password);
95
- case "PAC4J_BASIC":
100
+ case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
96
101
  return this.doBasicAuthentication(username, password);
97
102
  default:
98
103
  return this.doJaasAuthentication(username, password);
@@ -103,8 +108,8 @@ class Authenticate {
103
108
  */
104
109
  getFormLoginUrl(): string {
105
110
  switch (this.authenticationType) {
106
- case "PAC4J_BASIC":
107
- case "PAC4J_FORM":
111
+ case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
112
+ case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
108
113
  return `${getBasePath()}${loginPath()}`;
109
114
  default:
110
115
  return `${getBasePath()}/j_security_check`;
@@ -118,8 +123,8 @@ class Authenticate {
118
123
  const encodedPassword = encodeURIComponent(password);
119
124
 
120
125
  switch (this.authenticationType) {
121
- case "PAC4J_BASIC":
122
- case "PAC4J_FORM":
126
+ case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
127
+ case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
123
128
  return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;
124
129
  default:
125
130
  return `j_username=${encodedUsername}&j_password=${encodedPassword}`;
@@ -158,11 +163,23 @@ class Authenticate {
158
163
  });
159
164
  }
160
165
 
166
+ /**
167
+ */
168
+ getLogoutUrl(): string {
169
+ switch (this.authenticationType) {
170
+ case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
171
+ case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
172
+ return `${getBasePath()}${logoutPath()}`;
173
+ default:
174
+ return `${getBasePath()}/Logoff`;
175
+ }
176
+ }
177
+
161
178
  /**
162
179
  */
163
180
  logout(): Promise<any> {
164
181
  return universalFetch({
165
- url: `${getBasePath()}${logoutPath()}`,
182
+ url: this.getLogoutUrl(),
166
183
  }).then((response) => {
167
184
  // clear cache because of cached contributions
168
185
  Cache.clear();
@@ -12,6 +12,7 @@ export type Props = {
12
12
  +error: Error,
13
13
  };
14
14
 
15
+ // $FlowFixMe
15
16
  const StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`
16
17
  padding: ${spacers(2, 1)};
17
18
  margin-bottom: ${spacer(2)};
@@ -19,6 +20,7 @@ const StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`
19
20
  border-radius: 0.3em;
20
21
  `;
21
22
 
23
+ // $FlowFixMe
22
24
  const StyledStack = styled.pre`
23
25
  display: block;
24
26
  font-size: 87.5%;
@@ -176,6 +176,8 @@ const setApplication = (store: ReduxStore) => {
176
176
  locale: locale,
177
177
  }).fetchSync();
178
178
 
179
+ application.connectKey = `application(/)(${locale})`;
180
+
179
181
  store.dispatch(
180
182
  initModels([
181
183
  {
@@ -25,7 +25,7 @@ const updateValidations =
25
25
  const currentForm = getState().modularui[form.connectKey];
26
26
 
27
27
  if (currentForm) {
28
- const validatedForm = currentForm.model.clone(true);
28
+ const validatedForm = currentForm.model.clone();
29
29
  if (validatedForm instanceof FormModel) {
30
30
  validatedForm.updateValidations(formWithValidations.data);
31
31
  }
@@ -128,6 +128,11 @@ export namespace ATTRIBUTE_WIDTH {
128
128
  const EXTRA_LARGE: string;
129
129
  }
130
130
  export const ALL_CONTENT_IN_DATA_SETTING: "hasAllContentInData";
131
+ export namespace INTERNAL_LOGIN_TYPE {
132
+ const JAAS: string;
133
+ const PAC4J_FORM: string;
134
+ const PAC4J_BASIC: string;
135
+ }
131
136
  export const LOGIN_TYPE: "security.clients";
132
137
  export const LOGIN_PATH_SETTING: "FormClient.login_url";
133
138
  export const LOGIN_USERNAME_SETTING: "FormClient.username_field_name";
@@ -83,7 +83,7 @@ declare class BaseCollection<T> {
83
83
  */
84
84
  get sorted(): T[];
85
85
  /**
86
- * Returns a clone of the model (this is not a deep copy)
86
+ * Returns a clone of the model
87
87
  */
88
- clone(deepcopy?: boolean): this;
88
+ clone(): this;
89
89
  }
@@ -62,6 +62,6 @@ declare class BaseModel {
62
62
  /**
63
63
  * Returns a clone of the model
64
64
  */
65
- clone(deepcopy?: boolean): any;
65
+ clone(): any;
66
66
  }
67
67
  import LayoutHintCollection from "../layouthint/LayoutHintCollection";
@@ -5,7 +5,11 @@ declare class Authenticate {
5
5
  _isBasic: boolean;
6
6
  /**
7
7
  */
8
- get authenticationType(): "JAAS" | "PAC4J_FORM" | "PAC4J_BASIC";
8
+ get authenticationType(): $Keys<{
9
+ JAAS: string;
10
+ PAC4J_FORM: string;
11
+ PAC4J_BASIC: string;
12
+ }>;
9
13
  /**
10
14
  */
11
15
  set isBasicAuthentication(arg: boolean);
@@ -36,6 +40,9 @@ declare class Authenticate {
36
40
  /**
37
41
  */
38
42
  doJaasAuthentication(username: string, password: string): Promise<any>;
43
+ /**
44
+ */
45
+ getLogoutUrl(): string;
39
46
  /**
40
47
  */
41
48
  logout(): Promise<any>;