Skip to content

Commit 1eca32d

Browse files
authored
Merge pull request #635 from Real-Dev-Squad/develop
Dev to Main Sync
2 parents 2eeb0b1 + 872a845 commit 1eca32d

File tree

5 files changed

+26
-175
lines changed

5 files changed

+26
-175
lines changed

app/constants/url.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ export const REDIRECT_URLS = {
2323
notifications: `${MAIN_SITE_PREFIX}/notifications?dev=true`,
2424
identity: `${MAIN_SITE_PREFIX}/identity?dev=true`,
2525
mobile: `${MAIN_SITE_PREFIX}/mobile?dev=true`,
26-
// TODO: add other links after finishing their testing on main site
26+
'new-signup': `${MAIN_SITE_PREFIX}/new-signup?dev=true`,
27+
discord: `${MAIN_SITE_PREFIX}/discord?dev=true`,
28+
// TODO: add link for the '/tasks` pas as well but on status site
29+
// rishi should be doing this
30+
// ticket link:
2731
};

app/controllers/goto.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import { MAIN_SITE_PREFIX, REDIRECT_URLS } from '../constants/url';
55
import { REDIRECTION_TIME } from '../constants/redirection-time';
66
export default class GotoController extends Controller {
77
@service router;
8-
queryParams = ['from'];
8+
queryParams = ['from', 'token'];
99

1010
@action
1111
redirectToAppropriatePage() {
12-
const redirectUrl = REDIRECT_URLS[this.from];
12+
let redirectUrl = REDIRECT_URLS[this.from];
13+
if (this.token) {
14+
const separator = redirectUrl.includes('?') ? '&' : '?';
15+
redirectUrl = `${redirectUrl}${separator}token=${this.token}`;
16+
}
1317

1418
setTimeout(() => {
1519
window.location.href = redirectUrl ?? MAIN_SITE_PREFIX;

app/routes/discord.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ export default class DiscordRoute extends Route {
88
@service router;
99
@service toast;
1010

11+
beforeModel() {
12+
this.router.transitionTo('goto', {
13+
queryParams: {
14+
from: this.routeName,
15+
token: this.paramsFor('discord').token,
16+
},
17+
});
18+
}
1119
queryParams = {
1220
token: { refreshModel: true },
1321
};

app/routes/new-signup.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ export default class NewSignupRoute extends Route {
99
@service analytics;
1010
@service toast;
1111
@service featureFlag;
12+
@service router;
13+
14+
beforeModel() {
15+
this.router.transitionTo('goto', {
16+
queryParams: { from: this.routeName },
17+
});
18+
}
1219

1320
async model() {
1421
try {

tests/acceptance/discord-test.js

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)