Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/constants/redirection-time.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// TODO: we will decrease this time after testing bi-weekly
export const REDIRECTION_TIME = 3000; // in milliseconds
export const REDIRECTION_TIME = 1500; // in milliseconds
5 changes: 2 additions & 3 deletions app/constants/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const FETCH_AUTH_STATUS = `${ENV.BASE_API_URL}/auth/qr-code-auth/authoriz
export const FETCH_DEVICE_INFO = `${ENV.BASE_API_URL}/auth/device`;

export const MAIN_SITE_PREFIX = ENV.MAIN_SITE_URL;
export const STATUS_SITE_PREFIX = ENV.STATUS_SITE;
export const REDIRECT_URLS = {
// TODO: remove dev=true after it being removed from main site
// @Tejasgp: is taking care of this under a doc
Expand All @@ -25,7 +26,5 @@ export const REDIRECT_URLS = {
mobile: `${MAIN_SITE_PREFIX}/mobile?dev=true`,
'new-signup': `${MAIN_SITE_PREFIX}/new-signup?dev=true`,
discord: `${MAIN_SITE_PREFIX}/discord?dev=true`,
// TODO: add link for the '/tasks` pas as well but on status site
// rishi should be doing this
// ticket link:
tasks: `${STATUS_SITE_PREFIX}/tasks?dev=true`,
};
11 changes: 11 additions & 0 deletions app/routes/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ const API_BASE_URL = ENV.BASE_API_URL;

export default class TasksRoute extends Route {
@service toast;
@service router;

beforeModel() {
// This route is deprecated and redirects to the status site
// See ticket for context on the redirection strategy
// https://github.com/Real-Dev-Squad/website-www/issues/1031
return this.router.transitionTo('goto', {
queryParams: { from: this.routeName },
});
}

model = async () => {
try {
const response = await fetch(`${API_BASE_URL}/tasks/self`, {
Expand Down
20 changes: 20 additions & 0 deletions functions/_middleware.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export async function onRequest(context) {
const { env, next } = context;

const IS_DEPRECATED = env.DEPRECATED !== 'false';

if (IS_DEPRECATED) {
return new Response(
'This site has been deprecated. Please use main-site.',
{
status: 410,
headers: {
'Content-Type': 'text/plain; charset=utf-8',
'Cache-Control': 'no-store',
},
}
);
}

return await next();
}
2 changes: 1 addition & 1 deletion tests/integration/components/tasks-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module('Integration | Component | tasks', function (hooks) {
);
assert.equal(ctrl.taskFields.percentCompleted, 100);
});
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) {
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) {
tasks[0].status = 'SMOKE_TESTING';
this.set('dev', true);
const ctrl = this.owner.lookup('controller:tasks');
Expand Down