Skip to content

Commit

Permalink
Merge pull request #147 from ignapas/project-filters-hotfix
Browse files Browse the repository at this point in the history
Hotfix for failing linking to project search
  • Loading branch information
egauzens authored Jul 11, 2024
2 parents d42e0a6 + 27451d5 commit e442546
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
3 changes: 3 additions & 0 deletions components/FacetMenu/ProjectsFacetMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export default {
if (this.$route.query.selectedProjectsAnatomicalFocusIds) {
this.defaultCheckedAnatomicalFocusIds = this.$route.query.selectedProjectsAnatomicalFocusIds.split(",")
}
else {
this.$emit('projects-selections-changed')
}
},
methods: {
Expand Down
19 changes: 7 additions & 12 deletions pages/about/projects/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@
<el-col :sm="24" :md="8" :lg="6">
<client-only>
<projects-facet-menu :anatomicalFocusFacets="projectsAnatomicalFocusFacets"
@projects-selections-changed="onFacetSelectionChange()" @hook:mounted="facetMenuMounted"
ref="projectsFacetMenu" />
@projects-selections-changed="onFacetSelectionChange" ref="projectsFacetMenu" />
</client-only>
</el-col>
<el-col class="search-results-container" :sm="searchColSpan('sm')" :md="searchColSpan('md')"
Expand Down Expand Up @@ -272,7 +271,7 @@ export default {
// Added route name check bc clicking on Data & Models header link was causing this to still fire after navigating to the data page
if (!this.$route.query.consortiaType && this.$route.name == 'about-projects') {
this.$router.push({
query: {consortiaType: this.consortiaType['id'] }
query: { consortiaType: this.consortiaType.id }
})
} else {
this.searchData = {
Expand All @@ -284,32 +283,29 @@ export default {
this.fetchConsortiaStyle(this.consortiaType.id)
this.fetchResults()
}
},
immediate: true
}
},
'$route.query.search': {
handler: function () {
this.searchQuery = this.$route.query.search
this.fetchResults()
},
immediate: true
}
},
'$route.query.projectsSort': {
handler: function (option) {
this.fetchResults()
},
immediate: true
}
},
'$route.query.selectedProjectsAnatomicalFocusIds': {
handler: function (option) {
this.fetchResults()
},
immediate: true
}
},
},
beforeMount: function () {
this.windowWidth = window.innerWidth
this.fetchConsortiaStyle(this.consortiaType.id)
},
mounted: function () {
if (!this.$route.query.consortiaType) {
Expand All @@ -321,7 +317,6 @@ export default {
limit: Number(this.$route.query.limit || this.searchData.limit),
search: this.$route.query.search || ''
}
this.searchData = { ...this.searchData, ...queryParams }
}
if (window.innerWidth <= 768) this.titleColumnWidth = 150
Expand Down

0 comments on commit e442546

Please sign in to comment.