From 9c67aecaac12f5d16bbe1f3a6cb737d7e028a864 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 22 Aug 2023 17:10:41 -0400 Subject: [PATCH 1/2] Reroute users to registries landing page instead of discover page for osf --- lib/registries/addon/branded/index/route.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/registries/addon/branded/index/route.ts b/lib/registries/addon/branded/index/route.ts index c4adf37659..b2b0de51ff 100644 --- a/lib/registries/addon/branded/index/route.ts +++ b/lib/registries/addon/branded/index/route.ts @@ -1,8 +1,12 @@ import Route from '@ember/routing/route'; - +import config from 'ember-get-config'; export default class BrandedRegistriesIndexRoute extends Route { beforeModel() { const params: { providerId?: string } = this.paramsFor('branded'); + if (params.providerId === config.defaultProvider) { + return this.replaceWith('index'); + } + return this.replaceWith('branded.discover', params.providerId); } } From 719d6c38df137adf82d3d4a9435043084971b016 Mon Sep 17 00:00:00 2001 From: Futa Ikeda Date: Tue, 22 Aug 2023 17:49:01 -0400 Subject: [PATCH 2/2] Update test --- tests/engines/registries/acceptance/branded/discover-test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/engines/registries/acceptance/branded/discover-test.ts b/tests/engines/registries/acceptance/branded/discover-test.ts index d0d6ebb59b..3d101d7863 100644 --- a/tests/engines/registries/acceptance/branded/discover-test.ts +++ b/tests/engines/registries/acceptance/branded/discover-test.ts @@ -83,7 +83,7 @@ module('Registries | Acceptance | branded.discover', hooks => { await visit(`/registries/${osfProvider.id}`); assert.equal(currentRouteName(), - 'search', - '/registries/osf redirects to search page'); + 'registries.index', + '/registries/osf redirects to registries index page'); }); });