@beinformed/ui 1.28.1 → 1.28.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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
4
4
 
5
+ ## [1.28.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.28.2...v1.28.3) (2023-02-21)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **pac4j:** set pac4j as default in preferences ([ceb714b](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/ceb714bedf3282cc0a2de25eb1d6cdc87f142168))
10
+
11
+ ## [1.28.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.28.1...v1.28.2) (2023-02-20)
12
+
13
+ ### Bug Fixes
14
+
15
+ - **export:** make all parts of react-client importable ([7d571e1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/7d571e1b350fda26e546ea67a0ee633e7d8d8f1d))
16
+
5
17
  ## [1.28.1](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.28.0...v1.28.1) (2023-02-20)
6
18
 
7
19
  ### Bug Fixes
@@ -6,7 +6,7 @@ import ErrorBoundary from "../react/ErrorBoundary";
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  /**
8
8
  */
9
- const Init = _ref => {
9
+ export const Init = _ref => {
10
10
  let {
11
11
  store,
12
12
  routerHistory,
@@ -33,5 +33,4 @@ const Init = _ref => {
33
33
  });
34
34
  };
35
35
  Init.displayName = "BI.Init";
36
- export default Init;
37
36
  //# sourceMappingURL=Init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Init.js","names":["Provider","HelmetProvider","Router","ThemeProvider","ErrorBoundary","Init","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\nexport type Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nconst Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\n\nInit.displayName = \"BI.Init\";\n\nexport default Init;\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAAC;AAiBnD;AACA;AACA,MAAMC,IAAI,GAAG;EAAA,IAAC;IACZC,KAAK;IACLC,aAAa;IACbC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC;EACK,CAAC;EAAA,oBACN,KAAC,QAAQ;IAAC,KAAK,EAAEL,KAAM;IAAA,uBACrB,KAAC,aAAa;MAAC,KAAK,EAAEG,KAAM;MAAA,uBAC1B,KAAC,cAAc;QAAA,uBACb,KAAC,aAAa;UAAC,iBAAiB,EAAEE,sBAAuB;UAAA,uBACvD,KAAC,MAAM;YAAC,OAAO,EAAEJ,aAAc;YAAC,QAAQ,EAAEC,WAAY;YAAA,UACnDE;UAAQ;QACF;MACK;IACD;EACH,EACP;AAAA,CACZ;AAEDL,IAAI,CAACO,WAAW,GAAG,SAAS;AAE5B,eAAeP,IAAI"}
1
+ {"version":3,"file":"Init.js","names":["Provider","HelmetProvider","Router","ThemeProvider","ErrorBoundary","Init","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nexport const Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\nInit.displayName = \"BI.Init\";\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AACtC,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,MAAM,QAAQ,cAAc;AAErC,OAAOC,aAAa,MAAM,8BAA8B;AACxD,OAAOC,aAAa,MAAM,wBAAwB;AAAC;AAiBnD;AACA;AACA,OAAO,MAAMC,IAAI,GAAG;EAAA,IAAC;IACnBC,KAAK;IACLC,aAAa;IACbC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC;EACK,CAAC;EAAA,oBACN,KAAC,QAAQ;IAAC,KAAK,EAAEL,KAAM;IAAA,uBACrB,KAAC,aAAa;MAAC,KAAK,EAAEG,KAAM;MAAA,uBAC1B,KAAC,cAAc;QAAA,uBACb,KAAC,aAAa;UAAC,iBAAiB,EAAEE,sBAAuB;UAAA,uBACvD,KAAC,MAAM;YAAC,OAAO,EAAEJ,aAAc;YAAC,QAAQ,EAAEC,WAAY;YAAA,UACnDE;UAAQ;QACF;MACK;IACD;EACH,EACP;AAAA,CACZ;AACDL,IAAI,CAACO,WAAW,GAAG,SAAS"}
@@ -13,7 +13,7 @@ import { handleError } from "../redux/actions/Error";
13
13
  import { loginSuccess } from "../redux/actions/SignIn";
14
14
  import { locationChange } from "../redux/_router/RouterActions";
15
15
  import { JsonParseException, FetchException } from "../exceptions";
16
- import Init from "./Init";
16
+ import { Init } from "./Init";
17
17
  import { handleBeforeRenderHooks } from "../redux/store/beforeRenderHooks";
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  /*
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["hydrate","render","has","setImmediate","Cache","createBrowserHistory","configureStore","rehydrate","getBasePath","setAllContentInDataSetting","setLoginPreferences","showXHRErrorNotification","handleError","loginSuccess","locationChange","JsonParseException","FetchException","Init","handleBeforeRenderHooks","parseDataToJSON","data","JSON","parse","error","getDataFromServer","dataElement","document","querySelector","Error","textContent","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","errorMessage","reason","message","toString","dispatch","setupClient","customReducers","beforeRenderHooks","contextPath","clear","browserHistory","basename","routerHistory","getState","loadOtherBrowserTabs","getItem","response","listen","location","action","body","className","addContentLoadedEvent","theme","ErrorFallbackComponent","mount","addEventListener","applicationNode","mountClient","initComponent","isSSR","client"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\nimport { hydrate, render } from \"react-dom\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport { getBasePath } from \"../constants/Settings\";\n\nimport {\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\n\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\n\nimport { locationChange } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport Init from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type {\n ComponentType,\n Element as ReactElement,\n ElementType,\n} from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\nexport type Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: Function,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\nconst getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]'\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return {};\n }\n\n return parseDataToJSON(dataElement.textContent);\n};\n\n/**\n */\nexport const setUnhandledRejectionEvent = (store: ReduxStore) => {\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n};\n\n/**\n */\nexport const setupClient = (\n customReducers: CustomReducers = {},\n beforeRenderHooks: ?Array<BeforeRenderHook>\n): { store: ReduxStore, routerHistory: RouterHistory } => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const data = getDataFromServer();\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: getBasePath(),\n });\n const { routerHistory, store } = configureStore(\n browserHistory,\n customReducers,\n rehydrate(data)\n );\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data?.error?.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n routerHistory.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n setUnhandledRejectionEvent(store);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store });\n }\n\n return { store, routerHistory };\n};\n\n/**\n */\nexport const addContentLoadedEvent = (\n store: ReduxStore,\n routerHistory: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: Function,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n mount: Function\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\"\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={routerHistory}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>\n );\n });\n};\n\n/**\n */\nconst mountClient = (\n applicationNode: Element,\n initComponent: ReactElement<ElementType>\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrate(initComponent, applicationNode);\n } else {\n render(initComponent, applicationNode);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n}: Props) => {\n const { store, routerHistory } = setupClient(\n customReducers,\n beforeRenderHooks\n );\n\n addContentLoadedEvent(\n store,\n routerHistory,\n theme,\n render,\n ErrorFallbackComponent,\n mountClient\n );\n};\n"],"mappings":";AACA,SAASA,OAAO,EAAEC,MAAM,QAAQ,WAAW;AAE3C,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,YAAY,MAAM,cAAc;AAEvC,OAAOC,KAAK,MAAM,wBAAwB;AAE1C,SAASC,oBAAoB,QAAQ,SAAS;AAC9C,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,WAAW,QAAQ,uBAAuB;AAEnD,SACEC,0BAA0B,EAC1BC,mBAAmB,QACd,8BAA8B;AACrC,SAASC,wBAAwB,QAAQ,+BAA+B;AAExE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,cAAc,QAAQ,gCAAgC;AAE/D,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,eAAe;AAElE,OAAOC,IAAI,MAAM,QAAQ;AAEzB,SAASC,uBAAuB,QAAQ,kCAAkC;AAAC;AAqB3E;AACA;AACA;AACA,MAAMC,eAAe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,GAAGP,WAAW,CAC1CC,cAAc,EACdC,iBAAiB,CAClB;EAEDe,qBAAqB,CACnB3B,KAAK,EACLiB,aAAa,EACbW,KAAK,EACL1D,MAAM,EACN2D,sBAAsB,EACtBI,WAAW,CACZ;AACH,CAAC"}
1
+ {"version":3,"file":"client.js","names":["hydrate","render","has","setImmediate","Cache","createBrowserHistory","configureStore","rehydrate","getBasePath","setAllContentInDataSetting","setLoginPreferences","showXHRErrorNotification","handleError","loginSuccess","locationChange","JsonParseException","FetchException","Init","handleBeforeRenderHooks","parseDataToJSON","data","JSON","parse","error","getDataFromServer","dataElement","document","querySelector","Error","textContent","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","errorMessage","reason","message","toString","dispatch","setupClient","customReducers","beforeRenderHooks","contextPath","clear","browserHistory","basename","routerHistory","getState","loadOtherBrowserTabs","getItem","response","listen","location","action","body","className","addContentLoadedEvent","theme","ErrorFallbackComponent","mount","addEventListener","applicationNode","mountClient","initComponent","isSSR","client"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\nimport { hydrate, render } from \"react-dom\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport { getBasePath } from \"../constants/Settings\";\n\nimport {\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\n\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\n\nimport { locationChange } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport { Init } from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type {\n ComponentType,\n Element as ReactElement,\n ElementType,\n} from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: Function,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\nconst getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]'\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return {};\n }\n\n return parseDataToJSON(dataElement.textContent);\n};\n\n/**\n */\nexport const setUnhandledRejectionEvent = (store: ReduxStore) => {\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n};\n\n/**\n */\nexport const setupClient = (\n customReducers: CustomReducers = {},\n beforeRenderHooks: ?Array<BeforeRenderHook>\n): { store: ReduxStore, routerHistory: RouterHistory } => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const data = getDataFromServer();\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: getBasePath(),\n });\n const { routerHistory, store } = configureStore(\n browserHistory,\n customReducers,\n rehydrate(data)\n );\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data?.error?.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n routerHistory.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n setUnhandledRejectionEvent(store);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store });\n }\n\n return { store, routerHistory };\n};\n\n/**\n */\nexport const addContentLoadedEvent = (\n store: ReduxStore,\n routerHistory: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: Function,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n mount: Function\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\"\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={routerHistory}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>\n );\n });\n};\n\n/**\n */\nconst mountClient = (\n applicationNode: Element,\n initComponent: ReactElement<ElementType>\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrate(initComponent, applicationNode);\n } else {\n render(initComponent, applicationNode);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n}: Props) => {\n const { store, routerHistory } = setupClient(\n customReducers,\n beforeRenderHooks\n );\n\n addContentLoadedEvent(\n store,\n routerHistory,\n theme,\n render,\n ErrorFallbackComponent,\n mountClient\n );\n};\n"],"mappings":";AACA,SAASA,OAAO,EAAEC,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M,CAACY,WAAY;MAChC,KAAK,EAAEe,KAAM;MACb,sBAAsB,EAAEC,sBAAuB;MAAA,UAE9C3D,MAAM;IAAE,EACJ,CACR;EACH,CAAC,CAAC;AACJ,CAAC;;AAED;AACA;AACA,MAAM+D,WAAW,GAAG,CAClBD,eAAwB,EACxBE,aAAwC,KACrC;EACH,MAAMC,KAAK,GAAGH,eAAe,CAACpC,aAAa,CAAC,cAAc,CAAC;EAC3D,IAAIuC,KAAK,EAAE;IACTlE,OAAO,CAACiE,aAAa,EAAEF,eAAe,CAAC;EACzC,CAAC,MAAM;IACL9D,MAAM,CAACgE,aAAa,EAAEF,eAAe,CAAC;EACxC;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMI,MAAM,GAAG,QAMT;EAAA,IANU;IACrBzB,cAAc;IACdiB,KAAK;IACL1D,MAAM;IACN0C,iBAAiB;IACjBiB;EACK,CAAC;EACN,MAAM;IAAE7B,KAAK;IAAEiB;EAAc,CAAC,GAAGP,WAAW,CAC1CC,cAAc,EACdC,iBAAiB,CAClB;EAEDe,qBAAqB,CACnB3B,KAAK,EACLiB,aAAa,EACbW,KAAK,EACL1D,MAAM,EACN2D,sBAAsB,EACtBI,WAAW,CACZ;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- export { setCustomErrorResponseHandler } from "../redux/actions/Error";
2
- export { default as Init } from "./Init";
3
1
  export * from "./client";
2
+ export * from "./Init";
3
+ export * from "../redux/actions/Error";
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["setCustomErrorResponseHandler","default","Init"],"sources":["../../src/react-client/index.js"],"sourcesContent":["// @flow\nexport { setCustomErrorResponseHandler } from \"../redux/actions/Error\";\n\nexport { default as Init } from \"./Init\";\n\nexport * from \"./client\";\n"],"mappings":"AACA,SAASA,6BAA6B,QAAQ,wBAAwB;AAEtE,SAASC,OAAO,IAAIC,IAAI,QAAQ,QAAQ;AAExC,cAAc,UAAU"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/react-client/index.js"],"sourcesContent":["// @flow\nexport * from \"./client\";\nexport * from \"./Init\";\nexport * from \"../redux/actions/Error\";\n"],"mappings":"AACA,cAAc,UAAU;AACxB,cAAc,QAAQ;AACtB,cAAc,wBAAwB"}
@@ -90,10 +90,10 @@ export const setAllContentInDataSetting = state => {
90
90
  export const setLoginPreferences = state => {
91
91
  const loginSettings = {
92
92
  [LOGIN_TYPE]: getServerPreferenceValue(LOGIN_TYPE, state?.preferences[LOGIN_TYPE]),
93
- [LOGIN_PATH_SETTING]: getServerPreferenceValue(LOGIN_PATH_SETTING, state?.preferences[LOGIN_PATH_SETTING] ?? `/j_security_check`),
93
+ [LOGIN_PATH_SETTING]: getServerPreferenceValue(LOGIN_PATH_SETTING, state?.preferences[LOGIN_PATH_SETTING] ?? `/callback?client_name=FormClient`),
94
94
  [LOGIN_USERNAME_SETTING]: getServerPreferenceValue(LOGIN_USERNAME_SETTING, state?.preferences[LOGIN_USERNAME_SETTING] ?? "j_username"),
95
95
  [LOGIN_PASSWORD_SETTING]: getServerPreferenceValue(LOGIN_PASSWORD_SETTING, state?.preferences[LOGIN_PASSWORD_SETTING] ?? "j_password"),
96
- [LOGOUT_PATH_SETTING]: getServerPreferenceValue(LOGOUT_PATH_SETTING, state?.preferences[LOGOUT_PATH_SETTING] ?? `/Logoff`)
96
+ [LOGOUT_PATH_SETTING]: getServerPreferenceValue(LOGOUT_PATH_SETTING, state?.preferences[LOGOUT_PATH_SETTING] ?? `/logout`)
97
97
  };
98
98
  setSettings(loginSettings);
99
99
  return setPreferences(loginSettings);
@@ -1 +1 @@
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: PreferenceValue = 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: PreferenceValue = 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"],"m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H,KAAkB,IACO;EACzB,MAAMI,aAAa,GAAG;IACpB,CAACjC,UAAU,GAAGK,wBAAwB,CACpCL,UAAU,EACV6B,KAAK,EAAET,WAAW,CAACpB,UAAU,CAAC,CAC/B;IACD,CAACE,kBAAkB,GAAGG,wBAAwB,CAC5CH,kBAAkB,EAClB2B,KAAK,EAAET,WAAW,CAAClB,kBAAkB,CAAC,IAAK,mBAAkB,CAC9D;IACD,CAACC,sBAAsB,GAAGE,wBAAwB,CAChDF,sBAAsB,EACtB0B,KAAK,EAAET,WAAW,CAACjB,sBAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACF,sBAAsB,GAAGI,wBAAwB,CAChDJ,sBAAsB,EACtB4B,KAAK,EAAET,WAAW,CAACnB,sBAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACG,mBAAmB,GAAGC,wBAAwB,CAC7CD,mBAAmB,EACnByB,KAAK,EAAET,WAAW,CAAChB,mBAAmB,CAAC,IAAK,SAAQ;EAExD,CAAC;EAEDN,WAAW,CAACmC,aAAa,CAAC;EAC1B,OAAOd,cAAc,CAACc,aAAa,CAAC;AACtC,CAAC"}
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: PreferenceValue = 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: PreferenceValue = 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] ??\n `/callback?client_name=FormClient`\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] ?? `/logout`\n ),\n };\n\n setSettings(loginSettings);\n return setPreferences(loginSettings);\n};\n"],"mappings":";;;AACA,SAASA,aAAa,QAAQ,6BAA6B;AAE3D,SAASC,kBAAkB,QAAQ,kBAAkB;AACrD,SAASC,UAAU,EAAEC,WAAW,QAAQ,0BAA0B;AASlE,SACEC,2BAA2B,EAC3BC,UAAU,EACVC,sBAAsB,EACtBC,kBAAkB,EAClBC,sBAAsB,EACtBC,mBAAmB,QACd,iBAAiB;;AAExB;AACA;AACA,MAAMC,wBAAwB,GAAG,UAC/BC,cAAsB,EAGnB;EAAA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F,sBAAsB,EACtB0B,KAAK,EAAET,WAAW,CAACjB,sBAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACF,sBAAsB,GAAGI,wBAAwB,CAChDJ,sBAAsB,EACtB4B,KAAK,EAAET,WAAW,CAACnB,sBAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACG,mBAAmB,GAAGC,wBAAwB,CAC7CD,mBAAmB,EACnByB,KAAK,EAAET,WAAW,CAAChB,mBAAmB,CAAC,IAAK,SAAQ;EAExD,CAAC;EAEDN,WAAW,CAACmC,aAAa,CAAC;EAC1B,OAAOd,cAAc,CAACc,aAAa,CAAC;AACtC,CAAC"}
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequ
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.Init = void 0;
8
8
  var _reactRedux = require("react-redux");
9
9
  var _reactHelmetAsync = require("react-helmet-async");
10
10
  var _reactRouter = require("react-router");
@@ -39,7 +39,6 @@ const Init = _ref => {
39
39
  })
40
40
  });
41
41
  };
42
+ exports.Init = Init;
42
43
  Init.displayName = "BI.Init";
43
- var _default = Init;
44
- exports.default = _default;
45
44
  //# sourceMappingURL=Init.js.map
@@ -12,7 +12,7 @@ import type { Theme } from "../react-theme/types";
12
12
  import type { ReduxStore } from "../redux/types";
13
13
  import type { Props as FallbackProps } from "../react/ErrorBoundaryFallback";
14
14
 
15
- export type Props = {
15
+ type Props = {
16
16
  +store: ReduxStore,
17
17
  +routerHistory: RouterHistory,
18
18
  +contextPath: string,
@@ -23,7 +23,7 @@ export type Props = {
23
23
 
24
24
  /**
25
25
  */
26
- const Init = ({
26
+ export const Init = ({
27
27
  store,
28
28
  routerHistory,
29
29
  contextPath,
@@ -43,7 +43,4 @@ const Init = ({
43
43
  </ThemeProvider>
44
44
  </Provider>
45
45
  );
46
-
47
46
  Init.displayName = "BI.Init";
48
-
49
- export default Init;
@@ -1 +1 @@
1
- {"version":3,"file":"Init.js","names":["Init","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\nexport type Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nconst Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\n\nInit.displayName = \"BI.Init\";\n\nexport default Init;\n"],"mappings":";;;;;;;AACA;AACA;AACA;AAEA;AACA;AAAmD;AAiBnD;AACA;AACA,MAAMA,IAAI,GAAG;EAAA,IAAC;IACZC,KAAK;IACLC,aAAa;IACbC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC;EACK,CAAC;EAAA,oBACN,qBAAC,oBAAQ;IAAC,KAAK,EAAEL,KAAM;IAAA,uBACrB,qBAAC,sBAAa;MAAC,KAAK,EAAEG,KAAM;MAAA,uBAC1B,qBAAC,gCAAc;QAAA,uBACb,qBAAC,sBAAa;UAAC,iBAAiB,EAAEE,sBAAuB;UAAA,uBACvD,qBAAC,mBAAM;YAAC,OAAO,EAAEJ,aAAc;YAAC,QAAQ,EAAEC,WAAY;YAAA,UACnDE;UAAQ;QACF;MACK;IACD;EACH,EACP;AAAA,CACZ;AAEDL,IAAI,CAACO,WAAW,GAAG,SAAS;AAAC,eAEdP,IAAI;AAAA"}
1
+ {"version":3,"file":"Init.js","names":["Init","store","routerHistory","contextPath","theme","children","ErrorFallbackComponent","displayName"],"sources":["../../src/react-client/Init.js"],"sourcesContent":["// @flow\nimport { Provider } from \"react-redux\";\nimport { HelmetProvider } from \"react-helmet-async\";\nimport { Router } from \"react-router\";\n\nimport ThemeProvider from \"../react-theme/ThemeProvider\";\nimport ErrorBoundary from \"../react/ErrorBoundary\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { RouterHistory } from \"react-router\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { ReduxStore } from \"../redux/types\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype Props = {\n +store: ReduxStore,\n +routerHistory: RouterHistory,\n +contextPath: string,\n +theme?: Theme | Array<Theme>,\n +children: ?Node,\n +ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/**\n */\nexport const Init = ({\n store,\n routerHistory,\n contextPath,\n theme,\n children,\n ErrorFallbackComponent,\n}: Props): Node => (\n <Provider store={store}>\n <ThemeProvider theme={theme}>\n <HelmetProvider>\n <ErrorBoundary FallbackComponent={ErrorFallbackComponent}>\n <Router history={routerHistory} basename={contextPath}>\n {children}\n </Router>\n </ErrorBoundary>\n </HelmetProvider>\n </ThemeProvider>\n </Provider>\n);\nInit.displayName = \"BI.Init\";\n"],"mappings":";;;;;;;AACA;AACA;AACA;AAEA;AACA;AAAmD;AAiBnD;AACA;AACO,MAAMA,IAAI,GAAG;EAAA,IAAC;IACnBC,KAAK;IACLC,aAAa;IACbC,WAAW;IACXC,KAAK;IACLC,QAAQ;IACRC;EACK,CAAC;EAAA,oBACN,qBAAC,oBAAQ;IAAC,KAAK,EAAEL,KAAM;IAAA,uBACrB,qBAAC,sBAAa;MAAC,KAAK,EAAEG,KAAM;MAAA,uBAC1B,qBAAC,gCAAc;QAAA,uBACb,qBAAC,sBAAa;UAAC,iBAAiB,EAAEE,sBAAuB;UAAA,uBACvD,qBAAC,mBAAM;YAAC,OAAO,EAAEJ,aAAc;YAAC,QAAQ,EAAEC,WAAY;YAAA,UACnDE;UAAQ;QACF;MACK;IACD;EACH,EACP;AAAA,CACZ;AAAC;AACFL,IAAI,CAACO,WAAW,GAAG,SAAS"}
@@ -20,7 +20,7 @@ var _Error = require("../redux/actions/Error");
20
20
  var _SignIn = require("../redux/actions/SignIn");
21
21
  var _RouterActions = require("../redux/_router/RouterActions");
22
22
  var _exceptions = require("../exceptions");
23
- var _Init = _interopRequireDefault(require("./Init"));
23
+ var _Init = require("./Init");
24
24
  var _beforeRenderHooks = require("../redux/store/beforeRenderHooks");
25
25
  var _jsxRuntime = require("react/jsx-runtime");
26
26
  /*
@@ -126,7 +126,7 @@ const addContentLoadedEvent = (store, routerHistory, theme, render, ErrorFallbac
126
126
  if (!applicationNode) {
127
127
  throw new Error("No DOM element with id application found to attach client to");
128
128
  }
129
- mount(applicationNode, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Init.default, {
129
+ mount(applicationNode, /*#__PURE__*/(0, _jsxRuntime.jsx)(_Init.Init, {
130
130
  store: store,
131
131
  routerHistory: routerHistory,
132
132
  contextPath: window.contextPath,
@@ -25,7 +25,7 @@ import { locationChange } from "../redux/_router/RouterActions";
25
25
 
26
26
  import { JsonParseException, FetchException } from "../exceptions";
27
27
 
28
- import Init from "./Init";
28
+ import { Init } from "./Init";
29
29
 
30
30
  import { handleBeforeRenderHooks } from "../redux/store/beforeRenderHooks";
31
31
 
@@ -40,7 +40,7 @@ import type { RouterHistory } from "react-router";
40
40
  import type { BeforeRenderHook } from "../redux/store/beforeRenderHooks";
41
41
  import type { Props as FallbackProps } from "../react/ErrorBoundaryFallback";
42
42
 
43
- export type Props = {
43
+ type Props = {
44
44
  customReducers?: CustomReducers,
45
45
  theme?: Theme | Array<Theme>,
46
46
  render: Function,
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["parseDataToJSON","data","JSON","parse","error","JsonParseException","getDataFromServer","dataElement","document","querySelector","Error","textContent","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","setImmediate","errorMessage","reason","message","toString","dispatch","showXHRErrorNotification","setupClient","customReducers","beforeRenderHooks","contextPath","Cache","clear","browserHistory","createBrowserHistory","basename","getBasePath","routerHistory","configureStore","rehydrate","setAllContentInDataSetting","getState","setLoginPreferences","loadOtherBrowserTabs","getItem","loginSuccess","has","FetchException","response","handleError","listen","location","action","locationChange","body","className","handleBeforeRenderHooks","addContentLoadedEvent","theme","render","ErrorFallbackComponent","mount","addEventListener","applicationNode","mountClient","initComponent","isSSR","hydrate","client"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\nimport { hydrate, render } from \"react-dom\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport { getBasePath } from \"../constants/Settings\";\n\nimport {\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\n\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\n\nimport { locationChange } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport Init from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type {\n ComponentType,\n Element as ReactElement,\n ElementType,\n} from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\nexport type Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: Function,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\nconst getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]'\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return {};\n }\n\n return parseDataToJSON(dataElement.textContent);\n};\n\n/**\n */\nexport const setUnhandledRejectionEvent = (store: ReduxStore) => {\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n};\n\n/**\n */\nexport const setupClient = (\n customReducers: CustomReducers = {},\n beforeRenderHooks: ?Array<BeforeRenderHook>\n): { store: ReduxStore, routerHistory: RouterHistory } => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const data = getDataFromServer();\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: getBasePath(),\n });\n const { routerHistory, store } = configureStore(\n browserHistory,\n customReducers,\n rehydrate(data)\n );\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data?.error?.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n routerHistory.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n setUnhandledRejectionEvent(store);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store });\n }\n\n return { store, routerHistory };\n};\n\n/**\n */\nexport const addContentLoadedEvent = (\n store: ReduxStore,\n routerHistory: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: Function,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n mount: Function\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\"\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={routerHistory}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>\n );\n });\n};\n\n/**\n */\nconst mountClient = (\n applicationNode: Element,\n initComponent: ReactElement<ElementType>\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrate(initComponent, applicationNode);\n } else {\n render(initComponent, applicationNode);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n}: Props) => {\n const { store, routerHistory } = setupClient(\n customReducers,\n beforeRenderHooks\n );\n\n addContentLoadedEvent(\n store,\n routerHistory,\n theme,\n render,\n ErrorFallbackComponent,\n mountClient\n );\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AAIA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAA2E;AAqB3E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ACrBxC,cAAc;IACd8B,KAAK;IACLC,MAAM;IACN9B,iBAAiB;IACjB+B;EACK,CAAC;EACN,MAAM;IAAE7C,KAAK;IAAEsB;EAAc,CAAC,GAAGV,WAAW,CAC1CC,cAAc,EACdC,iBAAiB,CAClB;EAED4B,qBAAqB,CACnB1C,KAAK,EACLsB,aAAa,EACbqB,KAAK,EACLC,MAAM,EACNC,sBAAsB,EACtBI,WAAW,CACZ;AACH,CAAC;AAAC"}
1
+ {"version":3,"file":"client.js","names":["parseDataToJSON","data","JSON","parse","error","JsonParseException","getDataFromServer","dataElement","document","querySelector","Error","textContent","setUnhandledRejectionEvent","store","window","onunhandledrejection","event","detail","setImmediate","errorMessage","reason","message","toString","dispatch","showXHRErrorNotification","setupClient","customReducers","beforeRenderHooks","contextPath","Cache","clear","browserHistory","createBrowserHistory","basename","getBasePath","routerHistory","configureStore","rehydrate","setAllContentInDataSetting","getState","setLoginPreferences","loadOtherBrowserTabs","getItem","loginSuccess","has","FetchException","response","handleError","listen","location","action","locationChange","body","className","handleBeforeRenderHooks","addContentLoadedEvent","theme","render","ErrorFallbackComponent","mount","addEventListener","applicationNode","mountClient","initComponent","isSSR","hydrate","client"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\nimport { hydrate, render } from \"react-dom\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport { getBasePath } from \"../constants/Settings\";\n\nimport {\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\n\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\n\nimport { locationChange } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport { Init } from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type {\n ComponentType,\n Element as ReactElement,\n ElementType,\n} from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\n\ntype Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: Function,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\nconst getDataFromServer = () => {\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]'\n );\n\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return {};\n }\n\n return parseDataToJSON(dataElement.textContent);\n};\n\n/**\n */\nexport const setUnhandledRejectionEvent = (store: ReduxStore) => {\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n};\n\n/**\n */\nexport const setupClient = (\n customReducers: CustomReducers = {},\n beforeRenderHooks: ?Array<BeforeRenderHook>\n): { store: ReduxStore, routerHistory: RouterHistory } => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const data = getDataFromServer();\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: getBasePath(),\n });\n const { routerHistory, store } = configureStore(\n browserHistory,\n customReducers,\n rehydrate(data)\n );\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data?.error?.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n routerHistory.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n setUnhandledRejectionEvent(store);\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (beforeRenderHooks) {\n handleBeforeRenderHooks(beforeRenderHooks, { store });\n }\n\n return { store, routerHistory };\n};\n\n/**\n */\nexport const addContentLoadedEvent = (\n store: ReduxStore,\n routerHistory: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: Function,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n mount: Function\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (!applicationNode) {\n throw new Error(\n \"No DOM element with id application found to attach client to\"\n );\n }\n\n mount(\n applicationNode,\n <Init\n store={store}\n routerHistory={routerHistory}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>\n );\n });\n};\n\n/**\n */\nconst mountClient = (\n applicationNode: Element,\n initComponent: ReactElement<ElementType>\n) => {\n const isSSR = applicationNode.querySelector(\".application\");\n if (isSSR) {\n hydrate(initComponent, applicationNode);\n } else {\n render(initComponent, applicationNode);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, setup redux store and caches, add unhandledRejectionEvent, used client side when JavaScript is enabled.\n */\nexport const client = ({\n customReducers,\n theme,\n render,\n beforeRenderHooks,\n ErrorFallbackComponent,\n}: Props) => {\n const { store, routerHistory } = setupClient(\n customReducers,\n beforeRenderHooks\n );\n\n addContentLoadedEvent(\n store,\n routerHistory,\n theme,\n render,\n ErrorFallbackComponent,\n mountClient\n );\n};\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AAIA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAA2E;AAqB3E;AACA;AACA;AACA,MAAMA,eAAe,GAAIC,IAAY,IAAK;EACxC,IAAI;IACF,OAAOC,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC;EACzB,CAAC,CAAC,OAAOG,KAAK,EAAE;IACd,MAAM,IAAIC,8BAAkB,CAAE,yBAAwBJ,IAAK,EAAC,CAAC;EAC/D;AACF,CAAC;AAED,MAAMK,iBAAiB,GAAG,MAAM;EAAA;EAC9B,MAAMC,WAAW,GAAGC,QAAQ,CAACC,aAAa,CACxC,4DAA4D,CAC7D;EAED,IAAI,CAACF,WAAW,EAAE;IAChB,MAAM,IAAIG,KAAK,CAAC,qCAAqC,CAAC;EACxD,CAAC,MAAM,IAAI,8BAAAH,WAAW,CAACI,WAAW,gBAAO,KAAK,EAAE,EAAE;IAChD,OAAO,CAAC,CAAC;EACX;EAEA,OAAOX,eAAe,CAACO,WAAW,CAACI,WAAW,CAAC;AACjD,CAAC;;AAED;AACA;AACO,MAAMC,0BAA0B,GAAIC,KAAiB,IAAK;EAC/DC,MAAM,CAACC,oBAAoB,GAAIC,KAAK,IAAK;IACvC,IAAIA,KAAK,CAACC,MAAM,EAAE;MAChB,OAAO,IAAAC,qBAAY,EAAC,MAAM;QACxB,MAAMC,YAAY,GAAGH,KAAK,CAACC,MAAM,CAACG,MAAM,CAACC,OAAO,CAACC,QAAQ,EAAE;QAE3DT,KAAK,CAACU,QAAQ,CAAC,IAAAC,sCAAwB,EAACL,YAAY,CAAC,CAAC;QACtD,MAAMH,KAAK,CAACC,MAAM,CAACG,MAAM;MAC3B,CAAC,CAAC;IACJ;IAEA,OAAOJ,KAAK;EACd,CAAC;AACH,CAAC;;AA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,KAAK,EAAE;IACT,IAAAC,iBAAO,EAACF,aAAa,EAAEF,eAAe,CAAC;EACzC,CAAC,MAAM;IACL,IAAAJ,gBAAM,EAACM,aAAa,EAAEF,eAAe,CAAC;EACxC;AACF,CAAC;;AAED;AACA;AACA;AACO,MAAMK,MAAM,GAAG,QAMT;EAAA,IANU;IACrBxC,cAAc;IACd8B,KAAK;IACLC,MAAM;IACN9B,iBAAiB;IACjB+B;EACK,CAAC;EACN,MAAM;IAAE7C,KAAK;IAAEsB;EAAc,CAAC,GAAGV,WAAW,CAC1CC,cAAc,EACdC,iBAAiB,CAClB;EAED4B,qBAAqB,CACnB1C,KAAK,EACLsB,aAAa,EACbqB,KAAK,EACLC,MAAM,EACNC,sBAAsB,EACtBI,WAAW,CACZ;AACH,CAAC;AAAC"}
@@ -1,32 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _Object$keys = require("@babel/runtime-corejs3/core-js-stable/object/keys");
4
- var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- var _exportNames = {
9
- setCustomErrorResponseHandler: true,
10
- Init: true
11
- };
12
- Object.defineProperty(exports, "Init", {
13
- enumerable: true,
14
- get: function () {
15
- return _Init.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "setCustomErrorResponseHandler", {
19
- enumerable: true,
20
- get: function () {
21
- return _Error.setCustomErrorResponseHandler;
22
- }
23
- });
24
- var _Error = require("../redux/actions/Error");
25
- var _Init = _interopRequireDefault(require("./Init"));
26
7
  var _client = require("./client");
27
8
  _Object$keys(_client).forEach(function (key) {
28
9
  if (key === "default" || key === "__esModule") return;
29
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
30
10
  if (key in exports && exports[key] === _client[key]) return;
31
11
  Object.defineProperty(exports, key, {
32
12
  enumerable: true,
@@ -35,4 +15,26 @@ _Object$keys(_client).forEach(function (key) {
35
15
  }
36
16
  });
37
17
  });
18
+ var _Init = require("./Init");
19
+ _Object$keys(_Init).forEach(function (key) {
20
+ if (key === "default" || key === "__esModule") return;
21
+ if (key in exports && exports[key] === _Init[key]) return;
22
+ Object.defineProperty(exports, key, {
23
+ enumerable: true,
24
+ get: function () {
25
+ return _Init[key];
26
+ }
27
+ });
28
+ });
29
+ var _Error = require("../redux/actions/Error");
30
+ _Object$keys(_Error).forEach(function (key) {
31
+ if (key === "default" || key === "__esModule") return;
32
+ if (key in exports && exports[key] === _Error[key]) return;
33
+ Object.defineProperty(exports, key, {
34
+ enumerable: true,
35
+ get: function () {
36
+ return _Error[key];
37
+ }
38
+ });
39
+ });
38
40
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,4 @@
1
1
  // @flow
2
- export { setCustomErrorResponseHandler } from "../redux/actions/Error";
3
-
4
- export { default as Init } from "./Init";
5
-
6
2
  export * from "./client";
3
+ export * from "./Init";
4
+ export * from "../redux/actions/Error";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/react-client/index.js"],"sourcesContent":["// @flow\nexport { setCustomErrorResponseHandler } from \"../redux/actions/Error\";\n\nexport { default as Init } from \"./Init\";\n\nexport * from \"./client\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA;AAEA;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/react-client/index.js"],"sourcesContent":["// @flow\nexport * from \"./client\";\nexport * from \"./Init\";\nexport * from \"../redux/actions/Error\";\n"],"mappings":";;;;;;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -112,8 +112,8 @@ describe("serverUtil", () => {
112
112
  {
113
113
  type: "SET_PREFERENCES",
114
114
  payload: {
115
- "FormClient.login_url": "/j_security_check",
116
- "FormClient.logout_url": "/Logoff",
115
+ "FormClient.login_url": "/callback?client_name=FormClient",
116
+ "FormClient.logout_url": "/logout",
117
117
  "FormClient.password_field_name": "j_password",
118
118
  "FormClient.username_field_name": "j_username",
119
119
  "security.clients": null,
@@ -159,8 +159,8 @@ describe("serverUtil", () => {
159
159
  {
160
160
  type: "SET_PREFERENCES",
161
161
  payload: {
162
- "FormClient.login_url": "/j_security_check",
163
- "FormClient.logout_url": "/Logoff",
162
+ "FormClient.login_url": "/callback?client_name=FormClient",
163
+ "FormClient.logout_url": "/logout",
164
164
  "FormClient.password_field_name": "j_password",
165
165
  "FormClient.username_field_name": "j_username",
166
166
  "security.clients": null,
@@ -101,10 +101,10 @@ exports.setAllContentInDataSetting = setAllContentInDataSetting;
101
101
  const setLoginPreferences = state => {
102
102
  const loginSettings = {
103
103
  [_constants.LOGIN_TYPE]: getServerPreferenceValue(_constants.LOGIN_TYPE, state?.preferences[_constants.LOGIN_TYPE]),
104
- [_constants.LOGIN_PATH_SETTING]: getServerPreferenceValue(_constants.LOGIN_PATH_SETTING, state?.preferences[_constants.LOGIN_PATH_SETTING] ?? `/j_security_check`),
104
+ [_constants.LOGIN_PATH_SETTING]: getServerPreferenceValue(_constants.LOGIN_PATH_SETTING, state?.preferences[_constants.LOGIN_PATH_SETTING] ?? `/callback?client_name=FormClient`),
105
105
  [_constants.LOGIN_USERNAME_SETTING]: getServerPreferenceValue(_constants.LOGIN_USERNAME_SETTING, state?.preferences[_constants.LOGIN_USERNAME_SETTING] ?? "j_username"),
106
106
  [_constants.LOGIN_PASSWORD_SETTING]: getServerPreferenceValue(_constants.LOGIN_PASSWORD_SETTING, state?.preferences[_constants.LOGIN_PASSWORD_SETTING] ?? "j_password"),
107
- [_constants.LOGOUT_PATH_SETTING]: getServerPreferenceValue(_constants.LOGOUT_PATH_SETTING, state?.preferences[_constants.LOGOUT_PATH_SETTING] ?? `/Logoff`)
107
+ [_constants.LOGOUT_PATH_SETTING]: getServerPreferenceValue(_constants.LOGOUT_PATH_SETTING, state?.preferences[_constants.LOGOUT_PATH_SETTING] ?? `/logout`)
108
108
  };
109
109
  (0, _Settings.setSettings)(loginSettings);
110
110
  return setPreferences(loginSettings);
@@ -129,7 +129,8 @@ export const setLoginPreferences = (
129
129
  ),
130
130
  [LOGIN_PATH_SETTING]: getServerPreferenceValue(
131
131
  LOGIN_PATH_SETTING,
132
- state?.preferences[LOGIN_PATH_SETTING] ?? `/j_security_check`
132
+ state?.preferences[LOGIN_PATH_SETTING] ??
133
+ `/callback?client_name=FormClient`
133
134
  ),
134
135
  [LOGIN_USERNAME_SETTING]: getServerPreferenceValue(
135
136
  LOGIN_USERNAME_SETTING,
@@ -141,7 +142,7 @@ export const setLoginPreferences = (
141
142
  ),
142
143
  [LOGOUT_PATH_SETTING]: getServerPreferenceValue(
143
144
  LOGOUT_PATH_SETTING,
144
- state?.preferences[LOGOUT_PATH_SETTING] ?? `/Logoff`
145
+ state?.preferences[LOGOUT_PATH_SETTING] ?? `/logout`
145
146
  ),
146
147
  };
147
148
 
@@ -1 +1 @@
1
- {"version":3,"file":"Preferences.js","names":["getServerPreferenceValue","preferenceName","defaultValue","type","value","preferencesProvider","getPreferenceByName","split","val","setServerPreference","propertyName","setPreference","propertyValue","payload","setPreferences","preferences","setThemePreference","configTheme","themeData","JSON","parse","error","JsonParseException","isPlainObject","setSettings","settings","setAllContentInDataSetting","state","allContentInDataSetting","getModularUIContentInData","ALL_CONTENT_IN_DATA_SETTING","setSetting","setLoginPreferences","loginSettings","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING"],"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: PreferenceValue = 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: PreferenceValue = 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;AAEA;AACA;AASA;AASA;AACA;AACA,MAAMA,wBAAwB,GAAG,UAC/BC,cAAsB,EAGnB;EAAA,IAFHC,YAA6B,uEAAG,IAAI;EAAA,IACpCC,IAAa;EAEb,IAAIC,KAAsB,GAAG,IAAI;EACjC,IAAI,OAAOC,mBAAmB,KAAK,WAAW,EAAE;IAC9CD,KAAK,GAAGC,mBAAmB,CAACC,mBAAmB,CAACL,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WAAW,CAACsB,iCAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACC,8BAAmB,GAAGtC,wBAAwB,CAC7CsC,8BAAmB,EACnBX,KAAK,EAAEZ,WAAW,CAACuB,8BAAmB,CAAC,IAAK,SAAQ;EAExD,CAAC;EAED,IAAAd,qBAAW,EAACS,aAAa,CAAC;EAC1B,OAAOnB,cAAc,CAACmB,aAAa,CAAC;AACtC,CAAC;AAAC"}
1
+ {"version":3,"file":"Preferences.js","names":["getServerPreferenceValue","preferenceName","defaultValue","type","value","preferencesProvider","getPreferenceByName","split","val","setServerPreference","propertyName","setPreference","propertyValue","payload","setPreferences","preferences","setThemePreference","configTheme","themeData","JSON","parse","error","JsonParseException","isPlainObject","setSettings","settings","setAllContentInDataSetting","state","allContentInDataSetting","getModularUIContentInData","ALL_CONTENT_IN_DATA_SETTING","setSetting","setLoginPreferences","loginSettings","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING"],"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: PreferenceValue = 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: PreferenceValue = 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] ??\n `/callback?client_name=FormClient`\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] ?? `/logout`\n ),\n };\n\n setSettings(loginSettings);\n return setPreferences(loginSettings);\n};\n"],"mappings":";;;;;;;;;;AACA;AAEA;AACA;AASA;AASA;AACA;AACA,MAAMA,wBAAwB,GAAG,UAC/BC,cAAsB,EAGnB;EAAA,IAFHC,YAA6B,uEAAG,IAAI;EAAA,IACpCC,IAAa;EAEb,IAAIC,KAAsB,GAAG,IAAI;EACjC,IAAI,OAAOC,mBAAmB,KAAK,WAAW,EAAE;IAC9CD,KAAK,GAAGC,mBAAmB,CAACC,mBAAmB,CAACL,cAAc,CAAC;EACjE;EAEA,IAAIG,KAAK,IAAI,IAAI,EAAE;IACjBA,KAAK,GAAGF,YAAY;EACtB;EAEA,IAAI,OAAOE,KAAK,KAAK,QAAQ,IAAID,IAAI,KAAK,QAAQ,IAAI,uBAAAC,KAAK,OAALA,KAAK,EAAU,GAAG,CAAC,EAAE;IAAA;IACzEA,KAAK,GAAG,6BAAAA,KAAK,CAACG,KAAK,CAAC,GAAG,CAAC,iBAAMC,GAAG,IAAK,mBAAAA,GAAG,OAAHA,GAAG,CAAO,CAAC;EACnD;EAEA,OAAOJ,KAAK;AACd,CAAC;;AAED;AACA;AACO,MAAMK,mBAAmB,GAAG,UACjCC,YAAoB,EAGI;EAAA,IAFxBR,YAA6B,u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E,CAAC,MAAM,IAAI,OAAOF,KAAK,KAAK,WAAW,EAAE;IACvCC,uBAAuB,GAAGD,KAAK,CAACZ,WAAW,CAACe,sCAA2B,CAAC;EAC1E;EAEA,IAAAC,oBAAU,EAACD,sCAA2B,EAAE,CAAC,CAACF,uBAAuB,CAAC;EAClE,OAAOjB,aAAa,CAACmB,sCAA2B,EAAEF,uBAAuB,CAAC;AAC5E,CAAC;;AAED;AACA;AACA;AAFA;AAGO,MAAMI,mBAAmB,GAC9BL,KAAkB,IACO;EACzB,MAAMM,aAAa,GAAG;IACpB,CAACC,qBAAU,GAAGlC,wBAAwB,CACpCkC,qBAAU,EACVP,KAAK,EAAEZ,WAAW,CAACmB,qBAAU,CAAC,CAC/B;IACD,CAACC,6BAAkB,GAAGnC,wBAAwB,CAC5CmC,6BAAkB,EAClBR,KAAK,EAAEZ,WAAW,CAACoB,6BAAkB,CAAC,IACnC,kCAAiC,CACrC;IACD,CAACC,iCAAsB,GAAGpC,wBAAwB,CAChDoC,iCAAsB,EACtBT,KAAK,EAAEZ,WAAW,CAACqB,iCAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACC,iCAAsB,GAAGrC,wBAAwB,CAChDqC,iCAAsB,EACtBV,KAAK,EAAEZ,WAAW,CAACsB,iCAAsB,CAAC,IAAI,YAAY,CAC3D;IACD,CAACC,8BAAmB,GAAGtC,wBAAwB,CAC7CsC,8BAAmB,EACnBX,KAAK,EAAEZ,WAAW,CAACuB,8BAAmB,CAAC,IAAK,SAAQ;EAExD,CAAC;EAED,IAAAd,qBAAW,EAACS,aAAa,CAAC;EAC1B,OAAOnB,cAAc,CAACmB,aAAa,CAAC;AACtC,CAAC;AAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beinformed/ui",
3
- "version": "1.28.1",
3
+ "version": "1.28.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",
@@ -12,7 +12,7 @@ import type { Theme } from "../react-theme/types";
12
12
  import type { ReduxStore } from "../redux/types";
13
13
  import type { Props as FallbackProps } from "../react/ErrorBoundaryFallback";
14
14
 
15
- export type Props = {
15
+ type Props = {
16
16
  +store: ReduxStore,
17
17
  +routerHistory: RouterHistory,
18
18
  +contextPath: string,
@@ -23,7 +23,7 @@ export type Props = {
23
23
 
24
24
  /**
25
25
  */
26
- const Init = ({
26
+ export const Init = ({
27
27
  store,
28
28
  routerHistory,
29
29
  contextPath,
@@ -43,7 +43,4 @@ const Init = ({
43
43
  </ThemeProvider>
44
44
  </Provider>
45
45
  );
46
-
47
46
  Init.displayName = "BI.Init";
48
-
49
- export default Init;
@@ -25,7 +25,7 @@ import { locationChange } from "../redux/_router/RouterActions";
25
25
 
26
26
  import { JsonParseException, FetchException } from "../exceptions";
27
27
 
28
- import Init from "./Init";
28
+ import { Init } from "./Init";
29
29
 
30
30
  import { handleBeforeRenderHooks } from "../redux/store/beforeRenderHooks";
31
31
 
@@ -40,7 +40,7 @@ import type { RouterHistory } from "react-router";
40
40
  import type { BeforeRenderHook } from "../redux/store/beforeRenderHooks";
41
41
  import type { Props as FallbackProps } from "../react/ErrorBoundaryFallback";
42
42
 
43
- export type Props = {
43
+ type Props = {
44
44
  customReducers?: CustomReducers,
45
45
  theme?: Theme | Array<Theme>,
46
46
  render: Function,
@@ -1,6 +1,4 @@
1
1
  // @flow
2
- export { setCustomErrorResponseHandler } from "../redux/actions/Error";
3
-
4
- export { default as Init } from "./Init";
5
-
6
2
  export * from "./client";
3
+ export * from "./Init";
4
+ export * from "../redux/actions/Error";
@@ -112,8 +112,8 @@ describe("serverUtil", () => {
112
112
  {
113
113
  type: "SET_PREFERENCES",
114
114
  payload: {
115
- "FormClient.login_url": "/j_security_check",
116
- "FormClient.logout_url": "/Logoff",
115
+ "FormClient.login_url": "/callback?client_name=FormClient",
116
+ "FormClient.logout_url": "/logout",
117
117
  "FormClient.password_field_name": "j_password",
118
118
  "FormClient.username_field_name": "j_username",
119
119
  "security.clients": null,
@@ -159,8 +159,8 @@ describe("serverUtil", () => {
159
159
  {
160
160
  type: "SET_PREFERENCES",
161
161
  payload: {
162
- "FormClient.login_url": "/j_security_check",
163
- "FormClient.logout_url": "/Logoff",
162
+ "FormClient.login_url": "/callback?client_name=FormClient",
163
+ "FormClient.logout_url": "/logout",
164
164
  "FormClient.password_field_name": "j_password",
165
165
  "FormClient.username_field_name": "j_username",
166
166
  "security.clients": null,
@@ -129,7 +129,8 @@ export const setLoginPreferences = (
129
129
  ),
130
130
  [LOGIN_PATH_SETTING]: getServerPreferenceValue(
131
131
  LOGIN_PATH_SETTING,
132
- state?.preferences[LOGIN_PATH_SETTING] ?? `/j_security_check`
132
+ state?.preferences[LOGIN_PATH_SETTING] ??
133
+ `/callback?client_name=FormClient`
133
134
  ),
134
135
  [LOGIN_USERNAME_SETTING]: getServerPreferenceValue(
135
136
  LOGIN_USERNAME_SETTING,
@@ -141,7 +142,7 @@ export const setLoginPreferences = (
141
142
  ),
142
143
  [LOGOUT_PATH_SETTING]: getServerPreferenceValue(
143
144
  LOGOUT_PATH_SETTING,
144
- state?.preferences[LOGOUT_PATH_SETTING] ?? `/Logoff`
145
+ state?.preferences[LOGOUT_PATH_SETTING] ?? `/logout`
145
146
  ),
146
147
  };
147
148