@beinformed/ui 1.25.2 → 1.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/esm/constants/Constants.js +5 -0
- package/esm/constants/Constants.js.map +1 -1
- package/esm/hooks/useAuthentication.js +5 -5
- package/esm/hooks/useAuthentication.js.map +1 -1
- package/esm/hooks/useModularUI.js.map +1 -1
- package/esm/hooks/useModularUIBasic.js +3 -0
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +7 -0
- package/esm/hooks/useModularUIModel.js.map +1 -1
- package/esm/hooks/useModularUIRequest.js +5 -7
- package/esm/hooks/useModularUIRequest.js.map +1 -1
- package/esm/models/application/ApplicationModel.js +9 -1
- package/esm/models/application/ApplicationModel.js.map +1 -1
- package/esm/models/base/ResourceModel.js +7 -0
- package/esm/models/base/ResourceModel.js.map +1 -1
- package/esm/models/caseview/CaseViewModel.js +6 -0
- package/esm/models/caseview/CaseViewModel.js.map +1 -1
- package/esm/models/concepts/BusinessScenarioModel.js +6 -0
- package/esm/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/esm/models/concepts/ConceptDetailModel.js +6 -0
- package/esm/models/concepts/ConceptDetailModel.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +6 -0
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/concepts/ConceptTypeDetailModel.js +6 -0
- package/esm/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +6 -0
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +6 -0
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +6 -0
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/content/ContentTypeModel.js +6 -0
- package/esm/models/content/ContentTypeModel.js.map +1 -1
- package/esm/models/detail/DetailModel.js +6 -0
- package/esm/models/detail/DetailModel.js.map +1 -1
- package/esm/models/form/FormModel.js +6 -0
- package/esm/models/form/FormModel.js.map +1 -1
- package/esm/models/list/ListDetailModel.js +6 -0
- package/esm/models/list/ListDetailModel.js.map +1 -1
- package/esm/models/list/ListModel.js +6 -0
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/lookup/LookupOptionsModel.js +6 -0
- package/esm/models/lookup/LookupOptionsModel.js.map +1 -1
- package/esm/models/modelcatalog/ModelCatalogModel.js +6 -0
- package/esm/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/esm/models/panels/GroupingPanelModel.js +6 -0
- package/esm/models/panels/GroupingPanelModel.js.map +1 -1
- package/esm/models/resolveModel.js +4 -4
- package/esm/models/resolveModel.js.map +1 -1
- package/esm/models/search/CaseSearchModel.js +6 -0
- package/esm/models/search/CaseSearchModel.js.map +1 -1
- package/esm/models/tab/TabModel.js +6 -0
- package/esm/models/tab/TabModel.js.map +1 -1
- package/esm/models/taskgroup/TaskGroupModel.js +6 -0
- package/esm/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/esm/models/types.js.map +1 -1
- package/esm/models/user/UserModel.js +6 -0
- package/esm/models/user/UserModel.js.map +1 -1
- package/esm/models/user/UserProfileModel.js +6 -0
- package/esm/models/user/UserProfileModel.js.map +1 -1
- package/esm/models/user/UserServicesModel.js +6 -0
- package/esm/models/user/UserServicesModel.js.map +1 -1
- package/esm/modularui/ModularUIRequest.js +38 -11
- package/esm/modularui/ModularUIRequest.js.map +1 -1
- package/esm/modularui/types.js +2 -0
- package/esm/modularui/types.js.map +1 -0
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/esm/redux/_modularui/types.js.map +1 -1
- package/esm/redux/_modularui/withModularUI.js.map +1 -1
- package/esm/utils/fetch/types.js.map +1 -1
- package/lib/constants/Constants.js +7 -1
- package/lib/constants/Constants.js.flow +6 -0
- package/lib/constants/Constants.js.map +1 -1
- package/lib/hooks/__tests__/UseModularUIModel.spec.js.flow +1 -1
- package/lib/hooks/__tests__/useModelCatalog.spec.js.flow +1 -1
- package/lib/hooks/__tests__/useModularUIBasic.spec.js.flow +2 -2
- package/lib/hooks/useAuthentication.js +4 -4
- package/lib/hooks/useAuthentication.js.flow +17 -5
- package/lib/hooks/useAuthentication.js.map +1 -1
- package/lib/hooks/useModularUI.js.flow +2 -2
- package/lib/hooks/useModularUI.js.map +1 -1
- package/lib/hooks/useModularUIBasic.js +3 -0
- package/lib/hooks/useModularUIBasic.js.flow +6 -3
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +9 -1
- package/lib/hooks/useModularUIModel.js.flow +18 -10
- package/lib/hooks/useModularUIModel.js.map +1 -1
- package/lib/hooks/useModularUIRequest.js +5 -7
- package/lib/hooks/useModularUIRequest.js.flow +12 -11
- package/lib/hooks/useModularUIRequest.js.map +1 -1
- package/lib/models/application/ApplicationModel.js +8 -1
- package/lib/models/application/ApplicationModel.js.flow +10 -1
- package/lib/models/application/ApplicationModel.js.map +1 -1
- package/lib/models/base/ResourceModel.js +7 -0
- package/lib/models/base/ResourceModel.js.flow +7 -0
- package/lib/models/base/ResourceModel.js.map +1 -1
- package/lib/models/caseview/CaseViewModel.js +6 -0
- package/lib/models/caseview/CaseViewModel.js.flow +6 -0
- package/lib/models/caseview/CaseViewModel.js.map +1 -1
- package/lib/models/concepts/BusinessScenarioModel.js +6 -0
- package/lib/models/concepts/BusinessScenarioModel.js.flow +6 -0
- package/lib/models/concepts/BusinessScenarioModel.js.map +1 -1
- package/lib/models/concepts/ConceptDetailModel.js +6 -0
- package/lib/models/concepts/ConceptDetailModel.js.flow +6 -0
- package/lib/models/concepts/ConceptDetailModel.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +6 -0
- package/lib/models/concepts/ConceptIndexModel.js.flow +6 -0
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/concepts/ConceptTypeDetailModel.js +6 -0
- package/lib/models/concepts/ConceptTypeDetailModel.js.flow +6 -0
- package/lib/models/concepts/ConceptTypeDetailModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +6 -0
- package/lib/models/content/ContentIndexModel.js.flow +6 -0
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +6 -0
- package/lib/models/content/ContentModel.js.flow +6 -0
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +6 -0
- package/lib/models/content/ContentTOCModel.js.flow +6 -0
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/content/ContentTypeModel.js +6 -0
- package/lib/models/content/ContentTypeModel.js.flow +6 -0
- package/lib/models/content/ContentTypeModel.js.map +1 -1
- package/lib/models/detail/DetailModel.js +6 -0
- package/lib/models/detail/DetailModel.js.flow +6 -0
- package/lib/models/detail/DetailModel.js.map +1 -1
- package/lib/models/form/FormModel.js +6 -0
- package/lib/models/form/FormModel.js.flow +6 -0
- package/lib/models/form/FormModel.js.map +1 -1
- package/lib/models/list/ListDetailModel.js +6 -0
- package/lib/models/list/ListDetailModel.js.flow +6 -0
- package/lib/models/list/ListDetailModel.js.map +1 -1
- package/lib/models/list/ListModel.js +6 -0
- package/lib/models/list/ListModel.js.flow +6 -0
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/lookup/LookupOptionsModel.js +6 -0
- package/lib/models/lookup/LookupOptionsModel.js.flow +6 -0
- package/lib/models/lookup/LookupOptionsModel.js.map +1 -1
- package/lib/models/modelcatalog/ModelCatalogModel.js +6 -0
- package/lib/models/modelcatalog/ModelCatalogModel.js.flow +6 -0
- package/lib/models/modelcatalog/ModelCatalogModel.js.map +1 -1
- package/lib/models/panels/GroupingPanelModel.js +6 -0
- package/lib/models/panels/GroupingPanelModel.js.flow +6 -0
- package/lib/models/panels/GroupingPanelModel.js.map +1 -1
- package/lib/models/resolveModel.js +4 -3
- package/lib/models/resolveModel.js.flow +6 -4
- package/lib/models/resolveModel.js.map +1 -1
- package/lib/models/search/CaseSearchModel.js +6 -0
- package/lib/models/search/CaseSearchModel.js.flow +6 -0
- package/lib/models/search/CaseSearchModel.js.map +1 -1
- package/lib/models/tab/TabModel.js +6 -0
- package/lib/models/tab/TabModel.js.flow +6 -0
- package/lib/models/tab/TabModel.js.map +1 -1
- package/lib/models/taskgroup/TaskGroupModel.js +6 -0
- package/lib/models/taskgroup/TaskGroupModel.js.flow +6 -0
- package/lib/models/taskgroup/TaskGroupModel.js.map +1 -1
- package/lib/models/types.js.flow +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/models/user/UserModel.js +6 -0
- package/lib/models/user/UserModel.js.flow +6 -0
- package/lib/models/user/UserModel.js.map +1 -1
- package/lib/models/user/UserProfileModel.js +6 -0
- package/lib/models/user/UserProfileModel.js.flow +6 -0
- package/lib/models/user/UserProfileModel.js.map +1 -1
- package/lib/models/user/UserServicesModel.js +6 -0
- package/lib/models/user/UserServicesModel.js.flow +6 -0
- package/lib/models/user/UserServicesModel.js.map +1 -1
- package/lib/modularui/ModularUIRequest.js +38 -11
- package/lib/modularui/ModularUIRequest.js.flow +65 -17
- package/lib/modularui/ModularUIRequest.js.map +1 -1
- package/lib/modularui/__tests__/ModularUIRequest.spec.js.flow +4 -9
- package/lib/modularui/types.js +2 -0
- package/lib/modularui/types.js.flow +4 -0
- package/lib/modularui/types.js.map +1 -0
- package/lib/redux/_modularui/ModularUIActions.js.flow +4 -4
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js.flow +3 -2
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +4 -3
- package/lib/redux/_modularui/types.js.map +1 -1
- package/lib/redux/_modularui/withModularUI.js.flow +2 -2
- package/lib/redux/_modularui/withModularUI.js.map +1 -1
- package/lib/utils/fetch/types.js.flow +12 -4
- package/lib/utils/fetch/types.js.map +1 -1
- package/package.json +7 -7
- package/src/constants/Constants.js +6 -0
- package/src/hooks/__tests__/UseModularUIModel.spec.js +1 -1
- package/src/hooks/__tests__/useModelCatalog.spec.js +1 -1
- package/src/hooks/__tests__/useModularUIBasic.spec.js +2 -2
- package/src/hooks/useAuthentication.js +17 -5
- package/src/hooks/useModularUI.js +2 -2
- package/src/hooks/useModularUIBasic.js +6 -3
- package/src/hooks/useModularUIModel.js +18 -10
- package/src/hooks/useModularUIRequest.js +12 -11
- package/src/models/application/ApplicationModel.js +10 -1
- package/src/models/base/ResourceModel.js +7 -0
- package/src/models/caseview/CaseViewModel.js +6 -0
- package/src/models/concepts/BusinessScenarioModel.js +6 -0
- package/src/models/concepts/ConceptDetailModel.js +6 -0
- package/src/models/concepts/ConceptIndexModel.js +6 -0
- package/src/models/concepts/ConceptTypeDetailModel.js +6 -0
- package/src/models/content/ContentIndexModel.js +6 -0
- package/src/models/content/ContentModel.js +6 -0
- package/src/models/content/ContentTOCModel.js +6 -0
- package/src/models/content/ContentTypeModel.js +6 -0
- package/src/models/detail/DetailModel.js +6 -0
- package/src/models/form/FormModel.js +6 -0
- package/src/models/list/ListDetailModel.js +6 -0
- package/src/models/list/ListModel.js +6 -0
- package/src/models/lookup/LookupOptionsModel.js +6 -0
- package/src/models/modelcatalog/ModelCatalogModel.js +6 -0
- package/src/models/panels/GroupingPanelModel.js +6 -0
- package/src/models/resolveModel.js +6 -4
- package/src/models/search/CaseSearchModel.js +6 -0
- package/src/models/tab/TabModel.js +6 -0
- package/src/models/taskgroup/TaskGroupModel.js +6 -0
- package/src/models/types.js +1 -1
- package/src/models/user/UserModel.js +6 -0
- package/src/models/user/UserProfileModel.js +6 -0
- package/src/models/user/UserServicesModel.js +6 -0
- package/src/modularui/ModularUIRequest.js +65 -17
- package/src/modularui/__tests__/ModularUIRequest.spec.js +4 -9
- package/src/modularui/types.js +4 -0
- package/src/redux/_modularui/ModularUIActions.js +4 -4
- package/src/redux/_modularui/ModularUIMiddleware.js +3 -2
- package/src/redux/_modularui/types.js +4 -3
- package/src/redux/_modularui/withModularUI.js +2 -2
- package/src/utils/fetch/types.js +12 -4
- package/types/constants/Constants.d.ts +5 -0
- package/types/models/base/ResourceModel.d.ts +4 -0
- package/types/models/form/FormObjectModel.d.ts +28 -2
- package/types/models/resolveModel.d.ts +1 -1
- package/types/models/types.d.ts +1 -1
- package/types/modularui/ModularUIRequest.d.ts +15 -7
- package/types/modularui/types.d.ts +2 -0
- package/types/redux/_modularui/types.d.ts +2 -2
- package/types/utils/fetch/types.d.ts +8 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","constructor","modularuiResponse","_relations","data","relations","entryDate","type","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","conceptTypeModel","model","conceptType","key","getData","selfhref","href","selflink","setParameter","removeParameter","_conceptType","label","conceptLabel","taxonomyType","formula","labels","labelTypes","labelType","setting","_id","getLabelElementByIds","ids","conceptProperties","propertyTypes","propertyType","properties","property","getConceptPropertiesByIds","textfragments","textFragments","textFragment","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","getSourceReferenceCollection","availableLocales","_sourceReferences","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","availableLanguagesInSourceReferences","sourceReference","substring","length","currentLanguagePostfix","locale","availableLanguages","split","value"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id)\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type)\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = []\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix)\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n )\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,sBAAsB,MAAM,0BAA0B;AAE7D,SAASC,uBAAuB,QAAQ,2BAA2B;AAYnE;AACA;AACA;AACA,eAAe,MAAMC,kBAAkB,SAASL,aAAa,CAAC;EAK5D;AACF;EACEM,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAAA;IAEzB,IAAI,CAACC,UAAU,GAAG,IAAIP,yBAAyB,CAC7C,IAAI,CAACQ,IAAI,CAACC,SAAS,EACnB,IAAI,CAACC,SAAS,CACf;EACH;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACJ,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACK,aAAa,CAACC,YAAY,IAC/BN,IAAI,CAACK,aAAa,CAACC,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,eAAe,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,aAAa,CAAC;IAC9D,MAAMC,wBAAwB,GAC5B,IAAI,CAACC,mBAAmB,CAACL,yBAAyB,EAAE;IAEtD,IAAIC,eAAe,EAAE;MACnBA,eAAe,CAACK,WAAW,GAAG,IAAI;MAClC,OAAO,CAACL,eAAe,EAAE,GAAGG,wBAAwB,CAAC;IACvD;IAEA,OAAOA,wBAAwB;EACjC;;EAEA;AACF;EACEG,cAAc,CAACC,MAA6B,EAAE;IAC5C;IACA,MAAMC,gBAAyC,GAAG,sBAAAD,MAAM,OAANA,MAAM,EACrDE,KAAK,IAAKA,KAAK,YAAYvB,sBAAsB,CACnD;IAED,IA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AAC,EAAE0E,KAAK,IAAI,IAAI;EACnE;AACF"}
|
|
1
|
+
{"version":3,"file":"ConceptDetailModel.js","names":["ResourceModel","ConceptRelationCollection","SourceReferenceCollection","ConceptTypeDetailModel","TIMEVERSION_FILTER_NAME","ConceptDetailModel","constructor","modularuiResponse","_relations","data","relations","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","conceptTypeLink","links","getLinkByKey","relationsCollectionLinks","relationsCollection","isCacheable","setChildModels","models","conceptTypeModel","model","conceptType","key","getData","selfhref","href","selflink","setParameter","removeParameter","_conceptType","label","conceptLabel","taxonomyType","formula","labels","labelTypes","labelType","setting","_id","getLabelElementByIds","ids","conceptProperties","propertyTypes","propertyType","properties","property","getConceptPropertiesByIds","textfragments","textFragments","textFragment","textFragmentConfig","textFragmentTypes","textFragmentType","notConfiguredTextFragments","some","textfragment","getTextFragmentByKeys","keys","getSourceReferenceCollection","availableLocales","_sourceReferences","getSourceReferencesForCurrentLanguage","LANGUAGE_POSTFIX_LENGTH","sourceReferences","availableLanguagesInSourceReferences","sourceReference","substring","length","currentLanguagePostfix","locale","availableLanguages","split","value"],"sources":["../../../src/models/concepts/ConceptDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ConceptRelationCollection from \"./ConceptRelationCollection\";\nimport SourceReferenceCollection from \"./SourceReferenceCollection\";\nimport ConceptTypeDetailModel from \"./ConceptTypeDetailModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type {\n ModularUIModel,\n labelsJSON,\n textfragmentJSON,\n propertyJSON,\n} from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type Href from \"../href/Href\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ConceptDetailModel extends ResourceModel {\n _relations: ConceptRelationCollection;\n _conceptType: ?ConceptTypeDetailModel;\n _sourceReferences: SourceReferenceCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._relations = new ConceptRelationCollection(\n this.data.relations,\n this.entryDate\n );\n }\n\n /**\n */\n get type(): string {\n return \"ConceptDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const conceptTypeLink = this.links.getLinkByKey(\"concepttype\");\n const relationsCollectionLinks =\n this.relationsCollection.getInitialChildModelLinks();\n\n if (conceptTypeLink) {\n conceptTypeLink.isCacheable = true;\n return [conceptTypeLink, ...relationsCollectionLinks];\n }\n\n return relationsCollectionLinks;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n // $FlowExpectedError[incompatible-type]\n const conceptTypeModel: ?ConceptTypeDetailModel = models.find(\n (model) => model instanceof ConceptTypeDetailModel\n );\n\n if (conceptTypeModel) {\n this.conceptType = conceptTypeModel;\n }\n\n this.relationsCollection.setChildModels(models);\n }\n\n /**\n * Retrieve concept detail identifier as key for this model\n */\n get key(): string {\n return this.getData(\"_id\", \"concept\");\n }\n\n /**\n * Getting the self link of this Concept\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.entryDate) {\n href.setParameter(TIMEVERSION_FILTER_NAME, this.entryDate);\n } else {\n href.removeParameter(TIMEVERSION_FILTER_NAME);\n }\n\n return href;\n }\n\n /**\n * Get conceptType of concept\n */\n get conceptType(): ?ConceptTypeDetailModel {\n return this._conceptType;\n }\n\n /**\n */\n set conceptType(conceptType: ?ConceptTypeDetailModel) {\n this._conceptType = conceptType;\n }\n\n /**\n * Get concept label\n */\n get label(): string {\n return this.data.conceptLabel;\n }\n\n /**\n * Get taxonomy type\n */\n get taxonomyType(): string {\n return this.getData(\"taxonomyType\", \"default\");\n }\n\n /**\n * Get concept relations collection\n */\n get relationsCollection(): ConceptRelationCollection {\n return this._relations;\n }\n\n /**\n * Get concept formula\n */\n get formula(): string {\n return this.data.formula;\n }\n\n /**\n * Get additional labels of concept\n */\n get labels(): Array<labelsJSON> {\n return this.conceptType && this.conceptType.labelTypes\n ? this.conceptType.labelTypes.map((labelType) => {\n const setting = this.data.labels\n ? this.data.labels.find((label) => label.type === labelType._id)\n : {};\n\n return {\n ...labelType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get label elements by id\n */\n getLabelElementByIds(ids: Array<string>): Array<labelsJSON> {\n return this.labels.filter((label: labelsJSON) => ids.includes(label._id));\n }\n\n /**\n * Get concept properties\n */\n get conceptProperties(): Array<propertyJSON> {\n return this.conceptType && this.conceptType.propertyTypes\n ? this.conceptType.propertyTypes.map((propertyType) => {\n const setting = this.data.properties\n ? this.data.properties.find(\n (property) => property.type === propertyType._id\n )\n : {};\n\n return {\n ...propertyType,\n ...setting,\n };\n })\n : [];\n }\n\n /**\n * Get concept properties by id\n */\n getConceptPropertiesByIds(ids: Array<string>): Array<propertyJSON> {\n return this.conceptProperties.filter((property) =>\n ids.includes(property._id)\n );\n }\n\n /**\n * Get Text fragments\n */\n get textfragments(): Array<textfragmentJSON> {\n const textFragments = this.data.textFragments\n ? this.data.textFragments.map((textFragment) => {\n const textFragmentConfig =\n this.conceptType &&\n this.conceptType.textFragmentTypes.find(\n (textFragmentType) => textFragment.type === textFragmentType._id\n );\n\n return {\n ...textFragmentConfig,\n ...textFragment,\n };\n })\n : [];\n\n const notConfiguredTextFragments =\n this.conceptType && this.conceptType.textFragmentTypes\n ? this.conceptType.textFragmentTypes.filter((textFragmentType) => {\n if (!this.data.textFragments) {\n return true;\n }\n\n return !this.data.textFragments.some(\n (textfragment) => textfragment.type === textFragmentType._id\n );\n })\n : [];\n\n return [...textFragments, ...notConfiguredTextFragments];\n }\n\n /**\n * Get text fragments by id\n */\n getTextFragmentByKeys(keys: Array<string>): Array<textfragmentJSON> {\n return this.textfragments.filter((textfragment) =>\n keys.includes(textfragment.type)\n );\n }\n\n /**\n * Get source reference collection\n */\n getSourceReferenceCollection(\n availableLocales: Array<string> = []\n ): SourceReferenceCollection {\n if (!this._sourceReferences) {\n this._sourceReferences = new SourceReferenceCollection(\n this.getSourceReferencesForCurrentLanguage(availableLocales),\n this.entryDate\n );\n }\n\n return this._sourceReferences;\n }\n\n /*\n * Retrieve all sourceReferenceTypes that are valid for the current language\n * Used by sourceRef collection\n */\n /**\n */\n getSourceReferencesForCurrentLanguage(\n availableLocales: Array<string>\n ): Array<Object> {\n const LANGUAGE_POSTFIX_LENGTH = 3;\n if (this.data.sourceReferences) {\n const availableLanguagesInSourceReferences =\n this.data.sourceReferences.map((sourceReference) =>\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n );\n\n const currentLanguagePostfix = `_${this.locale}`;\n\n if (\n availableLanguagesInSourceReferences.includes(currentLanguagePostfix)\n ) {\n // return all sourceReferences that end with language that is selected\n return this.data.sourceReferences.filter((sourceReference) =>\n sourceReference.type.endsWith(currentLanguagePostfix)\n );\n }\n\n const availableLanguages = availableLocales.map(\n (locale) => `_${locale.split(\"-\")[0]}`\n );\n\n // return all sourceReferences that do not end with language postfix\n return this.data.sourceReferences.filter(\n (sourceReference) =>\n !availableLanguages.includes(\n sourceReference.type.substring(\n sourceReference.type.length - LANGUAGE_POSTFIX_LENGTH\n )\n )\n );\n }\n return [];\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n return this.data.filter?.[TIMEVERSION_FILTER_NAME]?.value ?? null;\n }\n}\n"],"mappings":";;;;;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,sBAAsB,MAAM,0BAA0B;AAE7D,SAASC,uBAAuB,QAAQ,2BAA2B;AAYnE;AACA;AACA;AACA,eAAe,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C6D,gBAAgB,EAAE;MAAA;MAC9B,MAAMC,oCAAoC,GACxC,sCAAI,CAAC9D,IAAI,CAAC6D,gBAAgB,mBAAME,eAAe,IAC7CA,eAAe,CAAC5D,IAAI,CAAC6D,SAAS,CAC5BD,eAAe,CAAC5D,IAAI,CAAC8D,MAAM,GAAGL,uBAAuB,CACtD,CACF;MAEH,MAAMM,sBAAsB,GAAI,IAAG,IAAI,CAACC,MAAO,EAAC;MAEhD,IACE,0BAAAL,oCAAoC,OAApCA,oCAAoC,EAAUI,sBAAsB,CAAC,EACrE;QAAA;QACA;QACA,OAAO,yCAAI,CAAClE,IAAI,CAAC6D,gBAAgB,mBAASE,eAAe;UAAA;UAAA,OACvD,uCAAAA,eAAe,CAAC5D,IAAI,mBAAU+D,sBAAsB,CAAC;QAAA,EACtD;MACH;MAEA,MAAME,kBAAkB,GAAG,qBAAAX,gBAAgB,OAAhBA,gBAAgB,EACxCU,MAAM,IAAM,IAAGA,MAAM,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,EAAC,CACvC;;MAED;MACA,OAAO,yCAAI,CAACrE,IAAI,CAAC6D,gBAAgB,mBAC9BE,eAAe,IACd,CAAC,0BAAAK,kBAAkB,OAAlBA,kBAAkB,EACjBL,eAAe,CAAC5D,IAAI,CAAC6D,SAAS,CAC5BD,eAAe,CAAC5D,IAAI,CAAC8D,MAAM,GAAGL,uBAAuB,CACtD,CACF,CACJ;IACH;IACA,OAAO,EAAE;EACX;;EAEA;AACF;AACA;EACE,IAAI1D,SAAS,GAAkB;IAC7B,OAAO,4BAAI,CAACF,IAAI,IAAUL,uBAAuB,CAAC,EAAE2E,KAAK,IAAI,IAAI;EACnE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_filterCollection","data","filter","contributions","dynamicschema","_concepts","collection","_embedded","results","concept","entryDate","type","resourcetype","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n });\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) => new ConceptLinkModel(concept.concept, this.entryDate)\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.items.setChildModels(models);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAOnE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASL,aAAa,CAAC;EAI3D;AACF;EACEM,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIN,gBAAgB,yBAAC,IAAI,CAACO,IAAI,GAAS;MAC9DC,MAAM,0BAAE,IAAI,CAACC,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,CAAC;IAEF,IAAI,CAACC,SAAS,GAAG,IAAIZ,kBAAkB,EAAE;IACzC,IAAI,CAACY,SAAS,CAACC,UAAU,GAAG,IAAI,CAACL,IAAI,CAACM,SAAS,GAC3C,oCAAI,CAACN,IAAI,CAACM,SAAS,CAACC,OAAO,iBACxBC,OAAO,IAAK,IAAId,gBAAgB,CAACc,OAAO,CAACA,OAAO,EAAE,IAAI,CAACC,SAAS,CAAC,CACnE,GACD,EAAE;EACR;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,IAAI,IAAI,CAACC,YAAY,KAAK,iBAAiB,EAAE;MAC3C,OAAO,iBAAiB;IAC1B;IAEA,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ConceptIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ConceptLinkModel","TIMEVERSION_FILTER_NAME","ConceptIndexModel","constructor","modularuiResponse","_filterCollection","data","filter","contributions","dynamicschema","_concepts","collection","_embedded","results","concept","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","attribute","searchtermfilter","itemCollection"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n });\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) => new ConceptLinkModel(concept.concept, this.entryDate)\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" || resourceType === \"relatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.items.setChildModels(models);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): string | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n if (timeversionFilter && timeversionFilter.attribute) {\n return timeversionFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAOnE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASL,aAAa,CAAC;EAI3D;AACF;EACEM,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIN,gBAAgB,yBAAC,IAAI,CAACO,IAAI,GAAS;MAC9DC,MAAM,0BAAE,IAAI,CAACC,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,CAAC;IAEF,IAAI,CAACC,SAAS,GAAG,IAAIZ,kBAAkB,EAAE;IACzC,IAAI,CAACY,SAAS,CAACC,UAAU,GAAG,IAAI,CAACL,IAAI,CAACM,SAAS,GAC3C,oCAAI,CAACN,IAAI,CAACM,SAAS,CAACC,OAAO,iBACxBC,OAAO,IAAK,IAAId,gBAAgB,CAACc,OAAO,CAACA,OAAO,EAAE,IAAI,CAACC,SAAS,CAAC,CACnE,GACD,EAAE;EACR;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,IAAI,IAAI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EAEA;AACF;AACA;EACE,IAAIkC,WAAW,GAAsB;IACnC,OAAO,IAAI,CAACX,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAIzB,SAAS,GAAkB;IAC7B,MAAM0B,iBAAiB,GAAG,IAAI,CAACb,gBAAgB,CAACY,uBAAuB,CACrEvC,uBAAuB,CACxB;IACD,IAAIwC,iBAAiB,IAAIA,iBAAiB,CAACC,SAAS,EAAE;MACpD,OAAOD,iBAAiB,CAACC,SAAS,CAACT,KAAK;IAC1C;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIU,gBAAgB,GAAsB;IACxC,OAAO,IAAI,CAACf,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAIlB,KAAK,GAAyC;IAChD,OAAO,IAAI,CAACZ,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIY,KAAK,CAACsB,cAAoD,EAAE;IAC9D,IAAI,CAAClC,SAAS,GAAGkC,cAAc;EACjC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptTypeDetailModel.js","names":["ResourceModel","ConceptTypeDetailModel","type","isApplicableModel","data","contributions","resourcetype","key","_id","label","getData","icon","textColor","backgroundColor","borderColor","labelTypes","propertyTypes","textFragmentTypes","sectionReferenceTypes"],"sources":["../../../src/models/concepts/ConceptTypeDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nclass ConceptTypeDetailModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptTypeDetail\"\n );\n }\n\n /**\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get concept type icon\n */\n get icon(): string {\n return this.getData(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor(): string {\n return this.getData(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor(): string {\n return this.getData(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor(): string {\n return this.getData(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): ?Array<Object> {\n return this.data.labelTypes;\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): Array<Object> {\n return this.getData(\"propertyTypes\", []);\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): Array<Object> {\n return this.getData(\"textFragmentTypes\", []);\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): Array<Object> {\n return this.getData(\"sectionReferenceTypes\", []);\n }\n}\n\nexport default ConceptTypeDetailModel;\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,uBAAuB;AAIjD;AACA;AACA;AACA,MAAMC,sBAAsB,SAASD,aAAa,CAAC;EACjD;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;EACE,IAAIC,GAAG,GAAW;IAChB,OAAO,IAAI,CAACH,IAAI,CAACI,GAAG;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,IAAI,CAACD,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;EACjC;;EAEA;AACF;AACA;EACE,IAAIE,SAAS,GAAW;IACtB,OAAO,IAAI,CAACF,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIG,eAAe,GAAW;IAC5B,OAAO,IAAI,CAACH,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;EAChD;;EAEA;AACF;AACA;EACE,IAAII,WAAW,GAAW;IACxB,OAAO,IAAI,CAACJ,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAU,GAAmB;IAC/B,OAAO,IAAI,CAACX,IAAI,CAACW,UAAU;EAC7B;;EAEA;AACF;AACA;EACE,IAAIC,aAAa,GAAkB;IACjC,OAAO,IAAI,CAACN,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIO,iBAAiB,GAAkB;IACrC,OAAO,IAAI,CAACP,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;EAC9C;;EAEA;AACF;AACA;EACE,IAAIQ,qBAAqB,GAAkB;IACzC,OAAO,IAAI,CAACR,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC;EAClD;AACF;AAEA,
|
|
1
|
+
{"version":3,"file":"ConceptTypeDetailModel.js","names":["ResourceModel","ConceptTypeDetailModel","type","modelName","isApplicableModel","data","contributions","resourcetype","key","_id","label","getData","icon","textColor","backgroundColor","borderColor","labelTypes","propertyTypes","textFragmentTypes","sectionReferenceTypes"],"sources":["../../../src/models/concepts/ConceptTypeDetailModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nclass ConceptTypeDetailModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ConceptTypeDetail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptTypeDetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ConceptTypeDetail\"\n );\n }\n\n /**\n */\n get key(): string {\n return this.data._id;\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get concept type icon\n */\n get icon(): string {\n return this.getData(\"icon\", \"\");\n }\n\n /**\n * Get concept type text color\n */\n get textColor(): string {\n return this.getData(\"textColor\", \"#000\");\n }\n\n /**\n * Get concept type background color\n */\n get backgroundColor(): string {\n return this.getData(\"backgroundColor\", \"#fff\");\n }\n\n /**\n * Get concept line color\n */\n get borderColor(): string {\n return this.getData(\"lineColor\", \"#000\");\n }\n\n /**\n * Get label types\n */\n get labelTypes(): ?Array<Object> {\n return this.data.labelTypes;\n }\n\n /**\n * Get propertyTypes\n */\n get propertyTypes(): Array<Object> {\n return this.getData(\"propertyTypes\", []);\n }\n\n /**\n * Get textFragmentTypes\n */\n get textFragmentTypes(): Array<Object> {\n return this.getData(\"textFragmentTypes\", []);\n }\n\n /**\n * Get sectionReferenceTypes\n */\n get sectionReferenceTypes(): Array<Object> {\n return this.getData(\"sectionReferenceTypes\", []);\n }\n}\n\nexport default ConceptTypeDetailModel;\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,uBAAuB;AAIjD;AACA;AACA;AACA,MAAMC,sBAAsB,SAASD,aAAa,CAAC;EACjD;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,wBAAwB;EACjC;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;EACE,IAAIC,GAAG,GAAW;IAChB,OAAO,IAAI,CAACH,IAAI,CAACI,GAAG;EACtB;;EAEA;AACF;AACA;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,IAAI,CAACD,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;EACjC;;EAEA;AACF;AACA;EACE,IAAIE,SAAS,GAAW;IACtB,OAAO,IAAI,CAACF,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIG,eAAe,GAAW;IAC5B,OAAO,IAAI,CAACH,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;EAChD;;EAEA;AACF;AACA;EACE,IAAII,WAAW,GAAW;IACxB,OAAO,IAAI,CAACJ,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIK,UAAU,GAAmB;IAC/B,OAAO,IAAI,CAACX,IAAI,CAACW,UAAU;EAC7B;;EAEA;AACF;AACA;EACE,IAAIC,aAAa,GAAkB;IACjC,OAAO,IAAI,CAACN,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIO,iBAAiB,GAAkB;IACrC,OAAO,IAAI,CAACP,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;EAC9C;;EAEA;AACF;AACA;EACE,IAAIQ,qBAAqB,GAAkB;IACzC,OAAO,IAAI,CAACR,OAAO,CAAC,uBAAuB,EAAE,EAAE,CAAC;EAClD;AACF;AAEA,eAAeV,sBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ContentLinkModel","Href","ChoiceAttributeModel","ContentIndexModel","constructor","modularuiResponse","_filterCollection","data","filter","contributions","dynamicschema","_content","collection","_embedded","results","content","type","isApplicableModel","resourcetype","getInitialChildModelLinks","items","setChildModels","models","selfhref","href","selflink","filterCollection","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","hasIndexFilter","filterAttribute","attribute","options","length","hasNoFiltersSet","isEmpty","inputvalue","getFirstCharHref","firstChar","option","code","path","addParameter"],"sources":["../../../src/models/content/ContentIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport Href from \"../href/Href\";\n\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport ChoiceAttributeModel from \"../attributes/ChoiceAttributeModel\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ContentIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _content: ResourceCollection<ContentLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n });\n\n this._content = new ResourceCollection();\n this._content.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (content) => new ContentLinkModel(content.content)\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n return \"ContentIndex\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentSearch\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.items.setChildModels(models);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this._filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve content collection\n */\n get items(): ResourceCollection<ContentLinkModel> {\n return this._content;\n }\n\n /**\n */\n hasIndexFilter(): boolean {\n const filterAttribute = this.indexfilter?.attribute;\n\n return (\n filterAttribute instanceof ChoiceAttributeModel &&\n filterAttribute.options.length > 0\n );\n }\n\n /**\n */\n hasNoFiltersSet(): boolean {\n return (\n this.items.isEmpty &&\n this.filterCollection.filter(\n (filter) => filter.attribute?.inputvalue !== \"\"\n ).length === 0\n );\n }\n\n /**\n */\n getFirstCharHref(): Href {\n const filterAttribute = this.indexfilter?.attribute;\n\n let firstChar = \"#\";\n if (filterAttribute instanceof ChoiceAttributeModel) {\n firstChar = filterAttribute.options.filter(\n (option) => option.code !== \"0\"\n )[0].code;\n }\n\n return new Href(this.selfhref.path).addParameter(\"index\", firstChar);\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAK/B,OAAOC,oBAAoB,MAAM,oCAAoC;;AAErE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASN,aAAa,CAAC;EAI3D;AACF;EACEO,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIP,gBAAgB,yBAAC,IAAI,CAACQ,IAAI,GAAS;MAC9DC,MAAM,0BAAE,IAAI,CAACC,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,CAAC;IAEF,IAAI,CAACC,QAAQ,GAAG,IAAIb,kBAAkB,EAAE;IACxC,IAAI,CAACa,QAAQ,CAACC,UAAU,GAAG,IAAI,CAACL,IAAI,CAACM,SAAS,GAC1C,oCAAI,CAACN,IAAI,CAACM,SAAS,CAACC,OAAO,iBACxBC,OAAO,IAAK,IAAIf,gBAAgB,CAACe,OAAO,CAACA,OAAO,CAAC,CACnD,GACD,EAAE;EACR;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ContentIndexModel.js","names":["ResourceModel","ResourceCollection","FilterCollection","ContentLinkModel","Href","ChoiceAttributeModel","ContentIndexModel","constructor","modularuiResponse","_filterCollection","data","filter","contributions","dynamicschema","_content","collection","_embedded","results","content","type","modelName","isApplicableModel","resourcetype","getInitialChildModelLinks","items","setChildModels","models","selfhref","href","selflink","filterCollection","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","hasIndexFilter","filterAttribute","attribute","options","length","hasNoFiltersSet","isEmpty","inputvalue","getFirstCharHref","firstChar","option","code","path","addParameter"],"sources":["../../../src/models/content/ContentIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport Href from \"../href/Href\";\n\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport ChoiceAttributeModel from \"../attributes/ChoiceAttributeModel\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ContentIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _content: ResourceCollection<ContentLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n });\n\n this._content = new ResourceCollection();\n this._content.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (content) => new ContentLinkModel(content.content)\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n return \"ContentIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentSearch\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.items.setChildModels(models);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this._filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve content collection\n */\n get items(): ResourceCollection<ContentLinkModel> {\n return this._content;\n }\n\n /**\n */\n hasIndexFilter(): boolean {\n const filterAttribute = this.indexfilter?.attribute;\n\n return (\n filterAttribute instanceof ChoiceAttributeModel &&\n filterAttribute.options.length > 0\n );\n }\n\n /**\n */\n hasNoFiltersSet(): boolean {\n return (\n this.items.isEmpty &&\n this.filterCollection.filter(\n (filter) => filter.attribute?.inputvalue !== \"\"\n ).length === 0\n );\n }\n\n /**\n */\n getFirstCharHref(): Href {\n const filterAttribute = this.indexfilter?.attribute;\n\n let firstChar = \"#\";\n if (filterAttribute instanceof ChoiceAttributeModel) {\n firstChar = filterAttribute.options.filter(\n (option) => option.code !== \"0\"\n )[0].code;\n }\n\n return new Href(this.selfhref.path).addParameter(\"index\", firstChar);\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAa,MAAM,uBAAuB;AACjD,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAK/B,OAAOC,oBAAoB,MAAM,oCAAoC;;AAErE;AACA;AACA;AACA,eAAe,MAAMC,iBAAiB,SAASN,aAAa,CAAC;EAI3D;AACF;EACEO,WAAW,CAACC,iBAAoC,EAAE;IAAA;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIP,gBAAgB,yBAAC,IAAI,CAACQ,IAAI,GAAS;MAC9DC,MAAM,0BAAE,IAAI,CAACC,aAAa,CAAO;MACjCC,aAAa,EAAE,IAAI,CAACH,IAAI,CAACG;IAC3B,CAAC,CAAC;IAEF,IAAI,CAACC,QAAQ,GAAG,IAAIb,kBAAkB,EAAE;IACxC,IAAI,CAACa,QAAQ,CAACC,UAAU,GAAG,IAAI,CAACL,IAAI,CAACM,SAAS,GAC1C,oCAAI,CAACN,IAAI,CAACM,SAAS,CAACC,OAAO,iBACxBC,OAAO,IAAK,IAAIf,gBAAgB,CAACe,OAAO,CAACA,OAAO,CAAC,CACnD,GACD,EAAE;EACR;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,mBAAmB;EAC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AEA;AACF;EACE4B,cAAc,GAAY;IACxB,MAAMC,eAAe,GAAG,IAAI,CAACH,WAAW,EAAEI,SAAS;IAEnD,OACED,eAAe,YAAYtC,oBAAoB,IAC/CsC,eAAe,CAACE,OAAO,CAACC,MAAM,GAAG,CAAC;EAEtC;;EAEA;AACF;EACEC,eAAe,GAAY;IAAA;IACzB,OACE,IAAI,CAACvB,KAAK,CAACwB,OAAO,IAClB,wCAAI,CAAClB,gBAAgB,kBAClBnB,MAAM,IAAKA,MAAM,CAACiC,SAAS,EAAEK,UAAU,KAAK,EAAE,CAChD,CAACH,MAAM,KAAK,CAAC;EAElB;;EAEA;AACF;EACEI,gBAAgB,GAAS;IACvB,MAAMP,eAAe,GAAG,IAAI,CAACH,WAAW,EAAEI,SAAS;IAEnD,IAAIO,SAAS,GAAG,GAAG;IACnB,IAAIR,eAAe,YAAYtC,oBAAoB,EAAE;MAAA;MACnD8C,SAAS,GAAG,oCAAAR,eAAe,CAACE,OAAO,kBAChCO,MAAM,IAAKA,MAAM,CAACC,IAAI,KAAK,GAAG,CAChC,CAAC,CAAC,CAAC,CAACA,IAAI;IACX;IAEA,OAAO,IAAIjD,IAAI,CAAC,IAAI,CAACuB,QAAQ,CAAC2B,IAAI,CAAC,CAACC,YAAY,CAAC,OAAO,EAAEJ,SAAS,CAAC;EACtE;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentModel.js","names":["ModularUIResponse","ResourceModel","FilterCollection","ContentLinkModel","SubSectionModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","SectionModel","ContentModel","constructor","response","_section","data","entryDate","type","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","model","section","id","_id","filterCollection","_filterCollection","filter","entryDateFilter","getFilterByAttributeKey","attribute","value","_contentType","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","referenceHash"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(this.data, this.entryDate);\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n }\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA,eAAe,MAAMC,YAAY,SAASP,aAAa,CAAC;EAKtDQ,WAAW,CAACC,QAA2B,EAAE;IACvC,KAAK,CAACA,QAAQ,CAAC;IAAC;IAAA,sCAJsB,IAAI;IAAA;IAM1C,IAAI,CAACC,QAAQ,GAAG,IAAIJ,YAAY,CAAC,IAAI,CAACK,IAAI,EAAE,IAAI,CAACC,SAAS,CAAC;EAC7D;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,SAAS;EAClB;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"ContentModel.js","names":["ModularUIResponse","ResourceModel","FilterCollection","ContentLinkModel","SubSectionModel","ContentTypeModel","TIMEVERSION_FILTER_NAME","SectionModel","ContentModel","constructor","response","_section","data","entryDate","type","modelName","isApplicableModel","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","model","section","id","_id","filterCollection","_filterCollection","filter","entryDateFilter","getFilterByAttributeKey","attribute","value","_contentType","label","number","body","childSectionLinks","selfContentLink","childSections","sections","subSections","relatedConceptsHrefs","hrefs","relatedConceptsHref","push","forEach","subSection","relatedConceptsLink","href","addParameter","referenceHash"],"sources":["../../../src/models/content/ContentModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport SubSectionModel from \"./SubSectionModel\";\n\nimport ContentTypeModel from \"./ContentTypeModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport SectionModel from \"./SectionModel\";\n\n/**\n * Content detail model\n */\nexport default class ContentModel extends ResourceModel {\n _section: SectionModel;\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n constructor(response: ModularUIResponse) {\n super(response);\n\n this._section = new SectionModel(this.data, this.entryDate);\n }\n\n /**\n */\n get type(): string {\n return \"Content\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentDetail\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n */\n get section(): SectionModel {\n return this._section;\n }\n\n /**\n */\n get id(): string {\n return this.data._id;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection && this.data.filter?.entryDate) {\n this._filterCollection = new FilterCollection(\n {\n entryDate: this.data.filter.entryDate,\n },\n {\n filter: this.contributions.filter,\n }\n );\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const entryDateFilter = this.filterCollection?.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n if (entryDateFilter && entryDateFilter.attribute) {\n return entryDateFilter.attribute.value;\n }\n\n return null;\n }\n\n /**\n * Get conceptType of concept\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n * Set concept type\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.section.label;\n }\n\n /**\n * Retrieve number of section\n */\n get number(): string | null {\n return this.section.number;\n }\n\n /**\n * Get content body\n */\n get body(): ?string {\n return this.section.body;\n }\n\n /**\n * Retrieve child section links\n */\n get childSectionLinks(): Array<ContentLinkModel> {\n return this.section.childSectionLinks;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return this.section.selfContentLink;\n }\n\n /**\n * Get tree of child sections\n */\n get childSections(): Array<SectionModel> {\n return this.section.childSections;\n }\n\n /**\n * set resolved child sections\n */\n set childSections(sections: Array<SectionModel>) {\n this.section.childSections = sections || [];\n }\n\n /**\n * Get sub sections\n */\n get subSections(): Array<SubSectionModel> {\n return this.section.subSections;\n }\n\n /**\n */\n get relatedConceptsHrefs(): Array<Href> {\n const hrefs = [];\n if (this.relatedConceptsHref) {\n hrefs.push(this.relatedConceptsHref);\n }\n\n this.subSections.forEach((subSection) => {\n hrefs.push(...subSection.relatedConceptsHrefs);\n });\n\n return hrefs;\n }\n\n /**\n * Get related concepts link\n */\n get relatedConceptsHref(): Href | null {\n const relatedConceptsLink = this.links.getLinkByKey(\"relatedConcepts\");\n\n if (relatedConceptsLink) {\n const { href } = relatedConceptsLink;\n href.addParameter(\"entryDate\", this.entryDate);\n return href;\n }\n\n return null;\n }\n\n /**\n */\n get referenceHash(): number {\n return this.section.referenceHash;\n }\n}\n"],"mappings":";;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,eAAe,MAAM,mBAAmB;AAE/C,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,SAASC,uBAAuB,QAAQ,2BAA2B;AAKnE,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA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,EAAE;IAC/C,IAAI,CAACjB,OAAO,CAACgB,aAAa,GAAGC,QAAQ,IAAI,EAAE;EAC7C;;EAEA;AACF;AACA;EACE,IAAIC,WAAW,GAA2B;IACxC,OAAO,IAAI,CAAClB,OAAO,CAACkB,WAAW;EACjC;;EAEA;AACF;EACE,IAAIC,oBAAoB,GAAgB;IACtC,MAAMC,KAAK,GAAG,EAAE;IAChB,IAAI,IAAI,CAACC,mBAAmB,EAAE;MAC5BD,KAAK,CAACE,IAAI,CAAC,IAAI,CAACD,mBAAmB,CAAC;IACtC;IAEA,IAAI,CAACH,WAAW,CAACK,OAAO,CAAEC,UAAU,IAAK;MACvCJ,KAAK,CAACE,IAAI,CAAC,GAAGE,UAAU,CAACL,oBAAoB,CAAC;IAChD,CAAC,CAAC;IAEF,OAAOC,KAAK;EACd;;EAEA;AACF;AACA;EACE,IAAIC,mBAAmB,GAAgB;IACrC,MAAMI,mBAAmB,GAAG,IAAI,CAAC/B,KAAK,CAACC,YAAY,CAAC,iBAAiB,CAAC;IAEtE,IAAI8B,mBAAmB,EAAE;MACvB,MAAM;QAAEC;MAAK,CAAC,GAAGD,mBAAmB;MACpCC,IAAI,CAACC,YAAY,CAAC,WAAW,EAAE,IAAI,CAACzC,SAAS,CAAC;MAC9C,OAAOwC,IAAI;IACb;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIE,aAAa,GAAW;IAC1B,OAAO,IAAI,CAAC5B,OAAO,CAAC4B,aAAa;EACnC;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentTOCModel.js","names":["has","ResourceModel","FilterCollection","ContentLinkModel","ContentTypeModel","Href","TIMEVERSION_FILTER_NAME","getItems","items","entryDate","item","link","section","_id","ContentTOCModel","type","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","model","label","getData","selfhref","href","selflink","filterCollection","forEach","filter","params","param","value","setParameter","name","removeParameter","selfContentLink","categories","category","_contentType","_filterCollection","key","timeversionFilter","getFilterByAttributeKey","attribute"],"sources":["../../../src/models/content/ContentTOCModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport Href from \"../href/Href\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Get content items recursively\n */\nconst getItems = (\n items: Array<Object>,\n entryDate: ISO_DATE | null\n): Array<ContentLinkModel> =>\n items.map((item) => {\n const link = new ContentLinkModel(\n {\n ...item,\n section: item._id,\n },\n entryDate\n );\n\n if (item.items) {\n link.items = getItems(item.items, entryDate);\n }\n\n return link;\n });\n\n/**\n * Content detail model\n */\nexport default class ContentTOCModel extends ResourceModel {\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n /**\n */\n get type(): string {\n return \"ContentTOC\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentTOC\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(this.data, this.entryDate);\n }\n\n /**\n * Get sub items of toc\n */\n get items(): Array<ContentLinkModel> {\n return this.data.items ? getItems(this.data.items, this.entryDate) : [];\n }\n\n /**\n * get categories of content\n */\n get categories(): Array<ContentLinkModel> {\n if (this.data.categories) {\n return this.data.categories.map(\n (category) => new ContentLinkModel(category)\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data?.filter, key);\n }),\n });\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n\n return timeversionFilter?.attribute?.value ?? null;\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAE/B,SAASC,uBAAuB,QAAQ,2BAA2B;AAMnE;AACA;AACA;AACA,MAAMC,QAAQ,GAAG,CACfC,KAAoB,EACpBC,SAA0B,KAE1B,qBAAAD,KAAK,OAALA,KAAK,EAAME,IAAI,IAAK;EAClB,MAAMC,IAAI,GAAG,IAAIR,gBAAgB,CAC/B;IACE,GAAGO,IAAI;IACPE,OAAO,EAAEF,IAAI,CAACG;EAChB,CAAC,EACDJ,SAAS,CACV;EAED,IAAIC,IAAI,CAACF,KAAK,EAAE;IACdG,IAAI,CAACH,KAAK,GAAGD,QAAQ,CAACG,IAAI,CAACF,KAAK,EAAEC,SAAS,CAAC;EAC9C;EAEA,OAAOE,IAAI;AACb,CAAC,CAAC;;AAEJ;AACA;AACA;AACA,eAAe,MAAMG,eAAe,SAASb,aAAa,CAAC;EAAA;IAAA;IAAA,sCACjB,IAAI;IAAA;EAAA;EAG5C;AACF;EACE,IAAIc,IAAI,GAAW;IACjB,OAAO,YAAY;EACrB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,YAAY;EAEpD;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,MAAMC,eAAe,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,aAAa,CAAC;IAE9D,IAAIF,eAAe,EAAE;MACnB,OAAO,CAACA,eAAe,CAAC;IAC1B;IAEA,OAAO,EAAE;EACX;;EAEA;AACF;EACEG,cAAc,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACC,WAAW,GAAG,sBAAAD,MAAM,OAANA,MAAM,EAAOE,KAAK,IAAKA,KAAK,
|
|
1
|
+
{"version":3,"file":"ContentTOCModel.js","names":["has","ResourceModel","FilterCollection","ContentLinkModel","ContentTypeModel","Href","TIMEVERSION_FILTER_NAME","getItems","items","entryDate","item","link","section","_id","ContentTOCModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getInitialChildModelLinks","contentTypeLink","links","getLinkByKey","setChildModels","models","contentType","model","label","getData","selfhref","href","selflink","filterCollection","forEach","filter","params","param","value","setParameter","name","removeParameter","selfContentLink","categories","category","_contentType","_filterCollection","key","timeversionFilter","getFilterByAttributeKey","attribute"],"sources":["../../../src/models/content/ContentTOCModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ResourceModel from \"../base/ResourceModel\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ContentLinkModel from \"./ContentLinkModel\";\nimport ContentTypeModel from \"./ContentTypeModel\";\nimport Href from \"../href/Href\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Get content items recursively\n */\nconst getItems = (\n items: Array<Object>,\n entryDate: ISO_DATE | null\n): Array<ContentLinkModel> =>\n items.map((item) => {\n const link = new ContentLinkModel(\n {\n ...item,\n section: item._id,\n },\n entryDate\n );\n\n if (item.items) {\n link.items = getItems(item.items, entryDate);\n }\n\n return link;\n });\n\n/**\n * Content detail model\n */\nexport default class ContentTOCModel extends ResourceModel {\n _contentType: ContentTypeModel | null = null;\n _filterCollection: FilterCollection;\n\n /**\n */\n get type(): string {\n return \"ContentTOC\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentTOCModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentTOC\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n const contentTypeLink = this.links.getLinkByKey(\"contenttype\");\n\n if (contentTypeLink) {\n return [contentTypeLink];\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.contentType = models.find((model) => model.type === \"ContentType\");\n }\n\n /**\n * Get content label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const href = new Href(this.selflink.href);\n\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n\n return href;\n }\n\n /**\n */\n get selfContentLink(): ContentLinkModel {\n return new ContentLinkModel(this.data, this.entryDate);\n }\n\n /**\n * Get sub items of toc\n */\n get items(): Array<ContentLinkModel> {\n return this.data.items ? getItems(this.data.items, this.entryDate) : [];\n }\n\n /**\n * get categories of content\n */\n get categories(): Array<ContentLinkModel> {\n if (this.data.categories) {\n return this.data.categories.map(\n (category) => new ContentLinkModel(category)\n );\n }\n\n return [];\n }\n\n /**\n * Retrieve content type model\n */\n get contentType(): ContentTypeModel | null {\n return this._contentType;\n }\n\n /**\n */\n set contentType(contentType: ?ModularUIModel) {\n this._contentType =\n contentType instanceof ContentTypeModel ? contentType : null;\n }\n\n /**\n * Retrieve available filters on concept toc\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = new FilterCollection(this.data.filter, {\n filter: this.contributions.filter.filter((filter) => {\n const [key] = Object.keys(filter);\n return has(this.data?.filter, key);\n }),\n });\n }\n\n return this._filterCollection;\n }\n\n /**\n * Retrieve entrydate of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME\n );\n\n return timeversionFilter?.attribute?.value ?? null;\n }\n}\n"],"mappings":";;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,IAAI,MAAM,cAAc;AAE/B,SAASC,uBAAuB,QAAQ,2BAA2B;AAMnE;AACA;AACA;AACA,MAAMC,QAAQ,GAAG,CACfC,KAAoB,EACpBC,SAA0B,KAE1B,qBAAAD,KAAK,OAALA,KAAK,EAAME,IAAI,IAAK;EAClB,MAAMC,IAAI,GAAG,IAAIR,gBAAgB,CAC/B;IACE,GAAGO,I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AAiB,GAAG,IAAI7C,gBAAgB,yBAAC,IAAI,CAACgB,IAAI,GAAS;QAC9DkB,MAAM,EAAE,gEAAI,CAACjB,aAAa,mBAAgBiB,MAAM,IAAK;UACnD,MAAM,CAACY,GAAG,CAAC,GAAG,aAAYZ,MAAM,CAAC;UACjC,OAAOpC,GAAG,CAAC,IAAI,CAACkB,IAAI,EAAEkB,MAAM,EAAEY,GAAG,CAAC;QACpC,CAAC;MACH,CAAC,CAAC;IACJ;IAEA,OAAO,IAAI,CAACD,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACE,IAAItC,SAAS,GAAoB;IAC/B,MAAMwC,iBAAiB,GAAG,IAAI,CAACf,gBAAgB,CAACgB,uBAAuB,CACrE5C,uBAAuB,CACxB;IAED,OAAO2C,iBAAiB,EAAEE,SAAS,EAAEZ,KAAK,IAAI,IAAI;EACpD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentTypeModel.js","names":["ResourceModel","ContentTypeModel","type","isApplicableModel","data","contributions","resourcetype","label","getData","icon","iconLarge","iconSmall","iconMedium","description"],"sources":["../../../src/models/content/ContentTypeModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ContentTypeModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ContentType\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentTypeDetail\"\n );\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get content type icon\n */\n get icon(): ?string {\n return this.iconLarge;\n }\n\n /**\n * Get content type small icon\n */\n get iconSmall(): ?string {\n return this.data.iconSmall;\n }\n\n /**\n * Get content type medium icon\n */\n get iconMedium(): ?string {\n return this.data.iconMedium;\n }\n\n /**\n * Get content type large icon\n */\n get iconLarge(): ?string {\n return this.data.iconLarge;\n }\n\n /**\n * Get concept type text color\n */\n get description(): ?string {\n return this.data.description;\n }\n}\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,uBAAuB;AAGjD;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,aAAa,CAAC;EAC1D;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;AACA;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;EACE,IAAIC,IAAI,GAAY;IAClB,OAAO,IAAI,CAACC,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIC,SAAS,GAAY;IACvB,OAAO,IAAI,CAACP,IAAI,CAACO,SAAS;EAC5B;;EAEA;AACF;AACA;EACE,IAAIC,UAAU,GAAY;IACxB,OAAO,IAAI,CAACR,IAAI,CAACQ,UAAU;EAC7B;;EAEA;AACF;AACA;EACE,IAAIF,SAAS,GAAY;IACvB,OAAO,IAAI,CAACN,IAAI,CAACM,SAAS;EAC5B;;EAEA;AACF;AACA;EACE,IAAIG,WAAW,GAAY;IACzB,OAAO,IAAI,CAACT,IAAI,CAACS,WAAW;EAC9B;AACF"}
|
|
1
|
+
{"version":3,"file":"ContentTypeModel.js","names":["ResourceModel","ContentTypeModel","type","modelName","isApplicableModel","data","contributions","resourcetype","label","getData","icon","iconLarge","iconSmall","iconMedium","description"],"sources":["../../../src/models/content/ContentTypeModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * Model for concept details, available through modelcatalog\n */\nexport default class ContentTypeModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ContentType\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ContentTypeModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ContentTypeDetail\"\n );\n }\n\n /**\n * Get concept type label\n */\n get label(): string {\n return this.getData(\"label\", \"\");\n }\n\n /**\n * Get content type icon\n */\n get icon(): ?string {\n return this.iconLarge;\n }\n\n /**\n * Get content type small icon\n */\n get iconSmall(): ?string {\n return this.data.iconSmall;\n }\n\n /**\n * Get content type medium icon\n */\n get iconMedium(): ?string {\n return this.data.iconMedium;\n }\n\n /**\n * Get content type large icon\n */\n get iconLarge(): ?string {\n return this.data.iconLarge;\n }\n\n /**\n * Get concept type text color\n */\n get description(): ?string {\n return this.data.description;\n }\n}\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,uBAAuB;AAGjD;AACA;AACA;AACA,eAAe,MAAMC,gBAAgB,SAASD,aAAa,CAAC;EAC1D;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,aAAa;EACtB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,kBAAkB;EAC3B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,mBAAmB;EAE3D;;EAEA;AACF;AACA;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;EAClC;;EAEA;AACF;AACA;EACE,IAAIC,IAAI,GAAY;IAClB,OAAO,IAAI,CAACC,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIC,SAAS,GAAY;IACvB,OAAO,IAAI,CAACP,IAAI,CAACO,SAAS;EAC5B;;EAEA;AACF;AACA;EACE,IAAIC,UAAU,GAAY;IACxB,OAAO,IAAI,CAACR,IAAI,CAACQ,UAAU;EAC7B;;EAEA;AACF;AACA;EACE,IAAIF,SAAS,GAAY;IACvB,OAAO,IAAI,CAACN,IAAI,CAACM,SAAS;EAC5B;;EAEA;AACF;AACA;EACE,IAAIG,WAAW,GAAY;IACzB,OAAO,IAAI,CAACT,IAAI,CAACS,WAAW;EAC9B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailModel.js","names":["has","ActionCollection","AttributeCollection","ResourceModel","TITLE","DetailModel","constructor","modularuiResponse","createAttributeCollection","createMetadataCollection","createActionCollection","type","isApplicableModel","data","resourceType","contributions","resourcetype","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","attributeContributions","attributes","contribution","attributeCollection","collection","all","attribute","layouthint","isHidden","getAttributeByKey","metadataContributions","metadata","metadataKey","metadataCollection","_metadataCollection","_actionCollection","actions","actionCollection","isCase","titleAttribute","getAttributeByLayoutHint","update","model","clonedModel","clone","equals","toString"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,aAAa,MAAM,uBAAuB;AAEjD,SAASC,KAAK,QAAQ,6BAA6B;AAMnD;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,WAAW,SAASF,aAAa,CAAC;EAKrD;AACF;EACEG,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAAA;IAEzB,IAAI,CAACC,yBAAyB,EAAE;IAChC,IAAI,CAACC,wBAAwB,EAAE;IAC/B,IAAI,CAACC,sBAAsB,EAAE;EAC/B;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,QAAQ;EACjB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IAAA;IACzD,MAAMC,YAAY,GAAGD,IAAI,CAACE,aAAa,EAAEC,YAAY;IACrD,OACEF,YAAY,KACX,0BAAAA,YAAY,OAAZA,YAAY,EAAU,aAAa,CAAC,IACnC,sCAAC,QAAQ,EAAE,qBAAqB,EAAE,2BAA2B,CAAC,iBAC5DA,YAAY,CACb,CAAC;EAER;;EAEA;AACF;EACEG,yBAAyB,GAAqB;IAC5C,OAAO,IAAI,CAACC,oBAAoB,CAACD,yBAAyB,EAAE;EAC9D;;EAEA;AACF;EACEE,cAAc,CAACC,MAA6B,EAAE;IAC5C,IAAI,CAACF,oBAAoB,CAACC,cAAc,CAACC,MAAM,CAAC;EAClD;;EAEA;AACF;AACA;EACE,IAAIC,EAAE,GAAW;IACf,OAAO,IAAI,CAACC,OAAO,CAAC,KAAK,EAAE,IAAI,CAACC,GAAG,CAAC;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;
|
|
1
|
+
{"version":3,"file":"DetailModel.js","names":["has","ActionCollection","AttributeCollection","ResourceModel","TITLE","DetailModel","constructor","modularuiResponse","createAttributeCollection","createMetadataCollection","createActionCollection","type","modelName","isApplicableModel","data","resourceType","contributions","resourcetype","getInitialChildModelLinks","_attributeCollection","setChildModels","models","id","getData","key","label","getContribution","attributeContributions","attributes","contribution","attributeCollection","collection","all","attribute","layouthint","isHidden","getAttributeByKey","metadataContributions","metadata","metadataKey","metadataCollection","_metadataCollection","_actionCollection","actions","actionCollection","isCase","titleAttribute","getAttributeByLayoutHint","update","model","clonedModel","clone","equals","toString"],"sources":["../../../src/models/detail/DetailModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport ActionCollection from \"../actions/ActionCollection\";\nimport AttributeCollection from \"../attributes/AttributeCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport { TITLE } from \"../../constants/LayoutHints\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel, AttributeType } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Base class for details<br/>\n * For instance the details of case 1<br/>\n * For instance the details of record 12<br/>\n */\nexport default class DetailModel extends ResourceModel {\n _attributeCollection: AttributeCollection;\n _metadataCollection: AttributeCollection;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createAttributeCollection();\n this.createMetadataCollection();\n this.createActionCollection();\n }\n\n /**\n */\n get type(): string {\n return \"Detail\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"DetailModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType &&\n (resourceType.endsWith(\"DetailPanel\") ||\n [\"Detail\", \"CasePropertiesPanel\", \"CasePropertiesPanelDetail\"].includes(\n resourceType\n ))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this._attributeCollection.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this._attributeCollection.setChildModels(models);\n }\n\n /**\n * Getting the unique identifier of the details\n */\n get id(): string {\n return this.getData(\"_id\", this.key);\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Attribute collection\n */\n createAttributeCollection() {\n const attributeContributions = this.contributions.attributes\n ? this.contributions.attributes.filter((contribution) => {\n const [key] = Object.keys(contribution);\n return has(this.data, key);\n })\n : [];\n\n this.attributeCollection = new AttributeCollection(\n this.data,\n attributeContributions,\n true\n );\n }\n\n /**\n */\n get attributeCollection(): AttributeCollection {\n return this._attributeCollection;\n }\n\n /**\n */\n set attributeCollection(collection: AttributeCollection) {\n this._attributeCollection = collection;\n }\n\n /**\n * Retrieve list of visible attributes\n */\n get attributes(): Array<AttributeType> {\n return this.attributeCollection.all.filter(\n (attribute) => !attribute.layouthint.has(TITLE) && !attribute.isHidden\n );\n }\n\n /**\n * Retrieve an attribute by it's key\n */\n getAttributeByKey(key: string): AttributeType | null {\n return this._attributeCollection.getAttributeByKey(key);\n }\n\n /**\n * Metadata collection\n */\n createMetadataCollection() {\n const metadataContributions = this.contributions.metadata\n ? Object.keys(this.contributions.metadata).map((metadataKey) => ({\n [metadataKey]: this.contributions.metadata[metadataKey],\n }))\n : [];\n\n this.metadataCollection = new AttributeCollection(\n this.data,\n metadataContributions,\n true\n );\n }\n\n /**\n */\n get metadataCollection(): AttributeCollection {\n return this._metadataCollection;\n }\n\n /**\n */\n set metadataCollection(collection: AttributeCollection) {\n this._metadataCollection = collection;\n }\n\n /**\n * Action collection\n */\n createActionCollection() {\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n */\n set actionCollection(actionCollection: ActionCollection) {\n this._actionCollection = actionCollection;\n }\n\n /**\n * Determines if this is a case\n */\n get isCase(): boolean {\n return this.contributions.resourcetype === \"CaseView\";\n }\n\n /**\n * Getting the attribute that has as layout hint 'title'\n */\n get titleAttribute(): ?AttributeType {\n return this._attributeCollection.getAttributeByLayoutHint(TITLE);\n }\n\n /**\n * Update current detail with a new detail model and return a cloned version of the model\n */\n update(model: ModularUIModel): DetailModel {\n if (model instanceof DetailModel) {\n const clonedModel = this.clone();\n\n clonedModel.attributeCollection = model._attributeCollection;\n clonedModel.metadataCollection = model._metadataCollection;\n clonedModel.actionCollection = model._actionCollection;\n\n return clonedModel;\n }\n\n return this;\n }\n\n /**\n */\n equals(model: DetailModel): boolean {\n return this.id.toString() === model.id.toString();\n }\n}\n"],"mappings":";;;;;;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,mBAAmB,MAAM,mCAAmC;AACnE,OAAOC,aAAa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