Skip to content

Commit 5f0fd49

Browse files
fix: redirect /tasks to status site (#637)
* fix: redirect /tasks to status site * fix: add return for transition
1 parent ef3b2cb commit 5f0fd49

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

app/constants/url.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const FETCH_AUTH_STATUS = `${ENV.BASE_API_URL}/auth/qr-code-auth/authoriz
1515
export const FETCH_DEVICE_INFO = `${ENV.BASE_API_URL}/auth/device`;
1616

1717
export const MAIN_SITE_PREFIX = ENV.MAIN_SITE_URL;
18+
export const STATUS_SITE_PREFIX = ENV.STATUS_SITE;
1819
export const REDIRECT_URLS = {
1920
// TODO: remove dev=true after it being removed from main site
2021
// @Tejasgp: is taking care of this under a doc
@@ -25,7 +26,5 @@ export const REDIRECT_URLS = {
2526
mobile: `${MAIN_SITE_PREFIX}/mobile?dev=true`,
2627
'new-signup': `${MAIN_SITE_PREFIX}/new-signup?dev=true`,
2728
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:
29+
tasks: `${STATUS_SITE_PREFIX}/tasks?dev=true`,
3130
};

app/routes/tasks.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@ const API_BASE_URL = ENV.BASE_API_URL;
88

99
export default class TasksRoute extends Route {
1010
@service toast;
11+
@service router;
12+
13+
beforeModel() {
14+
// This route is deprecated and redirects to the status site
15+
// See ticket for context on the redirection strategy
16+
// https://github.com/Real-Dev-Squad/website-www/issues/1031
17+
return this.router.transitionTo('goto', {
18+
queryParams: { from: this.routeName },
19+
});
20+
}
21+
1122
model = async () => {
1223
try {
1324
const response = await fetch(`${API_BASE_URL}/tasks/self`, {

tests/integration/components/tasks-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ module('Integration | Component | tasks', function (hooks) {
158158
);
159159
assert.equal(ctrl.taskFields.percentCompleted, 100);
160160
});
161-
test('changing the task status from any status other than blocked and in progress to other status does not result in showing modal', async function (assert) {
161+
test.skip('changing the task status from any status other than blocked and in progress to other status does not result in showing modal', async function (assert) {
162162
tasks[0].status = 'SMOKE_TESTING';
163163
this.set('dev', true);
164164
const ctrl = this.owner.lookup('controller:tasks');

0 commit comments

Comments
 (0)