Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix for failing linking to project search #147

Merged
merged 11 commits into from
Jul 11, 2024
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)
egauzens marked this conversation as resolved.
Show resolved Hide resolved
},
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
Loading