Skip to content

Commit

Permalink
Update taxonomy-top-list qp (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda committed Sep 18, 2023
1 parent 1e2cfaa commit 377f3d7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/components/taxonomy-top-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ export default Component.extend(Analytics, {
// subject param in the discover controller is expecting
const subjectOdd = sortedList.objectAt(i);
pair.pushObject({
path: [subjectOdd.get('path')],
path: `activeFilters=[{"propertyVisibleLabel":"Subject","propertyShortFormLabel":"subject","label":"${subjectOdd.get('text')}","value":"${subjectOdd.get('links.iri')}"}]`,
text: subjectOdd.get('text'),
});

if (sortedList.objectAt(i + 1)) {
const subjectEven = sortedList.objectAt(i + 1);
pair.pushObject({
path: [subjectEven.get('path')],
path: `activeFilters=[{"propertyVisibleLabel":"Subject","propertyShortFormLabel":"subject","label":"${subjectEven.get('text')}","value":"${subjectEven.get('links.iri')}"}]`,
text: subjectEven.get('text'),
});
}
Expand Down
10 changes: 5 additions & 5 deletions app/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export default Route.extend(Analytics, ResetScrollMixin, {
},
actions: {
search(q) {
// remove trailing slash if it exists
const host = this.host.replace(/\/$/, '');
if (this.get('theme.isSubRoute')) {
// TODO Phase2 search improvement: reroute users to new branded preprint discover page
const route = 'provider.discover';
this.transitionTo(route, { queryParams: { q } });
const { id } = this.get('theme');
window.location.href = `${host}/preprints/${id}/discover?q=${q}`;
} else {
// If OSF, reroute to new search page
window.location.href = `${this.host}/search?q=${q}&resourceType=osf:Preprints`;
window.location.href = `${host}/search?q=${q}&resourceType=Preprint`;
}
},
},
Expand Down
2 changes: 1 addition & 1 deletion app/templates/components/taxonomy-top-list.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{{#each pair as |subject|}}
<div class="col-xs-12 col-sm-6 subject-item">
<a
href="{{osfUrl}}preprints/{{theme.provider.id}}/discover?subject={{subject.path}}"
href="{{osfUrl}}preprints/{{theme.provider.id}}/discover?{{subject.path}}"
class="btn btn-primary p-sm"
>
{{subject.text}}
Expand Down

0 comments on commit 377f3d7

Please sign in to comment.