Skip to content

Commit 31a6aa5

Browse files
authored
Merge pull request #638 from RealDevSquad/develop
Dev to Main Sync
2 parents 1eca32d + 97ea93e commit 31a6aa5

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

app/constants/redirection-time.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// TODO: we will decrease this time after testing bi-weekly
2-
export const REDIRECTION_TIME = 3000; // in milliseconds
2+
export const REDIRECTION_TIME = 1500; // in milliseconds

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`, {

functions/_middleware.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export async function onRequest(context) {
2+
const { env, next } = context;
3+
4+
const IS_DEPRECATED = env.DEPRECATED !== 'false';
5+
6+
if (IS_DEPRECATED) {
7+
return new Response(
8+
'This site has been deprecated. Please use main-site.',
9+
{
10+
status: 410,
11+
headers: {
12+
'Content-Type': 'text/plain; charset=utf-8',
13+
'Cache-Control': 'no-store',
14+
},
15+
}
16+
);
17+
}
18+
19+
return await next();
20+
}

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)