@beinformed/ui 1.57.2 → 1.57.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/esm/constants/Settings.js +14 -6
- package/esm/constants/Settings.js.map +1 -1
- package/esm/hooks/useAuthentication.js +3 -3
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useModelCatalog.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +1 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/models/actions/ActionCollection.js +2 -3
- package/esm/models/actions/ActionCollection.js.map +1 -1
- package/esm/models/actions/ActionModel.js +13 -23
- package/esm/models/actions/ActionModel.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +1 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/attributes/AttributeCollection.js +6 -3
- package/esm/models/attributes/AttributeCollection.js.map +1 -1
- package/esm/models/attributes/AttributeModel.js +3 -3
- package/esm/models/attributes/AttributeModel.js.map +1 -1
- package/esm/models/attributes/AttributeSetModel.js +7 -4
- package/esm/models/attributes/AttributeSetModel.js.map +1 -1
- package/esm/models/attributes/BooleanAttributeModel.js +6 -3
- package/esm/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeModel.js +6 -3
- package/esm/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js +18 -14
- package/esm/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/esm/models/attributes/ChoiceAttributeOptionModel.js +17 -10
- package/esm/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeChildCollection.js +7 -7
- package/esm/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/esm/models/attributes/CompositeAttributeModel.js +3 -3
- package/esm/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/esm/models/attributes/DatetimeAttributeModel.js +2 -2
- package/esm/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/esm/models/attributes/StringAttributeModel.js +2 -2
- package/esm/models/attributes/StringAttributeModel.js.map +1 -1
- package/esm/models/attributes/_createAttribute.js +2 -2
- package/esm/models/attributes/_createAttribute.js.map +1 -1
- package/esm/models/base/BaseModel.js +27 -1
- package/esm/models/base/BaseModel.js.map +1 -1
- package/esm/models/base/ResourceModel.js +3 -23
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +1 -1
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +2 -2
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +2 -2
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptLinkModel.js +4 -10
- package/esm/models/concepts/ConceptLinkModel.js.map +1 -1
- package/esm/models/concepts/ConceptRelationCollection.js +11 -4
- package/esm/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/esm/models/concepts/ConceptRelationModel.js +8 -1
- package/esm/models/concepts/ConceptRelationModel.js.map +1 -1
- package/esm/models/concepts/SourceReferenceCollection.js +2 -4
- package/esm/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/esm/models/concepts/SourceReferenceModel.js +9 -10
- package/esm/models/concepts/SourceReferenceModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +2 -2
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentLinkModel.js +4 -11
- package/esm/models/content/ContentLinkModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +2 -2
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +7 -7
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/SectionModel.js +6 -12
- package/esm/models/content/SectionModel.js.map +1 -1
- package/esm/models/detail/DetailModel.js +9 -3
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/error/ErrorResponse.js +8 -10
- package/esm/models/error/ErrorResponse.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +2 -2
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +3 -3
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +2 -3
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterCollection.js +8 -7
- package/esm/models/filters/FilterCollection.js.map +1 -1
- package/esm/models/filters/StringFilterModel.js +2 -2
- package/esm/models/filters/StringFilterModel.js.map +1 -1
- package/esm/models/form/FormModel.js +4 -4
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/form/FormObjectModel.js +7 -4
- package/esm/models/form/FormObjectModel.js.map +1 -1
- package/esm/models/grouping/GroupingModel.js +10 -7
- package/esm/models/grouping/GroupingModel.js.map +1 -1
- package/esm/models/href/Href.js +22 -21
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/links/LinkCollection.js +2 -3
- package/esm/models/links/LinkCollection.js.map +1 -1
- package/esm/models/links/LinkModel.js +7 -7
- package/esm/models/links/LinkModel.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +1 -1
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListItemCollection.js +1 -1
- package/esm/models/list/ListItemCollection.js.map +1 -1
- package/esm/models/list/ListItemModel.js +3 -3
- package/esm/models/list/ListItemModel.js.map +1 -1
- package/esm/models/list/ListModel.js +3 -3
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionCollection.js +5 -2
- package/esm/models/lookup/LookupOptionCollection.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +2 -2
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +1 -1
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +2 -2
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +4 -5
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +4 -1
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/modularui/CaptchaRequest.js +3 -3
- package/esm/modularui/CaptchaRequest.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +8 -5
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/ModularUIResponse.js +12 -3
- package/esm/modularui/ModularUIResponse.js.map +1 -1
- package/esm/modularui/UploadRequest.js +3 -3
- package/esm/modularui/UploadRequest.js.map +1 -1
- package/esm/react-client/client.js +3 -3
- package/esm/react-client/client.js.map +1 -1
- package/esm/react-server/renderSSRComplete.js +2 -2
- package/esm/react-server/renderSSRComplete.js.map +1 -1
- package/esm/react-server/renderSSRMinimal.js +2 -2
- package/esm/react-server/renderSSRMinimal.js.map +1 -1
- package/esm/redux/_modularui/ModularUIActions.js +8 -2
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIUtils.js +11 -11
- package/esm/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/esm/utils/browser/Cookies.js +3 -3
- package/esm/utils/browser/Cookies.js.map +1 -1
- package/esm/utils/helpers/createHref.js +23 -3
- package/esm/utils/helpers/createHref.js.map +1 -1
- package/esm/utils/helpers/repositoryResource.js +2 -2
- package/esm/utils/helpers/repositoryResource.js.map +1 -1
- package/lib/constants/Settings.js +18 -8
- package/lib/constants/Settings.js.flow +16 -6
- package/lib/constants/Settings.js.map +1 -1
- package/lib/hooks/useAuthentication.js +2 -2
- package/lib/hooks/useAuthentication.js.flow +3 -3
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useModelCatalog.js.flow +7 -6
- package/lib/hooks/useModelCatalog.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +1 -1
- package/lib/hooks/useModularUIBasic.js.flow +1 -1
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js.flow +16 -11
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/models/actions/ActionCollection.js +2 -2
- package/lib/models/actions/ActionCollection.js.flow +3 -8
- package/lib/models/actions/ActionCollection.js.map +1 -1
- package/lib/models/actions/ActionModel.js +12 -22
- package/lib/models/actions/ActionModel.js.flow +7 -24
- package/lib/models/actions/ActionModel.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +1 -1
- package/lib/models/application/ApplicationModel.js.flow +1 -2
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/attributes/AttributeCollection.js +6 -3
- package/lib/models/attributes/AttributeCollection.js.flow +12 -4
- package/lib/models/attributes/AttributeCollection.js.map +1 -1
- package/lib/models/attributes/AttributeModel.js +3 -3
- package/lib/models/attributes/AttributeModel.js.flow +8 -2
- package/lib/models/attributes/AttributeModel.js.map +1 -1
- package/lib/models/attributes/AttributeSetModel.js +7 -3
- package/lib/models/attributes/AttributeSetModel.js.flow +11 -3
- package/lib/models/attributes/AttributeSetModel.js.map +1 -1
- package/lib/models/attributes/BooleanAttributeModel.js +6 -3
- package/lib/models/attributes/BooleanAttributeModel.js.flow +8 -4
- package/lib/models/attributes/BooleanAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeModel.js +6 -3
- package/lib/models/attributes/ChoiceAttributeModel.js.flow +13 -4
- package/lib/models/attributes/ChoiceAttributeModel.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js +18 -13
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.flow +30 -28
- package/lib/models/attributes/ChoiceAttributeOptionCollection.js.map +1 -1
- package/lib/models/attributes/ChoiceAttributeOptionModel.js +17 -10
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.flow +30 -11
- package/lib/models/attributes/ChoiceAttributeOptionModel.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js +7 -7
- package/lib/models/attributes/CompositeAttributeChildCollection.js.flow +8 -1
- package/lib/models/attributes/CompositeAttributeChildCollection.js.map +1 -1
- package/lib/models/attributes/CompositeAttributeModel.js +3 -3
- package/lib/models/attributes/CompositeAttributeModel.js.flow +8 -3
- package/lib/models/attributes/CompositeAttributeModel.js.map +1 -1
- package/lib/models/attributes/DatetimeAttributeModel.js +2 -2
- package/lib/models/attributes/DatetimeAttributeModel.js.flow +7 -2
- package/lib/models/attributes/DatetimeAttributeModel.js.map +1 -1
- package/lib/models/attributes/StringAttributeModel.js +2 -2
- package/lib/models/attributes/StringAttributeModel.js.flow +7 -3
- package/lib/models/attributes/StringAttributeModel.js.map +1 -1
- package/lib/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js.flow +1 -1
- package/lib/models/attributes/_createAttribute.js +2 -2
- package/lib/models/attributes/_createAttribute.js.flow +3 -2
- package/lib/models/attributes/_createAttribute.js.map +1 -1
- package/lib/models/base/BaseModel.js +27 -1
- package/lib/models/base/BaseModel.js.flow +31 -1
- package/lib/models/base/BaseModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js +3 -22
- package/lib/models/base/ResourceModel.js.flow +6 -23
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/base/__tests__/BaseModel.spec.js.flow +4 -0
- package/lib/models/caseview/CaseViewModel.js +1 -1
- package/lib/models/caseview/CaseViewModel.js.flow +1 -2
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +2 -2
- package/lib/models/concepts/ConceptDetailModel.js.flow +2 -2
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +2 -2
- package/lib/models/concepts/ConceptIndexModel.js.flow +9 -6
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptLinkModel.js +4 -10
- package/lib/models/concepts/ConceptLinkModel.js.flow +15 -12
- package/lib/models/concepts/ConceptLinkModel.js.map +1 -1
- package/lib/models/concepts/ConceptRelationCollection.js +11 -4
- package/lib/models/concepts/ConceptRelationCollection.js.flow +17 -3
- package/lib/models/concepts/ConceptRelationCollection.js.map +1 -1
- package/lib/models/concepts/ConceptRelationModel.js +8 -1
- package/lib/models/concepts/ConceptRelationModel.js.flow +18 -2
- package/lib/models/concepts/ConceptRelationModel.js.map +1 -1
- package/lib/models/concepts/SourceReferenceCollection.js +2 -3
- package/lib/models/concepts/SourceReferenceCollection.js.flow +3 -8
- package/lib/models/concepts/SourceReferenceCollection.js.map +1 -1
- package/lib/models/concepts/SourceReferenceModel.js +8 -8
- package/lib/models/concepts/SourceReferenceModel.js.flow +10 -11
- package/lib/models/concepts/SourceReferenceModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +2 -2
- package/lib/models/content/ContentIndexModel.js.flow +10 -5
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentLinkModel.js +4 -10
- package/lib/models/content/ContentLinkModel.js.flow +10 -13
- package/lib/models/content/ContentLinkModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +2 -2
- package/lib/models/content/ContentModel.js.flow +6 -1
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +7 -7
- package/lib/models/content/ContentTOCModel.js.flow +19 -11
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/SectionModel.js +6 -11
- package/lib/models/content/SectionModel.js.flow +9 -21
- package/lib/models/content/SectionModel.js.map +1 -1
- package/lib/models/detail/DetailModel.js +9 -3
- package/lib/models/detail/DetailModel.js.flow +3 -4
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/error/ErrorResponse.js +7 -9
- package/lib/models/error/ErrorResponse.js.flow +9 -20
- package/lib/models/error/ErrorResponse.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +2 -2
- package/lib/models/filters/AssignmentFilterModel.js.flow +7 -3
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +3 -3
- package/lib/models/filters/BaseFilterModel.js.flow +16 -7
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
- package/lib/models/filters/ConceptIndexFilterModel.js.flow +8 -2
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterCollection.js +8 -7
- package/lib/models/filters/FilterCollection.js.flow +13 -7
- package/lib/models/filters/FilterCollection.js.map +1 -1
- package/lib/models/filters/StringFilterModel.js +2 -2
- package/lib/models/filters/StringFilterModel.js.flow +7 -3
- package/lib/models/filters/StringFilterModel.js.map +1 -1
- package/lib/models/form/FormModel.js +4 -4
- package/lib/models/form/FormModel.js.flow +8 -2
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/form/FormObjectModel.js +7 -4
- package/lib/models/form/FormObjectModel.js.flow +17 -4
- package/lib/models/form/FormObjectModel.js.map +1 -1
- package/lib/models/grouping/GroupingModel.js +10 -7
- package/lib/models/grouping/GroupingModel.js.flow +21 -5
- package/lib/models/grouping/GroupingModel.js.map +1 -1
- package/lib/models/href/Href.js +21 -20
- package/lib/models/href/Href.js.flow +33 -25
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/__tests__/Href.spec.js.flow +16 -14
- package/lib/models/links/LinkCollection.js +2 -3
- package/lib/models/links/LinkCollection.js.flow +3 -3
- package/lib/models/links/LinkCollection.js.map +1 -1
- package/lib/models/links/LinkModel.js +7 -7
- package/lib/models/links/LinkModel.js.flow +8 -15
- package/lib/models/links/LinkModel.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +1 -1
- package/lib/models/list/ListDetailModel.js.flow +6 -1
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListItemCollection.js +1 -1
- package/lib/models/list/ListItemCollection.js.flow +1 -2
- package/lib/models/list/ListItemCollection.js.map +1 -1
- package/lib/models/list/ListItemModel.js +3 -3
- package/lib/models/list/ListItemModel.js.flow +4 -4
- package/lib/models/list/ListItemModel.js.map +1 -1
- package/lib/models/list/ListModel.js +3 -3
- package/lib/models/list/ListModel.js.flow +12 -8
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionCollection.js +5 -1
- package/lib/models/lookup/LookupOptionCollection.js.flow +17 -6
- package/lib/models/lookup/LookupOptionCollection.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +2 -2
- package/lib/models/lookup/LookupOptionsModel.js.flow +2 -0
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +1 -1
- package/lib/models/panels/GroupingPanelModel.js.flow +1 -2
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +2 -2
- package/lib/models/tab/TabModel.js.flow +2 -4
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +4 -4
- package/lib/models/taskgroup/TaskGroupModel.js.flow +5 -6
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.flow +5 -0
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +4 -1
- package/lib/models/user/UserProfileModel.js.flow +1 -0
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/modularui/CaptchaRequest.js +2 -2
- package/lib/modularui/CaptchaRequest.js.flow +7 -3
- package/lib/modularui/CaptchaRequest.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +7 -4
- package/lib/modularui/ModularUIRequest.js.flow +8 -5
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/ModularUIResponse.js +11 -2
- package/lib/modularui/ModularUIResponse.js.flow +13 -3
- package/lib/modularui/ModularUIResponse.js.map +1 -1
- package/lib/modularui/UploadRequest.js +2 -2
- package/lib/modularui/UploadRequest.js.flow +7 -3
- package/lib/modularui/UploadRequest.js.map +1 -1
- package/lib/react-client/client.js +2 -2
- package/lib/react-client/client.js.flow +7 -3
- package/lib/react-client/client.js.map +1 -1
- package/lib/react-server/renderSSRComplete.js +1 -1
- package/lib/react-server/renderSSRComplete.js.flow +2 -2
- package/lib/react-server/renderSSRComplete.js.map +1 -1
- package/lib/react-server/renderSSRMinimal.js +1 -1
- package/lib/react-server/renderSSRMinimal.js.flow +2 -2
- package/lib/react-server/renderSSRMinimal.js.map +1 -1
- package/lib/redux/_modularui/ModularUIActions.js +8 -2
- package/lib/redux/_modularui/ModularUIActions.js.flow +8 -7
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIUtils.js +11 -11
- package/lib/redux/_modularui/ModularUIUtils.js.flow +17 -14
- package/lib/redux/_modularui/ModularUIUtils.js.map +1 -1
- package/lib/utils/browser/Cookies.js +2 -2
- package/lib/utils/browser/Cookies.js.flow +3 -3
- package/lib/utils/browser/Cookies.js.map +1 -1
- package/lib/utils/helpers/__tests__/createHref.spec.js.flow +13 -8
- package/lib/utils/helpers/createHref.js +23 -3
- package/lib/utils/helpers/createHref.js.flow +37 -8
- package/lib/utils/helpers/createHref.js.map +1 -1
- package/lib/utils/helpers/repositoryResource.js +1 -1
- package/lib/utils/helpers/repositoryResource.js.flow +2 -2
- package/lib/utils/helpers/repositoryResource.js.map +1 -1
- package/package.json +4 -4
- package/src/constants/Settings.js +16 -6
- package/src/hooks/useAuthentication.js +3 -3
- package/src/hooks/useModelCatalog.js +7 -6
- package/src/hooks/useModularUIBasic.js +1 -1
- package/src/hooks/useModularUIModel.js +16 -11
- package/src/models/actions/ActionCollection.js +3 -8
- package/src/models/actions/ActionModel.js +7 -24
- package/src/models/application/ApplicationModel.js +1 -2
- package/src/models/attributes/AttributeCollection.js +12 -4
- package/src/models/attributes/AttributeModel.js +8 -2
- package/src/models/attributes/AttributeSetModel.js +11 -3
- package/src/models/attributes/BooleanAttributeModel.js +8 -4
- package/src/models/attributes/ChoiceAttributeModel.js +13 -4
- package/src/models/attributes/ChoiceAttributeOptionCollection.js +30 -28
- package/src/models/attributes/ChoiceAttributeOptionModel.js +30 -11
- package/src/models/attributes/CompositeAttributeChildCollection.js +8 -1
- package/src/models/attributes/CompositeAttributeModel.js +8 -3
- package/src/models/attributes/DatetimeAttributeModel.js +7 -2
- package/src/models/attributes/StringAttributeModel.js +7 -3
- package/src/models/attributes/__tests__/ChoiceAttributeOptionModel.spec.js +1 -1
- package/src/models/attributes/_createAttribute.js +3 -2
- package/src/models/base/BaseModel.js +31 -1
- package/src/models/base/ResourceModel.js +6 -23
- package/src/models/base/__tests__/BaseModel.spec.js +4 -0
- package/src/models/caseview/CaseViewModel.js +1 -2
- package/src/models/concepts/ConceptDetailModel.js +2 -2
- package/src/models/concepts/ConceptIndexModel.js +9 -6
- package/src/models/concepts/ConceptLinkModel.js +15 -12
- package/src/models/concepts/ConceptRelationCollection.js +17 -3
- package/src/models/concepts/ConceptRelationModel.js +18 -2
- package/src/models/concepts/SourceReferenceCollection.js +3 -8
- package/src/models/concepts/SourceReferenceModel.js +10 -11
- package/src/models/content/ContentIndexModel.js +10 -5
- package/src/models/content/ContentLinkModel.js +10 -13
- package/src/models/content/ContentModel.js +6 -1
- package/src/models/content/ContentTOCModel.js +19 -11
- package/src/models/content/SectionModel.js +9 -21
- package/src/models/detail/DetailModel.js +3 -4
- package/src/models/error/ErrorResponse.js +9 -20
- package/src/models/filters/AssignmentFilterModel.js +7 -3
- package/src/models/filters/BaseFilterModel.js +16 -7
- package/src/models/filters/ConceptIndexFilterModel.js +8 -2
- package/src/models/filters/FilterCollection.js +13 -7
- package/src/models/filters/StringFilterModel.js +7 -3
- package/src/models/form/FormModel.js +8 -2
- package/src/models/form/FormObjectModel.js +17 -4
- package/src/models/grouping/GroupingModel.js +21 -5
- package/src/models/href/Href.js +33 -25
- package/src/models/href/__tests__/Href.spec.js +16 -14
- package/src/models/links/LinkCollection.js +3 -3
- package/src/models/links/LinkModel.js +8 -15
- package/src/models/list/ListDetailModel.js +6 -1
- package/src/models/list/ListItemCollection.js +1 -2
- package/src/models/list/ListItemModel.js +4 -4
- package/src/models/list/ListModel.js +12 -8
- package/src/models/lookup/LookupOptionCollection.js +17 -6
- package/src/models/lookup/LookupOptionsModel.js +2 -0
- package/src/models/panels/GroupingPanelModel.js +1 -2
- package/src/models/tab/TabModel.js +2 -4
- package/src/models/taskgroup/TaskGroupModel.js +5 -6
- package/src/models/types.js +5 -0
- package/src/models/user/UserProfileModel.js +1 -0
- package/src/modularui/CaptchaRequest.js +7 -3
- package/src/modularui/ModularUIRequest.js +8 -5
- package/src/modularui/ModularUIResponse.js +13 -3
- package/src/modularui/UploadRequest.js +7 -3
- package/src/react-client/client.js +7 -3
- package/src/react-server/renderSSRComplete.js +2 -2
- package/src/react-server/renderSSRMinimal.js +2 -2
- package/src/redux/_modularui/ModularUIActions.js +8 -7
- package/src/redux/_modularui/ModularUIUtils.js +17 -14
- package/src/utils/browser/Cookies.js +3 -3
- package/src/utils/helpers/__tests__/createHref.spec.js +13 -8
- package/src/utils/helpers/createHref.js +37 -8
- package/src/utils/helpers/repositoryResource.js +2 -2
|
@@ -10,24 +10,31 @@ import type { ComponentType } from "react";
|
|
|
10
10
|
/**
|
|
11
11
|
* Generate modular ui url
|
|
12
12
|
*/
|
|
13
|
-
const getUrl = (resource: string | Function, props: Object) => {
|
|
13
|
+
const getUrl = (resource: string | Function | Href, props: Object): Href => {
|
|
14
14
|
const url = typeof resource === "function" ? resource(props) : resource;
|
|
15
15
|
|
|
16
16
|
if (url instanceof Href) {
|
|
17
|
-
return url
|
|
17
|
+
return url;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
return url
|
|
20
|
+
return new Href(url);
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
*/
|
|
25
|
-
export const useUrl = (
|
|
26
|
-
|
|
25
|
+
export const useUrl = (
|
|
26
|
+
resource: string | Function | Href,
|
|
27
|
+
props: Object,
|
|
28
|
+
): Href => {
|
|
29
|
+
const [previousUrl, setPreviousUrl] = useState(null);
|
|
27
30
|
const [previousExact, setPreviousExact] = useState(false);
|
|
28
31
|
|
|
29
32
|
const url = getUrl(resource, props);
|
|
30
33
|
|
|
34
|
+
if (url == null && previousUrl == null) {
|
|
35
|
+
return new Href("");
|
|
36
|
+
}
|
|
37
|
+
|
|
31
38
|
const { match } = props;
|
|
32
39
|
|
|
33
40
|
// when match is not available through props,
|
|
@@ -36,21 +43,17 @@ export const useUrl = (resource: string | Function, props: Object): string => {
|
|
|
36
43
|
return url;
|
|
37
44
|
}
|
|
38
45
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return previousUrl;
|
|
46
|
+
if (url.equalsWithParameters(previousUrl)) {
|
|
47
|
+
return previousUrl || url;
|
|
42
48
|
}
|
|
43
49
|
|
|
44
|
-
const hasDifferentStartUriPart =
|
|
45
|
-
previousUrl !== "" && !previousUrl.startsWith(match.url);
|
|
46
|
-
|
|
47
50
|
// Always create an url when the match is exact
|
|
48
51
|
// Or when the match is not exact AND the original match also was not exact
|
|
49
|
-
// Or when the new start uri is different from the previous url
|
|
52
|
+
// Or when the new start uri is different from the previous url --> different resource for same panel
|
|
50
53
|
if (
|
|
51
54
|
match.isExact === true ||
|
|
52
55
|
previousExact === match.isExact ||
|
|
53
|
-
|
|
56
|
+
!previousUrl?.startsWith(match.url)
|
|
54
57
|
) {
|
|
55
58
|
setPreviousUrl(url);
|
|
56
59
|
setPreviousExact(match.isExact);
|
|
@@ -58,7 +61,7 @@ export const useUrl = (resource: string | Function, props: Object): string => {
|
|
|
58
61
|
return url;
|
|
59
62
|
}
|
|
60
63
|
|
|
61
|
-
return previousUrl;
|
|
64
|
+
return previousUrl || new Href("");
|
|
62
65
|
};
|
|
63
66
|
|
|
64
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModularUIUtils.js","names":["_react","require","_utils","_Constants","_Href","_interopRequireDefault","getUrl","resource","props","url","Href","
|
|
1
|
+
{"version":3,"file":"ModularUIUtils.js","names":["_react","require","_utils","_Constants","_Href","_interopRequireDefault","getUrl","resource","props","url","Href","useUrl","previousUrl","setPreviousUrl","useState","previousExact","setPreviousExact","match","equalsWithParameters","isExact","startsWith","exports","getKey","WrappedComponent","name","getDisplayName","split","useReload","modelEntry","reload","arguments","length","undefined","isFullyLoaded","status","MODULARUI_STATUS","FINISHED","lastModification"],"sources":["../../../src/redux/_modularui/ModularUIUtils.js"],"sourcesContent":["// @flow\nimport { useState } from \"react\";\n\nimport { getDisplayName } from \"../../react/utils\";\nimport { MODULARUI_STATUS } from \"../../constants/Constants\";\nimport Href from \"../../models/href/Href\";\n\nimport type { ComponentType } from \"react\";\n\n/**\n * Generate modular ui url\n */\nconst getUrl = (resource: string | Function | Href, props: Object): Href => {\n const url = typeof resource === \"function\" ? resource(props) : resource;\n\n if (url instanceof Href) {\n return url;\n }\n\n return new Href(url);\n};\n\n/**\n */\nexport const useUrl = (\n resource: string | Function | Href,\n props: Object,\n): Href => {\n const [previousUrl, setPreviousUrl] = useState(null);\n const [previousExact, setPreviousExact] = useState(false);\n\n const url = getUrl(resource, props);\n\n if (url == null && previousUrl == null) {\n return new Href(\"\");\n }\n\n const { match } = props;\n\n // when match is not available through props,\n // this is a direct call to the modular ui hoc, not using a route\n if (!match) {\n return url;\n }\n\n if (url.equalsWithParameters(previousUrl)) {\n return previousUrl || url;\n }\n\n // Always create an url when the match is exact\n // Or when the match is not exact AND the original match also was not exact\n // Or when the new start uri is different from the previous url --> different resource for same panel\n if (\n match.isExact === true ||\n previousExact === match.isExact ||\n !previousUrl?.startsWith(match.url)\n ) {\n setPreviousUrl(url);\n setPreviousExact(match.isExact);\n\n return url;\n }\n\n return previousUrl || new Href(\"\");\n};\n\n/**\n * Create key for modularui request based on component name and requested url\n */\nexport const getKey = (\n WrappedComponent: ComponentType<any>,\n name: string,\n url: string,\n): string => {\n if (url) {\n return `${getDisplayName(WrappedComponent, name)}(${url.split(\"?\")[0]})`;\n }\n\n return getDisplayName(WrappedComponent, name);\n};\n\n/**\n * Check if the model corresponding to a modular ui service should be reloaded\n */\nexport const useReload = (modelEntry: Object, reload: number = 0): boolean => {\n if (reload > 0) {\n const isFullyLoaded = modelEntry?.status === MODULARUI_STATUS.FINISHED;\n const lastModification = modelEntry?.lastModification ?? 0;\n\n if (isFullyLoaded && lastModification < reload) {\n return true;\n }\n }\n\n return false;\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAIA;AACA;AACA;AACA,MAAMK,MAAM,GAAGA,CAACC,QAAkC,EAAEC,KAAa,KAAW;EAC1E,MAAMC,GAAG,GAAG,OAAOF,QAAQ,KAAK,UAAU,GAAGA,QAAQ,CAACC,KAAK,CAAC,GAAGD,QAAQ;EAEvE,IAAIE,GAAG,YAAYC,aAAI,EAAE;IACvB,OAAOD,GAAG;EACZ;EAEA,OAAO,IAAIC,aAAI,CAACD,GAAG,CAAC;AACtB,CAAC;;AAED;AACA;AACO,MAAME,MAAM,GAAGA,CACpBJ,QAAkC,EAClCC,KAAa,KACJ;EACT,MAAM,CAACI,WAAW,EAAEC,cAAc,CAAC,GAAG,IAAAC,eAAQ,EAAC,IAAI,CAAC;EACpD,MAAM,CAACC,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAAF,eAAQ,EAAC,KAAK,CAAC;EAEzD,MAAML,GAAG,GAAGH,MAAM,CAACC,QAAQ,EAAEC,KAAK,CAAC;EAEnC,IAAIC,GAAG,IAAI,IAAI,IAAIG,WAAW,IAAI,IAAI,EAAE;IACtC,OAAO,IAAIF,aAAI,CAAC,EAAE,CAAC;EACrB;EAEA,MAAM;IAAEO;EAAM,CAAC,GAAGT,KAAK;;EAEvB;EACA;EACA,IAAI,CAACS,KAAK,EAAE;IACV,OAAOR,GAAG;EACZ;EAEA,IAAIA,GAAG,CAACS,oBAAoB,CAACN,WAAW,CAAC,EAAE;IACzC,OAAOA,WAAW,IAAIH,GAAG;EAC3B;;EAEA;EACA;EACA;EACA,IACEQ,KAAK,CAACE,OAAO,KAAK,IAAI,IACtBJ,aAAa,KAAKE,KAAK,CAACE,OAAO,IAC/B,CAACP,WAAW,EAAEQ,UAAU,CAACH,KAAK,CAACR,GAAG,CAAC,EACnC;IACAI,cAAc,CAACJ,GAAG,CAAC;IACnBO,gBAAgB,CAACC,KAAK,CAACE,OAAO,CAAC;IAE/B,OAAOV,GAAG;EACZ;EAEA,OAAOG,WAAW,IAAI,IAAIF,aAAI,CAAC,EAAE,CAAC;AACpC,CAAC;;AAED;AACA;AACA;AAFAW,OAAA,CAAAV,MAAA,GAAAA,MAAA;AAGO,MAAMW,MAAM,GAAGA,CACpBC,gBAAoC,EACpCC,IAAY,EACZf,GAAW,KACA;EACX,IAAIA,GAAG,EAAE;IACP,OAAO,GAAG,IAAAgB,qBAAc,EAACF,gBAAgB,EAAEC,IAAI,CAAC,IAAIf,GAAG,CAACiB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;EAC1E;EAEA,OAAO,IAAAD,qBAAc,EAACF,gBAAgB,EAAEC,IAAI,CAAC;AAC/C,CAAC;;AAED;AACA;AACA;AAFAH,OAAA,CAAAC,MAAA,GAAAA,MAAA;AAGO,MAAMK,SAAS,GAAG,SAAAA,CAACC,UAAkB,EAAkC;EAAA,IAAhCC,MAAc,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC;EAC9D,IAAID,MAAM,GAAG,CAAC,EAAE;IACd,MAAMI,aAAa,GAAGL,UAAU,EAAEM,MAAM,KAAKC,2BAAgB,CAACC,QAAQ;IACtE,MAAMC,gBAAgB,GAAGT,UAAU,EAAES,gBAAgB,IAAI,CAAC;IAE1D,IAAIJ,aAAa,IAAII,gBAAgB,GAAGR,MAAM,EAAE;MAC9C,OAAO,IAAI;IACb;EACF;EAEA,OAAO,KAAK;AACd,CAAC;AAACR,OAAA,CAAAM,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@ const getCookie = name => {
|
|
|
18
18
|
exports.getCookie = getCookie;
|
|
19
19
|
const setCookie = (name, value, options) => {
|
|
20
20
|
const attributes = {
|
|
21
|
-
path: (0, _Settings.
|
|
21
|
+
path: (0, _Settings.getBasePathServer)()
|
|
22
22
|
};
|
|
23
23
|
attributes.expires = options?.days;
|
|
24
24
|
attributes.sameSite = options?.sameSite ?? "Strict";
|
|
@@ -31,7 +31,7 @@ const setCookie = (name, value, options) => {
|
|
|
31
31
|
exports.setCookie = setCookie;
|
|
32
32
|
const clearCookie = name => {
|
|
33
33
|
_jsCookie.default.remove(name, {
|
|
34
|
-
path: (0, _Settings.
|
|
34
|
+
path: (0, _Settings.getBasePathServer)()
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
exports.clearCookie = clearCookie;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import Cookies from "js-cookie";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { getBasePathServer } from "../../constants/Settings";
|
|
5
5
|
|
|
6
6
|
type CookieOptions = {
|
|
7
7
|
days?: number,
|
|
@@ -29,7 +29,7 @@ export const setCookie = (
|
|
|
29
29
|
value: any,
|
|
30
30
|
options?: CookieOptions,
|
|
31
31
|
) => {
|
|
32
|
-
const attributes: CookieAttributes = { path:
|
|
32
|
+
const attributes: CookieAttributes = { path: getBasePathServer() };
|
|
33
33
|
attributes.expires = options?.days;
|
|
34
34
|
attributes.sameSite = options?.sameSite ?? "Strict";
|
|
35
35
|
attributes.secure = options?.secure;
|
|
@@ -40,5 +40,5 @@ export const setCookie = (
|
|
|
40
40
|
/**
|
|
41
41
|
*/
|
|
42
42
|
export const clearCookie = (name: string) => {
|
|
43
|
-
Cookies.remove(name, { path:
|
|
43
|
+
Cookies.remove(name, { path: getBasePathServer() });
|
|
44
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cookies.js","names":["_jsCookie","_interopRequireDefault","require","_Settings","getCookie","name","Cookies","get","exports","setCookie","value","options","attributes","path","
|
|
1
|
+
{"version":3,"file":"Cookies.js","names":["_jsCookie","_interopRequireDefault","require","_Settings","getCookie","name","Cookies","get","exports","setCookie","value","options","attributes","path","getBasePathServer","expires","days","sameSite","secure","set","clearCookie","remove"],"sources":["../../../src/utils/browser/Cookies.js"],"sourcesContent":["// @flow\nimport Cookies from \"js-cookie\";\n\nimport { getBasePathServer } from \"../../constants/Settings\";\n\ntype CookieOptions = {\n days?: number,\n sameSite?: \"None\" | \"Lax\" | \"Strict\",\n secure?: boolean,\n};\n\ntype CookieAttributes = {\n path: string,\n expires?: number,\n sameSite?: string,\n secure?: boolean,\n};\n\n/**\n */\nexport const getCookie = (name: string): null | string => {\n return Cookies.get(name);\n};\n\n/**\n */\nexport const setCookie = (\n name: string,\n value: any,\n options?: CookieOptions,\n) => {\n const attributes: CookieAttributes = { path: getBasePathServer() };\n attributes.expires = options?.days;\n attributes.sameSite = options?.sameSite ?? \"Strict\";\n attributes.secure = options?.secure;\n\n Cookies.set(name, value, attributes);\n};\n\n/**\n */\nexport const clearCookie = (name: string) => {\n Cookies.remove(name, { path: getBasePathServer() });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAeA;AACA;AACO,MAAME,SAAS,GAAIC,IAAY,IAAoB;EACxD,OAAOC,iBAAO,CAACC,GAAG,CAACF,IAAI,CAAC;AAC1B,CAAC;;AAED;AACA;AADAG,OAAA,CAAAJ,SAAA,GAAAA,SAAA;AAEO,MAAMK,SAAS,GAAGA,CACvBJ,IAAY,EACZK,KAAU,EACVC,OAAuB,KACpB;EACH,MAAMC,UAA4B,GAAG;IAAEC,IAAI,EAAE,IAAAC,2BAAiB,EAAC;EAAE,CAAC;EAClEF,UAAU,CAACG,OAAO,GAAGJ,OAAO,EAAEK,IAAI;EAClCJ,UAAU,CAACK,QAAQ,GAAGN,OAAO,EAAEM,QAAQ,IAAI,QAAQ;EACnDL,UAAU,CAACM,MAAM,GAAGP,OAAO,EAAEO,MAAM;EAEnCZ,iBAAO,CAACa,GAAG,CAACd,IAAI,EAAEK,KAAK,EAAEE,UAAU,CAAC;AACtC,CAAC;;AAED;AACA;AADAJ,OAAA,CAAAC,SAAA,GAAAA,SAAA;AAEO,MAAMW,WAAW,GAAIf,IAAY,IAAK;EAC3CC,iBAAO,CAACe,MAAM,CAAChB,IAAI,EAAE;IAAEQ,IAAI,EAAE,IAAAC,2BAAiB,EAAC;EAAE,CAAC,CAAC;AACrD,CAAC;AAACN,OAAA,CAAAY,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHref } from "../createHref";
|
|
2
|
+
import Href from "../../../models/href/Href";
|
|
2
3
|
|
|
3
4
|
describe("createHref", () => {
|
|
4
5
|
it("can filter out qs parameters", () => {
|
|
@@ -7,24 +8,28 @@ describe("createHref", () => {
|
|
|
7
8
|
search: "?entryDate=2024-03-08&index=C¬Allowed=true",
|
|
8
9
|
};
|
|
9
10
|
|
|
10
|
-
expect(createHref("concepts", dynamicPart)).
|
|
11
|
-
"/concepts/" + dynamicPart,
|
|
11
|
+
expect(createHref("concepts", dynamicPart)).toEqual(
|
|
12
|
+
new Href("/concepts/" + dynamicPart),
|
|
12
13
|
);
|
|
13
|
-
expect(createHref("concepts", dynamicPart, location)).
|
|
14
|
-
"/concepts/" + dynamicPart + location.search,
|
|
14
|
+
expect(createHref("concepts", dynamicPart, location)).toEqual(
|
|
15
|
+
new Href("/concepts/" + dynamicPart + location.search),
|
|
15
16
|
);
|
|
16
17
|
expect(
|
|
17
18
|
createHref("concepts", dynamicPart, location, ["entryDate", "index"]),
|
|
18
|
-
).
|
|
19
|
+
).toEqual(
|
|
20
|
+
new Href("/concepts/" + dynamicPart + "?entryDate=2024-03-08&index=C"),
|
|
21
|
+
);
|
|
19
22
|
expect(
|
|
20
23
|
createHref("concepts", dynamicPart + location.search, location, [
|
|
21
24
|
"entryDate",
|
|
22
25
|
"index",
|
|
23
26
|
]),
|
|
24
|
-
).
|
|
27
|
+
).toEqual(
|
|
28
|
+
new Href("/concepts/" + dynamicPart + "?entryDate=2024-03-08&index=C"),
|
|
29
|
+
);
|
|
25
30
|
|
|
26
|
-
expect(createHref("concepts", dynamicPart + "#hash")).
|
|
27
|
-
"/concepts/" + dynamicPart + "#hash",
|
|
31
|
+
expect(createHref("concepts", dynamicPart + "#hash")).toEqual(
|
|
32
|
+
new Href("/concepts/" + dynamicPart + "#hash"),
|
|
28
33
|
);
|
|
29
34
|
});
|
|
30
35
|
});
|
|
@@ -10,9 +10,17 @@ var _urlSearchParams = _interopRequireDefault(require("@babel/runtime-corejs3/co
|
|
|
10
10
|
var _from = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/array/from"));
|
|
11
11
|
var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/keys"));
|
|
12
12
|
var _startsWith = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/starts-with"));
|
|
13
|
+
var _Href = _interopRequireDefault(require("../../models/href/Href"));
|
|
13
14
|
/**
|
|
14
15
|
*/
|
|
15
16
|
const parseUrl = href => {
|
|
17
|
+
if (href instanceof _Href.default) {
|
|
18
|
+
return {
|
|
19
|
+
path: href.path,
|
|
20
|
+
querystring: href.querystring,
|
|
21
|
+
hash: href.hash
|
|
22
|
+
};
|
|
23
|
+
}
|
|
16
24
|
let path = href;
|
|
17
25
|
let hash = null;
|
|
18
26
|
let querystring = null;
|
|
@@ -38,7 +46,7 @@ const parseUrl = href => {
|
|
|
38
46
|
exports.parseUrl = parseUrl;
|
|
39
47
|
const filterParameters = (href, allowedParameters) => {
|
|
40
48
|
if (!Array.isArray(allowedParameters)) {
|
|
41
|
-
return href;
|
|
49
|
+
return new _Href.default(href);
|
|
42
50
|
}
|
|
43
51
|
const url = parseUrl(href);
|
|
44
52
|
let filteredUrl = url.path;
|
|
@@ -55,14 +63,20 @@ const filterParameters = (href, allowedParameters) => {
|
|
|
55
63
|
if (url.hash) {
|
|
56
64
|
filteredUrl = filteredUrl + "#" + url.hash;
|
|
57
65
|
}
|
|
58
|
-
|
|
66
|
+
if (href instanceof _Href.default) {
|
|
67
|
+
return new _Href.default(filteredUrl, href.resourcetype, {
|
|
68
|
+
origin: href.origin,
|
|
69
|
+
contextPath: href.contextPath
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return new _Href.default(filteredUrl);
|
|
59
73
|
};
|
|
60
74
|
|
|
61
75
|
/**
|
|
62
76
|
*/
|
|
63
77
|
exports.filterParameters = filterParameters;
|
|
64
78
|
const createHref = (context, dynamicPart, location, allowedParameters) => {
|
|
65
|
-
let href = dynamicPart;
|
|
79
|
+
let href = dynamicPart.toString();
|
|
66
80
|
if (!(0, _startsWith.default)(href).call(href, `/${context}/`)) {
|
|
67
81
|
href = `/${context}/${href}`;
|
|
68
82
|
}
|
|
@@ -72,6 +86,12 @@ const createHref = (context, dynamicPart, location, allowedParameters) => {
|
|
|
72
86
|
const search = (0, _startsWith.default)(_context = location.search).call(_context, "?") ? location.search.substring(1) : location.search;
|
|
73
87
|
href = `${href}?${search}`;
|
|
74
88
|
}
|
|
89
|
+
if (dynamicPart instanceof _Href.default) {
|
|
90
|
+
return filterParameters(new _Href.default(href, dynamicPart.resourcetype, {
|
|
91
|
+
origin: dynamicPart.origin,
|
|
92
|
+
contextPath: dynamicPart.contextPath
|
|
93
|
+
}), allowedParameters);
|
|
94
|
+
}
|
|
75
95
|
return filterParameters(href, allowedParameters);
|
|
76
96
|
};
|
|
77
97
|
exports.createHref = createHref;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
// @flow
|
|
2
|
+
import Href from "../../models/href/Href";
|
|
3
|
+
|
|
2
4
|
import type { Location } from "react-router";
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
*/
|
|
6
8
|
export const parseUrl = (
|
|
7
|
-
href: string,
|
|
9
|
+
href: string | Href,
|
|
8
10
|
): { path: string, querystring: null | string, hash: null | string } => {
|
|
11
|
+
if (href instanceof Href) {
|
|
12
|
+
return {
|
|
13
|
+
path: href.path,
|
|
14
|
+
querystring: href.querystring,
|
|
15
|
+
hash: href.hash,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
let path = href;
|
|
10
20
|
let hash = null;
|
|
11
21
|
let querystring = null;
|
|
@@ -29,11 +39,11 @@ export const parseUrl = (
|
|
|
29
39
|
/**
|
|
30
40
|
*/
|
|
31
41
|
export const filterParameters = (
|
|
32
|
-
href: string,
|
|
42
|
+
href: string | Href,
|
|
33
43
|
allowedParameters?: Array<string>,
|
|
34
|
-
):
|
|
44
|
+
): Href => {
|
|
35
45
|
if (!Array.isArray(allowedParameters)) {
|
|
36
|
-
return href;
|
|
46
|
+
return new Href(href);
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
const url = parseUrl(href);
|
|
@@ -51,18 +61,27 @@ export const filterParameters = (
|
|
|
51
61
|
if (url.hash) {
|
|
52
62
|
filteredUrl = filteredUrl + "#" + url.hash;
|
|
53
63
|
}
|
|
54
|
-
|
|
64
|
+
|
|
65
|
+
if (href instanceof Href) {
|
|
66
|
+
return new Href(filteredUrl, href.resourcetype, {
|
|
67
|
+
origin: href.origin,
|
|
68
|
+
contextPath: href.contextPath,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return new Href(filteredUrl);
|
|
55
73
|
};
|
|
56
74
|
|
|
57
75
|
/**
|
|
58
76
|
*/
|
|
59
77
|
export const createHref = (
|
|
60
78
|
context: string,
|
|
61
|
-
dynamicPart: string,
|
|
79
|
+
dynamicPart: string | Href,
|
|
62
80
|
location?: ?Location,
|
|
63
81
|
allowedParameters?: Array<string>,
|
|
64
|
-
):
|
|
65
|
-
let href = dynamicPart;
|
|
82
|
+
): Href => {
|
|
83
|
+
let href = dynamicPart.toString();
|
|
84
|
+
|
|
66
85
|
if (!href.startsWith(`/${context}/`)) {
|
|
67
86
|
href = `/${context}/${href}`;
|
|
68
87
|
}
|
|
@@ -76,5 +95,15 @@ export const createHref = (
|
|
|
76
95
|
href = `${href}?${search}`;
|
|
77
96
|
}
|
|
78
97
|
|
|
98
|
+
if (dynamicPart instanceof Href) {
|
|
99
|
+
return filterParameters(
|
|
100
|
+
new Href(href, dynamicPart.resourcetype, {
|
|
101
|
+
origin: dynamicPart.origin,
|
|
102
|
+
contextPath: dynamicPart.contextPath,
|
|
103
|
+
}),
|
|
104
|
+
allowedParameters,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
79
108
|
return filterParameters(href, allowedParameters);
|
|
80
109
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createHref.js","names":["parseUrl","href","
|
|
1
|
+
{"version":3,"file":"createHref.js","names":["_Href","_interopRequireDefault","require","parseUrl","href","Href","path","querystring","hash","_includes","default","call","hashSplit","split","qsSplit","exports","filterParameters","allowedParameters","Array","isArray","url","filteredUrl","searchParams","_urlSearchParams","params","_from","_keys","param","delete","toString","resourcetype","origin","contextPath","createHref","context","dynamicPart","location","_startsWith","replace","search","_context","substring"],"sources":["../../../src/utils/helpers/createHref.js"],"sourcesContent":["// @flow\nimport Href from \"../../models/href/Href\";\n\nimport type { Location } from \"react-router\";\n\n/**\n */\nexport const parseUrl = (\n href: string | Href,\n): { path: string, querystring: null | string, hash: null | string } => {\n if (href instanceof Href) {\n return {\n path: href.path,\n querystring: href.querystring,\n hash: href.hash,\n };\n }\n\n let path = href;\n let hash = null;\n let querystring = null;\n if (href.includes(\"#\")) {\n const hashSplit = href.split(\"#\");\n path = hashSplit[0];\n hash = hashSplit[1];\n }\n if (href.includes(\"?\")) {\n const qsSplit = path.split(\"?\");\n path = qsSplit[0];\n querystring = qsSplit[1];\n }\n return {\n path,\n querystring,\n hash,\n };\n};\n\n/**\n */\nexport const filterParameters = (\n href: string | Href,\n allowedParameters?: Array<string>,\n): Href => {\n if (!Array.isArray(allowedParameters)) {\n return new Href(href);\n }\n\n const url = parseUrl(href);\n let filteredUrl = url.path;\n if (url.querystring) {\n const searchParams = new URLSearchParams(url.querystring);\n const params = Array.from(searchParams.keys());\n for (const param of params) {\n if (!allowedParameters.includes(param)) {\n searchParams.delete(param);\n }\n }\n filteredUrl = filteredUrl + \"?\" + searchParams.toString();\n }\n if (url.hash) {\n filteredUrl = filteredUrl + \"#\" + url.hash;\n }\n\n if (href instanceof Href) {\n return new Href(filteredUrl, href.resourcetype, {\n origin: href.origin,\n contextPath: href.contextPath,\n });\n }\n\n return new Href(filteredUrl);\n};\n\n/**\n */\nexport const createHref = (\n context: string,\n dynamicPart: string | Href,\n location?: ?Location,\n allowedParameters?: Array<string>,\n): Href => {\n let href = dynamicPart.toString();\n\n if (!href.startsWith(`/${context}/`)) {\n href = `/${context}/${href}`;\n }\n\n href = href.replace(/\\/\\//g, \"/\");\n\n if (location?.search && !href.includes(\"?\")) {\n const search = location.search.startsWith(\"?\")\n ? location.search.substring(1)\n : location.search;\n href = `${href}?${search}`;\n }\n\n if (dynamicPart instanceof Href) {\n return filterParameters(\n new Href(href, dynamicPart.resourcetype, {\n origin: dynamicPart.origin,\n contextPath: dynamicPart.contextPath,\n }),\n allowedParameters,\n );\n }\n\n return filterParameters(href, allowedParameters);\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ var _constants = require("../../constants");
|
|
|
12
12
|
* Only possible when serving using the UI Servlet of Be Informed
|
|
13
13
|
*/
|
|
14
14
|
const getRepositoryResourceUrl = function (resourceUrl) {
|
|
15
|
-
let contextPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _constants.
|
|
15
|
+
let contextPath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _constants.getBasePathServer)();
|
|
16
16
|
let origin = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
17
17
|
if ((0, _startsWith.default)(resourceUrl).call(resourceUrl, origin + contextPath)) {
|
|
18
18
|
return resourceUrl;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
2
|
+
import { getBasePathServer, RESOURCE_PATH } from "../../constants";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates an url to a resource in the Be Informed repository
|
|
@@ -7,7 +7,7 @@ import { getBasePath, RESOURCE_PATH } from "../../constants";
|
|
|
7
7
|
*/
|
|
8
8
|
export const getRepositoryResourceUrl = (
|
|
9
9
|
resourceUrl: string,
|
|
10
|
-
contextPath: string =
|
|
10
|
+
contextPath: string = getBasePathServer(),
|
|
11
11
|
origin: string = "",
|
|
12
12
|
): string => {
|
|
13
13
|
if (resourceUrl.startsWith(origin + contextPath)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repositoryResource.js","names":["_constants","require","getRepositoryResourceUrl","resourceUrl","contextPath","arguments","length","undefined","
|
|
1
|
+
{"version":3,"file":"repositoryResource.js","names":["_constants","require","getRepositoryResourceUrl","resourceUrl","contextPath","arguments","length","undefined","getBasePathServer","origin","_startsWith","default","call","RESOURCE_PATH","exports"],"sources":["../../../src/utils/helpers/repositoryResource.js"],"sourcesContent":["// @flow\nimport { getBasePathServer, RESOURCE_PATH } from \"../../constants\";\n\n/**\n * Creates an url to a resource in the Be Informed repository\n * Only possible when serving using the UI Servlet of Be Informed\n */\nexport const getRepositoryResourceUrl = (\n resourceUrl: string,\n contextPath: string = getBasePathServer(),\n origin: string = \"\",\n): string => {\n if (resourceUrl.startsWith(origin + contextPath)) {\n return resourceUrl;\n }\n\n if (resourceUrl.startsWith(RESOURCE_PATH)) {\n return `${origin}${contextPath}${resourceUrl}`;\n }\n\n return `${origin}${contextPath}${RESOURCE_PATH}${resourceUrl}`;\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG,SAAAA,CACtCC,WAAmB,EAGR;EAAA,IAFXC,WAAmB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAAG,4BAAiB,EAAC,CAAC;EAAA,IACzCC,MAAc,GAAAJ,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAEnB,IAAI,IAAAK,WAAA,CAAAC,OAAA,EAAAR,WAAW,EAAAS,IAAA,CAAXT,WAAW,EAAYM,MAAM,GAAGL,WAAW,CAAC,EAAE;IAChD,OAAOD,WAAW;EACpB;EAEA,IAAI,IAAAO,WAAA,CAAAC,OAAA,EAAAR,WAAW,EAAAS,IAAA,CAAXT,WAAW,EAAYU,wBAAa,CAAC,EAAE;IACzC,OAAO,GAAGJ,MAAM,GAAGL,WAAW,GAAGD,WAAW,EAAE;EAChD;EAEA,OAAO,GAAGM,MAAM,GAAGL,WAAW,GAAGS,wBAAa,GAAGV,WAAW,EAAE;AAChE,CAAC;AAACW,OAAA,CAAAZ,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beinformed/ui",
|
|
3
|
-
"version": "1.57.
|
|
3
|
+
"version": "1.57.4",
|
|
4
4
|
"description": "Toolbox for be informed javascript layouts",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"bugs": "http://support.beinformed.com",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"styled-components": "^5.0.0"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@babel/runtime-corejs3": "^7.
|
|
85
|
+
"@babel/runtime-corejs3": "^7.26.0",
|
|
86
86
|
"big.js": "^6.2.2",
|
|
87
87
|
"date-fns": "^4.1.0",
|
|
88
88
|
"deepmerge": "^4.3.1",
|
|
@@ -99,13 +99,13 @@
|
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@babel/cli": "^7.25.9",
|
|
102
|
-
"@babel/core": "^7.
|
|
102
|
+
"@babel/core": "^7.26.0",
|
|
103
103
|
"@babel/eslint-parser": "^7.25.9",
|
|
104
104
|
"@babel/eslint-plugin": "^7.25.9",
|
|
105
105
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
106
106
|
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
|
|
107
107
|
"@babel/plugin-transform-runtime": "^7.25.9",
|
|
108
|
-
"@babel/preset-env": "^7.
|
|
108
|
+
"@babel/preset-env": "^7.26.0",
|
|
109
109
|
"@babel/preset-flow": "^7.25.9",
|
|
110
110
|
"@babel/preset-react": "^7.25.9",
|
|
111
111
|
"@commitlint/cli": "^19.5.0",
|
|
@@ -161,19 +161,29 @@ export const cacheContributions = (): boolean =>
|
|
|
161
161
|
getSetting("CACHE_CONTRIBUTIONS", true);
|
|
162
162
|
|
|
163
163
|
/**
|
|
164
|
-
*
|
|
165
|
-
* This
|
|
166
|
-
* When requesting a remote server with CORS enabled, add the origin, for example:
|
|
167
|
-
* export const BEINFORMED_PATH = 'http://192.168.128.61:8080/BeInformed';
|
|
164
|
+
* The context path is retrieved on the server using the context path property as set in the runtime properties
|
|
165
|
+
* This can be manually override by setting the UI setting 'CONTEXT_PATH'
|
|
168
166
|
*/
|
|
169
167
|
export const getBasePath = (): string =>
|
|
170
168
|
getSetting("CONTEXT_PATH", "/BeInformed");
|
|
171
169
|
|
|
170
|
+
/**
|
|
171
|
+
* The context path to modular ui rest services
|
|
172
|
+
*/
|
|
173
|
+
export const getBasePathModularUI = (): string =>
|
|
174
|
+
getSetting("CONTEXT_PATH_SERVER", getBasePath());
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Used to link the css and js files in the server templates
|
|
178
|
+
*/
|
|
179
|
+
export const getBasePathServer = (): string =>
|
|
180
|
+
getSetting("CONTEXT_PATH_SERVER", getBasePath());
|
|
181
|
+
|
|
172
182
|
/**
|
|
173
183
|
* Path to upload service
|
|
174
184
|
*/
|
|
175
185
|
export const getUploadPath = (
|
|
176
|
-
contextPath: string =
|
|
186
|
+
contextPath: string = getBasePathModularUI(),
|
|
177
187
|
origin: string = "",
|
|
178
188
|
): string => `${origin}${contextPath}${UPLOAD_PATH}`;
|
|
179
189
|
|
|
@@ -181,7 +191,7 @@ export const getUploadPath = (
|
|
|
181
191
|
* Path to captcha service
|
|
182
192
|
*/
|
|
183
193
|
export const getCaptchaPath = (
|
|
184
|
-
contextPath: string =
|
|
194
|
+
contextPath: string = getBasePathModularUI(),
|
|
185
195
|
origin: string = "",
|
|
186
196
|
): string => `${origin}${contextPath}${CAPTCHA_PATH}`;
|
|
187
197
|
|
|
@@ -7,7 +7,7 @@ import { login, logout, resetAuthErrors } from "../redux/actions";
|
|
|
7
7
|
import Cache from "../utils/browser/Cache";
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_AUTHENTICATION_TYPE,
|
|
10
|
-
|
|
10
|
+
getBasePathServer,
|
|
11
11
|
logoutPath,
|
|
12
12
|
} from "../constants";
|
|
13
13
|
|
|
@@ -62,7 +62,7 @@ export const useLogin = (): LoginHook => {
|
|
|
62
62
|
if (!isAuthenticated) {
|
|
63
63
|
Cache.setItem("isRedirectLogin", true);
|
|
64
64
|
window.location.assign(
|
|
65
|
-
`${
|
|
65
|
+
`${getBasePathServer()}${authenticationType.redirectUri ?? ""}`,
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
},
|
|
@@ -76,7 +76,7 @@ export const useLogout = (): LogoutHook => {
|
|
|
76
76
|
const application = useSelector(getApplication);
|
|
77
77
|
|
|
78
78
|
const LOGOUT_PATH = logoutPath();
|
|
79
|
-
const BASE_PATH =
|
|
79
|
+
const BASE_PATH = getBasePathServer();
|
|
80
80
|
|
|
81
81
|
const isAuthenticated = application?.isLoggedIn ?? false;
|
|
82
82
|
return {
|
|
@@ -14,6 +14,7 @@ import ContentModel from "../models/content/ContentModel";
|
|
|
14
14
|
import { useModularUIBasic } from "./useModularUIBasic";
|
|
15
15
|
import { ContentTypeModel } from "../models";
|
|
16
16
|
|
|
17
|
+
import type Href from "../models/href/Href";
|
|
17
18
|
import type { UseModularUIBasicOptions } from "./useModularUIBasic";
|
|
18
19
|
export type SearchFilter = {
|
|
19
20
|
index?: string,
|
|
@@ -37,7 +38,7 @@ export const useModelCatalog = (
|
|
|
37
38
|
/**
|
|
38
39
|
*/
|
|
39
40
|
export const useConceptIndex = (
|
|
40
|
-
href: string,
|
|
41
|
+
href: string | Href,
|
|
41
42
|
key?: string = "conceptindex",
|
|
42
43
|
options?: UseModularUIBasicOptions<ConceptIndexModel>,
|
|
43
44
|
): ?ConceptIndexModel => {
|
|
@@ -58,7 +59,7 @@ export const useConceptIndex = (
|
|
|
58
59
|
/**
|
|
59
60
|
*/
|
|
60
61
|
export const useConceptDetail = (
|
|
61
|
-
concept: string,
|
|
62
|
+
concept: string | Href,
|
|
62
63
|
key?: string = "conceptdetail",
|
|
63
64
|
options?: UseModularUIBasicOptions<
|
|
64
65
|
ConceptDetailModel | BusinessScenarioModel,
|
|
@@ -76,7 +77,7 @@ export const useConceptDetail = (
|
|
|
76
77
|
/**
|
|
77
78
|
*/
|
|
78
79
|
export const useContentIndex = (
|
|
79
|
-
href: string,
|
|
80
|
+
href: string | Href,
|
|
80
81
|
key?: string = "contentindex",
|
|
81
82
|
options?: UseModularUIBasicOptions<ContentIndexModel>,
|
|
82
83
|
): ?ContentIndexModel => {
|
|
@@ -91,7 +92,7 @@ export const useContentIndex = (
|
|
|
91
92
|
/**
|
|
92
93
|
*/
|
|
93
94
|
export const useContentTOC = (
|
|
94
|
-
content: string,
|
|
95
|
+
content: string | Href,
|
|
95
96
|
key?: string = "contenttoc",
|
|
96
97
|
options?: UseModularUIBasicOptions<ContentTOCModel>,
|
|
97
98
|
): ?ContentTOCModel => {
|
|
@@ -107,7 +108,7 @@ export const useContentTOC = (
|
|
|
107
108
|
/**
|
|
108
109
|
*/
|
|
109
110
|
export const useContent = (
|
|
110
|
-
contentSection: string,
|
|
111
|
+
contentSection: string | Href,
|
|
111
112
|
key?: string = "content",
|
|
112
113
|
options?: UseModularUIBasicOptions<ContentModel>,
|
|
113
114
|
): ?ContentModel => {
|
|
@@ -122,7 +123,7 @@ export const useContent = (
|
|
|
122
123
|
/**
|
|
123
124
|
*/
|
|
124
125
|
export const useContentType = (
|
|
125
|
-
contentType: string,
|
|
126
|
+
contentType: string | Href,
|
|
126
127
|
key?: string = "contenttypes",
|
|
127
128
|
options?: UseModularUIBasicOptions<ContentTypeModel>,
|
|
128
129
|
): ?ContentTypeModel => {
|
|
@@ -85,7 +85,7 @@ export const useModularUIBasic = <T: ModularUIModel>(
|
|
|
85
85
|
[options, memoizedHref, location],
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
const modularUI = useModularUI(key,
|
|
88
|
+
const modularUI = useModularUI(key, href, useModularUIOptions);
|
|
89
89
|
const expectedModels = useMemo(
|
|
90
90
|
() => options.expectedModels ?? [],
|
|
91
91
|
[options.expectedModels],
|