@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
package/src/models/href/Href.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
// @flow
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getBasePathModularUI,
|
|
4
|
+
HTTP_METHODS,
|
|
5
|
+
CONTENT_PATH,
|
|
6
|
+
} from "../../constants";
|
|
3
7
|
|
|
4
8
|
import Parameter from "../parameter/Parameter";
|
|
5
|
-
import { IllegalArgumentException } from "../../exceptions";
|
|
6
9
|
|
|
7
10
|
import type { LocationShape } from "react-router";
|
|
11
|
+
import type { ModelOptions } from "../types";
|
|
8
12
|
|
|
9
13
|
type HrefObject = {
|
|
10
14
|
_path: string,
|
|
@@ -30,7 +34,7 @@ class Href {
|
|
|
30
34
|
_state: any = null;
|
|
31
35
|
_referenceHash: ?number;
|
|
32
36
|
_origin: string = "";
|
|
33
|
-
_contextPath: string =
|
|
37
|
+
_contextPath: string = getBasePathModularUI();
|
|
34
38
|
|
|
35
39
|
/**
|
|
36
40
|
* Create a Href
|
|
@@ -38,8 +42,7 @@ class Href {
|
|
|
38
42
|
constructor(
|
|
39
43
|
href?: HrefInput,
|
|
40
44
|
resourcetype?: string,
|
|
41
|
-
|
|
42
|
-
contextPath?: string,
|
|
45
|
+
modelOptions?: ?ModelOptions,
|
|
43
46
|
) {
|
|
44
47
|
this.resourcetype = resourcetype ?? "";
|
|
45
48
|
|
|
@@ -51,12 +54,12 @@ class Href {
|
|
|
51
54
|
this.setFromLocationOrObject(href);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
|
-
if (typeof origin === "string") {
|
|
55
|
-
this.origin = origin;
|
|
57
|
+
if (typeof modelOptions?.origin === "string") {
|
|
58
|
+
this.origin = modelOptions.origin;
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
if (typeof contextPath === "string") {
|
|
59
|
-
this.contextPath = contextPath;
|
|
61
|
+
if (typeof modelOptions?.contextPath === "string") {
|
|
62
|
+
this.contextPath = modelOptions.contextPath;
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
|
|
@@ -478,7 +481,7 @@ class Href {
|
|
|
478
481
|
/**
|
|
479
482
|
* Checks if the given Href equals this Href
|
|
480
483
|
*/
|
|
481
|
-
equals(href: Href | string): boolean {
|
|
484
|
+
equals(href: Href | string | null): boolean {
|
|
482
485
|
if (href instanceof Href) {
|
|
483
486
|
return this.path === href.path;
|
|
484
487
|
}
|
|
@@ -488,35 +491,39 @@ class Href {
|
|
|
488
491
|
|
|
489
492
|
/**
|
|
490
493
|
*/
|
|
491
|
-
equalsWithParameters(
|
|
492
|
-
if (
|
|
494
|
+
equalsWithParameters(other: Href | string | null): boolean {
|
|
495
|
+
if (other == null) {
|
|
493
496
|
return false;
|
|
494
497
|
}
|
|
495
498
|
|
|
496
|
-
|
|
497
|
-
if (this.parameters.length !== href.parameters.length) {
|
|
498
|
-
return false;
|
|
499
|
-
}
|
|
499
|
+
const href = other instanceof Href ? other : new Href(other);
|
|
500
500
|
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
501
|
+
if (!this.equals(href)) {
|
|
502
|
+
return false;
|
|
503
|
+
}
|
|
504
504
|
|
|
505
|
-
|
|
505
|
+
if (this.parameters.length !== href.parameters.length) {
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
506
508
|
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
);
|
|
509
|
+
if (this.parameters.length === 0 && href.parameters.length === 0) {
|
|
510
|
+
return true;
|
|
510
511
|
}
|
|
511
512
|
|
|
512
|
-
|
|
513
|
+
const thisParams = this.parameters.map((param) => param.toString());
|
|
514
|
+
|
|
515
|
+
return href.parameters.every((param) =>
|
|
516
|
+
thisParams.includes(param.toString()),
|
|
517
|
+
);
|
|
513
518
|
}
|
|
514
519
|
|
|
515
520
|
/**
|
|
516
521
|
* Indicates if the link is a content link
|
|
517
522
|
*/
|
|
518
523
|
get isContent(): boolean {
|
|
519
|
-
return this.absolutepath.startsWith(
|
|
524
|
+
return this.absolutepath.startsWith(
|
|
525
|
+
`${getBasePathModularUI()}${CONTENT_PATH}`,
|
|
526
|
+
);
|
|
520
527
|
}
|
|
521
528
|
|
|
522
529
|
/**
|
|
@@ -546,6 +553,7 @@ class Href {
|
|
|
546
553
|
search: this.querystring.length > 0 ? `?${this.querystring}` : "",
|
|
547
554
|
hash: this.hash.length > 0 ? `#${this.hash}` : "",
|
|
548
555
|
state: {
|
|
556
|
+
origin: this.origin,
|
|
549
557
|
contextPath: this.contextPath,
|
|
550
558
|
...this.state,
|
|
551
559
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBasePathModularUI } from "../../../constants";
|
|
2
2
|
import Href from "../Href";
|
|
3
3
|
|
|
4
4
|
describe("href spec", () => {
|
|
@@ -90,13 +90,18 @@ describe("href spec", () => {
|
|
|
90
90
|
const samePathHref = new Href("/url?param1=value2");
|
|
91
91
|
const otherHref = new Href("/path?param1=value1");
|
|
92
92
|
|
|
93
|
-
expect(baseHref.equals(sameHref)).
|
|
94
|
-
expect(baseHref.equals(samePathHref)).
|
|
95
|
-
expect(baseHref.equals(otherHref)).
|
|
93
|
+
expect(baseHref.equals(sameHref)).toBe(true);
|
|
94
|
+
expect(baseHref.equals(samePathHref)).toBe(true);
|
|
95
|
+
expect(baseHref.equals(otherHref)).toBe(false);
|
|
96
96
|
|
|
97
|
-
expect(baseHref.equalsWithParameters(sameHref)).
|
|
98
|
-
expect(baseHref.equalsWithParameters(samePathHref)).
|
|
99
|
-
expect(baseHref.equalsWithParameters(otherHref)).
|
|
97
|
+
expect(baseHref.equalsWithParameters(sameHref)).toBe(true);
|
|
98
|
+
expect(baseHref.equalsWithParameters(samePathHref)).toBe(false);
|
|
99
|
+
expect(baseHref.equalsWithParameters(otherHref)).toBe(false);
|
|
100
|
+
|
|
101
|
+
expect(baseHref.equalsWithParameters("/url?param1=value1")).toBe(true);
|
|
102
|
+
expect(baseHref.equalsWithParameters(null)).toBe(false);
|
|
103
|
+
expect(baseHref.equalsWithParameters("/url?param1=value2")).toBe(false);
|
|
104
|
+
expect(baseHref.equalsWithParameters("/path?param1=value1")).toBe(false);
|
|
100
105
|
});
|
|
101
106
|
|
|
102
107
|
it("can make distinction between relative and absolute urls", () => {
|
|
@@ -142,7 +147,7 @@ describe("href spec", () => {
|
|
|
142
147
|
});
|
|
143
148
|
|
|
144
149
|
it("a tab can have the same uri as the contextPath", () => {
|
|
145
|
-
expect(
|
|
150
|
+
expect(getBasePathModularUI()).toBe("/BeInformed");
|
|
146
151
|
|
|
147
152
|
const tabHref = new Href("/BeInformed");
|
|
148
153
|
|
|
@@ -152,6 +157,7 @@ describe("href spec", () => {
|
|
|
152
157
|
pathname: "/BeInformed",
|
|
153
158
|
search: "",
|
|
154
159
|
state: {
|
|
160
|
+
origin: "",
|
|
155
161
|
contextPath: "/BeInformed",
|
|
156
162
|
},
|
|
157
163
|
});
|
|
@@ -163,9 +169,7 @@ describe("href spec", () => {
|
|
|
163
169
|
hash: "",
|
|
164
170
|
pathname: "/BeInformed/list",
|
|
165
171
|
search: "",
|
|
166
|
-
state: {
|
|
167
|
-
contextPath: "/BeInformed",
|
|
168
|
-
},
|
|
172
|
+
state: { origin: "", contextPath: "/BeInformed" },
|
|
169
173
|
});
|
|
170
174
|
|
|
171
175
|
const listHrefFromHref = new Href(listHref);
|
|
@@ -174,9 +178,7 @@ describe("href spec", () => {
|
|
|
174
178
|
hash: "",
|
|
175
179
|
pathname: "/BeInformed/list",
|
|
176
180
|
search: "",
|
|
177
|
-
state: {
|
|
178
|
-
contextPath: "/BeInformed",
|
|
179
|
-
},
|
|
181
|
+
state: { origin: "", contextPath: "/BeInformed" },
|
|
180
182
|
});
|
|
181
183
|
});
|
|
182
184
|
});
|
|
@@ -4,6 +4,7 @@ import normalizeLinkJSON from "./normalizeLinkJSON";
|
|
|
4
4
|
import LinkModel from "./LinkModel";
|
|
5
5
|
|
|
6
6
|
import type Href from "../href/Href";
|
|
7
|
+
import type { ModelOptions } from "../types";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Collection of links
|
|
@@ -17,15 +18,14 @@ export default class LinkCollection extends BaseCollection<LinkModel> {
|
|
|
17
18
|
constructor(
|
|
18
19
|
linkData: Object = {},
|
|
19
20
|
linkContributions: Object = {},
|
|
20
|
-
|
|
21
|
-
contextPath?: string,
|
|
21
|
+
modelOptions?: ModelOptions,
|
|
22
22
|
) {
|
|
23
23
|
super();
|
|
24
24
|
|
|
25
25
|
// There can be links in data and/or contributions (e.g. concept link is available through contributions)
|
|
26
26
|
this.collection = normalizeLinkJSON(linkData, linkContributions).map(
|
|
27
27
|
({ data, contributions }) =>
|
|
28
|
-
new LinkModel(data, contributions,
|
|
28
|
+
new LinkModel(data, contributions, modelOptions),
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -7,7 +7,7 @@ import Href from "../href/Href";
|
|
|
7
7
|
import LinkCollection from "../links/LinkCollection";
|
|
8
8
|
import { INITIAL_FILTER } from "../../constants/LayoutHints";
|
|
9
9
|
|
|
10
|
-
import type { ModularUIModel } from "../types";
|
|
10
|
+
import type { ModelOptions, ModularUIModel } from "../types";
|
|
11
11
|
import Parameter from "../parameter/Parameter";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -30,12 +30,11 @@ class LinkModel extends BaseModel {
|
|
|
30
30
|
constructor(
|
|
31
31
|
data: Object,
|
|
32
32
|
contributions: Object,
|
|
33
|
-
|
|
34
|
-
contextPath?: string,
|
|
33
|
+
modelOptions?: ModelOptions,
|
|
35
34
|
) {
|
|
36
|
-
super(data, contributions);
|
|
35
|
+
super(data, contributions, modelOptions);
|
|
37
36
|
|
|
38
|
-
this.createHref(
|
|
37
|
+
this.createHref(modelOptions);
|
|
39
38
|
|
|
40
39
|
this._isCacheable = false;
|
|
41
40
|
}
|
|
@@ -47,23 +46,17 @@ class LinkModel extends BaseModel {
|
|
|
47
46
|
name: string,
|
|
48
47
|
href: string | Href,
|
|
49
48
|
label: string,
|
|
50
|
-
|
|
51
|
-
contextPath?: string,
|
|
49
|
+
modelOptions?: ModelOptions,
|
|
52
50
|
): LinkModel {
|
|
53
51
|
const data = { name, href };
|
|
54
52
|
const contributions = { label };
|
|
55
|
-
return new LinkModel(data, contributions,
|
|
53
|
+
return new LinkModel(data, contributions, modelOptions);
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
/**
|
|
59
57
|
*/
|
|
60
|
-
createHref(
|
|
61
|
-
const href = new Href(
|
|
62
|
-
this.data.href,
|
|
63
|
-
this.resourcetype,
|
|
64
|
-
origin,
|
|
65
|
-
contextPath,
|
|
66
|
-
);
|
|
58
|
+
createHref(modelOptions: ?ModelOptions) {
|
|
59
|
+
const href = new Href(this.data.href, this.resourcetype, modelOptions);
|
|
67
60
|
this.handleInitialFilters(href);
|
|
68
61
|
|
|
69
62
|
this.href = href;
|
|
@@ -278,7 +278,12 @@ export default class ListDetailModel extends DetailModel {
|
|
|
278
278
|
*/
|
|
279
279
|
addAttributes(key: string, eventData: Object, eventContributions: Object) {
|
|
280
280
|
this._eventdata.push(
|
|
281
|
-
new AttributeSetModel(
|
|
281
|
+
new AttributeSetModel(
|
|
282
|
+
key,
|
|
283
|
+
eventData,
|
|
284
|
+
eventContributions,
|
|
285
|
+
this.modelOptions,
|
|
286
|
+
),
|
|
282
287
|
);
|
|
283
288
|
}
|
|
284
289
|
|
|
@@ -9,6 +9,7 @@ import { CASEVIEW_LINK } from "../../constants/LayoutHints";
|
|
|
9
9
|
import type ChoiceAttributeOptionModel from "../attributes/ChoiceAttributeOptionModel";
|
|
10
10
|
import type ActionCollection from "../actions/ActionCollection";
|
|
11
11
|
import type LinkCollection from "../links/LinkCollection";
|
|
12
|
+
import type { ModelOptions } from "../types";
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* List Item
|
|
@@ -20,15 +21,14 @@ export default class ListItemModel extends DetailModel {
|
|
|
20
21
|
key: string,
|
|
21
22
|
data: Object,
|
|
22
23
|
contributions: Object,
|
|
23
|
-
|
|
24
|
-
contextPath?: string,
|
|
24
|
+
modelOptions?: ModelOptions,
|
|
25
25
|
): ListItemModel {
|
|
26
26
|
const listitemInput = new ModularUIResponse();
|
|
27
27
|
listitemInput.key = key;
|
|
28
28
|
listitemInput.data = data;
|
|
29
29
|
listitemInput.contributions = contributions;
|
|
30
|
-
listitemInput.origin = origin;
|
|
31
|
-
listitemInput.contextPath = contextPath;
|
|
30
|
+
listitemInput.origin = modelOptions?.origin;
|
|
31
|
+
listitemInput.contextPath = modelOptions?.contextPath;
|
|
32
32
|
|
|
33
33
|
return new ListItemModel(listitemInput);
|
|
34
34
|
}
|
|
@@ -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
|
/**
|