@beinformed/ui 1.65.2 → 1.65.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -0
- package/esm/hooks/useList.js +4 -4
- package/esm/hooks/useList.js.flow +5 -5
- package/esm/hooks/useList.js.map +1 -1
- package/esm/models/concepts/ConceptIndexModel.js +3 -2
- package/esm/models/concepts/ConceptIndexModel.js.flow +5 -4
- package/esm/models/concepts/ConceptIndexModel.js.map +1 -1
- package/esm/models/content/ContentIndexModel.js +7 -1
- package/esm/models/content/ContentIndexModel.js.flow +8 -3
- package/esm/models/content/ContentIndexModel.js.map +1 -1
- package/esm/models/content/ContentModel.js +3 -2
- package/esm/models/content/ContentModel.js.flow +4 -3
- package/esm/models/content/ContentModel.js.map +1 -1
- package/esm/models/content/ContentTOCModel.js +6 -2
- package/esm/models/content/ContentTOCModel.js.flow +6 -2
- package/esm/models/content/ContentTOCModel.js.map +1 -1
- package/esm/models/filters/AssignmentFilterModel.js +54 -26
- package/esm/models/filters/AssignmentFilterModel.js.flow +68 -37
- package/esm/models/filters/AssignmentFilterModel.js.map +1 -1
- package/esm/models/filters/BaseFilterModel.js +0 -110
- package/esm/models/filters/BaseFilterModel.js.flow +2 -133
- package/esm/models/filters/BaseFilterModel.js.map +1 -1
- package/esm/models/filters/ConceptIndexFilterModel.js +2 -2
- package/esm/models/filters/ConceptIndexFilterModel.js.flow +2 -2
- package/esm/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/esm/models/filters/FilterModel.js +117 -2
- package/esm/models/filters/FilterModel.js.flow +146 -1
- package/esm/models/filters/FilterModel.js.map +1 -1
- package/esm/models/filters/RangeFilterModel.js +2 -2
- package/esm/models/filters/RangeFilterModel.js.flow +2 -2
- package/esm/models/filters/RangeFilterModel.js.map +1 -1
- package/esm/models/href/Href.js +1 -1
- package/esm/models/href/Href.js.flow +1 -1
- package/esm/models/href/Href.js.map +1 -1
- package/esm/models/list/ListModel.js +5 -1
- package/esm/models/list/ListModel.js.flow +7 -3
- package/esm/models/list/ListModel.js.map +1 -1
- package/esm/models/sorting/SortOptionModel.js +7 -0
- package/esm/models/sorting/SortOptionModel.js.flow +7 -0
- package/esm/models/sorting/SortOptionModel.js.map +1 -1
- package/esm/models/sorting/SortingModel.js +14 -2
- package/esm/models/sorting/SortingModel.js.flow +14 -2
- package/esm/models/sorting/SortingModel.js.map +1 -1
- package/esm/models/types.js.flow +1 -3
- package/esm/models/types.js.map +1 -1
- package/esm/redux/_modularui/ModularUIConnector.js +7 -6
- package/esm/redux/_modularui/ModularUIConnector.js.flow +6 -4
- package/esm/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/lib/hooks/useList.js +4 -4
- package/lib/hooks/useList.js.map +1 -1
- package/lib/models/concepts/ConceptIndexModel.js +3 -2
- package/lib/models/concepts/ConceptIndexModel.js.map +1 -1
- package/lib/models/content/ContentIndexModel.js +6 -1
- package/lib/models/content/ContentIndexModel.js.map +1 -1
- package/lib/models/content/ContentModel.js +3 -2
- package/lib/models/content/ContentModel.js.map +1 -1
- package/lib/models/content/ContentTOCModel.js +6 -2
- package/lib/models/content/ContentTOCModel.js.map +1 -1
- package/lib/models/filters/AssignmentFilterModel.js +54 -26
- package/lib/models/filters/AssignmentFilterModel.js.map +1 -1
- package/lib/models/filters/BaseFilterModel.js +0 -109
- package/lib/models/filters/BaseFilterModel.js.map +1 -1
- package/lib/models/filters/ConceptIndexFilterModel.js +2 -2
- package/lib/models/filters/ConceptIndexFilterModel.js.map +1 -1
- package/lib/models/filters/FilterModel.js +117 -1
- package/lib/models/filters/FilterModel.js.map +1 -1
- package/lib/models/filters/RangeFilterModel.js +2 -2
- package/lib/models/filters/RangeFilterModel.js.map +1 -1
- package/lib/models/href/Href.js +1 -1
- package/lib/models/href/Href.js.map +1 -1
- package/lib/models/list/ListModel.js +5 -1
- package/lib/models/list/ListModel.js.map +1 -1
- package/lib/models/sorting/SortOptionModel.js +7 -0
- package/lib/models/sorting/SortOptionModel.js.map +1 -1
- package/lib/models/sorting/SortingModel.js +14 -2
- package/lib/models/sorting/SortingModel.js.map +1 -1
- package/lib/models/types.js.map +1 -1
- package/lib/redux/_modularui/ModularUIConnector.js +7 -6
- package/lib/redux/_modularui/ModularUIConnector.js.map +1 -1
- package/package.json +6 -6
- package/src/hooks/useList.js +5 -5
- package/src/models/concepts/ConceptIndexModel.js +5 -4
- package/src/models/content/ContentIndexModel.js +8 -3
- package/src/models/content/ContentModel.js +4 -3
- package/src/models/content/ContentTOCModel.js +6 -2
- package/src/models/filters/AssignmentFilterModel.js +68 -37
- package/src/models/filters/BaseFilterModel.js +2 -133
- package/src/models/filters/ConceptIndexFilterModel.js +2 -2
- package/src/models/filters/FilterModel.js +146 -1
- package/src/models/filters/RangeFilterModel.js +2 -2
- package/src/models/href/Href.js +1 -1
- package/src/models/list/ListModel.js +7 -3
- package/src/models/sorting/SortOptionModel.js +7 -0
- package/src/models/sorting/SortingModel.js +14 -2
- package/src/models/types.js +1 -3
- package/src/redux/_modularui/ModularUIConnector.js +6 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListModel.js","names":["ModularUIResponse","ListItemCollection","ListDetailModel","ActionCollection","FilterCollection","GroupingModel","ListHeaderModel","ListHref","ListItemModel","PagingModel","ResourceModel","SortingModel","HTTP_METHODS","PARAMETER_TYPES","CASEVIEW_LINK","HIDE_WHEN_EMPTY","SHOW_ONE_RESULT_AS_DETAIL","ListModel","constructor","args","_defineProperty","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","layouthint","has","listItemCollection","length","_context2","_mapInstanceProperty","listItem","listDetailLink","selflink","targetModel","setChildModels","models","detail","_findInstanceProperty","childModel","requestMethod","mustPost","filterCollection","some","filter","parameterType","BODY","hasValue","POST","GET","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","createFromList","_detail","_context3","listitemHref","selfhref","listitem","equals","grouping","_grouping","setGrouping","dynamicschema","contexts","modelOptions","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","actionCollection","isEmpty","hasActiveFilters","getListItemById","id","_context4","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","_context5","paging","_paging","setPaging","sorting","_sorting","setSorting","getSortingLabels","_filterCollection","setFilters","_filterInstanceProperty","listkey","key","isFiltered","_actionCollection","setActionCollection","actions","hasList","getSelfHref","selfLink","links","getLinkByKey","headers","_headers","setHeaders","tempHeaders","results","_Object$keys","forEach","attributes","attribute","listHeader","exists","tempHeader","push","sortingLabels","attributeKey","getActionsByType","actionType","getAdditionalDetailLabel","resultTypes","resultType","_context6","link","_links","panel","Function","bind","panelLink","formdata","_JSON$stringify"],"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 { HTTP_METHODS, PARAMETER_TYPES } from \"../../constants\";\n\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\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 */\n get requestMethod(): $Keys<typeof HTTP_METHODS> {\n const mustPost = this.filterCollection.some(\n (filter) =>\n filter.parameterType === PARAMETER_TYPES.BODY && filter.hasValue(),\n );\n return mustPost ? HTTP_METHODS.POST : HTTP_METHODS.GET;\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\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts,\n this.modelOptions,\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId,\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href),\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting,\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection) {\n this._filterCollection = filterCollection;\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(\n this.data.filter,\n {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n getSelfHref(): 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 return this.getSelfHref();\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader),\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n\n /**\n * Retrieves the label of the first additional detail link by resource type\n */\n getAdditionalDetailLabel(resourceType: string): string | null {\n const resultTypes = Object.keys(this.contributions.results);\n\n for (const resultType of resultTypes) {\n const link = this.contributions.results[resultType]._links?.panel?.find(\n (panelLink) => panelLink.resourcetype === resourceType,\n );\n if (link) {\n return link.label;\n }\n }\n\n return null;\n }\n\n /**\n */\n get formdata(): string {\n return JSON.stringify(this.filterCollection.formdata);\n }\n}\n"],"mappings":";;;;;;;;AACA,OAAOA,iBAAiB,MAAM,mCAAmC;AAEjE,OAAOC,kBAAkB,MAAM,4BAA4B;AAC3D,OAAOC,eAAe,MAAM,yBAAyB;AACrD,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,OAAOC,aAAa,MAAM,2BAA2B;AACrD,OAAOC,eAAe,MAAM,yBAAyB;AACrD,OAAOC,QAAQ,MAAM,kBAAkB;AACvC,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,aAAa,MAAM,uBAAuB;AACjD,OAAOC,YAAY,MAAM,yBAAyB;AAClD,SAASC,YAAY,EA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,OAAO,CAACd,GAAG,CAAC,CAACiB,UAAU,CAACD,OAAO,CAAEE,SAAS,IAAK;UAC7C,MAAMM,YAAY,GAAGT,YAAA,CAAYG,SAAS,CAAC,CAAC,CAAC,CAAC;UAC9CK,aAAa,CAACC,YAAY,CAAC,GAAGN,SAAS,CAACM,YAAY,CAAC,CAAC3E,KAAK;QAC7D,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ;IAEA,OAAO0E,aAAa;EACtB;;EAEA;AACF;AACA;EACEE,gBAAgBA,CAACC,UAAkB,EAAoB;IACrD,OAAO,IAAI,CAAClD,gBAAgB,CAACiD,gBAAgB,CAACC,UAAU,CAAC;EAC3D;;EAEA;AACF;AACA;EACEC,wBAAwBA,CAAC9G,YAAoB,EAAiB;IAC5D,MAAM+G,WAAW,GAAGb,YAAA,CAAY,IAAI,CAACjG,aAAa,CAACgG,OAAO,CAAC;IAE3D,KAAK,MAAMe,UAAU,IAAID,WAAW,EAAE;MAAA,IAAAE,SAAA;MACpC,MAAMC,IAAI,GAAG,EAAAD,SAAA,OAAI,CAAChH,aAAa,CAACgG,OAAO,CAACe,UAAU,CAAC,CAACG,MAAM,EAAEC,KAAK,qBAAAC,QAAA,CAAAjH,IAAA,CAAAkH,IAAA,CAAAlG,qBAAA,CAAA6F,SAAA,GAAAA,SAAA,KAC9DM,SAAS,IAAKA,SAAS,CAACrH,YAAY,KAAKF,YAC5C,CAAC;MACD,IAAIkH,IAAI,EAAE;QACR,OAAOA,IAAI,CAAClF,KAAK;MACnB;IACF;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIwF,QAAQA,CAAA,EAAW;IACrB,OAAOC,eAAA,CAAe,IAAI,CAACjG,gBAAgB,CAACgG,QAAQ,CAAC;EACvD;AACF","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ListModel.js","names":["ModularUIResponse","ListItemCollection","ListDetailModel","ActionCollection","FilterCollection","GroupingModel","ListHeaderModel","ListHref","ListItemModel","PagingModel","ResourceModel","SortingModel","HTTP_METHODS","PARAMETER_TYPES","CASEVIEW_LINK","HIDE_WHEN_EMPTY","SHOW_ONE_RESULT_AS_DETAIL","ListModel","constructor","args","_defineProperty","type","modelName","isApplicableModel","data","_context","resourceType","contributions","resourcetype","_endsWithInstanceProperty","call","_includesInstanceProperty","getInitialChildModelLinks","layouthint","has","listItemCollection","length","_context2","_mapInstanceProperty","listItem","listDetailLink","selflink","targetModel","setChildModels","models","detail","_findInstanceProperty","childModel","requestMethod","mustPost","filterCollection","some","filter","parameterType","BODY","hasValue","POST","GET","label","introtext","content","text","message","Array","isArray","texts","_listItemCollection","createFromList","_detail","_context3","listitemHref","selfhref","listitem","equals","grouping","_grouping","setGrouping","dynamicschema","contexts","modelOptions","hasGrouping","hasGroups","hasResults","hasItems","shouldHide","actionCollection","isEmpty","hasActiveFilters","getListItemById","id","_context4","decodedId","decodeURIComponent","toString","result","getListItemByHref","href","_context5","paging","_paging","setPaging","sorting","_sorting","setSorting","getSortingLabels","_filterCollection","setFilters","collection","_filterInstanceProperty","listkey","key","isFiltered","_actionCollection","setActionCollection","actions","hasList","getSelfHref","selfLink","links","getLinkByKey","headers","_headers","setHeaders","tempHeaders","results","_Object$keys","forEach","attributes","attribute","listHeader","exists","tempHeader","push","sortingLabels","attributeKey","getActionsByType","actionType","getAdditionalDetailLabel","resultTypes","resultType","_context6","link","_links","panel","Function","bind","panelLink","formdata","_JSON$stringify"],"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 { HTTP_METHODS, PARAMETER_TYPES } from \"../../constants\";\n\nimport {\n CASEVIEW_LINK,\n HIDE_WHEN_EMPTY,\n SHOW_ONE_RESULT_AS_DETAIL,\n} from \"../../constants/LayoutHints\";\n\nimport type { ModularUIModel, FilterType } 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\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 */\n get requestMethod(): $Keys<typeof HTTP_METHODS> {\n const mustPost = this.filterCollection.some(\n (filter) =>\n filter.parameterType === PARAMETER_TYPES.BODY && filter.hasValue(),\n );\n return mustPost ? HTTP_METHODS.POST : HTTP_METHODS.GET;\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\n /**\n * Retrieve grouping information\n */\n get grouping(): GroupingModel {\n if (!this._grouping) {\n this._grouping = this.setGrouping();\n }\n\n return this._grouping;\n }\n\n /**\n */\n setGrouping(): GroupingModel {\n return new GroupingModel(\n { ...this.data.grouping, dynamicschema: this.data.dynamicschema },\n this.contributions.contexts,\n this.modelOptions,\n );\n }\n\n /**\n */\n hasGrouping(): boolean {\n return this.grouping.hasGroups();\n }\n\n /**\n * Check if list has results\n */\n hasResults(): boolean {\n return this.listItemCollection.hasItems;\n }\n\n /**\n */\n get shouldHide(): boolean {\n return (\n this.layouthint.has(HIDE_WHEN_EMPTY) &&\n !this.hasResults() &&\n this.actionCollection.isEmpty &&\n !this.filterCollection.hasActiveFilters()\n );\n }\n\n /**\n * Get list item by ID\n */\n getListItemById(id: string | number): ListItemModel | null {\n const decodedId = decodeURIComponent(id.toString());\n return this.listItemCollection.find(\n (result) => result.id.toString() === decodedId,\n );\n }\n\n /**\n * Get list item by Href\n */\n getListItemByHref(href: ListHref): ListItemModel | null {\n return this.listItemCollection.find((result) =>\n result.selfhref.equals(href),\n );\n }\n\n /**\n * Getting paging information\n */\n get paging(): PagingModel {\n if (!this._paging) {\n this._paging = this.setPaging();\n }\n return this._paging;\n }\n\n /**\n */\n setPaging(): PagingModel {\n return new PagingModel(this.data.paging, this.contributions.paging);\n }\n\n /**\n * Getting sorting information\n */\n get sorting(): SortingModel {\n if (!this._sorting) {\n this._sorting = this.setSorting();\n }\n\n return this._sorting;\n }\n\n /**\n */\n setSorting(): SortingModel {\n return new SortingModel(\n this.contributions,\n this.getSortingLabels(),\n this.grouping,\n this.data.sorting,\n );\n }\n\n /**\n * Getting the filters\n */\n get filterCollection(): FilterCollection {\n if (!this._filterCollection) {\n this._filterCollection = this.setFilters();\n }\n\n return this._filterCollection;\n }\n\n /**\n * Set filterCollection\n */\n set filterCollection(filterCollection: FilterCollection | Array<FilterType>) {\n if (Array.isArray(filterCollection)) {\n this._filterCollection.collection = filterCollection;\n } else {\n this._filterCollection = filterCollection;\n }\n }\n\n /**\n */\n setFilters(): FilterCollection {\n return new FilterCollection(\n this.data.filter,\n {\n listkey: this.key,\n filter: this.contributions.filter,\n contexts: this.contributions.contexts,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n }\n\n /**\n * Indicates if list results are filtered\n */\n isFiltered(): boolean {\n return this.filterCollection.hasActiveFilters();\n }\n\n /**\n * Getting actions\n */\n get actionCollection(): ActionCollection {\n if (!this._actionCollection) {\n this._actionCollection = this.setActionCollection();\n }\n return this._actionCollection;\n }\n\n /**\n */\n setActionCollection(): ActionCollection {\n return new ActionCollection(\n this.data.actions,\n this.contributions.actions,\n this.modelOptions,\n );\n }\n\n /**\n * Contains this model list data\n */\n hasList(): boolean {\n return this.key != null;\n }\n\n /**\n * Sets self href from links collection\n */\n getSelfHref(): 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 return this.getSelfHref();\n }\n\n /**\n * Getting the headers of this list\n */\n get headers(): Array<ListHeaderModel> {\n if (!this._headers) {\n this._headers = this.setHeaders();\n }\n\n return this._headers;\n }\n\n /**\n * Set initial headers of list\n */\n setHeaders(): Array<ListHeaderModel> {\n const tempHeaders = [];\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const listHeader = new ListHeaderModel(attribute, this.sorting);\n\n const exists = tempHeaders.some((tempHeader) =>\n tempHeader.equals(listHeader),\n );\n\n if (!exists && !listHeader.layouthint.has(CASEVIEW_LINK)) {\n tempHeaders.push(listHeader);\n }\n });\n });\n }\n\n return tempHeaders;\n }\n\n /**\n */\n getSortingLabels(): { [string]: string } {\n const sortingLabels: { [string]: string } = {};\n\n if (this.contributions.results) {\n const { results } = this.contributions;\n Object.keys(results).forEach((key) => {\n results[key].attributes.forEach((attribute) => {\n const attributeKey = Object.keys(attribute)[0];\n sortingLabels[attributeKey] = attribute[attributeKey].label;\n });\n });\n }\n\n return sortingLabels;\n }\n\n /**\n * Retrieve all actions by type\n */\n getActionsByType(actionType: string): ActionCollection {\n return this.actionCollection.getActionsByType(actionType);\n }\n\n /**\n * Retrieves the label of the first additional detail link by resource type\n */\n getAdditionalDetailLabel(resourceType: string): string | null {\n const resultTypes = Object.keys(this.contributions.results);\n\n for (const resultType of resultTypes) {\n const link = this.contributions.results[resultType]._links?.panel?.find(\n (panelLink) => panelLink.resourcetype === resourceType,\n );\n if (link) {\n return link.label;\n }\n }\n\n return null;\n }\n\n /**\n */\n get formdata(): string {\n return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A,IAAAE,SAAA;MACpC,MAAMC,IAAI,GAAG,EAAAD,SAAA,OAAI,CAACjH,aAAa,CAACiG,OAAO,CAACe,UAAU,CAAC,CAACG,MAAM,EAAEC,KAAK,qBAAAC,QAAA,CAAAlH,IAAA,CAAAmH,IAAA,CAAAnG,qBAAA,CAAA8F,SAAA,GAAAA,SAAA,KAC9DM,SAAS,IAAKA,SAAS,CAACtH,YAAY,KAAKF,YAC5C,CAAC;MACD,IAAImH,IAAI,EAAE;QACR,OAAOA,IAAI,CAACnF,KAAK;MACnB;IACF;IAEA,OAAO,IAAI;EACb;;EAEA;AACF;EACE,IAAIyF,QAAQA,CAAA,EAAW;IACrB,OAAOC,eAAA,CAAe,IAAI,CAAClG,gBAAgB,CAACiG,QAAQ,CAAC;EACvD;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortOptionModel.js","names":["ListHref","SortOptionModel","constructor","key","label","group","_defineProperty","_key","_group","_label","attribute","getAttributeByKey","selected","
|
|
1
|
+
{"version":3,"file":"SortOptionModel.js","names":["ListHref","SortOptionModel","constructor","key","label","group","_defineProperty","_key","_group","_label","attribute","getAttributeByKey","reset","selected","sortorder","_selected","value","oppositeDirection","oppositeValue","_sortorder","getHref","listHref","listhref","hasPage","prefix","hasParameter","page","sort"],"sources":["../../../src/models/sorting/SortOptionModel.js"],"sourcesContent":["// @flow\nimport type { GroupModel } from \"../grouping/GroupingModel\";\n\nimport ListHref from \"../href/ListHref\";\n\n/**\n */\nclass SortOptionModel {\n _key: string;\n _label: string;\n _group: ?GroupModel;\n _sortorder: \"desc\" | \"asc\" = \"desc\";\n _selected: boolean = false;\n\n /**\n */\n constructor(key: string, label?: string, group?: ?GroupModel) {\n this._key = key;\n this._group = group;\n\n if (label) {\n this._label = label;\n } else if (group) {\n const attribute = group.getAttributeByKey(key);\n if (attribute) {\n this._label = attribute.label;\n }\n }\n }\n\n /**\n */\n reset() {\n this.selected = false;\n this.sortorder = \"desc\";\n }\n\n /**\n */\n get selected(): boolean {\n return this._selected;\n }\n\n /**\n */\n set selected(selected: boolean) {\n this._selected = selected;\n }\n\n /**\n */\n get key(): string {\n return this._key;\n }\n\n /**\n */\n get value(): string {\n return `${this.key} ${this.sortorder}`;\n }\n\n /**\n */\n get oppositeDirection(): \"asc\" | \"desc\" {\n return this.sortorder === \"desc\" ? \"asc\" : \"desc\";\n }\n\n /**\n */\n get oppositeValue(): string {\n return `${this.key} ${this.oppositeDirection}`;\n }\n\n /**\n */\n get label(): string {\n return this._label;\n }\n\n /**\n */\n get sortorder(): \"desc\" | \"asc\" {\n return this._sortorder;\n }\n\n /**\n */\n set sortorder(sortorder: \"desc\" | \"asc\") {\n this._sortorder = sortorder;\n }\n\n /**\n */\n get group(): ?GroupModel {\n return this._group;\n }\n\n /**\n */\n getHref(listHref: ListHref): ListHref {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.oppositeValue;\n\n return listhref;\n }\n}\n\nexport default SortOptionModel;\n"],"mappings":";AAGA,OAAOA,QAAQ,MAAM,kBAAkB;;AAEvC;AACA;AACA,MAAMC,eAAe,CAAC;EAOpB;AACF;EACEC,WAAWA,CAACC,GAAW,EAAEC,KAAc,EAAEC,KAAmB,EAAE;IAAAC,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA,qBALjC,MAAM;IAAAA,eAAA,oBACd,KAAK;IAKxB,IAAI,CAACC,IAAI,GAAGJ,GAAG;IACf,IAAI,CAACK,MAAM,GAAGH,KAAK;IAEnB,IAAID,KAAK,EAAE;MACT,IAAI,CAACK,MAAM,GAAGL,KAAK;IACrB,CAAC,MAAM,IAAIC,KAAK,EAAE;MAChB,MAAMK,SAAS,GAAGL,KAAK,CAACM,iBAAiB,CAACR,GAAG,CAAC;MAC9C,IAAIO,SAAS,EAAE;QACb,IAA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,OAAO,GAAGD,QAAQ,CAACE,MAAM,GAC3BF,QAAQ,CAACG,YAAY,CAAC,MAAM,EAAEH,QAAQ,CAACE,MAAM,CAAC,GAC9CF,QAAQ,CAACG,YAAY,CAAC,MAAM,CAAC;IACjC,IAAIF,OAAO,EAAE;MACXD,QAAQ,CAACI,IAAI,GAAG,CAAC;IACnB;IACAJ,QAAQ,CAACK,IAAI,GAAG,IAAI,CAACT,aAAa;IAElC,OAAOI,QAAQ;EACjB;AACF;AAEA,eAAerB,eAAe","ignoreList":[]}
|
|
@@ -37,6 +37,13 @@ class SortingModel extends BaseCollection {
|
|
|
37
37
|
return _mapInstanceProperty(_context2 = _filterInstanceProperty(_context3 = this).call(_context3, option => option.selected)).call(_context2, option => option.value).join(",");
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
*/
|
|
42
|
+
set value(value) {
|
|
43
|
+
this.reset();
|
|
44
|
+
this.setSelected(value);
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
/**
|
|
41
48
|
*/
|
|
42
49
|
get param() {
|
|
@@ -51,8 +58,13 @@ class SortingModel extends BaseCollection {
|
|
|
51
58
|
|
|
52
59
|
/**
|
|
53
60
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
reset() {
|
|
62
|
+
this.collection.forEach(option => option.reset());
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
*/
|
|
66
|
+
setSelected(value = "") {
|
|
67
|
+
value.split(",").forEach(sortItem => {
|
|
56
68
|
const [key, direction] = sortItem.split(" ");
|
|
57
69
|
this.collection.forEach(option => {
|
|
58
70
|
if (option.key === key) {
|
|
@@ -47,6 +47,13 @@ class SortingModel extends BaseCollection<SortOptionModel> {
|
|
|
47
47
|
.join(",");
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
*/
|
|
52
|
+
set value(value: string) {
|
|
53
|
+
this.reset();
|
|
54
|
+
this.setSelected(value);
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
/**
|
|
51
58
|
*/
|
|
52
59
|
get param(): string {
|
|
@@ -61,8 +68,13 @@ class SortingModel extends BaseCollection<SortOptionModel> {
|
|
|
61
68
|
|
|
62
69
|
/**
|
|
63
70
|
*/
|
|
64
|
-
|
|
65
|
-
|
|
71
|
+
reset() {
|
|
72
|
+
this.collection.forEach((option) => option.reset());
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
*/
|
|
76
|
+
setSelected(value: string = "") {
|
|
77
|
+
value.split(",").forEach((sortItem) => {
|
|
66
78
|
const [key, direction] = sortItem.split(" ");
|
|
67
79
|
|
|
68
80
|
this.collection.forEach((option) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortingModel.js","names":["has","BaseCollection","SortOptionModel","ListHref","IllegalArgumentException","SortingModel","constructor","contributions","labels","grouping","currentSort","sorting","_context","collection","_mapInstanceProperty","attributes","call","attributeKey","label","group","getGroupByAttributeKey","setSelected","name","value","_context2","_context3","_filterInstanceProperty","option","selected","join","param","options","
|
|
1
|
+
{"version":3,"file":"SortingModel.js","names":["has","BaseCollection","SortOptionModel","ListHref","IllegalArgumentException","SortingModel","constructor","contributions","labels","grouping","currentSort","sorting","_context","collection","_mapInstanceProperty","attributes","call","attributeKey","label","group","getGroupByAttributeKey","setSelected","name","value","_context2","_context3","_filterInstanceProperty","option","selected","join","reset","param","options","forEach","split","sortItem","key","direction","sortorder","getUpdateQuerystring","optionKey","_context4","_context5","oppositeValue","getUpdateQuerystringBySortOption","sortOption","createListHref","listHref","listhref","hasPage","prefix","hasParameter","page","sort"],"sources":["../../../src/models/sorting/SortingModel.js"],"sourcesContent":["// @flow\nimport { has } from \"../../utils/helpers/objects\";\n\nimport BaseCollection from \"../base/BaseCollection\";\nimport SortOptionModel from \"../sorting/SortOptionModel\";\nimport ListHref from \"../href/ListHref\";\n\nimport type GroupingModel from \"../grouping/GroupingModel\";\nimport IllegalArgumentException from \"../../exceptions/IllegalArgumentException\";\n\n/**\n */\nclass SortingModel extends BaseCollection<SortOptionModel> {\n /**\n */\n constructor(\n contributions: Object,\n labels: { [key: string]: string },\n grouping: GroupingModel,\n currentSort: string,\n ) {\n super();\n\n if (has(contributions?.sorting, \"attributes\")) {\n this.collection = contributions.sorting.attributes.map((attributeKey) => {\n const label = labels[attributeKey];\n const group = grouping && grouping.getGroupByAttributeKey(attributeKey);\n\n return new SortOptionModel(attributeKey, label, group);\n });\n\n this.setSelected(currentSort);\n }\n }\n\n /**\n */\n get name(): string {\n return \"sort\";\n }\n\n /**\n */\n get value(): string {\n return this.filter((option) => option.selected)\n .map((option) => option.value)\n .join(\",\");\n }\n\n /**\n */\n set value(value: string) {\n this.reset();\n this.setSelected(value);\n }\n\n /**\n */\n get param(): string {\n return this.value;\n }\n\n /**\n */\n get options(): Array<SortOptionModel> {\n return this.collection;\n }\n\n /**\n */\n reset() {\n this.collection.forEach((option) => option.reset());\n }\n /**\n */\n setSelected(value: string = \"\") {\n value.split(\",\").forEach((sortItem) => {\n const [key, direction] = sortItem.split(\" \");\n\n this.collection.forEach((option) => {\n if (option.key === key) {\n option.selected = true;\n if (direction === \"asc\") {\n option.sortorder = \"asc\";\n } else if (direction === \"desc\") {\n option.sortorder = \"desc\";\n }\n }\n });\n });\n }\n\n /**\n * Retrieve a sort option from the model that can be used in the querystring to set it in the opposite direction\n * For example a sort option in the model with key books and direction descending will be retrieved as 'Books asc'\n */\n getUpdateQuerystring(optionKey: string): string {\n if (!optionKey) {\n throw new IllegalArgumentException(\n \"Missing option key as input argument\",\n );\n }\n\n return this.filter((option) => option.key === optionKey)\n .map((option) =>\n option.key === optionKey ? option.oppositeValue : option.value,\n )\n .join(\",\");\n }\n\n /**\n * @see {@link SortingModel#getUpdateQuerystring}\n */\n getUpdateQuerystringBySortOption(sortOption: SortOptionModel): string {\n if (!(sortOption instanceof SortOptionModel)) {\n throw new IllegalArgumentException(\n \"Missing SortOptionModel as input argument\",\n );\n }\n\n return this.getUpdateQuerystring(sortOption.key);\n }\n\n /**\n */\n createListHref(listHref: ListHref, sortOption: SortOptionModel): ListHref {\n const listhref = new ListHref(listHref);\n const hasPage = listhref.prefix\n ? listhref.hasParameter(\"page\", listhref.prefix)\n : listhref.hasParameter(\"page\");\n if (hasPage) {\n listhref.page = 1;\n }\n listhref.sort = this.getUpdateQuerystringBySortOption(sortOption);\n\n return listhref;\n }\n}\n\nexport default SortingModel;\n"],"mappings":";;AACA,SAASA,GAAG,QAAQ,6BAA6B;AAEjD,OAAOC,cAAc,MAAM,wBAAwB;AACnD,OAAOC,eAAe,MAAM,4BAA4B;AACxD,OAAOC,QAAQ,MAAM,kBAAkB;AAGvC,OAAOC,wBAAwB,MAAM,2CAA2C;;AAEhF;AACA;AACA,MAAMC,YAAY,SAASJ,cAAc,CAAkB;EACzD;AACF;EACEK,WAAWA,CACTC,aAAqB,EACrBC,MAAiC,EACjCC,QAAuB,EACvBC,WAAmB,EACnB;IACA,KAAK,CAAC,CAAC;IAEP,IAAIV,GAAG,CAACO,aAAa,EAAEI,OAAO,EAAE,YAAY,CAAC,EAAE;MAAA,IAAAC,QAAA;MAC7C,IAAI,CAACC,UAAU,GAAGC,oBAAA,CAAAF,QAAA,GAAAL,aAAa,CAACI,OAAO,CAACI,UAAU,EAAAC,IAAA,CAAAJ,QAAA,EAAMK,YAAY,IAAK;QACvE,MAAMC,KAAK,GAAGV,MAAM,CAACS,YAAY,CAAC;QAClC,MAAME,KAAK,GAAGV,QAAQ,IAAIA,QAAQ,CAACW,sBAAsB,CAACH,YAAY,CAAC;QAEvE,OAAO,IAAIf,eAAe,CAACe,YAAY,EAAEC,KAAK,EAAEC,KAAK,CAAC;MACxD,CAAC,CAAC;MAEF,IAAI,CAACE,WAAW,CAACX,WAAW,CAAC;IAC/B;EACF;;EAEA;AACF;EACE,IAAIY,IAAIA,CAAA,EAAW;IACjB,OAAO,MAAM;EACf;;EAEA;AACF;EACE,IAAIC,KAAKA,CAAA,EAAW;IAAA,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EACjB;AACF;AAEA,eAAe3C,YAAY","ignoreList":[]}
|
package/esm/models/types.js.flow
CHANGED
|
@@ -41,7 +41,6 @@ import type UserModel from "./user/UserModel";
|
|
|
41
41
|
import type UserServicesModel from "./user/UserServicesModel";
|
|
42
42
|
import type LinkModel from "./links/LinkModel";
|
|
43
43
|
import type LookupOptionsModel from "./lookup/LookupOptionsModel";
|
|
44
|
-
import type BaseFilterModel from "./filters/BaseFilterModel";
|
|
45
44
|
import type AttributeCollection from "./attributes/AttributeCollection";
|
|
46
45
|
import type AttributeModel from "./attributes/AttributeModel";
|
|
47
46
|
import type LayoutHintCollection from "./layouthint/LayoutHintCollection";
|
|
@@ -92,9 +91,8 @@ export type RangeChildAttributeType =
|
|
|
92
91
|
| DatetimeAttributeModel;
|
|
93
92
|
|
|
94
93
|
export type FilterType =
|
|
95
|
-
| BaseFilterModel
|
|
96
|
-
| FilterModel
|
|
97
94
|
| AssignmentFilterModel
|
|
95
|
+
| FilterModel
|
|
98
96
|
| RangeFilterModel
|
|
99
97
|
| ConceptIndexFilterModel;
|
|
100
98
|
|
package/esm/models/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/models/types.js"],"sourcesContent":["// @flow\nimport type ApplicationModel from \"./application/ApplicationModel\";\nimport type BooleanAttributeModel from \"./attributes/BooleanAttributeModel\";\nimport type CaptchaAttributeModel from \"./attributes/CaptchaAttributeModel\";\nimport type ChoiceAttributeModel from \"./attributes/ChoiceAttributeModel\";\nimport type CompositeAttributeModel from \"./attributes/CompositeAttributeModel\";\nimport type DatetimeAttributeModel from \"./attributes/DatetimeAttributeModel\";\nimport type HelptextAttributeModel from \"./attributes/HelptextAttributeModel\";\nimport type LabelAttributeModel from \"./attributes/LabelAttributeModel\";\nimport type MemoAttributeModel from \"./attributes/MemoAttributeModel\";\nimport type MoneyAttributeModel from \"./attributes/MoneyAttributeModel\";\nimport type NumberAttributeModel from \"./attributes/NumberAttributeModel\";\nimport type PasswordAttributeModel from \"./attributes/PasswordAttributeModel\";\nimport type StringAttributeModel from \"./attributes/StringAttributeModel\";\nimport type UploadAttributeModel from \"./attributes/UploadAttributeModel\";\nimport type XMLAttributeModel from \"./attributes/XMLAttributeModel\";\nimport type CaseViewModel from \"./caseview/CaseViewModel\";\nimport type BusinessScenarioModel from \"./concepts/BusinessScenarioModel\";\nimport type ConceptDetailModel from \"./concepts/ConceptDetailModel\";\nimport type ConceptIndexModel from \"./concepts/ConceptIndexModel\";\nimport type ConceptTypeDetailModel from \"./concepts/ConceptTypeDetailModel\";\nimport type ContentIndexModel from \"./content/ContentIndexModel\";\nimport type ContentModel from \"./content/ContentModel\";\nimport type SectionModel from \"./content/SectionModel\";\nimport type ContentTOCModel from \"./content/ContentTOCModel\";\nimport type ContentTypeModel from \"./content/ContentTypeModel\";\nimport type DetailModel from \"./detail/DetailModel\";\nimport type AssignmentFilterModel from \"./filters/AssignmentFilterModel\";\nimport type FilterModel from \"./filters/FilterModel\";\nimport type RangeFilterModel from \"./filters/RangeFilterModel\";\nimport type ConceptIndexFilterModel from \"./filters/ConceptIndexFilterModel\";\nimport type FormModel from \"./form/FormModel\";\nimport type ListDetailModel from \"./list/ListDetailModel\";\nimport type ListModel from \"./list/ListModel\";\nimport type ModelCatalogModel from \"./modelcatalog/ModelCatalogModel\";\nimport type GroupingPanelModel from \"./panels/GroupingPanelModel\";\nimport type CaseSearchModel from \"./search/CaseSearchModel\";\nimport type TabModel from \"./tab/TabModel\";\nimport type TaskGroupModel from \"./taskgroup/TaskGroupModel\";\nimport type UserModel from \"./user/UserModel\";\nimport type UserServicesModel from \"./user/UserServicesModel\";\nimport type LinkModel from \"./links/LinkModel\";\nimport type LookupOptionsModel from \"./lookup/LookupOptionsModel\";\nimport type
|
|
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 AttributeCollection from \"./attributes/AttributeCollection\";\nimport type AttributeModel from \"./attributes/AttributeModel\";\nimport type LayoutHintCollection from \"./layouthint/LayoutHintCollection\";\nimport type ErrorResponse from \"./error/ErrorResponse\";\n\nexport type ModularUIModel =\n | ApplicationModel\n | CaseSearchModel\n | CaseViewModel\n | ListDetailModel\n | DetailModel\n | FormModel\n | GroupingPanelModel\n | ListModel\n | TabModel\n | TaskGroupModel\n | UserModel\n | UserServicesModel\n | ModelCatalogModel\n | ConceptIndexModel\n | ConceptDetailModel\n | BusinessScenarioModel\n | ConceptTypeDetailModel\n | ContentIndexModel\n | ContentTOCModel\n | ContentModel\n | ContentTypeModel\n | LookupOptionsModel;\n\nexport type AttributeType =\n | BooleanAttributeModel\n | CaptchaAttributeModel\n | ChoiceAttributeModel\n | DatetimeAttributeModel\n | HelptextAttributeModel\n | LabelAttributeModel\n | MemoAttributeModel\n | MoneyAttributeModel\n | NumberAttributeModel\n | PasswordAttributeModel\n | CompositeAttributeModel\n | StringAttributeModel\n | UploadAttributeModel\n | XMLAttributeModel;\n\nexport type RangeChildAttributeType =\n | NumberAttributeModel\n | DatetimeAttributeModel;\n\nexport type FilterType =\n | AssignmentFilterModel\n | FilterModel\n | RangeFilterModel\n | ConceptIndexFilterModel;\n\nexport type FormErrorAnchor = {\n id: string,\n properties?: {\n [propertyName: string]: string | number,\n },\n anchor?: {\n objectid: string,\n elementid?: string,\n _links?: Object,\n index?: number,\n \"index-identifier\"?: string,\n },\n layouthint: LayoutHintCollection,\n message: string,\n param?: {\n name: string,\n },\n};\n\nexport type labelsJSON = {\n _id: string,\n label: string,\n value: string,\n};\n\nexport type propertyJSON = {\n _id: string,\n type: string,\n mandatory: string,\n label: string,\n value: string,\n};\n\nexport type textfragmentJSON = {\n label: string,\n text: string,\n type: string,\n};\n\nexport interface IConstraintModel {\n +id: string;\n +defaultMessage: string;\n +parameters: Object;\n +isMandatoryConstraint: boolean;\n validate(value: any): boolean;\n hasValidation(): boolean;\n}\n\nexport interface ILayoutHintRule {\n process(attribute: AttributeModel, attributes: AttributeCollection): void;\n}\n\nexport interface IModelWithChildModels {\n getInitialChildModelLinks(): Array<LinkModel>;\n setChildModels(\n models: Array<ModularUIModel>,\n errors: Array<ErrorResponse>,\n ): void;\n}\n\nexport type AuthenticationType = {\n name: string,\n authentication: string,\n redirectUri?: string,\n isPrimary: boolean,\n};\n\nexport type FileEntryType = {\n name: string,\n size?: number,\n progress: number,\n error?: string,\n token?: string,\n};\n\nexport type FilesType = {\n [filename: string]: FileEntryType,\n};\n\nexport type FiletypeConstraintsType = Array<{|\n extensions: Array<string>,\n mimeTypes: Array<string>,\n|}>;\n\nexport type FilesizeConstraintsType = {\n fileSize: ?number,\n maxTotalFileSize: ?number,\n isMaxTotal: boolean,\n};\n\nexport type PropertyData = { type: string, label: string, value: string };\nexport type TextFragmentData = {\n type: string,\n label: string,\n text: string | { id?: string, message: string, properties?: Object },\n};\nexport type SectionData = {\n id: string,\n type: string,\n label?: string,\n number?: string,\n body: string | { id?: string, message: string, properties?: Object },\n _links: { self: { href: string } },\n childSections?: Array<SectionData>,\n sections?: Array<SectionData>,\n subSections: Array<SectionData>,\n};\n\nexport type PropertyElement = {\n propertyElement: {\n label: string,\n layouthint: Array<string>,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElement = {\n textFragmentElement: {\n label: string,\n layouthint: Array<string>,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElement = {\n contentElement: {\n label: string,\n layouthint: Array<string>,\n sections: Array<SectionData>,\n },\n};\n\nexport type PropertyElementMapped = {\n propertyElement: {\n label: string,\n layouthint: LayoutHintCollection,\n properties: Array<PropertyData>,\n },\n};\nexport type TextFragmentElementMapped = {\n textFragmentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n textfragments: Array<TextFragmentData>,\n },\n};\nexport type ContentElementMapped = {\n contentElement: {\n label: string,\n layouthint: LayoutHintCollection,\n sections: Array<SectionModel>,\n },\n};\n\nexport type ContentAll = Array<\n PropertyElementMapped | TextFragmentElementMapped | ContentElementMapped,\n>;\n\nexport type ContentData = {\n header: {\n label?: string,\n description?: { id?: string, message: string, properties?: Object },\n },\n label?: string,\n elements: Array<PropertyElement | TextFragmentElement | ContentElement>,\n};\n\nexport type SectionFragment = {\n text: string,\n startOffset: number,\n endOffset: number,\n};\n\nexport type ModelOptions = {\n origin?: ?string,\n contextPath?: ?string,\n};\n"],"mappings":"","ignoreList":[]}
|
|
@@ -81,12 +81,13 @@ const modularUIConnector = (name, resource, options = {
|
|
|
81
81
|
}, [dispatch, doReload, url, modelKey]);
|
|
82
82
|
|
|
83
83
|
// Remove model when hoc unloads
|
|
84
|
-
useEffect(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
useEffect(
|
|
85
|
+
// prettier-ignore
|
|
86
|
+
() => () => {
|
|
87
|
+
//NOSONAR
|
|
88
|
+
if (finalRemoveOnUnmount) {
|
|
89
|
+
dispatch(removeModelByKey(modelKey));
|
|
90
|
+
}
|
|
90
91
|
}, [dispatch, modelKey, finalRemoveOnUnmount]);
|
|
91
92
|
|
|
92
93
|
// Create new properties object to inject modularui properties to own props
|
|
@@ -118,13 +118,15 @@ const modularUIConnector = (
|
|
|
118
118
|
}, [dispatch, doReload, url, modelKey]);
|
|
119
119
|
|
|
120
120
|
// Remove model when hoc unloads
|
|
121
|
-
useEffect(
|
|
122
|
-
|
|
121
|
+
useEffect(
|
|
122
|
+
// prettier-ignore
|
|
123
|
+
() => () => { //NOSONAR
|
|
123
124
|
if (finalRemoveOnUnmount) {
|
|
124
125
|
dispatch(removeModelByKey(modelKey));
|
|
125
126
|
}
|
|
126
|
-
}
|
|
127
|
-
|
|
127
|
+
},
|
|
128
|
+
[dispatch, modelKey, finalRemoveOnUnmount],
|
|
129
|
+
);
|
|
128
130
|
|
|
129
131
|
// Create new properties object to inject modularui properties to own props
|
|
130
132
|
const locale = useLocale();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModularUIConnector.js","names":["useEffect","useDispatch","useLocation","loadModularUI","reloadModel","removeModelByKey","Href","getDisplayName","useUrl","useReload","useModularUI","useLocale","FormModel","jsx","_jsx","patchUpdateModelOption","oldOptions","updateModel","updateHandler","newModel","clonedModel","clone","update","modularUIConnector","name","resource","options","propName","removeOnUnmount","otherOptions","Component","WrappedComponent","props","finalRemoveOnUnmount","dispatch","location","url","displayName","contextId","modelEntry","modelKey","model","connectKey","handleManualReload","reloadOptions","handleFetch","href","fetchOptions","reload","state","doReload","isReload","locale","newProps","status","lastModification","hasModel","Boolean","fetchModularUI"],"sources":["../../../src/redux/_modularui/ModularUIConnector.js"],"sourcesContent":["// @flow\nimport { useEffect } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router\";\n\nimport {\n loadModularUI,\n reloadModel,\n removeModelByKey,\n} from \"./ModularUIActions\";\n\nimport Href from \"../../models/href/Href\";\nimport { getDisplayName } from \"../../react/utils\";\n\nimport { useUrl, useReload } from \"./ModularUIUtils\";\nimport { useModularUI } from \"../../hooks/useModularUI\";\nimport { useLocale } from \"../../hooks/useI18n\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { Location } from \"react-router\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport type { ModularUIOptions } from \"./types\";\nimport FormModel from \"../../models/form/FormModel\";\n\nexport type InjectedProps = {\n +modelKey: string,\n +location: Location,\n +status: string | null,\n +lastModification: number | null,\n +hasModel: boolean,\n +locale: string,\n +fetchModularUI: (href: string | Href, fetchOptions: Object) => void,\n +reloadModel: (model: ModularUIModel, options: Object) => void,\n +data?: ?ModularUIModel,\n};\n\nconst patchUpdateModelOption = (oldOptions: Object) => {\n if (\n \"updateModel\" in oldOptions &&\n oldOptions.updateModel instanceof FormModel\n ) {\n return {\n ...oldOptions,\n updateHandler: (newModel: ModularUIModel): ModularUIModel => {\n if (newModel instanceof FormModel) {\n // $FLowFixMe\n const clonedModel: FormModel = oldOptions.updateModel.clone();\n clonedModel.update(newModel);\n return clonedModel;\n }\n return newModel;\n },\n };\n }\n\n return oldOptions;\n};\n\n/**\n */\nconst modularUIConnector = (\n name: string,\n resource: string | Function,\n options: ModularUIOptions = { propName: \"data\", removeOnUnmount: false },\n): ((Component: ComponentType<any>) => (props: any) => Node) => {\n const {\n propName = \"data\",\n removeOnUnmount = false,\n ...otherOptions\n } = options;\n\n return (Component: ComponentType<any>) => {\n const WrappedComponent = (props: any) => {\n // explicit property for removeOnMount overwrite the setting\n const finalRemoveOnUnmount = props.removeOnUnmount ?? removeOnUnmount;\n\n const dispatch = useDispatch();\n const location = useLocation();\n\n const url = useUrl(resource, { location, ...props });\n const displayName = getDisplayName(Component, name, props.contextId);\n\n // Load the model through the useModUI hook\n const modelEntry = useModularUI(displayName, url, {\n ...otherOptions,\n removeOnUnmount: finalRemoveOnUnmount,\n });\n const modelKey = modelEntry?.model?.connectKey;\n\n // handle manual reload of model\n const handleManualReload = (\n model: ModularUIModel,\n reloadOptions?: Object,\n ) => {\n dispatch(reloadModel(model, reloadOptions));\n };\n\n // Provide connected models with a fetchModularUI method to be able\n // to run the loadModularUI action from a handler / callback in the component\n const handleFetch = (href: string | Href, fetchOptions: Object) => {\n dispatch(\n loadModularUI(modelKey, href, patchUpdateModelOption(fetchOptions)),\n );\n };\n\n // Check if current model needs a reload\n const reload = location?.state?.reload ?? 0;\n const doReload = useReload(modelEntry, reload);\n useEffect(() => {\n if (doReload) {\n dispatch(\n loadModularUI(modelKey, url, {\n ...patchUpdateModelOption(otherOptions),\n isReload: true,\n }),\n );\n }\n }, [dispatch, doReload, url, modelKey]);\n\n // Remove model when hoc unloads\n useEffect(() =>
|
|
1
|
+
{"version":3,"file":"ModularUIConnector.js","names":["useEffect","useDispatch","useLocation","loadModularUI","reloadModel","removeModelByKey","Href","getDisplayName","useUrl","useReload","useModularUI","useLocale","FormModel","jsx","_jsx","patchUpdateModelOption","oldOptions","updateModel","updateHandler","newModel","clonedModel","clone","update","modularUIConnector","name","resource","options","propName","removeOnUnmount","otherOptions","Component","WrappedComponent","props","finalRemoveOnUnmount","dispatch","location","url","displayName","contextId","modelEntry","modelKey","model","connectKey","handleManualReload","reloadOptions","handleFetch","href","fetchOptions","reload","state","doReload","isReload","locale","newProps","status","lastModification","hasModel","Boolean","fetchModularUI"],"sources":["../../../src/redux/_modularui/ModularUIConnector.js"],"sourcesContent":["// @flow\nimport { useEffect } from \"react\";\nimport { useDispatch } from \"react-redux\";\nimport { useLocation } from \"react-router\";\n\nimport {\n loadModularUI,\n reloadModel,\n removeModelByKey,\n} from \"./ModularUIActions\";\n\nimport Href from \"../../models/href/Href\";\nimport { getDisplayName } from \"../../react/utils\";\n\nimport { useUrl, useReload } from \"./ModularUIUtils\";\nimport { useModularUI } from \"../../hooks/useModularUI\";\nimport { useLocale } from \"../../hooks/useI18n\";\n\nimport type { ComponentType, Node } from \"react\";\nimport type { Location } from \"react-router\";\nimport type { ModularUIModel } from \"../../models/types\";\nimport type { ModularUIOptions } from \"./types\";\nimport FormModel from \"../../models/form/FormModel\";\n\nexport type InjectedProps = {\n +modelKey: string,\n +location: Location,\n +status: string | null,\n +lastModification: number | null,\n +hasModel: boolean,\n +locale: string,\n +fetchModularUI: (href: string | Href, fetchOptions: Object) => void,\n +reloadModel: (model: ModularUIModel, options: Object) => void,\n +data?: ?ModularUIModel,\n};\n\nconst patchUpdateModelOption = (oldOptions: Object) => {\n if (\n \"updateModel\" in oldOptions &&\n oldOptions.updateModel instanceof FormModel\n ) {\n return {\n ...oldOptions,\n updateHandler: (newModel: ModularUIModel): ModularUIModel => {\n if (newModel instanceof FormModel) {\n // $FLowFixMe\n const clonedModel: FormModel = oldOptions.updateModel.clone();\n clonedModel.update(newModel);\n return clonedModel;\n }\n return newModel;\n },\n };\n }\n\n return oldOptions;\n};\n\n/**\n */\nconst modularUIConnector = (\n name: string,\n resource: string | Function,\n options: ModularUIOptions = { propName: \"data\", removeOnUnmount: false },\n): ((Component: ComponentType<any>) => (props: any) => Node) => {\n const {\n propName = \"data\",\n removeOnUnmount = false,\n ...otherOptions\n } = options;\n\n return (Component: ComponentType<any>) => {\n const WrappedComponent = (props: any) => {\n // explicit property for removeOnMount overwrite the setting\n const finalRemoveOnUnmount = props.removeOnUnmount ?? removeOnUnmount;\n\n const dispatch = useDispatch();\n const location = useLocation();\n\n const url = useUrl(resource, { location, ...props });\n const displayName = getDisplayName(Component, name, props.contextId);\n\n // Load the model through the useModUI hook\n const modelEntry = useModularUI(displayName, url, {\n ...otherOptions,\n removeOnUnmount: finalRemoveOnUnmount,\n });\n const modelKey = modelEntry?.model?.connectKey;\n\n // handle manual reload of model\n const handleManualReload = (\n model: ModularUIModel,\n reloadOptions?: Object,\n ) => {\n dispatch(reloadModel(model, reloadOptions));\n };\n\n // Provide connected models with a fetchModularUI method to be able\n // to run the loadModularUI action from a handler / callback in the component\n const handleFetch = (href: string | Href, fetchOptions: Object) => {\n dispatch(\n loadModularUI(modelKey, href, patchUpdateModelOption(fetchOptions)),\n );\n };\n\n // Check if current model needs a reload\n const reload = location?.state?.reload ?? 0;\n const doReload = useReload(modelEntry, reload);\n useEffect(() => {\n if (doReload) {\n dispatch(\n loadModularUI(modelKey, url, {\n ...patchUpdateModelOption(otherOptions),\n isReload: true,\n }),\n );\n }\n }, [dispatch, doReload, url, modelKey]);\n\n // Remove model when hoc unloads\n useEffect(\n // prettier-ignore\n () => () => { //NOSONAR\n if (finalRemoveOnUnmount) {\n dispatch(removeModelByKey(modelKey));\n }\n },\n [dispatch, modelKey, finalRemoveOnUnmount],\n );\n\n // Create new properties object to inject modularui properties to own props\n const locale = useLocale();\n const newProps: InjectedProps = {\n modelKey,\n [propName]: modelEntry?.model ?? null,\n location,\n status: modelEntry?.status ?? null,\n lastModification: modelEntry?.lastModification ?? null,\n hasModel: Boolean(modelEntry),\n locale,\n fetchModularUI: handleFetch,\n reloadModel: handleManualReload,\n };\n\n return <Component {...props} {...newProps} />;\n };\n\n WrappedComponent.displayName = `BI.modularui(${getDisplayName(\n WrappedComponent,\n name,\n )}`;\n\n return WrappedComponent;\n };\n};\n\nexport default modularUIConnector;\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,WAAW,QAAQ,cAAc;AAE1C,SACEC,aAAa,EACbC,WAAW,EACXC,gBAAgB,QACX,oBAAoB;AAE3B,OAAOC,IAAI,MAAM,wBAAwB;AACzC,SAASC,cAAc,QAAQ,mBAAmB;AAElD,SAASC,MAAM,EAAEC,SAAS,QAAQ,kBAAkB;AACpD,SAASC,YAAY,QAAQ,0BAA0B;AACvD,SAASC,SAAS,QAAQ,qBAAqB;AAM/C,OAAOC,SAAS,MAAM,6BAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAcpD,MAAMC,sBAAsB,GAAIC,UAAkB,IAAK;EACrD,IACE,aAAa,IAAIA,UAAU,IAC3BA,UAAU,CAACC,WAAW,YAAYL,SAAS,EAC3C;IACA,OAAO;MACL,GAAGI,UAAU;MACbE,aAAa,EAAGC,QAAwB,IAAqB;QAC3D,IAAIA,QAAQ,YAAYP,SAAS,EAAE;UACjC;UACA,MAAMQ,WAAsB,GAAGJ,UAAU,CAACC,WAAW,CAACI,KAAK,CAAC,CAAC;UAC7DD,WAAW,CAACE,MAAM,CAACH,QAAQ,CAAC;UAC5B,OAAOC,WAAW;QACpB;QACA,OAAOD,QAAQ;MACjB;IACF,CAAC;EACH;EAEA,OAAOH,UAAU;AACnB,CAAC;;AAED;AACA;AACA,MAAM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CAAC;AAED,eAAeR,kBAAkB","ignoreList":[]}
|
package/lib/hooks/useList.js
CHANGED
|
@@ -47,7 +47,7 @@ exports.useListDetail = useListDetail;
|
|
|
47
47
|
const useListNavigation = () => {
|
|
48
48
|
const history = (0, _reactRouter.useHistory)();
|
|
49
49
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
50
|
-
const
|
|
50
|
+
const update = (list, resetPage = false) => {
|
|
51
51
|
const listHref = list.selfhref;
|
|
52
52
|
if (resetPage) {
|
|
53
53
|
listHref.page = null;
|
|
@@ -57,7 +57,7 @@ const useListNavigation = () => {
|
|
|
57
57
|
search: listHref.querystring,
|
|
58
58
|
state: list.formdata
|
|
59
59
|
});
|
|
60
|
-
|
|
60
|
+
dispatch((0, _redux.loadModularUI)(list.connectKey, listHref, {
|
|
61
61
|
method: _Constants.HTTP_METHODS.POST,
|
|
62
62
|
data: list.formdata,
|
|
63
63
|
targetModel: _ListModel.default
|
|
@@ -66,14 +66,14 @@ const useListNavigation = () => {
|
|
|
66
66
|
history.push({
|
|
67
67
|
search: listHref.querystring
|
|
68
68
|
});
|
|
69
|
-
|
|
69
|
+
dispatch((0, _redux.loadModularUI)(list.connectKey, listHref, {
|
|
70
70
|
method: _Constants.HTTP_METHODS.GET,
|
|
71
71
|
targetModel: _ListModel.default
|
|
72
72
|
}));
|
|
73
73
|
}
|
|
74
74
|
};
|
|
75
75
|
return {
|
|
76
|
-
|
|
76
|
+
update
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
79
|
exports.useListNavigation = useListNavigation;
|
package/lib/hooks/useList.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useList.js","names":["_useModularUIBasic","require","_reactRedux","_Constants","_redux","_DetailModel","_interopRequireDefault","_ListModel","_ListDetailModel","_Href","_reactRouter","useList","href","options","useModularUIBasic","expectedModels","targetModel","ListModel","exports","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useListNavigation","history","useHistory","dispatch","useDispatch","
|
|
1
|
+
{"version":3,"file":"useList.js","names":["_useModularUIBasic","require","_reactRedux","_Constants","_redux","_DetailModel","_interopRequireDefault","_ListModel","_ListDetailModel","_Href","_reactRouter","useList","href","options","useModularUIBasic","expectedModels","targetModel","ListModel","exports","useListOrDetail","DetailModel","useListDetail","ListDetailModel","forceTargetModel","useListNavigation","history","useHistory","dispatch","useDispatch","update","list","resetPage","listHref","selfhref","page","requestMethod","HTTP_METHODS","POST","push","search","querystring","state","formdata","loadModularUI","connectKey","method","data","GET"],"sources":["../../src/hooks/useList.js"],"sourcesContent":["// @flow\nimport { useModularUIBasic } from \"./useModularUIBasic\";\nimport { useDispatch } from \"react-redux\";\nimport { HTTP_METHODS } from \"../constants/Constants\";\nimport { loadModularUI } from \"../redux\";\nimport DetailModel from \"../models/detail/DetailModel\";\nimport ListModel from \"../models/list/ListModel\";\nimport ListDetailModel from \"../models/list/ListDetailModel\";\nimport Href from \"../models/href/Href\";\n\nimport type { HookOptions } from \"./useModularUIBasic\";\nimport { useHistory } from \"react-router\";\n\ntype ListNavigationHook = {\n update: (list: ListModel, resetPage?: boolean) => void,\n};\n\n/**\n */\nexport const useList = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\"],\n targetModel: ListModel,\n ...options,\n });\n\n/**\n */\nexport const useListOrDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListModel | DetailModel | null =>\n useModularUIBasic(\"list\", href, {\n expectedModels: [\"List\", \"Detail\"],\n targetModel: [ListModel, DetailModel],\n ...options,\n });\n\n/**\n */\nexport const useListDetail = (\n href: string | Href,\n options?: HookOptions,\n): ListDetailModel | null =>\n useModularUIBasic(\"listdetail\", href, {\n expectedModels: [\"ListDetail\"],\n targetModel: ListDetailModel,\n forceTargetModel: true,\n ...options,\n });\n\n/**\n */\nexport const useListNavigation = (): ListNavigationHook => {\n const history = useHistory();\n const dispatch = useDispatch();\n\n const update = (list: ListModel, resetPage: boolean = false) => {\n const listHref = list.selfhref;\n if (resetPage) {\n listHref.page = null;\n }\n\n if (list.requestMethod === HTTP_METHODS.POST) {\n history.push({ search: listHref.querystring, state: list.formdata });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.POST,\n data: list.formdata,\n targetModel: ListModel,\n }),\n );\n } else {\n history.push({ search: listHref.querystring });\n dispatch(\n loadModularUI(list.connectKey, listHref, {\n method: HTTP_METHODS.GET,\n targetModel: ListModel,\n }),\n );\n }\n };\n\n return {\n update,\n };\n};\n"],"mappings":";;;;;;;AACA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,UAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,gBAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,KAAA,GAAAH,sBAAA,CAAAL,OAAA;AAGA,IAAAS,YAAA,GAAAT,OAAA;AAMA;AACA;AACO,MAAMU,OAAO,GAAGA,CACrBC,IAAmB,EACnBC,OAAqB,KAErB,IAAAC,oCAAiB,EAAC,MAAM,EAAEF,IAAI,EAAE;EAC9BG,cAAc,EAAE,CAAC,MAAM,CAAC;EACxBC,WAAW,EAAEC,kBAAS;EACtB,GAAGJ;AACL,CAAC,CAAC;;AAEJ;AACA;AADAK,OAAA,CAAAP,OAAA,GAAAA,OAAA;AAEO,MAAMQ,eAAe,GAAGA,CAC7BP,IAAmB,EACnBC,OAAqB,KAErB,IAAAC,oCAAiB,EAAC,MAAM,EAAEF,IAAI,EAAE;EAC9BG,cAAc,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;EAClCC,WAAW,EAAE,CAACC,kBAAS,EAAEG,oBAAW,CAAC;EACrC,GAAGP;AACL,CAAC,CAAC;;AAEJ;AACA;A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EAAE;QACvCa,MAAM,EAAET,uBAAY,CAACW,GAAG;QACxB/B,WAAW,EAAEC;MACf,CAAC,CACH,CAAC;IACH;EACF,CAAC;EAED,OAAO;IACLY;EACF,CAAC;AACH,CAAC;AAACX,OAAA,CAAAM,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -112,8 +112,9 @@ class ConceptIndexModel extends _ResourceModel.default {
|
|
|
112
112
|
*/
|
|
113
113
|
get entryDate() {
|
|
114
114
|
const timeversionFilter = this.filterCollection.getFilterByAttributeKey(_Constants.TIMEVERSION_FILTER_NAME);
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
const date = timeversionFilter?.value;
|
|
116
|
+
if (typeof date === "string") {
|
|
117
|
+
return date;
|
|
117
118
|
}
|
|
118
119
|
return null;
|
|
119
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptIndexModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ResourceCollection","_FilterCollection","_ConceptLinkModel","_Constants","ConceptIndexModel","ResourceModel","constructor","modularuiResponse","_context","_defineProperty2","default","_filterCollection","FilterCollection","_filter","data","filter","contributions","dynamicschema","modelOptions","_concepts","ResourceCollection","collection","_embedded","_map","results","call","concept","ConceptLinkModel","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","TIMEVERSION_FILTER_NAME","
|
|
1
|
+
{"version":3,"file":"ConceptIndexModel.js","names":["_ResourceModel","_interopRequireDefault","require","_ResourceCollection","_FilterCollection","_ConceptLinkModel","_Constants","ConceptIndexModel","ResourceModel","constructor","modularuiResponse","_context","_defineProperty2","default","_filterCollection","FilterCollection","_filter","data","filter","contributions","dynamicschema","modelOptions","_concepts","ResourceCollection","collection","_embedded","_map","results","call","concept","ConceptLinkModel","entryDate","type","resourcetype","modelName","isApplicableModel","resourceType","getInitialChildModelLinks","items","setChildModels","models","errors","selfhref","href","selflink","filterCollection","hasItems","forEach","params","param","value","setParameter","name","removeParameter","label","getContribution","indexfilter","getFilterByAttributeKey","timeversionFilter","TIMEVERSION_FILTER_NAME","date","searchtermfilter","modelCategoryFilter","itemCollection","exports"],"sources":["../../../src/models/concepts/ConceptIndexModel.js"],"sourcesContent":["// @flow\nimport ResourceModel from \"../base/ResourceModel\";\nimport ResourceCollection from \"../base/ResourceCollection\";\nimport FilterCollection from \"../filters/FilterCollection\";\nimport ConceptLinkModel from \"./ConceptLinkModel\";\n\nimport { TIMEVERSION_FILTER_NAME } from \"../../constants/Constants\";\n\nimport type { ModularUIResponse } from \"../../modularui\";\nimport type { FilterType, ModularUIModel } from \"../types\";\nimport type LinkModel from \"../links/LinkModel\";\nimport type Href from \"../href/Href\";\nimport type ErrorResponse from \"../error/ErrorResponse\";\n\n/**\n * Get Index of concepts, to filter model catalog\n */\nexport default class ConceptIndexModel extends ResourceModel {\n _filterCollection: FilterCollection;\n _concepts: ResourceCollection<ConceptLinkModel>;\n\n /**\n */\n constructor(modularuiResponse: ModularUIResponse) {\n super(modularuiResponse);\n\n this._filterCollection = new FilterCollection(\n this.data.filter,\n {\n filter: this.contributions.filter,\n dynamicschema: this.data.dynamicschema,\n },\n this.modelOptions,\n );\n\n this._concepts = new ResourceCollection();\n this._concepts.collection = this.data._embedded\n ? this.data._embedded.results.map(\n (concept) =>\n new ConceptLinkModel(\n concept.concept,\n this.entryDate,\n this.modelOptions,\n ),\n )\n : [];\n }\n\n /**\n */\n get type(): string {\n if (this.resourcetype === \"RelatedConcepts\") {\n return \"RelatedConcepts\";\n }\n\n return \"ConceptIndex\";\n }\n\n /**\n */\n static get modelName(): string {\n return \"ConceptIndexModel\";\n }\n\n /**\n */\n static isApplicableModel(data: ModularUIResponse): boolean {\n const resourceType = data.contributions?.resourcetype;\n return (\n resourceType === \"ConceptSearch\" ||\n resourceType === \"relatedConcepts\" ||\n resourceType === \"RelatedConcepts\"\n );\n }\n\n /**\n */\n getInitialChildModelLinks(): Array<LinkModel> {\n return this.items.getInitialChildModelLinks();\n }\n\n /**\n */\n setChildModels(models: Array<ModularUIModel>, errors: Array<ErrorResponse>) {\n this.items.setChildModels(models, errors);\n }\n\n /**\n * Getting the self link of this list\n */\n get selfhref(): Href {\n const { href } = this.selflink;\n\n if (this.filterCollection.hasItems) {\n this.filterCollection.forEach((filter) => {\n filter.params.forEach((param) => {\n if (param.value) {\n href.setParameter(param.name, param.value);\n } else {\n href.removeParameter(param.name);\n }\n });\n });\n }\n\n return href;\n }\n\n /**\n */\n get label(): string {\n return this.getContribution(\"label\");\n }\n\n /**\n * Retrieve filters of conceptindex model\n */\n get filterCollection(): FilterCollection {\n return this._filterCollection;\n }\n\n /**\n * Get index filter\n */\n get indexfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"index\");\n }\n\n /**\n * Retrieve modelcatalog.js of content toc\n */\n get entryDate(): ISO_DATE | null {\n const timeversionFilter = this.filterCollection.getFilterByAttributeKey(\n TIMEVERSION_FILTER_NAME,\n );\n\n const date = timeversionFilter?.value;\n if (typeof date === \"string\") {\n return date;\n }\n return null;\n }\n\n /**\n * get searchterm filter\n */\n get searchtermfilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"label\");\n }\n\n /**\n * Get model category filter\n */\n get modelCategoryFilter(): FilterType | null {\n return this.filterCollection.getFilterByAttributeKey(\"modelCategory\");\n }\n\n /**\n * Get concept links found by index filter\n */\n get items(): ResourceCollection<ConceptLinkModel> {\n return this._concepts;\n }\n\n /**\n * Replace the items collection\n */\n set items(itemCollection: ResourceCollection<ConceptLinkModel>) {\n this._concepts = itemCollection;\n }\n}\n"],"mappings":";;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAH,sBAAA,CA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EAC/D;;EAEA;AACF;AACA;EACE,IAAI1B,SAASA,CAAA,EAAoB;IAC/B,MAAM2B,iBAAiB,GAAG,IAAI,CAACb,gBAAgB,CAACY,uBAAuB,CACrEE,kCACF,CAAC;IAED,MAAMC,IAAI,GAAGF,iBAAiB,EAAER,KAAK;IACrC,IAAI,OAAOU,IAAI,KAAK,QAAQ,EAAE;MAC5B,OAAOA,IAAI;IACb;IACA,OAAO,IAAI;EACb;;EAEA;AACF;AACA;EACE,IAAIC,gBAAgBA,CAAA,EAAsB;IACxC,OAAO,IAAI,CAAChB,gBAAgB,CAACY,uBAAuB,CAAC,OAAO,CAAC;EAC/D;;EAEA;AACF;AACA;EACE,IAAIK,mBAAmBA,CAAA,EAAsB;IAC3C,OAAO,IAAI,CAACjB,gBAAgB,CAACY,uBAAuB,CAAC,eAAe,CAAC;EACvE;;EAEA;AACF;AACA;EACE,IAAInB,KAAKA,CAAA,EAAyC;IAChD,OAAO,IAAI,CAAChB,SAAS;EACvB;;EAEA;AACF;AACA;EACE,IAAIgB,KAAKA,CAACyB,cAAoD,EAAE;IAC9D,IAAI,CAACzC,SAAS,GAAGyC,cAAc;EACjC;AACF;AAACC,OAAA,CAAAnD,OAAA,GAAAN,iBAAA","ignoreList":[]}
|
|
@@ -14,6 +14,7 @@ var _FilterCollection = _interopRequireDefault(require("../filters/FilterCollect
|
|
|
14
14
|
var _ContentLinkModel = _interopRequireDefault(require("./ContentLinkModel"));
|
|
15
15
|
var _Href = _interopRequireDefault(require("../href/Href"));
|
|
16
16
|
var _ChoiceAttributeModel = _interopRequireDefault(require("../attributes/ChoiceAttributeModel"));
|
|
17
|
+
var _ConceptIndexFilterModel = _interopRequireDefault(require("../filters/ConceptIndexFilterModel"));
|
|
17
18
|
/**
|
|
18
19
|
* Get Index of concepts, to filter model catalog
|
|
19
20
|
*/
|
|
@@ -97,7 +98,11 @@ class ContentIndexModel extends _ResourceModel.default {
|
|
|
97
98
|
* Get index filter
|
|
98
99
|
*/
|
|
99
100
|
get indexfilter() {
|
|
100
|
-
|
|
101
|
+
const indexFilter = this._filterCollection.getFilterByAttributeKey("index");
|
|
102
|
+
if (indexFilter instanceof _ConceptIndexFilterModel.default) {
|
|
103
|
+
return indexFilter;
|
|
104
|
+
}
|
|
105
|
+
return null;
|
|
101
106
|
}
|
|
102
107
|
|
|
103
108
|
/**
|