Skip to content

Commit

Permalink
fix: not possible to see more or search for App items when creating d…
Browse files Browse the repository at this point in the history
…ashboard (#3187)

Fixes DHIS2-18835

Fix: the Item selector list is populated based on the item type, but for some reason 
the code for setting which types should "Show more" was using itemType.id, which APP lacked.
Now, it will consistently check the type rather than id. But also, the id property for APP
was added to the itemTypes object, for code consistency.
  • Loading branch information
jenniferarnesen authored Jan 22, 2025
1 parent 15cde91 commit 72cacc6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/modules/itemTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export const itemTypeMap = {
appKey: 'line-listing',
},
[APP]: {
id: APP,
endPointName: 'apps',
propName: 'appKey',
pluralTitle: i18n.t('Apps'),
Expand Down
2 changes: 1 addition & 1 deletion src/pages/edit/ItemSelector/ItemSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const ItemSelector = () => {
const itemCount = getDefaultItemCount(type)
const allItems = items[itemType.endPointName]
const hasMore = allItems.length > itemCount
const displayItems = maxOptions.has(itemType.id)
const displayItems = maxOptions.has(type)
? allItems
: allItems.slice(0, itemCount)

Expand Down

0 comments on commit 72cacc6

Please sign in to comment.