@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":"ListModel.js","names":["ModularUIResponse","ListItemCollection","ListDetailModel","ActionCollection","FilterCollection","GroupingModel","ListHeaderModel","ListHref","ListItemModel","PagingModel","ResourceModel","SortingModel","CASEVIEW_LINK","HIDE_WHEN_EMPTY","SHOW_ONE_RESULT_AS_DETAIL","ListModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","layouthint","has","listItemCollection","length","_context2","_mapInstanceProperty","listItem","listDetailLink","selflink","targetModel","setChildModels","models","detail","_findInstanceProperty","childModel","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","createFromList","_detail","_context3","listitemHref","selfhref","listitem","equals","setSelfHref","grouping","_grouping","setGrouping","dynamicschema","contexts","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","actionCollection","isEmpty","filterCollection","hasActiveFilters","getListItemById","id","_context4","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","_context5","paging","_paging","setPaging","sorting","_sorting","setSorting","getSortingLabels","_filterCollection","setFilters","_filterInstanceProperty","listkey","key","filter","isFiltered","_actionCollection","setActionCollection","actions","origin","contextPath","hasList","selfLink","links","getLinkByKey","_selfhref","headers","_headers","setHeaders","tempHeaders","results","_Object$keys","forEach","attributes","attribute","listHeader","exists","some","tempHeader","push","sortingLabels","attributeKey","getActionsByType","actionType","getAdditionalDetailLabel","resultTypes","resultType","link","_links","panel","find","panelLink"],"sources":["../../../src/models/list/ListModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ListItemCollection from \"../list/ListItemCollection\";\nimport ListDetailModel from \"../list/ListDetailModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport GroupingModel from \"../grouping/GroupingModel\";\nimport ListHeaderModel from \"../list/ListHeaderModel\";\nimport ListHref from \"../href/ListHref\";\nimport ListItemModel from \"../list/ListItemModel\";\nimport PagingModel from \"../paging/PagingModel\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport SortingModel from \"../sorting/SortingModel\";\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Defines a list object\n */\nexport default class ListModel extends ResourceModel {\n _detail: ?ListDetailModel = null;\n _headers: Array<ListHeaderModel>;\n _paging: PagingModel;\n _filterCollection: FilterCollection;\n _sorting: SortingModel;\n _actionCollection: ActionCollection;\n _listItemCollection: ListItemCollection;\n _grouping: GroupingModel;\n _selfhref: ListHref;\n\n /**\n */\n get type(): string {\n return \"List\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ListModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype ?? \"\";\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel;\n return listDetailLink;\n });\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.detail = models.find((childModel) => childModel.type === \"ListDetail\");\n }\n\n /**\n * Getting the label of the list\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext(): string {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection(): ListItemCollection {\n if (!this._listItemCollection) {\n this._listItemCollection = ListItemCollection.createFromList(this);\n }\n\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail(): ?ListDetailModel {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ?ModularUIModel) {\n if (detail instanceof ListDetailModel) {\n const listitemHref = detail.selfhref;\n\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(listitemHref),\n );\n\n if (listitem) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n }\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts,\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId,\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href),\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting,\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(this.data.filter, {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n });\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.origin,\n this.contextPath,\n );\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref(): ListHref {\n const selfLink = this.links ? this.links.getLinkByKey(\"self\") : null;\n\n if (selfLink !== null) {\n return new ListHref(selfLink.href, this);\n }\n\n return new ListHref();\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): ListHref {\n if (!this._selfhref) {\n this._selfhref = this.setSelfHref();\n }\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader),\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n\n /**\n * Retrieves the label of the first additional detail link by resource type\n */\n getAdditionalDetailLabel(resourceType: string): string | null {\n const resultTypes = Object.keys(this.contributions.results);\n\n for (const resultType of resultTypes) {\n const link = this.contributions.results[resultType]._links?.panel?.find(\n (panelLink) => panelLink.resourcetype === resourceType,\n );\n if (link) {\n return link.label;\n }\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,eAAe,MAAM,yBAAyB;AACrD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,eAAe,MAAM,yBAAyB;AACrD,OAAOC,QAAQ,MAAM,kBAAkB;AACvC,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,YAAY,MAAM,yBAAyB;AAClD,SACEC,aAAa,EACbC,eAAe,EACfC,yBAAyB,QACpB,6BAA6B;AAKpC;AACA;AACA;AACA,eAAe,MAAMC,SAAS,SAASL,aAAa,CAAC;EAAAM,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBACvB,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA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C,wBAAwBA,CAACzG,YAAoB,EAAiB;IAC5D,MAAM0G,WAAW,GAAGd,YAAA,CAAY,IAAI,CAAC3F,aAAa,CAAC0F,OAAO,CAAC;IAE3D,KAAK,MAAMgB,UAAU,IAAID,WAAW,EAAE;MACpC,MAAME,IAAI,GAAG,IAAI,CAAC3G,aAAa,CAAC0F,OAAO,CAACgB,UAAU,CAAC,CAACE,MAAM,EAAEC,KAAK,EAAEC,IAAI,CACpEC,SAAS,IAAKA,SAAS,CAAC9G,YAAY,KAAKF,YAC5C,CAAC;MACD,IAAI4G,IAAI,EAAE;QACR,OAAOA,IAAI,CAACtF,KAAK;MACnB;IACF;IAEA,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListModel.js","names":["ModularUIResponse","ListItemCollection","ListDetailModel","ActionCollection","FilterCollection","GroupingModel","ListHeaderModel","ListHref","ListItemModel","PagingModel","ResourceModel","SortingModel","CASEVIEW_LINK","HIDE_WHEN_EMPTY","SHOW_ONE_RESULT_AS_DETAIL","ListModel","constructor","arguments","_defineProperty","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","layouthint","has","listItemCollection","length","_context2","_mapInstanceProperty","listItem","listDetailLink","selflink","targetModel","setChildModels","models","detail","_findInstanceProperty","childModel","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","createFromList","_detail","_context3","listitemHref","selfhref","listitem","equals","setSelfHref","grouping","_grouping","setGrouping","dynamicschema","contexts","modelOptions","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","actionCollection","isEmpty","filterCollection","hasActiveFilters","getListItemById","id","_context4","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","_context5","paging","_paging","setPaging","sorting","_sorting","setSorting","getSortingLabels","_filterCollection","setFilters","_filterInstanceProperty","listkey","key","filter","isFiltered","_actionCollection","setActionCollection","actions","hasList","selfLink","links","getLinkByKey","_selfhref","headers","_headers","setHeaders","tempHeaders","results","_Object$keys","forEach","attributes","attribute","listHeader","exists","some","tempHeader","push","sortingLabels","attributeKey","getActionsByType","actionType","getAdditionalDetailLabel","resultTypes","resultType","link","_links","panel","find","panelLink"],"sources":["../../../src/models/list/ListModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ListItemCollection from \"../list/ListItemCollection\";\nimport ListDetailModel from \"../list/ListDetailModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport GroupingModel from \"../grouping/GroupingModel\";\nimport ListHeaderModel from \"../list/ListHeaderModel\";\nimport ListHref from \"../href/ListHref\";\nimport ListItemModel from \"../list/ListItemModel\";\nimport PagingModel from \"../paging/PagingModel\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport SortingModel from \"../sorting/SortingModel\";\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Defines a list object\n */\nexport default class ListModel extends ResourceModel {\n _detail: ?ListDetailModel = null;\n _headers: Array<ListHeaderModel>;\n _paging: PagingModel;\n _filterCollection: FilterCollection;\n _sorting: SortingModel;\n _actionCollection: ActionCollection;\n _listItemCollection: ListItemCollection;\n _grouping: GroupingModel;\n _selfhref: ListHref;\n\n /**\n */\n get type(): string {\n return \"List\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ListModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype ?? \"\";\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel;\n return listDetailLink;\n });\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.detail = models.find((childModel) => childModel.type === \"ListDetail\");\n }\n\n /**\n * Getting the label of the list\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext(): string {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection(): ListItemCollection {\n if (!this._listItemCollection) {\n this._listItemCollection = ListItemCollection.createFromList(this);\n }\n\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail(): ?ListDetailModel {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ?ModularUIModel) {\n if (detail instanceof ListDetailModel) {\n const listitemHref = detail.selfhref;\n\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(listitemHref),\n );\n\n if (listitem) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n }\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts,\n this.modelOptions,\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId,\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href),\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting,\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(\n this.data.filter,\n {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref(): ListHref {\n const selfLink = this.links ? this.links.getLinkByKey(\"self\") : null;\n\n if (selfLink !== null) {\n return new ListHref(selfLink.href, this);\n }\n\n return new ListHref();\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): ListHref {\n if (!this._selfhref) {\n this._selfhref = this.setSelfHref();\n }\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader),\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n\n /**\n * Retrieves the label of the first additional detail link by resource type\n */\n getAdditionalDetailLabel(resourceType: string): string | null {\n const resultTypes = Object.keys(this.contributions.results);\n\n for (const resultType of resultTypes) {\n const link = this.contributions.results[resultType]._links?.panel?.find(\n (panelLink) => panelLink.resourcetype === resourceType,\n );\n if (link) {\n return link.label;\n }\n }\n\n return null;\n }\n}\n"],"mappings":";;;;;;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,eAAe,MAAM,yBAAyB;AACrD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,eAAe,MAAM,yBAAyB;AACrD,OAAOC,QAAQ,MAAM,kBAAkB;AACvC,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,YAAY,MAAM,yBAAyB;AAClD,SACEC,aAAa,EACbC,eAAe,EACfC,yBAAyB,QACpB,6BAA6B;AAKpC;AACA;AACA;AACA,eAAe,MAAMC,SAAS,SAASL,aAAa,CAAC;EAAAM,YAAA;IAAA,SAAAC,SAAA;IAAAC,eAAA,kBACvB,IAAI;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;EAAA;EAUhC;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACC,IAAuB,EAAW;IAAA,IAAAC,QAAA;IACzD,MAAMC,YAAY,GAAGF,IAAI,CAACG,aAAa,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KA,SAAS,CAAC7G,YAAY,KAAKF,YAC5C,CAAC;MACD,IAAI2G,IAAI,EAAE;QACR,OAAOA,IAAI,CAACrF,KAAK;MACnB;IACF;IAEA,OAAO,IAAI;EACb;AACF","ignoreList":[]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import ResourceCollection from "../base/ResourceCollection";
|
|
2
2
|
import ChoiceAttributeOptionModel from "../attributes/ChoiceAttributeOptionModel";
|
|
3
|
-
|
|
3
|
+
import { DateUtil } from "../../utils";
|
|
4
4
|
/**
|
|
5
5
|
*/
|
|
6
6
|
class LookupOptionCollection extends ResourceCollection {
|
|
7
7
|
/**
|
|
8
8
|
*/
|
|
9
|
-
static create(data, contributions) {
|
|
9
|
+
static create(data, contributions, modelOptions) {
|
|
10
10
|
const collection = new LookupOptionCollection();
|
|
11
11
|
if (data.options && contributions.options) {
|
|
12
12
|
data.options.forEach(option => {
|
|
@@ -14,6 +14,9 @@ class LookupOptionCollection extends ResourceCollection {
|
|
|
14
14
|
...option,
|
|
15
15
|
optionType: this.getOptionType(option, contributions),
|
|
16
16
|
elementsContributions: contributions.options[0].elements
|
|
17
|
+
}, {
|
|
18
|
+
...modelOptions,
|
|
19
|
+
referenceDate: DateUtil.now()
|
|
17
20
|
}));
|
|
18
21
|
});
|
|
19
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookupOptionCollection.js","names":["ResourceCollection","ChoiceAttributeOptionModel","LookupOptionCollection","create","data","contributions","collection","options","forEach","option","add","optionType","getOptionType","elementsContributions","elements","_links","download","name"],"sources":["../../../src/models/lookup/LookupOptionCollection.js"],"sourcesContent":["// @flow\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport ChoiceAttributeOptionModel from \"../attributes/ChoiceAttributeOptionModel\";\n\n/**\n */\nclass LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {\n /**\n */\n static create(data: Object
|
|
1
|
+
{"version":3,"file":"LookupOptionCollection.js","names":["ResourceCollection","ChoiceAttributeOptionModel","DateUtil","LookupOptionCollection","create","data","contributions","modelOptions","collection","options","forEach","option","add","optionType","getOptionType","elementsContributions","elements","referenceDate","now","_links","download","name"],"sources":["../../../src/models/lookup/LookupOptionCollection.js"],"sourcesContent":["// @flow\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport ChoiceAttributeOptionModel from \"../attributes/ChoiceAttributeOptionModel\";\nimport { DateUtil } from \"../../utils\";\n\nimport type { ModelOptions } from \"../types\";\n\n/**\n */\nclass LookupOptionCollection extends ResourceCollection<ChoiceAttributeOptionModel> {\n /**\n */\n static create(\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ): LookupOptionCollection {\n const collection = new LookupOptionCollection();\n\n if (data.options && contributions.options) {\n data.options.forEach((option) => {\n collection.add(\n new ChoiceAttributeOptionModel(\n [],\n {\n ...option,\n optionType: this.getOptionType(option, contributions),\n elementsContributions: contributions.options[0].elements,\n },\n { ...modelOptions, referenceDate: DateUtil.now() },\n ),\n );\n });\n }\n\n return collection;\n }\n\n /**\n */\n static getOptionType(option: Object, contributions: Object): string {\n if (contributions.optionType) {\n return contributions.optionType;\n }\n if (option._links?.download?.[0].name === \"avatar\") {\n return \"user\";\n }\n return \"generic\";\n }\n}\n\nexport default LookupOptionCollection;\n"],"mappings":"AACA,OAAOA,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,0BAA0B,MAAM,0CAA0C;AACjF,SAASC,QAAQ,QAAQ,aAAa;AAItC;AACA;AACA,MAAMC,sBAAsB,SAASH,kBAAkB,CAA6B;EAClF;AACF;EACE,OAAOI,MAAMA,CACXC,IAAY,EACZC,aAAqB,EACrBC,YAA2B,EACH;IACxB,MAAMC,UAAU,GAAG,IAAIL,sBAAsB,CAAC,CAAC;IAE/C,IAAIE,IAAI,CAACI,OAAO,IAAIH,aAAa,CAACG,OAAO,EAAE;MACzCJ,IAAI,CAACI,OAAO,CAACC,OAAO,CAAEC,MAAM,IAAK;QAC/BH,UAAU,CAACI,GAAG,CACZ,IAAIX,0BAA0B,CAC5B,EAAE,EACF;UACE,GAAGU,MAAM;UACTE,UAAU,EAAE,IAAI,CAACC,aAAa,CAACH,MAAM,EAAEL,aAAa,CAAC;UACrDS,qBAAqB,EAAET,aAAa,CAACG,OAAO,CAAC,CAAC,CAAC,CAACO;QAClD,CAAC,EACD;UAAE,GAAGT,YAAY;UAAEU,aAAa,EAAEf,QAAQ,CAACgB,GAAG,CAAC;QAAE,CACnD,CACF,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAOV,UAAU;EACnB;;EAEA;AACF;EACE,OAAOM,aAAaA,CAACH,MAAc,EAAEL,aAAqB,EAAU;IAClE,IAAIA,aAAa,CAACO,UAAU,EAAE;MAC5B,OAAOP,aAAa,CAACO,UAAU;IACjC;IACA,IAAIF,MAAM,CAACQ,MAAM,EAAEC,QAAQ,GAAG,CAAC,CAAC,CAACC,IAAI,KAAK,QAAQ,EAAE;MAClD,OAAO,MAAM;IACf;IACA,OAAO,SAAS;EAClB;AACF;AAEA,eAAelB,sBAAsB","ignoreList":[]}
|
|
@@ -12,7 +12,7 @@ export default class LookupOptionsModel extends ResourceModel {
|
|
|
12
12
|
super(modularuiResponse);
|
|
13
13
|
_defineProperty(this, "_options", void 0);
|
|
14
14
|
_defineProperty(this, "_filterCollection", void 0);
|
|
15
|
-
this._options = LookupOptionCollection.create(this.data, this.contributions);
|
|
15
|
+
this._options = LookupOptionCollection.create(this.data, this.contributions, this.modelOptions);
|
|
16
16
|
this._filterCollection = this.createFilterCollection(_filterInstanceProperty(this.data), _filterInstanceProperty(this.contributions));
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -48,7 +48,7 @@ export default class LookupOptionsModel extends ResourceModel {
|
|
|
48
48
|
[data.name]: data
|
|
49
49
|
}, {
|
|
50
50
|
filter: contributions
|
|
51
|
-
});
|
|
51
|
+
}, this.modelOptions);
|
|
52
52
|
}
|
|
53
53
|
return new FilterCollection();
|
|
54
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookupOptionsModel.js","names":["ResourceModel","LookupOptionCollection","FilterCollection","LookupOptionsModel","constructor","modularuiResponse","_defineProperty","_options","create","data","contributions","_filterCollection","createFilterCollection","_filterInstanceProperty","type","modelName","isApplicableModel","resourcetype","options","name","filter","filterCollection"],"sources":["../../../src/models/lookup/LookupOptionsModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LookupOptionCollection from \"../lookup/LookupOptionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n */\nexport default class LookupOptionsModel extends ResourceModel {\n _options: LookupOptionCollection;\n _filterCollection: ?FilterCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions,\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter,\n );\n }\n\n /**\n */\n get type(): string {\n return \"LookupOptions\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"LookupOptionsModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"lookupOptions\"\n );\n }\n\n /**\n */\n get options(): LookupOptionCollection {\n return this._options;\n }\n\n /**\n */\n createFilterCollection(\n data: Object,\n contributions: Object,\n ): FilterCollection {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions },\n );\n }\n\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): ?FilterCollection {\n return this._filterCollection;\n }\n}\n"],"mappings":";;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,sBAAsB,MAAM,kCAAkC;AACrE,OAAOC,gBAAgB,MAAM,6BAA6B;AAI1D;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASH,aAAa,CAAC;EAI5D;AACF;EACEI,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,QAAQ,GAAGN,sBAAsB,CAACO,MAAM,CAC3C,IAAI,CAACC,IAAI,EACT,IAAI,CAACC,
|
|
1
|
+
{"version":3,"file":"LookupOptionsModel.js","names":["ResourceModel","LookupOptionCollection","FilterCollection","LookupOptionsModel","constructor","modularuiResponse","_defineProperty","_options","create","data","contributions","modelOptions","_filterCollection","createFilterCollection","_filterInstanceProperty","type","modelName","isApplicableModel","resourcetype","options","name","filter","filterCollection"],"sources":["../../../src/models/lookup/LookupOptionsModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LookupOptionCollection from \"../lookup/LookupOptionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n */\nexport default class LookupOptionsModel extends ResourceModel {\n _options: LookupOptionCollection;\n _filterCollection: ?FilterCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions,\n this.modelOptions,\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter,\n );\n }\n\n /**\n */\n get type(): string {\n return \"LookupOptions\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"LookupOptionsModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"lookupOptions\"\n );\n }\n\n /**\n */\n get options(): LookupOptionCollection {\n return this._options;\n }\n\n /**\n */\n createFilterCollection(\n data: Object,\n contributions: Object,\n ): FilterCollection {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions },\n this.modelOptions,\n );\n }\n\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): ?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gBAAgB,CAAC,CAAC;EAC/B;;EAEA;AACF;AACA;EACE,IAAIoB,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAACV,iBAAiB;EAC/B;AACF","ignoreList":[]}
|
|
@@ -100,7 +100,7 @@ export default class GroupingPanelModel extends ResourceModel {
|
|
|
100
100
|
const allTaskgroupsContributions = this.getContribution("taskgroups", []);
|
|
101
101
|
this.taskGroupCollection = _mapInstanceProperty(_context2 = _filterInstanceProperty(allTaskgroupsData).call(allTaskgroupsData, taskgroup => allTaskgroupsContributions.some(taskgroupContribution => taskgroupContribution.name === taskgroup.name))).call(_context2, taskgroup => {
|
|
102
102
|
const taskgroupContributions = _findInstanceProperty(allTaskgroupsContributions).call(allTaskgroupsContributions, taskgroupContribution => taskgroupContribution.name === taskgroup.name);
|
|
103
|
-
return TaskGroupModel.create(taskgroup.name, taskgroup, taskgroupContributions, this.
|
|
103
|
+
return TaskGroupModel.create(taskgroup.name, taskgroup, taskgroupContributions, this.modelOptions);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingPanelModel.js","names":["ResourceModel","TaskGroupCollection","TaskGroupModel","GroupingPanelModel","constructor","modularuiResponse","_defineProperty","createTaskGroupCollection","type","modelName","isApplicableModel","data","_context","contributions","resourcetype","_includesInstanceProperty","call","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","_context2","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","_mapInstanceProperty","_filterInstanceProperty","taskgroup","some","taskgroupContribution","name","taskgroupContributions","_findInstanceProperty","create","
|
|
1
|
+
{"version":3,"file":"GroupingPanelModel.js","names":["ResourceModel","TaskGroupCollection","TaskGroupModel","GroupingPanelModel","constructor","modularuiResponse","_defineProperty","createTaskGroupCollection","type","modelName","isApplicableModel","data","_context","contributions","resourcetype","_includesInstanceProperty","call","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","_context2","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","_mapInstanceProperty","_filterInstanceProperty","taskgroup","some","taskgroupContribution","name","taskgroupContributions","_findInstanceProperty","create","modelOptions","taskgroups","_taskGroupCollection","hasTaskGroups","hasItems","hasTasks"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"GroupingPanelModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype,\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n ),\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n this.modelOptions,\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":";;;;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,mBAAmB,MAAM,kCAAkC;AAElE,OAAOC,cAAc,MAAM,6BAA6B;AAOxD;AACA;A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A1B,IAAA,CAA1B0B,0BAA0B,EACtDM,qBAAqB,IACpBA,qBAAqB,CAACC,IAAI,KAAKH,SAAS,CAACG,IAC7C,CAAC;MAED,OAAO/C,cAAc,CAACkD,MAAM,CAC1BN,SAAS,CAACG,IAAI,EACdH,SAAS,EACTI,sBAAsB,EACtB,IAAI,CAACG,YACP,CAAC;IACH,CAAC,CAAC;EACN;;EAEA;AACF;AACA;EACE,IAAIxB,mBAAmBA,CAACyB,UAAiC,EAAE;IACzD,IAAI,CAACC,oBAAoB,GAAG,IAAItD,mBAAmB,CAACqD,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAIzB,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAAC0B,oBAAoB;EAClC;;EAEA;AACF;AACA;EACEC,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAAC3B,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,CAAC4B,QAAQ;EACtE;;EAEA;AACF;AACA;EACEC,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAAC7B,mBAAmB,CAAC6B,QAAQ,CAAC,CAAC;EAC5C;AACF","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@ export default class TabModel extends ResourceModel {
|
|
|
18
18
|
_defineProperty(this, "_actionCollection", void 0);
|
|
19
19
|
_defineProperty(this, "_taskGroupCollection", void 0);
|
|
20
20
|
this.createTaskGroupCollection();
|
|
21
|
-
this._actionCollection = new ActionCollection(this.data.actions, this.contributions.actions, this.
|
|
21
|
+
this._actionCollection = new ActionCollection(this.data.actions, this.contributions.actions, this.modelOptions);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -72,7 +72,7 @@ export default class TabModel extends ResourceModel {
|
|
|
72
72
|
var _context5;
|
|
73
73
|
const taskgroupContributions = _findInstanceProperty(_context5 = this.contributions.taskgroups).call(_context5, taskgroupContribution => taskgroupContribution.name === taskgroup.name);
|
|
74
74
|
if (taskgroupContributions) {
|
|
75
|
-
return TaskGroupModel.create(taskgroup.name, taskgroup, taskgroupContributions, this.
|
|
75
|
+
return TaskGroupModel.create(taskgroup.name, taskgroup, taskgroupContributions, this.modelOptions);
|
|
76
76
|
}
|
|
77
77
|
return null;
|
|
78
78
|
})).call(_context3, taskgroup => taskgroup != null) : [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabModel.js","names":["TaskGroupCollection","ResourceModel","TaskGroupModel","ActionCollection","TabModel","constructor","modularuiResponse","_defineProperty","createTaskGroupCollection","_actionCollection","data","actions","contributions","
|
|
1
|
+
{"version":3,"file":"TabModel.js","names":["TaskGroupCollection","ResourceModel","TaskGroupModel","ActionCollection","TabModel","constructor","modularuiResponse","_defineProperty","createTaskGroupCollection","_actionCollection","data","actions","contributions","modelOptions","type","modelName","isApplicableModel","_context","_context2","resourcetype","_endsWithInstanceProperty","call","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","push","taskGroupCollection","add","searchLink","first","_context3","_context4","taskgroups","_filterInstanceProperty","_mapInstanceProperty","taskgroup","_context5","taskgroupContributions","_findInstanceProperty","taskgroupContribution","name","create","_taskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name,\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions,\n this.modelOptions,\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;AACA,OAAOA,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,gBAAgB,MAAM,6BAA6B;AAO1D;AACA;AACA;AACA,eAAe,MAAMC,QAAQ,SAASH,aAAa,CAAC;EAIlD;AACF;EACEI,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,yBAAyB,CAAC,CAAC;IAEhC,IAAI,CAACC,iBAAiB,GAAG,IAAIN,gBAAgB,CAC3C,IAAI,CAACO,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,EAC1B,IAAI,CAACE,YACP,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,UAAU;EACnB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACN,IAAuB,EAAW;IAAA,IAAAO,QAAA,EAAAC,SAAA;IACzD,OACER,IAAI,CAACE,aAAa,CAACO,YAAY,KAC9BC,yBAAA,CAAAH,QAAA,GAAAP,IAAI,CAACE,aAAa,CAACO,YAAY,EAAAE,IAAA,CAAAJ,QAAA,EAAU,KAAK,CAAC,IAC9CG,yBAAA,CAAAF,SAAA,GAAAR,IAAI,CAACE,aAAa,CAACO,YAAY,EAAAE,IAAA,CAAAH,SA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CAACK,IAAI,EACdL,SAAS,EACTE,sBAAsB,EACtB,IAAI,CAAC9B,YACP,CAAC;MACH;MAEA,OAAO,IAAI;IACb,CAAC,CAAC,EAAAQ,IAAA,CAAAe,SAAA,EACOK,SAAS,IAAKA,SAAS,IAAI,IAAI,CAAC,GAC3C,EAAE;EACR;;EAEA;AACF;AACA;EACE,IAAIT,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACgB,oBAAoB;EAClC;;EAEA;AACF;AACA;EACE,IAAIhB,mBAAmBA,CAACM,UAAiC,EAAE;IACzD,IAAI,CAACU,oBAAoB,GAAG,IAAIhD,mBAAmB,CAACsC,UAAU,CAAC;EACjE;;EAEA;AACF;AACA;EACE,IAAIW,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,UAAUA,CAAA,EAAmB;IAC/B,OAAO,IAAI,CAAC5B,KAAK,CAACC,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC;EAC1D;;EAEA;AACF;EACE,IAAI4B,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAAC3C,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE4C,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACF,UAAU,CAACG,IAAI,GAAG,CAAC;EACjC;;EAEA;AACF;AACA;EACEC,aAAaA,CAAA,EAAY;IACvB,OAAO,IAAI,CAACvB,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,EAAEwB,QAAQ;EACvE;;EAEA;AACF;EACEC,UAAUA,CAAA,EAAY;IACpB,OAAO,IAAI,CAACL,gBAAgB,IAAI,IAAI,CAACA,gBAAgB,CAACI,QAAQ;EAChE;AACF","ignoreList":[]}
|
|
@@ -2,7 +2,6 @@ import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
|
2
2
|
import ActionCollection from "../actions/ActionCollection";
|
|
3
3
|
import ResourceModel from "../base/ResourceModel";
|
|
4
4
|
import ModularUIResponse from "../../modularui/ModularUIResponse";
|
|
5
|
-
|
|
6
5
|
/**
|
|
7
6
|
* TaskGroupModel
|
|
8
7
|
*/
|
|
@@ -13,20 +12,20 @@ export default class TaskGroupModel extends ResourceModel {
|
|
|
13
12
|
super(modularuiResponse);
|
|
14
13
|
_defineProperty(this, "_key", void 0);
|
|
15
14
|
_defineProperty(this, "_actionCollection", void 0);
|
|
16
|
-
this._actionCollection = new ActionCollection(this.data.actions, this.contributions.actions, this.
|
|
15
|
+
this._actionCollection = new ActionCollection(this.data.actions, this.contributions.actions, this.modelOptions);
|
|
17
16
|
const selfHref = this.links.getLinkByKey("self") ? this.selflink.href.href : null;
|
|
18
17
|
this._key = selfHref ? selfHref.substring(selfHref.lastIndexOf("/") + 1) : this.data.name;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
20
|
/**
|
|
22
21
|
*/
|
|
23
|
-
static create(key, data, contributions,
|
|
22
|
+
static create(key, data, contributions, modelOptions) {
|
|
24
23
|
const taskgroup = new ModularUIResponse();
|
|
25
24
|
taskgroup.key = key;
|
|
26
25
|
taskgroup.data = data;
|
|
27
26
|
taskgroup.contributions = contributions;
|
|
28
|
-
taskgroup.origin = origin;
|
|
29
|
-
taskgroup.contextPath = contextPath;
|
|
27
|
+
taskgroup.origin = modelOptions?.origin;
|
|
28
|
+
taskgroup.contextPath = modelOptions?.contextPath;
|
|
30
29
|
return new TaskGroupModel(taskgroup);
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGroupModel.js","names":["ActionCollection","ResourceModel","ModularUIResponse","TaskGroupModel","constructor","modularuiResponse","_defineProperty","_actionCollection","data","actions","contributions","
|
|
1
|
+
{"version":3,"file":"TaskGroupModel.js","names":["ActionCollection","ResourceModel","ModularUIResponse","TaskGroupModel","constructor","modularuiResponse","_defineProperty","_actionCollection","data","actions","contributions","modelOptions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","origin","contextPath","type","modelName","isApplicableModel","resourcetype","label","actionCollection","hasTasks","length"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\nimport type { ModelOptions } from \"../types\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object,\n modelOptions?: ModelOptions,\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n taskgroup.origin = modelOptions?.origin;\n taskgroup.contextPath = modelOptions?.contextPath;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Indicates if taskgroup has tasks\n * @returns {boolean}\n */\n hasTasks(): boolean {\n return this.actionCollection.length > 0;\n }\n}\n"],"mappings":";AACA,OAAOA,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,OAAOC,iBAAiB,MAAM,mCAAmC;AAGjE;AACA;AACA;AACA,eAAe,MAAMC,cAAc,SAASF,aAAa,CAAC;EAIxD;AACF;EACEG,WAAWA,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAACC,eAAA;IAAAA,eAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIP,gBAAgB,CAC3C,IAAI,CAACQ,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,EAC1B,IAAI,CAACE,YACP,CAAC;IAED,MAAMC,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACX,IAAI,CAACY,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAMA,CACXC,GAAW,EACXd,IAAY,EACZE,aAAqB,EACrBC,YAA2B,EACX;IAChB,MAAMY,SAAS,GAAG,IAAIrB,iBAAiB,CAAC,CAAC;IACzCqB,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACf,IAAI,GAAGA,IAAI;IACrBe,SAAS,CAACb,aAAa,GAAGA,aAAa;IACvCa,SAAS,CAACC,MAAM,GAAGb,YAAY,EAAEa,MAAM;IACvCD,SAAS,CAACE,WAAW,GAAGd,YAAY,EAAEc,WAAW;IAEjD,OAAO,IAAItB,cAAc,CAACoB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIG,IAAIA,CAAA,EAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAASA,CAAA,EAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiBA,CAACpB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACmB,YAAY,IAC/BrB,IAAI,CAACE,aAAa,CAACmB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIP,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIa,KAAKA,CAAA,EAAW;IAClB,OAAO,IAAI,CAACpB,aAAa,CAACoB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAqB;IACvC,OAAO,IAAI,CAACxB,iBAAiB;EAC/B;;EAEA;AACF;AACA;AACA;EACEyB,QAAQA,CAAA,EAAY;IAClB,OAAO,IAAI,CAACD,gBAAgB,CAACE,MAAM,GAAG,CAAC;EACzC;AACF","ignoreList":[]}
|
package/esm/models/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -19,7 +19,10 @@ export default class UserProfileModel extends UserModel {
|
|
|
19
19
|
const [key] = _Object$keys(contribution);
|
|
20
20
|
return key !== "sessiondata" && has(this.data, key);
|
|
21
21
|
}) : [];
|
|
22
|
-
this._attributeCollection = new AttributeCollection(this.data, attributeContributions
|
|
22
|
+
this._attributeCollection = new AttributeCollection(this.data, attributeContributions, {
|
|
23
|
+
...this.modelOptions,
|
|
24
|
+
isReadonly: true
|
|
25
|
+
});
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserProfileModel.js","names":["has","AttributeCollection","UserModel","UserProfileModel","constructor","modularuiResponse","_context","_defineProperty","attributeContributions","contributions","attributes","_filterInstanceProperty","call","contribution","key","_Object$keys","data","_attributeCollection","type","attributeCollection","modelName"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,mBAAmB,MAAM,mCAAmC;AAEnE,OAAOC,SAAS,MAAM,aAAa;AAInC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAGtD;AACF;AACA;EACEE,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAACE,eAAA;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxDC,uBAAA,CAAAL,QAAA,OAAI,CAACG,aAAa,CAACC,UAAU,EAAAE,IAAA,CAAAN,QAAA,EAASO,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAGC,YAAA,CAAYF,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAId,GAAG,CAAC,IAAI,CAACgB,IAAI,EAAEF,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACG,oBAAoB,GAAG,IAAIhB,mBAAmB,CACjD,IAAI,CAACe,IAAI,EACTR,
|
|
1
|
+
{"version":3,"file":"UserProfileModel.js","names":["has","AttributeCollection","UserModel","UserProfileModel","constructor","modularuiResponse","_context","_defineProperty","attributeContributions","contributions","attributes","_filterInstanceProperty","call","contribution","key","_Object$keys","data","_attributeCollection","modelOptions","isReadonly","type","attributeCollection","modelName"],"sources":["../../../src/models/user/UserProfileModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport AttributeCollection from \"../attributes/AttributeCollection\";\n\nimport UserModel from \"./UserModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserProfileModel extends UserModel {\n _attributeCollection: AttributeCollection;\n\n /**\n * constructor\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return key !== \"sessiondata\" && has(this.data, key);\n })\n : [];\n\n this._attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n { ...this.modelOptions, isReadonly: true },\n );\n }\n\n /**\n */\n get type(): string {\n return \"UserProfile\";\n }\n\n /**\n * returns all the attributes from the attribute collection\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserProfileModel\";\n }\n}\n"],"mappings":";;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,mBAAmB,MAAM,mCAAmC;AAEnE,OAAOC,SAAS,MAAM,aAAa;AAInC;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,SAAS,CAAC;EAGtD;AACF;AACA;EACEE,WAAWA,CAACC,iBAAoC,EAAE;IAAA,IAAAC,QAAA;IAChD,KAAK,CAACD,iBAAiB,CAAC;IAACE,eAAA;IAEzB,MAAMC,sBAAsB,GAAG,IAAI,CAACC,aAAa,CAACC,UAAU,GACxDC,uBAAA,CAAAL,QAAA,OAAI,CAACG,aAAa,CAACC,UAAU,EAAAE,IAAA,CAAAN,QAAA,EAASO,YAAY,IAAK;MACrD,MAAM,CAACC,GAAG,CAAC,GAAGC,YAAA,CAAYF,YAAY,CAAC;MACvC,OAAOC,GAAG,KAAK,aAAa,IAAId,GAAG,CAAC,IAAI,CAACgB,IAAI,EAAEF,GAAG,CAAC;IACrD,CAAC,CAAC,GACF,EAAE;IAEN,IAAI,CAACG,oBAAoB,GAAG,IAAIhB,mBAAmB,CACjD,IAAI,CAACe,IAAI,EACTR,sBAAsB,EACtB;MAAE,GAAG,IAAI,CAACU,YAAY;MAAEC,UAAU,EAAE;IAAK,CAC3C,CAAC;EACH;;EAEA;AACF;EACE,IAAIC,IAAIA,CAAA,EAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmBA,CAAA,EAAwB;IAC7C,OAAO,IAAI,CAACJ,oBAAoB;EAClC;;EAEA;AACF;EACE,WAAWK,SAASA,CAAA,EAAW;IAC7B,OAAO,kBAAkB;EAC3B;AACF","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime-corejs3/helpers/esm/defineProperty";
|
|
2
2
|
import xhr from "../utils/fetch/xhr";
|
|
3
|
-
import {
|
|
3
|
+
import { getBasePathModularUI, getCaptchaPath, HTTP_METHODS } from "../constants";
|
|
4
4
|
/**
|
|
5
5
|
*/
|
|
6
6
|
class CaptchaRequest {
|
|
@@ -8,13 +8,13 @@ class CaptchaRequest {
|
|
|
8
8
|
_defineProperty(this, "_tokenId", void 0);
|
|
9
9
|
_defineProperty(this, "_image", void 0);
|
|
10
10
|
_defineProperty(this, "_origin", "");
|
|
11
|
-
_defineProperty(this, "_contextPath",
|
|
11
|
+
_defineProperty(this, "_contextPath", getBasePathModularUI());
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
*/
|
|
15
15
|
CaptchaRequest(options) {
|
|
16
16
|
this._origin = options?.origin || "";
|
|
17
|
-
this._contextPath = options?.contextPath ||
|
|
17
|
+
this._contextPath = options?.contextPath || getBasePathModularUI();
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaptchaRequest.js","names":["xhr","
|
|
1
|
+
{"version":3,"file":"CaptchaRequest.js","names":["xhr","getBasePathModularUI","getCaptchaPath","HTTP_METHODS","CaptchaRequest","constructor","_defineProperty","options","_origin","origin","_contextPath","contextPath","captchaResponse","response","_tokenId","tokenId","_image","image","valid","error","init","url","then","send","answer","method","POST","data","catch","refresh"],"sources":["../../src/modularui/CaptchaRequest.js"],"sourcesContent":["// @flow\nimport xhr from \"../utils/fetch/xhr\";\nimport {\n getBasePathModularUI,\n getCaptchaPath,\n HTTP_METHODS,\n} from \"../constants\";\n\ntype CaptchaInitialResponse = {\n tokenId: string,\n image: string,\n};\n\ntype CaptchaValidResponse = {\n valid: boolean,\n};\n\ntype CaptchaInvalidResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string },\n};\n\ntype CaptchaResponse = {\n tokenId: string,\n image: string,\n valid: boolean,\n error: { id: string } | null,\n};\n\ntype CaptchaRequestOptions = {\n origin?: string,\n contextPath?: string,\n};\n\n/**\n */\nclass CaptchaRequest {\n _tokenId: string;\n _image: string;\n _origin: string = \"\";\n _contextPath: string = getBasePathModularUI();\n\n /**\n */\n CaptchaRequest(options?: CaptchaRequestOptions) {\n this._origin = options?.origin || \"\";\n this._contextPath = options?.contextPath || getBasePathModularUI();\n }\n\n /**\n */\n captchaResponse(\n response:\n | CaptchaInitialResponse\n | CaptchaValidResponse\n | CaptchaInvalidResponse,\n ): CaptchaResponse {\n this._tokenId = response.tokenId ?? this._tokenId;\n this._image = response.image ?? this._image;\n\n return {\n tokenId: this._tokenId,\n image: this._image,\n valid: response.valid ?? false,\n error: response.error ?? null,\n };\n }\n\n /**\n * Initiate the captcha request\n */\n init(): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(this._contextPath, this._origin),\n }).then((response) => this.captchaResponse(response));\n }\n\n /**\n * Answer the captcha\n */\n send(answer?: string): Promise<CaptchaResponse> {\n return xhr({\n url: getCaptchaPath(this._contextPath, this._origin),\n method: HTTP_METHODS.POST,\n data: {\n tokenId: this._tokenId ?? \"\",\n answer: answer ?? \"\",\n },\n })\n .then((response) => this.captchaResponse(response))\n .catch((error) => this.captchaResponse(error.response));\n }\n\n /**\n * Reset the captcha and receive a new token and image\n */\n refresh(): Promise<CaptchaResponse> {\n return this.init();\n }\n}\n\nexport default CaptchaRequest;\n"],"mappings":";AACA,OAAOA,GAAG,MAAM,oBAAoB;AACpC,SACEC,oBAAoB,EACpBC,cAAc,EACdC,YAAY,QACP,cAAc;AA8BrB;AACA;AACA,MAAMC,cAAc,CAAC;EAAAC,YAAA;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA,kBAGD,EAAE;IAAAA,eAAA,uBACGL,oBAAoB,CAAC,CAAC;EAAA;EAE7C;AACF;EACEG,cAAcA,CAACG,OAA+B,EAAE;IAC9C,IAAI,CAACC,OAAO,GAAGD,OAAO,EAAEE,MAAM,IAAI,EAAE;IACpC,IAAI,CAACC,YAAY,GAAGH,OAAO,EAAEI,WAAW,IAAIV,oBAAoB,CAAC,CAAC;EACpE;;EAEA;AACF;EACEW,eAAeA,CACbC,QAG0B,EACT;IACjB,IAAI,CAACC,QAAQ,GAAGD,QAAQ,CAACE,OAAO,IAAI,IAAI,CAACD,QAAQ;IACjD,IAAI,CAACE,MAAM,GAAGH,QAAQ,CAACI,KAAK,IAAI,IAAI,CAACD,MAAM;IAE3C,OAAO;MACLD,OAAO,EAAE,IAAI,CAACD,QAAQ;MACtBG,KAAK,EAAE,IAAI,CAACD,MAAM;MAClBE,KAAK,EAAEL,QAAQ,CAACK,KAAK,IAAI,KAAK;MAC9BC,KAAK,EAAEN,QAAQ,CAACM,KAAK,IAAI;IAC3B,CAAC;EACH;;EAEA;AACF;AACA;EACEC,IAAIA,CAAA,EAA6B;IAC/B,OAAOpB,GAAG,CAAC;MACTqB,GAAG,EAAEnB,cAAc,CAAC,IAAI,CAACQ,YAAY,EAAE,IAAI,CAACF,OAAO;IACrD,CAAC,CAAC,CAACc,IAAI,CAAET,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC;EACvD;;EAEA;AACF;AACA;EACEU,IAAIA,CAACC,MAAe,EAA4B;IAC9C,OAAOxB,GAAG,CAAC;MACTqB,GAAG,EAAEnB,cAAc,CAAC,IAAI,CAACQ,YAAY,EAAE,IAAI,CAACF,OAAO,CAAC;MACpDiB,MAAM,EAAEtB,YAAY,CAACuB,IAAI;MACzBC,IAAI,EAAE;QACJZ,OAAO,EAAE,IAAI,CAACD,QAAQ,IAAI,EAAE;QAC5BU,MAAM,EAAEA,MAAM,IAAI;MACpB;IACF,CAAC,CAAC,CACCF,IAAI,CAAET,QAAQ,IAAK,IAAI,CAACD,eAAe,CAACC,QAAQ,CAAC,CAAC,CAClDe,KAAK,CAAET,KAAK,IAAK,IAAI,CAACP,eAAe,CAACO,KAAK,CAACN,QAAQ,CAAC,CAAC;EAC3D;;EAEA;AACF;AACA;EACEgB,OAAOA,CAAA,EAA6B;IAClC,OAAO,IAAI,CAACT,IAAI,CAAC,CAAC;EACpB;AACF;AAEA,eAAehB,cAAc","ignoreList":[]}
|
|
@@ -9,7 +9,7 @@ import _includesInstanceProperty from "@babel/runtime-corejs3/core-js-stable/ins
|
|
|
9
9
|
import deepmerge from "deepmerge";
|
|
10
10
|
import { HTTP_METHODS, TIMEVERSION_FILTER_NAME } from "../constants/Constants";
|
|
11
11
|
import { HIDE_WHEN_EMPTY } from "../constants/LayoutHints";
|
|
12
|
-
import {
|
|
12
|
+
import { getBasePathModularUI, getSetting } from "../constants/Settings";
|
|
13
13
|
import Href from "../models/href/Href";
|
|
14
14
|
import universalFetch from "../utils/fetch/universalFetch";
|
|
15
15
|
import resolveModel from "../models/resolveModel";
|
|
@@ -39,7 +39,7 @@ class ModularUIRequest {
|
|
|
39
39
|
_defineProperty(this, "_method", HTTP_METHODS.GET);
|
|
40
40
|
_defineProperty(this, "_progressEvent", void 0);
|
|
41
41
|
_defineProperty(this, "_origin", "");
|
|
42
|
-
_defineProperty(this, "_contextPath",
|
|
42
|
+
_defineProperty(this, "_contextPath", getBasePathModularUI());
|
|
43
43
|
if (!href) {
|
|
44
44
|
throw new IllegalArgumentException("You must pass a href to the resource that is requested");
|
|
45
45
|
}
|
|
@@ -93,8 +93,8 @@ class ModularUIRequest {
|
|
|
93
93
|
/**
|
|
94
94
|
*/
|
|
95
95
|
set contextPath(contextPath) {
|
|
96
|
-
this._contextPath = contextPath ??
|
|
97
|
-
this._response.contextPath = contextPath ??
|
|
96
|
+
this._contextPath = contextPath ?? getBasePathModularUI();
|
|
97
|
+
this._response.contextPath = contextPath ?? getBasePathModularUI();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
@@ -590,7 +590,10 @@ class ModularUIRequest {
|
|
|
590
590
|
// eslint-disable-next-line no-console
|
|
591
591
|
console.debug("Unexpected error when retrieving child model:", reason);
|
|
592
592
|
}
|
|
593
|
-
errorChildModels.push(new ErrorResponse(reason, "",
|
|
593
|
+
errorChildModels.push(new ErrorResponse(reason, "", {
|
|
594
|
+
origin: this.origin,
|
|
595
|
+
contextPath: this.contextPath
|
|
596
|
+
}));
|
|
594
597
|
} else {
|
|
595
598
|
resolvedChildModels.push(childModel.value);
|
|
596
599
|
}
|