@beinformed/ui 1.25.2 → 1.25.5
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 +18 -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 +7 -1
- package/esm/hooks/useModularUIBasic.js.map +1 -1
- package/esm/hooks/useModularUIModel.js +9 -1
- 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 +54 -10
- 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 +2 -0
- package/esm/redux/_modularui/ModularUIActions.js.map +1 -1
- package/esm/redux/_modularui/ModularUIMiddleware.js +1 -0
- 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 +7 -1
- package/lib/hooks/useModularUIBasic.js.flow +14 -4
- package/lib/hooks/useModularUIBasic.js.map +1 -1
- package/lib/hooks/useModularUIModel.js +11 -2
- package/lib/hooks/useModularUIModel.js.flow +19 -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 +54 -10
- package/lib/modularui/ModularUIRequest.js.flow +83 -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 +2 -0
- package/lib/redux/_modularui/ModularUIActions.js.flow +6 -4
- package/lib/redux/_modularui/ModularUIActions.js.map +1 -1
- package/lib/redux/_modularui/ModularUIMiddleware.js +1 -0
- package/lib/redux/_modularui/ModularUIMiddleware.js.flow +5 -2
- package/lib/redux/_modularui/ModularUIMiddleware.js.map +1 -1
- package/lib/redux/_modularui/types.js.flow +5 -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 +14 -4
- package/src/hooks/useModularUIModel.js +19 -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 +83 -17
- package/src/modularui/__tests__/ModularUIRequest.spec.js +4 -9
- package/src/modularui/types.js +4 -0
- package/src/redux/_modularui/ModularUIActions.js +6 -4
- package/src/redux/_modularui/ModularUIMiddleware.js +5 -2
- package/src/redux/_modularui/types.js +5 -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":"ListModel.js","names":["ListModel","ResourceModel","type","isApplicableModel","data","resourceType","contributions","resourcetype","getInitialChildModelLinks","layouthint","has","SHOW_ONE_RESULT_AS_DETAIL","listItemCollection","length","listItem","listDetailLink","selflink","targetModel","ListDetailModel","setChildModels","models","detail","childModel","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","ListItemCollection","createFromList","_detail","listitemHref","selfhref","listitem","equals","setSelfHref","grouping","_grouping","setGrouping","GroupingModel","dynamicschema","contexts","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","HIDE_WHEN_EMPTY","actionCollection","isEmpty","filterCollection","hasActiveFilters","getListItemById","id","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","paging","_paging","setPaging","PagingModel","sorting","_sorting","setSorting","SortingModel","getSortingLabels","_filterCollection","setFilters","FilterCollection","listkey","key","filter","isFiltered","_actionCollection","setActionCollection","ActionCollection","actions","hasList","selfLink","links","getLinkByKey","ListHref","_selfhref","headers","_headers","setHeaders","tempHeaders","results","forEach","attributes","attribute","listHeader","ListHeaderModel","exists","some","tempHeader","CASEVIEW_LINK","push","sortingLabels","attributeKey","getActionsByType","actionType"],"sources":["../../../src/models/list/ListModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ListItemCollection from \"../list/ListItemCollection\";\nimport ListDetailModel from \"../list/ListDetailModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport GroupingModel from \"../grouping/GroupingModel\";\nimport ListHeaderModel from \"../list/ListHeaderModel\";\nimport ListHref from \"../href/ListHref\";\nimport ListItemModel from \"../list/ListItemModel\";\nimport PagingModel from \"../paging/PagingModel\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport SortingModel from \"../sorting/SortingModel\";\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Defines a list object\n */\nexport default class ListModel extends ResourceModel {\n _detail: ?ListDetailModel = null;\n _headers: Array<ListHeaderModel>;\n _paging: PagingModel;\n _filterCollection: FilterCollection;\n _sorting: SortingModel;\n _actionCollection: ActionCollection;\n _listItemCollection: ListItemCollection;\n _grouping: GroupingModel;\n _selfhref: ListHref;\n\n /**\n */\n get type(): string {\n return \"List\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype ?? \"\";\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel;\n return listDetailLink;\n });\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.detail = models.find((childModel) => childModel.type === \"ListDetail\");\n }\n\n /**\n * Getting the label of the list\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext(): string {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection(): ListItemCollection {\n if (!this._listItemCollection) {\n this._listItemCollection = ListItemCollection.createFromList(this);\n }\n\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail(): ?ListDetailModel {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ?ModularUIModel) {\n if (detail instanceof ListDetailModel) {\n const listitemHref = detail.selfhref;\n\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(listitemHref)\n );\n\n if (listitem) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n }\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href)\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(this.data.filter, {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n });\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(this.data.actions, this.contributions.actions);\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref(): ListHref {\n const selfLink = this.links ? this.links.getLinkByKey(\"self\") : null;\n\n if (selfLink !== null) {\n return new ListHref(selfLink.href, this);\n }\n\n return new ListHref();\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): ListHref {\n if (!this._selfhref) {\n this._selfhref = this.setSelfHref();\n }\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader)\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EAAA;IAAA;IAAA,+CACvB,IAAI;IAAA;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AAYT,SAAS,CAAC,CAAC,CAAC,CAAC;UAC9CQ,aAAa,CAACC,YAAY,CAAC,GAAGT,SAAS,CAACS,YAAY,CAAC,CAACnF,KAAK;QAC7D,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAOkF,aAAa;EACtB;;EAEA;AACF;AACA;EACEE,gBAAgB,CAACC,UAAkB,EAAoB;IACrD,OAAO,IAAI,CAACxD,gBAAgB,CAACuD,gBAAgB,CAACC,UAAU,CAAC;EAC3D;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"ListModel.js","names":["ListModel","ResourceModel","type","modelName","isApplicableModel","data","resourceType","contributions","resourcetype","getInitialChildModelLinks","layouthint","has","SHOW_ONE_RESULT_AS_DETAIL","listItemCollection","length","listItem","listDetailLink","selflink","targetModel","ListDetailModel","setChildModels","models","detail","childModel","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","ListItemCollection","createFromList","_detail","listitemHref","selfhref","listitem","equals","setSelfHref","grouping","_grouping","setGrouping","GroupingModel","dynamicschema","contexts","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","HIDE_WHEN_EMPTY","actionCollection","isEmpty","filterCollection","hasActiveFilters","getListItemById","id","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","paging","_paging","setPaging","PagingModel","sorting","_sorting","setSorting","SortingModel","getSortingLabels","_filterCollection","setFilters","FilterCollection","listkey","key","filter","isFiltered","_actionCollection","setActionCollection","ActionCollection","actions","hasList","selfLink","links","getLinkByKey","ListHref","_selfhref","headers","_headers","setHeaders","tempHeaders","results","forEach","attributes","attribute","listHeader","ListHeaderModel","exists","some","tempHeader","CASEVIEW_LINK","push","sortingLabels","attributeKey","getActionsByType","actionType"],"sources":["../../../src/models/list/ListModel.js"],"sourcesContent":["// @flow\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\nimport ListItemCollection from \"../list/ListItemCollection\";\nimport ListDetailModel from \"../list/ListDetailModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport GroupingModel from \"../grouping/GroupingModel\";\nimport ListHeaderModel from \"../list/ListHeaderModel\";\nimport ListHref from \"../href/ListHref\";\nimport ListItemModel from \"../list/ListItemModel\";\nimport PagingModel from \"../paging/PagingModel\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport SortingModel from \"../sorting/SortingModel\";\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\n\n/**\n * Defines a list object\n */\nexport default class ListModel extends ResourceModel {\n _detail: ?ListDetailModel = null;\n _headers: Array<ListHeaderModel>;\n _paging: PagingModel;\n _filterCollection: FilterCollection;\n _sorting: SortingModel;\n _actionCollection: ActionCollection;\n _listItemCollection: ListItemCollection;\n _grouping: GroupingModel;\n _selfhref: ListHref;\n\n /**\n */\n get type(): string {\n return \"List\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ListModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype ?? \"\";\n return (\n resourceType.endsWith(\"List\") ||\n resourceType.endsWith(\"ListPanel\") ||\n resourceType.endsWith(\"RelatedDataStorePanel\") ||\n resourceType.endsWith(\"RelatedDatastorePanel\") ||\n [\n \"list-related-cases\",\n \"RecordPanel\",\n \"EventHistoryPanel\",\n \"NotePanel\",\n \"AppointmentPanel\",\n \"DocumentPanel\",\n \"AssignmentPanel\",\n ].includes(resourceType)\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n if (\n this.layouthint.has(SHOW_ONE_RESULT_AS_DETAIL) &&\n this.listItemCollection.length === 1\n ) {\n return this.listItemCollection.map((listItem) => {\n const listDetailLink = listItem.selflink;\n listDetailLink.targetModel = ListDetailModel;\n return listDetailLink;\n });\n }\n\n return [];\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n this.detail = models.find((childModel) => childModel.type === \"ListDetail\");\n }\n\n /**\n * Getting the label of the list\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Getting the introduction text\n */\n get introtext(): string {\n if (this.data.content) {\n return this.data.content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n * Getting the results\n */\n get listItemCollection(): ListItemCollection {\n if (!this._listItemCollection) {\n this._listItemCollection = ListItemCollection.createFromList(this);\n }\n\n return this._listItemCollection;\n }\n\n /**\n * Set results\n */\n set listItemCollection(listItemCollection: ListItemCollection) {\n this._listItemCollection = listItemCollection;\n }\n\n /**\n * Getting the detail\n */\n get detail(): ?ListDetailModel {\n return this._detail;\n }\n\n /**\n * Add detail model to the {ListModel}\n */\n set detail(detail: ?ModularUIModel) {\n if (detail instanceof ListDetailModel) {\n const listitemHref = detail.selfhref;\n\n const listitem = this.listItemCollection.find((listItem) =>\n listItem.selfhref.equals(listitemHref)\n );\n\n if (listitem) {\n detail.listitem = listitem;\n }\n\n this._detail = detail;\n }\n\n this.setSelfHref();\n }\n\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href)\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(this.data.filter, {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n });\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(this.data.actions, this.contributions.actions);\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n setSelfHref(): ListHref {\n const selfLink = this.links ? this.links.getLinkByKey(\"self\") : null;\n\n if (selfLink !== null) {\n return new ListHref(selfLink.href, this);\n }\n\n return new ListHref();\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): ListHref {\n if (!this._selfhref) {\n this._selfhref = this.setSelfHref();\n }\n return this._selfhref;\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader)\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EAAA;IAAA;IAAA,+CACvB,IAAI;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAUhC;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,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CAAC,CAACnF,KAAK;QAC7D,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAOkF,aAAa;EACtB;;EAEA;AACF;AACA;EACEE,gBAAgB,CAACC,UAAkB,EAAoB;IACrD,OAAO,IAAI,CAACxD,gBAAgB,CAACuD,gBAAgB,CAACC,UAAU,CAAC;EAC3D;AACF;AAAC"}
|
|
@@ -33,6 +33,12 @@ export default class LookupOptionsModel extends ResourceModel {
|
|
|
33
33
|
return "LookupOptions";
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
*/
|
|
38
|
+
static get modelName(): string {
|
|
39
|
+
return "LookupOptionsModel";
|
|
40
|
+
}
|
|
41
|
+
|
|
36
42
|
/**
|
|
37
43
|
*/
|
|
38
44
|
static isApplicableModel(data: ModularUIResponse): boolean {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LookupOptionsModel.js","names":["LookupOptionsModel","ResourceModel","constructor","modularuiResponse","_options","LookupOptionCollection","create","data","contributions","_filterCollection","createFilterCollection","type","isApplicableModel","resourcetype","options","FilterCollection","name","filter","filterCollection"],"sources":["../../../src/models/lookup/LookupOptionsModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LookupOptionCollection from \"../lookup/LookupOptionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n */\nexport default class LookupOptionsModel extends ResourceModel {\n _options: LookupOptionCollection;\n _filterCollection: ?FilterCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter\n );\n }\n\n /**\n */\n get type(): string {\n return \"LookupOptions\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"lookupOptions\"\n );\n }\n\n /**\n */\n get options(): LookupOptionCollection {\n return this._options;\n }\n\n /**\n */\n createFilterCollection(\n data: Object,\n contributions: Object\n ): FilterCollection {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions }\n );\n }\n\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): ?FilterCollection {\n return this._filterCollection;\n }\n}\n"],"mappings":";;;;;;;;;AACA;AACA;AACA;AAIA;AACA;AACe,MAAMA,kBAAkB,SAASC,sBAAa,CAAC;EAI5D;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,QAAQ,GAAGC,+BAAsB,CAACC,MAAM,CAC3C,IAAI,CAACC,IAAI,EACT,IAAI,CAACC,aAAa,CACnB;IAED,IAAI,CAACC,iBAAiB,GAAG,IAAI,CAACC,sBAAsB,sBAClD,IAAI,CAACH,IAAI,wBACT,IAAI,CAACC,aAAa,EACnB;EACH;;EAEA;AACF;EACE,IAAIG,IAAI,GAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"LookupOptionsModel.js","names":["LookupOptionsModel","ResourceModel","constructor","modularuiResponse","_options","LookupOptionCollection","create","data","contributions","_filterCollection","createFilterCollection","type","modelName","isApplicableModel","resourcetype","options","FilterCollection","name","filter","filterCollection"],"sources":["../../../src/models/lookup/LookupOptionsModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport LookupOptionCollection from \"../lookup/LookupOptionCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n */\nexport default class LookupOptionsModel extends ResourceModel {\n _options: LookupOptionCollection;\n _filterCollection: ?FilterCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._options = LookupOptionCollection.create(\n this.data,\n this.contributions\n );\n\n this._filterCollection = this.createFilterCollection(\n this.data.filter,\n this.contributions.filter\n );\n }\n\n /**\n */\n get type(): string {\n return \"LookupOptions\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"LookupOptionsModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"lookupOptions\"\n );\n }\n\n /**\n */\n get options(): LookupOptionCollection {\n return this._options;\n }\n\n /**\n */\n createFilterCollection(\n data: Object,\n contributions: Object\n ): FilterCollection {\n if (data && contributions) {\n return new FilterCollection(\n { [data.name]: data },\n { filter: contributions }\n );\n }\n\n return new FilterCollection();\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): ?FilterCollection {\n return this._filterCollection;\n }\n}\n"],"mappings":";;;;;;;;;AACA;AACA;AACA;AAIA;AACA;AACe,MAAMA,kBAAkB,SAASC,sBAAa,CAAC;EAI5D;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,QAAQ,GAAGC,+BAAsB,CAACC,MAAM,CAC3C,IAAI,CAACC,IAAI,EACT,IAAI,CAACC,aAAa,CACnB;IAED,IAAI,CAACC,iBAAiB,GAAG,IAAI,CAACC,sBAAsB,sBAClD,IAAI,CAACH,IAAI,wBACT,IAAI,CAACC,aAAa,EACnB;EACH;;EAEA;AACF;EACE,IAAIG,IAAI,GAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,oBAAoB;EAC7B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACN,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACM,YAAY,IAC/BP,IAAI,CAACC,aAAa,CAACM,YAAY,KAAK,eAAe;EAEvD;;EAEA;AACF;EACE,IAAIC,OAAO,GAA2B;IACpC,OAAO,IAAI,CAACX,QAAQ;EACtB;;EAEA;AACF;EACEM,sBAAsB,CACpBH,IAAY,EACZC,aAAqB,EACH;IAClB,IAAID,IAAI,IAAIC,aAAa,EAAE;MACzB,OAAO,IAAIQ,yBAAgB,CACzB;QAAE,CAACT,IAAI,CAACU,IAAI,GAAGV;MAAK,CAAC,EACrB;QAAEW,MAAM,EAAEV;MAAc,CAAC,CAC1B;IACH;IAEA,OAAO,IAAIQ,yBAAgB,EAAE;EAC/B;;EAEA;AACF;AACA;EACE,IAAIG,gBAAgB,GAAsB;IACxC,OAAO,IAAI,CAACV,iBAAiB;EAC/B;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelCatalogModel.js","names":["ModelCatalogModel","ResourceModel","type","isApplicableModel","data","contributions","resourcetype","label","locale","conceptIndexLink","link","links","getLinkByKey","IllegalStateException","contentIndexLink"],"sources":["../../../src/models/modelcatalog/ModelCatalogModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport { IllegalStateException } from \"../../exceptions\";\n\n/**\n * The Application model\n */\nexport default class ModelCatalogModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ModelCatalog\";\n }\n\n /**\n */\n static isApplicableModel(data: Object): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ModelCatalog\"\n );\n }\n\n /**\n */\n get label(): string {\n return this.locale === \"nl\" ? \"Model catalogus\" : \"Model catalog\";\n }\n\n /**\n * Retrieve link to Concept Index model\n */\n get conceptIndexLink(): LinkModel {\n const link = this.links.getLinkByKey(\"concepts\");\n if (!link) {\n throw new IllegalStateException(\n \"Missing concepts index link in model catalog\"\n );\n }\n return link;\n }\n\n /**\n * Retrieve link to Content Index model\n */\n get contentIndexLink(): LinkModel {\n const link = this.links.getLinkByKey(\"content\");\n if (!link) {\n throw new IllegalStateException(\n \"Missing content index link in model catalog\"\n );\n }\n return link;\n }\n}\n"],"mappings":";;;;;;;AACA;AAGA;AAEA;AACA;AACA;AACe,MAAMA,iBAAiB,SAASC,sBAAa,CAAC;EAC3D;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAY,EAAW;IAC9C,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,cAAc;EAEtD;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,MAAM,KAAK,IAAI,GAAG,iBAAiB,GAAG,eAAe;EACnE;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgB,GAAc;IAChC,MAAMC,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,UAAU,CAAC;IAChD,IAAI,CAACF,IAAI,EAAE;MACT,MAAM,IAAIG,iCAAqB,CAC7B,8CAA8C,CAC/C;IACH;IACA,OAAOH,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAII,gBAAgB,GAAc;IAChC,MAAMJ,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,SAAS,CAAC;IAC/C,IAAI,CAACF,IAAI,EAAE;MACT,MAAM,IAAIG,iCAAqB,CAC7B,6CAA6C,CAC9C;IACH;IACA,OAAOH,IAAI;EACb;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"ModelCatalogModel.js","names":["ModelCatalogModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","label","locale","conceptIndexLink","link","links","getLinkByKey","IllegalStateException","contentIndexLink"],"sources":["../../../src/models/modelcatalog/ModelCatalogModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type LinkModel from \"../links/LinkModel\";\nimport { IllegalStateException } from \"../../exceptions\";\n\n/**\n * The Application model\n */\nexport default class ModelCatalogModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"ModelCatalog\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ModelCatalogModel\";\n }\n\n /**\n */\n static isApplicableModel(data: Object): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"ModelCatalog\"\n );\n }\n\n /**\n */\n get label(): string {\n return this.locale === \"nl\" ? \"Model catalogus\" : \"Model catalog\";\n }\n\n /**\n * Retrieve link to Concept Index model\n */\n get conceptIndexLink(): LinkModel {\n const link = this.links.getLinkByKey(\"concepts\");\n if (!link) {\n throw new IllegalStateException(\n \"Missing concepts index link in model catalog\"\n );\n }\n return link;\n }\n\n /**\n * Retrieve link to Content Index model\n */\n get contentIndexLink(): LinkModel {\n const link = this.links.getLinkByKey(\"content\");\n if (!link) {\n throw new IllegalStateException(\n \"Missing content index link in model catalog\"\n );\n }\n return link;\n }\n}\n"],"mappings":";;;;;;;AACA;AAGA;AAEA;AACA;AACA;AACe,MAAMA,iBAAiB,SAASC,sBAAa,CAAC;EAC3D;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,cAAc;EACvB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,mBAAmB;EAC5B;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAY,EAAW;IAC9C,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,cAAc;EAEtD;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACC,MAAM,KAAK,IAAI,GAAG,iBAAiB,GAAG,eAAe;EACnE;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgB,GAAc;IAChC,MAAMC,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,UAAU,CAAC;IAChD,IAAI,CAACF,IAAI,EAAE;MACT,MAAM,IAAIG,iCAAqB,CAC7B,8CAA8C,CAC/C;IACH;IACA,OAAOH,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAII,gBAAgB,GAAc;IAChC,MAAMJ,IAAI,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,SAAS,CAAC;IAC/C,IAAI,CAACF,IAAI,EAAE;MACT,MAAM,IAAIG,iCAAqB,CAC7B,6CAA6C,CAC9C;IACH;IACA,OAAOH,IAAI;EACb;AACF;AAAC"}
|
|
@@ -30,6 +30,12 @@ export default class GroupingPanelModel extends ResourceModel {
|
|
|
30
30
|
return "GroupingPanel";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
*/
|
|
35
|
+
static get modelName(): string {
|
|
36
|
+
return "GroupingPanelModel";
|
|
37
|
+
}
|
|
38
|
+
|
|
33
39
|
/**
|
|
34
40
|
*/
|
|
35
41
|
static isApplicableModel(data: ModularUIResponse): boolean {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GroupingPanelModel.js","names":["GroupingPanelModel","ResourceModel","constructor","modularuiResponse","createTaskGroupCollection","type","isApplicableModel","data","contributions","resourcetype","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","taskgroup","some","taskgroupContribution","name","taskgroupContributions","create","taskgroups","_taskGroupCollection","TaskGroupCollection","hasTaskGroups","hasItems","hasTasks"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n )\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AAEA;AAOA;AACA;AACA;AACe,MAAMA,kBAAkB,SAASC,sBAAa,CAAC;EAG5D;AACF;AACA;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,IAAI,CAACC,yBAAyB,EAAE;EAClC;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IAAA;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/B,mCAAC,eAAe,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,iBAC3DF,IAAI,CAACC,aAAa,CAACC,YAAY,CAChC;EAEL;;EAEA;AACF;AACA;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACF,aAAa,CAACE,KAAK;EACjC;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,OAAO,IAAI,CAACC,KAAK,CAACC,eAAe,CAAC,WAAW,CAAC,CAACC,GAAG;EACpD;;EAEA;AACF;EACE,IAAIC,UAAU,GAAmB;IAC/B,OAAO,IAAI,CAACH,KAAK,CAACC,eAAe,CAAC,OAAO,CAAC;EAC5C;;EAEA;AACF;EACEG,cAAc,CAACC,MAA6B,EAAE;IAC5C,MAAMC,UAAU,GAAG,EAAE;IAErB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,MAAM,EAAED,CAAC,EAAE,EAAE;MACtC,IAAIF,MAAM,CAACE,CAAC,CAAC,YAAYE,uBAAc,EAAE;QACvCH,UAAU,CAACI,IAAI,CAACL,MAAM,CAACE,CAAC,CAAC,CAAC;MAC5B;IACF;IAEA,IAAI,CAACI,mBAAmB,CAACC,GAAG,CAACN,UAAU,CAAC;EAC1C;;EAEA;AACF;AACA;EACEO,YAAY,GAAY;IACtB,OAAO,IAAI,CAACC,SAAS,KAAK,EAAE;EAC9B;;EAEA;AACF;AACA;EACE,IAAIA,SAAS,GAAW;IACtB,IAAI,IAAI,CAACnB,IAAI,CAACoB,QAAQ,EAAE;MACtB,OAAO,IAAI,CAACpB,IAAI,CAACoB,QAAQ,CAACC,IAAI,CAACC,OAAO;IACxC;IAEA,IAAI,IAAI,CAACrB,aAAa,CAACoB,IAAI,EAAE;MAC3B,OAAO,IAAI,CAACpB,aAAa,CAACoB,IAAI,CAACC,OAAO,IAAI,IAAI,CAACrB,aAAa,CAACoB,IAAI;IACnE;IAEA,IAAIE,KAAK,CAACC,OAAO,CAAC,IAAI,CAACvB,aAAa,CAACwB,KAAK,CAAC,EAAE;MAC3C,OAAO,IAAI,CAACxB,aAAa,CAACwB,KAAK,CAAC,CAAC,CAAC,CAACJ,IAAI;IACzC;IAEA,OAAO,EAAE;EACX;;EAEA;AACF;
|
|
1
|
+
{"version":3,"file":"GroupingPanelModel.js","names":["GroupingPanelModel","ResourceModel","constructor","modularuiResponse","createTaskGroupCollection","type","modelName","isApplicableModel","data","contributions","resourcetype","label","getInitialChildModelLinks","links","getLinksByGroup","all","panelLinks","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","hasIntroText","introtext","_content","text","message","Array","isArray","texts","allTaskgroupsData","getData","allTaskgroupsContributions","getContribution","taskgroup","some","taskgroupContribution","name","taskgroupContributions","create","taskgroups","_taskGroupCollection","TaskGroupCollection","hasTaskGroups","hasItems","hasTasks"],"sources":["../../../src/models/panels/GroupingPanelModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\n\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Panel that groups other panels\n */\nexport default class GroupingPanelModel extends ResourceModel {\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n * Constructs GroupingPanel\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n }\n\n /**\n */\n get type(): string {\n return \"GroupingPanel\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"GroupingPanelModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n [\"GroupingPanel\", \"CaseTabGroupingPanel\", \"TabGroupingPanel\"].includes(\n data.contributions.resourcetype\n )\n );\n }\n\n /**\n * Getting the label of the panel\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\").all;\n }\n\n /**\n */\n get panelLinks(): LinkCollection {\n return this.links.getLinksByGroup(\"panel\");\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n * Check if an introtext exists for this caseview\n */\n hasIntroText(): boolean {\n return this.introtext !== \"\";\n }\n\n /**\n * Getting the introduction text configured on the grouping panel\n */\n get introtext(): string {\n if (this.data._content) {\n return this.data._content.text.message;\n }\n\n if (this.contributions.text) {\n return this.contributions.text.message ?? this.contributions.text;\n }\n\n if (Array.isArray(this.contributions.texts)) {\n return this.contributions.texts[0].text;\n }\n\n return \"\";\n }\n\n /**\n */\n createTaskGroupCollection() {\n const allTaskgroupsData = this.getData(\"taskgroups\", []);\n const allTaskgroupsContributions = this.getContribution(\"taskgroups\", []);\n\n this.taskGroupCollection = allTaskgroupsData\n .filter((taskgroup) =>\n allTaskgroupsContributions.some(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n )\n )\n .map((taskgroup) => {\n const taskgroupContributions = allTaskgroupsContributions.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n });\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection.hasItems;\n }\n\n /**\n * Has tasks\n */\n hasTasks(): boolean {\n return this.taskGroupCollection.hasTasks();\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AAEA;AAOA;AACA;AACA;AACe,MAAMA,kBAAkB,SAASC,sBAAa,CAAC;EAG5D;AACF;AACA;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAEzB,IAAI,CAACC,yBAAyB,EAAE;EAClC;;EAEA;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,eAAe;EACxB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,oBAAoB;EAC7B;;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EAEA;AACF;AACA;EACEC,QAAQ,GAAY;IAClB,OAAO,IAAI,CAACzB,mBAAmB,CAACyB,QAAQ,EAAE;EAC5C;AACF;AAAC"}
|
|
@@ -39,14 +39,15 @@ const RESOURCE_MODELS = [_ApplicationModel.default, _TabModel.default, _ListDeta
|
|
|
39
39
|
/**
|
|
40
40
|
* Resolve a model by resource
|
|
41
41
|
*/
|
|
42
|
-
const resolveModel = data
|
|
42
|
+
const resolveModel = function (data) {
|
|
43
|
+
let availableModels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : RESOURCE_MODELS;
|
|
43
44
|
if (!data) {
|
|
44
45
|
throw new _exceptions.IllegalArgumentException("No data or contribution available, cannot resolve model");
|
|
45
46
|
}
|
|
46
47
|
if (!(0, _objects.has)(data.contributions, "resourcetype")) {
|
|
47
|
-
throw new _exceptions.IllegalArgumentException("Data has wrong format, missing resourcetype in contributions, cannot resolve model");
|
|
48
|
+
throw new _exceptions.IllegalArgumentException("Data has wrong format, missing resourcetype property in contributions, cannot resolve model");
|
|
48
49
|
}
|
|
49
|
-
const resourceTypeModel = (0, _find.default)(
|
|
50
|
+
const resourceTypeModel = (0, _find.default)(availableModels).call(availableModels, resourceModel => resourceModel.isApplicableModel(data));
|
|
50
51
|
if (resourceTypeModel) {
|
|
51
52
|
return resourceTypeModel;
|
|
52
53
|
}
|
|
@@ -25,9 +25,10 @@ import ContentModel from "./content/ContentModel";
|
|
|
25
25
|
import ContentTypeModel from "./content/ContentTypeModel";
|
|
26
26
|
import LookupOptionsModel from "./lookup/LookupOptionsModel";
|
|
27
27
|
|
|
28
|
+
import { IllegalArgumentException } from "../exceptions";
|
|
29
|
+
|
|
28
30
|
import type ModularUIResponse from "../modularui/ModularUIResponse";
|
|
29
31
|
import type { ModularUIModel } from "./types";
|
|
30
|
-
import { IllegalArgumentException } from "../exceptions";
|
|
31
32
|
|
|
32
33
|
/**
|
|
33
34
|
* Mapping of models and resourcetypes
|
|
@@ -62,7 +63,8 @@ const RESOURCE_MODELS = [
|
|
|
62
63
|
* Resolve a model by resource
|
|
63
64
|
*/
|
|
64
65
|
const resolveModel = (
|
|
65
|
-
data: ModularUIResponse
|
|
66
|
+
data: ModularUIResponse,
|
|
67
|
+
availableModels: Array<Class<ModularUIModel>> = RESOURCE_MODELS
|
|
66
68
|
): Class<ModularUIModel> | null => {
|
|
67
69
|
if (!data) {
|
|
68
70
|
throw new IllegalArgumentException(
|
|
@@ -72,11 +74,11 @@ const resolveModel = (
|
|
|
72
74
|
|
|
73
75
|
if (!has(data.contributions, "resourcetype")) {
|
|
74
76
|
throw new IllegalArgumentException(
|
|
75
|
-
"Data has wrong format, missing resourcetype in contributions, cannot resolve model"
|
|
77
|
+
"Data has wrong format, missing resourcetype property in contributions, cannot resolve model"
|
|
76
78
|
);
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
const resourceTypeModel =
|
|
81
|
+
const resourceTypeModel = availableModels.find((resourceModel) =>
|
|
80
82
|
resourceModel.isApplicableModel(data)
|
|
81
83
|
);
|
|
82
84
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveModel.js","names":["RESOURCE_MODELS","ApplicationModel","TabModel","ListDetailModel","ListModel","GroupingPanelModel","CaseSearchModel","CaseViewModel","DetailModel","TaskGroupModel","FormModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","BusinessScenarioModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","resolveModel","data","IllegalArgumentException","has","contributions","resourceTypeModel","resourceModel","isApplicableModel"],"sources":["../../src/models/resolveModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport ApplicationModel from \"./application/ApplicationModel\";\nimport CaseSearchModel from \"./search/CaseSearchModel\";\nimport CaseViewModel from \"./caseview/CaseViewModel\";\nimport DetailModel from \"./detail/DetailModel\";\nimport FormModel from \"./form/FormModel\";\nimport GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport ListModel from \"./list/ListModel\";\nimport ListDetailModel from \"./list/ListDetailModel\";\nimport TabModel from \"./tab/TabModel\";\nimport TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport UserModel from \"./user/UserModel\";\nimport UserProfileModel from \"./user/UserProfileModel\";\nimport UserServicesModel from \"./user/UserServicesModel\";\nimport ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport ContentIndexModel from \"./content/ContentIndexModel\";\nimport ContentTOCModel from \"./content/ContentTOCModel\";\nimport ContentModel from \"./content/ContentModel\";\nimport ContentTypeModel from \"./content/ContentTypeModel\";\nimport LookupOptionsModel from \"./lookup/LookupOptionsModel\";\n\nimport
|
|
1
|
+
{"version":3,"file":"resolveModel.js","names":["RESOURCE_MODELS","ApplicationModel","TabModel","ListDetailModel","ListModel","GroupingPanelModel","CaseSearchModel","CaseViewModel","DetailModel","TaskGroupModel","FormModel","UserModel","UserProfileModel","UserServicesModel","ModelCatalogModel","ConceptIndexModel","BusinessScenarioModel","ConceptDetailModel","ConceptTypeDetailModel","ContentIndexModel","ContentTOCModel","ContentModel","ContentTypeModel","LookupOptionsModel","resolveModel","data","availableModels","IllegalArgumentException","has","contributions","resourceTypeModel","resourceModel","isApplicableModel"],"sources":["../../src/models/resolveModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../utils/helpers/objects\";\n\nimport ApplicationModel from \"./application/ApplicationModel\";\nimport CaseSearchModel from \"./search/CaseSearchModel\";\nimport CaseViewModel from \"./caseview/CaseViewModel\";\nimport DetailModel from \"./detail/DetailModel\";\nimport FormModel from \"./form/FormModel\";\nimport GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport ListModel from \"./list/ListModel\";\nimport ListDetailModel from \"./list/ListDetailModel\";\nimport TabModel from \"./tab/TabModel\";\nimport TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport UserModel from \"./user/UserModel\";\nimport UserProfileModel from \"./user/UserProfileModel\";\nimport UserServicesModel from \"./user/UserServicesModel\";\nimport ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport ContentIndexModel from \"./content/ContentIndexModel\";\nimport ContentTOCModel from \"./content/ContentTOCModel\";\nimport ContentModel from \"./content/ContentModel\";\nimport ContentTypeModel from \"./content/ContentTypeModel\";\nimport LookupOptionsModel from \"./lookup/LookupOptionsModel\";\n\nimport { IllegalArgumentException } from \"../exceptions\";\n\nimport type ModularUIResponse from \"../modularui/ModularUIResponse\";\nimport type { ModularUIModel } from \"./types\";\n\n/**\n * Mapping of models and resourcetypes\n */\nconst RESOURCE_MODELS = [\n ApplicationModel,\n TabModel,\n ListDetailModel,\n ListModel,\n GroupingPanelModel,\n CaseSearchModel,\n CaseViewModel,\n DetailModel,\n TaskGroupModel,\n FormModel,\n UserModel,\n UserProfileModel,\n UserServicesModel,\n ModelCatalogModel,\n ConceptIndexModel,\n BusinessScenarioModel,\n ConceptDetailModel,\n ConceptTypeDetailModel,\n ContentIndexModel,\n ContentTOCModel,\n ContentModel,\n ContentTypeModel,\n LookupOptionsModel,\n];\n\n/**\n * Resolve a model by resource\n */\nconst resolveModel = (\n data: ModularUIResponse,\n availableModels: Array<Class<ModularUIModel>> = RESOURCE_MODELS\n): Class<ModularUIModel> | null => {\n if (!data) {\n throw new IllegalArgumentException(\n \"No data or contribution available, cannot resolve model\"\n );\n }\n\n if (!has(data.contributions, \"resourcetype\")) {\n throw new IllegalArgumentException(\n \"Data has wrong format, missing resourcetype property in contributions, cannot resolve model\"\n );\n }\n\n const resourceTypeModel = availableModels.find((resourceModel) =>\n resourceModel.isApplicableModel(data)\n );\n\n if (resourceTypeModel) {\n return resourceTypeModel;\n }\n\n return null;\n};\n\nexport default resolveModel;\n"],"mappings":";;;;;;;;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AACA;AACA;AACA,MAAMA,eAAe,GAAG,CACtBC,yBAAgB,EAChBC,iBAAQ,EACRC,wBAAe,EACfC,kBAAS,EACTC,2BAAkB,EAClBC,wBAAe,EACfC,sBAAa,EACbC,oBAAW,EACXC,uBAAc,EACdC,kBAAS,EACTC,kBAAS,EACTC,yBAAgB,EAChBC,0BAAiB,EACjBC,0BAAiB,EACjBC,0BAAiB,EACjBC,8BAAqB,EACrBC,2BAAkB,EAClBC,+BAAsB,EACtBC,0BAAiB,EACjBC,wBAAe,EACfC,qBAAY,EACZC,yBAAgB,EAChBC,2BAAkB,CACnB;;AAED;AACA;AACA;AACA,MAAMC,YAAY,GAAG,UACnBC,IAAuB,EAEU;EAAA,IADjCC,eAA6C,uEAAG1B,eAAe;EAE/D,IAAI,CAACyB,IAAI,EAAE;IACT,MAAM,IAAIE,oCAAwB,CAChC,yDAAyD,CAC1D;EACH;EAEA,IAAI,CAAC,IAAAC,YAAG,EAACH,IAAI,CAACI,aAAa,EAAE,cAAc,CAAC,EAAE;IAC5C,MAAM,IAAIF,oCAAwB,CAChC,6FAA6F,CAC9F;EACH;EAEA,MAAMG,iBAAiB,GAAG,mBAAAJ,eAAe,OAAfA,eAAe,EAAOK,aAAa,IAC3DA,aAAa,CAACC,iBAAiB,CAACP,IAAI,CAAC,CACtC;EAED,IAAIK,iBAAiB,EAAE;IACrB,OAAOA,iBAAiB;EAC1B;EAEA,OAAO,IAAI;AACb,CAAC;AAAC,eAEaN,YAAY;AAAA"}
|
|
@@ -14,6 +14,12 @@ export default class CaseSearchModel extends ListModel {
|
|
|
14
14
|
return "CaseSearch";
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
*/
|
|
19
|
+
static get modelName(): string {
|
|
20
|
+
return "CaseSearchModel";
|
|
21
|
+
}
|
|
22
|
+
|
|
17
23
|
/**
|
|
18
24
|
*/
|
|
19
25
|
static isApplicableModel(data: ModularUIResponse): boolean {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CaseSearchModel.js","names":["CaseSearchModel","ListModel","type","isApplicableModel","data","contributions","resourcetype","getQuickSearchFilters","filterCollection","filter","isQuickSearch","hasQuickSearchFilters","length"],"sources":["../../../src/models/search/CaseSearchModel.js"],"sourcesContent":["// @flow\nimport ListModel from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType } from \"../types\";\n\n/**\n * Case search model\n */\nexport default class CaseSearchModel extends ListModel {\n /**\n */\n get type(): string {\n return \"CaseSearch\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseSearch\"\n );\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters(): Array<FilterType> {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n /**\n */\n hasQuickSearchFilters(): boolean {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA;AAKA;AACA;AACA;AACe,MAAMA,eAAe,SAASC,kBAAS,CAAC;EACrD;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;AACA;EACEC,qBAAqB,GAAsB;IAAA;IACzC,OAAO,IAAI,CAACC,gBAAgB,GACxB,oCAAI,CAACA,gBAAgB,iBAASC,MAAM,IAAKA,MAAM,CAACC,aAAa,EAAE,CAAC,GAChE,EAAE;EACR;;EAEA;AACF;EACEC,qBAAqB,GAAY;IAC/B,OAAO,IAAI,CAACJ,qBAAqB,EAAE,CAACK,MAAM,GAAG,CAAC;EAChD;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"CaseSearchModel.js","names":["CaseSearchModel","ListModel","type","modelName","isApplicableModel","data","contributions","resourcetype","getQuickSearchFilters","filterCollection","filter","isQuickSearch","hasQuickSearchFilters","length"],"sources":["../../../src/models/search/CaseSearchModel.js"],"sourcesContent":["// @flow\nimport ListModel from \"../list/ListModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType } from \"../types\";\n\n/**\n * Case search model\n */\nexport default class CaseSearchModel extends ListModel {\n /**\n */\n get type(): string {\n return \"CaseSearch\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"CaseSearchModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"CaseSearch\"\n );\n }\n\n /**\n * Retrieve quick search filters\n */\n getQuickSearchFilters(): Array<FilterType> {\n return this.filterCollection\n ? this.filterCollection.filter((filter) => filter.isQuickSearch())\n : [];\n }\n\n /**\n */\n hasQuickSearchFilters(): boolean {\n return this.getQuickSearchFilters().length > 0;\n }\n}\n"],"mappings":";;;;;;;;AACA;AAKA;AACA;AACA;AACe,MAAMA,eAAe,SAASC,kBAAS,CAAC;EACrD;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,YAAY;EACrB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,iBAAiB;EAC1B;;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;AACA;EACEC,qBAAqB,GAAsB;IAAA;IACzC,OAAO,IAAI,CAACC,gBAAgB,GACxB,oCAAI,CAACA,gBAAgB,iBAASC,MAAM,IAAKA,MAAM,CAACC,aAAa,EAAE,CAAC,GAChE,EAAE;EACR;;EAEA;AACF;EACEC,qBAAqB,GAAY;IAC/B,OAAO,IAAI,CAACJ,qBAAqB,EAAE,CAACK,MAAM,GAAG,CAAC;EAChD;AACF;AAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabModel.js","names":["TabModel","ResourceModel","constructor","modularuiResponse","createTaskGroupCollection","_actionCollection","ActionCollection","data","actions","contributions","type","isApplicableModel","resourcetype","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","searchLink","first","taskgroups","taskgroup","taskgroupContributions","taskgroupContribution","name","create","_taskGroupCollection","TaskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACe,MAAMA,QAAQ,SAASC,sBAAa,CAAC;EAIlD;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,yBAAyB,EAAE;IAEhC,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;EACH;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TabModel.js","names":["TabModel","ResourceModel","constructor","modularuiResponse","createTaskGroupCollection","_actionCollection","ActionCollection","data","actions","contributions","type","modelName","isApplicableModel","resourcetype","getInitialChildModelLinks","links","getLinksByGroup","all","setChildModels","models","taskGroups","i","length","TaskGroupModel","push","taskGroupCollection","add","searchLink","first","taskgroups","taskgroup","taskgroupContributions","taskgroupContribution","name","create","_taskGroupCollection","TaskGroupCollection","label","getContribution","components","actionCollection","hasComponents","size","hasTaskGroups","hasItems","hasActions"],"sources":["../../../src/models/tab/TabModel.js"],"sourcesContent":["// @flow\nimport TaskGroupCollection from \"../taskgroup/TaskGroupCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\nimport TaskGroupModel from \"../taskgroup/TaskGroupModel\";\nimport ActionCollection from \"../actions/ActionCollection\";\n\nimport type { ModularUIModel } from \"../types\";\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type LinkCollection from \"../links/LinkCollection\";\n\n/**\n * Describes a TabModel\n */\nexport default class TabModel extends ResourceModel {\n _actionCollection: ActionCollection;\n _taskGroupCollection: TaskGroupCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this.createTaskGroupCollection();\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n }\n\n /**\n */\n get type(): string {\n return \"Tab\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TabModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n (data.contributions.resourcetype.endsWith(\"Tab\") ||\n data.contributions.resourcetype.endsWith(\"KnowledgeBank\"))\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.links.getLinksByGroup(\"taskgroup\", \"actions\").all;\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>) {\n const taskGroups = [];\n\n for (let i = 0; i < models.length; i++) {\n if (models[i] instanceof TaskGroupModel) {\n taskGroups.push(models[i]);\n }\n }\n\n this.taskGroupCollection.add(taskGroups);\n }\n\n /**\n */\n get searchLink(): ?LinkModel {\n return this.links.getLinksByGroup(\"search\").first;\n }\n\n /**\n */\n createTaskGroupCollection() {\n this.taskGroupCollection = this.data.taskgroups\n ? this.data.taskgroups\n .map((taskgroup) => {\n const taskgroupContributions = this.contributions.taskgroups.find(\n (taskgroupContribution) =>\n taskgroupContribution.name === taskgroup.name\n );\n\n if (taskgroupContributions) {\n return TaskGroupModel.create(\n taskgroup.name,\n taskgroup,\n taskgroupContributions\n );\n }\n\n return null;\n })\n .filter((taskgroup) => taskgroup != null)\n : [];\n }\n\n /**\n * Getting the taskgrouppanels on the tab\n */\n get taskGroupCollection(): TaskGroupCollection {\n return this._taskGroupCollection;\n }\n\n /**\n * Setting the taskgroup panel collection\n */\n set taskGroupCollection(taskgroups: Array<TaskGroupModel>) {\n this._taskGroupCollection = new TaskGroupCollection(taskgroups);\n }\n\n /**\n * Getting the label of the tab\n */\n get label(): string {\n return this.getContribution(\"label\", \"\");\n }\n\n /**\n * Getting the component links on the tab\n */\n get components(): LinkCollection {\n return this.links.getLinksByGroup(\"component\", \"search\");\n }\n\n /**\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n\n /**\n * Has component links\n */\n hasComponents(): boolean {\n return this.components.size > 0;\n }\n\n /**\n * Has taskgroups\n */\n hasTaskGroups(): boolean {\n return this.taskGroupCollection && this.taskGroupCollection?.hasItems;\n }\n\n /**\n */\n hasActions(): boolean {\n return this.actionCollection && this.actionCollection.hasItems;\n }\n}\n"],"mappings":";;;;;;;;;;;;AACA;AACA;AACA;AACA;AAOA;AACA;AACA;AACe,MAAMA,QAAQ,SAASC,sBAAa,CAAC;EAIlD;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,yBAAyB,EAAE;IAEhC,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;EACH;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,KAAK;EACd;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,UAAU;EACnB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACL,IAAuB,EAAW;IAAA;IACzD,OACEA,IAAI,CAACE,aAAa,CAACI,YAAY,KAC9B,kCAAAN,IAAI,CAACE,aAAa,CAACI,YAAY,iBAAU,KAAK,CAAC,IAC9C,mCAAAN,IAAI,CAACE,aAAa,CAACI,YAAY,kBAAU,eAAe,CAAC,CAAC;EAEhE;;EAEA;AACF;EACEC,yBAAyB,GAAqB;IAC5C,OAAO,IAAI,CAACC,KAAK,CAACC,eAAe,CAAC,WAAW,EAAE,SAAS,CAAC,CAACC,GAAG;EAC/D;;EAEA;AACF;EACEC,cAAc,CAACC,MAA6B,EAAE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;IAClB,OAAO,IAAI,CAACC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;EAC1C;;EAEA;AACF;AACA;EACE,IAAIC,UAAU,GAAmB;IAC/B,OAAO,IAAI,CAACxB,KAAK,CAACC,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC;EAC1D;;EAEA;AACF;EACE,IAAIwB,gBAAgB,GAAqB;IACvC,OAAO,IAAI,CAACnC,iBAAiB;EAC/B;;EAEA;AACF;AACA;EACEoC,aAAa,GAAY;IACvB,OAAO,IAAI,CAACF,UAAU,CAACG,IAAI,GAAG,CAAC;EACjC;;EAEA;AACF;AACA;EACEC,aAAa,GAAY;IACvB,OAAO,IAAI,CAAClB,mBAAmB,IAAI,IAAI,CAACA,mBAAmB,EAAEmB,QAAQ;EACvE;;EAEA;AACF;EACEC,UAAU,GAAY;IACpB,OAAO,IAAI,CAACL,gBAAgB,IAAI,IAAI,CAACA,gBAAgB,CAACI,QAAQ;EAChE;AACF;AAAC"}
|
|
@@ -51,6 +51,12 @@ export default class TaskGroupModel extends ResourceModel {
|
|
|
51
51
|
return "TaskGroup";
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
*/
|
|
56
|
+
static get modelName(): string {
|
|
57
|
+
return "TaskGroupModel";
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
/**
|
|
55
61
|
*/
|
|
56
62
|
static isApplicableModel(data: ModularUIResponse): boolean {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGroupModel.js","names":["TaskGroupModel","ResourceModel","constructor","modularuiResponse","_actionCollection","ActionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","isApplicableModel","resourcetype","label","actionCollection"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n}\n"],"mappings":";;;;;;;;AACA;AACA;AAEA;AAEA;AACA;AACA;AACe,MAAMA,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;IAED,MAAME,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAM,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,EAAE;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIR,cAAc,CAACoB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"TaskGroupModel.js","names":["TaskGroupModel","ResourceModel","constructor","modularuiResponse","_actionCollection","ActionCollection","data","actions","contributions","selfHref","links","getLinkByKey","selflink","href","_key","substring","lastIndexOf","name","create","key","taskgroup","ModularUIResponse","type","modelName","isApplicableModel","resourcetype","label","actionCollection"],"sources":["../../../src/models/taskgroup/TaskGroupModel.js"],"sourcesContent":["// @flow\nimport ActionCollection from \"../actions/ActionCollection\";\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport ModularUIResponse from \"../../modularui/ModularUIResponse\";\n\n/**\n * TaskGroupModel\n */\nexport default class TaskGroupModel extends ResourceModel {\n _key: string;\n _actionCollection: ActionCollection;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._actionCollection = new ActionCollection(\n this.data.actions,\n this.contributions.actions\n );\n\n const selfHref = this.links.getLinkByKey(\"self\")\n ? this.selflink.href.href\n : null;\n\n this._key = selfHref\n ? selfHref.substring(selfHref.lastIndexOf(\"/\") + 1)\n : this.data.name;\n }\n\n /**\n */\n static create(\n key: string,\n data: Object,\n contributions: Object\n ): TaskGroupModel {\n const taskgroup = new ModularUIResponse();\n taskgroup.key = key;\n taskgroup.data = data;\n taskgroup.contributions = contributions;\n\n return new TaskGroupModel(taskgroup);\n }\n\n /**\n */\n get type(): string {\n return \"TaskGroup\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"TaskGroupModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"TaskGroup\"\n );\n }\n\n /**\n * Get the key of the TaskGroup\n */\n get key(): string {\n return this._key;\n }\n\n /**\n * Get the label of the TaskGroup\n */\n get label(): string {\n return this.contributions.label;\n }\n\n /**\n * Retrieve actions of taskgroup\n */\n get actionCollection(): ActionCollection {\n return this._actionCollection;\n }\n}\n"],"mappings":";;;;;;;;AACA;AACA;AAEA;AAEA;AACA;AACA;AACe,MAAMA,cAAc,SAASC,sBAAa,CAAC;EAIxD;AACF;EACEC,WAAW,CAACC,iBAAoC,EAAE;IAChD,KAAK,CAACA,iBAAiB,CAAC;IAAC;IAAA;IAEzB,IAAI,CAACC,iBAAiB,GAAG,IAAIC,yBAAgB,CAC3C,IAAI,CAACC,IAAI,CAACC,OAAO,EACjB,IAAI,CAACC,aAAa,CAACD,OAAO,CAC3B;IAED,MAAME,QAAQ,GAAG,IAAI,CAACC,KAAK,CAACC,YAAY,CAAC,MAAM,CAAC,GAC5C,IAAI,CAACC,QAAQ,CAACC,IAAI,CAACA,IAAI,GACvB,IAAI;IAER,IAAI,CAACC,IAAI,GAAGL,QAAQ,GAChBA,QAAQ,CAACM,SAAS,CAACN,QAAQ,CAACO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GACjD,IAAI,CAACV,IAAI,CAACW,IAAI;EACpB;;EAEA;AACF;EACE,OAAOC,MAAM,CACXC,GAAW,EACXb,IAAY,EACZE,aAAqB,EACL;IAChB,MAAMY,SAAS,GAAG,IAAIC,0BAAiB,EAAE;IACzCD,SAAS,CAACD,GAAG,GAAGA,GAAG;IACnBC,SAAS,CAACd,IAAI,GAAGA,IAAI;IACrBc,SAAS,CAACZ,aAAa,GAAGA,aAAa;IAEvC,OAAO,IAAIR,cAAc,CAACoB,SAAS,CAAC;EACtC;;EAEA;AACF;EACE,IAAIE,IAAI,GAAW;IACjB,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,gBAAgB;EACzB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAAClB,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACE,aAAa,CAACiB,YAAY,IAC/BnB,IAAI,CAACE,aAAa,CAACiB,YAAY,KAAK,WAAW;EAEnD;;EAEA;AACF;AACA;EACE,IAAIN,GAAG,GAAW;IAChB,OAAO,IAAI,CAACL,IAAI;EAClB;;EAEA;AACF;AACA;EACE,IAAIY,KAAK,GAAW;IAClB,OAAO,IAAI,CAAClB,aAAa,CAACkB,KAAK;EACjC;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgB,GAAqB;IACvC,OAAO,IAAI,CAACvB,iBAAiB;EAC/B;AACF;AAAC"}
|
package/lib/models/types.js.flow
CHANGED
package/lib/models/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type BaseFilterModel from \"./filters/BaseFilterModel\";\nimport type AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | BaseFilterModel\n | FilterModel\n | AssignmentFilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(models: Array<ModularUIModel>): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserModel.js","names":["UserModel","ResourceModel","type","isApplicableModel","data","contributions","resourcetype","username","Username","fullname","Fullname","label"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":";;;;;;;AACA;AAIA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EACnD;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACH,IAAI,CAACI,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACN,aAAa,CAACM,KAAK;EACjC;AACF;AAAC"}
|
|
1
|
+
{"version":3,"file":"UserModel.js","names":["UserModel","ResourceModel","type","modelName","isApplicableModel","data","contributions","resourcetype","username","Username","fullname","Fullname","label"],"sources":["../../../src/models/user/UserModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\n\n/**\n * User model\n */\nexport default class UserModel extends ResourceModel {\n /**\n */\n get type(): string {\n return \"User\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"UserModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n return (\n data.contributions.resourcetype &&\n data.contributions.resourcetype === \"userdata\"\n );\n }\n\n /**\n * Retrieve username of user\n */\n get username(): string {\n return this.data.Username || \"Guest\";\n }\n\n /**\n * retrieve the fullname of the user\n */\n get fullname(): string {\n return this.data.Fullname || \"Guest\";\n }\n\n /**\n */\n get label(): string {\n return this.contributions.label;\n }\n}\n"],"mappings":";;;;;;;AACA;AAIA;AACA;AACA;AACe,MAAMA,SAAS,SAASC,sBAAa,CAAC;EACnD;AACF;EACE,IAAIC,IAAI,GAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,WAAWC,SAAS,GAAW;IAC7B,OAAO,WAAW;EACpB;;EAEA;AACF;EACE,OAAOC,iBAAiB,CAACC,IAAuB,EAAW;IACzD,OACEA,IAAI,CAACC,aAAa,CAACC,YAAY,IAC/BF,IAAI,CAACC,aAAa,CAACC,YAAY,KAAK,UAAU;EAElD;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACH,IAAI,CAACI,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;AACA;EACE,IAAIC,QAAQ,GAAW;IACrB,OAAO,IAAI,CAACL,IAAI,CAACM,QAAQ,IAAI,OAAO;EACtC;;EAEA;AACF;EACE,IAAIC,KAAK,GAAW;IAClB,OAAO,IAAI,CAACN,aAAa,CAACM,KAAK;EACjC;AACF;AAAC"}
|
|
@@ -41,6 +41,12 @@ class UserProfileModel extends _UserModel.default {
|
|
|
41
41
|
get attributeCollection() {
|
|
42
42
|
return this._attributeCollection;
|
|
43
43
|
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
*/
|
|
47
|
+
static get modelName() {
|
|
48
|
+
return "UserProfileModel";
|
|
49
|
+
}
|
|
44
50
|
}
|
|
45
51
|
exports.default = UserProfileModel;
|
|
46
52
|
//# sourceMappingURL=UserProfileModel.js.map
|