@beinformed/ui 1.25.0 → 1.25.1-beta.0
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 +6 -0
- package/esm/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/esm/constants/Settings.js.map +1 -1
- package/esm/hooks/useAuthentication.js +1 -1
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useModelCatalog.js +0 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModels.js +1 -1
- package/esm/hooks/useModels.js.map +1 -1
- package/esm/hooks/useModularUI.js +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +4 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useRouter.js +1 -1
- package/esm/hooks/useRouter.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/NumberAttributeModel.js +5 -2
- package/esm/models/attributes/NumberAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/esm/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/links/LinkModel.js +3 -1
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/links/normalizeLinkJSON.js.map +1 -1
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/parameter/Parameter.js +1 -1
- package/esm/models/parameter/Parameter.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/react-client/client.js +1 -1
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-client/rehydrate.js.map +1 -1
- package/esm/react-server/createSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js +4 -2
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/serverUtil.js +18 -9
- package/esm/react-server/serverUtil.js.map +1 -1
- package/esm/react-theme/ThemeProvider.js +1 -1
- package/esm/react-theme/ThemeProvider.js.map +1 -1
- package/esm/react-theme/createTheme.js +8 -3
- package/esm/react-theme/createTheme.js.map +1 -1
- package/esm/react-theme/utils/contrast.js +3 -1
- package/esm/react-theme/utils/contrast.js.map +1 -1
- package/esm/react-theme/utils/corners.js +3 -1
- package/esm/react-theme/utils/corners.js.map +1 -1
- package/esm/react-theme/utils/spacers.js +9 -3
- package/esm/react-theme/utils/spacers.js.map +1 -1
- package/esm/redux/_i18n/{actions.js → I18nActions.js} +1 -1
- package/esm/redux/_i18n/I18nActions.js.map +1 -0
- package/esm/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
- package/esm/redux/_i18n/I18nReducer.js.map +1 -0
- package/esm/redux/_i18n/index.js +2 -2
- package/esm/redux/_i18n/index.js.map +1 -1
- package/esm/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -0
- package/esm/redux/_modularui/{connector.js → ModularUIConnector.js} +5 -5
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -0
- package/esm/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +2 -2
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -0
- package/esm/redux/_modularui/{reducer.js → ModularUIReducer.js} +1 -1
- package/esm/redux/_modularui/ModularUIReducer.js.map +1 -0
- package/esm/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
- package/esm/redux/_modularui/ModularUISelectors.js.map +1 -0
- package/esm/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
- package/esm/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
- package/esm/redux/_modularui/index.js +6 -6
- package/esm/redux/_modularui/index.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/redux/_router/{actions.js → RouterActions.js} +1 -1
- package/esm/redux/_router/RouterActions.js.map +1 -0
- package/esm/redux/_router/{connectors.js → RouterConnectors.js} +2 -2
- package/esm/redux/_router/RouterConnectors.js.map +1 -0
- package/esm/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
- package/esm/redux/_router/RouterMiddleware.js.map +1 -0
- package/esm/redux/_router/{reducer.js → RouterReducer.js} +1 -1
- package/esm/redux/_router/RouterReducer.js.map +1 -0
- package/esm/redux/_router/index.js +4 -4
- package/esm/redux/_router/index.js.map +1 -1
- package/esm/redux/actions/Application.js +2 -2
- package/esm/redux/actions/Application.js.map +1 -1
- package/esm/redux/actions/Authorization.js +3 -3
- package/esm/redux/actions/Authorization.js.map +1 -1
- package/esm/redux/actions/Error.js +1 -1
- package/esm/redux/actions/Error.js.map +1 -1
- package/esm/redux/actions/Form.js +2 -2
- package/esm/redux/actions/Form.js.map +1 -1
- package/esm/redux/actions/FormAttributeSet.js +1 -1
- package/esm/redux/actions/FormAttributeSet.js.map +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js +1 -1
- package/esm/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/esm/redux/actions/FormAutosave.js +1 -1
- package/esm/redux/actions/FormAutosave.js.map +1 -1
- package/esm/redux/actions/FormAutosubmit.js +1 -1
- package/esm/redux/actions/FormAutosubmit.js.map +1 -1
- package/esm/redux/actions/FormValidations.js +1 -1
- package/esm/redux/actions/FormValidations.js.map +1 -1
- package/esm/redux/actions/Notification.js.map +1 -1
- package/esm/redux/actions/Preferences.js +1 -1
- package/esm/redux/actions/Preferences.js.map +1 -1
- package/esm/redux/actions/SignIn.js +1 -1
- package/esm/redux/actions/SignIn.js.map +1 -1
- package/esm/redux/actions/SignOut.js +1 -1
- package/esm/redux/actions/SignOut.js.map +1 -1
- package/esm/redux/connectors/Application.js +1 -1
- package/esm/redux/connectors/Application.js.map +1 -1
- package/esm/redux/connectors/Breadcrumb.js +1 -1
- package/esm/redux/connectors/Breadcrumb.js.map +1 -1
- package/esm/redux/connectors/CaseView.js +1 -1
- package/esm/redux/connectors/CaseView.js.map +1 -1
- package/esm/redux/connectors/ConceptDetail.js +1 -1
- package/esm/redux/connectors/ConceptDetail.js.map +1 -1
- package/esm/redux/connectors/ContentBrowser.js +1 -1
- package/esm/redux/connectors/ContentBrowser.js.map +1 -1
- package/esm/redux/connectors/ContentDetail.js +1 -1
- package/esm/redux/connectors/ContentDetail.js.map +1 -1
- package/esm/redux/connectors/ContentDetailSection.js +1 -1
- package/esm/redux/connectors/ContentDetailSection.js.map +1 -1
- package/esm/redux/connectors/Form.js +1 -1
- package/esm/redux/connectors/Form.js.map +1 -1
- package/esm/redux/connectors/ListDetail.js +1 -1
- package/esm/redux/connectors/ListDetail.js.map +1 -1
- package/esm/redux/connectors/ModelCatalog.js +1 -1
- package/esm/redux/connectors/ModelCatalog.js.map +1 -1
- package/esm/redux/connectors/PanelRenderer.js +1 -1
- package/esm/redux/connectors/PanelRenderer.js.map +1 -1
- package/esm/redux/connectors/Preferences.js.map +1 -1
- package/esm/redux/connectors/QuickSearch.js +2 -2
- package/esm/redux/connectors/QuickSearch.js.map +1 -1
- package/esm/redux/connectors/SignIn.js +1 -1
- package/esm/redux/connectors/SignIn.js.map +1 -1
- package/esm/redux/connectors/SignOut.js.map +1 -1
- package/esm/redux/connectors/Tab.js +1 -1
- package/esm/redux/connectors/Tab.js.map +1 -1
- package/esm/redux/reducers/ModalsReducer.js.map +1 -1
- package/esm/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/esm/redux/reducers/createReducer.js +3 -3
- package/esm/redux/reducers/createReducer.js.map +1 -1
- package/esm/redux/store/configureStore.js +4 -4
- package/esm/redux/store/configureStore.js.map +1 -1
- package/esm/utils/fetch/universalFetch.js +3 -2
- package/esm/utils/fetch/universalFetch.js.map +1 -1
- package/esm/utils/fetch/xhr.js.map +1 -1
- package/esm/utils/helpers/objects.js +4 -3
- package/esm/utils/helpers/objects.js.map +1 -1
- package/esm/utils/helpers/sanitizeHtml.js.map +1 -1
- package/esm/utils/number/parseNumbers.js.map +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.flow +1 -1
- package/lib/builder/mergeLayoutHintConfigurations.js.map +1 -1
- package/lib/constants/Settings.js.flow +1 -1
- package/lib/constants/Settings.js.map +1 -1
- package/lib/hooks/useAuthentication.js +3 -3
- package/lib/hooks/useAuthentication.js.flow +1 -1
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.flow +2 -1
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModels.js +2 -2
- package/lib/hooks/useModels.js.flow +1 -1
- package/lib/hooks/useModels.js.map +1 -1
- package/lib/hooks/useModularUI.js +3 -3
- package/lib/hooks/useModularUI.js.flow +4 -1
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +4 -1
- package/lib/hooks/useModularUIBasic.js.flow +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useRouter.js +6 -6
- package/lib/hooks/useRouter.js.flow +7 -1
- package/lib/hooks/useRouter.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js.flow +8 -6
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js.flow +18 -16
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/NumberAttributeModel.js +5 -2
- package/lib/models/attributes/NumberAttributeModel.js.flow +7 -3
- package/lib/models/attributes/NumberAttributeModel.js.map +1 -1
- package/lib/models/attributes/_createAttribute.js.flow +1 -1
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.flow +1 -1
- package/lib/models/attributes/layouthint-rules/BaseLayoutHintRule.js.map +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.flow +1 -1
- package/lib/models/attributes/layouthint-rules/DependentAttribute.js.map +1 -1
- package/lib/models/base/ResourceModel.js.flow +1 -1
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js.flow +4 -1
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js.flow +1 -1
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/form/FormModel.js.flow +2 -2
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/links/LinkModel.js +3 -1
- package/lib/models/links/LinkModel.js.flow +4 -2
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/links/normalizeLinkJSON.js.flow +1 -1
- package/lib/models/links/normalizeLinkJSON.js.map +1 -1
- package/lib/models/list/ListModel.js.flow +1 -1
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/parameter/Parameter.js +1 -1
- package/lib/models/parameter/Parameter.js.flow +1 -1
- package/lib/models/parameter/Parameter.js.map +1 -1
- package/lib/models/types.js.flow +6 -6
- package/lib/models/types.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js.flow +6 -6
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/react-client/client.js +2 -2
- package/lib/react-client/client.js.flow +8 -8
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-client/rehydrate.js.flow +2 -2
- package/lib/react-client/rehydrate.js.map +1 -1
- package/lib/react-server/createSSRComplete.js.flow +3 -3
- package/lib/react-server/createSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +4 -2
- package/lib/react-server/renderSSRComplete.js.flow +2 -2
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/serverUtil.js +19 -10
- package/lib/react-server/serverUtil.js.flow +20 -11
- package/lib/react-server/serverUtil.js.map +1 -1
- package/lib/react-theme/ThemeProvider.js +1 -1
- package/lib/react-theme/ThemeProvider.js.flow +1 -1
- package/lib/react-theme/ThemeProvider.js.map +1 -1
- package/lib/react-theme/__tests__/ThemeProvider.spec.js.flow +2 -0
- package/lib/react-theme/__tests__/createTheme.spec.js.flow +3 -0
- package/lib/react-theme/createTheme.js +8 -3
- package/lib/react-theme/createTheme.js.flow +7 -5
- package/lib/react-theme/createTheme.js.map +1 -1
- package/lib/react-theme/utils/contrast.js +3 -1
- package/lib/react-theme/utils/contrast.js.flow +1 -1
- package/lib/react-theme/utils/contrast.js.map +1 -1
- package/lib/react-theme/utils/corners.js +3 -1
- package/lib/react-theme/utils/corners.js.flow +1 -1
- package/lib/react-theme/utils/corners.js.map +1 -1
- package/lib/react-theme/utils/spacers.js +9 -3
- package/lib/react-theme/utils/spacers.js.flow +3 -3
- package/lib/react-theme/utils/spacers.js.map +1 -1
- package/lib/redux/_i18n/{actions.js → I18nActions.js} +1 -1
- package/lib/redux/_i18n/{actions.js.flow → I18nActions.js.flow} +0 -0
- package/lib/redux/_i18n/I18nActions.js.map +1 -0
- package/lib/redux/_i18n/{reducer.js → I18nReducer.js} +1 -1
- package/{src/redux/_i18n/reducer.js → lib/redux/_i18n/I18nReducer.js.flow} +5 -2
- package/lib/redux/_i18n/I18nReducer.js.map +1 -0
- package/lib/redux/_i18n/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_i18n/__tests__/reducer.spec.js.flow +1 -1
- package/lib/redux/_i18n/index.js +8 -8
- package/lib/redux/_i18n/index.js.flow +2 -2
- package/lib/redux/_i18n/index.js.map +1 -1
- package/lib/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
- package/lib/redux/_modularui/{actions.js.flow → ModularUIActions.js.flow} +1 -1
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -0
- package/lib/redux/_modularui/{connector.js → ModularUIConnector.js} +11 -11
- package/{src/redux/_modularui/connector.js → lib/redux/_modularui/ModularUIConnector.js.flow} +8 -4
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -0
- package/lib/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +4 -4
- package/lib/redux/_modularui/{middleware.js.flow → ModularUIMiddleware.js.flow} +20 -5
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -0
- package/lib/redux/_modularui/{reducer.js → ModularUIReducer.js} +1 -1
- package/lib/redux/_modularui/{reducer.js.flow → ModularUIReducer.js.flow} +12 -5
- package/lib/redux/_modularui/ModularUIReducer.js.map +1 -0
- package/lib/redux/_modularui/{selectors.js → ModularUISelectors.js} +1 -1
- package/lib/redux/_modularui/{selectors.js.flow → ModularUISelectors.js.flow} +3 -2
- package/lib/redux/_modularui/ModularUISelectors.js.map +1 -0
- package/lib/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +1 -1
- package/lib/redux/_modularui/{modularuiUtils.js.flow → ModularUIUtils.js.flow} +0 -0
- package/lib/redux/_modularui/{modularuiUtils.js.map → ModularUIUtils.js.map} +1 -1
- package/lib/redux/_modularui/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_modularui/__tests__/reducer.spec.js.flow +2 -2
- package/lib/redux/_modularui/__tests__/selectors.spec.js.flow +1 -1
- package/lib/redux/_modularui/index.js +22 -22
- package/lib/redux/_modularui/index.js.flow +6 -6
- package/lib/redux/_modularui/index.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +10 -4
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js +2 -2
- package/lib/redux/_modularui/withModularUI.js.flow +1 -1
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/redux/_router/{actions.js → RouterActions.js} +1 -1
- package/lib/redux/_router/{actions.js.flow → RouterActions.js.flow} +0 -0
- package/lib/redux/_router/RouterActions.js.map +1 -0
- package/lib/redux/_router/{connectors.js → RouterConnectors.js} +7 -7
- package/lib/redux/_router/{connectors.js.flow → RouterConnectors.js.flow} +1 -1
- package/lib/redux/_router/RouterConnectors.js.map +1 -0
- package/lib/redux/_router/{middleware.js → RouterMiddleware.js} +1 -1
- package/lib/redux/_router/{middleware.js.flow → RouterMiddleware.js.flow} +0 -0
- package/lib/redux/_router/RouterMiddleware.js.map +1 -0
- package/lib/redux/_router/{reducer.js → RouterReducer.js} +1 -1
- package/lib/redux/_router/{reducer.js.flow → RouterReducer.js.flow} +0 -0
- package/lib/redux/_router/RouterReducer.js.map +1 -0
- package/lib/redux/_router/__tests__/actions.spec.js.flow +1 -1
- package/lib/redux/_router/__tests__/middleware.spec.js.flow +2 -2
- package/lib/redux/_router/__tests__/reducer.spec.js.flow +1 -1
- package/lib/redux/_router/index.js +16 -16
- package/lib/redux/_router/index.js.flow +4 -4
- package/lib/redux/_router/index.js.map +1 -1
- package/lib/redux/actions/Application.js +5 -5
- package/lib/redux/actions/Application.js.flow +5 -2
- package/lib/redux/actions/Application.js.map +1 -1
- package/lib/redux/actions/Authorization.js +6 -6
- package/lib/redux/actions/Authorization.js.flow +3 -3
- package/lib/redux/actions/Authorization.js.map +1 -1
- package/lib/redux/actions/Error.js +2 -2
- package/lib/redux/actions/Error.js.flow +2 -2
- package/lib/redux/actions/Error.js.map +1 -1
- package/lib/redux/actions/Form.js +5 -5
- package/lib/redux/actions/Form.js.flow +2 -2
- package/lib/redux/actions/Form.js.map +1 -1
- package/lib/redux/actions/FormAttributeSet.js +2 -2
- package/lib/redux/actions/FormAttributeSet.js.flow +1 -1
- package/lib/redux/actions/FormAttributeSet.js.map +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js +4 -4
- package/lib/redux/actions/FormAttributeSetRepeatable.js.flow +1 -1
- package/lib/redux/actions/FormAttributeSetRepeatable.js.map +1 -1
- package/lib/redux/actions/FormAutosave.js +2 -2
- package/lib/redux/actions/FormAutosave.js.flow +1 -1
- package/lib/redux/actions/FormAutosave.js.map +1 -1
- package/lib/redux/actions/FormAutosubmit.js +2 -2
- package/lib/redux/actions/FormAutosubmit.js.flow +1 -1
- package/lib/redux/actions/FormAutosubmit.js.map +1 -1
- package/lib/redux/actions/FormValidations.js +2 -2
- package/lib/redux/actions/FormValidations.js.flow +5 -3
- package/lib/redux/actions/FormValidations.js.map +1 -1
- package/lib/redux/actions/Notification.js.flow +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 +3 -3
- package/lib/redux/actions/Preferences.js.map +1 -1
- package/lib/redux/actions/SignIn.js +2 -2
- package/lib/redux/actions/SignIn.js.flow +1 -1
- package/lib/redux/actions/SignIn.js.map +1 -1
- package/lib/redux/actions/SignOut.js +2 -2
- package/lib/redux/actions/SignOut.js.flow +1 -1
- package/lib/redux/actions/SignOut.js.map +1 -1
- package/lib/redux/connectors/Application.js +2 -2
- package/lib/redux/connectors/Application.js.flow +1 -1
- package/lib/redux/connectors/Application.js.map +1 -1
- package/lib/redux/connectors/Breadcrumb.js +2 -2
- package/lib/redux/connectors/Breadcrumb.js.flow +1 -1
- package/lib/redux/connectors/Breadcrumb.js.map +1 -1
- package/lib/redux/connectors/CaseView.js +2 -2
- package/lib/redux/connectors/CaseView.js.flow +1 -1
- package/lib/redux/connectors/CaseView.js.map +1 -1
- package/lib/redux/connectors/ConceptDetail.js +2 -2
- package/lib/redux/connectors/ConceptDetail.js.flow +1 -1
- package/lib/redux/connectors/ConceptDetail.js.map +1 -1
- package/lib/redux/connectors/ContentBrowser.js +2 -2
- package/lib/redux/connectors/ContentBrowser.js.flow +1 -1
- package/lib/redux/connectors/ContentBrowser.js.map +1 -1
- package/lib/redux/connectors/ContentDetail.js +2 -2
- package/lib/redux/connectors/ContentDetail.js.flow +1 -1
- package/lib/redux/connectors/ContentDetail.js.map +1 -1
- package/lib/redux/connectors/ContentDetailSection.js +2 -2
- package/lib/redux/connectors/ContentDetailSection.js.flow +1 -1
- package/lib/redux/connectors/ContentDetailSection.js.map +1 -1
- package/lib/redux/connectors/Form.js +2 -2
- package/lib/redux/connectors/Form.js.flow +1 -1
- package/lib/redux/connectors/Form.js.map +1 -1
- package/lib/redux/connectors/ListDetail.js +2 -2
- package/lib/redux/connectors/ListDetail.js.flow +1 -1
- package/lib/redux/connectors/ListDetail.js.map +1 -1
- package/lib/redux/connectors/ModelCatalog.js +2 -2
- package/lib/redux/connectors/ModelCatalog.js.flow +1 -1
- package/lib/redux/connectors/ModelCatalog.js.map +1 -1
- package/lib/redux/connectors/PanelRenderer.js +2 -2
- package/lib/redux/connectors/PanelRenderer.js.flow +1 -1
- package/lib/redux/connectors/PanelRenderer.js.map +1 -1
- package/lib/redux/connectors/Preferences.js.flow +5 -2
- package/lib/redux/connectors/Preferences.js.map +1 -1
- package/lib/redux/connectors/QuickSearch.js +4 -4
- package/lib/redux/connectors/QuickSearch.js.flow +2 -2
- package/lib/redux/connectors/QuickSearch.js.map +1 -1
- package/lib/redux/connectors/SignIn.js +2 -2
- package/lib/redux/connectors/SignIn.js.flow +1 -1
- package/lib/redux/connectors/SignIn.js.map +1 -1
- package/lib/redux/connectors/SignOut.js.flow +2 -2
- package/lib/redux/connectors/SignOut.js.map +1 -1
- package/lib/redux/connectors/Tab.js +2 -2
- package/lib/redux/connectors/Tab.js.flow +1 -1
- package/lib/redux/connectors/Tab.js.map +1 -1
- package/lib/redux/reducers/ModalsReducer.js.flow +2 -2
- package/lib/redux/reducers/ModalsReducer.js.map +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.flow +1 -1
- package/lib/redux/reducers/ProgressIndicatorReducer.js.map +1 -1
- package/lib/redux/reducers/createReducer.js +6 -6
- package/lib/redux/reducers/createReducer.js.flow +3 -3
- package/lib/redux/reducers/createReducer.js.map +1 -1
- package/lib/redux/store/configureStore.js +5 -5
- package/lib/redux/store/configureStore.js.flow +4 -4
- package/lib/redux/store/configureStore.js.map +1 -1
- package/lib/utils/fetch/universalFetch.js +5 -3
- package/lib/utils/fetch/universalFetch.js.flow +8 -6
- package/lib/utils/fetch/universalFetch.js.map +1 -1
- package/lib/utils/fetch/xhr.js.flow +21 -21
- package/lib/utils/fetch/xhr.js.map +1 -1
- package/lib/utils/helpers/objects.js.flow +5 -3
- package/lib/utils/helpers/objects.js.map +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.flow +1 -1
- package/lib/utils/helpers/sanitizeHtml.js.map +1 -1
- package/lib/utils/number/parseNumbers.js.flow +8 -2
- package/lib/utils/number/parseNumbers.js.map +1 -1
- package/package.json +8 -8
- package/src/builder/mergeLayoutHintConfigurations.js +1 -1
- package/src/constants/Settings.js +1 -1
- package/src/hooks/useAuthentication.js +1 -1
- package/src/hooks/useModelCatalog.js +2 -1
- package/src/hooks/useModels.js +1 -1
- package/src/hooks/useModularUI.js +4 -1
- package/src/hooks/useModularUIBasic.js +1 -1
- package/src/hooks/useRouter.js +7 -1
- package/src/models/attributes/AttributeCollection.js +8 -6
- package/src/models/attributes/AttributeModel.js +18 -16
- package/src/models/attributes/CompositeAttributeChildCollection.js +1 -1
- package/src/models/attributes/NumberAttributeModel.js +7 -3
- package/src/models/attributes/_createAttribute.js +1 -1
- package/src/models/attributes/layouthint-rules/BaseLayoutHintRule.js +1 -1
- package/src/models/attributes/layouthint-rules/DependentAttribute.js +1 -1
- package/src/models/base/ResourceModel.js +1 -1
- package/src/models/content/ContentTOCModel.js +4 -1
- package/src/models/filters/FilterCollection.js +1 -1
- package/src/models/form/FormModel.js +2 -2
- package/src/models/links/LinkModel.js +4 -2
- package/src/models/links/normalizeLinkJSON.js +1 -1
- package/src/models/list/ListModel.js +1 -1
- package/src/models/parameter/Parameter.js +1 -1
- package/src/models/types.js +6 -6
- package/src/modularui/ModularUIRequest.js +6 -6
- package/src/react-client/client.js +8 -8
- package/src/react-client/rehydrate.js +2 -2
- package/src/react-server/createSSRComplete.js +3 -3
- package/src/react-server/renderSSRComplete.js +2 -2
- package/src/react-server/serverUtil.js +20 -11
- package/src/react-theme/ThemeProvider.js +1 -1
- package/src/react-theme/__tests__/ThemeProvider.spec.js +2 -0
- package/src/react-theme/__tests__/createTheme.spec.js +3 -0
- package/src/react-theme/createTheme.js +7 -5
- package/src/react-theme/utils/contrast.js +1 -1
- package/src/react-theme/utils/corners.js +1 -1
- package/src/react-theme/utils/spacers.js +3 -3
- package/src/redux/_i18n/{actions.js → I18nActions.js} +0 -0
- package/{lib/redux/_i18n/reducer.js.flow → src/redux/_i18n/I18nReducer.js} +5 -2
- package/src/redux/_i18n/__tests__/actions.spec.js +1 -1
- package/src/redux/_i18n/__tests__/reducer.spec.js +1 -1
- package/src/redux/_i18n/index.js +2 -2
- package/src/redux/_modularui/{actions.js → ModularUIActions.js} +1 -1
- package/{lib/redux/_modularui/connector.js.flow → src/redux/_modularui/ModularUIConnector.js} +8 -4
- package/src/redux/_modularui/{middleware.js → ModularUIMiddleware.js} +20 -5
- package/src/redux/_modularui/{reducer.js → ModularUIReducer.js} +12 -5
- package/src/redux/_modularui/{selectors.js → ModularUISelectors.js} +3 -2
- package/src/redux/_modularui/{modularuiUtils.js → ModularUIUtils.js} +0 -0
- package/src/redux/_modularui/__tests__/actions.spec.js +1 -1
- package/src/redux/_modularui/__tests__/reducer.spec.js +2 -2
- package/src/redux/_modularui/__tests__/selectors.spec.js +1 -1
- package/src/redux/_modularui/index.js +6 -6
- package/src/redux/_modularui/types.js +10 -4
- package/src/redux/_modularui/withModularUI.js +1 -1
- package/src/redux/_router/{actions.js → RouterActions.js} +0 -0
- package/src/redux/_router/{connectors.js → RouterConnectors.js} +1 -1
- package/src/redux/_router/{middleware.js → RouterMiddleware.js} +0 -0
- package/src/redux/_router/{reducer.js → RouterReducer.js} +0 -0
- package/src/redux/_router/__tests__/actions.spec.js +1 -1
- package/src/redux/_router/__tests__/middleware.spec.js +2 -2
- package/src/redux/_router/__tests__/reducer.spec.js +1 -1
- package/src/redux/_router/index.js +4 -4
- package/src/redux/actions/Application.js +5 -2
- package/src/redux/actions/Authorization.js +3 -3
- package/src/redux/actions/Error.js +2 -2
- package/src/redux/actions/Form.js +2 -2
- package/src/redux/actions/FormAttributeSet.js +1 -1
- package/src/redux/actions/FormAttributeSetRepeatable.js +1 -1
- package/src/redux/actions/FormAutosave.js +1 -1
- package/src/redux/actions/FormAutosubmit.js +1 -1
- package/src/redux/actions/FormValidations.js +5 -3
- package/src/redux/actions/Notification.js +1 -1
- package/src/redux/actions/Preferences.js +3 -3
- package/src/redux/actions/SignIn.js +1 -1
- package/src/redux/actions/SignOut.js +1 -1
- package/src/redux/connectors/Application.js +1 -1
- package/src/redux/connectors/Breadcrumb.js +1 -1
- package/src/redux/connectors/CaseView.js +1 -1
- package/src/redux/connectors/ConceptDetail.js +1 -1
- package/src/redux/connectors/ContentBrowser.js +1 -1
- package/src/redux/connectors/ContentDetail.js +1 -1
- package/src/redux/connectors/ContentDetailSection.js +1 -1
- package/src/redux/connectors/Form.js +1 -1
- package/src/redux/connectors/ListDetail.js +1 -1
- package/src/redux/connectors/ModelCatalog.js +1 -1
- package/src/redux/connectors/PanelRenderer.js +1 -1
- package/src/redux/connectors/Preferences.js +5 -2
- package/src/redux/connectors/QuickSearch.js +2 -2
- package/src/redux/connectors/SignIn.js +1 -1
- package/src/redux/connectors/SignOut.js +2 -2
- package/src/redux/connectors/Tab.js +1 -1
- package/src/redux/reducers/ModalsReducer.js +2 -2
- package/src/redux/reducers/ProgressIndicatorReducer.js +1 -1
- package/src/redux/reducers/createReducer.js +3 -3
- package/src/redux/store/configureStore.js +4 -4
- package/src/utils/fetch/universalFetch.js +8 -6
- package/src/utils/fetch/xhr.js +21 -21
- package/src/utils/helpers/objects.js +5 -3
- package/src/utils/helpers/sanitizeHtml.js +1 -1
- package/src/utils/number/parseNumbers.js +8 -2
- package/types/models/concepts/ConceptDetailModel.d.ts +3 -3
- package/types/models/concepts/ConceptRelationModel.d.ts +2 -1
- package/types/models/types.d.ts +17 -3
- package/types/redux/_modularui/types.d.ts +3 -1
- package/types/utils/fetch/universalFetch.d.ts +3 -3
- package/types/utils/helpers/objects.d.ts +10 -2
- package/esm/redux/_i18n/actions.js.map +0 -1
- package/esm/redux/_i18n/reducer.js.map +0 -1
- package/esm/redux/_modularui/actions.js.map +0 -1
- package/esm/redux/_modularui/connector.js.map +0 -1
- package/esm/redux/_modularui/middleware.js.map +0 -1
- package/esm/redux/_modularui/reducer.js.map +0 -1
- package/esm/redux/_modularui/selectors.js.map +0 -1
- package/esm/redux/_router/actions.js.map +0 -1
- package/esm/redux/_router/connectors.js.map +0 -1
- package/esm/redux/_router/middleware.js.map +0 -1
- package/esm/redux/_router/reducer.js.map +0 -1
- package/lib/redux/_i18n/actions.js.map +0 -1
- package/lib/redux/_i18n/reducer.js.map +0 -1
- package/lib/redux/_modularui/actions.js.map +0 -1
- package/lib/redux/_modularui/connector.js.map +0 -1
- package/lib/redux/_modularui/middleware.js.map +0 -1
- package/lib/redux/_modularui/reducer.js.map +0 -1
- package/lib/redux/_modularui/selectors.js.map +0 -1
- package/lib/redux/_router/actions.js.map +0 -1
- package/lib/redux/_router/connectors.js.map +0 -1
- package/lib/redux/_router/middleware.js.map +0 -1
- package/lib/redux/_router/reducer.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListModel.js","names":["ListModel","ResourceModel","type","isApplicableModel","data","resourceType","contributions","resourcetype","getInitialChildModelLinks","layouthint","has","SHOW_ONE_RESULT_AS_DETAIL","listItemCollection","length","listItem","listDetailLink","selflink","targetModel","ListDetailModel","setChildModels","models","detail","childModel","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","ListItemCollection","createFromList","_detail","listitemHref","selfhref","listitem","equals","setSelfHref","grouping","_grouping","setGrouping","GroupingModel","dynamicschema","contexts","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","HIDE_WHEN_EMPTY","actionCollection","isEmpty","filterCollection","hasActiveFilters","getListItemById","id","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","paging","_paging","setPaging","PagingModel","sorting","_sorting","setSorting","SortingModel","getSortingLabels","_filterCollection","setFilters","FilterCollection","listkey","key","filter","isFiltered","_actionCollection","setActionCollection","ActionCollection","actions","hasList","selfLink","links","getLinkByKey","ListHref","_selfhref","headers","_headers","setHeaders","tempHeaders","results","forEach","attributes","attribute","listHeader","ListHeaderModel","exists","some","tempHeader","CASEVIEW_LINK","push","sortingLabels","attributeKey","getActionsByType","actionType"],"sources":["../../../src/models/list/ListModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ListItemCollection from \"../list/ListItemCollection\";\nimport ListDetailModel from \"../list/ListDetailModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport GroupingModel from \"../grouping/GroupingModel\";\nimport ListHeaderModel from \"../list/ListHeaderModel\";\nimport ListHref from \"../href/ListHref\";\nimport ListItemModel from \"../list/ListItemModel\";\nimport PagingModel from \"../paging/PagingModel\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport SortingModel from \"../sorting/SortingModel\";\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Defines a list object\n */\nexport default class ListModel extends ResourceModel {\n _detail: ?ListDetailModel = null;\n _headers: Array<ListHeaderModel>;\n _paging: PagingModel;\n _filterCollection: FilterCollection;\n _sorting: SortingModel;\n _actionCollection: ActionCollection;\n _listItemCollection: ListItemCollection;\n _grouping: GroupingModel;\n _selfhref: ListHref;\n\n /**\n */\n get type(): string {\n return \"List\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype ?? \"\";\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel;\n return listDetailLink;\n });\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.detail = models.find((childModel) => childModel.type === \"ListDetail\");\n }\n\n /**\n * Getting the label of the list\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext(): string {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection(): ListItemCollection {\n if (!this._listItemCollection) {\n this._listItemCollection = ListItemCollection.createFromList(this);\n }\n\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail(): ?ListDetailModel {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ?ModularUIModel) {\n if (detail instanceof ListDetailModel) {\n const listitemHref = detail.selfhref;\n\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(listitemHref)\n );\n\n if (listitem) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n }\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href)\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(this.data.filter, {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n });\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(this.data.actions, this.contributions.actions);\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref(): ListHref {\n const selfLink = this.links ? this.links.getLinkByKey(\"self\") : null;\n\n if (selfLink !== null) {\n return new ListHref(selfLink.href, this);\n }\n\n return new ListHref();\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): ListHref {\n if (!this._selfhref) {\n this._selfhref = this.setSelfHref();\n }\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader)\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EAAA;IAAA;IAAA,+CACvB,IAAI;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAUhC;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IAAA;IACzD,MAAMC,YAAY,GAAGD,IAAI,CAACE,aAAa,EAAEC,YAAY,IAAI,EAAE;IAC3D,OACE,uBAAAF,YAAY,OAAZA,YAAY,EAAU,MAAM,CAAC,IAC7B,uBAAAA,YAAY,OAAZA,YAAY,EAAU,WAAW,CAAC,IAClC,uBAAAA,YAAY,OAAZA,YAAY,EAAU,uBAAuB,CAAC,IAC9C,uBAAAA,YAAY,OAAZA,YAAY,EAAU,uBAAuB,CAAC,IAC9C,mCACE,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,iBAAiB,CAClB,iBAAUA,YAAY,CAAC;EAE5B;;EAEA;AACF;EACEG,yBAAyB,GAAqB;IAC5C,IACE,IAAI,CAACC,UAAU,CAACC,GAAG,CAACC,sCAAyB,CAAC,IAC9C,IAAI,CAACC,kBAAkB,CAACC,MAAM,KAAK,CAAC,EACpC;MAAA;MACA,OAAO,kCAAI,CAACD,kBAAkB,kBAAME,QAAQ,IAAK;QAC/C,MAAMC,cAAc,GAAGD,QAAQ,CAACE,QAAQ;QACxCD,cAAc,CAACE,WAAW,GAAGC,wBAAe;QAC5C,OAAOH,cAAc;MACvB,CAAC,CAAC;IACJ;IAEA,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AAG,CAAC,CAAC;IAExB,IAAI,IAAI,CAACnG,aAAa,CAACwF,OAAO,EAAE;MAC9B,MAAM;QAAEA;MAAQ,CAAC,GAAG,IAAI,CAACxF,aAAa;MACtC,mBAAYwF,OAAO,CAAC,CAACC,OAAO,CAAElB,GAAG,IAAK;QACpCiB,OAAO,CAACjB,GAAG,CAAC,CAACmB,UAAU,CAACD,OAAO,CAAEE,SAAS,IAAK;UAC7C,MAAMS,YAAY,GAAG,mBAAYT,SAAS,CAAC,CAAC,CAAC,CAAC;UAC9CQ,aAAa,CAACC,YAAY,CAAC,GAAGT,SAAS,CAACS,YAAY,CAAC,CAACnF,KAAK;QAC7D,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAOkF,aAAa;EACtB;;EAEA;AACF;AACA;EACEE,gBAAgB,CAACC,UAAkB,EAAoB;IACrD,OAAO,IAAI,CAACxD,gBAAgB,CAACuD,gBAAgB,CAACC,UAAU,CAAC;EAC3D;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"ListModel.js","names":["ListModel","ResourceModel","type","isApplicableModel","data","resourceType","contributions","resourcetype","getInitialChildModelLinks","layouthint","has","SHOW_ONE_RESULT_AS_DETAIL","listItemCollection","length","listItem","listDetailLink","selflink","targetModel","ListDetailModel","setChildModels","models","detail","childModel","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","ListItemCollection","createFromList","_detail","listitemHref","selfhref","listitem","equals","setSelfHref","grouping","_grouping","setGrouping","GroupingModel","dynamicschema","contexts","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","HIDE_WHEN_EMPTY","actionCollection","isEmpty","filterCollection","hasActiveFilters","getListItemById","id","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","paging","_paging","setPaging","PagingModel","sorting","_sorting","setSorting","SortingModel","getSortingLabels","_filterCollection","setFilters","FilterCollection","listkey","key","filter","isFiltered","_actionCollection","setActionCollection","ActionCollection","actions","hasList","selfLink","links","getLinkByKey","ListHref","_selfhref","headers","_headers","setHeaders","tempHeaders","results","forEach","attributes","attribute","listHeader","ListHeaderModel","exists","some","tempHeader","CASEVIEW_LINK","push","sortingLabels","attributeKey","getActionsByType","actionType"],"sources":["../../../src/models/list/ListModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ListItemCollection from \"../list/ListItemCollection\";\nimport ListDetailModel from \"../list/ListDetailModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport GroupingModel from \"../grouping/GroupingModel\";\nimport ListHeaderModel from \"../list/ListHeaderModel\";\nimport ListHref from \"../href/ListHref\";\nimport ListItemModel from \"../list/ListItemModel\";\nimport PagingModel from \"../paging/PagingModel\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport SortingModel from \"../sorting/SortingModel\";\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Defines a list object\n */\nexport default class ListModel extends ResourceModel {\n _detail: ?ListDetailModel = null;\n _headers: Array<ListHeaderModel>;\n _paging: PagingModel;\n _filterCollection: FilterCollection;\n _sorting: SortingModel;\n _actionCollection: ActionCollection;\n _listItemCollection: ListItemCollection;\n _grouping: GroupingModel;\n _selfhref: ListHref;\n\n /**\n */\n get type(): string {\n return \"List\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype ?? \"\";\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel;\n return listDetailLink;\n });\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.detail = models.find((childModel) => childModel.type === \"ListDetail\");\n }\n\n /**\n * Getting the label of the list\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext(): string {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection(): ListItemCollection {\n if (!this._listItemCollection) {\n this._listItemCollection = ListItemCollection.createFromList(this);\n }\n\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail(): ?ListDetailModel {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ?ModularUIModel) {\n if (detail instanceof ListDetailModel) {\n const listitemHref = detail.selfhref;\n\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(listitemHref)\n );\n\n if (listitem) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n }\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href)\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(this.data.filter, {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n });\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(this.data.actions, this.contributions.actions);\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref(): ListHref {\n const selfLink = this.links ? this.links.getLinkByKey(\"self\") : null;\n\n if (selfLink !== null) {\n return new ListHref(selfLink.href, this);\n }\n\n return new ListHref();\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): ListHref {\n if (!this._selfhref) {\n this._selfhref = this.setSelfHref();\n }\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader)\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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ACjB,GAAG,CAAC,CAACmB,UAAU,CAACD,OAAO,CAAEE,SAAS,IAAK;UAC7C,MAAMS,YAAY,GAAG,mBAAYT,SAAS,CAAC,CAAC,CAAC,CAAC;UAC9CQ,aAAa,CAACC,YAAY,CAAC,GAAGT,SAAS,CAACS,YAAY,CAAC,CAACnF,KAAK;QAC7D,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAOkF,aAAa;EACtB;;EAEA;AACF;AACA;EACEE,gBAAgB,CAACC,UAAkB,EAAoB;IACrD,OAAO,IAAI,CAACxD,gBAAgB,CAACuD,gBAAgB,CAACC,UAAU,CAAC;EAC3D;AACF;AAAC"}
|
|
@@ -57,7 +57,7 @@ class Parameter {
|
|
|
57
57
|
// parameter has the structure prefix~name=value
|
|
58
58
|
const namePart = parameter.substr(0, parameter.indexOf("="));
|
|
59
59
|
const value = parameter.substr(parameter.indexOf("=") + 1);
|
|
60
|
-
let prefix
|
|
60
|
+
let prefix;
|
|
61
61
|
let name = namePart;
|
|
62
62
|
if ((0, _includes.default)(namePart).call(namePart, _Constants.PARAMETER_SEPARATOR)) {
|
|
63
63
|
prefix = namePart.substr(0, namePart.indexOf("~"));
|
|
@@ -55,7 +55,7 @@ class Parameter {
|
|
|
55
55
|
const namePart = parameter.substr(0, parameter.indexOf("="));
|
|
56
56
|
const value = parameter.substr(parameter.indexOf("=") + 1);
|
|
57
57
|
|
|
58
|
-
let prefix
|
|
58
|
+
let prefix;
|
|
59
59
|
let name = namePart;
|
|
60
60
|
if (namePart.includes(PARAMETER_SEPARATOR)) {
|
|
61
61
|
prefix = namePart.substr(0, namePart.indexOf("~"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Parameter.js","names":["Parameter","constructor","prefix","name","value","_prefix","_name","_value","fromString","parameter","namePart","substr","indexOf","PARAMETER_SEPARATOR","decodeURIComponent","toString","withPrefix","toQuerystring","encodeURIComponent","isModUIParameter","_isModUIParameter","uiParameterSetting","getSetting","DEFAULT_UI_PARAMETERS"],"sources":["../../../src/models/parameter/Parameter.js"],"sourcesContent":["// @flow\nimport {\n PARAMETER_SEPARATOR,\n DEFAULT_UI_PARAMETERS,\n} from \"../../constants/Constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\n/**\n * Querystring parameter\n */\nclass Parameter {\n _prefix: ?string;\n _name: string;\n _value: ?string;\n _isModUIParameter: boolean | null = null;\n\n /**\n */\n constructor(prefix: ?string, name: string, value: ?string) {\n this._prefix = prefix;\n this._name = name;\n this._value = value;\n }\n\n /**\n * Getting prefix\n */\n get prefix(): ?string {\n return this._prefix;\n }\n\n /**\n * Getting name\n */\n get name(): string {\n return this._name;\n }\n\n /**\n * Getting value\n */\n get value(): ?string {\n return this._value;\n }\n\n /**\n * Create parameter from string input\n */\n static fromString(parameter: string): null | Parameter {\n if (parameter == null || parameter === \"\" || !parameter.includes(\"=\")) {\n return null;\n }\n\n // parameter has the structure prefix~name=value\n const namePart = parameter.substr(0, parameter.indexOf(\"=\"));\n const value = parameter.substr(parameter.indexOf(\"=\") + 1);\n\n let prefix
|
|
1
|
+
{"version":3,"file":"Parameter.js","names":["Parameter","constructor","prefix","name","value","_prefix","_name","_value","fromString","parameter","namePart","substr","indexOf","PARAMETER_SEPARATOR","decodeURIComponent","toString","withPrefix","toQuerystring","encodeURIComponent","isModUIParameter","_isModUIParameter","uiParameterSetting","getSetting","DEFAULT_UI_PARAMETERS"],"sources":["../../../src/models/parameter/Parameter.js"],"sourcesContent":["// @flow\nimport {\n PARAMETER_SEPARATOR,\n DEFAULT_UI_PARAMETERS,\n} from \"../../constants/Constants\";\nimport { getSetting } from \"../../constants/Settings\";\n\n/**\n * Querystring parameter\n */\nclass Parameter {\n _prefix: ?string;\n _name: string;\n _value: ?string;\n _isModUIParameter: boolean | null = null;\n\n /**\n */\n constructor(prefix: ?string, name: string, value: ?string) {\n this._prefix = prefix;\n this._name = name;\n this._value = value;\n }\n\n /**\n * Getting prefix\n */\n get prefix(): ?string {\n return this._prefix;\n }\n\n /**\n * Getting name\n */\n get name(): string {\n return this._name;\n }\n\n /**\n * Getting value\n */\n get value(): ?string {\n return this._value;\n }\n\n /**\n * Create parameter from string input\n */\n static fromString(parameter: string): null | Parameter {\n if (parameter == null || parameter === \"\" || !parameter.includes(\"=\")) {\n return null;\n }\n\n // parameter has the structure prefix~name=value\n const namePart = parameter.substr(0, parameter.indexOf(\"=\"));\n const value = parameter.substr(parameter.indexOf(\"=\") + 1);\n\n let prefix;\n let name = namePart;\n if (namePart.includes(PARAMETER_SEPARATOR)) {\n prefix = namePart.substr(0, namePart.indexOf(\"~\"));\n name = namePart.substr(namePart.indexOf(\"~\") + 1);\n }\n\n if (name === \"\") {\n return null;\n }\n\n return new Parameter(prefix, name, decodeURIComponent(value));\n }\n\n /**\n * Convert parameter to string\n */\n toString(withPrefix: boolean = true): string {\n if (!this.name) {\n return \"\";\n }\n\n const value = this.value == null ? \"\" : this.value;\n\n return withPrefix && this.prefix\n ? `${this.prefix}${PARAMETER_SEPARATOR}${this.name}=${value}`\n : `${this.name}=${value}`;\n }\n\n /**\n */\n toQuerystring(withPrefix: boolean = true): string {\n if (!this.name) {\n return \"\";\n }\n\n const value = this.value == null ? \"\" : encodeURIComponent(this.value);\n\n return withPrefix && this.prefix\n ? `${this.prefix}${PARAMETER_SEPARATOR}${this.name}=${value}`\n : `${this.name}=${value}`;\n }\n\n /**\n * Indicates if parameter can be send to the Be Informed modular UI\n */\n get isModUIParameter(): boolean {\n if (this._isModUIParameter == null) {\n const uiParameterSetting = getSetting(\"UI_PARAMETERS\", []);\n this._isModUIParameter = ![\n ...DEFAULT_UI_PARAMETERS,\n ...uiParameterSetting,\n ].includes(this.name);\n }\n\n return this._isModUIParameter;\n }\n}\n\nexport default Parameter;\n"],"mappings":";;;;;;;;;AACA;AAIA;AAEA;AACA;AACA;AACA,MAAMA,SAAS,CAAC;EAMd;AACF;EACEC,WAAW,CAACC,MAAe,EAAEC,IAAY,EAAEC,KAAc,EAAE;IAA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ACiB,iBAAiB;EAC/B;AACF;AAAC,eAEcpB,SAAS;AAAA"}
|
package/lib/models/types.js.flow
CHANGED
|
@@ -116,25 +116,25 @@ export type FormErrorAnchor = {
|
|
|
116
116
|
},
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
export type labelsJSON = {
|
|
119
|
+
export type labelsJSON = {
|
|
120
120
|
_id: string,
|
|
121
121
|
label: string,
|
|
122
122
|
value: string,
|
|
123
|
-
|
|
123
|
+
};
|
|
124
124
|
|
|
125
|
-
export type propertyJSON = {
|
|
125
|
+
export type propertyJSON = {
|
|
126
126
|
_id: string,
|
|
127
127
|
type: string,
|
|
128
128
|
mandatory: string,
|
|
129
129
|
label: string,
|
|
130
130
|
value: string,
|
|
131
|
-
|
|
131
|
+
};
|
|
132
132
|
|
|
133
|
-
export type textfragmentJSON = {
|
|
133
|
+
export type textfragmentJSON = {
|
|
134
134
|
label: string,
|
|
135
135
|
text: string,
|
|
136
136
|
type: string,
|
|
137
|
-
|
|
137
|
+
};
|
|
138
138
|
|
|
139
139
|
export interface IConstraintModel {
|
|
140
140
|
+id: string;
|
package/lib/models/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
|
|
@@ -183,7 +183,7 @@ class ModularUIRequest {
|
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
*/
|
|
186
|
-
processContributionsService(contributionsData: Object) {
|
|
186
|
+
processContributionsService(contributionsData: Object): void {
|
|
187
187
|
if (!isPlainObject(contributionsData)) {
|
|
188
188
|
throw new IllegalArgumentException(
|
|
189
189
|
"Missing contributions data or contributions is not JSON"
|
|
@@ -206,14 +206,14 @@ class ModularUIRequest {
|
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
208
|
*/
|
|
209
|
-
handleContributionsError(error: Object) {
|
|
209
|
+
handleContributionsError(error: Object): void {
|
|
210
210
|
const errorMessage = error.properties?.message ?? "Error in contribution";
|
|
211
211
|
throw new ModularUIError(errorMessage, error, this.contributionsHref);
|
|
212
212
|
}
|
|
213
213
|
|
|
214
214
|
/**
|
|
215
215
|
*/
|
|
216
|
-
handleDataError(error: Object) {
|
|
216
|
+
handleDataError(error: Object): void {
|
|
217
217
|
if (error.properties) {
|
|
218
218
|
const errorMessage = error.properties?.message ?? "Error in data";
|
|
219
219
|
throw new ModularUIError(errorMessage, error, this.href.path.toString());
|
|
@@ -224,7 +224,7 @@ class ModularUIRequest {
|
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
226
|
*/
|
|
227
|
-
handleData(key: string, data: Object) {
|
|
227
|
+
handleData(key: string, data: Object): void {
|
|
228
228
|
this.response.key = key;
|
|
229
229
|
this.response.data = data;
|
|
230
230
|
|
|
@@ -243,7 +243,7 @@ class ModularUIRequest {
|
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
245
|
*/
|
|
246
|
-
processDataService(data: Object) {
|
|
246
|
+
processDataService(data: Object): void {
|
|
247
247
|
if (!isPlainObject(data)) {
|
|
248
248
|
throw new IllegalArgumentException("Missing data or data is not JSON");
|
|
249
249
|
}
|
|
@@ -431,7 +431,7 @@ class ModularUIRequest {
|
|
|
431
431
|
);
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
const newDataLinks = {};
|
|
434
|
+
const newDataLinks: { [string]: any } = {};
|
|
435
435
|
for (const dataLinkKey in dataLinks) {
|
|
436
436
|
if (!hiddenLinks.includes(dataLinkKey)) {
|
|
437
437
|
newDataLinks[dataLinkKey] = dataLinks[dataLinkKey];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModularUIRequest.js","names":["ModularUIRequest","constructor","href","options","HTTP_METHODS","GET","IllegalArgumentException","_response","ModularUIResponse","Href","locale","parameters","targetModel","method","contributionsHref","_contributionsHref","_locale","response","_href","_method","_options","withChildModels","childmodels","_targetModel","createModel","Model","resolveModel","isApplicableModel","IllegalStateException","processContributionsService","contributionsData","isPlainObject","contributionsKey","error","handleContributionsError","key","contributions","errorMessage","properties","message","ModularUIError","handleDataError","path","toString","handleData","data","links","_links","Array","isArray","processDataService","fetchContributionsService","universalFetch","url","BASE","cache","fetchDataService","params","getQuerystringForModularUI","onProgress","processAsyncLayoutHints","getSetting","processApplicationLinks","processTabLinks","processPanelLinks","resolve","contributionLinks","dataLinks","contributionTabLink","tab","dataTabLinks","dataLink","name","processLinks","components","then","newLinks","replaceApplicationLinks","tabName","tabLink","component","panel","dataLinksPerName","linksPerName","hideWhenEmptyLinks","contributionLink","layouthint","includes","HIDE_WHEN_EMPTY","isHiddenListChecks","push","isHiddenList","all","hiddenLinks","newDataLinks","dataLinkKey","HIDE_WHEN_EMPTY_IGNORE_TASKS","_embedded","actions","noListItems","noActions","isHidden","catch","progressEvent","_progressEvent","getDynamicValidationData","model","prevData","JSON","parse","FormModel","newData","validationData","deepmerge","loadDynamicValidations","isValidationRequest","currentFormObject","hasDynamicValidations","validationHref","setParameter","updateValidations","fetch","Error","fetchChildModels","fetchFromCache","childModelLinks","getInitialChildModelLinks","childModelRequests","childModelLink","request","isCacheable","allSettled","childModels","resolvedChildModels","forEach","childModel","status","reason","console","value","addChildModels","fetchContent","withChildSections","ContentModel","childSectionLinks","length","fetchContentChildSections","contentModel","newContentModel","clone","childSectionLink","contentHrefWithEntryDate","selfhref","addParameter","TIMEVERSION_FILTER_NAME","entryDate","sectionModels","childSections","post","POST","postForm","form","formdata","update"],"sources":["../../src/modularui/ModularUIRequest.js"],"sourcesContent":["// @flow\nimport deepmerge from \"deepmerge\";\n\nimport {\n BASE,\n HTTP_METHODS,\n TIMEVERSION_FILTER_NAME,\n} from \"../constants/Constants\";\n\nimport { HIDE_WHEN_EMPTY } from \"../constants/LayoutHints\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport Href from \"../models/href/Href\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport resolveModel from \"../models/resolveModel\";\nimport FormModel from \"../models/form/FormModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport ModularUIResponse from \"./ModularUIResponse\";\n\nimport ModularUIError from \"./ModularUIError\";\nimport { IllegalArgumentException, IllegalStateException } from \"../exceptions\";\n\nimport { isPlainObject } from \"../utils/helpers/objects\";\n\nimport type { RequestBaseOptions } from \"../utils/fetch/types\";\nimport type { ModularUIModel } from \"../models/types\";\n\n/**\n * Helper for fetching data and contributions from the Be Informed modular ui\n * and merge it into a target or resolvable model.\n */\nclass ModularUIRequest {\n _response: ModularUIResponse;\n\n _href: Href;\n _options: RequestBaseOptions;\n _targetModel: ?Class<ModularUIModel>;\n _contributionsHref: string;\n _locale: string;\n _method: $Keys<typeof HTTP_METHODS> = HTTP_METHODS.GET;\n\n _progressEvent: ProgressEventHandler;\n\n /**\n */\n constructor(href: Href | string, options: $Shape<RequestBaseOptions> = {}) {\n if (!href) {\n throw new IllegalArgumentException(\n \"You must pass a href to the resource that is requested\"\n );\n }\n\n this.options = options;\n\n this._response = new ModularUIResponse();\n\n this.href = typeof href === \"string\" ? new Href(href) : href;\n this.locale = options.locale ?? \"en\";\n\n // copy request parameters to response, to be able to use them in the models\n // self links are missing the request parameters\n this._response.parameters = this.href.parameters;\n\n if (options.targetModel) {\n this.targetModel = options.targetModel;\n }\n\n if (options.method) {\n this.method = options.method;\n } else {\n this.method = this.href.method;\n }\n }\n\n /**\n */\n get contributionsHref(): string {\n return this._contributionsHref;\n }\n\n /**\n */\n set contributionsHref(contributionsHref: string) {\n this._contributionsHref = contributionsHref;\n }\n\n /**\n */\n set locale(locale: string) {\n this._locale = locale;\n this._response.locale = locale;\n }\n\n /**\n */\n get locale(): string {\n return this._locale;\n }\n\n /**\n */\n get response(): ModularUIResponse {\n return this._response;\n }\n\n /**\n */\n set href(href: Href) {\n this._href = href;\n }\n\n /**\n */\n get href(): Href {\n return this._href;\n }\n\n /**\n */\n set method(method: $Keys<typeof HTTP_METHODS>) {\n this._method = method;\n }\n\n /**\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this._method;\n }\n\n /**\n */\n get options(): RequestBaseOptions {\n return {\n ...this._options,\n locale: this.locale,\n method: this.method,\n };\n }\n\n /**\n */\n set options(options: RequestBaseOptions) {\n this._options = options;\n }\n\n /**\n */\n get withChildModels(): boolean {\n return (\n !(\"childmodels\" in this.options) || this.options.childmodels === true\n );\n }\n\n /**\n */\n set targetModel(targetModel: ?Class<ModularUIModel>) {\n this._targetModel = targetModel;\n }\n\n /**\n */\n get targetModel(): ?Class<ModularUIModel> {\n return this._targetModel;\n }\n\n /**\n */\n createModel(): ModularUIModel {\n const Model = this.targetModel || resolveModel(this.response);\n\n // check for ResourceModel\n if (Model && Model.isApplicableModel) {\n return new Model(this.response);\n }\n\n throw new IllegalStateException(\n `No model available for data: ${JSON.stringify(this.response)}`\n );\n }\n\n /**\n */\n processContributionsService(contributionsData: Object) {\n if (!isPlainObject(contributionsData)) {\n throw new IllegalArgumentException(\n \"Missing contributions data or contributions is not JSON\"\n );\n }\n\n const [contributionsKey] = Object.keys(contributionsData);\n\n if (contributionsData.error && contributionsKey === \"error\") {\n this.handleContributionsError(contributionsData.error);\n }\n\n // The key of the data service is different from the contributions service for forms\n if (!(this.response.key in contributionsData)) {\n this.response.key = contributionsKey;\n }\n\n this.response.contributions = contributionsData[this.response.key];\n }\n\n /**\n */\n handleContributionsError(error: Object) {\n const errorMessage = error.properties?.message ?? \"Error in contribution\";\n throw new ModularUIError(errorMessage, error, this.contributionsHref);\n }\n\n /**\n */\n handleDataError(error: Object) {\n if (error.properties) {\n const errorMessage = error.properties?.message ?? \"Error in data\";\n throw new ModularUIError(errorMessage, error, this.href.path.toString());\n }\n\n throw new IllegalArgumentException(error);\n }\n\n /**\n */\n handleData(key: string, data: Object) {\n this.response.key = key;\n this.response.data = data;\n\n const links = data._links;\n\n if (links && links.contributions) {\n this.contributionsHref = links.contributions.href;\n } else if (Array.isArray(links) && links[0].contributions) {\n this.contributionsHref = links[0].contributions.href;\n } else {\n throw new IllegalArgumentException(\n `Contributions link not found for data with key ${key}`\n );\n }\n }\n\n /**\n */\n processDataService(data: Object) {\n if (!isPlainObject(data)) {\n throw new IllegalArgumentException(\"Missing data or data is not JSON\");\n }\n\n if (data.error) {\n this.handleDataError(data.error);\n } else {\n const [key] = Object.keys(data);\n this.handleData(key, data[key]);\n }\n }\n\n /**\n */\n fetchContributionsService(): Promise<any> {\n if (!this.contributionsHref) {\n throw new IllegalStateException(\"Missing a contributions href\");\n }\n\n return universalFetch({\n url: `${BASE}${this.contributionsHref}`,\n cache: true,\n locale: this.options.locale,\n });\n }\n\n /**\n */\n fetchDataService(): Promise<any> {\n return universalFetch({\n ...this.options,\n url: `${BASE}${this.href.path}`,\n params: this.href.getQuerystringForModularUI(),\n locale: this.options.locale,\n onProgress: this.onProgress,\n });\n }\n\n /**\n * Check if links contain a 'hide-when-empty' layout hint and remove the link from\n * the component when it exists and no results are available\n */\n async processAsyncLayoutHints(): Promise<void> {\n if (getSetting(\"ALLOW_HIDE_WHEN_EMPTY_ON_TABS\")) {\n await this.processApplicationLinks();\n await this.processTabLinks();\n }\n await this.processPanelLinks();\n\n return Promise.resolve();\n }\n\n /**\n * hide application links<br>\n * _links on application data contains an extra level of tab links\n */\n processApplicationLinks(): Promise<void> {\n const contributionLinks = this.response.contributions._links;\n const dataLinks = this.response.data._links;\n if (!contributionLinks || !dataLinks) {\n return Promise.resolve();\n }\n\n if (\"tab\" in contributionLinks && \"tab\" in dataLinks) {\n for (const contributionTabLink of contributionLinks.tab) {\n if (\"components\" in contributionTabLink) {\n const dataTabLinks = dataLinks.tab.find(\n (dataLink) => dataLink.name === contributionTabLink.name\n );\n\n if (dataTabLinks && \"components\" in dataTabLinks) {\n return this.processLinks(\n dataTabLinks.components,\n contributionTabLink.components\n ).then((newLinks) =>\n this.replaceApplicationLinks(contributionTabLink.name, newLinks)\n );\n }\n }\n }\n }\n\n return Promise.resolve();\n }\n\n /**\n * Replace hidden link in application link tree\n */\n replaceApplicationLinks(tabName: string, newLinks: Array<Object>): void {\n this.response.data._links.tab = this.response.data._links.tab.map(\n (tabLink) => {\n const key = tabLink.name;\n if (tabName === key) {\n tabLink.components = newLinks;\n }\n return tabLink;\n }\n );\n }\n\n /**\n */\n processTabLinks(): Promise<void> {\n const contributionLinks = this.response.contributions._links;\n\n if (!contributionLinks) {\n return Promise.resolve();\n }\n\n if (\"component\" in contributionLinks) {\n return this.processLinks(\n this.response.data._links.component,\n contributionLinks.component\n ).then((newLinks) => {\n this.response.data._links.component = newLinks;\n });\n }\n\n return Promise.resolve();\n }\n\n /**\n */\n processPanelLinks(): Promise<void> {\n const contributionLinks = this.response.contributions._links;\n\n if (!contributionLinks) {\n return Promise.resolve();\n }\n\n if (\"panel\" in contributionLinks) {\n return this.processLinks(\n this.response.data._links,\n contributionLinks.panel\n ).then((newLinks) => {\n this.response.data._links = newLinks;\n });\n }\n\n return Promise.resolve();\n }\n\n /**\n * Retrieve an object of key: link\n */\n dataLinksPerName(dataLinks: any): { [linkName: string]: any } {\n if (Array.isArray(dataLinks)) {\n const links = {};\n for (const dataLink of dataLinks) {\n links[dataLink.name] = dataLink;\n }\n return links;\n }\n return dataLinks;\n }\n\n /**\n * Check if links are empty and hide them when hide-when-empty hint exists\n */\n processLinks(\n dataLinks: any,\n contributionLinks: any\n ): Promise<Object | Array<Object>> {\n const linksPerName = this.dataLinksPerName(dataLinks);\n const hideWhenEmptyLinks = contributionLinks.filter((contributionLink) =>\n contributionLink.layouthint?.includes(HIDE_WHEN_EMPTY)\n );\n\n const isHiddenListChecks = [];\n\n for (const contributionLink of hideWhenEmptyLinks) {\n const dataLink = linksPerName[contributionLink.name];\n if (dataLink?.href) {\n isHiddenListChecks.push(\n this.isHiddenList(contributionLink.name, dataLink.href)\n );\n }\n }\n\n return Promise.all(isHiddenListChecks).then(\n (hiddenLinks: Array<string>) => {\n if (Array.isArray(dataLinks)) {\n return dataLinks.filter(\n (dataLink) => !hiddenLinks.includes(dataLink.name)\n );\n }\n\n const newDataLinks = {};\n for (const dataLinkKey in dataLinks) {\n if (!hiddenLinks.includes(dataLinkKey)) {\n newDataLinks[dataLinkKey] = dataLinks[dataLinkKey];\n }\n }\n return newDataLinks;\n }\n );\n }\n\n /**\n */\n isHiddenList(name: string, href: string): Promise<string> {\n const HIDE_WHEN_EMPTY_IGNORE_TASKS = getSetting(\n \"HIDE_WHEN_EMPTY_IGNORE_TASKS\",\n false\n );\n\n return universalFetch({\n ...this.options,\n url: `${BASE}${href}`,\n })\n .then((response: Object) => {\n if (isPlainObject(response)) {\n const [key] = Object.keys(response);\n const { _embedded, actions } = response[key];\n\n const noListItems = _embedded === null;\n const noActions = actions == null || HIDE_WHEN_EMPTY_IGNORE_TASKS;\n\n const isHidden = noListItems && noActions;\n if (isHidden) {\n return name;\n }\n }\n return \"\";\n })\n .catch(() => {\n return \"\";\n });\n }\n\n /**\n */\n set onProgress(progressEvent: ProgressEventHandler) {\n this._progressEvent = progressEvent;\n }\n\n /**\n */\n get onProgress(): ProgressEventHandler {\n return this._progressEvent || null;\n }\n\n /**\n * Combine previous send request data with new validation data to create a complete request object\n * The received model is new FormModel containing ONLY the current question, not the previously entered questions\n * to create a complete request we append the originally send form objects\n */\n getDynamicValidationData(model: ModularUIModel): string {\n const prevData =\n typeof this.options.data === \"string\"\n ? JSON.parse(this.options.data)\n : this.options.data;\n\n if (model instanceof FormModel) {\n const newData = JSON.parse(model.validationData);\n // $FlowFixMe incompatible-call\n return JSON.stringify(deepmerge(prevData || {}, newData));\n }\n\n return JSON.stringify(prevData) ?? \"{}\";\n }\n\n /**\n * First load of dynamic values when a form is loaded\n */\n loadDynamicValidations(model: ModularUIModel): Promise<ModularUIModel> {\n if (\n !this.options.isValidationRequest &&\n getSetting(\"USE_INSTANT_SERVER_VALIDATION\") &&\n model instanceof FormModel &&\n model.currentFormObject &&\n model.currentFormObject.hasDynamicValidations\n ) {\n const validationHref = this.href.setParameter(\"commit\", \"false\");\n return universalFetch({\n ...this.options,\n url: `${BASE}${this.href.path}`,\n params: validationHref.getQuerystringForModularUI(),\n childmodels: false,\n data: this.getDynamicValidationData(model),\n }).then((data) => {\n if (data == null || typeof data !== \"object\") {\n return model;\n }\n\n const [key] = Object.keys(data);\n return model.updateValidations(data[key]);\n });\n }\n\n return Promise.resolve(model);\n }\n\n /**\n */\n fetch(): Promise<ModularUIModel> {\n return this.fetchDataService()\n .then((data) => {\n if (data == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(data);\n return this.fetchContributionsService();\n })\n .then((contributionsData) => {\n if (contributionsData == null) {\n throw new Error(\n `No contributions data received for ${this.contributionsHref}`\n );\n }\n\n this.processContributionsService(contributionsData);\n return this.processAsyncLayoutHints();\n })\n .then(() => Promise.resolve(this.createModel()))\n .then((model) => this.loadDynamicValidations(model))\n .then((model) => {\n if (this.withChildModels) {\n return this.fetchChildModels(model);\n }\n\n return Promise.resolve(model);\n });\n }\n\n /**\n */\n fetchFromCache(): Promise<ModularUIModel> {\n this.options = {\n ...this.options,\n cache: true,\n };\n\n return this.fetch();\n }\n\n /**\n */\n fetchChildModels(model: ModularUIModel): Promise<ModularUIModel> {\n const childModelLinks = model.getInitialChildModelLinks();\n\n const childModelRequests = childModelLinks.map((childModelLink) => {\n const request = new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n });\n\n if (childModelLink.targetModel) {\n request.targetModel = childModelLink.targetModel;\n }\n\n if (childModelLink.isCacheable) {\n return request.fetchFromCache();\n }\n\n return request.fetch();\n });\n\n return Promise.allSettled(childModelRequests).then((childModels) => {\n const resolvedChildModels = [];\n\n childModels.forEach((childModel) => {\n if (childModel.status === \"rejected\") {\n const { reason } = childModel;\n if (reason.name !== \"Error.ChangePasswordRequired\") {\n console.error(\n \"Unexpected error when retrieving child model:\",\n reason\n );\n }\n } else {\n resolvedChildModels.push(childModel.value);\n }\n });\n\n model.addChildModels(resolvedChildModels);\n\n return model;\n });\n }\n\n /**\n */\n fetchContent(withChildSections: boolean): Promise<mixed> {\n return this.fetchFromCache().then((model) => {\n if (\n withChildSections &&\n model instanceof ContentModel &&\n model.childSectionLinks.length > 0\n ) {\n return this.fetchContentChildSections(model);\n }\n\n return Promise.resolve(model);\n });\n }\n\n /**\n * Recursively return child sections defined on the content model\n */\n fetchContentChildSections(contentModel: ContentModel): Promise<mixed> {\n const newContentModel = contentModel.clone();\n\n return Promise.all(\n contentModel.childSectionLinks.map((childSectionLink) => {\n const contentHrefWithEntryDate = childSectionLink.selfhref.addParameter(\n TIMEVERSION_FILTER_NAME,\n contentModel.entryDate\n );\n\n const request = new ModularUIRequest(contentHrefWithEntryDate, {\n locale: this.locale,\n });\n\n return request.fetchContent(true);\n })\n ).then((sectionModels) => {\n newContentModel.childSections = sectionModels;\n\n return newContentModel;\n });\n }\n\n /**\n * Make a post request with optionally data to send\n * @param data\n */\n post(data?: string | { [key: string]: string }): Promise<ModularUIModel> {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data,\n };\n\n return this.fetch();\n }\n\n /**\n * Make a POST request using the form, an updated form is returned (merge of old and new form)\n * @param form\n * @returns {Promise<FormModel>}\n */\n postForm(form: FormModel): Promise<FormModel> {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data: form.formdata,\n };\n\n return this.fetch().then((response) => {\n return form.update(response);\n });\n }\n}\n\nexport default ModularUIRequest;\n"],"mappings":";;;;;;;;;;;;;;;AACA;AAEA;AAMA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA,MAAMA,gBAAgB,CAAC;EAYrB;AACF;EACEC,WAAW,CAACC,IAAmB,EAA4C;IAAA,IAA1CC,OAAmC,uEAAG,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,+CANnCC,uBAAY,CAACC,GAAG;IAAA;IAOpD,IAAI,CAACH,IAAI,EAAE;MACT,MAAM,IAAII,oCAAwB,CAChC,wDAAwD,CACzD;IACH;IAEA,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,IAAI,CAACI,SAAS,GAAG,IAAIC,0BAAiB,EAAE;IAExC,IAAI,CAACN,IAAI,GAAG,OAAOA,IAAI,KAAK,QAAQ,GAAG,IAAIO,aAAI,CAACP,IAAI,CAAC,GAAGA,IAAI;IAC5D,IAAI,CAACQ,MAAM,GAAGP,OAAO,CAACO,MAAM,IAAI,IAAI;;IAEpC;IACA;IACA,IAAI,CAACH,SAAS,CAACI,UAAU,GAAG,IAAI,CAACT,IAAI,CAACS,UAAU;IAEhD,IAAIR,OAAO,CAACS,WAAW,EAAE;MACvB,IAAI,CAACA,WAAW,GAAGT,OAAO,CAACS,WAAW;IACxC;IAEA,IAAIT,OAAO,CAACU,MAAM,EAAE;MAClB,IAAI,CAACA,MAAM,GAAGV,OAAO,CAACU,MAAM;IAC9B,CAAC,MAAM;MACL,IAAI,CAACA,MAAM,GAAG,IAAI,CAACX,IAAI,CAACW,MAAM;IAChC;EACF;;EAEA;AACF;EACE,IAAIC,i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b,CAAC;IAED,OAAO,IAAI,CAACzC,KAAK,EAAE,CAAC9C,IAAI,CAAE1D,QAAQ,IAAK;MACrC,OAAOgJ,IAAI,CAACE,MAAM,CAAClJ,QAAQ,CAAC;IAC9B,CAAC,CAAC;EACJ;AACF;AAAC,eAEcjB,gBAAgB;AAAA"}
|
|
1
|
+
{"version":3,"file":"ModularUIRequest.js","names":["ModularUIRequest","constructor","href","options","HTTP_METHODS","GET","IllegalArgumentException","_response","ModularUIResponse","Href","locale","parameters","targetModel","method","contributionsHref","_contributionsHref","_locale","response","_href","_method","_options","withChildModels","childmodels","_targetModel","createModel","Model","resolveModel","isApplicableModel","IllegalStateException","processContributionsService","contributionsData","isPlainObject","contributionsKey","error","handleContributionsError","key","contributions","errorMessage","properties","message","ModularUIError","handleDataError","path","toString","handleData","data","links","_links","Array","isArray","processDataService","fetchContributionsService","universalFetch","url","BASE","cache","fetchDataService","params","getQuerystringForModularUI","onProgress","processAsyncLayoutHints","getSetting","processApplicationLinks","processTabLinks","processPanelLinks","resolve","contributionLinks","dataLinks","contributionTabLink","tab","dataTabLinks","dataLink","name","processLinks","components","then","newLinks","replaceApplicationLinks","tabName","tabLink","component","panel","dataLinksPerName","linksPerName","hideWhenEmptyLinks","contributionLink","layouthint","includes","HIDE_WHEN_EMPTY","isHiddenListChecks","push","isHiddenList","all","hiddenLinks","newDataLinks","dataLinkKey","HIDE_WHEN_EMPTY_IGNORE_TASKS","_embedded","actions","noListItems","noActions","isHidden","catch","progressEvent","_progressEvent","getDynamicValidationData","model","prevData","JSON","parse","FormModel","newData","validationData","deepmerge","loadDynamicValidations","isValidationRequest","currentFormObject","hasDynamicValidations","validationHref","setParameter","updateValidations","fetch","Error","fetchChildModels","fetchFromCache","childModelLinks","getInitialChildModelLinks","childModelRequests","childModelLink","request","isCacheable","allSettled","childModels","resolvedChildModels","forEach","childModel","status","reason","console","value","addChildModels","fetchContent","withChildSections","ContentModel","childSectionLinks","length","fetchContentChildSections","contentModel","newContentModel","clone","childSectionLink","contentHrefWithEntryDate","selfhref","addParameter","TIMEVERSION_FILTER_NAME","entryDate","sectionModels","childSections","post","POST","postForm","form","formdata","update"],"sources":["../../src/modularui/ModularUIRequest.js"],"sourcesContent":["// @flow\nimport deepmerge from \"deepmerge\";\n\nimport {\n BASE,\n HTTP_METHODS,\n TIMEVERSION_FILTER_NAME,\n} from \"../constants/Constants\";\n\nimport { HIDE_WHEN_EMPTY } from \"../constants/LayoutHints\";\n\nimport { getSetting } from \"../constants/Settings\";\n\nimport Href from \"../models/href/Href\";\n\nimport universalFetch from \"../utils/fetch/universalFetch\";\nimport resolveModel from \"../models/resolveModel\";\nimport FormModel from \"../models/form/FormModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport ModularUIResponse from \"./ModularUIResponse\";\n\nimport ModularUIError from \"./ModularUIError\";\nimport { IllegalArgumentException, IllegalStateException } from \"../exceptions\";\n\nimport { isPlainObject } from \"../utils/helpers/objects\";\n\nimport type { RequestBaseOptions } from \"../utils/fetch/types\";\nimport type { ModularUIModel } from \"../models/types\";\n\n/**\n * Helper for fetching data and contributions from the Be Informed modular ui\n * and merge it into a target or resolvable model.\n */\nclass ModularUIRequest {\n _response: ModularUIResponse;\n\n _href: Href;\n _options: RequestBaseOptions;\n _targetModel: ?Class<ModularUIModel>;\n _contributionsHref: string;\n _locale: string;\n _method: $Keys<typeof HTTP_METHODS> = HTTP_METHODS.GET;\n\n _progressEvent: ProgressEventHandler;\n\n /**\n */\n constructor(href: Href | string, options: $Shape<RequestBaseOptions> = {}) {\n if (!href) {\n throw new IllegalArgumentException(\n \"You must pass a href to the resource that is requested\"\n );\n }\n\n this.options = options;\n\n this._response = new ModularUIResponse();\n\n this.href = typeof href === \"string\" ? new Href(href) : href;\n this.locale = options.locale ?? \"en\";\n\n // copy request parameters to response, to be able to use them in the models\n // self links are missing the request parameters\n this._response.parameters = this.href.parameters;\n\n if (options.targetModel) {\n this.targetModel = options.targetModel;\n }\n\n if (options.method) {\n this.method = options.method;\n } else {\n this.method = this.href.method;\n }\n }\n\n /**\n */\n get contributionsHref(): string {\n return this._contributionsHref;\n }\n\n /**\n */\n set contributionsHref(contributionsHref: string) {\n this._contributionsHref = contributionsHref;\n }\n\n /**\n */\n set locale(locale: string) {\n this._locale = locale;\n this._response.locale = locale;\n }\n\n /**\n */\n get locale(): string {\n return this._locale;\n }\n\n /**\n */\n get response(): ModularUIResponse {\n return this._response;\n }\n\n /**\n */\n set href(href: Href) {\n this._href = href;\n }\n\n /**\n */\n get href(): Href {\n return this._href;\n }\n\n /**\n */\n set method(method: $Keys<typeof HTTP_METHODS>) {\n this._method = method;\n }\n\n /**\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this._method;\n }\n\n /**\n */\n get options(): RequestBaseOptions {\n return {\n ...this._options,\n locale: this.locale,\n method: this.method,\n };\n }\n\n /**\n */\n set options(options: RequestBaseOptions) {\n this._options = options;\n }\n\n /**\n */\n get withChildModels(): boolean {\n return (\n !(\"childmodels\" in this.options) || this.options.childmodels === true\n );\n }\n\n /**\n */\n set targetModel(targetModel: ?Class<ModularUIModel>) {\n this._targetModel = targetModel;\n }\n\n /**\n */\n get targetModel(): ?Class<ModularUIModel> {\n return this._targetModel;\n }\n\n /**\n */\n createModel(): ModularUIModel {\n const Model = this.targetModel || resolveModel(this.response);\n\n // check for ResourceModel\n if (Model && Model.isApplicableModel) {\n return new Model(this.response);\n }\n\n throw new IllegalStateException(\n `No model available for data: ${JSON.stringify(this.response)}`\n );\n }\n\n /**\n */\n processContributionsService(contributionsData: Object): void {\n if (!isPlainObject(contributionsData)) {\n throw new IllegalArgumentException(\n \"Missing contributions data or contributions is not JSON\"\n );\n }\n\n const [contributionsKey] = Object.keys(contributionsData);\n\n if (contributionsData.error && contributionsKey === \"error\") {\n this.handleContributionsError(contributionsData.error);\n }\n\n // The key of the data service is different from the contributions service for forms\n if (!(this.response.key in contributionsData)) {\n this.response.key = contributionsKey;\n }\n\n this.response.contributions = contributionsData[this.response.key];\n }\n\n /**\n */\n handleContributionsError(error: Object): void {\n const errorMessage = error.properties?.message ?? \"Error in contribution\";\n throw new ModularUIError(errorMessage, error, this.contributionsHref);\n }\n\n /**\n */\n handleDataError(error: Object): void {\n if (error.properties) {\n const errorMessage = error.properties?.message ?? \"Error in data\";\n throw new ModularUIError(errorMessage, error, this.href.path.toString());\n }\n\n throw new IllegalArgumentException(error);\n }\n\n /**\n */\n handleData(key: string, data: Object): void {\n this.response.key = key;\n this.response.data = data;\n\n const links = data._links;\n\n if (links && links.contributions) {\n this.contributionsHref = links.contributions.href;\n } else if (Array.isArray(links) && links[0].contributions) {\n this.contributionsHref = links[0].contributions.href;\n } else {\n throw new IllegalArgumentException(\n `Contributions link not found for data with key ${key}`\n );\n }\n }\n\n /**\n */\n processDataService(data: Object): void {\n if (!isPlainObject(data)) {\n throw new IllegalArgumentException(\"Missing data or data is not JSON\");\n }\n\n if (data.error) {\n this.handleDataError(data.error);\n } else {\n const [key] = Object.keys(data);\n this.handleData(key, data[key]);\n }\n }\n\n /**\n */\n fetchContributionsService(): Promise<any> {\n if (!this.contributionsHref) {\n throw new IllegalStateException(\"Missing a contributions href\");\n }\n\n return universalFetch({\n url: `${BASE}${this.contributionsHref}`,\n cache: true,\n locale: this.options.locale,\n });\n }\n\n /**\n */\n fetchDataService(): Promise<any> {\n return universalFetch({\n ...this.options,\n url: `${BASE}${this.href.path}`,\n params: this.href.getQuerystringForModularUI(),\n locale: this.options.locale,\n onProgress: this.onProgress,\n });\n }\n\n /**\n * Check if links contain a 'hide-when-empty' layout hint and remove the link from\n * the component when it exists and no results are available\n */\n async processAsyncLayoutHints(): Promise<void> {\n if (getSetting(\"ALLOW_HIDE_WHEN_EMPTY_ON_TABS\")) {\n await this.processApplicationLinks();\n await this.processTabLinks();\n }\n await this.processPanelLinks();\n\n return Promise.resolve();\n }\n\n /**\n * hide application links<br>\n * _links on application data contains an extra level of tab links\n */\n processApplicationLinks(): Promise<void> {\n const contributionLinks = this.response.contributions._links;\n const dataLinks = this.response.data._links;\n if (!contributionLinks || !dataLinks) {\n return Promise.resolve();\n }\n\n if (\"tab\" in contributionLinks && \"tab\" in dataLinks) {\n for (const contributionTabLink of contributionLinks.tab) {\n if (\"components\" in contributionTabLink) {\n const dataTabLinks = dataLinks.tab.find(\n (dataLink) => dataLink.name === contributionTabLink.name\n );\n\n if (dataTabLinks && \"components\" in dataTabLinks) {\n return this.processLinks(\n dataTabLinks.components,\n contributionTabLink.components\n ).then((newLinks) =>\n this.replaceApplicationLinks(contributionTabLink.name, newLinks)\n );\n }\n }\n }\n }\n\n return Promise.resolve();\n }\n\n /**\n * Replace hidden link in application link tree\n */\n replaceApplicationLinks(tabName: string, newLinks: Array<Object>): void {\n this.response.data._links.tab = this.response.data._links.tab.map(\n (tabLink) => {\n const key = tabLink.name;\n if (tabName === key) {\n tabLink.components = newLinks;\n }\n return tabLink;\n }\n );\n }\n\n /**\n */\n processTabLinks(): Promise<void> {\n const contributionLinks = this.response.contributions._links;\n\n if (!contributionLinks) {\n return Promise.resolve();\n }\n\n if (\"component\" in contributionLinks) {\n return this.processLinks(\n this.response.data._links.component,\n contributionLinks.component\n ).then((newLinks) => {\n this.response.data._links.component = newLinks;\n });\n }\n\n return Promise.resolve();\n }\n\n /**\n */\n processPanelLinks(): Promise<void> {\n const contributionLinks = this.response.contributions._links;\n\n if (!contributionLinks) {\n return Promise.resolve();\n }\n\n if (\"panel\" in contributionLinks) {\n return this.processLinks(\n this.response.data._links,\n contributionLinks.panel\n ).then((newLinks) => {\n this.response.data._links = newLinks;\n });\n }\n\n return Promise.resolve();\n }\n\n /**\n * Retrieve an object of key: link\n */\n dataLinksPerName(dataLinks: any): { [linkName: string]: any } {\n if (Array.isArray(dataLinks)) {\n const links = {};\n for (const dataLink of dataLinks) {\n links[dataLink.name] = dataLink;\n }\n return links;\n }\n return dataLinks;\n }\n\n /**\n * Check if links are empty and hide them when hide-when-empty hint exists\n */\n processLinks(\n dataLinks: any,\n contributionLinks: any\n ): Promise<Object | Array<Object>> {\n const linksPerName = this.dataLinksPerName(dataLinks);\n const hideWhenEmptyLinks = contributionLinks.filter((contributionLink) =>\n contributionLink.layouthint?.includes(HIDE_WHEN_EMPTY)\n );\n\n const isHiddenListChecks = [];\n\n for (const contributionLink of hideWhenEmptyLinks) {\n const dataLink = linksPerName[contributionLink.name];\n if (dataLink?.href) {\n isHiddenListChecks.push(\n this.isHiddenList(contributionLink.name, dataLink.href)\n );\n }\n }\n\n return Promise.all(isHiddenListChecks).then(\n (hiddenLinks: Array<string>) => {\n if (Array.isArray(dataLinks)) {\n return dataLinks.filter(\n (dataLink) => !hiddenLinks.includes(dataLink.name)\n );\n }\n\n const newDataLinks: { [string]: any } = {};\n for (const dataLinkKey in dataLinks) {\n if (!hiddenLinks.includes(dataLinkKey)) {\n newDataLinks[dataLinkKey] = dataLinks[dataLinkKey];\n }\n }\n return newDataLinks;\n }\n );\n }\n\n /**\n */\n isHiddenList(name: string, href: string): Promise<string> {\n const HIDE_WHEN_EMPTY_IGNORE_TASKS = getSetting(\n \"HIDE_WHEN_EMPTY_IGNORE_TASKS\",\n false\n );\n\n return universalFetch({\n ...this.options,\n url: `${BASE}${href}`,\n })\n .then((response: Object) => {\n if (isPlainObject(response)) {\n const [key] = Object.keys(response);\n const { _embedded, actions } = response[key];\n\n const noListItems = _embedded === null;\n const noActions = actions == null || HIDE_WHEN_EMPTY_IGNORE_TASKS;\n\n const isHidden = noListItems && noActions;\n if (isHidden) {\n return name;\n }\n }\n return \"\";\n })\n .catch(() => {\n return \"\";\n });\n }\n\n /**\n */\n set onProgress(progressEvent: ProgressEventHandler) {\n this._progressEvent = progressEvent;\n }\n\n /**\n */\n get onProgress(): ProgressEventHandler {\n return this._progressEvent || null;\n }\n\n /**\n * Combine previous send request data with new validation data to create a complete request object\n * The received model is new FormModel containing ONLY the current question, not the previously entered questions\n * to create a complete request we append the originally send form objects\n */\n getDynamicValidationData(model: ModularUIModel): string {\n const prevData =\n typeof this.options.data === \"string\"\n ? JSON.parse(this.options.data)\n : this.options.data;\n\n if (model instanceof FormModel) {\n const newData = JSON.parse(model.validationData);\n // $FlowFixMe incompatible-call\n return JSON.stringify(deepmerge(prevData || {}, newData));\n }\n\n return JSON.stringify(prevData) ?? \"{}\";\n }\n\n /**\n * First load of dynamic values when a form is loaded\n */\n loadDynamicValidations(model: ModularUIModel): Promise<ModularUIModel> {\n if (\n !this.options.isValidationRequest &&\n getSetting(\"USE_INSTANT_SERVER_VALIDATION\") &&\n model instanceof FormModel &&\n model.currentFormObject &&\n model.currentFormObject.hasDynamicValidations\n ) {\n const validationHref = this.href.setParameter(\"commit\", \"false\");\n return universalFetch({\n ...this.options,\n url: `${BASE}${this.href.path}`,\n params: validationHref.getQuerystringForModularUI(),\n childmodels: false,\n data: this.getDynamicValidationData(model),\n }).then((data) => {\n if (data == null || typeof data !== \"object\") {\n return model;\n }\n\n const [key] = Object.keys(data);\n return model.updateValidations(data[key]);\n });\n }\n\n return Promise.resolve(model);\n }\n\n /**\n */\n fetch(): Promise<ModularUIModel> {\n return this.fetchDataService()\n .then((data) => {\n if (data == null) {\n throw new Error(`No data received for ${this.href.toString()}`);\n }\n\n this.processDataService(data);\n return this.fetchContributionsService();\n })\n .then((contributionsData) => {\n if (contributionsData == null) {\n throw new Error(\n `No contributions data received for ${this.contributionsHref}`\n );\n }\n\n this.processContributionsService(contributionsData);\n return this.processAsyncLayoutHints();\n })\n .then(() => Promise.resolve(this.createModel()))\n .then((model) => this.loadDynamicValidations(model))\n .then((model) => {\n if (this.withChildModels) {\n return this.fetchChildModels(model);\n }\n\n return Promise.resolve(model);\n });\n }\n\n /**\n */\n fetchFromCache(): Promise<ModularUIModel> {\n this.options = {\n ...this.options,\n cache: true,\n };\n\n return this.fetch();\n }\n\n /**\n */\n fetchChildModels(model: ModularUIModel): Promise<ModularUIModel> {\n const childModelLinks = model.getInitialChildModelLinks();\n\n const childModelRequests = childModelLinks.map((childModelLink) => {\n const request = new ModularUIRequest(childModelLink.href, {\n locale: this.locale,\n });\n\n if (childModelLink.targetModel) {\n request.targetModel = childModelLink.targetModel;\n }\n\n if (childModelLink.isCacheable) {\n return request.fetchFromCache();\n }\n\n return request.fetch();\n });\n\n return Promise.allSettled(childModelRequests).then((childModels) => {\n const resolvedChildModels = [];\n\n childModels.forEach((childModel) => {\n if (childModel.status === \"rejected\") {\n const { reason } = childModel;\n if (reason.name !== \"Error.ChangePasswordRequired\") {\n console.error(\n \"Unexpected error when retrieving child model:\",\n reason\n );\n }\n } else {\n resolvedChildModels.push(childModel.value);\n }\n });\n\n model.addChildModels(resolvedChildModels);\n\n return model;\n });\n }\n\n /**\n */\n fetchContent(withChildSections: boolean): Promise<mixed> {\n return this.fetchFromCache().then((model) => {\n if (\n withChildSections &&\n model instanceof ContentModel &&\n model.childSectionLinks.length > 0\n ) {\n return this.fetchContentChildSections(model);\n }\n\n return Promise.resolve(model);\n });\n }\n\n /**\n * Recursively return child sections defined on the content model\n */\n fetchContentChildSections(contentModel: ContentModel): Promise<mixed> {\n const newContentModel = contentModel.clone();\n\n return Promise.all(\n contentModel.childSectionLinks.map((childSectionLink) => {\n const contentHrefWithEntryDate = childSectionLink.selfhref.addParameter(\n TIMEVERSION_FILTER_NAME,\n contentModel.entryDate\n );\n\n const request = new ModularUIRequest(contentHrefWithEntryDate, {\n locale: this.locale,\n });\n\n return request.fetchContent(true);\n })\n ).then((sectionModels) => {\n newContentModel.childSections = sectionModels;\n\n return newContentModel;\n });\n }\n\n /**\n * Make a post request with optionally data to send\n * @param data\n */\n post(data?: string | { [key: string]: string }): Promise<ModularUIModel> {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data,\n };\n\n return this.fetch();\n }\n\n /**\n * Make a POST request using the form, an updated form is returned (merge of old and new form)\n * @param form\n * @returns {Promise<FormModel>}\n */\n postForm(form: FormModel): Promise<FormModel> {\n this.method = HTTP_METHODS.POST;\n this.options = {\n ...this.options,\n data: form.formdata,\n };\n\n return this.fetch().then((response) => {\n return form.update(response);\n });\n }\n}\n\nexport default ModularUIRequest;\n"],"mappings":";;;;;;;;;;;;;;;AACA;AAEA;AAMA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AAEA;AAEA;AACA;AAEA;AAKA;AACA;AACA;AACA;AACA,MAAMA,gBAAgB,CAAC;EAYrB;AACF;EACEC,WAAW,CAACC,IAAmB,EAA4C;IAAA,IAA1CC,OAAmC,uEAAG,CAAC,CAAC;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,+CANnCC,uBAAY,CAACC,GAAG;IAAA;IAOpD,IAAI,CAACH,IAAI,EAAE;MACT,MAAM,IAAII,oCAAwB,CAChC,wDAAwD,CACzD;IACH;IAEA,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,IAAI,CAACI,SAAS,GAAG,IAAIC,0BAAiB,EAAE;IAExC,IAAI,CAACN,IAAI,GAAG,OAAOA,IAAI,KAAK,QAAQ,GAAG,IAAIO,aAAI,CAACP,IAAI,CAAC,GAAGA,IAAI;IAC5D,IAAI,CAACQ,MAAM,GAAGP,OAAO,CAACO,MAAM,IAAI,IAAI;;IAEpC;IACA;IACA,IAAI,CAACH,SAAS,CAACI,UAAU,GAAG,IAAI,CAACT,IAAI,CAACS,UAAU;IAEhD,IAAIR,OAAO,CAACS,WAAW,EAAE;MACvB,IAAI,CAACA,WAAW,GAAGT,OAAO,CAACS,WAAW;IACxC;IAEA,IAAIT,OAAO,CAACU,MAAM,EAAE;MAClB,IAAI,CAACA,MAAM,GAAGV,OAAO,CAACU,MAAM;IAC9B,CAAC,MAAM;MACL,IAAI,CAACA,MAAM,GAAG,IAAI,CAACX,IAAI,CAACW,MAAM;IAChC;EACF;;EAEA;AACF;EACE,IAAIC,iBAAiB,GAAW;IAC9B,OAAO,IAAI,CAACC,kBAAkB;EAChC;;EAEA;AACF;EACE,IAAID,iBAAiB,CAACA,iBAAyB,EAAE;IAC/C,IAAI,CAACC,kBAAkB,GAAGD,iBAAiB;EAC7C;;EAE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AAC;EACJ;AACF;AAAC,eAEcjB,gBAAgB;AAAA"}
|
|
@@ -20,7 +20,7 @@ var _Preferences = require("../redux/actions/Preferences");
|
|
|
20
20
|
var _Notification = require("../redux/actions/Notification");
|
|
21
21
|
var _Error = require("../redux/actions/Error");
|
|
22
22
|
var _SignIn = require("../redux/actions/SignIn");
|
|
23
|
-
var
|
|
23
|
+
var _RouterActions = require("../redux/_router/RouterActions");
|
|
24
24
|
var _exceptions = require("../exceptions");
|
|
25
25
|
var _Init = _interopRequireDefault(require("./Init"));
|
|
26
26
|
var _beforeRenderHooks = require("../redux/store/beforeRenderHooks");
|
|
@@ -89,7 +89,7 @@ const client = props => {
|
|
|
89
89
|
|
|
90
90
|
// listen to history change and update the redux router store
|
|
91
91
|
history.listen((location, action) => {
|
|
92
|
-
store.dispatch((0,
|
|
92
|
+
store.dispatch((0, _RouterActions.locationChange)(location, action));
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
/**
|
|
@@ -28,7 +28,7 @@ import { showXHRErrorNotification } from "../redux/actions/Notification";
|
|
|
28
28
|
import { handleError } from "../redux/actions/Error";
|
|
29
29
|
import { loginSuccess } from "../redux/actions/SignIn";
|
|
30
30
|
|
|
31
|
-
import { locationChange } from "../redux/_router/
|
|
31
|
+
import { locationChange } from "../redux/_router/RouterActions";
|
|
32
32
|
|
|
33
33
|
import { JsonParseException, FetchException } from "../exceptions";
|
|
34
34
|
|
|
@@ -38,7 +38,7 @@ import { handleBeforeRenderHooks } from "../redux/store/beforeRenderHooks";
|
|
|
38
38
|
|
|
39
39
|
import type { ComponentType } from "react";
|
|
40
40
|
import type { Theme } from "../react-theme/types";
|
|
41
|
-
import type { CustomReducers } from "../redux/types";
|
|
41
|
+
import type { CustomReducers, ReduxStore } from "../redux/types";
|
|
42
42
|
import type { RouterHistory } from "react-router";
|
|
43
43
|
import type { BeforeRenderHook } from "../redux/store/beforeRenderHooks";
|
|
44
44
|
import type { Props as FallbackProps } from "../react/ErrorBoundaryFallback";
|
|
@@ -55,7 +55,7 @@ export type Props = {
|
|
|
55
55
|
*/
|
|
56
56
|
/**
|
|
57
57
|
*/
|
|
58
|
-
const parseDataToJSON = (data) => {
|
|
58
|
+
const parseDataToJSON = (data: string) => {
|
|
59
59
|
try {
|
|
60
60
|
return JSON.parse(data);
|
|
61
61
|
} catch (error) {
|
|
@@ -154,11 +154,11 @@ const client = (props: Props) => {
|
|
|
154
154
|
/**
|
|
155
155
|
*/
|
|
156
156
|
const addContentLoadedEvent = (
|
|
157
|
-
store,
|
|
158
|
-
history,
|
|
159
|
-
theme
|
|
160
|
-
render,
|
|
161
|
-
ErrorFallbackComponent
|
|
157
|
+
store: ReduxStore,
|
|
158
|
+
history: RouterHistory,
|
|
159
|
+
theme?: Theme | Array<Theme>,
|
|
160
|
+
render: Function,
|
|
161
|
+
ErrorFallbackComponent?: ComponentType<FallbackProps>
|
|
162
162
|
) => {
|
|
163
163
|
window.addEventListener("DOMContentLoaded", () => {
|
|
164
164
|
const applicationNode = document.querySelector("#application");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["elementClosest","window","parseDataToJSON","data","JSON","parse","error","JsonParseException","client","props","contextPath","Error","dataElement","document","querySelector","textContent","Cache","clear","browserHistory","createBrowserHistory","basename","BASE","history","store","configureStore","customReducers","rehydrate","setAllContentInDataSetting","getState","setLoginPreferences","loadOtherBrowserTabs","getItem","dispatch","loginSuccess","has","FetchException","response","handleError","listen","location","action","locationChange","onunhandledrejection","event","detail","setImmediate","errorMessage","reason","message","toString","showXHRErrorNotification","body","className","beforeRenderHooks","handleBeforeRenderHooks","addContentLoadedEvent","theme","render","ErrorFallbackComponent","addEventListener","applicationNode","isSSR","mount","hydrate","reactRender"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\n/* polyfills needed for ie11 */\nimport elementClosest from \"element-closest\";\nelementClosest(window);\n\n/* polyfill for focus-visible */\nimport \"focus-visible\";\n\nimport { hydrate, render as reactRender } from \"react-dom\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport { BASE } from \"../constants/Constants\";\n\nimport {\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\n\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\n\nimport { locationChange } from \"../redux/_router/
|
|
1
|
+
{"version":3,"file":"client.js","names":["elementClosest","window","parseDataToJSON","data","JSON","parse","error","JsonParseException","client","props","contextPath","Error","dataElement","document","querySelector","textContent","Cache","clear","browserHistory","createBrowserHistory","basename","BASE","history","store","configureStore","customReducers","rehydrate","setAllContentInDataSetting","getState","setLoginPreferences","loadOtherBrowserTabs","getItem","dispatch","loginSuccess","has","FetchException","response","handleError","listen","location","action","locationChange","onunhandledrejection","event","detail","setImmediate","errorMessage","reason","message","toString","showXHRErrorNotification","body","className","beforeRenderHooks","handleBeforeRenderHooks","addContentLoadedEvent","theme","render","ErrorFallbackComponent","addEventListener","applicationNode","isSSR","mount","hydrate","reactRender"],"sources":["../../src/react-client/client.js"],"sourcesContent":["// @flow\n/* polyfills needed for ie11 */\nimport elementClosest from \"element-closest\";\nelementClosest(window);\n\n/* polyfill for focus-visible */\nimport \"focus-visible\";\n\nimport { hydrate, render as reactRender } from \"react-dom\";\n\nimport { has } from \"../utils/helpers/objects\";\nimport setImmediate from \"setimmediate\";\n\nimport Cache from \"../utils/browser/Cache\";\n\nimport { createBrowserHistory } from \"history\";\nimport configureStore from \"../redux/store/configureStore\";\n\nimport rehydrate from \"./rehydrate\";\nimport { BASE } from \"../constants/Constants\";\n\nimport {\n setAllContentInDataSetting,\n setLoginPreferences,\n} from \"../redux/actions/Preferences\";\nimport { showXHRErrorNotification } from \"../redux/actions/Notification\";\n\nimport { handleError } from \"../redux/actions/Error\";\nimport { loginSuccess } from \"../redux/actions/SignIn\";\n\nimport { locationChange } from \"../redux/_router/RouterActions\";\n\nimport { JsonParseException, FetchException } from \"../exceptions\";\n\nimport Init from \"./Init\";\n\nimport { handleBeforeRenderHooks } from \"../redux/store/beforeRenderHooks\";\n\nimport type { ComponentType } from \"react\";\nimport type { Theme } from \"../react-theme/types\";\nimport type { CustomReducers, ReduxStore } from \"../redux/types\";\nimport type { RouterHistory } from \"react-router\";\nimport type { BeforeRenderHook } from \"../redux/store/beforeRenderHooks\";\nimport type { Props as FallbackProps } from \"../react/ErrorBoundaryFallback\";\nexport type Props = {\n customReducers?: CustomReducers,\n theme?: Theme | Array<Theme>,\n render: Function,\n beforeRenderHooks?: Array<BeforeRenderHook>,\n ErrorFallbackComponent?: ComponentType<FallbackProps>,\n};\n\n/*\n * deserialize serialized data from the server to provide a smooth dehydration.\n */\n/**\n */\nconst parseDataToJSON = (data: string) => {\n try {\n return JSON.parse(data);\n } catch (error) {\n throw new JsonParseException(`Error parsing content ${data}`);\n }\n};\n\n/**\n * Mount the webapplication to the DOM, used client side when JavaScript is enabled.\n */\nconst client = (props: Props) => {\n if (typeof window.contextPath === \"undefined\") {\n throw new Error(\"Missing contextPath on window object\");\n }\n\n const dataElement = document.querySelector(\n 'script[type=\"application/json\"][data-app-state=\"app-json\"]'\n );\n if (!dataElement) {\n throw new Error(\"Error loading state, json not found\");\n } else if (dataElement.textContent.trim() === \"\") {\n return;\n }\n\n const data = parseDataToJSON(dataElement.textContent);\n\n // remove all resources from cache\n Cache.clear(\"^res:\");\n\n // $FlowExpectedError\n const browserHistory: RouterHistory = createBrowserHistory({\n basename: BASE,\n });\n const { history, store } = configureStore(\n browserHistory,\n props.customReducers ?? {},\n rehydrate(data)\n );\n\n setAllContentInDataSetting(store.getState());\n setLoginPreferences(store.getState());\n\n // load existing cache from other browser tabs\n Cache.loadOtherBrowserTabs(() => {\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n });\n\n if (has(data, \"error.name\")) {\n const error = new FetchException(data.error.response);\n store.dispatch(handleError(error));\n }\n\n if (Cache.getItem(\"auth\")) {\n store.dispatch(loginSuccess());\n }\n\n // listen to history change and update the redux router store\n history.listen((location, action) => {\n store.dispatch(locationChange(location, action));\n });\n\n /**\n */\n window.onunhandledrejection = (event) => {\n if (event.detail) {\n return setImmediate(() => {\n const errorMessage = event.detail.reason.message.toString();\n\n store.dispatch(showXHRErrorNotification(errorMessage));\n throw event.detail.reason;\n });\n }\n\n return event;\n };\n\n if (document.body) {\n document.body.className = \"js\";\n }\n\n if (props.beforeRenderHooks) {\n handleBeforeRenderHooks(props.beforeRenderHooks, { store });\n }\n\n addContentLoadedEvent(\n store,\n history,\n props.theme,\n props.render,\n props.ErrorFallbackComponent\n );\n};\n\n/**\n */\nconst addContentLoadedEvent = (\n store: ReduxStore,\n history: RouterHistory,\n theme?: Theme | Array<Theme>,\n render: Function,\n ErrorFallbackComponent?: ComponentType<FallbackProps>\n) => {\n window.addEventListener(\"DOMContentLoaded\", () => {\n const applicationNode = document.querySelector(\"#application\");\n if (applicationNode) {\n const isSSR = applicationNode.querySelector(\".application\");\n const mount = isSSR ? hydrate : reactRender;\n mount(\n <Init\n store={store}\n history={history}\n contextPath={window.contextPath}\n theme={theme}\n ErrorFallbackComponent={ErrorFallbackComponent}\n >\n {render()}\n </Init>,\n applicationNode\n );\n } else {\n throw new Error(\n \"No DOM element with id application found to attach client to\"\n );\n }\n });\n};\n\nexport default client;\n"],"mappings":";;;;;;;;AAEA;AAIA;AAEA;AAEA;AACA;AAEA;AAEA;AACA;AAEA;AACA;AAEA;AAIA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAA2E;AAnC3E;AAEA,IAAAA,uBAAc,EAACC,MAAM,CAAC;;AAEtB;;AA+CA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAIC,IAAY,IAAK;EACxC,IAAI;IACF,OAA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K,EACX/C,KAAK,CAACgD,MAAM,EACZhD,KAAK,CAACiD,sBAAsB,CAC7B;AACH,CAAC;;AAED;AACA;AACA,MAAMH,qBAAqB,GAAG,CAC5BhC,KAAiB,EACjBD,OAAsB,EACtBkC,KAA4B,EAC5BC,MAAgB,EAChBC,sBAAqD,KAClD;EACHzD,MAAM,CAAC0D,gBAAgB,CAAC,kBAAkB,EAAE,MAAM;IAChD,MAAMC,eAAe,GAAG/C,QAAQ,CAACC,aAAa,CAAC,cAAc,CAAC;IAC9D,IAAI8C,eAAe,EAAE;MACnB,MAAMC,KAAK,GAAGD,eAAe,CAAC9C,aAAa,CAAC,cAAc,CAAC;MAC3D,MAAMgD,KAAK,GAAGD,KAAK,GAAGE,iBAAO,GAAGC,gBAAW;MAC3CF,KAAK,eACH,qBAAC,aAAI;QACH,KAAK,EAAEvC,KAAM;QACb,OAAO,EAAED,OAAQ;QACjB,WAAW,EAAErB,MAAM,CAACS,WAAY;QAChC,KAAK,EAAE8C,KAAM;QACb,sBAAsB,EAAEE,sBAAuB;QAAA,UAE9CD,MAAM;MAAE,EACJ,EACPG,eAAe,CAChB;IACH,CAAC,MAAM;MACL,MAAM,IAAIjD,KAAK,CACb,8DAA8D,CAC/D;IACH;EACF,CAAC,CAAC;AACJ,CAAC;AAAC,eAEaH,MAAM;AAAA"}
|
|
@@ -40,7 +40,7 @@ const isModularUIModelData = (data: any) =>
|
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
*/
|
|
43
|
-
const rehydratedValue = (stateKey, stateValue) => {
|
|
43
|
+
const rehydratedValue = (stateKey: string, stateValue: any) => {
|
|
44
44
|
if (Array.isArray(stateValue)) {
|
|
45
45
|
return stateValue.map((stateItem) => rehydrate(stateItem)); // NOSONAR
|
|
46
46
|
}
|
|
@@ -76,7 +76,7 @@ const rehydratedValue = (stateKey, stateValue) => {
|
|
|
76
76
|
* Maps dehydrated state to models that can be used to rehydrated the application.
|
|
77
77
|
*/
|
|
78
78
|
const rehydrate = (state: Object): { ... } => {
|
|
79
|
-
const mappedState = {};
|
|
79
|
+
const mappedState: { [string]: any } = {};
|
|
80
80
|
|
|
81
81
|
Object.keys(state).forEach((stateKey) => {
|
|
82
82
|
const stateValue = state[stateKey];
|