Skip to content

Commit cc4329e

Browse files
authored
Merge pull request #618 from adlius/Emb-610_Add_campaign_query_param_for_registries
[EMB-610] Add query parameter.
2 parents c6083eb + 0062049 commit cc4329e

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

lib/osf-components/addon/components/osf-navbar/auth-dropdown/component.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import pathJoin from 'ember-osf-web/utils/path-join';
1919
import styles from './styles';
2020
import template from './template';
2121

22-
const { OSF: { url: baseUrl }, featureFlagNames } = config;
22+
const { OSF: { url: baseUrl } } = config;
2323

2424
export class AuthBase extends Component {
2525
@service analytics!: Analytics;
@@ -53,12 +53,6 @@ export class AuthBase extends Component {
5353
return pathJoin(baseUrl, this.router.currentURL);
5454
}
5555

56-
@computed('signUpURL', 'signUpNext')
57-
get signUpRoute() {
58-
return this.features.isEnabled(featureFlagNames.routes.register) ? 'register' :
59-
`${this.signUpURL}?${param(this.signUpQueryParams)}`;
60-
}
61-
6256
@computed('router.currentRouteName', 'signUpNext')
6357
get signUpQueryParams() {
6458
const params: Record<string, string> = {};

lib/osf-components/addon/components/osf-navbar/auth-dropdown/template.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
data-test-ad-sign-up-button
66
data-analytics-name='SignUp'
77
class='btn btn-success btn-top-signup m-l-sm m-r-xs'
8-
@href={{this.signUpRoute}}
8+
@route='register'
99
@queryParams={{this.signUpQueryParams}}
1010
>
1111
{{t 'auth_dropdown.sign_up'}}

tests/engines/registries/integration/components/registries-navbar/component-test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Service from '@ember/service';
22
import { click, fillIn, render, triggerKeyEvent } from '@ember/test-helpers';
3-
import config from 'ember-get-config';
43
import { t } from 'ember-i18n/test-support';
54
import { setupEngineRenderingTest } from 'ember-osf-web/tests/helpers/engines';
65
import { setBreakpoint } from 'ember-responsive/test-support';
@@ -10,8 +9,6 @@ import $ from 'jquery';
109
import { module, test } from 'qunit';
1110
import sinon from 'sinon';
1211

13-
const { OSF: { url: osfUrl } } = config;
14-
1512
const statusMessagesStub = Service.extend({
1613
messages: [],
1714

@@ -88,17 +85,12 @@ module('Registries | Integration | Component | registries-navbar', hooks => {
8885
});
8986

9087
test('desktop layout (logged out)', async function(assert) {
91-
const osfUrlEncoded = encodeURIComponent(osfUrl);
9288
setBreakpoint('desktop');
9389
this.owner.lookup('service:session').set('isAuthenticated', false);
9490

9591
await render(hbs`<RegistriesNavbar @campaign="osf-registries" @signUpURL="http://example.com" />`);
9692

9793
assert.dom('a[data-test-join]').hasText(`${t('navbar.join')}`);
98-
assert.dom('a[data-test-join]').hasAttribute(
99-
'href',
100-
`http://example.com?campaign=osf-registries&next=${osfUrlEncoded}FakeURL`,
101-
);
10294
assert.dom('a[data-test-join]').isVisible('Join button is visible');
10395

10496
assert.dom('a[role="button"][data-test-login]').hasText(`${t('navbar.login')}`);

0 commit comments

Comments
 (0)