@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModelCatalog.js","names":["_useRouter","require","_createHref","_ModelCatalogModel","_interopRequireDefault","_ConceptIndexModel","_ConceptDetailModel","_BusinessScenarioModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_useModularUIBasic","_models","useModelCatalog","options","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","exports","useConceptIndex","href","key","arguments","length","undefined","url","filterParameters","ConceptIndexModel","useConceptDetail","concept","location","useLocation","createHref","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel","getSearchHref","uri","filters","filterString","_keys","default","filterValue","value","Array","isArray","join","replace","push","useConceptSearch","useContentSearch"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\nexport type SearchFilter = {\n index?: string,\n label?: string,\n type?: string | Array<string>,\n modelCategory?: string | Array<string>,\n entryDate?: string,\n};\n\n/**\n */\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string,\n key?: string = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const url = filterParameters(href, [\n \"entryDate\",\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string,\n key?: string = \"conceptdetail\",\n options?: UseModularUIBasicOptions<\n ConceptDetailModel | BusinessScenarioModel,\n >,\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n ...options,\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string,\n key?: string = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string,\n key?: string = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\n): ?ContentTOCModel => {\n const location = useLocation();\n const href = createHref(\"content\", content, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string,\n key?: string = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n): ?ContentModel => {\n const href = createHref(\"content\", contentSection, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string,\n key?: string = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n): ?ContentTypeModel => {\n const href = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\n/**\n */\nconst getSearchHref = (uri: string, filters: SearchFilter): string => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\n/**\n */\nexport const useConceptSearch = (\n filters: SearchFilter,\n key?: string = \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\n/**\n */\nexport const useContentSearch = (\n filters: SearchFilter,\n key?: string = \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,mBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,sBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,kBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,gBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,aAAA,GAAAN,sBAAA,CAAAH,OAAA;AAEA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAWA;AACA;AACO,MAAMY,eAAe,GAC1BC,OAAqD,IAErD,IAAAC,oCAAiB,EAAC,cAAc,EAAE,eAAe,EAAE;EACjDC,cAAc,EAAE,CAAC,cAAc,CAAC;EAChCC,WAAW,EAAEC,0BAAiB;EAC9B,GAAGJ;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAN,eAAA,GAAAA,eAAA;AAEO,MAAMO,eAAe,GAAG,SAAAA,CAC7BC,IAAY,EAGW;EAAA,IAFvBC,GAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,cAAc;EAAA,IAC7BT,OAAqD,GAAAS,SAAA,CAAAC,MA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ACI,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;MACrC;MACAR,YAAY,CAACS,IAAI,CAAC,GAAGnC,GAAG,IAAI8B,KAAK,EAAE,CAAC;IACtC;EACF;EAEA,OAAOJ,YAAY,CAACxB,MAAM,GAAG,GAAGsB,GAAG,IAAIE,YAAY,CAACO,IAAI,CAAC,GAAG,CAAC,EAAE,GAAGT,GAAG;AACvE,CAAC;;AAED;AACA;AACO,MAAMY,gBAAgB,GAAG,SAAAA,CAC9BX,OAAqB,EAGE;EAAA,IAFvBzB,GAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,eAAe;EAAA,IAC9BT,OAAqD,GAAAS,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAErD,MAAMJ,IAAI,GAAGwB,aAAa,CAAC,WAAW,EAAEE,OAAO,CAAC;EAChD,OAAO3B,eAAe,CAACC,IAAI,EAAEC,GAAG,EAAER,OAAO,CAAC;AAC5C,CAAC;;AAED;AACA;AADAK,OAAA,CAAAuC,gBAAA,GAAAA,gBAAA;AAEO,MAAMC,gBAAgB,GAAG,SAAAA,CAC9BZ,OAAqB,EAGE;EAAA,IAFvBzB,GAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,eAAe;EAAA,IAC9BT,OAAqD,GAAAS,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAErD,MAAMJ,IAAI,GAAGwB,aAAa,CAAC,UAAU,EAAEE,OAAO,CAAC;EAC/C,OAAOb,eAAe,CAACb,IAAI,EAAEC,GAAG,EAAER,OAAO,CAAC;AAC5C,CAAC;AAACK,OAAA,CAAAwC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"useModelCatalog.js","names":["_useRouter","require","_createHref","_ModelCatalogModel","_interopRequireDefault","_ConceptIndexModel","_ConceptDetailModel","_BusinessScenarioModel","_ContentIndexModel","_ContentTOCModel","_ContentModel","_useModularUIBasic","_models","useModelCatalog","options","useModularUIBasic","expectedModels","targetModel","ModelCatalogModel","exports","useConceptIndex","href","key","arguments","length","undefined","url","filterParameters","ConceptIndexModel","useConceptDetail","concept","location","useLocation","createHref","useContentIndex","ContentIndexModel","useContentTOC","content","ContentTOCModel","useContent","contentSection","ContentModel","useContentType","contentType","ContentTypeModel","getSearchHref","uri","filters","filterString","_keys","default","filterValue","value","Array","isArray","join","replace","push","useConceptSearch","useContentSearch"],"sources":["../../src/hooks/useModelCatalog.js"],"sourcesContent":["// @flow\nimport { useLocation } from \"./useRouter\";\n\nimport { createHref, filterParameters } from \"../utils/helpers/createHref\";\n\nimport ModelCatalogModel from \"../models/modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"../models/concepts/ConceptIndexModel\";\nimport ConceptDetailModel from \"../models/concepts/ConceptDetailModel\";\nimport { default as BusinessScenarioModel } from \"../models/concepts/BusinessScenarioModel\";\nimport ContentIndexModel from \"../models/content/ContentIndexModel\";\nimport ContentTOCModel from \"../models/content/ContentTOCModel\";\nimport ContentModel from \"../models/content/ContentModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { ContentTypeModel } from \"../models\";\n\nimport type Href from \"../models/href/Href\";\nimport type { UseModularUIBasicOptions } from \"./useModularUIBasic\";\nexport type SearchFilter = {\n index?: string,\n label?: string,\n type?: string | Array<string>,\n modelCategory?: string | Array<string>,\n entryDate?: string,\n};\n\n/**\n */\nexport const useModelCatalog = (\n options?: UseModularUIBasicOptions<ModelCatalogModel>,\n): ?ModelCatalogModel =>\n useModularUIBasic(\"modelcatalog\", \"/modelcatalog\", {\n expectedModels: [\"ModelCatalog\"],\n targetModel: ModelCatalogModel,\n ...options,\n });\n\n/**\n */\nexport const useConceptIndex = (\n href: string | Href,\n key?: string = \"conceptindex\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const url = filterParameters(href, [\n \"entryDate\",\n \"index\",\n \"label\",\n \"modelcategory\",\n \"type\",\n ]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ConceptIndex\"],\n targetModel: ConceptIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useConceptDetail = (\n concept: string | Href,\n key?: string = \"conceptdetail\",\n options?: UseModularUIBasicOptions<\n ConceptDetailModel | BusinessScenarioModel,\n >,\n): ?ConceptDetailModel | ?BusinessScenarioModel => {\n const location = useLocation();\n\n const href = createHref(\"concepts\", concept, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ConceptDetail\", \"BusinessScenario\"],\n ...options,\n });\n};\n\n/**\n */\nexport const useContentIndex = (\n href: string | Href,\n key?: string = \"contentindex\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const url = filterParameters(href, [\"index\", \"label\", \"type\"]);\n return useModularUIBasic(key, url, {\n expectedModels: [\"ContentIndex\"],\n targetModel: ContentIndexModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentTOC = (\n content: string | Href,\n key?: string = \"contenttoc\",\n options?: UseModularUIBasicOptions<ContentTOCModel>,\n): ?ContentTOCModel => {\n const location = useLocation();\n const href = createHref(\"content\", content, location, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentTOC\"],\n targetModel: ContentTOCModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContent = (\n contentSection: string | Href,\n key?: string = \"content\",\n options?: UseModularUIBasicOptions<ContentModel>,\n): ?ContentModel => {\n const href = createHref(\"content\", contentSection, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"Content\"],\n targetModel: ContentModel,\n ...options,\n });\n};\n\n/**\n */\nexport const useContentType = (\n contentType: string | Href,\n key?: string = \"contenttypes\",\n options?: UseModularUIBasicOptions<ContentTypeModel>,\n): ?ContentTypeModel => {\n const href = createHref(\"contenttypes\", contentType, null, [\"entryDate\"]);\n return useModularUIBasic(key, href, {\n expectedModels: [\"ContentType\"],\n targetModel: ContentTypeModel,\n ...options,\n });\n};\n\n/**\n */\nconst getSearchHref = (uri: string, filters: SearchFilter): string => {\n const filterString = [];\n\n for (const key of Object.keys(filters)) {\n const filterValue = filters[key];\n if (filterValue) {\n let value: string = Array.isArray(filterValue)\n ? filterValue.join(\",\")\n : filterValue;\n if (key === \"type\") {\n value = value.replace(\"#\", \"%23\"); // handles un-encoded #\n }\n filterString.push(`${key}=${value}`);\n }\n }\n\n return filterString.length ? `${uri}?${filterString.join(\"&\")}` : uri;\n};\n\n/**\n */\nexport const useConceptSearch = (\n filters: SearchFilter,\n key?: string = \"conceptSearch\",\n options?: UseModularUIBasicOptions<ConceptIndexModel>,\n): ?ConceptIndexModel => {\n const href = getSearchHref(\"/concepts\", filters);\n return useConceptIndex(href, key, options);\n};\n\n/**\n */\nexport const useContentSearch = (\n filters: SearchFilter,\n key?: string = \"contentSearch\",\n options?: UseModularUIBasicOptions<ContentIndexModel>,\n): ?ContentIndexModel => {\n const href = getSearchHref(\"/content\", filters);\n return useContentIndex(href, key, options);\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,mBAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,sBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,kBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,gBAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,aAAA,GAAAN,sBAAA,CAAAH,OAAA;AAEA,IAAAU,kBAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAYA;AACA;AACO,MAAMY,eAAe,GAC1BC,OAAqD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AE,SAAA,GAAAF,SAAA,MAAG,eAAe;EAAA,IAC9BT,OAAqD,GAAAS,SAAA,CAAAC,MAAA,OAAAD,SAAA,MAAAE,SAAA;EAErD,MAAMJ,IAAI,GAAGwB,aAAa,CAAC,UAAU,EAAEE,OAAO,CAAC;EAC/C,OAAOb,eAAe,CAACb,IAAI,EAAEC,GAAG,EAAER,OAAO,CAAC;AAC5C,CAAC;AAACK,OAAA,CAAAwC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -67,7 +67,7 @@ const useModularUIBasic = function (key, href) {
|
|
|
67
67
|
const location = (0, _useRouter.useLocation)();
|
|
68
68
|
const memoizedHref = (0, _react.useMemo)(() => href.toString(), [href]);
|
|
69
69
|
const useModularUIOptions = (0, _react.useMemo)(() => createUseModularUIOptions(options, memoizedHref, location), [options, memoizedHref, location]);
|
|
70
|
-
const modularUI = (0, _useModularUI.useModularUI)(key,
|
|
70
|
+
const modularUI = (0, _useModularUI.useModularUI)(key, href, useModularUIOptions);
|
|
71
71
|
const expectedModels = (0, _react.useMemo)(() => options.expectedModels ?? [], [options.expectedModels]);
|
|
72
72
|
return (0, _react.useMemo)(() => {
|
|
73
73
|
if (modularUI?.model) {
|
|
@@ -85,7 +85,7 @@ export const useModularUIBasic = <T: ModularUIModel>(
|
|
|
85
85
|
[options, memoizedHref, location],
|
|
86
86
|
);
|
|
87
87
|
|
|
88
|
-
const modularUI = useModularUI(key,
|
|
88
|
+
const modularUI = useModularUI(key, href, useModularUIOptions);
|
|
89
89
|
const expectedModels = useMemo(
|
|
90
90
|
() => options.expectedModels ?? [],
|
|
91
91
|
[options.expectedModels],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUIBasic.js","names":["_react","require","_useModularUI","_useRouter","createUseModularUIOptions","options","href","location","_context","baseOptions","targetModel","undefined","forceTargetModel","isReload","origin","contextPath","cache","state","reload","_startsWith","default","pathname","call","validateModel","model","expectedModels","length","isCorrectModel","some","expectedModel","type","console","warn","useModularUIBasic","key","arguments","useLocation","memoizedHref","useMemo","toString","useModularUIOptions","modularUI","useModularUI","exports"],"sources":["../../src/hooks/useModularUIBasic.js"],"sourcesContent":["// @flow\nimport { useMemo } from \"react\";\nimport { useModularUI } from \"./useModularUI\";\nimport { useLocation } from \"./useRouter\";\n\nimport type { ModularUIModel, Href } from \"../models\";\n\nexport type UseModularUIBasicOptions<T: ModularUIModel> = {\n expectedModels?: Array<string>,\n targetModel?: Class<T> | Array<Class<T>>,\n forceTargetModel?: boolean,\n origin?: string,\n contextPath?: string,\n cache?: boolean,\n};\n\n// Helper to create useModularUI options\nconst createUseModularUIOptions = <T: ModularUIModel>(\n options: UseModularUIBasicOptions<T>,\n href: string,\n location: any,\n): Object => {\n const baseOptions = {\n targetModel: undefined,\n forceTargetModel: undefined,\n isReload: false,\n origin: undefined,\n contextPath: undefined,\n cache: false,\n };\n\n // Handle targetModel and forceTargetModel\n if (options.targetModel) {\n baseOptions.targetModel = options.targetModel;\n baseOptions.forceTargetModel = options.forceTargetModel;\n }\n\n // Handle cache option\n if (options.cache) {\n baseOptions.cache = options.cache;\n }\n\n // Check for reload if location matches href\n if (location.state?.reload && location.pathname.startsWith(href)) {\n baseOptions.isReload = true;\n }\n\n // Handle origin and contextPath options\n baseOptions.origin = options.origin ?? baseOptions.origin;\n baseOptions.contextPath = options.contextPath ?? baseOptions.contextPath;\n\n return baseOptions;\n};\n\n// Helper to validate the model against expectedModels\nconst validateModel = (model: any, expectedModels: Array<string>) => {\n if (expectedModels.length > 0) {\n const isCorrectModel = expectedModels.some(\n (expectedModel) => model.type === expectedModel,\n );\n if (!isCorrectModel) {\n console.warn(model, \"is not of instance\", expectedModels);\n }\n }\n};\n\n/**\n * useModularUIBasic Hook\n */\nexport const useModularUIBasic = <T: ModularUIModel>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n forceTargetModel: false,\n origin: undefined,\n contextPath: undefined,\n },\n): T | null => {\n const location = useLocation();\n const memoizedHref = useMemo(() => href.toString(), [href]);\n const useModularUIOptions = useMemo(\n () => createUseModularUIOptions(options, memoizedHref, location),\n [options, memoizedHref, location],\n );\n\n const modularUI = useModularUI(key,
|
|
1
|
+
{"version":3,"file":"useModularUIBasic.js","names":["_react","require","_useModularUI","_useRouter","createUseModularUIOptions","options","href","location","_context","baseOptions","targetModel","undefined","forceTargetModel","isReload","origin","contextPath","cache","state","reload","_startsWith","default","pathname","call","validateModel","model","expectedModels","length","isCorrectModel","some","expectedModel","type","console","warn","useModularUIBasic","key","arguments","useLocation","memoizedHref","useMemo","toString","useModularUIOptions","modularUI","useModularUI","exports"],"sources":["../../src/hooks/useModularUIBasic.js"],"sourcesContent":["// @flow\nimport { useMemo } from \"react\";\nimport { useModularUI } from \"./useModularUI\";\nimport { useLocation } from \"./useRouter\";\n\nimport type { ModularUIModel, Href } from \"../models\";\n\nexport type UseModularUIBasicOptions<T: ModularUIModel> = {\n expectedModels?: Array<string>,\n targetModel?: Class<T> | Array<Class<T>>,\n forceTargetModel?: boolean,\n origin?: string,\n contextPath?: string,\n cache?: boolean,\n};\n\n// Helper to create useModularUI options\nconst createUseModularUIOptions = <T: ModularUIModel>(\n options: UseModularUIBasicOptions<T>,\n href: string,\n location: any,\n): Object => {\n const baseOptions = {\n targetModel: undefined,\n forceTargetModel: undefined,\n isReload: false,\n origin: undefined,\n contextPath: undefined,\n cache: false,\n };\n\n // Handle targetModel and forceTargetModel\n if (options.targetModel) {\n baseOptions.targetModel = options.targetModel;\n baseOptions.forceTargetModel = options.forceTargetModel;\n }\n\n // Handle cache option\n if (options.cache) {\n baseOptions.cache = options.cache;\n }\n\n // Check for reload if location matches href\n if (location.state?.reload && location.pathname.startsWith(href)) {\n baseOptions.isReload = true;\n }\n\n // Handle origin and contextPath options\n baseOptions.origin = options.origin ?? baseOptions.origin;\n baseOptions.contextPath = options.contextPath ?? baseOptions.contextPath;\n\n return baseOptions;\n};\n\n// Helper to validate the model against expectedModels\nconst validateModel = (model: any, expectedModels: Array<string>) => {\n if (expectedModels.length > 0) {\n const isCorrectModel = expectedModels.some(\n (expectedModel) => model.type === expectedModel,\n );\n if (!isCorrectModel) {\n console.warn(model, \"is not of instance\", expectedModels);\n }\n }\n};\n\n/**\n * useModularUIBasic Hook\n */\nexport const useModularUIBasic = <T: ModularUIModel>(\n key: string,\n href: string | Href,\n options: UseModularUIBasicOptions<T> = {\n expectedModels: [],\n targetModel: undefined,\n forceTargetModel: false,\n origin: undefined,\n contextPath: undefined,\n },\n): T | null => {\n const location = useLocation();\n const memoizedHref = useMemo(() => href.toString(), [href]);\n const useModularUIOptions = useMemo(\n () => createUseModularUIOptions(options, memoizedHref, location),\n [options, memoizedHref, location],\n );\n\n const modularUI = useModularUI(key, href, useModularUIOptions);\n const expectedModels = useMemo(\n () => options.expectedModels ?? [],\n [options.expectedModels],\n );\n\n return useMemo((): T | null => {\n if (modularUI?.model) {\n validateModel(modularUI.model, expectedModels);\n return modularUI.model;\n }\n return null;\n }, [expectedModels, modularUI]);\n};\n"],"mappings":";;;;;;;;AACA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAaA;AACA,MAAMG,yBAAyB,GAAGA,CAChCC,OAAoC,EACpCC,IAAY,EACZC,QAAa,KACF;EAAA,IAAAC,QAAA;EACX,MAAMC,WAAW,GAAG;IAClBC,WAAW,EAAEC,SAAS;IACtBC,gBAAgB,EAAED,SAAS;IAC3BE,QAAQ,EAAE,KAAK;IACfC,MAAM,EAAEH,SAAS;IACjBI,WAAW,EAAEJ,SAAS;IACtBK,KAAK,EAAE;EACT,CAAC;;EAED;EACA,IAAIX,OAAO,CAACK,WAAW,EAAE;IACvBD,WAAW,CAACC,WAAW,GAAGL,OAAO,CAACK,WAAW;IAC7CD,WAAW,CAACG,gBAAgB,GAAGP,OAAO,CAACO,gBAAgB;EACzD;;EAEA;EACA,IAAIP,OA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AAAC,cAAO,EAAC,MAAMhC,IAAI,CAACiC,QAAQ,CAAC,CAAC,EAAE,CAACjC,IAAI,CAAC,CAAC;EAC3D,MAAMkC,mBAAmB,GAAG,IAAAF,cAAO,EACjC,MAAMlC,yBAAyB,CAACC,OAAO,EAAEgC,YAAY,EAAE9B,QAAQ,CAAC,EAChE,CAACF,OAAO,EAAEgC,YAAY,EAAE9B,QAAQ,CAClC,CAAC;EAED,MAAMkC,SAAS,GAAG,IAAAC,0BAAY,EAACR,GAAG,EAAE5B,IAAI,EAAEkC,mBAAmB,CAAC;EAC9D,MAAMf,cAAc,GAAG,IAAAa,cAAO,EAC5B,MAAMjC,OAAO,CAACoB,cAAc,IAAI,EAAE,EAClC,CAACpB,OAAO,CAACoB,cAAc,CACzB,CAAC;EAED,OAAO,IAAAa,cAAO,EAAC,MAAgB;IAC7B,IAAIG,SAAS,EAAEjB,KAAK,EAAE;MACpBD,aAAa,CAACkB,SAAS,CAACjB,KAAK,EAAEC,cAAc,CAAC;MAC9C,OAAOgB,SAAS,CAACjB,KAAK;IACxB;IACA,OAAO,IAAI;EACb,CAAC,EAAE,CAACC,cAAc,EAAEgB,SAAS,CAAC,CAAC;AACjC,CAAC;AAACE,OAAA,CAAAV,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -11,6 +11,8 @@ import UserProfileModel from "../models/user/UserProfileModel";
|
|
|
11
11
|
|
|
12
12
|
import { useModularUIBasic } from "./useModularUIBasic";
|
|
13
13
|
|
|
14
|
+
import type Href from "../models/href/Href";
|
|
15
|
+
|
|
14
16
|
type HookOptions = {
|
|
15
17
|
origin?: string,
|
|
16
18
|
contextPath?: string,
|
|
@@ -31,7 +33,10 @@ export const useApplication = (
|
|
|
31
33
|
/**
|
|
32
34
|
* Load a tab by href
|
|
33
35
|
*/
|
|
34
|
-
export const useTab = (
|
|
36
|
+
export const useTab = (
|
|
37
|
+
href: string | Href,
|
|
38
|
+
options?: HookOptions,
|
|
39
|
+
): TabModel | null =>
|
|
35
40
|
useModularUIBasic("tab", href, {
|
|
36
41
|
expectedModels: ["Tab"],
|
|
37
42
|
targetModel: TabModel,
|
|
@@ -42,7 +47,7 @@ export const useTab = (href: string, options?: HookOptions): TabModel | null =>
|
|
|
42
47
|
* Load caseview by href
|
|
43
48
|
*/
|
|
44
49
|
export const useCaseView = (
|
|
45
|
-
href: string,
|
|
50
|
+
href: string | Href,
|
|
46
51
|
options?: HookOptions,
|
|
47
52
|
): CaseViewModel | null =>
|
|
48
53
|
useModularUIBasic("caseview", href, {
|
|
@@ -54,7 +59,7 @@ export const useCaseView = (
|
|
|
54
59
|
/**
|
|
55
60
|
*/
|
|
56
61
|
export const usePanel = (
|
|
57
|
-
href: string,
|
|
62
|
+
href: string | Href,
|
|
58
63
|
options?: HookOptions,
|
|
59
64
|
): ListModel | GroupingPanelModel | DetailModel | null =>
|
|
60
65
|
useModularUIBasic("panel", href, {
|
|
@@ -65,7 +70,7 @@ export const usePanel = (
|
|
|
65
70
|
/**
|
|
66
71
|
*/
|
|
67
72
|
export const useList = (
|
|
68
|
-
href: string,
|
|
73
|
+
href: string | Href,
|
|
69
74
|
options?: HookOptions,
|
|
70
75
|
): ListModel | null =>
|
|
71
76
|
useModularUIBasic("list", href, {
|
|
@@ -77,7 +82,7 @@ export const useList = (
|
|
|
77
82
|
/**
|
|
78
83
|
*/
|
|
79
84
|
export const useListOrDetail = (
|
|
80
|
-
href: string,
|
|
85
|
+
href: string | Href,
|
|
81
86
|
options?: HookOptions,
|
|
82
87
|
): ListModel | DetailModel | null =>
|
|
83
88
|
useModularUIBasic("list", href, {
|
|
@@ -89,7 +94,7 @@ export const useListOrDetail = (
|
|
|
89
94
|
/**
|
|
90
95
|
*/
|
|
91
96
|
export const useListDetail = (
|
|
92
|
-
href: string,
|
|
97
|
+
href: string | Href,
|
|
93
98
|
options?: HookOptions,
|
|
94
99
|
): ListDetailModel | null =>
|
|
95
100
|
useModularUIBasic("listdetail", href, {
|
|
@@ -102,7 +107,7 @@ export const useListDetail = (
|
|
|
102
107
|
/**
|
|
103
108
|
*/
|
|
104
109
|
export const useGroupingPanel = (
|
|
105
|
-
href: string,
|
|
110
|
+
href: string | Href,
|
|
106
111
|
options?: HookOptions,
|
|
107
112
|
): GroupingPanelModel | null =>
|
|
108
113
|
useModularUIBasic("groupingpanel", href, {
|
|
@@ -114,7 +119,7 @@ export const useGroupingPanel = (
|
|
|
114
119
|
/**
|
|
115
120
|
*/
|
|
116
121
|
export const useDetailPanel = (
|
|
117
|
-
href: string,
|
|
122
|
+
href: string | Href,
|
|
118
123
|
options?: HookOptions,
|
|
119
124
|
): DetailModel | null =>
|
|
120
125
|
useModularUIBasic("detailpanel", href, {
|
|
@@ -126,7 +131,7 @@ export const useDetailPanel = (
|
|
|
126
131
|
/**
|
|
127
132
|
*/
|
|
128
133
|
export const useQuicksearch = (
|
|
129
|
-
href: string,
|
|
134
|
+
href: string | Href,
|
|
130
135
|
options?: HookOptions,
|
|
131
136
|
): CaseSearchModel | null =>
|
|
132
137
|
useModularUIBasic("quicksearch", href, {
|
|
@@ -138,7 +143,7 @@ export const useQuicksearch = (
|
|
|
138
143
|
/**
|
|
139
144
|
*/
|
|
140
145
|
export const useSearch = (
|
|
141
|
-
href: string,
|
|
146
|
+
href: string | Href,
|
|
142
147
|
options?: HookOptions,
|
|
143
148
|
): CaseSearchModel | null =>
|
|
144
149
|
useModularUIBasic("search", href, {
|
|
@@ -150,7 +155,7 @@ export const useSearch = (
|
|
|
150
155
|
/**
|
|
151
156
|
*/
|
|
152
157
|
export const useUserProfile = (
|
|
153
|
-
href: string,
|
|
158
|
+
href: string | Href,
|
|
154
159
|
options?: HookOptions,
|
|
155
160
|
): UserProfileModel | null =>
|
|
156
161
|
useModularUIBasic("userprofile", href, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useModularUIModel.js","names":["_ApplicationModel","_interopRequireDefault","require","_CaseViewModel","_TabModel","_ListModel","_GroupingPanelModel","_DetailModel","_CaseSearchModel","_ListDetailModel","_UserProfileModel","_useModularUIBasic","useApplication","options","useModularUIBasic","expectedModels","targetModel","ApplicationModel","exports","useTab","href","TabModel","useCaseView","CaseViewModel","usePanel","useList","ListModel","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useGroupingPanel","GroupingPanelModel","useDetailPanel","useQuicksearch","CaseSearchModel","useSearch","useUserProfile","UserProfileModel"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\ntype HookOptions = {\n origin?: string,\n contextPath?: string,\n};\n\n/**\n * Load application\n */\nexport const useApplication = (\n options?: HookOptions,\n): ApplicationModel | null =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n ...options,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (href: string
|
|
1
|
+
{"version":3,"file":"useModularUIModel.js","names":["_ApplicationModel","_interopRequireDefault","require","_CaseViewModel","_TabModel","_ListModel","_GroupingPanelModel","_DetailModel","_CaseSearchModel","_ListDetailModel","_UserProfileModel","_useModularUIBasic","useApplication","options","useModularUIBasic","expectedModels","targetModel","ApplicationModel","exports","useTab","href","TabModel","useCaseView","CaseViewModel","usePanel","useList","ListModel","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useGroupingPanel","GroupingPanelModel","useDetailPanel","useQuicksearch","CaseSearchModel","useSearch","useUserProfile","UserProfileModel"],"sources":["../../src/hooks/useModularUIModel.js"],"sourcesContent":["// @flow\nimport ApplicationModel from \"../models/application/ApplicationModel\";\nimport CaseViewModel from \"../models/caseview/CaseViewModel\";\nimport TabModel from \"../models/tab/TabModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport GroupingPanelModel from \"../models/panels/GroupingPanelModel\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport CaseSearchModel from \"../models/search/CaseSearchModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport UserProfileModel from \"../models/user/UserProfileModel\";\n\nimport { useModularUIBasic } from \"./useModularUIBasic\";\n\nimport type Href from \"../models/href/Href\";\n\ntype HookOptions = {\n origin?: string,\n contextPath?: string,\n};\n\n/**\n * Load application\n */\nexport const useApplication = (\n options?: HookOptions,\n): ApplicationModel | null =>\n useModularUIBasic(\"application\", \"/\", {\n expectedModels: [\"Application\"],\n targetModel: ApplicationModel,\n ...options,\n });\n\n/**\n * Load a tab by href\n */\nexport const useTab = (\n href: string | Href,\n options?: HookOptions,\n): TabModel | null =>\n useModularUIBasic(\"tab\", href, {\n expectedModels: [\"Tab\"],\n targetModel: TabModel,\n ...options,\n });\n\n/**\n * Load caseview by href\n */\nexport const useCaseView = (\n href: string | Href,\n options?: HookOptions,\n): CaseViewModel | null =>\n useModularUIBasic(\"caseview\", href, {\n expectedModels: [\"CaseView\"],\n targetModel: CaseViewModel,\n ...options,\n });\n\n/**\n */\nexport const usePanel = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | GroupingPanelModel | DetailModel | null =>\n useModularUIBasic(\"panel\", href, {\n expectedModels: [\"List\", \"GroupingPanel\", \"Detail\"],\n ...options,\n });\n\n/**\n */\nexport const useList = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n ...options,\n });\n\n/**\n */\nexport const useListOrDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n targetModel: [ListModel, DetailModel],\n ...options,\n });\n\n/**\n */\nexport const useListDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\n/**\n */\nexport const useGroupingPanel = (\n href: string | Href,\n options?: HookOptions,\n): GroupingPanelModel | null =>\n useModularUIBasic(\"groupingpanel\", href, {\n expectedModels: [\"GroupingPanel\"],\n targetModel: GroupingPanelModel,\n ...options,\n });\n\n/**\n */\nexport const useDetailPanel = (\n href: string | Href,\n options?: HookOptions,\n): DetailModel | null =>\n useModularUIBasic(\"detailpanel\", href, {\n expectedModels: [\"Detail\"],\n targetModel: DetailModel,\n ...options,\n });\n\n/**\n */\nexport const useQuicksearch = (\n href: string | Href,\n options?: HookOptions,\n): CaseSearchModel | null =>\n useModularUIBasic(\"quicksearch\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\n/**\n */\nexport const useSearch = (\n href: string | Href,\n options?: HookOptions,\n): CaseSearchModel | null =>\n useModularUIBasic(\"search\", href, {\n expectedModels: [\"CaseSearch\"],\n targetModel: CaseSearchModel,\n ...options,\n });\n\n/**\n */\nexport const useUserProfile = (\n href: string | Href,\n options?: HookOptions,\n): UserProfileModel | null =>\n useModularUIBasic(\"userprofile\", href, {\n expectedModels: [\"UserProfile\"],\n targetModel: UserProfileModel,\n ...options,\n });\n"],"mappings":";;;;;;;AACA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,UAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,mBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA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EAAE,CAAC,QAAQ,CAAC;EAC1BC,WAAW,EAAEY,oBAAW;EACxB,GAAGf;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAgB,cAAA,GAAAA,cAAA;AAEO,MAAMC,cAAc,GAAGA,CAC5Bf,IAAmB,EACnBP,OAAqB,KAErB,IAAAC,oCAAiB,EAAC,aAAa,EAAEM,IAAI,EAAE;EACrCL,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEoB,wBAAe;EAC5B,GAAGvB;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAiB,cAAA,GAAAA,cAAA;AAEO,MAAME,SAAS,GAAGA,CACvBjB,IAAmB,EACnBP,OAAqB,KAErB,IAAAC,oCAAiB,EAAC,QAAQ,EAAEM,IAAI,EAAE;EAChCL,cAAc,EAAE,CAAC,YAAY,CAAC;EAC9BC,WAAW,EAAEoB,wBAAe;EAC5B,GAAGvB;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAmB,SAAA,GAAAA,SAAA;AAEO,MAAMC,cAAc,GAAGA,CAC5BlB,IAAmB,EACnBP,OAAqB,KAErB,IAAAC,oCAAiB,EAAC,aAAa,EAAEM,IAAI,EAAE;EACrCL,cAAc,EAAE,CAAC,aAAa,CAAC;EAC/BC,WAAW,EAAEuB,yBAAgB;EAC7B,GAAG1B;AACL,CAAC,CAAC;AAACK,OAAA,CAAAoB,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -15,7 +15,7 @@ var _ActionModel = _interopRequireDefault(require("./ActionModel"));
|
|
|
15
15
|
* Collection of actions
|
|
16
16
|
*/
|
|
17
17
|
class ActionCollection extends _BaseCollection.default {
|
|
18
|
-
constructor(actions, actionsContributions,
|
|
18
|
+
constructor(actions, actionsContributions, modelOptions) {
|
|
19
19
|
super();
|
|
20
20
|
|
|
21
21
|
// no actions gives an empty collection
|
|
@@ -26,7 +26,7 @@ class ActionCollection extends _BaseCollection.default {
|
|
|
26
26
|
for (const actionData of actions) {
|
|
27
27
|
const actionContribution = (0, _find.default)(actionsContributions).call(actionsContributions, actionContribution => actionContribution.name === actionData.name && actionContribution.type !== "service-operation");
|
|
28
28
|
if (actionContribution) {
|
|
29
|
-
actionModels.push(new _ActionModel.default(actionData, actionContribution,
|
|
29
|
+
actionModels.push(new _ActionModel.default(actionData, actionContribution, modelOptions));
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
this.collection = actionModels;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// @flow
|
|
2
2
|
import BaseCollection from "../base/BaseCollection";
|
|
3
3
|
import ActionModel from "./ActionModel";
|
|
4
|
+
import type { ModelOptions } from "../types";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Collection of actions
|
|
@@ -9,8 +10,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
|
|
|
9
10
|
constructor(
|
|
10
11
|
actions?: Object,
|
|
11
12
|
actionsContributions?: Object,
|
|
12
|
-
|
|
13
|
-
contextPath?: string,
|
|
13
|
+
modelOptions?: ModelOptions,
|
|
14
14
|
) {
|
|
15
15
|
super();
|
|
16
16
|
|
|
@@ -28,12 +28,7 @@ export default class ActionCollection extends BaseCollection<ActionModel> {
|
|
|
28
28
|
|
|
29
29
|
if (actionContribution) {
|
|
30
30
|
actionModels.push(
|
|
31
|
-
new ActionModel(
|
|
32
|
-
actionData,
|
|
33
|
-
actionContribution,
|
|
34
|
-
origin,
|
|
35
|
-
contextPath,
|
|
36
|
-
),
|
|
31
|
+
new ActionModel(actionData, actionContribution, modelOptions),
|
|
37
32
|
);
|
|
38
33
|
}
|
|
39
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_ActionModel","ActionCollection","BaseCollection","constructor","actions","actionsContributions","
|
|
1
|
+
{"version":3,"file":"ActionCollection.js","names":["_BaseCollection","_interopRequireDefault","require","_ActionModel","ActionCollection","BaseCollection","constructor","actions","actionsContributions","modelOptions","Array","isArray","collection","actionModels","actionData","actionContribution","_find","default","call","name","type","push","ActionModel","getActionByKey","key","_context","newCollection","_filter","action","first","getActionsByType","_context2","_includes","getActionsByLayoutHint","_context3","_len","arguments","length","hints","_key","layouthint","has","hasActionsByLayoutHint","routePath","_context4","enabledRoutes","isDisabled","path","_map","selfhref","join","exports"],"sources":["../../../src/models/actions/ActionCollection.js"],"sourcesContent":["// @flow\nimport BaseCollection from \"../base/BaseCollection\";\nimport ActionModel from \"./ActionModel\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n * Collection of actions\n */\nexport default class ActionCollection extends BaseCollection<ActionModel> {\n constructor(\n actions?: Object,\n actionsContributions?: Object,\n modelOptions?: ModelOptions,\n ) {\n super();\n\n // no actions gives an empty collection\n if (!Array.isArray(actions)) {\n this.collection = [];\n } else if (Array.isArray(actionsContributions)) {\n const actionModels = [];\n for (const actionData of actions) {\n const actionContribution = actionsContributions.find(\n (actionContribution) =>\n actionContribution.name === actionData.name &&\n actionContribution.type !== \"service-operation\",\n );\n\n if (actionContribution) {\n actionModels.push(\n new ActionModel(actionData, actionContribution, modelOptions),\n );\n }\n }\n\n this.collection = actionModels;\n }\n }\n\n /**\n * Retrieve action by key\n */\n getActionByKey(key: string): ActionModel | null {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) => action.key === key);\n\n return newCollection.first;\n }\n\n /**\n * Retrieve actions by type\n */\n getActionsByType(type: string | Array<string>): ActionCollection {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n Array.isArray(type) ? type.includes(action.type) : action.type === type,\n );\n\n return newCollection;\n }\n\n /**\n * Retrieve actions including a layout hint\n */\n getActionsByLayoutHint(...hints: Array<string>): ActionCollection {\n const newCollection = new ActionCollection();\n\n newCollection.collection = this.filter((action) =>\n action.layouthint.has(...hints),\n );\n\n return newCollection;\n }\n\n /**\n * Indicates if an action with layout hint exists\n */\n hasActionsByLayoutHint(...hints: Array<string>): boolean {\n return this.getActionsByLayoutHint(...hints).length > 0;\n }\n\n /**\n * Use as path regex for react router routes\n */\n get routePath(): string {\n const enabledRoutes = this.collection.filter(\n (action) => !action.isDisabled,\n );\n\n if (enabledRoutes.length === 0) {\n return \"__NON_EXISTING_ROUTE__\";\n }\n\n const path = enabledRoutes.map((action) => action.selfhref.path).join(\"|\");\n\n return this.length > 1 ? `(${path})` : path;\n }\n}\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAGA;AACA;AACA;AACe,MAAME,gBAAgB,SAASC,uBAAc,CAAc;EACxEC,WAAWA,CACTC,OAAgB,EAChBC,oBAA6B,EAC7BC,YAA2B,EAC3B;IACA,KAAK,CAAC,CAAC;;IAEP;IACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACJ,OAAO,CAAC,EAAE;MAC3B,IAAI,CAACK,UAAU,GAAG,EAAE;IACtB,CAAC,MAAM,IAAIF,KAAK,CAACC,OAAO,CAACH,oBAAoB,CAAC,EAAE;MAC9C,MAAMK,YAAY,GAAG,EAAE;MACvB,KAAK,MAAMC,UAAU,IAAIP,OAAO,EAAE;QAChC,MAAMQ,kBAAkB,GAAG,IAAAC,KAAA,CAAAC,OAAA,EAAAT,oBAAoB,EAAAU,IAAA,CAApBV,oBAAoB,EAC5CO,kBAAkB,IACjBA,kBAAkB,CAACI,IAAI,KAAKL,UAAU,CAACK,IAAI,IAC3CJ,kBAAkB,CAACK,IAAI,KAAK,mBAChC,CAAC;QAED,IAAIL,kBAAkB,EAAE;UACtBF,YAAY,CAACQ,IAAI,CACf,IAAIC,oBAAW,CAACR,UAAU,EAAEC,kBAAkB,EAAEN,YAAY,CAC9D,CAAC;QACH;MACF;MAEA,IAAI,CAACG,UAAU,GAAGC,YAAY;IAChC;EACF;;EAEA;AACF;AACA;EACEU,cAAcA,CAACC,GAAW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AC,GAAGH,KAAK,CAChC,CAAC;IAED,OAAOZ,aAAa;EACtB;;EAEA;AACF;AACA;EACEgB,sBAAsBA,CAAA,EAAmC;IACvD,OAAO,IAAI,CAACT,sBAAsB,CAAC,GAAAG,SAAQ,CAAC,CAACC,MAAM,GAAG,CAAC;EACzD;;EAEA;AACF;AACA;EACE,IAAIM,SAASA,CAAA,EAAW;IAAA,IAAAC,SAAA;IACtB,MAAMC,aAAa,GAAG,IAAAlB,OAAA,CAAAV,OAAA,EAAA2B,SAAA,OAAI,CAAChC,UAAU,EAAAM,IAAA,CAAA0B,SAAA,EAClChB,MAAM,IAAK,CAACA,MAAM,CAACkB,UACtB,CAAC;IAED,IAAID,aAAa,CAACR,MAAM,KAAK,CAAC,EAAE;MAC9B,OAAO,wBAAwB;IACjC;IAEA,MAAMU,IAAI,GAAG,IAAAC,IAAA,CAAA/B,OAAA,EAAA4B,aAAa,EAAA3B,IAAA,CAAb2B,aAAa,EAAMjB,MAAM,IAAKA,MAAM,CAACqB,QAAQ,CAACF,IAAI,CAAC,CAACG,IAAI,CAAC,GAAG,CAAC;IAE1E,OAAO,IAAI,CAACb,MAAM,GAAG,CAAC,GAAG,IAAIU,IAAI,GAAG,GAAGA,IAAI;EAC7C;AACF;AAACI,OAAA,CAAAlC,OAAA,GAAAb,gBAAA","ignoreList":[]}
|
|
@@ -18,16 +18,15 @@ var _constants = require("../../constants");
|
|
|
18
18
|
* Defines an Action. For instance an action on the tab 'books', which leads to a form
|
|
19
19
|
*/
|
|
20
20
|
class ActionModel extends _BaseModel.default {
|
|
21
|
-
constructor(data, contributions,
|
|
22
|
-
super(data, contributions);
|
|
21
|
+
constructor(data, contributions, modelOptions) {
|
|
22
|
+
super(data, contributions, modelOptions);
|
|
23
23
|
(0, _defineProperty2.default)(this, "_fieldCollection", void 0);
|
|
24
24
|
(0, _defineProperty2.default)(this, "_href", void 0);
|
|
25
25
|
(0, _defineProperty2.default)(this, "_icon", void 0);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this._contextPath = contextPath;
|
|
26
|
+
this._fieldCollection = new _AttributeCollection.default(this.data.fields, this.contributions.fields, {
|
|
27
|
+
...modelOptions,
|
|
28
|
+
isReadonly: false
|
|
29
|
+
});
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
/**
|
|
@@ -45,7 +44,10 @@ class ActionModel extends _BaseModel.default {
|
|
|
45
44
|
label: label ?? name,
|
|
46
45
|
type
|
|
47
46
|
};
|
|
48
|
-
return new ActionModel(data, contributions,
|
|
47
|
+
return new ActionModel(data, contributions, {
|
|
48
|
+
origin,
|
|
49
|
+
contextPath
|
|
50
|
+
});
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
/**
|
|
@@ -54,23 +56,11 @@ class ActionModel extends _BaseModel.default {
|
|
|
54
56
|
return this.data.href == null;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
/**
|
|
58
|
-
*/
|
|
59
|
-
get origin() {
|
|
60
|
-
return this._origin ?? "";
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
*/
|
|
65
|
-
get contextPath() {
|
|
66
|
-
return this._contextPath ?? (0, _constants.getBasePath)();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
59
|
/**
|
|
70
60
|
* retrieve href of action
|
|
71
61
|
*/
|
|
72
62
|
get selfhref() {
|
|
73
|
-
return this._href ?? new _Href.default(`${this.data.href}?${this.querystring}`, "Form", this.
|
|
63
|
+
return this._href ?? new _Href.default(`${this.data.href}?${this.querystring}`, "Form", this.modelOptions);
|
|
74
64
|
}
|
|
75
65
|
|
|
76
66
|
/**
|
|
@@ -183,7 +173,7 @@ class ActionModel extends _BaseModel.default {
|
|
|
183
173
|
*/
|
|
184
174
|
get processStatus() {
|
|
185
175
|
if (this.isProcessTask) {
|
|
186
|
-
return new _ProcessStatusSettingsModel.default(this.getData("processStatus", {}), this.getContribution("processTask", {}));
|
|
176
|
+
return new _ProcessStatusSettingsModel.default(this.getData("processStatus", {}), this.getContribution("processTask", {}), this.modelOptions);
|
|
187
177
|
}
|
|
188
178
|
return null;
|
|
189
179
|
}
|
|
@@ -7,14 +7,13 @@ import BaseModel from "../base/BaseModel";
|
|
|
7
7
|
import Href from "../href/Href";
|
|
8
8
|
|
|
9
9
|
import {
|
|
10
|
-
getBasePath,
|
|
11
10
|
HTTP_METHODS,
|
|
12
11
|
CREATE_ACTION,
|
|
13
12
|
UPDATE_ACTION,
|
|
14
13
|
DELETE_ACTION,
|
|
15
14
|
} from "../../constants";
|
|
16
15
|
|
|
17
|
-
import type { AttributeType } from "../types";
|
|
16
|
+
import type { AttributeType, ModelOptions } from "../types";
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
* Defines an Action. For instance an action on the tab 'books', which leads to a form
|
|
@@ -23,23 +22,19 @@ export default class ActionModel extends BaseModel {
|
|
|
23
22
|
_fieldCollection: AttributeCollection;
|
|
24
23
|
_href: Href;
|
|
25
24
|
_icon: string;
|
|
26
|
-
_origin: ?string;
|
|
27
|
-
_contextPath: ?string;
|
|
28
25
|
|
|
29
26
|
constructor(
|
|
30
27
|
data: Object,
|
|
31
28
|
contributions: Object,
|
|
32
|
-
|
|
33
|
-
contextPath?: string,
|
|
29
|
+
modelOptions?: ModelOptions,
|
|
34
30
|
) {
|
|
35
|
-
super(data, contributions);
|
|
31
|
+
super(data, contributions, modelOptions);
|
|
36
32
|
|
|
37
33
|
this._fieldCollection = new AttributeCollection(
|
|
38
34
|
this.data.fields,
|
|
39
35
|
this.contributions.fields,
|
|
36
|
+
{ ...modelOptions, isReadonly: false },
|
|
40
37
|
);
|
|
41
|
-
this._origin = origin;
|
|
42
|
-
this._contextPath = contextPath;
|
|
43
38
|
}
|
|
44
39
|
|
|
45
40
|
/**
|
|
@@ -54,7 +49,7 @@ export default class ActionModel extends BaseModel {
|
|
|
54
49
|
): ActionModel {
|
|
55
50
|
const data = { name, href };
|
|
56
51
|
const contributions = { name, label: label ?? name, type };
|
|
57
|
-
return new ActionModel(data, contributions, origin, contextPath);
|
|
52
|
+
return new ActionModel(data, contributions, { origin, contextPath });
|
|
58
53
|
}
|
|
59
54
|
|
|
60
55
|
/**
|
|
@@ -63,18 +58,6 @@ export default class ActionModel extends BaseModel {
|
|
|
63
58
|
return this.data.href == null;
|
|
64
59
|
}
|
|
65
60
|
|
|
66
|
-
/**
|
|
67
|
-
*/
|
|
68
|
-
get origin(): string {
|
|
69
|
-
return this._origin ?? "";
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*/
|
|
74
|
-
get contextPath(): string {
|
|
75
|
-
return this._contextPath ?? getBasePath();
|
|
76
|
-
}
|
|
77
|
-
|
|
78
61
|
/**
|
|
79
62
|
* retrieve href of action
|
|
80
63
|
*/
|
|
@@ -84,8 +67,7 @@ export default class ActionModel extends BaseModel {
|
|
|
84
67
|
new Href(
|
|
85
68
|
`${this.data.href}?${this.querystring}`,
|
|
86
69
|
"Form",
|
|
87
|
-
this.
|
|
88
|
-
this.contextPath,
|
|
70
|
+
this.modelOptions,
|
|
89
71
|
)
|
|
90
72
|
);
|
|
91
73
|
}
|
|
@@ -204,6 +186,7 @@ export default class ActionModel extends BaseModel {
|
|
|
204
186
|
return new ProcessStatusSettingsModel(
|
|
205
187
|
this.getData("processStatus", {}),
|
|
206
188
|
this.getContribution("processTask", {}),
|
|
189
|
+
this.modelOptions,
|
|
207
190
|
);
|
|
208
191
|
}
|
|
209
192
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionModel.js","names":["_objects","require","_ProcessStatusSettingsModel","_interopRequireDefault","_AttributeCollection","_BaseModel","_Href","_constants","ActionModel","BaseModel","constructor","data","contributions","
|
|
1
|
+
{"version":3,"file":"ActionModel.js","names":["_objects","require","_ProcessStatusSettingsModel","_interopRequireDefault","_AttributeCollection","_BaseModel","_Href","_constants","ActionModel","BaseModel","constructor","data","contributions","modelOptions","_defineProperty2","default","_fieldCollection","AttributeCollection","fields","isReadonly","createFromHref","name","href","label","type","arguments","length","undefined","origin","contextPath","isDisabled","selfhref","_href","Href","querystring","method","getData","HTTP_METHODS","POST","layouthint","has","CREATE_ACTION","UPDATE_ACTION","DELETE_ACTION","getContribution","all","fieldCollection","_context","_context2","_map","_filter","call","attribute","value","join","getFieldByKey","key","getAttributeByKey","hasFieldByKey","isProcessTask","processStatus","ProcessStatusSettingsModel","icon","_icon","exports"],"sources":["../../../src/models/actions/ActionModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ProcessStatusSettingsModel from \"../process/ProcessStatusSettingsModel\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport BaseModel from \"../base/BaseModel\";\nimport Href from \"../href/Href\";\n\nimport {\n HTTP_METHODS,\n CREATE_ACTION,\n UPDATE_ACTION,\n DELETE_ACTION,\n} from \"../../constants\";\n\nimport type { AttributeType, ModelOptions } from \"../types\";\n\n/**\n * Defines an Action. For instance an action on the tab 'books', which leads to a form\n */\nexport default class ActionModel extends BaseModel {\n _fieldCollection: AttributeCollection;\n _href: Href;\n _icon: string;\n\n constructor(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ) {\n super(data, contributions, modelOptions);\n\n this._fieldCollection = new AttributeCollection(\n this.data.fields,\n this.contributions.fields,\n { ...modelOptions, isReadonly: false },\n );\n }\n\n /**\n */\n static createFromHref(\n name: string,\n href: string,\n label: string,\n type: string = \"form\",\n origin?: string,\n contextPath?: string,\n ): ActionModel {\n const data = { name, href };\n const contributions = { name, label: label ?? name, type };\n return new ActionModel(data, contributions, { origin, contextPath });\n }\n\n /**\n */\n get isDisabled(): boolean {\n return this.data.href == null;\n }\n\n /**\n * retrieve href of action\n */\n get selfhref(): Href {\n return (\n this._href ??\n new Href(\n `${this.data.href}?${this.querystring}`,\n \"Form\",\n this.modelOptions,\n )\n );\n }\n\n /**\n */\n set selfhref(href: Href) {\n this._href = href;\n }\n\n /**\n * retrieve request method\n */\n get method(): $Keys<typeof HTTP_METHODS> {\n return this.getData(\"method\", HTTP_METHODS.POST);\n }\n\n /**\n * Retrieve type of method\n */\n get type(): string {\n if (this.layouthint.has(CREATE_ACTION)) {\n return \"create\";\n }\n if (this.layouthint.has(UPDATE_ACTION)) {\n return \"update\";\n }\n if (this.layouthint.has(DELETE_ACTION)) {\n return \"delete\";\n }\n\n return this.getContribution(\"type\", \"general\");\n }\n\n /**\n * Retrieve name of action\n */\n get name(): string {\n return this.getData(\"name\", \"unknown\");\n }\n\n /**\n * retrieve the collection of field attributes as an array\n */\n get fields(): Array<AttributeType> {\n return this._fieldCollection.all;\n }\n\n /**\n * Retrieve the field collection\n */\n get fieldCollection(): AttributeCollection {\n return this._fieldCollection;\n }\n\n /**\n */\n set fieldCollection(fieldCollection: AttributeCollection) {\n this._fieldCollection = fieldCollection;\n }\n\n /**\n * Retrieve querystring of action\n */\n get querystring(): string {\n return this.fields\n .filter((attribute) => attribute.value != null && attribute.value !== \"\")\n .map((attribute) => {\n const { value } = attribute;\n if (value !== null) {\n return `${attribute.name}=${value}`;\n }\n return attribute.name;\n })\n .join(\"&\");\n }\n\n /**\n * Retrieve a field by it's key\n */\n getFieldByKey(key: string): AttributeType | null {\n return this._fieldCollection.getAttributeByKey(key);\n }\n\n /**\n * Indicates if field exists by the given key\n */\n hasFieldByKey(key: string): boolean {\n return this.getFieldByKey(key) !== null;\n }\n\n /**\n * Getting the key/name of this action\n */\n get key(): string {\n return this.data.name;\n }\n\n /**\n * Getting the label of the action\n */\n get label(): string {\n return this.getContribution(\"label\", this.key);\n }\n\n /**\n */\n get isProcessTask(): boolean {\n return has(this.contributions, \"processTask\");\n }\n\n /**\n */\n get processStatus(): ProcessStatusSettingsModel | null {\n if (this.isProcessTask) {\n return new ProcessStatusSettingsModel(\n this.getData(\"processStatus\", {}),\n this.getContribution(\"processTask\", {}),\n this.modelOptions,\n );\n }\n\n return null;\n }\n\n /**\n */\n get icon(): string {\n return this._icon;\n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OAAO,IAAI,CAACqB,eAAe,CAAC,OAAO,EAAE,IAAI,CAACY,GAAG,CAAC;EAChD;;EAEA;AACF;EACE,IAAIG,aAAaA,CAAA,EAAY;IAC3B,OAAO,IAAAnB,YAAG,EAAC,IAAI,CAAC5B,aAAa,EAAE,aAAa,CAAC;EAC/C;;EAEA;AACF;EACE,IAAIgD,aAAaA,CAAA,EAAsC;IACrD,IAAI,IAAI,CAACD,aAAa,EAAE;MACtB,OAAO,IAAIE,mCAA0B,CACnC,IAAI,CAACzB,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EACjC,IAAI,CAACQ,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EACvC,IAAI,CAAC/B,YACP,CAAC;IACH;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIiD,IAAIA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACC,KAAK;EACnB;;EAEA;AACF;EACE,IAAID,IAAIA,CAACA,IAAY,EAAE;IACrB,IAAI,CAACC,KAAK,GAAGD,IAAI;EACnB;AACF;AAACE,OAAA,CAAAjD,OAAA,GAAAP,WAAA","ignoreList":[]}
|
|
@@ -88,7 +88,7 @@ class ApplicationModel extends _ResourceModel.default {
|
|
|
88
88
|
* Get modelcatalog link
|
|
89
89
|
*/
|
|
90
90
|
get modelcatalog() {
|
|
91
|
-
return _LinkModel.default.create("modelcatalog", "/modelcatalog", "Model catalog", this.
|
|
91
|
+
return _LinkModel.default.create("modelcatalog", "/modelcatalog", "Model catalog", this.modelOptions);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationModel.js","names":["_ResourceModel","_interopRequireDefault","require","_LinkModel","_UserServicesModel","_exceptions","_constants","ApplicationModel","ResourceModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","NotAllowedUriException","setChildModels","models","userServiceModel","_find","call","model","userServices","label","getContribution","authenticationTypes","DEFAULT_AUTHENTICATION_TYPE","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","LinkModel","create","
|
|
1
|
+
{"version":3,"file":"ApplicationModel.js","names":["_ResourceModel","_interopRequireDefault","require","_LinkModel","_UserServicesModel","_exceptions","_constants","ApplicationModel","ResourceModel","constructor","arguments","_defineProperty2","default","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","userService","links","getLinkByKey","href","path","NotAllowedUriException","setChildModels","models","userServiceModel","_find","call","model","userServices","label","getContribution","authenticationTypes","DEFAULT_AUTHENTICATION_TYPE","sort","a","b","isPrimary","tabs","getLinksByGroup","modelcatalog","LinkModel","create","modelOptions","_userServices","UserServicesModel","isLoggedIn","userHref","userLink","userMustChangePassword","mustChangePassword","exports"],"sources":["../../../src/models/application/ApplicationModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LinkModel from \"../links/LinkModel\";\nimport UserServicesModel from \"../user/UserServicesModel\";\n\nimport { NotAllowedUriException } from \"../../exceptions\";\n\nimport { DEFAULT_AUTHENTICATION_TYPE } from \"../../constants\";\n\nimport type { ModularUIModel, AuthenticationType } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkCollection from \"../links/LinkCollection\";\nimport type Href from \"../href/Href\";\n\n/**\n * The Application model\n */\nexport default class ApplicationModel extends ResourceModel {\n _userServices: ?UserServicesModel;\n\n /**\n * Retrieve type of model\n */\n get type(): string {\n return \"Application\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ApplicationModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"Application\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const userService = this.links.getLinkByKey(\"UserServices\");\n if (userService && userService.href.path === \"/login\") {\n throw new NotAllowedUriException(\n \"The user service (Login panel) should not have the uri '/login', use a different URI because this uri matches the login service.\",\n );\n }\n\n return userService ? [userService] : [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const userServiceModel = models.find(\n (model) => model.type === \"UserServices\",\n );\n\n if (userServiceModel) {\n this.userServices = userServiceModel;\n }\n }\n\n /**\n * Getting the label of the application\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the authentication types of the application\n */\n get authenticationTypes(): Array<AuthenticationType> {\n const authenticationTypes = this.getContribution(\"security\", [\n DEFAULT_AUTHENTICATION_TYPE,\n ]);\n\n if (authenticationTypes) {\n //put primary first\n return authenticationTypes?.sort(\n (a: AuthenticationType, b: AuthenticationType) =>\n a.isPrimary === b.isPrimary ? 0 : a.isPrimary ? -1 : 1,\n );\n }\n\n return [DEFAULT_AUTHENTICATION_TYPE];\n }\n\n /**\n * Getting the tab links\n */\n get tabs(): LinkCollection {\n return this.links.getLinksByGroup(\"tab\");\n }\n\n /**\n * Get modelcatalog link\n */\n get modelcatalog(): LinkModel {\n return LinkModel.create(\n \"modelcatalog\",\n \"/modelcatalog\",\n \"Model catalog\",\n this.modelOptions,\n );\n }\n\n /**\n * Set the userservices for this application\n */\n set userServices(model: ?ModularUIModel) {\n this._userServices = model instanceof UserServicesModel ? model : null;\n }\n\n /**\n * returns the userservices configured for this application\n */\n get userServices(): ?UserServicesModel {\n return this._userServices ? this._userServices : null;\n }\n\n /**\n * Indicates if the user is logged in\n */\n get isLoggedIn(): boolean {\n return this.userServices?.isLoggedIn ?? false;\n }\n\n /**\n * Retrieve link to the user information,\n * only available when the user services are available\n */\n get userHref(): Href | null {\n if (this.userServices?.userLink) {\n return this.userServices.userLink.href;\n }\n\n return null;\n }\n\n /**\n */\n get userMustChangePassword(): boolean {\n return this.userServices?.mustChangePassword ?? false;\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UA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