From ef3b2cb341b759f7bd5fff8d05bf3e437f88c931 Mon Sep 17 00:00:00 2001 From: TEJAS Date: Mon, 9 Jun 2025 00:22:55 +0530 Subject: [PATCH 1/3] feat: decrease redirection time (#636) --- app/constants/redirection-time.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/constants/redirection-time.js b/app/constants/redirection-time.js index 0aac7712..40ed1137 100644 --- a/app/constants/redirection-time.js +++ b/app/constants/redirection-time.js @@ -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 From 5f0fd49d79cb36590d847050f2f0cea8918ff22a Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Mon, 1 Sep 2025 23:05:59 +0530 Subject: [PATCH 2/3] fix: redirect `/tasks` to status site (#637) * fix: redirect /tasks to status site * fix: add return for transition --- app/constants/url.js | 5 ++--- app/routes/tasks.js | 11 +++++++++++ tests/integration/components/tasks-test.js | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/constants/url.js b/app/constants/url.js index 8c091ed1..598e4c46 100644 --- a/app/constants/url.js +++ b/app/constants/url.js @@ -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 @@ -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`, }; diff --git a/app/routes/tasks.js b/app/routes/tasks.js index 0d21a018..3f7ecab3 100644 --- a/app/routes/tasks.js +++ b/app/routes/tasks.js @@ -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`, { diff --git a/tests/integration/components/tasks-test.js b/tests/integration/components/tasks-test.js index b7764e6d..25ca7603 100644 --- a/tests/integration/components/tasks-test.js +++ b/tests/integration/components/tasks-test.js @@ -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'); From 97ea93e15fac7c564e8e0c16de8f79938fad69d8 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Thu, 15 Jan 2026 23:55:23 +0530 Subject: [PATCH 3/3] fix: add CF function for edge level deprecation (#641) * chore: add function for deprecation * fix: adddd await before calling next --- functions/_middleware.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 functions/_middleware.js diff --git a/functions/_middleware.js b/functions/_middleware.js new file mode 100644 index 00000000..e5a2d4a9 --- /dev/null +++ b/functions/_middleware.js @@ -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(); +}