@beinformed/ui 1.57.2 → 1.57.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -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 +9 -8
- 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 +8 -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 +8 -7
- package/lib/models/href/Href.js.flow +17 -10
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/href/__tests__/Href.spec.js.flow +5 -8
- 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 +8 -11
- package/lib/redux/_modularui/ModularUIUtils.js.flow +13 -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 +17 -10
- package/src/models/href/__tests__/Href.spec.js +5 -8
- 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 +13 -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
|
@@ -180,6 +180,7 @@ export default class ListModel extends ResourceModel {
|
|
|
180
180
|
return new GroupingModel(
|
|
181
181
|
{ ...this.data.grouping, dynamicschema: this.data.dynamicschema },
|
|
182
182
|
this.contributions.contexts,
|
|
183
|
+
this.modelOptions,
|
|
183
184
|
);
|
|
184
185
|
}
|
|
185
186
|
|
|
@@ -285,12 +286,16 @@ export default class ListModel extends ResourceModel {
|
|
|
285
286
|
/**
|
|
286
287
|
*/
|
|
287
288
|
setFilters(): FilterCollection {
|
|
288
|
-
return new FilterCollection(
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
289
|
+
return new FilterCollection(
|
|
290
|
+
this.data.filter,
|
|
291
|
+
{
|
|
292
|
+
listkey: this.key,
|
|
293
|
+
filter: this.contributions.filter,
|
|
294
|
+
contexts: this.contributions.contexts,
|
|
295
|
+
dynamicschema: this.data.dynamicschema,
|
|
296
|
+
},
|
|
297
|
+
this.modelOptions,
|
|
298
|
+
);
|
|
294
299
|
}
|
|
295
300
|
|
|
296
301
|
/**
|
|
@@ -316,8 +321,7 @@ export default class ListModel extends ResourceModel {
|
|
|
316
321
|
return new ActionCollection(
|
|
317
322
|
this.data.actions,
|
|
318
323
|
this.contributions.actions,
|
|
319
|
-
this.
|
|
320
|
-
this.contextPath,
|
|
324
|
+
this.modelOptions,
|
|
321
325
|
);
|
|
322
326
|
}
|
|
323
327
|
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import ResourceCollection from "../base/ResourceCollection";
|
|
3
3
|
import ChoiceAttributeOptionModel from "../attributes/ChoiceAttributeOptionModel";
|
|
4
|
+
import { DateUtil } from "../../utils";
|
|
5
|
+
|
|
6
|
+
import type { ModelOptions } from "../types";
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
*/
|
|
7
10
|
class LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {
|
|
8
11
|
/**
|
|
9
12
|
*/
|
|
10
|
-
static create(
|
|
13
|
+
static create(
|
|
14
|
+
data: Object,
|
|
15
|
+
contributions: Object,
|
|
16
|
+
modelOptions?: ModelOptions,
|
|
17
|
+
): LookupOptionCollection {
|
|
11
18
|
const collection = new LookupOptionCollection();
|
|
12
19
|
|
|
13
20
|
if (data.options && contributions.options) {
|
|
14
21
|
data.options.forEach((option) => {
|
|
15
22
|
collection.add(
|
|
16
|
-
new ChoiceAttributeOptionModel(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
new ChoiceAttributeOptionModel(
|
|
24
|
+
[],
|
|
25
|
+
{
|
|
26
|
+
...option,
|
|
27
|
+
optionType: this.getOptionType(option, contributions),
|
|
28
|
+
elementsContributions: contributions.options[0].elements,
|
|
29
|
+
},
|
|
30
|
+
{ ...modelOptions, referenceDate: DateUtil.now() },
|
|
31
|
+
),
|
|
21
32
|
);
|
|
22
33
|
});
|
|
23
34
|
}
|
|
@@ -19,6 +19,7 @@ export default class LookupOptionsModel extends ResourceModel {
|
|
|
19
19
|
this._options = LookupOptionCollection.create(
|
|
20
20
|
this.data,
|
|
21
21
|
this.contributions,
|
|
22
|
+
this.modelOptions,
|
|
22
23
|
);
|
|
23
24
|
|
|
24
25
|
this._filterCollection = this.createFilterCollection(
|
|
@@ -64,6 +65,7 @@ export default class LookupOptionsModel extends ResourceModel {
|
|
|
64
65
|
return new FilterCollection(
|
|
65
66
|
{ [data.name]: data },
|
|
66
67
|
{ filter: contributions },
|
|
68
|
+
this.modelOptions,
|
|
67
69
|
);
|
|
68
70
|
}
|
|
69
71
|
|
|
@@ -26,8 +26,7 @@ export default class TabModel extends ResourceModel {
|
|
|
26
26
|
this._actionCollection = new ActionCollection(
|
|
27
27
|
this.data.actions,
|
|
28
28
|
this.contributions.actions,
|
|
29
|
-
this.
|
|
30
|
-
this.contextPath,
|
|
29
|
+
this.modelOptions,
|
|
31
30
|
);
|
|
32
31
|
}
|
|
33
32
|
|
|
@@ -95,8 +94,7 @@ export default class TabModel extends ResourceModel {
|
|
|
95
94
|
taskgroup.name,
|
|
96
95
|
taskgroup,
|
|
97
96
|
taskgroupContributions,
|
|
98
|
-
this.
|
|
99
|
-
this.contextPath,
|
|
97
|
+
this.modelOptions,
|
|
100
98
|
);
|
|
101
99
|
}
|
|
102
100
|
|
|
@@ -3,6 +3,7 @@ import ActionCollection from "../actions/ActionCollection";
|
|
|
3
3
|
import ResourceModel from "../base/ResourceModel";
|
|
4
4
|
|
|
5
5
|
import ModularUIResponse from "../../modularui/ModularUIResponse";
|
|
6
|
+
import type { ModelOptions } from "../types";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* TaskGroupModel
|
|
@@ -19,8 +20,7 @@ export default class TaskGroupModel extends ResourceModel {
|
|
|
19
20
|
this._actionCollection = new ActionCollection(
|
|
20
21
|
this.data.actions,
|
|
21
22
|
this.contributions.actions,
|
|
22
|
-
this.
|
|
23
|
-
this.contextPath,
|
|
23
|
+
this.modelOptions,
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
const selfHref = this.links.getLinkByKey("self")
|
|
@@ -38,15 +38,14 @@ export default class TaskGroupModel extends ResourceModel {
|
|
|
38
38
|
key: string,
|
|
39
39
|
data: Object,
|
|
40
40
|
contributions: Object,
|
|
41
|
-
|
|
42
|
-
contextPath?: string,
|
|
41
|
+
modelOptions?: ModelOptions,
|
|
43
42
|
): TaskGroupModel {
|
|
44
43
|
const taskgroup = new ModularUIResponse();
|
|
45
44
|
taskgroup.key = key;
|
|
46
45
|
taskgroup.data = data;
|
|
47
46
|
taskgroup.contributions = contributions;
|
|
48
|
-
taskgroup.origin = origin;
|
|
49
|
-
taskgroup.contextPath = contextPath;
|
|
47
|
+
taskgroup.origin = modelOptions?.origin;
|
|
48
|
+
taskgroup.contextPath = modelOptions?.contextPath;
|
|
50
49
|
|
|
51
50
|
return new TaskGroupModel(taskgroup);
|
|
52
51
|
}
|
package/src/models/types.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import xhr from "../utils/fetch/xhr";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
getBasePathModularUI,
|
|
5
|
+
getCaptchaPath,
|
|
6
|
+
HTTP_METHODS,
|
|
7
|
+
} from "../constants";
|
|
4
8
|
|
|
5
9
|
type CaptchaInitialResponse = {
|
|
6
10
|
tokenId: string,
|
|
@@ -36,13 +40,13 @@ class CaptchaRequest {
|
|
|
36
40
|
_tokenId: string;
|
|
37
41
|
_image: string;
|
|
38
42
|
_origin: string = "";
|
|
39
|
-
_contextPath: string =
|
|
43
|
+
_contextPath: string = getBasePathModularUI();
|
|
40
44
|
|
|
41
45
|
/**
|
|
42
46
|
*/
|
|
43
47
|
CaptchaRequest(options?: CaptchaRequestOptions) {
|
|
44
48
|
this._origin = options?.origin || "";
|
|
45
|
-
this._contextPath = options?.contextPath ||
|
|
49
|
+
this._contextPath = options?.contextPath || getBasePathModularUI();
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
/**
|
|
@@ -5,7 +5,7 @@ import { HTTP_METHODS, TIMEVERSION_FILTER_NAME } from "../constants/Constants";
|
|
|
5
5
|
|
|
6
6
|
import { HIDE_WHEN_EMPTY } from "../constants/LayoutHints";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { getBasePathModularUI, getSetting } from "../constants/Settings";
|
|
9
9
|
|
|
10
10
|
import Href from "../models/href/Href";
|
|
11
11
|
|
|
@@ -47,7 +47,7 @@ class ModularUIRequest {
|
|
|
47
47
|
_progressEvent: ProgressEventHandler;
|
|
48
48
|
|
|
49
49
|
_origin: string = "";
|
|
50
|
-
_contextPath: string =
|
|
50
|
+
_contextPath: string = getBasePathModularUI();
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
*/
|
|
@@ -117,8 +117,8 @@ class ModularUIRequest {
|
|
|
117
117
|
/**
|
|
118
118
|
*/
|
|
119
119
|
set contextPath(contextPath: ?string) {
|
|
120
|
-
this._contextPath = contextPath ??
|
|
121
|
-
this._response.contextPath = contextPath ??
|
|
120
|
+
this._contextPath = contextPath ?? getBasePathModularUI();
|
|
121
|
+
this._response.contextPath = contextPath ?? getBasePathModularUI();
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/**
|
|
@@ -725,7 +725,10 @@ class ModularUIRequest {
|
|
|
725
725
|
);
|
|
726
726
|
}
|
|
727
727
|
errorChildModels.push(
|
|
728
|
-
new ErrorResponse(reason, "",
|
|
728
|
+
new ErrorResponse(reason, "", {
|
|
729
|
+
origin: this.origin,
|
|
730
|
+
contextPath: this.contextPath,
|
|
731
|
+
}),
|
|
729
732
|
);
|
|
730
733
|
} else {
|
|
731
734
|
resolvedChildModels.push(childModel.value);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import { has } from "../utils/helpers/objects";
|
|
3
|
-
import {
|
|
3
|
+
import { getBasePathModularUI } from "../constants";
|
|
4
4
|
|
|
5
5
|
import type Parameter from "../models/parameter/Parameter";
|
|
6
|
+
import type { ModelOptions } from "../models";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
*/
|
|
@@ -12,7 +13,7 @@ class ModularUIResponse {
|
|
|
12
13
|
_contributions: Object;
|
|
13
14
|
_locale: string = "en";
|
|
14
15
|
_parameters: Array<Parameter> = [];
|
|
15
|
-
_contextPath: string =
|
|
16
|
+
_contextPath: string = getBasePathModularUI();
|
|
16
17
|
_origin: string = "";
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -40,6 +41,15 @@ class ModularUIResponse {
|
|
|
40
41
|
return response;
|
|
41
42
|
}
|
|
42
43
|
|
|
44
|
+
/**
|
|
45
|
+
*/
|
|
46
|
+
get modelOptions(): ModelOptions {
|
|
47
|
+
return {
|
|
48
|
+
origin: this.origin,
|
|
49
|
+
contextPath: this.contextPath,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
43
53
|
/**
|
|
44
54
|
*/
|
|
45
55
|
set origin(origin: ?string) {
|
|
@@ -55,7 +65,7 @@ class ModularUIResponse {
|
|
|
55
65
|
/**
|
|
56
66
|
*/
|
|
57
67
|
set contextPath(contextPath: ?string) {
|
|
58
|
-
this._contextPath = contextPath ??
|
|
68
|
+
this._contextPath = contextPath ?? getBasePathModularUI();
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
/**
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getBasePathModularUI,
|
|
4
|
+
getUploadPath,
|
|
5
|
+
HTTP_METHODS,
|
|
6
|
+
} from "../constants";
|
|
3
7
|
|
|
4
8
|
import xhr from "../utils/fetch/xhr";
|
|
5
9
|
|
|
@@ -31,7 +35,7 @@ class UploadRequest {
|
|
|
31
35
|
};
|
|
32
36
|
_progressHandler: ProgressHandler;
|
|
33
37
|
_origin: string = "";
|
|
34
|
-
_contextPath: string =
|
|
38
|
+
_contextPath: string = getBasePathModularUI();
|
|
35
39
|
|
|
36
40
|
constructor(
|
|
37
41
|
uploadConstraints: {
|
|
@@ -45,7 +49,7 @@ class UploadRequest {
|
|
|
45
49
|
this._uploadConstraints = uploadConstraints;
|
|
46
50
|
this._progressHandler = progressHandler;
|
|
47
51
|
this._origin = options?.origin || "";
|
|
48
|
-
this._contextPath = options?.contextPath ||
|
|
52
|
+
this._contextPath = options?.contextPath || getBasePathModularUI();
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
/**
|
|
@@ -13,7 +13,11 @@ import { createBrowserHistory } from "history";
|
|
|
13
13
|
import configureStore from "../redux/store/configureStore";
|
|
14
14
|
|
|
15
15
|
import rehydrate from "./rehydrate";
|
|
16
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
getBasePathModularUI,
|
|
18
|
+
getBasePathServer,
|
|
19
|
+
getSetting,
|
|
20
|
+
} from "../constants/Settings";
|
|
17
21
|
|
|
18
22
|
import {
|
|
19
23
|
setAllContentInDataSetting,
|
|
@@ -107,7 +111,7 @@ const handleRedirectURI = (store: ReduxStore) => {
|
|
|
107
111
|
const urlParams = new URLSearchParams(window.location.search);
|
|
108
112
|
const redirectURI = urlParams.get("redirectURI");
|
|
109
113
|
if (redirectURI) {
|
|
110
|
-
xhr({ url: `${
|
|
114
|
+
xhr({ url: `${getBasePathModularUI()}${redirectURI}` }).catch((e) => {
|
|
111
115
|
if (
|
|
112
116
|
e.id === "UnauthorizedException" ||
|
|
113
117
|
e.id === "Error.NotAuthorized" ||
|
|
@@ -143,7 +147,7 @@ export const setupClient = (
|
|
|
143
147
|
|
|
144
148
|
// $FlowExpectedError
|
|
145
149
|
const browserHistory: RouterHistory = createBrowserHistory({
|
|
146
|
-
basename:
|
|
150
|
+
basename: getBasePathServer(),
|
|
147
151
|
});
|
|
148
152
|
const { routerHistory, store } = configureStore(
|
|
149
153
|
browserHistory,
|
|
@@ -10,7 +10,7 @@ import { ServerStyleSheet, StyleSheetManager } from "styled-components";
|
|
|
10
10
|
import createSSRComplete from "./createSSRComplete";
|
|
11
11
|
import htmlpage from "./htmlpage";
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { getBasePathServer } from "../constants/Settings";
|
|
14
14
|
|
|
15
15
|
import ThemeProvider from "../react-theme/ThemeProvider";
|
|
16
16
|
import ErrorBoundary from "../react/ErrorBoundary";
|
|
@@ -52,7 +52,7 @@ const renderSSRComplete = ({
|
|
|
52
52
|
// $FlowFixMe[prop-missing]
|
|
53
53
|
const location: Location = requestHref.toLocation();
|
|
54
54
|
|
|
55
|
-
const basePath =
|
|
55
|
+
const basePath = getBasePathServer();
|
|
56
56
|
|
|
57
57
|
return createSSRComplete(store, () =>
|
|
58
58
|
renderToString(
|
|
@@ -6,7 +6,7 @@ import { Provider } from "react-redux";
|
|
|
6
6
|
import { ServerStyleSheet, StyleSheetManager } from "styled-components";
|
|
7
7
|
import ThemeProvider from "../react-theme/ThemeProvider";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { getBasePathServer } from "../constants/Settings";
|
|
10
10
|
|
|
11
11
|
import { createHead, dehydrate } from "./serverUtil";
|
|
12
12
|
import htmlpage from "./htmlpage";
|
|
@@ -43,7 +43,7 @@ const renderSSRMinimal = ({
|
|
|
43
43
|
|
|
44
44
|
const head = createHead(sheet, UUID);
|
|
45
45
|
return template({
|
|
46
|
-
contextPath:
|
|
46
|
+
contextPath: getBasePathServer(),
|
|
47
47
|
html: appHTML,
|
|
48
48
|
head,
|
|
49
49
|
state: dehydrate(store),
|
|
@@ -115,7 +115,10 @@ export const loadModel = (
|
|
|
115
115
|
href:
|
|
116
116
|
href instanceof Href
|
|
117
117
|
? href
|
|
118
|
-
: new Href(href, "",
|
|
118
|
+
: new Href(href, "", {
|
|
119
|
+
origin: options?.origin,
|
|
120
|
+
contextPath: options?.contextPath,
|
|
121
|
+
}),
|
|
119
122
|
method: options?.method ?? HTTP_METHODS.GET,
|
|
120
123
|
data: options?.data,
|
|
121
124
|
locale: options?.locale ?? "en",
|
|
@@ -130,12 +133,10 @@ export const loadModel = (
|
|
|
130
133
|
/**
|
|
131
134
|
*/
|
|
132
135
|
errorAction: (error) => {
|
|
133
|
-
const errorResponse = new ErrorResponse(
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
options?.contextPath,
|
|
138
|
-
);
|
|
136
|
+
const errorResponse = new ErrorResponse(error, key, {
|
|
137
|
+
origin: options?.origin,
|
|
138
|
+
contextPath: options?.contextPath,
|
|
139
|
+
});
|
|
139
140
|
if (errorResponse.isChangePassword) {
|
|
140
141
|
return {
|
|
141
142
|
type: "NO_ACTION",
|
|
@@ -10,20 +10,23 @@ 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);
|
|
@@ -36,21 +39,17 @@ export const useUrl = (resource: string | Function, props: Object): string => {
|
|
|
36
39
|
return url;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return previousUrl;
|
|
42
|
+
if (url.equals(previousUrl)) {
|
|
43
|
+
return url;
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
const hasDifferentStartUriPart =
|
|
45
|
-
previousUrl !== "" && !previousUrl.startsWith(match.url);
|
|
46
|
-
|
|
47
46
|
// Always create an url when the match is exact
|
|
48
47
|
// 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
|
|
48
|
+
// Or when the new start uri is different from the previous url --> different resource for same panel
|
|
50
49
|
if (
|
|
51
50
|
match.isExact === true ||
|
|
52
51
|
previousExact === match.isExact ||
|
|
53
|
-
|
|
52
|
+
!previousUrl?.startsWith(match.url)
|
|
54
53
|
) {
|
|
55
54
|
setPreviousUrl(url);
|
|
56
55
|
setPreviousExact(match.isExact);
|
|
@@ -58,7 +57,7 @@ export const useUrl = (resource: string | Function, props: Object): string => {
|
|
|
58
57
|
return url;
|
|
59
58
|
}
|
|
60
59
|
|
|
61
|
-
return previousUrl;
|
|
60
|
+
return previousUrl || new Href("");
|
|
62
61
|
};
|
|
63
62
|
|
|
64
63
|
/**
|
|
@@ -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,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
|
});
|
|
@@ -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,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)) {
|