@beinformed/ui 1.27.2 → 1.27.4
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 +14 -0
- package/esm/constants/Constants.js +5 -0
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/Settings.js +6 -4
- package/esm/constants/Settings.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +6 -3
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +25 -13
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/react/ErrorBoundaryFallback.js +3 -0
- package/esm/react/ErrorBoundaryFallback.js.map +1 -1
- package/esm/react-server/serverNoSSR.js +5 -2
- package/esm/react-server/serverNoSSR.js.map +1 -1
- package/esm/react-server/serverUtil.js +1 -0
- package/esm/react-server/serverUtil.js.map +1 -1
- package/lib/constants/Constants.js +7 -1
- package/lib/constants/Constants.js.flow +5 -0
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/Settings.js +5 -3
- package/lib/constants/Settings.js.flow +7 -3
- package/lib/constants/Settings.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +6 -3
- package/lib/models/application/ApplicationModel.js.flow +10 -5
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +24 -12
- package/lib/modularui/Authenticate.js.flow +30 -13
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js +3 -0
- package/lib/react/ErrorBoundaryFallback.js.flow +2 -0
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react-server/serverNoSSR.js +5 -2
- package/lib/react-server/serverNoSSR.js.flow +5 -1
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js +1 -0
- package/lib/react-server/serverUtil.js.flow +2 -0
- package/lib/react-server/serverUtil.js.map +1 -1
- package/package.json +3 -3
- package/src/constants/Constants.js +5 -0
- package/src/constants/Settings.js +7 -3
- package/src/models/application/ApplicationModel.js +10 -5
- package/src/modularui/Authenticate.js +30 -13
- package/src/react/ErrorBoundaryFallback.js +2 -0
- package/src/react-server/serverNoSSR.js +5 -1
- package/src/react-server/serverUtil.js +2 -0
- package/types/constants/Constants.d.ts +5 -0
- package/types/modularui/Authenticate.d.ts +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.27.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.27.3...v1.27.4) (2023-02-07)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **server:** add property to skip preloading the web application on the server ([b9c8e17](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/b9c8e178bbef7cf94f9d3d80da9f64f78e228a24))
|
|
10
|
+
|
|
11
|
+
### [1.27.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.27.2...v1.27.3) (2023-02-06)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- **authenticate:** set default login path to pac4j ([6f14e68](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/6f14e68843f5dbe53ed4850eed7cd49fc9631a46))
|
|
16
|
+
- **authentication:** return default authentication type when security property not present ([2c5d05b](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/2c5d05b3c80b7de3732eb3c6773972817d6c4b13))
|
|
17
|
+
- **init:** set connectKey on application model on initialization ([4eb88d5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4eb88d5f9c639296ae2ed2a024a080d1d03ac0d9))
|
|
18
|
+
|
|
5
19
|
### [1.27.2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.27.1...v1.27.2) (2023-01-31)
|
|
6
20
|
|
|
7
21
|
### Bug Fixes
|
|
@@ -150,6 +150,11 @@ export const ATTRIBUTE_WIDTH = {
|
|
|
150
150
|
EXTRA_LARGE: "EXTRA_LARGE"
|
|
151
151
|
};
|
|
152
152
|
export const ALL_CONTENT_IN_DATA_SETTING = "hasAllContentInData";
|
|
153
|
+
export const INTERNAL_LOGIN_TYPE = {
|
|
154
|
+
JAAS: "JAAS",
|
|
155
|
+
PAC4J_FORM: "PAC4J_FORM",
|
|
156
|
+
PAC4J_BASIC: "PAC4J_BASIC"
|
|
157
|
+
};
|
|
153
158
|
export const LOGIN_TYPE = "security.clients";
|
|
154
159
|
export const LOGIN_PATH_SETTING = "FormClient.login_url";
|
|
155
160
|
export const LOGIN_USERNAME_SETTING = "FormClient.username_field_name";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","names":["CONTENT_PATH","UPLOAD_PATH","CAPTCHA_PATH","CHANGEPASSWORD_PATH","USERPROFILE_PATH","RESOURCE_PATH","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","PARAMETER_OVERVIEW_VIEWTYPE","DEFAULT_UI_PARAMETERS","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","KEYCODES","TAB","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","IS_SYNC","dataFetcher","IS_SERVER","NOTIFICATION_TYPES","SUCCESS","INFO","WARNING","ERROR","HTTP_METHODS","GET","POST","MODULARUI_STATUS","LOADING","FINISHED","AUTOSAVE_STATUS","START","INPUT_DEBOUNCE_TIMEOUT","VALIDATE_DEBOUNCE_TIMEOUT","ATTRIBUTE_WIDTH","EXTRA_SMALL","SMALL","MEDIUM","LARGE","EXTRA_LARGE","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","DEFAULT_AUTHENTICATION_TYPE","name","authentication","isPrimary"],"sources":["../../src/constants/Constants.js"],"sourcesContent":["// @flow\n/**\n * path to content service\n */\nexport const CONTENT_PATH = `/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `/captchaServices`;\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Path to resources in the Be Informed repository\n */\nexport const RESOURCE_PATH = \"/resource\";\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nconst PARAMETER_OVERVIEW_VIEWTYPE = \"viewType\";\n/**\n * Parameter name for the viewtype toggle\n */\nexport const DEFAULT_UI_PARAMETERS: Array<string> = [\n PARAMETER_OVERVIEW_VIEWTYPE,\n];\n\n/**\n */\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\n/**\n */\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n/**\n */\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\n/**\n */\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * Key codes\n * @type {{SPACE: number, PAGE_DOWN: number, TAB: number, ARROW_RIGHT: number, ARROW_DOWN: number, ENTER: number, ARROW_UP: number, ARROW_LEFT: number, PAGE_UP: number, ESCAPE: number}}\n */\nexport const KEYCODES = {\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\n/**\n * @type {boolean}\n */\nexport const IS_SYNC = typeof dataFetcher !== \"undefined\";\n/**\n * @type {boolean}\n */\nexport const IS_SERVER = IS_SYNC;\n\n/**\n * @type {{SUCCESS: string, ERROR: string, INFO: string, WARNING: string}}\n */\nexport const NOTIFICATION_TYPES = {\n SUCCESS: \"SUCCESS\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n ERROR: \"ERROR\",\n};\n\n/**\n * SUPPORTED HTTP METHODS\n * @type {{POST: string, GET: string}}\n */\nexport const HTTP_METHODS = {\n GET: \"GET\",\n POST: \"POST\",\n};\n\n/**\n * POSSIBLE MODULARUI STATUSSES\n * @type {{LOADING: string, ERROR: string, FINISHED: string}}\n */\nexport const MODULARUI_STATUS = {\n LOADING: \"LOADING\",\n FINISHED: \"FINISHED\",\n ERROR: \"ERROR\",\n};\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport const AUTOSAVE_STATUS = {\n START: \"START\",\n FINISHED: \"FINISHED\",\n};\n\n/**\n * DEBOUNCE INPUT TIMEOUT\n */\nexport const INPUT_DEBOUNCE_TIMEOUT = 100;\n\n/**\n * DEBOUNCE VALIDATION TIMEOUT\n */\nexport const VALIDATE_DEBOUNCE_TIMEOUT = 500;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport const ATTRIBUTE_WIDTH = {\n EXTRA_SMALL: \"EXTRA_SMALL\",\n SMALL: \"SMALL\",\n MEDIUM: \"MEDIUM\",\n LARGE: \"LARGE\",\n EXTRA_LARGE: \"EXTRA_LARGE\",\n};\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\n\nexport const LOGIN_TYPE = \"security.clients\";\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n\nexport const DEFAULT_AUTHENTICATION_TYPE = {\n name: \"Form based authentication\",\n authentication: \"DefaultFormClient\",\n isPrimary: true,\n};\n"],"mappings":"AACA;AACA;AACA;AACA,OAAO,MAAMA,YAAY,GAAI,UAAS;;AAEtC;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAI,aAAY;;AAExC;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAI,kBAAiB;;AAE9C;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,kBAAkB;;AAErD;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,OAAO;;AAEvC;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,WAAW;;AAExC;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,GAAG;;AAEtC;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,WAAW;AAElD,MAAMC,2BAA2B,GAAG,UAAU;AAC9C;AACA;AACA;AACA,OAAO,MAAMC,qBAAoC,GAAG,CAClDD,2BAA2B,CAC5B;;AAED;AACA;AACA,OAAO,MAAME,eAAe,GAAG,YAAY;AAC3C;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,uBAAuB;AAC1D;AACA;AACA,OAAO,MAAMC,eAAe,GAAG,UAAU;AACzC;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAG,2BAA2B;AAC/D;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAG,CAAC;;AAEvC;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,GAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA,OAAO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AEhE,OAAO,MAAMC,UAAU,GAAG,kBAAkB;AAC5C,OAAO,MAAMC,kBAAkB,GAAG,sBAAsB;AACxD,OAAO,MAAMC,sBAAsB,GAAG,gCAAgC;AACtE,OAAO,MAAMC,sBAAsB,GAAG,gCAAgC;AACtE,OAAO,MAAMC,mBAAmB,GAAG,uBAAuB;AAE1D,OAAO,MAAMC,2BAA2B,GAAG;EACzCC,IAAI,EAAE,2BAA2B;EACjCC,cAAc,EAAE,mBAAmB;EACnCC,SAAS,EAAE;AACb,CAAC"}
|
|
1
|
+
{"version":3,"file":"Constants.js","names":["CONTENT_PATH","UPLOAD_PATH","CAPTCHA_PATH","CHANGEPASSWORD_PATH","USERPROFILE_PATH","RESOURCE_PATH","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","PARAMETER_OVERVIEW_VIEWTYPE","DEFAULT_UI_PARAMETERS","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","KEYCODES","TAB","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","IS_SYNC","dataFetcher","IS_SERVER","NOTIFICATION_TYPES","SUCCESS","INFO","WARNING","ERROR","HTTP_METHODS","GET","POST","MODULARUI_STATUS","LOADING","FINISHED","AUTOSAVE_STATUS","START","INPUT_DEBOUNCE_TIMEOUT","VALIDATE_DEBOUNCE_TIMEOUT","ATTRIBUTE_WIDTH","EXTRA_SMALL","SMALL","MEDIUM","LARGE","EXTRA_LARGE","ALL_CONTENT_IN_DATA_SETTING","INTERNAL_LOGIN_TYPE","JAAS","PAC4J_FORM","PAC4J_BASIC","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","DEFAULT_AUTHENTICATION_TYPE","name","authentication","isPrimary"],"sources":["../../src/constants/Constants.js"],"sourcesContent":["// @flow\n/**\n * path to content service\n */\nexport const CONTENT_PATH = `/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `/captchaServices`;\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Path to resources in the Be Informed repository\n */\nexport const RESOURCE_PATH = \"/resource\";\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nconst PARAMETER_OVERVIEW_VIEWTYPE = \"viewType\";\n/**\n * Parameter name for the viewtype toggle\n */\nexport const DEFAULT_UI_PARAMETERS: Array<string> = [\n PARAMETER_OVERVIEW_VIEWTYPE,\n];\n\n/**\n */\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\n/**\n */\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n/**\n */\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\n/**\n */\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * Key codes\n * @type {{SPACE: number, PAGE_DOWN: number, TAB: number, ARROW_RIGHT: number, ARROW_DOWN: number, ENTER: number, ARROW_UP: number, ARROW_LEFT: number, PAGE_UP: number, ESCAPE: number}}\n */\nexport const KEYCODES = {\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\n/**\n * @type {boolean}\n */\nexport const IS_SYNC = typeof dataFetcher !== \"undefined\";\n/**\n * @type {boolean}\n */\nexport const IS_SERVER = IS_SYNC;\n\n/**\n * @type {{SUCCESS: string, ERROR: string, INFO: string, WARNING: string}}\n */\nexport const NOTIFICATION_TYPES = {\n SUCCESS: \"SUCCESS\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n ERROR: \"ERROR\",\n};\n\n/**\n * SUPPORTED HTTP METHODS\n * @type {{POST: string, GET: string}}\n */\nexport const HTTP_METHODS = {\n GET: \"GET\",\n POST: \"POST\",\n};\n\n/**\n * POSSIBLE MODULARUI STATUSSES\n * @type {{LOADING: string, ERROR: string, FINISHED: string}}\n */\nexport const MODULARUI_STATUS = {\n LOADING: \"LOADING\",\n FINISHED: \"FINISHED\",\n ERROR: \"ERROR\",\n};\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport const AUTOSAVE_STATUS = {\n START: \"START\",\n FINISHED: \"FINISHED\",\n};\n\n/**\n * DEBOUNCE INPUT TIMEOUT\n */\nexport const INPUT_DEBOUNCE_TIMEOUT = 100;\n\n/**\n * DEBOUNCE VALIDATION TIMEOUT\n */\nexport const VALIDATE_DEBOUNCE_TIMEOUT = 500;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport const ATTRIBUTE_WIDTH = {\n EXTRA_SMALL: \"EXTRA_SMALL\",\n SMALL: \"SMALL\",\n MEDIUM: \"MEDIUM\",\n LARGE: \"LARGE\",\n EXTRA_LARGE: \"EXTRA_LARGE\",\n};\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\n\nexport const INTERNAL_LOGIN_TYPE = {\n JAAS: \"JAAS\",\n PAC4J_FORM: \"PAC4J_FORM\",\n PAC4J_BASIC: \"PAC4J_BASIC\",\n};\nexport const LOGIN_TYPE = \"security.clients\";\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n\nexport const DEFAULT_AUTHENTICATION_TYPE = {\n name: \"Form based authentication\",\n authentication: \"DefaultFormClient\",\n isPrimary: true,\n};\n"],"mappings":"AACA;AACA;AACA;AACA,OAAO,MAAMA,YAAY,GAAI,UAAS;;AAEtC;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAI,aAAY;;AAExC;AACA;AACA;AACA,OAAO,MAAMC,YAAY,GAAI,kBAAiB;;AAE9C;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,kBAAkB;;AAErD;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,GAAG,OAAO;;AAEvC;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAG,WAAW;;AAExC;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,GAAG;;AAEtC;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAG,WAAW;AAElD,MAAMC,2BAA2B,GAAG,UAAU;AAC9C;AACA;AACA;AACA,OAAO,MAAMC,qBAAoC,GAAG,CAClDD,2BAA2B,CAC5B;;AAED;AACA;AACA,OAAO,MAAME,eAAe,GAAG,YAAY;AAC3C;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG,uBAAuB;AAC1D;AACA;AACA,OAAO,MAAMC,eAAe,GAAG,UAAU;AACzC;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAG,2BAA2B;AAC/D;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAG,CAAC;;AAEvC;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,GAAG,CAAC;;AAEjD;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAA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mBAAmB,GAAG;EACjCC,IAAI,EAAE,MAAM;EACZC,UAAU,EAAE,YAAY;EACxBC,WAAW,EAAE;AACf,CAAC;AACD,OAAO,MAAMC,UAAU,GAAG,kBAAkB;AAC5C,OAAO,MAAMC,kBAAkB,GAAG,sBAAsB;AACxD,OAAO,MAAMC,sBAAsB,GAAG,gCAAgC;AACtE,OAAO,MAAMC,sBAAsB,GAAG,gCAAgC;AACtE,OAAO,MAAMC,mBAAmB,GAAG,uBAAuB;AAE1D,OAAO,MAAMC,2BAA2B,GAAG;EACzCC,IAAI,EAAE,2BAA2B;EACjCC,cAAc,EAAE,mBAAmB;EACnCC,SAAS,EAAE;AACb,CAAC"}
|
|
@@ -2,7 +2,7 @@ import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign"
|
|
|
2
2
|
import _startsWithInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/starts-with";
|
|
3
3
|
import { isPlainObject, has } from "../utils/helpers/objects";
|
|
4
4
|
import { getRepositoryResourceUrl } from "../utils/helpers/repositoryResource";
|
|
5
|
-
import { ALL_CONTENT_IN_DATA_SETTING, LOGIN_TYPE, LOGIN_PATH_SETTING, LOGIN_USERNAME_SETTING, LOGIN_PASSWORD_SETTING, LOGOUT_PATH_SETTING, UPLOAD_PATH, CAPTCHA_PATH } from "./Constants";
|
|
5
|
+
import { ALL_CONTENT_IN_DATA_SETTING, INTERNAL_LOGIN_TYPE, LOGIN_TYPE, LOGIN_PATH_SETTING, LOGIN_USERNAME_SETTING, LOGIN_PASSWORD_SETTING, LOGOUT_PATH_SETTING, UPLOAD_PATH, CAPTCHA_PATH } from "./Constants";
|
|
6
6
|
const serverBase = typeof __CONTEXT_PATH__ === "undefined" ? null : __CONTEXT_PATH__;
|
|
7
7
|
const defaultSettings = {
|
|
8
8
|
// This uses contextPath set from property from server
|
|
@@ -126,12 +126,14 @@ export const hasAllContentInData = () => getSetting(ALL_CONTENT_IN_DATA_SETTING,
|
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* Login type, only available when pac4j is configured
|
|
129
|
+
*
|
|
130
|
+
* Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS
|
|
129
131
|
*/
|
|
130
|
-
export const loginType = () => getSetting(LOGIN_TYPE,
|
|
132
|
+
export const loginType = () => getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);
|
|
131
133
|
|
|
132
134
|
/**
|
|
133
135
|
*/
|
|
134
|
-
export const loginPath = () => getSetting(LOGIN_PATH_SETTING, "/
|
|
136
|
+
export const loginPath = () => getSetting(LOGIN_PATH_SETTING, "/callback?client_name=FormClient");
|
|
135
137
|
/**
|
|
136
138
|
*/
|
|
137
139
|
export const loginUsernameField = () => getSetting(LOGIN_USERNAME_SETTING, "j_username");
|
|
@@ -140,7 +142,7 @@ export const loginUsernameField = () => getSetting(LOGIN_USERNAME_SETTING, "j_us
|
|
|
140
142
|
export const loginPasswordField = () => getSetting(LOGIN_PASSWORD_SETTING, "j_password");
|
|
141
143
|
/**
|
|
142
144
|
*/
|
|
143
|
-
export const logoutPath = () => getSetting(LOGOUT_PATH_SETTING, "/
|
|
145
|
+
export const logoutPath = () => getSetting(LOGOUT_PATH_SETTING, "/logout");
|
|
144
146
|
export const LOGIN_PATH = loginPath();
|
|
145
147
|
export const LOGOUT_PATH = logoutPath();
|
|
146
148
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","names":["isPlainObject","has","getRepositoryResourceUrl","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","UPLOAD_PATH","CAPTCHA_PATH","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","HIDE_WHEN_EMPTY_IGNORE_TASKS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getUploadPath","getCaptchaPath","hasAllContentInData","loginType","loginPath","loginUsernameField","loginPasswordField","logoutPath","getSwimLaneDiagramConfiguration","configLocation","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (): string => `${getBasePath()}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (): string => `${getBasePath()}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n */\nexport const loginType = (): string => getSetting(LOGIN_TYPE, \"JAAS\");\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/j_security_check\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/Logoff\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\"\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;AACA,SAASA,aAAa,EAAEC,GAAG,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SACEC,2BAA2B,EAC3BC,UAAU,EACVC,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A;AACA;AACA,OAAO,MAAMsD,cAAc,GAAG,MAAe,GAAEF,WAAW,EAAG,GAAEnD,YAAa,EAAC;;AAE7E;AACA;AACA,OAAO,MAAMsD,mBAAmB,GAAG,MACjCZ,UAAU,CAACjD,2BAA2B,EAAE,IAAI,CAAC;;AAE/C;AACA;AACA;AACA,OAAO,MAAM8D,SAAS,GAAG,MAAcb,UAAU,CAAChD,UAAU,EAAE,MAAM,CAAC;;AAErE;AACA;AACA,OAAO,MAAM8D,SAAS,GAAG,MACvBd,UAAU,CAAC/C,kBAAkB,EAAE,mBAAmB,CAAC;AACrD;AACA;AACA,OAAO,MAAM8D,kBAAkB,GAAG,MAChCf,UAAU,CAAC9C,sBAAsB,EAAE,YAAY,CAAC;AAClD;AACA;AACA,OAAO,MAAM8D,kBAAkB,GAAG,MAChChB,UAAU,CAAC7C,sBAAsB,EAAE,YAAY,CAAC;AAClD;AACA;AACA,OAAO,MAAM8D,UAAU,GAAG,MACxBjB,UAAU,CAAC5C,mBAAmB,EAAE,SAAS,CAAC;AAE5C,OAAO,MAAMuB,UAAkB,GAAGmC,SAAS,EAAE;AAC7C,OAAO,MAAMjC,WAAmB,GAAGoC,UAAU,EAAE;;AAE/C;AACA;AACA;AACA,OAAO,MAAMC,+BAAuC,GAAG,MAAM;EAC3D,IAAIC,cAAc,GAAGnB,UAAU,CAC7B,iCAAiC,EACjC,kCAAkC,CACnC;EACD,IAAI,CAAC,4BAAAmB,cAAc,OAAdA,cAAc,EAAY,GAAG,CAAC,EAAE;IACnCA,cAAc,GAAI,IAAGA,cAAe,EAAC;EACvC;EACA,OAAOrE,wBAAwB,CAACqE,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,IAAY,GAAGX,WAAW,EAAE"}
|
|
1
|
+
{"version":3,"file":"Settings.js","names":["isPlainObject","has","getRepositoryResourceUrl","ALL_CONTENT_IN_DATA_SETTING","INTERNAL_LOGIN_TYPE","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","UPLOAD_PATH","CAPTCHA_PATH","serverBase","__CONTEXT_PATH__","defaultSettings","CONTEXT_PATH","window","contextPath","CACHE_CONTRIBUTIONS","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_GLOBAL_LOGIN_PAGE","RENDER_GLOBAL_LOGOUT_PAGE","RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE","LOGIN_PATH","ADMINISTRATOR_LOGIN_PATH","LOGOUT_PATH","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","HIDE_WHEN_EMPTY_IGNORE_TASKS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","cacheContributions","getBasePath","getUploadPath","getCaptchaPath","hasAllContentInData","loginType","JAAS","loginPath","loginUsernameField","loginPasswordField","logoutPath","getSwimLaneDiagramConfiguration","configLocation","BASE"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport { getRepositoryResourceUrl } from \"../utils/helpers/repositoryResource\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n INTERNAL_LOGIN_TYPE,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n UPLOAD_PATH,\n CAPTCHA_PATH,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\nconst defaultSettings: { [name: string]: Setting } = {\n // This uses contextPath set from property from server\n CONTEXT_PATH:\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\"),\n\n // Indicates if contributions should be cached\n CACHE_CONTRIBUTIONS: true,\n\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Renders the global log in page\n RENDER_GLOBAL_LOGIN_PAGE: false,\n\n // Renders the global log out page\n RENDER_GLOBAL_LOGOUT_PAGE: false,\n\n // Renders the login variants as option on the global logout page\n RENDER_MULTI_LOGIN_ON_GLOBAL_LOGOUT_PAGE: false,\n\n // Path to login page / component\n LOGIN_PATH: \"/signin\",\n\n // Path to administrator login page / component\n ADMINISTRATOR_LOGIN_PATH: \"\",\n\n // Path to logout page / component\n LOGOUT_PATH: \"/signout\",\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n\n HIDE_WHEN_EMPTY_IGNORE_TASKS: false,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n * Indicates if contributions must be cached\n */\nexport const cacheContributions = (): boolean =>\n getSetting(\"CACHE_CONTRIBUTIONS\", true);\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const getBasePath = (): string =>\n getSetting(\"CONTEXT_PATH\", \"/BeInformed\");\n\n/**\n * Path to upload service\n */\nexport const getUploadPath = (): string => `${getBasePath()}${UPLOAD_PATH}`;\n\n/**\n * Path to captcha service\n */\nexport const getCaptchaPath = (): string => `${getBasePath()}${CAPTCHA_PATH}`;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n *\n * Preview does not support pac4j, thus is probably not configured when started, which results in login type JAAS\n */\nexport const loginType = (): string =>\n getSetting(LOGIN_TYPE, INTERNAL_LOGIN_TYPE.JAAS);\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/callback?client_name=FormClient\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/logout\");\n\nexport const LOGIN_PATH: string = loginPath();\nexport const LOGOUT_PATH: string = logoutPath();\n\n/**\n * Model overview swim lane configuration\n */\nexport const getSwimLaneDiagramConfiguration: Object = () => {\n let configLocation = getSetting(\n \"SWIM_LANE_DIAGRAM_CONFIGURATION\",\n \"/Library/Diagrams/Overviews.json\"\n );\n if (!configLocation.startsWith(\"/\")) {\n configLocation = `/${configLocation}`;\n }\n return getRepositoryResourceUrl(configLocation);\n};\n\n/**\n * Backwards compatible export of BASE constant\n */\nexport const BASE: string = getBasePath();\n"],"mappings":";;AACA,SAASA,aAAa,EAAEC,GAAG,QAAQ,0BAA0B;AAC7D,SAASC,wBAAwB,QAAQ,qCAAqC;AAC9E,SACEC,2BAA2B,EAC3BC,mBAAmB,EACnBC,UAAU,EACVC,kBAAkB,EAClBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,EACnBC,WAAW,EACXC,YAAY,QACP,aAAa;AAIpB,MAAMC,UAAU,GACd,OAAOC,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAGA,gBAAgB;AAEnE,MAAMC,eAA4C,GAAG;EACnD;EACAC,YAAY,EACVH,UAAU,KACT,OAAOI,MAAM,KAAK,WAAW,IAAIA,MAAM,CAACC,WAAW,GAChDD,MAAM,CAACC,WAAW,GAClB,aAAa,CAAC;EAEpB;EACAC,mBAAmB,EAAE,IAAI;EAEzB;EACAC,4BAA4B,EAAE,IAAI;EAElC;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,kBAAkB,EAAE,KAAK;EAEzB;EACAC,sBAAsB,EAAE,IAAI;EAE5B;EACAC,qCAAqC,EAAE,IAAI;EAE3C;EACAC,oCAAoC,EAAE,KAAK;EAE3C;EACAC,oBAAoB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;EAE/C;EACAC,yBAAyB,EAAE,IAAI;EAE/B;EACAC,6BAA6B,EAAE,IAAI;EAEnC;EACAC,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;EAE7B;EACAC,wBAAwB,EAAE,KAAK;EAE/B;EACAC,yBAAyB,EAAE,KAAK;EAEhC;EACAC,wCAAwC,EAAE,KAAK;EAE/C;EACAC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AAU,CAC7B,iCAAiC,EACjC,kCAAkC,CACnC;EACD,IAAI,CAAC,4BAAAoB,cAAc,OAAdA,cAAc,EAAY,GAAG,CAAC,EAAE;IACnCA,cAAc,GAAI,IAAGA,cAAe,EAAC;EACvC;EACA,OAAOvE,wBAAwB,CAACuE,cAAc,CAAC;AACjD,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,IAAY,GAAGZ,WAAW,EAAE"}
|
|
@@ -63,10 +63,13 @@ export default class ApplicationModel extends ResourceModel {
|
|
|
63
63
|
*/
|
|
64
64
|
get authenticationTypes() {
|
|
65
65
|
const authenticationTypes = this.getContribution("security", [DEFAULT_AUTHENTICATION_TYPE]);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
if (authenticationTypes) {
|
|
67
|
+
//put primary first
|
|
68
|
+
return authenticationTypes?.sort((a, b) => a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1);
|
|
69
|
+
}
|
|
70
|
+
return [DEFAULT_AUTHENTICATION_TYPE];
|
|
69
71
|
}
|
|
72
|
+
|
|
70
73
|
/**
|
|
71
74
|
* Getting the tab links
|
|
72
75
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationModel.js","names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","DEFAULT_AUTHENTICATION_TYPE","ApplicationModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","setChildModels","models","userServiceModel","model","userServices","label","getContribution","authenticationTypes","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","create","_userServices","isLoggedIn","userHref","userLink"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n //put primary first\n
|
|
1
|
+
{"version":3,"file":"ApplicationModel.js","names":["ResourceModel","LinkModel","UserServicesModel","NotAllowedUriException","DEFAULT_AUTHENTICATION_TYPE","ApplicationModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","setChildModels","models","userServiceModel","model","userServices","label","getContribution","authenticationTypes","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","create","_userServices","isLoggedIn","userHref","userLink"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\"\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\"\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort(\n (a: AuthenticationType, b: AuthenticationType) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\"modelcatalog\", \"/modelcatalog\", \"Model catalog\");\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices != null && this.userServices.userLink != null) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n}\n"],"mappings":";;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,OAAOC,iBAAiB,MAAM,2BAA2B;AAEzD,SAASC,sBAAsB,QAAQ,kBAAkB;AAEzD,SAASC,2BAA2B,QAAQ,iBAAiB;AAO7D;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASL,aAAa,CAAC;EAAA;IAAA;IAAA;EAAA;EAG1D;AACF;AACA;EACE,IAAIM,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,aAAa;EAErD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,WAAW,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,cAAc,CAAC;IAC3D,IAAIF,WAAW,IAAIA,WAAW,CAACG,IAAI,CAACC,IAAI,KAAK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AGmB,KAAK,GAAG,IAAI;EACxE;;EAEA;AACF;AACA;EACE,IAAIC,YAAY,GAAuB;IACrC,OAAO,IAAI,CAACY,aAAa,GAAG,IAAI,CAACA,aAAa,GAAG,IAAI;EACvD;;EAEA;AACF;AACA;EACE,IAAIC,UAAU,GAAY;IACxB,OAAO,IAAI,CAACb,YAAY,EAAEa,UAAU,IAAI,KAAK;EAC/C;;EAEA;AACF;AACA;AACA;EACE,IAAIC,QAAQ,GAAgB;IAC1B,IAAI,IAAI,CAACd,YAAY,IAAI,IAAI,IAAI,IAAI,CAACA,YAAY,CAACe,QAAQ,IAAI,IAAI,EAAE;MACnE,OAAO,IAAI,CAACf,YAAY,CAACe,QAAQ,CAACrB,IAAI;IACxC;IAEA,OAAO,IAAI;EACb;AACF"}
|
|
@@ -5,7 +5,7 @@ import { HTTP_METHODS } from "../constants/Constants";
|
|
|
5
5
|
import universalFetch from "../utils/fetch/universalFetch";
|
|
6
6
|
import Cache from "../utils/browser/Cache";
|
|
7
7
|
import { UnauthorizedException } from "../exceptions";
|
|
8
|
-
import { loginType, loginPath, loginPasswordField, loginUsernameField, logoutPath, getBasePath } from "../constants";
|
|
8
|
+
import { INTERNAL_LOGIN_TYPE, loginType, loginPath, loginPasswordField, loginUsernameField, logoutPath, getBasePath } from "../constants";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
*/
|
|
@@ -21,13 +21,13 @@ class Authenticate {
|
|
|
21
21
|
*/
|
|
22
22
|
get authenticationType() {
|
|
23
23
|
const type = loginType();
|
|
24
|
-
if (!type || type ===
|
|
25
|
-
return
|
|
24
|
+
if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {
|
|
25
|
+
return INTERNAL_LOGIN_TYPE.JAAS;
|
|
26
26
|
}
|
|
27
27
|
if (_includesInstanceProperty(type).call(type, "FormClient")) {
|
|
28
|
-
return
|
|
28
|
+
return INTERNAL_LOGIN_TYPE.PAC4J_FORM;
|
|
29
29
|
} else if (_includesInstanceProperty(type).call(type, "BasicClient")) {
|
|
30
|
-
return
|
|
30
|
+
return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;
|
|
31
31
|
}
|
|
32
32
|
throw new Error(`Unsupported login type found: ${type}`);
|
|
33
33
|
}
|
|
@@ -35,7 +35,7 @@ class Authenticate {
|
|
|
35
35
|
/**
|
|
36
36
|
*/
|
|
37
37
|
get isBasicAuthentication() {
|
|
38
|
-
return this._isBasic || this.authenticationType ===
|
|
38
|
+
return this._isBasic || this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -78,9 +78,9 @@ class Authenticate {
|
|
|
78
78
|
*/
|
|
79
79
|
login(username, password) {
|
|
80
80
|
switch (this.authenticationType) {
|
|
81
|
-
case
|
|
81
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
82
82
|
return this.doFormLogin(username, password);
|
|
83
|
-
case
|
|
83
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
84
84
|
return this.doBasicAuthentication(username, password);
|
|
85
85
|
default:
|
|
86
86
|
return this.doJaasAuthentication(username, password);
|
|
@@ -91,8 +91,8 @@ class Authenticate {
|
|
|
91
91
|
*/
|
|
92
92
|
getFormLoginUrl() {
|
|
93
93
|
switch (this.authenticationType) {
|
|
94
|
-
case
|
|
95
|
-
case
|
|
94
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
95
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
96
96
|
return `${getBasePath()}${loginPath()}`;
|
|
97
97
|
default:
|
|
98
98
|
return `${getBasePath()}/j_security_check`;
|
|
@@ -105,8 +105,8 @@ class Authenticate {
|
|
|
105
105
|
const encodedUsername = encodeURIComponent(username);
|
|
106
106
|
const encodedPassword = encodeURIComponent(password);
|
|
107
107
|
switch (this.authenticationType) {
|
|
108
|
-
case
|
|
109
|
-
case
|
|
108
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
109
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
110
110
|
return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;
|
|
111
111
|
default:
|
|
112
112
|
return `j_username=${encodedUsername}&j_password=${encodedPassword}`;
|
|
@@ -145,11 +145,23 @@ class Authenticate {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
/**
|
|
149
|
+
*/
|
|
150
|
+
getLogoutUrl() {
|
|
151
|
+
switch (this.authenticationType) {
|
|
152
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:
|
|
153
|
+
case INTERNAL_LOGIN_TYPE.PAC4J_FORM:
|
|
154
|
+
return `${getBasePath()}${logoutPath()}`;
|
|
155
|
+
default:
|
|
156
|
+
return `${getBasePath()}/Logoff`;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
148
160
|
/**
|
|
149
161
|
*/
|
|
150
162
|
logout() {
|
|
151
163
|
return universalFetch({
|
|
152
|
-
url:
|
|
164
|
+
url: this.getLogoutUrl()
|
|
153
165
|
}).then(response => {
|
|
154
166
|
// clear cache because of cached contributions
|
|
155
167
|
Cache.clear();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Authenticate.js","names":["HTTP_METHODS","universalFetch","Cache","UnauthorizedException","loginType","loginPath","loginPasswordField","loginUsernameField","logoutPath","getBasePath","Authenticate","constructor","_isBasic","authenticationType","type","Error","isBasicAuthentication","requestLogin","url","method","GET","headers","Accept","initLogin","resolve","catch","error","login","username","password","doFormLogin","doBasicAuthentication","doJaasAuthentication","getFormLoginUrl","getFormLoginData","encodedUsername","encodeURIComponent","encodedPassword","POST","data","addItem","btoa","then","logout","response","clear"],"sources":["../../src/modularui/Authenticate.js"],"sourcesContent":["// @flow\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport Cache from \"../utils/browser/Cache\";\n\nimport { UnauthorizedException } from \"../exceptions\";\nimport {\n loginType,\n loginPath,\n loginPasswordField,\n loginUsernameField,\n logoutPath,\n getBasePath,\n} from \"../constants\";\n\n/**\n */\nclass Authenticate {\n _isBasic: boolean;\n\n /**\n */\n constructor() {\n this._isBasic = false;\n }\n\n /**\n */\n get authenticationType():
|
|
1
|
+
{"version":3,"file":"Authenticate.js","names":["HTTP_METHODS","universalFetch","Cache","UnauthorizedException","INTERNAL_LOGIN_TYPE","loginType","loginPath","loginPasswordField","loginUsernameField","logoutPath","getBasePath","Authenticate","constructor","_isBasic","authenticationType","type","JAAS","PAC4J_FORM","PAC4J_BASIC","Error","isBasicAuthentication","requestLogin","url","method","GET","headers","Accept","initLogin","resolve","catch","error","login","username","password","doFormLogin","doBasicAuthentication","doJaasAuthentication","getFormLoginUrl","getFormLoginData","encodedUsername","encodeURIComponent","encodedPassword","POST","data","addItem","btoa","then","getLogoutUrl","logout","response","clear"],"sources":["../../src/modularui/Authenticate.js"],"sourcesContent":["// @flow\nimport { HTTP_METHODS } from \"../constants/Constants\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport Cache from \"../utils/browser/Cache\";\n\nimport { UnauthorizedException } from \"../exceptions\";\nimport {\n INTERNAL_LOGIN_TYPE,\n loginType,\n loginPath,\n loginPasswordField,\n loginUsernameField,\n logoutPath,\n getBasePath,\n} from \"../constants\";\n\n/**\n */\nclass Authenticate {\n _isBasic: boolean;\n\n /**\n */\n constructor() {\n this._isBasic = false;\n }\n\n /**\n */\n get authenticationType(): $Keys<typeof INTERNAL_LOGIN_TYPE> {\n const type = loginType();\n\n if (!type || type === INTERNAL_LOGIN_TYPE.JAAS) {\n return INTERNAL_LOGIN_TYPE.JAAS;\n }\n\n if (type.includes(\"FormClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_FORM;\n } else if (type.includes(\"BasicClient\")) {\n return INTERNAL_LOGIN_TYPE.PAC4J_BASIC;\n }\n\n throw new Error(`Unsupported login type found: ${type}`);\n }\n\n /**\n */\n get isBasicAuthentication(): boolean {\n return (\n this._isBasic ||\n this.authenticationType === INTERNAL_LOGIN_TYPE.PAC4J_BASIC\n );\n }\n\n /**\n */\n set isBasicAuthentication(isBasicAuthentication: boolean) {\n this._isBasic = isBasicAuthentication;\n }\n\n /**\n */\n requestLogin(): Promise<any> {\n return universalFetch({\n url: `${getBasePath()}/login`,\n method: HTTP_METHODS.GET,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n });\n }\n\n /**\n */\n initLogin(initLogin: boolean): Promise<any> {\n if (this.isBasicAuthentication || !initLogin) {\n return Promise.resolve(true);\n }\n\n return this.requestLogin().catch((error) => {\n // when an unauthorizedexception is received on a request to the login service,\n // this indicates a basic authorization scenario\n // in case of form based authentication other exceptions are thrown\n if (error instanceof UnauthorizedException) {\n this.isBasicAuthentication = true;\n }\n\n return Promise.resolve({});\n });\n }\n\n /**\n */\n login(username: string, password: string): Promise<any> {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return this.doFormLogin(username, password);\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n return this.doBasicAuthentication(username, password);\n default:\n return this.doJaasAuthentication(username, password);\n }\n }\n\n /**\n */\n getFormLoginUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${loginPath()}`;\n default:\n return `${getBasePath()}/j_security_check`;\n }\n }\n\n /**\n */\n getFormLoginData(username: string, password: string): string {\n const encodedUsername = encodeURIComponent(username);\n const encodedPassword = encodeURIComponent(password);\n\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${loginUsernameField()}=${encodedUsername}&${loginPasswordField()}=${encodedPassword}`;\n default:\n return `j_username=${encodedUsername}&j_password=${encodedPassword}`;\n }\n }\n\n /**\n */\n doFormLogin(username: string, password: string): Promise<any> {\n return universalFetch({\n url: this.getFormLoginUrl(),\n method: HTTP_METHODS.POST,\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/x-www-form-urlencoded\",\n },\n data: this.getFormLoginData(username, password),\n });\n }\n\n /**\n */\n doBasicAuthentication(username: string, password: string): Promise<any> {\n Cache.addItem(\"basic\", btoa(`${username}:${password}`));\n return this.requestLogin();\n }\n\n /**\n */\n doJaasAuthentication(username: string, password: string): Promise<any> {\n return this.initLogin(true).then(() => {\n if (this.isBasicAuthentication) {\n return this.doBasicAuthentication(username, password);\n }\n return this.doFormLogin(username, password);\n });\n }\n\n /**\n */\n getLogoutUrl(): string {\n switch (this.authenticationType) {\n case INTERNAL_LOGIN_TYPE.PAC4J_BASIC:\n case INTERNAL_LOGIN_TYPE.PAC4J_FORM:\n return `${getBasePath()}${logoutPath()}`;\n default:\n return `${getBasePath()}/Logoff`;\n }\n }\n\n /**\n */\n logout(): Promise<any> {\n return universalFetch({\n url: this.getLogoutUrl(),\n }).then((response) => {\n // clear cache because of cached contributions\n Cache.clear();\n return response;\n });\n }\n}\n\nexport default Authenticate;\n"],"mappings":";;;AACA,SAASA,YAAY,QAAQ,wBAAwB;AAErD,OAAOC,cAAc,MAAM,+BAA+B;AAC1D,OAAOC,KAAK,MAAM,wBAAwB;AAE1C,SAASC,qBAAqB,QAAQ,eAAe;AACrD,SACEC,mBAAmB,EACnBC,SAAS,EACTC,SAAS,EACTC,kBAAkB,EAClBC,kBAAkB,EAClBC,UAAU,EACVC,WAAW,QACN,cAAc;;AAErB;AACA;AACA,MAAMC,YAAY,CAAC;EAGjB;AACF;EACEC,WAAW,GAAG;IAAA;IACZ,IAAI,CAACC,QAAQ,GAAG,KAAK;EACvB;;EAEA;AACF;EACE,IAAIC,kBAAkB,GAAsC;IAC1D,MAAMC,IAAI,GAAGV,SAAS,EAAE;IAExB,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AAC;EACJ;AACF;AAEA,eAAetC,YAAY"}
|
|
@@ -2,9 +2,12 @@ import styled from "styled-components";
|
|
|
2
2
|
import { spacers, spacer } from "../react-theme/utils/spacers";
|
|
3
3
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
4
4
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
// $FlowFixMe
|
|
5
6
|
const StyledBoundary = /*#__PURE__*/styled.div.withConfig({
|
|
6
7
|
componentId: "sc-xsbtpo-0"
|
|
7
8
|
})(["padding:", ";margin-bottom:", ";background-color:#e9ecef;border-radius:0.3em;"], spacers(2, 1), spacer(2));
|
|
9
|
+
|
|
10
|
+
// $FlowFixMe
|
|
8
11
|
const StyledStack = /*#__PURE__*/styled.pre.withConfig({
|
|
9
12
|
componentId: "sc-xsbtpo-1"
|
|
10
13
|
})(["display:block;font-size:87.5%;color:#212529;font-style:italic;"]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundaryFallback.js","names":["styled","spacers","spacer","StyledBoundary","div","StyledStack","pre","ErrorBoundaryFallback","className","componentStack","error","toString","displayName"],"sources":["../../src/react/ErrorBoundaryFallback.js"],"sourcesContent":["// @flow\nimport styled from \"styled-components\";\nimport { spacers, spacer } from \"../react-theme/utils/spacers\";\n\nimport type { StyledComponent } from \"styled-components\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { Node } from \"react\";\n\nexport type Props = {\n +className?: string,\n +componentStack: string,\n +error: Error,\n};\n\nconst StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`\n padding: ${spacers(2, 1)};\n margin-bottom: ${spacer(2)};\n background-color: #e9ecef;\n border-radius: 0.3em;\n`;\n\nconst StyledStack = styled.pre`\n display: block;\n font-size: 87.5%;\n color: #212529;\n font-style: italic;\n`;\n\n/**\n */\nconst ErrorBoundaryFallback = ({\n className,\n componentStack,\n error,\n}: Props): Node => (\n <StyledBoundary className={className}>\n <h2>{error.toString()}</h2>\n <StyledStack className=\"debug\">{componentStack}</StyledStack>\n </StyledBoundary>\n);\n\nErrorBoundaryFallback.displayName = \"BI.ErrorBoundaryFallback\";\n\nexport default ErrorBoundaryFallback;\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,mBAAmB;AACtC,SAASC,OAAO,EAAEC,MAAM,QAAQ,8BAA8B;AAAC;AAAA;AAY/D,MAAMC,cAA6C,gBAAGH,MAAM,CAACI,GAAG;EAAA;AAAA,sFACnDH,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACPC,MAAM,CAAC,CAAC,CAAC,CAG3B;
|
|
1
|
+
{"version":3,"file":"ErrorBoundaryFallback.js","names":["styled","spacers","spacer","StyledBoundary","div","StyledStack","pre","ErrorBoundaryFallback","className","componentStack","error","toString","displayName"],"sources":["../../src/react/ErrorBoundaryFallback.js"],"sourcesContent":["// @flow\nimport styled from \"styled-components\";\nimport { spacers, spacer } from \"../react-theme/utils/spacers\";\n\nimport type { StyledComponent } from \"styled-components\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { Node } from \"react\";\n\nexport type Props = {\n +className?: string,\n +componentStack: string,\n +error: Error,\n};\n\n// $FlowFixMe\nconst StyledBoundary: StyledComponent<{}, Theme, *> = styled.div`\n padding: ${spacers(2, 1)};\n margin-bottom: ${spacer(2)};\n background-color: #e9ecef;\n border-radius: 0.3em;\n`;\n\n// $FlowFixMe\nconst StyledStack = styled.pre`\n display: block;\n font-size: 87.5%;\n color: #212529;\n font-style: italic;\n`;\n\n/**\n */\nconst ErrorBoundaryFallback = ({\n className,\n componentStack,\n error,\n}: Props): Node => (\n <StyledBoundary className={className}>\n <h2>{error.toString()}</h2>\n <StyledStack className=\"debug\">{componentStack}</StyledStack>\n </StyledBoundary>\n);\n\nErrorBoundaryFallback.displayName = \"BI.ErrorBoundaryFallback\";\n\nexport default ErrorBoundaryFallback;\n"],"mappings":"AACA,OAAOA,MAAM,MAAM,mBAAmB;AACtC,SAASC,OAAO,EAAEC,MAAM,QAAQ,8BAA8B;AAAC;AAAA;AAY/D;AACA,MAAMC,cAA6C,gBAAGH,MAAM,CAACI,GAAG;EAAA;AAAA,sFACnDH,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,EACPC,MAAM,CAAC,CAAC,CAAC,CAG3B;;AAED;AACA,MAAMG,WAAW,gBAAGL,MAAM,CAACM,GAAG;EAAA;AAAA,sEAK7B;;AAED;AACA;AACA,MAAMC,qBAAqB,GAAG;EAAA,IAAC;IAC7BC,SAAS;IACTC,cAAc;IACdC;EACK,CAAC;EAAA,oBACN,MAAC,cAAc;IAAC,SAAS,EAAEF,SAAU;IAAA,wBACnC;MAAA,UAAKE,KAAK,CAACC,QAAQ;IAAE,EAAM,eAC3B,KAAC,WAAW;MAAC,SAAS,EAAC,OAAO;MAAA,UAAEF;IAAc,EAAe;EAAA,EAC9C;AAAA,CAClB;AAEDF,qBAAqB,CAACK,WAAW,GAAG,0BAA0B;AAE9D,eAAeL,qBAAqB"}
|
|
@@ -16,7 +16,8 @@ const serverNoSSR = _ref => {
|
|
|
16
16
|
theme,
|
|
17
17
|
render,
|
|
18
18
|
template,
|
|
19
|
-
beforeRenderHooks
|
|
19
|
+
beforeRenderHooks,
|
|
20
|
+
preloadApplication = true
|
|
20
21
|
} = _ref;
|
|
21
22
|
const UUID = createUUID();
|
|
22
23
|
__webpack_nonce__ = UUID; // NOSONAR
|
|
@@ -31,7 +32,9 @@ const serverNoSSR = _ref => {
|
|
|
31
32
|
createTheme(storedTheme, theme);
|
|
32
33
|
}
|
|
33
34
|
setI18n(store, locales, request);
|
|
34
|
-
|
|
35
|
+
if (preloadApplication) {
|
|
36
|
+
setApplication(store);
|
|
37
|
+
}
|
|
35
38
|
handleErrors(store);
|
|
36
39
|
handleBeforeRenderHooks(beforeRenderHooks, {
|
|
37
40
|
store,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverNoSSR.js","names":["createUUID","getFullRequestHref","createReduxStore","setI18n","setApplication","setServerPreferences","setConfigurationTheme","handleErrors","handleBeforeRenderHooks","renderSSRMinimal","createTheme","serverNoSSR","request","locales","customReducers","serverPreferences","theme","render","template","beforeRenderHooks","UUID","__webpack_nonce__","requestHref","store","storedTheme","getState","preferences"],"sources":["../../src/react-server/serverNoSSR.js"],"sourcesContent":["// @flow\nimport \"./contextPath\";\n\nimport createUUID from \"../utils/helpers/createUUID\";\nimport { getFullRequestHref } from \"./requestInformation\";\n\nimport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n handleErrors,\n} from \"./serverUtil\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport renderSSRMinimal from \"./renderSSRMinimal\";\n\nimport createTheme from \"../react-theme/createTheme\";\n\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { PreferenceValue } from \"./serverUtil\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { Theme } from \"../react-theme/types\";\n\ntype serverProps = {\n request: HttpServletRequestJava,\n locales?: Array<LocaleConfiguration>,\n customReducers?: Object,\n theme?: Theme | Array<Theme>,\n serverPreferences?: Array<string | PreferenceValue>,\n render: Function,\n template?: (TemplateProps) => string,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n};\n\n/**\n */\nconst serverNoSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme,\n render,\n template,\n beforeRenderHooks,\n}: serverProps): string => {\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const requestHref = getFullRequestHref(request);\n\n const store = createReduxStore(requestHref, customReducers);\n\n setServerPreferences(store, serverPreferences);\n setConfigurationTheme(store);\n\n if (theme) {\n const storedTheme = store.getState()?.preferences?.theme;\n //$FlowFixMe[incompatible-call]\n createTheme(storedTheme, theme);\n }\n\n setI18n(store, locales, request);\n\n setApplication(store);\n\n handleErrors(store);\n\n handleBeforeRenderHooks(beforeRenderHooks, { store, request });\n\n return renderSSRMinimal({ store, theme, UUID, render, template });\n};\n\nexport default serverNoSSR;\n"],"mappings":"AACA,OAAO,eAAe;AAEtB,OAAOA,UAAU,MAAM,6BAA6B;AACpD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SACEC,gBAAgB,EAChBC,OAAO,EACPC,cAAc,EACdC,oBAAoB,EACpBC,qBAAqB,EACrBC,YAAY,QACP,cAAc;AAErB,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,OAAOC,WAAW,MAAM,4BAA4B;
|
|
1
|
+
{"version":3,"file":"serverNoSSR.js","names":["createUUID","getFullRequestHref","createReduxStore","setI18n","setApplication","setServerPreferences","setConfigurationTheme","handleErrors","handleBeforeRenderHooks","renderSSRMinimal","createTheme","serverNoSSR","request","locales","customReducers","serverPreferences","theme","render","template","beforeRenderHooks","preloadApplication","UUID","__webpack_nonce__","requestHref","store","storedTheme","getState","preferences"],"sources":["../../src/react-server/serverNoSSR.js"],"sourcesContent":["// @flow\nimport \"./contextPath\";\n\nimport createUUID from \"../utils/helpers/createUUID\";\nimport { getFullRequestHref } from \"./requestInformation\";\n\nimport {\n createReduxStore,\n setI18n,\n setApplication,\n setServerPreferences,\n setConfigurationTheme,\n handleErrors,\n} from \"./serverUtil\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport renderSSRMinimal from \"./renderSSRMinimal\";\n\nimport createTheme from \"../react-theme/createTheme\";\n\nimport type { TemplateProps } from \"./htmlpage\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { PreferenceValue } from \"./serverUtil\";\nimport type { LocaleConfiguration } from \"../i18n/types\";\nimport type { Theme } from \"../react-theme/types\";\n\ntype serverProps = {\n request: HttpServletRequestJava,\n locales?: Array<LocaleConfiguration>,\n customReducers?: Object,\n theme?: Theme | Array<Theme>,\n serverPreferences?: Array<string | PreferenceValue>,\n render: Function,\n template?: (TemplateProps) => string,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n preloadApplication?: boolean,\n};\n\n/**\n */\nconst serverNoSSR = ({\n request,\n locales,\n customReducers,\n serverPreferences = [],\n theme,\n render,\n template,\n beforeRenderHooks,\n preloadApplication = true,\n}: serverProps): string => {\n const UUID = createUUID();\n __webpack_nonce__ = UUID; // NOSONAR\n\n const requestHref = getFullRequestHref(request);\n\n const store = createReduxStore(requestHref, customReducers);\n\n setServerPreferences(store, serverPreferences);\n setConfigurationTheme(store);\n\n if (theme) {\n const storedTheme = store.getState()?.preferences?.theme;\n //$FlowFixMe[incompatible-call]\n createTheme(storedTheme, theme);\n }\n\n setI18n(store, locales, request);\n\n if (preloadApplication) {\n setApplication(store);\n }\n\n handleErrors(store);\n\n handleBeforeRenderHooks(beforeRenderHooks, { store, request });\n\n return renderSSRMinimal({ store, theme, UUID, render, template });\n};\n\nexport default serverNoSSR;\n"],"mappings":"AACA,OAAO,eAAe;AAEtB,OAAOA,UAAU,MAAM,6BAA6B;AACpD,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SACEC,gBAAgB,EAChBC,OAAO,EACPC,cAAc,EACdC,oBAAoB,EACpBC,qBAAqB,EACrBC,YAAY,QACP,cAAc;AAErB,SAASC,uBAAuB,QAAQ,kCAAkC;AAE1E,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,OAAOC,WAAW,MAAM,4BAA4B;AAoBpD;AACA;AACA,MAAMC,WAAW,GAAG,QAUO;EAAA,IAVN;IACnBC,OAAO;IACPC,OAAO;IACPC,cAAc;IACdC,iBAAiB,GAAG,EAAE;IACtBC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,iBAAiB;IACjBC,kBAAkB,GAAG;EACV,CAAC;EACZ,MAAMC,IAAI,GAAGrB,UAAU,EAAE;EACzBsB,iBAAiB,GAAGD,IAAI,CAAC,CAAC;;EAE1B,MAAME,WAAW,GAAGtB,kBAAkB,CAACW,OAAO,CAAC;EAE/C,MAAMY,KAAK,GAAGtB,gBAAgB,CAACqB,WAAW,EAAET,cAAc,CAAC;EAE3DT,oBAAoB,CAACmB,KAAK,EAAET,iBAAiB,CAAC;EAC9CT,qBAAqB,CAACkB,KAAK,CAAC;EAE5B,IAAIR,KAAK,EAAE;IACT,MAAMS,WAAW,GAAGD,KAAK,CAACE,QAAQ,EAAE,EAAEC,WAAW,EAAEX,KAAK;IACxD;IACAN,WAAW,CAACe,WAAW,EAAET,KAAK,CAAC;EACjC;EAEAb,OAAO,CAACqB,KAAK,EAAEX,OAAO,EAAED,OAAO,CAAC;EAEhC,IAAIQ,kBAAkB,EAAE;IACtBhB,cAAc,CAACoB,KAAK,CAAC;EACvB;EAEAjB,YAAY,CAACiB,KAAK,CAAC;EAEnBhB,uBAAuB,CAACW,iBAAiB,EAAE;IAAEK,KAAK;IAAEZ;EAAQ,CAAC,CAAC;EAE9D,OAAOH,gBAAgB,CAAC;IAAEe,KAAK;IAAER,KAAK;IAAEK,IAAI;IAAEJ,MAAM;IAAEC;EAAS,CAAC,CAAC;AACnE,CAAC;AAED,eAAeP,WAAW"}
|
|
@@ -127,6 +127,7 @@ const setApplication = store => {
|
|
|
127
127
|
const application = new ModularUIRequest("/", {
|
|
128
128
|
locale: locale
|
|
129
129
|
}).fetchSync();
|
|
130
|
+
application.connectKey = `application(/)(${locale})`;
|
|
130
131
|
store.dispatch(initModels([{
|
|
131
132
|
key: `application(/)(${locale})`,
|
|
132
133
|
model: application
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serverUtil.js","names":["createMemoryHistory","has","deepmerge","configureStore","availableLocales","Locales","getPreferredLocale","setLocales","setServerPreference","setThemePreference","setPreference","setAllContentInDataSetting","setLoginPreferences","getSetting","IllegalArgumentException","initModels","getLocale","ModularUIRequest","createReduxStore","requestHref","customReducers","initialState","history","initialEntries","toString","store","setI18n","locales","request","Array","isArray","mergedLocales","locale","code","customLocale","custLocale","forEach","some","push","enabledLocales","localesInstance","preferredLocale","dispatch","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreferences","preferencesProvider","isStudioContext","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","dataFetcher","fetch","Error","setApplication","getState","application","fetchSync","key","model","e","console","info","handleErrors","state","error","shouldThrowOnServer","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,SAASA,mBAAmB,QAAQ,SAAS;AAC7C,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,SAAS,MAAM,WAAW;AAEjC,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,OAAO,MAAM,iBAAiB;AAErC,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,UAAU,QAAQ,4BAA4B;AAEvD,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,aAAa,EACbC,0BAA0B,EAC1BC,mBAAmB,QACd,8BAA8B;AAErC,SAASC,UAAU,QAAQ,uBAAuB;AAElD,SAASC,wBAAwB,QAAQ,eAAe;AAExD,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,SAAS,QAAQ,yBAAyB;AAEnD,OAAOC,gBAAgB,MAAM,+BAA+B;AAa5D;AACA;AACA,MAAMC,gBAAgB,GAAG,CACvBC,WAAiB,EACjBC,cAAsB,EACtBC,YAAiC,KAClB;EACf;EACA,MAAMC,OAAsB,GAAGtB,mBAAmB,CAAC;IACjDuB,cAAc,EAAE,CAACJ,WAAW,CAACK,QAAQ,EAAE;EACzC,CAAC,CAAC;EAEF,MAAM;IAAEC;EAAM,CAAC,GAAGtB,cAAc,CAACmB,OAAO,EAAEF,cAAc,EAAEC,YAAY,CAAC;EAEvE,OAAOI,KAAK;AACd,CAAC;;AAED;AACA;AACA,MAAMC,OAAO,GAAG,UACdD,KAAiB,EAGd;EAAA,IAFHE,OAAmC,uEAAG,EAAE;EAAA,IACxCC,OAA+B;EAE/B,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EAAE;IAC3B,MAAM,IAAIb,wBAAwB,CAAC,qCAAqC,CAAC;EAC3E;EACA,IAAI,CAACc,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,CAAC,GAAGN,KAAK,CAACI,SAAS,CAACV,GAAG,CAAC;IAEhE,IAAIC,KAAK,EAAE;MACTS,SAAS,CAACV,GAAG,CAAC,GAAG;QACfW,MAAM;QACNC,gBAAgB;QAChBX,KAAK,EAAEA,KAAK,CAACQ,SAAS;MACxB,CAAC;IACH,CAAC,MAAM;MACLC,SAAS,CAACV,GAAG,CAAC,GAAG;QACfW,MAAM;QACNC,gBAAgB;QAChBX,KAAK,EAAEY;MACT,CAAC;IACH;EACF;EAEA,MAAMC,aAAa,GAAG;IACpB,GAAGR,KAAK;IACRI;EACF,CAAC;EAED,OAAO,gBAAeI,aAAa,CAAC,CAACC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC;AAC/D,CAAC;;AAED;AACA;AACA,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;AAED,SACEpE,gBAAgB,EAChBQ,OAAO,EACPkC,cAAc,EACdX,oBAAoB,EACpBG,qBAAqB,EACrB4B,UAAU,EACVX,YAAY,EACZI,SAAS"}
|
|
1
|
+
{"version":3,"file":"serverUtil.js","names":["createMemoryHistory","has","deepmerge","configureStore","availableLocales","Locales","getPreferredLocale","setLocales","setServerPreference","setThemePreference","setPreference","setAllContentInDataSetting","setLoginPreferences","getSetting","IllegalArgumentException","initModels","getLocale","ModularUIRequest","createReduxStore","requestHref","customReducers","initialState","history","initialEntries","toString","store","setI18n","locales","request","Array","isArray","mergedLocales","locale","code","customLocale","custLocale","forEach","some","push","enabledLocales","localesInstance","preferredLocale","dispatch","setServerPreferencesFromArray","serverPreferences","serverPreference","name","defaultValue","type","setServerPreferences","preferencesProvider","isStudioContext","setConfigurationTheme","configTheme","configFileLocation","getLayoutConfigFileLocation","configFilePath","dataFetcher","fetch","Error","setApplication","getState","application","fetchSync","connectKey","key","model","e","console","info","handleErrors","state","error","shouldThrowOnServer","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,SAASA,mBAAmB,QAAQ,SAAS;AAC7C,SAASC,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,SAAS,MAAM,WAAW;AAEjC,OAAOC,cAAc,MAAM,+BAA+B;AAE1D,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,OAAOC,OAAO,MAAM,iBAAiB;AAErC,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,UAAU,QAAQ,4BAA4B;AAEvD,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,aAAa,EACbC,0BAA0B,EAC1BC,mBAAmB,QACd,8BAA8B;AAErC,SAASC,UAAU,QAAQ,uBAAuB;AAElD,SAASC,wBAAwB,QAAQ,eAAe;AAExD,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,SAAS,QAAQ,yBAAyB;AAEnD,OAAOC,gBAAgB,MAAM,+BAA+B;AAa5D;AACA;AACA,MAAMC,gBAAgB,GAAG,CACvBC,WAAiB,EACjBC,cAAsB,EACtBC,YAAiC,KAClB;EACf;EACA,MAAMC,OAAsB,GAAGtB,mBAAmB,CAAC;IACjDuB,cAAc,EAAE,CAACJ,WAAW,CAACK,QAAQ,EAAE;EACzC,CAAC,CAAC;EAEF,MAAM;IAAEC;EAAM,CAAC,GAAGtB,cAAc,CAACmB,OAAO,EAAEF,cAAc,EAAEC,YAAY,CAAC;EAEvE,OAAOI,KAAK;AACd,CAAC;;AAED;AACA;AACA,MAAMC,OAAO,GAAG,UACdD,KAAiB,EAGd;EAAA,IAFHE,OAAmC,uEAAG,EAAE;EAAA,IACxCC,OAA+B;EAE/B,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,EA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exports.USERPROFILE_PATH = exports.UPLOAD_PATH = exports.TIMEVERSION_FILTER_NAME = exports.RESOURCE_PATH = exports.PARAMETER_SEPARATOR = exports.NOTIFICATION_TYPES = exports.MODULARUI_STATUS = exports.LOGOUT_PATH_SETTING = exports.LOGIN_USERNAME_SETTING = exports.LOGIN_TYPE = exports.LOGIN_PATH_SETTING = exports.LOGIN_PASSWORD_SETTING = exports.KEYCODES = exports.IS_SYNC = exports.IS_SERVER = exports.ISO_TIME_FORMAT = exports.ISO_TIMESTAMP_FORMAT = exports.ISO_DATE_FORMAT = exports.ISO_DATETIME_FORMAT = exports.INPUT_DEBOUNCE_TIMEOUT = exports.HTTP_METHODS = exports.DEFAULT_WEEK_STARTS_ON = exports.DEFAULT_UI_PARAMETERS = exports.DEFAULT_FIRST_WEEK_CONTAINS_DATE = exports.DEFAULT_AUTHENTICATION_TYPE = exports.CONTENT_PATH = exports.CHANGEPASSWORD_PATH = exports.CAPTCHA_PATH = exports.AUTOSAVE_STATUS = exports.ATTRIBUTE_WIDTH = exports.ALL_CONTENT_IN_DATA_SETTING = void 0;
|
|
6
|
+
exports.VALIDATE_DEBOUNCE_TIMEOUT = exports.USERPROFILE_PATH = exports.UPLOAD_PATH = exports.TIMEVERSION_FILTER_NAME = exports.RESOURCE_PATH = exports.PARAMETER_SEPARATOR = exports.NOTIFICATION_TYPES = exports.MODULARUI_STATUS = exports.LOGOUT_PATH_SETTING = exports.LOGIN_USERNAME_SETTING = exports.LOGIN_TYPE = exports.LOGIN_PATH_SETTING = exports.LOGIN_PASSWORD_SETTING = exports.KEYCODES = exports.IS_SYNC = exports.IS_SERVER = exports.ISO_TIME_FORMAT = exports.ISO_TIMESTAMP_FORMAT = exports.ISO_DATE_FORMAT = exports.ISO_DATETIME_FORMAT = exports.INTERNAL_LOGIN_TYPE = exports.INPUT_DEBOUNCE_TIMEOUT = exports.HTTP_METHODS = exports.DEFAULT_WEEK_STARTS_ON = exports.DEFAULT_UI_PARAMETERS = exports.DEFAULT_FIRST_WEEK_CONTAINS_DATE = exports.DEFAULT_AUTHENTICATION_TYPE = exports.CONTENT_PATH = exports.CHANGEPASSWORD_PATH = exports.CAPTCHA_PATH = exports.AUTOSAVE_STATUS = exports.ATTRIBUTE_WIDTH = exports.ALL_CONTENT_IN_DATA_SETTING = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* path to content service
|
|
9
9
|
*/
|
|
@@ -182,6 +182,12 @@ const ATTRIBUTE_WIDTH = {
|
|
|
182
182
|
exports.ATTRIBUTE_WIDTH = ATTRIBUTE_WIDTH;
|
|
183
183
|
const ALL_CONTENT_IN_DATA_SETTING = "hasAllContentInData";
|
|
184
184
|
exports.ALL_CONTENT_IN_DATA_SETTING = ALL_CONTENT_IN_DATA_SETTING;
|
|
185
|
+
const INTERNAL_LOGIN_TYPE = {
|
|
186
|
+
JAAS: "JAAS",
|
|
187
|
+
PAC4J_FORM: "PAC4J_FORM",
|
|
188
|
+
PAC4J_BASIC: "PAC4J_BASIC"
|
|
189
|
+
};
|
|
190
|
+
exports.INTERNAL_LOGIN_TYPE = INTERNAL_LOGIN_TYPE;
|
|
185
191
|
const LOGIN_TYPE = "security.clients";
|
|
186
192
|
exports.LOGIN_TYPE = LOGIN_TYPE;
|
|
187
193
|
const LOGIN_PATH_SETTING = "FormClient.login_url";
|
|
@@ -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";
|