diff --git a/app/dashboard/template.hbs b/app/dashboard/template.hbs index 40bb5818cc..229e237ca5 100644 --- a/app/dashboard/template.hbs +++ b/app/dashboard/template.hbs @@ -239,7 +239,7 @@ {{t 'dashboard.noteworthy.search_more'}} diff --git a/app/home/-components/hero-banner/component.ts b/app/home/-components/hero-banner/component.ts index 214d3b2049..0ee4b144f3 100644 --- a/app/home/-components/hero-banner/component.ts +++ b/app/home/-components/hero-banner/component.ts @@ -2,13 +2,12 @@ import { tagName } from '@ember-decorators/component'; import Component from '@ember/component'; import { action } from '@ember/object'; import { alias } from '@ember/object/computed'; +import RouterService from '@ember/routing/router-service'; import { inject as service } from '@ember/service'; import { camelize } from '@ember/string'; import Features from 'ember-feature-flags/services/features'; import config from 'ember-get-config'; -import { serviceLinks } from 'ember-osf-web/const/service-links'; - import { layout } from 'ember-osf-web/decorators/component'; import styles from './styles'; @@ -20,13 +19,13 @@ const { featureFlagNames: { ABTesting } } = config; @tagName('') export default class HomeHeroBanner extends Component { @service features!: Features; + @service router!: RouterService; @alias(`features.${camelize(ABTesting.homePageHeroTextVersionB)}`) shouldShowVersionB!: boolean; @action search(query: string) { - const { search } = serviceLinks; - window.location.href = `${search}?q=${query}&page=1`; + this.router.transitionTo('search', { queryParams: { q: query }}); } } diff --git a/app/search/controller.ts b/app/search/controller.ts index 233cad0754..62edd10c54 100644 --- a/app/search/controller.ts +++ b/app/search/controller.ts @@ -4,16 +4,16 @@ import { tracked } from '@glimmer/tracking'; import { OnSearchParams, ResourceTypeFilterValue } from 'osf-components/components/search-page/component'; export default class SearchController extends Controller { - @tracked cardSearchText?: string = ''; + @tracked q?: string = ''; @tracked sort?: string = '-relevance'; @tracked resourceType?: ResourceTypeFilterValue | null = null; @tracked page?: string = ''; - queryParams = ['cardSearchText', 'page', 'sort', 'resourceType']; + queryParams = ['q', 'page', 'sort', 'resourceType']; @action onSearch(queryOptions: OnSearchParams) { - this.cardSearchText = queryOptions.cardSearchText; + this.q = queryOptions.cardSearchText; this.sort = queryOptions.sort; this.resourceType = queryOptions.resourceType; this.page = queryOptions.page; diff --git a/app/search/template.hbs b/app/search/template.hbs index 461716ba38..f6c7bab398 100644 --- a/app/search/template.hbs +++ b/app/search/template.hbs @@ -2,7 +2,7 @@ ; @tagName('') @layout(template) export default class MetadataTagsManagerComponent extends Component { + @service router!: RouterService; // required changeset!: BufferedChangeset; valuePath!: string; @@ -58,6 +55,6 @@ export default class MetadataTagsManagerComponent extends Component { @action clickTag(tag: string): void { - window.location.assign(`${pathJoin(baseUrl, 'search')}?q=(tags:"${encodeURIComponent(tag)}")`); + this.router.transitionTo('search', { queryParams: { q: `${encodeURIComponent(tag)}` } }); } } diff --git a/translations/en-us.yml b/translations/en-us.yml index 26400dc8d0..720ac6b773 100644 --- a/translations/en-us.yml +++ b/translations/en-us.yml @@ -612,7 +612,7 @@ node_navbar: settings: Settings comments: Comments status: - welcome_message: '

Welcome to OSF!

Visit our Guides to learn about creating a project, or get inspiration from popular public projects.

' + welcome_message: '

Welcome to OSF!

Visit our Guides to learn about creating a project, or get inspiration from popular public projects.

' alternate_email_error: 'The email address has NOT been added to your account. Please log out and revisit the link in your email. Thank you.' # remove_addon: 'Because the GitHub add-on for {extra.category} "{extra.title}" was authenticated by {extra.user}, authentication information has been deleted.' project_deleted: 'Project has been successfully deleted.'