Skip to content

Commit

Permalink
feat: added filters for city and country summaries from stac
Browse files Browse the repository at this point in the history
  • Loading branch information
santilland committed Aug 1, 2023
1 parent 477f941 commit be670c3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
27 changes: 9 additions & 18 deletions app/src/components/IndicatorFiltersPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ export default {
),
*/
];
// If already set we do not need to set it again
if (this.searchItems.length > 0) {
return;
}
this.searchItems = itemArray;
this.$nextTick(() => {
Expand All @@ -71,40 +75,27 @@ export default {
{ key: 'tags', title: 'Tag' },
{ key: 'satellite', title: 'Satellite' },
{ key: 'sensor', title: 'Sensor' },
{ key: 'countries', title: 'Country' },
{ key: 'cities', title: 'City' },
],
aggregateResults: 'themes',
enableSearch: true,
enableHighlighting: true,
onSelect: (item) => {
this.setFeatureFilter({
indicators: item.code,
});
if (item.region === 'global') {
this.setSelectedIndicator(item);
} else {
this.setSelectedIndicator(null);
}
this.setSelectedIndicator(item);
},
fuseConfig: {
keys: [
'title', 'description', 'themes', 'region', 'tags', 'satellite', 'sensor',
'countries', 'cities',
],
},
},
gtif: {
titleProperty: 'title',
filterProperties: ['themes'],
onSelect: (item) => {
this.setFeatureFilter({
indicators: item.code,
});
if (this.getGroupedFeatures[0].properties.indicatorObject.siteName === 'global') {
this.setSelectedIndicator(
this.getGroupedFeatures[0].properties.indicatorObject,
);
} else {
this.setSelectedIndicator(null);
}
this.setSelectedIndicator(item);
},
exclusiveFilters: true,
fuseConfig: {
Expand Down
2 changes: 2 additions & 0 deletions app/src/store/modules/indicators.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ const actions = {
country: 'all',
city: 'World',
siteName: 'global',
countries: link.countries ? link.countries : [],
cities: link.cities ? link.cities : [],
// aoiID: 'CDS',
// TODO: some default values we seem to need would be great if we can remove them
subAoi: {
Expand Down

0 comments on commit be670c3

Please sign in to comment.