Skip to content

Commit

Permalink
#5588 details can be added also from section contents of map cards (#…
Browse files Browse the repository at this point in the history
…5598) (#5599)

* #5588 details can be added also from section contents of map cards
  • Loading branch information
MV88 authored Jul 3, 2020
1 parent 3e20118 commit 76354e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions web/client/epics/__tests__/maps-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const mapsState = {
}
};

// category is required to support details map
const testMap = {
"success": true,
"totalCount": 13,
Expand All @@ -101,6 +102,7 @@ const testMap = {
"description": "",
"id": 464,
"context": "2100",
"category": {name: "MAP"},
"contextName": "test-context",
"name": "TEST MAP",
"thumbnail": "base%2Fweb%2Fclient%2Ftest-resources%2Fimg%2Fblank.jpg",
Expand All @@ -121,6 +123,7 @@ const testMap2 = {
"lastUpdate": "2017-05-17 10:18:11.455",
"description": "",
"id": 464,
"category": {name: "MAP"},
"context": "2134",
"contextName": null,
"name": "TEST MAP",
Expand Down
10 changes: 7 additions & 3 deletions web/client/epics/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,13 @@ const getMapsResourcesByCategoryEpic = (action$, store) =>
}
})
.then(data => data))
.switchMap((response) => getContextNames(response).switchMap(responseWithContext => Rx.Observable.of(
mapsLoaded(responseWithContext, opts.params, searchText)
)))
.switchMap((response) => getContextNames(response).switchMap(responseWithContext => {
// category is required to identify maps for detail card. It's missing from this entry point
return Rx.Observable.of(
mapsLoaded({...responseWithContext, results: responseWithContext?.results?.map(res => ({...res, category: {name: "MAP"}}))}, opts.params, searchText)
);
}
))
)
.let(wrapStartStop(
loading(true, 'loadingMaps'),
Expand Down

0 comments on commit 76354e4

Please sign in to comment.