@beinformed/ui 1.18.3 → 1.18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/esm/constants/Constants.js +1 -0
- package/esm/constants/Constants.js.map +1 -1
- package/esm/constants/Settings.js +10 -3
- package/esm/constants/Settings.js.map +1 -1
- package/esm/hooks/useAuthentication.js +7 -50
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/i18n/Locales.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/form/FormModel.js +3 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/modularui/Authenticate.js +100 -21
- package/esm/modularui/Authenticate.js.map +1 -1
- package/esm/redux/actions/Preferences.js +2 -2
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/SignOut.js +6 -2
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +3 -2
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js +4 -1
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/reducers/AuthReducer.js +0 -10
- package/esm/redux/reducers/AuthReducer.js.map +1 -1
- package/esm/redux/types.js.map +1 -1
- package/esm/utils/helpers/checkResource.js +2 -0
- package/esm/utils/helpers/checkResource.js.map +1 -1
- package/lib/constants/Constants.js +3 -1
- package/lib/constants/Constants.js.flow +1 -0
- package/lib/constants/Constants.js.map +1 -1
- package/lib/constants/LayoutHints.js.map +1 -1
- package/lib/constants/Settings.js +13 -3
- package/lib/constants/Settings.js.flow +8 -3
- package/lib/constants/Settings.js.map +1 -1
- package/lib/exceptions/FetchException.js.map +1 -1
- package/lib/hooks/__tests__/useAuthentication.spec.js.flow +15 -1
- package/lib/hooks/useAllFormsOnModel.js.map +1 -1
- package/lib/hooks/useAuthentication.js +7 -55
- package/lib/hooks/useAuthentication.js.flow +4 -37
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useContent.js.map +1 -1
- package/lib/hooks/useDeepCompareEffect.js.map +1 -1
- package/lib/hooks/useForm.js.map +1 -1
- package/lib/hooks/useI18n.js.map +1 -1
- package/lib/hooks/useModal.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/hooks/useNotification.js.map +1 -1
- package/lib/hooks/usePreference.js.map +1 -1
- package/lib/hooks/useProgressIndicator.js.map +1 -1
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/i18n/Locale.js.map +1 -1
- package/lib/i18n/Locales.js.map +1 -1
- package/lib/i18n/Message.js.map +1 -1
- package/lib/i18n/withMessage.js.map +1 -1
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeContent.js.map +1 -1
- package/lib/models/attributes/AttributeDataHelper.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/HelptextAttributeModel.js.map +1 -1
- package/lib/models/attributes/MemoAttributeModel.js.map +1 -1
- package/lib/models/attributes/MoneyAttributeModel.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/XMLAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintCollection.js.map +1 -1
- package/lib/models/attributes/input-constraints/ConstraintModel.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeDateFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/DateTimeTimeFormatConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/FileSizeConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/IBANConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberBoundaryConstraint.js.map +1 -1
- package/lib/models/attributes/input-constraints/NumberFormatConstraint.js.map +1 -1
- package/lib/models/base/BaseCollection.js.map +1 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/content/SubSectionModel.js.map +1 -1
- package/lib/models/contentconfiguration/ContentConfigurationResults.js.map +1 -1
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +3 -1
- package/lib/models/form/FormModel.js.flow +1 -1
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/layouthint/LayoutHintCollection.js.map +1 -1
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListHeaderModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/paging/PagingModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/process/ProcessStatusSettingsModel.js.map +1 -1
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/Authenticate.js +102 -21
- package/lib/modularui/Authenticate.js.flow +75 -20
- package/lib/modularui/Authenticate.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/react/ErrorBoundaryFallback.js.map +1 -1
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/__tests__/serverUtil.spec.js.flow +6 -4
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/react-server/serverNoSSR.js.map +1 -1
- package/lib/react-server/serverSSR.js.map +1 -1
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/useTheme.js.map +1 -1
- package/lib/react-theme/utils/background.js.map +1 -1
- package/lib/react-theme/utils/colors.js.map +1 -1
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/react-theme/utils/themeProps.js.map +1 -1
- package/lib/redux/_i18n/actions.js.map +1 -1
- package/lib/redux/_i18n/reducer.js.map +1 -1
- package/lib/redux/_modularui/actions.js.map +1 -1
- package/lib/redux/_modularui/connector.js.map +1 -1
- package/lib/redux/_modularui/middleware.js.map +1 -1
- package/lib/redux/_modularui/modularuiUtils.js.map +1 -1
- package/lib/redux/_modularui/reducer.js.map +1 -1
- package/lib/redux/_modularui/selectors.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/connectors.js.map +1 -1
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Notification.js.map +1 -1
- package/lib/redux/actions/Preferences.js +1 -1
- package/lib/redux/actions/Preferences.js.flow +7 -3
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +6 -1
- package/lib/redux/actions/SignOut.js.flow +9 -5
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/FormAttributeSet.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/Modal.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/Notification.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/Progress.js.map +1 -1
- package/lib/redux/connectors/ProgressIndicator.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +3 -5
- package/lib/redux/connectors/SignIn.js.flow +1 -6
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js +5 -1
- package/lib/redux/connectors/SignOut.js.flow +2 -1
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/AuthReducer.js +0 -11
- package/lib/redux/reducers/AuthReducer.js.flow +0 -11
- package/lib/redux/reducers/AuthReducer.js.map +1 -1
- package/lib/redux/reducers/__tests__/AuthReducer.spec.js.flow +0 -9
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/redux/types.js.flow +0 -1
- package/lib/redux/types.js.map +1 -1
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/datetime/DateTimeUtil.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/checkResource.js +2 -0
- package/lib/utils/helpers/checkResource.js.flow +3 -0
- package/lib/utils/helpers/checkResource.js.map +1 -1
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/helpers/text.js.map +1 -1
- package/lib/utils/number/formatValue.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +22 -22
- package/src/constants/Constants.js +1 -0
- package/src/constants/Settings.js +8 -3
- package/src/hooks/__tests__/useAuthentication.spec.js +15 -1
- package/src/hooks/useAuthentication.js +4 -37
- package/src/models/form/FormModel.js +1 -1
- package/src/modularui/Authenticate.js +75 -20
- package/src/react-server/__tests__/serverUtil.spec.js +6 -4
- package/src/redux/actions/Preferences.js +7 -3
- package/src/redux/actions/SignOut.js +9 -5
- package/src/redux/connectors/SignIn.js +1 -6
- package/src/redux/connectors/SignOut.js +2 -1
- package/src/redux/reducers/AuthReducer.js +0 -11
- package/src/redux/reducers/__tests__/AuthReducer.spec.js +0 -9
- package/src/redux/types.js +0 -1
- package/src/utils/helpers/checkResource.js +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
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.18.6](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.18.5...v1.18.6) (2022-05-20)
|
|
6
|
+
|
|
7
|
+
### [1.18.5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.18.4...v1.18.5) (2022-05-20)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **authentication:** remove isAuthenticated flag from auth reducer, use userService on application ([a7ecde7](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/a7ecde77a2850964c72c97f99520e3b1d5d92ee7))
|
|
12
|
+
- **head-request:** add x-requested-with header to prevent basic authentication header on check resource ([24b2075](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/24b2075d7fb0401f5d3261153169b4b2fded47cf))
|
|
13
|
+
- **logout:** return response after logout ([4e1b6b2](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/4e1b6b2adeef8994ba05886a51fc8c37824c9d13))
|
|
14
|
+
- **signout:** improve logout sequence of logout method, improves application reload ([cad3d2d](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/cad3d2d88886808301e06c6efd066cc930225a26))
|
|
15
|
+
|
|
16
|
+
### [1.18.4](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.18.3...v1.18.4) (2022-05-12)
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
- **pac4j:** improve configuration of pac4j login configuration ([20b6da5](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/commit/20b6da53e09a4ec3e2760b75d722485f29044db1))
|
|
21
|
+
|
|
5
22
|
### [1.18.3](https://git.beinformed.com/public/nl.beinformed.bi.layout.lib.ui/compare/v1.18.2...v1.18.3) (2022-05-02)
|
|
6
23
|
|
|
7
24
|
### Bug Fixes
|
|
@@ -192,6 +192,7 @@ export var ATTRIBUTE_WIDTH = {
|
|
|
192
192
|
EXTRA_LARGE: "EXTRA_LARGE"
|
|
193
193
|
};
|
|
194
194
|
export var ALL_CONTENT_IN_DATA_SETTING = "hasAllContentInData";
|
|
195
|
+
export var LOGIN_TYPE = "security.clients";
|
|
195
196
|
export var LOGIN_PATH_SETTING = "FormClient.login_url";
|
|
196
197
|
export var LOGIN_USERNAME_SETTING = "FormClient.username_field_name";
|
|
197
198
|
export var LOGIN_PASSWORD_SETTING = "FormClient.password_field_name";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","names":["USE_CACHE","serverBase","__CONTEXT_PATH__","BASE","window","contextPath","MODULARUI_CONTRIBUTIONS","APPLICATION_URI","APPLICATION_PATH","CONTENT_PATH","UPLOAD_PATH","CAPTCHA_PATH","LOGIN_PATH","LOGOUT_PATH","CHANGEPASSWORD_PATH","USERPROFILE_PATH","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","PARAMETER_OVERVIEW_VIEWTYPE","DEFAULT_UI_PARAMETERS","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","KEYCODES","TAB","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","IS_SYNC","dataFetcher","IS_SERVER","NOTIFICATION_TYPES","SUCCESS","INFO","WARNING","ERROR","HTTP_METHODS","GET","POST","MODULARUI_STATUS","LOADING","FINISHED","AUTOSAVE_STATUS","START","INPUT_DEBOUNCE_TIMEOUT","VALIDATE_DEBOUNCE_TIMEOUT","ATTRIBUTE_WIDTH","EXTRA_SMALL","SMALL","MEDIUM","LARGE","EXTRA_LARGE","ALL_CONTENT_IN_DATA_SETTING","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING"],"sources":["../../src/constants/Constants.js"],"sourcesContent":["// @flow\n/**\n * Indicates if contributions should be cached\n */\nexport const USE_CACHE = true;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const BASE: string =\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\");\n\n/**\n * Path to the contributions api end point\n * /contributions uri part is added through the _links in the data service\n */\nexport const MODULARUI_CONTRIBUTIONS = \"/contributions\";\n\n/**\n * Application uri\n * @private\n */\nconst APPLICATION_URI = \"/\";\n\n/**\n * Base Path\n */\nexport const APPLICATION_PATH: string = BASE + APPLICATION_URI;\n\n/**\n * path to content service\n */\nexport const CONTENT_PATH = `${BASE}/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `${BASE}/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `${BASE}/captchaServices`;\n\n/**\n * Path to login page / component\n */\nexport const LOGIN_PATH = \"/signin\";\n\n/**\n * Path to logout page / component\n */\nexport const LOGOUT_PATH = \"/signout\";\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nconst PARAMETER_OVERVIEW_VIEWTYPE = \"viewType\";\n/**\n * Parameter name for the viewtype toggle\n */\nexport const DEFAULT_UI_PARAMETERS: Array<string> = [\n PARAMETER_OVERVIEW_VIEWTYPE,\n];\n\n/**\n */\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\n/**\n */\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n/**\n */\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\n/**\n */\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * Key codes\n * @type {{SPACE: number, PAGE_DOWN: number, TAB: number, ARROW_RIGHT: number, ARROW_DOWN: number, ENTER: number, ARROW_UP: number, ARROW_LEFT: number, PAGE_UP: number, ESCAPE: number}}\n */\nexport const KEYCODES = {\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\n/**\n * @type {boolean}\n */\nexport const IS_SYNC = typeof dataFetcher !== \"undefined\";\n/**\n * @type {boolean}\n */\nexport const IS_SERVER = IS_SYNC;\n\n/**\n * @type {{SUCCESS: string, ERROR: string, INFO: string, WARNING: string}}\n */\nexport const NOTIFICATION_TYPES = {\n SUCCESS: \"SUCCESS\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n ERROR: \"ERROR\",\n};\n\n/**\n * SUPPORTED HTTP METHODS\n * @type {{POST: string, GET: string}}\n */\nexport const HTTP_METHODS = {\n GET: \"GET\",\n POST: \"POST\",\n};\n\n/**\n * POSSIBLE MODULARUI STATUSSES\n * @type {{LOADING: string, ERROR: string, FINISHED: string}}\n */\nexport const MODULARUI_STATUS = {\n LOADING: \"LOADING\",\n FINISHED: \"FINISHED\",\n ERROR: \"ERROR\",\n};\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport const AUTOSAVE_STATUS = {\n START: \"START\",\n FINISHED: \"FINISHED\",\n};\n\n/**\n * DEBOUNCE INPUT TIMEOUT\n */\nexport const INPUT_DEBOUNCE_TIMEOUT = 100;\n\n/**\n * DEBOUNCE VALIDATION TIMEOUT\n */\nexport const VALIDATE_DEBOUNCE_TIMEOUT = 500;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport const ATTRIBUTE_WIDTH = {\n EXTRA_SMALL: \"EXTRA_SMALL\",\n SMALL: \"SMALL\",\n MEDIUM: \"MEDIUM\",\n LARGE: \"LARGE\",\n EXTRA_LARGE: \"EXTRA_LARGE\",\n};\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\n\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n"],"mappings":"AACA;AACA;AACA;AACA,OAAO,IAAMA,SAAS,GAAG,IAAlB;AAEP,IAAMC,UAAU,GACd,OAAO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AAEP;AACA;AACA;;AACA,OAAO,IAAMC,eAAe,GAAG;EAC7BC,WAAW,EAAE,aADgB;EAE7BC,KAAK,EAAE,OAFsB;EAG7BC,MAAM,EAAE,QAHqB;EAI7BC,KAAK,EAAE,OAJsB;EAK7BC,WAAW,EAAE;AALgB,CAAxB;AAQP,OAAO,IAAMC,2BAA2B,GAAG,qBAApC;AAEP,OAAO,IAAMC,kBAAkB,GAAG,sBAA3B;AACP,OAAO,IAAMC,sBAAsB,GAAG,gCAA/B;AACP,OAAO,IAAMC,sBAAsB,GAAG,gCAA/B;AACP,OAAO,IAAMC,mBAAmB,GAAG,uBAA5B"}
|
|
1
|
+
{"version":3,"file":"Constants.js","names":["USE_CACHE","serverBase","__CONTEXT_PATH__","BASE","window","contextPath","MODULARUI_CONTRIBUTIONS","APPLICATION_URI","APPLICATION_PATH","CONTENT_PATH","UPLOAD_PATH","CAPTCHA_PATH","LOGIN_PATH","LOGOUT_PATH","CHANGEPASSWORD_PATH","USERPROFILE_PATH","PARAMETER_SEPARATOR","TIMEVERSION_FILTER_NAME","PARAMETER_OVERVIEW_VIEWTYPE","DEFAULT_UI_PARAMETERS","ISO_DATE_FORMAT","ISO_DATETIME_FORMAT","ISO_TIME_FORMAT","ISO_TIMESTAMP_FORMAT","DEFAULT_WEEK_STARTS_ON","DEFAULT_FIRST_WEEK_CONTAINS_DATE","KEYCODES","TAB","ENTER","ESCAPE","SPACE","PAGE_UP","PAGE_DOWN","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","IS_SYNC","dataFetcher","IS_SERVER","NOTIFICATION_TYPES","SUCCESS","INFO","WARNING","ERROR","HTTP_METHODS","GET","POST","MODULARUI_STATUS","LOADING","FINISHED","AUTOSAVE_STATUS","START","INPUT_DEBOUNCE_TIMEOUT","VALIDATE_DEBOUNCE_TIMEOUT","ATTRIBUTE_WIDTH","EXTRA_SMALL","SMALL","MEDIUM","LARGE","EXTRA_LARGE","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING"],"sources":["../../src/constants/Constants.js"],"sourcesContent":["// @flow\n/**\n * Indicates if contributions should be cached\n */\nexport const USE_CACHE = true;\n\nconst serverBase =\n typeof __CONTEXT_PATH__ === \"undefined\" ? null : __CONTEXT_PATH__;\n\n/**\n * Base path\n * This uses contextPath set from property from server\n * When requesting a remote server with CORS enabled, add the origin, for example:\n * export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';\n */\nexport const BASE: string =\n serverBase ??\n (typeof window !== \"undefined\" && window.contextPath\n ? window.contextPath\n : \"/BeInformed\");\n\n/**\n * Path to the contributions api end point\n * /contributions uri part is added through the _links in the data service\n */\nexport const MODULARUI_CONTRIBUTIONS = \"/contributions\";\n\n/**\n * Application uri\n * @private\n */\nconst APPLICATION_URI = \"/\";\n\n/**\n * Base Path\n */\nexport const APPLICATION_PATH: string = BASE + APPLICATION_URI;\n\n/**\n * path to content service\n */\nexport const CONTENT_PATH = `${BASE}/content`;\n\n/**\n * Upload Path\n */\nexport const UPLOAD_PATH = `${BASE}/uploadFile`;\n\n/**\n * Captcha Path\n */\nexport const CAPTCHA_PATH = `${BASE}/captchaServices`;\n\n/**\n * Path to login page / component\n */\nexport const LOGIN_PATH = \"/signin\";\n\n/**\n * Path to logout page / component\n */\nexport const LOGOUT_PATH = \"/signout\";\n\n/**\n * Path to change password page / component\n */\nexport const CHANGEPASSWORD_PATH = \"/change-password\";\n\n/**\n * Path to user profile page / component\n */\nexport const USERPROFILE_PATH = \"/user\";\n\n/**\n * Separator for parameters of a list, makes it possible to render multiple lists on a page in a non-js environment\n */\nexport const PARAMETER_SEPARATOR = \"~\";\n\n/**\n * Timeversion filter name\n */\nexport const TIMEVERSION_FILTER_NAME = \"entryDate\";\n\nconst PARAMETER_OVERVIEW_VIEWTYPE = \"viewType\";\n/**\n * Parameter name for the viewtype toggle\n */\nexport const DEFAULT_UI_PARAMETERS: Array<string> = [\n PARAMETER_OVERVIEW_VIEWTYPE,\n];\n\n/**\n */\nexport const ISO_DATE_FORMAT = \"yyyy-MM-dd\";\n/**\n */\nexport const ISO_DATETIME_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss\";\n/**\n */\nexport const ISO_TIME_FORMAT = \"HH:mm:ss\";\n/**\n */\nexport const ISO_TIMESTAMP_FORMAT = \"yyyy-MM-dd'T'HH:mm:ss.SSS\";\n/**\n * week starts on monday by default\n */\nexport const DEFAULT_WEEK_STARTS_ON = 1;\n\n/**\n * first week indicated by the 1st of january\n */\nexport const DEFAULT_FIRST_WEEK_CONTAINS_DATE = 1;\n\n/**\n * Key codes\n * @type {{SPACE: number, PAGE_DOWN: number, TAB: number, ARROW_RIGHT: number, ARROW_DOWN: number, ENTER: number, ARROW_UP: number, ARROW_LEFT: number, PAGE_UP: number, ESCAPE: number}}\n */\nexport const KEYCODES = {\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n SPACE: 32,\n PAGE_UP: 33,\n PAGE_DOWN: 34,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\n/**\n * @type {boolean}\n */\nexport const IS_SYNC = typeof dataFetcher !== \"undefined\";\n/**\n * @type {boolean}\n */\nexport const IS_SERVER = IS_SYNC;\n\n/**\n * @type {{SUCCESS: string, ERROR: string, INFO: string, WARNING: string}}\n */\nexport const NOTIFICATION_TYPES = {\n SUCCESS: \"SUCCESS\",\n INFO: \"INFO\",\n WARNING: \"WARNING\",\n ERROR: \"ERROR\",\n};\n\n/**\n * SUPPORTED HTTP METHODS\n * @type {{POST: string, GET: string}}\n */\nexport const HTTP_METHODS = {\n GET: \"GET\",\n POST: \"POST\",\n};\n\n/**\n * POSSIBLE MODULARUI STATUSSES\n * @type {{LOADING: string, ERROR: string, FINISHED: string}}\n */\nexport const MODULARUI_STATUS = {\n LOADING: \"LOADING\",\n FINISHED: \"FINISHED\",\n ERROR: \"ERROR\",\n};\n\n/**\n * POSSIBLE AUTOSAVE STATUSSES\n * @type {{START: string, FINISHED: string}}\n */\nexport const AUTOSAVE_STATUS = {\n START: \"START\",\n FINISHED: \"FINISHED\",\n};\n\n/**\n * DEBOUNCE INPUT TIMEOUT\n */\nexport const INPUT_DEBOUNCE_TIMEOUT = 100;\n\n/**\n * DEBOUNCE VALIDATION TIMEOUT\n */\nexport const VALIDATE_DEBOUNCE_TIMEOUT = 500;\n\n/**\n * ATTRIBUTE WIDTH\n */\nexport const ATTRIBUTE_WIDTH = {\n EXTRA_SMALL: \"EXTRA_SMALL\",\n SMALL: \"SMALL\",\n MEDIUM: \"MEDIUM\",\n LARGE: \"LARGE\",\n EXTRA_LARGE: \"EXTRA_LARGE\",\n};\n\nexport const ALL_CONTENT_IN_DATA_SETTING = \"hasAllContentInData\";\n\nexport const LOGIN_TYPE = \"security.clients\";\nexport const LOGIN_PATH_SETTING = \"FormClient.login_url\";\nexport const LOGIN_USERNAME_SETTING = \"FormClient.username_field_name\";\nexport const LOGIN_PASSWORD_SETTING = \"FormClient.password_field_name\";\nexport const LOGOUT_PATH_SETTING = \"FormClient.logout_url\";\n"],"mappings":"AACA;AACA;AACA;AACA,OAAO,IAAMA,SAAS,GAAG,IAAlB;AAEP,IAAMC,UAAU,GACd,OAAOC,gBAAP,KAA4B,WAA5B,GAA0C,IAA1C,GAAiDA,gBADnD;AAGA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,IAAMC,IAAY,GACvBF,UADuB,aACvBA,UADuB,cACvBA,UADuB,GAEtB,OAAOG,MAAP,KAAkB,WAAlB,IAAiCA,MAAM,CAACC,WAAxC,GACGD,MAAM,CAACC,WADV,GAEG,aAJC;AAMP;AACA;AACA;AACA;;AACA,OAAO,IAAMC,uBAAuB,GAAG,gBAAhC;AAEP;AACA;AACA;AACA;;AACA,IAAMC,eAAe,GAAG,GAAxB;AAEA;AACA;AACA;;AACA,OAAO,IAAM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ACP,OAAO,IAAMC,mBAAmB,GAAG,uBAA5B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _Object$assign from "@babel/runtime-corejs3/core-js-stable/object/assign";
|
|
2
2
|
import { isPlainObject, has } from "../utils/helpers/objects";
|
|
3
|
-
import {
|
|
3
|
+
import { ALL_CONTENT_IN_DATA_SETTING, LOGIN_TYPE, LOGIN_PATH_SETTING, LOGIN_USERNAME_SETTING, LOGIN_PASSWORD_SETTING, LOGOUT_PATH_SETTING } from "./Constants";
|
|
4
4
|
var defaultSettings = {
|
|
5
5
|
// Debug missing i18n messages in layout
|
|
6
6
|
DEBUG_I18N_MESSAGE_NOT_FOUND: true,
|
|
@@ -87,11 +87,18 @@ export var allSettings = function allSettings() {
|
|
|
87
87
|
export var hasAllContentInData = function hasAllContentInData() {
|
|
88
88
|
return getSetting(ALL_CONTENT_IN_DATA_SETTING, true);
|
|
89
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* Login type, only available when pac4j is configured
|
|
92
|
+
*/
|
|
93
|
+
|
|
94
|
+
export var loginType = function loginType() {
|
|
95
|
+
return getSetting(LOGIN_TYPE, "JAAS");
|
|
96
|
+
};
|
|
90
97
|
/**
|
|
91
98
|
*/
|
|
92
99
|
|
|
93
100
|
export var loginPath = function loginPath() {
|
|
94
|
-
return getSetting(LOGIN_PATH_SETTING, "
|
|
101
|
+
return getSetting(LOGIN_PATH_SETTING, "/j_security_check");
|
|
95
102
|
};
|
|
96
103
|
/**
|
|
97
104
|
*/
|
|
@@ -109,6 +116,6 @@ export var loginPasswordField = function loginPasswordField() {
|
|
|
109
116
|
*/
|
|
110
117
|
|
|
111
118
|
export var logoutPath = function logoutPath() {
|
|
112
|
-
return getSetting(LOGOUT_PATH_SETTING, "
|
|
119
|
+
return getSetting(LOGOUT_PATH_SETTING, "/Logoff");
|
|
113
120
|
};
|
|
114
121
|
//# sourceMappingURL=Settings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Settings.js","names":["isPlainObject","has","
|
|
1
|
+
{"version":3,"file":"Settings.js","names":["isPlainObject","has","ALL_CONTENT_IN_DATA_SETTING","LOGIN_TYPE","LOGIN_PATH_SETTING","LOGIN_USERNAME_SETTING","LOGIN_PASSWORD_SETTING","LOGOUT_PATH_SETTING","defaultSettings","DEBUG_I18N_MESSAGE_NOT_FOUND","HIDE_NOTIFICATION_TIMEOUT","ALWAYS_COMMIT_FORM","RENDER_QUESTION_LABELS","RENDER_MANDATORY_ATTRIBUTE_INDICATION","RENDER_OPTIONAL_ATTRIBUTE_INDICATION","AVAILABLE_LIST_VIEWS","USE_CLIENTSIDE_VALIDATION","USE_INSTANT_SERVER_VALIDATION","ENABLED_LOCALES","RENDER_FORMS_IN_MODAL","SHOW_SUBMIT_WAIT_TIMEOUT","SWIM_LANE_DIAGRAM_CONFIGURATION","BUSINESS_SCENARIO_CONCEPT_TYPE","BUSINESS_SCENARIO_STEP_CONCEPT_TYPE","BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE","DATE_INPUT_FORMAT","DATE_READONLY_FORMAT","CALENDAR_WEEK_STARTS_ON","CALENDAR_FIRST_WEEK_CONTAINS_DATE","UI_PARAMETERS","ALLOW_HIDE_WHEN_EMPTY_ON_TABS","PAGE_RELOAD_ON_UNAUTHORIZED_ERROR","XHR_TIMEOUT_MS","settings","setSettings","config","getSetting","key","defaultValue","undefined","Error","setSetting","value","allSettings","hasAllContentInData","loginType","loginPath","loginUsernameField","loginPasswordField","logoutPath"],"sources":["../../src/constants/Settings.js"],"sourcesContent":["// @flow\nimport { isPlainObject, has } from \"../utils/helpers/objects\";\nimport {\n ALL_CONTENT_IN_DATA_SETTING,\n LOGIN_TYPE,\n LOGIN_PATH_SETTING,\n LOGIN_USERNAME_SETTING,\n LOGIN_PASSWORD_SETTING,\n LOGOUT_PATH_SETTING,\n} from \"./Constants\";\n\ntype Setting = boolean | string | number | Array<string>;\n\nconst defaultSettings = {\n // Debug missing i18n messages in layout\n DEBUG_I18N_MESSAGE_NOT_FOUND: true,\n\n // Time to show the notification bar\n HIDE_NOTIFICATION_TIMEOUT: 5000,\n\n // Always commit form, does not show result pages for instruments\n ALWAYS_COMMIT_FORM: false,\n\n // Render instrument and event question labels on forms (might result in duplicate labels)\n RENDER_QUESTION_LABELS: true,\n\n // Render mandatory indications on attributes\n RENDER_MANDATORY_ATTRIBUTE_INDICATION: true,\n\n // Render optional indications on attributes\n RENDER_OPTIONAL_ATTRIBUTE_INDICATION: false,\n\n // Renders a toggle with supported list views, options are ListView and TableView\n AVAILABLE_LIST_VIEWS: [\"ListView\", \"TableView\"],\n\n // Toggle client side validation\n USE_CLIENTSIDE_VALIDATION: true,\n\n // Indicates if server validation should be used when a form field is changed\n USE_INSTANT_SERVER_VALIDATION: true,\n\n // Indicates which locales are enabled\n ENABLED_LOCALES: [\"en\", \"nl\"],\n\n // Render forms in a modal\n RENDER_FORMS_IN_MODAL: true,\n\n // Wait timeout before rendering submit wait icon\n SHOW_SUBMIT_WAIT_TIMEOUT: 300,\n\n // Swim lane diagram configuration file\n SWIM_LANE_DIAGRAM_CONFIGURATION: \"/Library/Diagrams/Overviews.json\",\n\n // Business scenario concept types\n BUSINESS_SCENARIO_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/BusinessScenario\",\n ],\n BUSINESS_SCENARIO_STEP_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/ScenarioStep\",\n ],\n BUSINESS_SCENARIO_PERSONA_CONCEPT_TYPE: [\n \"/Library/KMTs/Business scenarios.bixml/Persona\",\n ],\n\n // Input format for dates. Without this setting having a value, the contributions format is used\n DATE_INPUT_FORMAT: \"\",\n\n // Readonly format for dates. Without this setting having a value, the contributions format is used\n DATE_READONLY_FORMAT: \"\",\n\n // indicates on what day the week starts (0 = Sunday)\n CALENDAR_WEEK_STARTS_ON: 1,\n\n // indicates which date indicates the first week of the year\n CALENDAR_FIRST_WEEK_CONTAINS_DATE: 1,\n\n // parameters that are added for the ui state, but should not be send to the modular ui\n UI_PARAMETERS: [],\n\n // disable hide-when-empty hint for layouts running on Be Informed versions older than 21.1\n ALLOW_HIDE_WHEN_EMPTY_ON_TABS: true,\n\n // reload the complete page on signout, usefull when third party authentication is in place\n PAGE_RELOAD_ON_UNAUTHORIZED_ERROR: false,\n\n XHR_TIMEOUT_MS: 300000,\n};\n\nlet settings = defaultSettings;\n\n/**\n */\nexport const setSettings = (config: Object) => {\n if (isPlainObject(config)) {\n settings = Object.assign(defaultSettings, config);\n }\n};\n\n/**\n */\nexport const getSetting = (key: string, defaultValue?: any): any => {\n if (!has(settings, key) && defaultValue === undefined) {\n throw new Error(\n `Setting with name ${key} not found and no defaultValue given`\n );\n }\n\n return settings[key] ?? defaultValue;\n};\n\n/**\n */\nexport const setSetting = (key: string, value: any) => {\n settings[key] = value;\n};\n\n/**\n */\nexport const allSettings = (): { [name: string]: Setting } => settings;\n\n/**\n */\nexport const hasAllContentInData = (): boolean =>\n getSetting(ALL_CONTENT_IN_DATA_SETTING, true);\n\n/**\n * Login type, only available when pac4j is configured\n */\nexport const loginType = (): string => getSetting(LOGIN_TYPE, \"JAAS\");\n\n/**\n */\nexport const loginPath = (): string =>\n getSetting(LOGIN_PATH_SETTING, \"/j_security_check\");\n/**\n */\nexport const loginUsernameField = (): string =>\n getSetting(LOGIN_USERNAME_SETTING, \"j_username\");\n/**\n */\nexport const loginPasswordField = (): string =>\n getSetting(LOGIN_PASSWORD_SETTING, \"j_password\");\n/**\n */\nexport const logoutPath = (): string =>\n getSetting(LOGOUT_PATH_SETTING, \"/Logoff\");\n"],"mappings":";AACA,SAASA,aAAT,EAAwBC,GAAxB,QAAmC,0BAAnC;AACA,SACEC,2BADF,EAEEC,UAFF,EAGEC,kBAHF,EAIEC,sBAJF,EAKEC,sBALF,EAMEC,mBANF,QAOO,aAPP;AAWA,IAAMC,eAAe,GAAG;EACtB;EACAC,4BAA4B,EAAE,IAFR;EAItB;EACAC,yBAAyB,EAAE,IALL;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/runtime-corejs3/helpers/esm/slicedToArray";
|
|
2
1
|
import { useSelector, useDispatch } from "react-redux";
|
|
3
2
|
import { getApplication } from "../redux/_modularui/selectors";
|
|
4
3
|
import { login as _login, logout as _logout, resetAuthErrors } from "../redux/actions";
|
|
5
|
-
import UserServicesModel from "../models/user/UserServicesModel";
|
|
6
|
-
import { useState, useEffect } from "react";
|
|
7
4
|
|
|
8
|
-
var getIsAuthenticated = function getIsAuthenticated(isAuthenticated, application) {
|
|
9
|
-
if (!application) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
var userServicesModel = application.userServices;
|
|
14
|
-
|
|
15
|
-
if (userServicesModel instanceof UserServicesModel) {
|
|
16
|
-
return isAuthenticated && userServicesModel.isLoggedIn;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return false;
|
|
20
|
-
};
|
|
21
5
|
/**
|
|
22
6
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
7
|
export var useLogin = function useLogin() {
|
|
8
|
+
var _application$isLogged;
|
|
9
|
+
|
|
26
10
|
var dispatch = useDispatch();
|
|
27
11
|
var application = useSelector(getApplication);
|
|
28
12
|
var auth = useSelector(function (state) {
|
|
29
13
|
return state.auth;
|
|
30
14
|
});
|
|
31
15
|
return {
|
|
32
|
-
isAuthenticated:
|
|
16
|
+
isAuthenticated: (_application$isLogged = application === null || application === void 0 ? void 0 : application.isLoggedIn) !== null && _application$isLogged !== void 0 ? _application$isLogged : false,
|
|
33
17
|
errorMessage: auth.error,
|
|
34
18
|
resetErrors: function resetErrors() {
|
|
35
19
|
return dispatch(resetAuthErrors());
|
|
@@ -43,41 +27,14 @@ export var useLogin = function useLogin() {
|
|
|
43
27
|
*/
|
|
44
28
|
|
|
45
29
|
export var useLogout = function useLogout() {
|
|
30
|
+
var _application$isLogged2;
|
|
31
|
+
|
|
46
32
|
var dispatch = useDispatch();
|
|
47
33
|
var application = useSelector(getApplication);
|
|
48
|
-
var auth = useSelector(function (state) {
|
|
49
|
-
var _state$auth;
|
|
50
|
-
|
|
51
|
-
return ((_state$auth = state.auth) === null || _state$auth === void 0 ? void 0 : _state$auth.isAuthenticated) || false;
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
var _useState = useState(false),
|
|
55
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
-
cancel = _useState2[0],
|
|
57
|
-
setCancel = _useState2[1];
|
|
58
|
-
|
|
59
|
-
var _useState3 = useState(function () {
|
|
60
|
-
return getIsAuthenticated(auth, application);
|
|
61
|
-
}),
|
|
62
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
63
|
-
isAuthenticated = _useState4[0],
|
|
64
|
-
setIsAuthenticated = _useState4[1]; // set cancel to true when the component this hook is used on, has been unmounted
|
|
65
|
-
// prevents state changes after unmount
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
useEffect(function () {
|
|
69
|
-
return function () {
|
|
70
|
-
setCancel(true);
|
|
71
|
-
};
|
|
72
|
-
}, []);
|
|
73
34
|
return {
|
|
74
|
-
isAuthenticated:
|
|
35
|
+
isAuthenticated: (_application$isLogged2 = application === null || application === void 0 ? void 0 : application.isLoggedIn) !== null && _application$isLogged2 !== void 0 ? _application$isLogged2 : false,
|
|
75
36
|
logout: function logout() {
|
|
76
|
-
return dispatch(_logout())
|
|
77
|
-
if (!cancel) {
|
|
78
|
-
setIsAuthenticated(false);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
37
|
+
return dispatch(_logout());
|
|
81
38
|
}
|
|
82
39
|
};
|
|
83
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuthentication.js","names":["useSelector","useDispatch","getApplication","login","logout","resetAuthErrors","
|
|
1
|
+
{"version":3,"file":"useAuthentication.js","names":["useSelector","useDispatch","getApplication","login","logout","resetAuthErrors","useLogin","dispatch","application","auth","state","isAuthenticated","isLoggedIn","errorMessage","error","resetErrors","username","password","useLogout"],"sources":["../../src/hooks/useAuthentication.js"],"sourcesContent":["// @flow\nimport { useSelector, useDispatch } from \"react-redux\";\n\nimport { getApplication } from \"../redux/_modularui/selectors\";\nimport { login, logout, resetAuthErrors } from \"../redux/actions\";\n\nimport type { ResetAuthErrorsAction } from \"../redux/types\";\ntype LoginHook = {\n isAuthenticated: boolean,\n errorMessage: ?string,\n resetErrors: () => ResetAuthErrorsAction,\n login: (username: string, password: string) => void,\n};\ntype LogoutHook = {\n isAuthenticated: boolean,\n logout: () => void,\n};\n\n/**\n */\nexport const useLogin = (): LoginHook => {\n const dispatch = useDispatch();\n\n const application = useSelector(getApplication);\n const auth = useSelector((state) => state.auth);\n\n return {\n isAuthenticated: application?.isLoggedIn ?? false,\n errorMessage: auth.error,\n resetErrors: () => dispatch(resetAuthErrors()),\n login: (username: string, password: string) =>\n dispatch(login(username, password)),\n };\n};\n\n/**\n */\nexport const useLogout = (): LogoutHook => {\n const dispatch = useDispatch();\n const application = useSelector(getApplication);\n\n return {\n isAuthenticated: application?.isLoggedIn ?? false,\n logout: () => dispatch(logout()),\n };\n};\n"],"mappings":"AACA,SAASA,WAAT,EAAsBC,WAAtB,QAAyC,aAAzC;AAEA,SAASC,cAAT,QAA+B,+BAA/B;AACA,SAASC,KAAK,IAALA,MAAT,EAAgBC,MAAM,IAANA,OAAhB,EAAwBC,eAAxB,QAA+C,kBAA/C;;AAcA;AACA;AACA,OAAO,IAAMC,QAAQ,GAAG,SAAXA,QAAW,GAAiB;EAAA;;EACvC,IAAMC,QAAQ,GAAGN,WAAW,EAA5B;EAEA,IAAMO,WAAW,GAAGR,WAAW,CAACE,cAAD,CAA/B;EACA,IAAMO,IAAI,GAAGT,WAAW,CAAC,UAACU,KAAD;IAAA,OAAWA,KAAK,CAACD,IAAjB;EAAA,CAAD,CAAxB;EAEA,OAAO;IACLE,eAAe,2BAAEH,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAEI,UAAf,yEAA6B,KADvC;IAELC,YAAY,EAAEJ,IAAI,CAACK,KAFd;IAGLC,WAAW,EAAE;MAAA,OAAMR,QAAQ,CAACF,eAAe,EAAhB,CAAd;IAAA,CAHR;IAILF,KAAK,EAAE,eAACa,QAAD,EAAmBC,QAAnB;MAAA,OACLV,QAAQ,CAACJ,MAAK,CAACa,QAAD,EAAWC,QAAX,CAAN,CADH;IAAA;EAJF,CAAP;AAOD,CAbM;AAeP;AACA;;AACA,OAAO,IAAMC,SAAS,GAAG,SAAZA,SAAY,GAAkB;EAAA;;EACzC,IAAMX,QAAQ,GAAGN,WAAW,EAA5B;EACA,IAAMO,WAAW,GAAGR,WAAW,CAACE,cAAD,CAA/B;EAEA,OAAO;IACLS,eAAe,4BAAEH,WAAF,aAAEA,WAAF,uBAAEA,WAAW,CAAEI,UAAf,2EAA6B,KADvC;IAELR,MAAM,EAAE;MAAA,OAAMG,QAAQ,CAACH,OAAM,EAAP,CAAd;IAAA;EAFH,CAAP;AAID,CARM"}
|
package/esm/i18n/Locales.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Locales.js","names":["Locale","englishErrors","dutchErrors","BaseCollection","IllegalArgumentException","availableLocales","code","messages","errors","createLocalesWithConfiguredErrors","configuredErrors","availableLocale","Locales","locales","locale","localeCode","some","item","hasLocale","acceptLanguageHeader","acceptLanguages","match","preferredLocales","availableLocaleCodes","length","getLocale","update","add","hydatedLocales","_collection","_code","_messages","_errors"],"sources":["../../src/i18n/Locales.js"],"sourcesContent":["// @flow\nimport Locale from \"./Locale\";\n\nimport englishErrors from \"./translations/beinformed_error_messages_en.nl\";\nimport dutchErrors from \"./translations/beinformed_error_messages_nl.nl\";\n\nimport BaseCollection from \"../models/base/BaseCollection\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"./types\";\n\ntype ErrorMessageObject = {\n [languageCode: string]: {\n [messageID: string]: string,\n },\n};\n\ntype HydratedLocales = {\n _collection: Array<{\n _code: string,\n _messages: {\n [string]: string,\n },\n _errors: {\n [string]: string,\n },\n }>,\n};\n\n/**\n * Array of available locales\n * Order of locales is the preferred order of locales.\n * When user has an accept language header that does not correspond to the locales array,\n * the first one is used as the preferred language\n */\nexport const availableLocales: Array<LocaleConfiguration> = [\n {\n code: \"en\",\n messages: {},\n errors: englishErrors,\n },\n {\n code: \"nl\",\n messages: {},\n errors: dutchErrors,\n },\n];\n\n/**\n * Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.\n */\nexport const createLocalesWithConfiguredErrors = (\n configuredErrors: ErrorMessageObject\n): Array<Object> =>\n availableLocales.map((availableLocale) => {\n if (configuredErrors[availableLocale.code]) {\n return {\n ...availableLocale,\n errors: {\n ...availableLocale.errors,\n ...configuredErrors[availableLocale.code],\n },\n };\n }\n\n return availableLocale;\n });\n\n/**\n * Locales, collection of Locale\n */\nclass Locales extends BaseCollection<Locale> {\n constructor(locales: Array<LocaleConfiguration> = availableLocales) {\n super(locales.map((locale) => new Locale(locale)));\n }\n\n /**\n * rehydrate\n */\n static rehydrate(hydatedLocales: HydratedLocales): Locales {\n if (hydatedLocales && hydatedLocales._collection) {\n return new Locales(\n hydatedLocales._collection.map((locale) => ({\n code: locale._code,\n messages: locale._messages,\n errors: locale._errors,\n }))\n );\n }\n\n return new Locales([]);\n }\n\n /**\n * Check if locale with localeCode exists\n */\n hasLocale(localeCode: string): boolean {\n return this.some((item) => localeCode.startsWith(item.code));\n }\n\n /**\n * Retrieve locales by localeCode from Locales collection\n */\n getLocale(localeCode: string): Locale {\n if (this.hasLocale(localeCode)) {\n const locale = this.find((item) => localeCode.startsWith(item.code));\n if (locale) {\n return locale;\n }\n }\n throw new IllegalArgumentException(\n `Locale configuration for locale ${localeCode} not found`\n );\n }\n\n /**\n * Retrieve all available locale codes\n */\n get availableLocaleCodes(): Array<string> {\n return this.map((locale) => locale.code);\n }\n\n /**\n * Retrieve preferred locale based on the accept header of a browser\n */\n getPreferredLocale(acceptLanguageHeader: string | null): void | string {\n if (acceptLanguageHeader != null) {\n const acceptLanguages =\n acceptLanguageHeader.match(/[-A-Za-z]{2,10}/gu) || [];\n\n const preferredLocales = acceptLanguages\n .filter((locale) =>\n this.availableLocaleCodes.some((availableLocale) =>\n locale.startsWith(availableLocale)\n )\n )\n .map((locale) =>\n this.availableLocaleCodes.find((availableLocale) =>\n locale.startsWith(availableLocale)\n )\n );\n\n if (preferredLocales.length > 0) {\n return preferredLocales[0];\n }\n }\n\n return this.availableLocaleCodes[0];\n }\n\n /**\n * Add or change messages and errors for the given locale.<br>\n * It is not possible to remove messages.\n */\n update(locale: string, messages: Object = {}, errors: Object = {}) {\n if (this.hasLocale(locale)) {\n this.getLocale(locale).update(messages, errors);\n } else {\n this.add(\n new Locale({\n code: locale,\n messages,\n errors,\n })\n );\n }\n }\n}\n\nexport default Locales;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAOA,MAAP,MAAmB,UAAnB;AAEA,OAAOC,aAAP,MAA0B,gDAA1B;AACA,OAAOC,WAAP,MAAwB,gDAAxB;AAEA,OAAOC,cAAP,MAA2B,+BAA3B;AAEA,SAASC,wBAAT,QAAyC,eAAzC;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,gBAA4C,GAAG,CAC1D;EACEC,IAAI,EAAE,IADR;EAEEC,QAAQ,EAAE,EAFZ;EAGEC,MAAM,EAAEP;AAHV,CAD0D,EAM1D;EACEK,IAAI,EAAE,IADR;EAEEC,QAAQ,EAAE,EAFZ;EAGEC,MAAM,EAAEN;AAHV,CAN0D,CAArD;AAaP;AACA;AACA;;AACA,OAAO,IAAMO,iCAAiC,GAAG,SAApCA,iCAAoC,CAC/CC,gBAD+C;EAAA,OAG/C,qBAAAL,gBAAgB,MAAhB,CAAAA,gBAAgB,EAAK,UAACM,eAAD,EAAqB;IACxC,IAAID,gBAAgB,CAACC,eAAe,CAACL,IAAjB,CAApB,EAA4C;MAC1C,uCACKK,eADL;QAEEH,MAAM,kCACDG,eAAe,CAACH,MADf,GAEDE,gBAA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AAAF,eAAe,MAAf,CAAAA,eAAe,EAC9B,UAACN,MAAD;UAAA,OACN,KAAI,CAACS,oBAAL,CAA0BP,IAA1B,CAA+B,UAACL,eAAD;YAAA,OAC7B,4BAAAG,MAAM,MAAN,CAAAA,MAAM,EAAYH,eAAZ,CADuB;UAAA,CAA/B,CADM;QAAA,CAD8B,CAAf,kBAMlB,UAACG,MAAD;UAAA;;UAAA,OACH,
|
|
1
|
+
{"version":3,"file":"Locales.js","names":["Locale","englishErrors","dutchErrors","BaseCollection","IllegalArgumentException","availableLocales","code","messages","errors","createLocalesWithConfiguredErrors","configuredErrors","availableLocale","Locales","locales","locale","localeCode","some","item","hasLocale","acceptLanguageHeader","acceptLanguages","match","preferredLocales","availableLocaleCodes","length","getLocale","update","add","hydatedLocales","_collection","_code","_messages","_errors"],"sources":["../../src/i18n/Locales.js"],"sourcesContent":["// @flow\nimport Locale from \"./Locale\";\n\nimport englishErrors from \"./translations/beinformed_error_messages_en.nl\";\nimport dutchErrors from \"./translations/beinformed_error_messages_nl.nl\";\n\nimport BaseCollection from \"../models/base/BaseCollection\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type { LocaleConfiguration } from \"./types\";\n\ntype ErrorMessageObject = {\n [languageCode: string]: {\n [messageID: string]: string,\n },\n};\n\ntype HydratedLocales = {\n _collection: Array<{\n _code: string,\n _messages: {\n [string]: string,\n },\n _errors: {\n [string]: string,\n },\n }>,\n};\n\n/**\n * Array of available locales\n * Order of locales is the preferred order of locales.\n * When user has an accept language header that does not correspond to the locales array,\n * the first one is used as the preferred language\n */\nexport const availableLocales: Array<LocaleConfiguration> = [\n {\n code: \"en\",\n messages: {},\n errors: englishErrors,\n },\n {\n code: \"nl\",\n messages: {},\n errors: dutchErrors,\n },\n];\n\n/**\n * Merge an object with custom error messages (exported and translated from be informed for example) and merge them with the existing translations.\n */\nexport const createLocalesWithConfiguredErrors = (\n configuredErrors: ErrorMessageObject\n): Array<Object> =>\n availableLocales.map((availableLocale) => {\n if (configuredErrors[availableLocale.code]) {\n return {\n ...availableLocale,\n errors: {\n ...availableLocale.errors,\n ...configuredErrors[availableLocale.code],\n },\n };\n }\n\n return availableLocale;\n });\n\n/**\n * Locales, collection of Locale\n */\nclass Locales extends BaseCollection<Locale> {\n constructor(locales: Array<LocaleConfiguration> = availableLocales) {\n super(locales.map((locale) => new Locale(locale)));\n }\n\n /**\n * rehydrate\n */\n static rehydrate(hydatedLocales: HydratedLocales): Locales {\n if (hydatedLocales && hydatedLocales._collection) {\n return new Locales(\n hydatedLocales._collection.map((locale) => ({\n code: locale._code,\n messages: locale._messages,\n errors: locale._errors,\n }))\n );\n }\n\n return new Locales([]);\n }\n\n /**\n * Check if locale with localeCode exists\n */\n hasLocale(localeCode: string): boolean {\n return this.some((item) => localeCode.startsWith(item.code));\n }\n\n /**\n * Retrieve locales by localeCode from Locales collection\n */\n getLocale(localeCode: string): Locale {\n if (this.hasLocale(localeCode)) {\n const locale = this.find((item) => localeCode.startsWith(item.code));\n if (locale) {\n return locale;\n }\n }\n throw new IllegalArgumentException(\n `Locale configuration for locale ${localeCode} not found`\n );\n }\n\n /**\n * Retrieve all available locale codes\n */\n get availableLocaleCodes(): Array<string> {\n return this.map((locale) => locale.code);\n }\n\n /**\n * Retrieve preferred locale based on the accept header of a browser\n */\n getPreferredLocale(acceptLanguageHeader: string | null): void | string {\n if (acceptLanguageHeader != null) {\n const acceptLanguages =\n acceptLanguageHeader.match(/[-A-Za-z]{2,10}/gu) || [];\n\n const preferredLocales = acceptLanguages\n .filter((locale) =>\n this.availableLocaleCodes.some((availableLocale) =>\n locale.startsWith(availableLocale)\n )\n )\n .map((locale) =>\n this.availableLocaleCodes.find((availableLocale) =>\n locale.startsWith(availableLocale)\n )\n );\n\n if (preferredLocales.length > 0) {\n return preferredLocales[0];\n }\n }\n\n return this.availableLocaleCodes[0];\n }\n\n /**\n * Add or change messages and errors for the given locale.<br>\n * It is not possible to remove messages.\n */\n update(locale: string, messages: Object = {}, errors: Object = {}) {\n if (this.hasLocale(locale)) {\n this.getLocale(locale).update(messages, errors);\n } else {\n this.add(\n new Locale({\n code: locale,\n messages,\n errors,\n })\n );\n }\n }\n}\n\nexport default Locales;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAOA,MAAP,MAAmB,UAAnB;AAEA,OAAOC,aAAP,MAA0B,gDAA1B;AACA,OAAOC,WAAP,MAAwB,gDAAxB;AAEA,OAAOC,cAAP,MAA2B,+BAA3B;AAEA,SAASC,wBAAT,QAAyC,eAAzC;;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,gBAA4C,GAAG,CAC1D;EACEC,IAAI,EAAE,IADR;EAEEC,QAAQ,EAAE,EAFZ;EAGEC,MAAM,EAAEP;AAHV,CAD0D,EAM1D;EACEK,IAAI,EAAE,IADR;EAEEC,QAAQ,EAAE,EAFZ;EAGEC,MAAM,EAAEN;AAHV,CAN0D,CAArD;AAaP;AACA;AACA;;AACA,OAAO,IAAMO,iCAAiC,GAAG,SAApCA,iCAAoC,CAC/CC,gBAD+C;EAAA,OAG/C,qBAAAL,gBAAgB,MAAhB,CAAAA,gBAAgB,EAAK,UAACM,eAAD,EAAqB;IACxC,IAAID,gBAAgB,CAACC,eAAe,CAACL,IAAjB,CAApB,EAA4C;MAC1C,uCACKK,eADL;QAEEH,MAAM,kCACDG,eAAe,CAACH,MADf,GAEDE,gBAAgB,CAACC,eAAe,CAACL,IAAjB,CAFf;MAFR;IAOD;;IAED,OAAOK,eAAP;EACD,CAZe,CAH+B;AAAA,CAA1C;AAiBP;AACA;AACA;;IACMC,O;;;;;EACJ,mBAAoE;IAAA,IAAxDC,OAAwD,uEAAlBR,gBAAkB;;IAAA;;IAAA,yBAC5D,qBAAAQ,OAAO,MAAP,CAAAA,OAAO,EAAK,UAACC,MAAD;MAAA,OAAY,IAAId,MAAJ,CAAWc,MAAX,CAAZ;IAAA,CAAL,CADqD;EAEnE;EAED;AACF;AACA;;;;;;IAeE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eAAZ,CADuB;UAAA,CAA/B,CADG;QAAA,CANkB,CAAzB;;QAYA,IAAIW,gBAAgB,CAACE,MAAjB,GAA0B,CAA9B,EAAiC;UAC/B,OAAOF,gBAAgB,CAAC,CAAD,CAAvB;QACD;MACF;;MAED,OAAO,KAAKC,oBAAL,CAA0B,CAA1B,CAAP;IACD;IAED;AACF;AACA;AACA;;;;WACE,gBAAOT,MAAP,EAAmE;MAAA,IAA5CP,QAA4C,uEAAzB,EAAyB;MAAA,IAArBC,MAAqB,uEAAJ,EAAI;;MACjE,IAAI,KAAKU,SAAL,CAAeJ,MAAf,CAAJ,EAA4B;QAC1B,KAAKW,SAAL,CAAeX,MAAf,EAAuBY,MAAvB,CAA8BnB,QAA9B,EAAwCC,MAAxC;MACD,CAFD,MAEO;QACL,KAAKmB,GAAL,CACE,IAAI3B,MAAJ,CAAW;UACTM,IAAI,EAAEQ,MADG;UAETP,QAAQ,EAARA,QAFS;UAGTC,MAAM,EAANA;QAHS,CAAX,CADF;MAOD;IACF;;;WAvFD,mBAAiBoB,cAAjB,EAA2D;MACzD,IAAIA,cAAc,IAAIA,cAAc,CAACC,WAArC,EAAkD;QAAA;;QAChD,OAAO,IAAIjB,OAAJ,CACL,iCAAAgB,cAAc,CAACC,WAAf,kBAA+B,UAACf,MAAD;UAAA,OAAa;YAC1CR,IAAI,EAAEQ,MAAM,CAACgB,KAD6B;YAE1CvB,QAAQ,EAAEO,MAAM,CAACiB,SAFyB;YAG1CvB,MAAM,EAAEM,MAAM,CAACkB;UAH2B,CAAb;QAAA,CAA/B,CADK,CAAP;MAOD;;MAED,OAAO,IAAIpB,OAAJ,CAAY,EAAZ,CAAP;IACD;;;;EApBmBT,c;;AAkGtB,eAAeS,OAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","modularuiResponse","_relations","data","relations","entryDate","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","getInitialChildModelLinks","isCacheable","models","conceptTypeModel","model","conceptType","setChildModels","getData","href","selflink","setParameter","removeParameter","_conceptType","conceptLabel","formula","labelTypes","labelType","setting","labels","label","type","_id","ids","propertyTypes","propertyType","properties","property","conceptProperties","textFragments","textFragment","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","keys","textfragments","availableLocales","_sourceReferences","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","availableLanguagesInSourceReferences","sourceReference","substring","length","currentLanguagePostfix","locale","availableLanguages","split","value","contributions","resourcetype"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id)\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type)\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = []\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix)\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n )\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAOA,aAAP,MAA0B,uBAA1B;AACA,OAAOC,yBAAP,MAAsC,6BAAtC;AACA,OAAOC,yBAAP,MAAsC,6BAAtC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AAEA,SAASC,uBAAT,QAAwC,2BAAxC;;AAYA;AACA;AACA;IACqBC,kB;;;;;EAKnB;AACF;EACE,4BAAYC,iBAAZ,EAAkD;IAAA;;IAAA;;IAChD,0BAAMA,iBAAN;;IADgD;;IAAA;;IAAA;;IAGhD,MAAKC,UAAL,GAAkB,IAAIN,yBAAJ,CAChB,MAAKO,IAAL,CAAUC,SADM,EAEhB,MAAKC,SAFW,CAAlB;IAHgD;EAOjD;EAED;AACF;;;;;SACE,eAAmB;MACjB,OAAO,eAAP;IACD;IAED;AACF;;;;;IAQE;AACF;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CAAlB,CAAhB;QAAA,CADyC,CAA3C,CAnB8B,CAuB9B;;;QACA,OAAO,0CAAK1D,IAAL,CAAUkD,gBAAV,mBACL,UAACE,eAAD;UAAA,OACE,CAAC,0BAAAK,kBAAkB,MAAlB,CAAAA,kBAAkB,EACjBL,eAAe,CAACxB,IAAhB,CAAqByB,SAArB,CACED,eAAe,CAACxB,IAAhB,CAAqB0B,MAArB,GAA8BL,uBADhC,CADiB,CADrB;QAAA,CADK,CAAP;MAQD;;MACD,OAAO,EAAP;IACD;IAED;AACF;AACA;;;;SACE,eAA+B;MAAA;;MAC7B,6EAAO,KAAKjD,IAAZ,iFAAO,kBAAmBJ,uBAAnB,CAAP,2DAAO,uBAA6C+D,KAApD,yEAA6D,IAA7D;IACD;;;WAzQD,2BAAyB3D,IAAzB,EAA2D;MACzD,OACEA,IAAI,CAAC4D,aAAL,CAAmBC,YAAnB,IACA7D,IAAI,CAAC4D,aAAL,CAAmBC,YAAnB,KAAoC,eAFtC;IAID;;;;EA7B6CrE,a;;SAA3BK,kB"}
|
|
1
|
+
{"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","modularuiResponse","_relations","data","relations","entryDate","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","getInitialChildModelLinks","isCacheable","models","conceptTypeModel","model","conceptType","setChildModels","getData","href","selflink","setParameter","removeParameter","_conceptType","conceptLabel","formula","labelTypes","labelType","setting","labels","label","type","_id","ids","propertyTypes","propertyType","properties","property","conceptProperties","textFragments","textFragment","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","keys","textfragments","availableLocales","_sourceReferences","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","availableLanguagesInSourceReferences","sourceReference","substring","length","currentLanguagePostfix","locale","availableLanguages","split","value","contributions","resourcetype"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id)\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type)\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = []\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix)\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n )\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAOA,aAAP,MAA0B,uBAA1B;AACA,OAAOC,yBAAP,MAAsC,6BAAtC;AACA,OAAOC,yBAAP,MAAsC,6BAAtC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AAEA,SAASC,uBAAT,QAAwC,2BAAxC;;AAYA;AACA;AACA;IACqBC,kB;;;;;EAKnB;AACF;EACE,4BAAYC,iBAAZ,EAAkD;IAAA;;IAAA;;IAChD,0BAAMA,iBAAN;;IADgD;;IAAA;;IAAA;;IAGhD,MAAKC,UAAL,GAAkB,IAAIN,yBAAJ,CAChB,MAAKO,IAAL,CAAUC,SADM,EAEhB,MAAKC,SAFW,CAAlB;IAHgD;EAOjD;EAED;AACF;;;;;SACE,eAAmB;MACjB,OAAO,eAAP;IACD;IAED;AACF;;;;;IAQE;AACF;IACE,qCAA8C;MAC5C,IAAMC,eAAe,GAAG,KAAKC,KAAL,CAAWC,YAAX,CAAwB,aAAxB,CAAxB;MACA,IAAMC,wBAAwB,GAC5B,KAAKC,mBAAL,CAAyBC,yBAAzB,EADF;;MAGA,IAAIL,eAAJ,EAAqB;QAAA;;QACnBA,eAAe,CAACM,WAAhB,GAA8B,IAA9B;QACA,2CAAQN,eAAR,qCAA4BG,wBAA5B;MACD;;MAED,OAAOA,wBAAP;IACD;IAED;AACF;;;;WACE,wBAAeI,MAAf,EAA8C;MAC5C;MACA,IAAMC,gBAAyC,GAAG,sBAAAD,MAAM,MAAN,CAAAA,MAAM,EACtD,UAACE,KAAD;QAAA,OAAWA,KAAK,YAAYjB,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ACD;;;WAzQD,2BAAyB3D,IAAzB,EAA2D;MACzD,OACEA,IAAI,CAAC4D,aAAL,CAAmBC,YAAnB,IACA7D,IAAI,CAAC4D,aAAL,CAAmBC,YAAnB,KAAoC,eAFtC;IAID;;;;EA7B6CrE,a;;SAA3BK,kB"}
|
|
@@ -572,6 +572,8 @@ var FormModel = /*#__PURE__*/function (_ResourceModel) {
|
|
|
572
572
|
var _this6 = this;
|
|
573
573
|
|
|
574
574
|
if (this.currentFormObject) {
|
|
575
|
+
var _this$currentFormObje2, _this$currentFormObje3;
|
|
576
|
+
|
|
575
577
|
if (this.currentFormObject.isRepeatable) {
|
|
576
578
|
var _context18, _context19;
|
|
577
579
|
|
|
@@ -587,7 +589,7 @@ var FormModel = /*#__PURE__*/function (_ResourceModel) {
|
|
|
587
589
|
}
|
|
588
590
|
}
|
|
589
591
|
|
|
590
|
-
return this.currentFormObject.isValid;
|
|
592
|
+
return (_this$currentFormObje2 = (_this$currentFormObje3 = this.currentFormObject) === null || _this$currentFormObje3 === void 0 ? void 0 : _this$currentFormObje3.isValid) !== null && _this$currentFormObje2 !== void 0 ? _this$currentFormObje2 : true;
|
|
591
593
|
}
|
|
592
594
|
|
|
593
595
|
return true;
|