From d2807750db9a3f9d5960df091c3b480f90bb9fb6 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Mon, 12 Jan 2026 18:07:37 +0530 Subject: [PATCH 1/3] fix: replace my site urls and use env based redirection (#1381) --- .../ExtensionStatusModal.test.tsx | 7 +++++ .../Unit/Components/Navbar/Navbar.test.tsx | 2 +- __tests__/Unit/Components/Tasks/Card.test.tsx | 3 +++ src/components/Dropdown/Dropdown.tsx | 16 +++++------ src/constants/url.ts | 27 +++++++++++-------- 5 files changed, 35 insertions(+), 20 deletions(-) diff --git a/__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx b/__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx index 4996dabf2..f63bf9fcc 100644 --- a/__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx +++ b/__tests__/Unit/Components/ExtensionRequest/ExtensionStatusModal.test.tsx @@ -121,8 +121,15 @@ describe('ExtensionStatusModal Component', () => { test('should test formatToRelativeTime function', () => { const timestamp = 1640995200; + const fixedNow = new Date('2025-01-01T00:00:00Z'); + + jest.useFakeTimers(); + jest.setSystemTime(fixedNow); + const result = formatToRelativeTime(timestamp); expect(result).toBe('3 years ago'); + + jest.useRealTimers(); }); test('should open extension request form when request extension button is clicked', () => { diff --git a/__tests__/Unit/Components/Navbar/Navbar.test.tsx b/__tests__/Unit/Components/Navbar/Navbar.test.tsx index 237f63b86..2ea4377ff 100644 --- a/__tests__/Unit/Components/Navbar/Navbar.test.tsx +++ b/__tests__/Unit/Components/Navbar/Navbar.test.tsx @@ -89,7 +89,7 @@ describe('Navbar', () => { ); expect(eventLink).toHaveAttribute( 'href', - 'https://www.realdevsquad.com/events.html' + 'https://www.realdevsquad.com/events' ); expect(memberLink).toHaveAttribute( 'href', diff --git a/__tests__/Unit/Components/Tasks/Card.test.tsx b/__tests__/Unit/Components/Tasks/Card.test.tsx index 025f1cbfa..00d924f67 100644 --- a/__tests__/Unit/Components/Tasks/Card.test.tsx +++ b/__tests__/Unit/Components/Tasks/Card.test.tsx @@ -537,6 +537,8 @@ describe('Task card', () => { }); it('renders "Started" with a specific date if status is not AVAILABLE', () => { + jest.useFakeTimers(); + jest.setSystemTime(new Date('2025-01-01T00:00:00Z')); const { getByTestId } = renderWithRouter( { ); const spanElement = screen.getByTestId('started-on'); expect(spanElement).toHaveTextContent('Started 4 years ago'); // Mocked date from moment + jest.useRealTimers(); }); it('Should show the status of the task', () => { renderWithRouter( diff --git a/src/components/Dropdown/Dropdown.tsx b/src/components/Dropdown/Dropdown.tsx index 68d84700a..4a6019b02 100644 --- a/src/components/Dropdown/Dropdown.tsx +++ b/src/components/Dropdown/Dropdown.tsx @@ -1,5 +1,5 @@ import Link from 'next/link'; -import { LOGOUT_URL, MAIN_SITE_URL, MY_SITE_URL } from '../../constants/url'; +import { LOGOUT_URL, MAIN_SITE_URL } from '../../constants/url'; import styles from '@/components/Dropdown/dropdown.module.scss'; export const logout = () => { @@ -18,23 +18,23 @@ const Dropdown = () => {
  • Home
  • - -
  • Status
  • - -
  • Profile
  • +
  • Status
  • +
  • Profile
  • + +
  • Tasks
  • Identity
  • diff --git a/src/constants/url.ts b/src/constants/url.ts index 901cef8f3..a29a08853 100644 --- a/src/constants/url.ts +++ b/src/constants/url.ts @@ -1,21 +1,27 @@ export const BASE_URL = `${process.env.NEXT_PUBLIC_BASE_URL}`; export const SUBSCRIBE_TO_CHALLENGE_URL = `${BASE_URL}/challenges/subscribe`; export const MINE_TASKS_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/tasks/self`; -export const USER_PROFILE_URL = 'https://my.realdevsquad.com/profile'; -export const HOME_URL = 'https://realdevsquad.com'; -export const WELCOME_URL = 'https://welcome.realdevsquad.com'; -export const EVENTS_URL = 'https://www.realdevsquad.com/events.html'; -export const CRYPTO_URL = 'https://crypto.realdevsquad.com'; -export const STATUS_URL = 'https://status.realdevsquad.com'; + +const isStaging = process.env.NEXT_PUBLIC_BASE_URL?.includes( + 'staging-api.realdevsquad.com' +); +const envPrefix = isStaging ? 'staging-' : ''; + +export const USER_PROFILE_URL = `https://${envPrefix}my.realdevsquad.com/profile`; +export const HOME_URL = `https://${envPrefix}realdevsquad.com`; +export const WELCOME_URL = `https://${envPrefix}welcome.realdevsquad.com`; +export const EVENTS_URL = `https://${envPrefix}www.realdevsquad.com/events`; +export const CRYPTO_URL = `https://${envPrefix}crypto.realdevsquad.com`; +export const STATUS_URL = `https://${envPrefix}status.realdevsquad.com`; export const LOGIN_URL = `https://github.com/login/oauth/authorize?client_id=23c78f66ab7964e5ef97&state=${STATUS_URL}`; -export const MEMBERS_URL = 'https://members.realdevsquad.com'; +export const MEMBERS_URL = `https://${envPrefix}members.realdevsquad.com`; export const CHALLENGES_URL = `${BASE_URL}/challenges`; export const USER_SELF = `${BASE_URL}/users?profile=true`; export const USERS_IDLE = `${BASE_URL}/users/search?state=IDLE`; export const DEFAULT_AVATAR = '/Avatar.png'; export const RDS_LOGO = '/RDSLogo.png'; export const GITHUB_LOGO = '/github-white.png'; -export const SIGNUP_LINK = 'https://my.realdevsquad.com/signup'; +export const SIGNUP_LINK = `https://${envPrefix}www.realdevsquad.com/new-signup`; export const LOGOUT_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/auth/signout`; export const IDLE_USERS_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/users/status?state=IDLE`; export const ITEM_BY_FILTER_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/items/filter`; @@ -28,9 +34,8 @@ export const TASKS_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/tasks`; export const TASK_REQUEST_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/taskRequests`; export const ISSUES_URL = `${process.env.NEXT_PUBLIC_BASE_URL}/issues`; export const USERS_URL = `${BASE_URL}/users`; -export const MAIN_SITE_URL = 'https://www.realdevsquad.com'; -export const MY_SITE_URL = 'https://my.realdevsquad.com'; -export const DASHBOARD_URL = 'https://dashboard.realdevsquad.com'; +export const MAIN_SITE_URL = `https://${envPrefix}www.realdevsquad.com`; +export const DASHBOARD_URL = `https://${envPrefix}dashboard.realdevsquad.com`; export const USER_MANAGEMENT_URL = `${DASHBOARD_URL}/users/details/`; export const TASK_REQUESTS_DETAILS_URL = `${DASHBOARD_URL}/task-requests/details/`; export const TASK_EXTENSION_REQUEST_URL = `${DASHBOARD_URL}/extension-requests/`; From 64b0ed8d114b1e70d14461ac0467ba8fc5ff3d86 Mon Sep 17 00:00:00 2001 From: Mayank Bansal Date: Wed, 14 Jan 2026 20:58:44 +0530 Subject: [PATCH 2/3] chore: remove dev flag from tasks dropdown (#1383) * chore: remove dev flag from tasks dropdown * fix: status duplication for self assigned task * fix: show status for dev mode --- src/components/tasks/card/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/tasks/card/index.tsx b/src/components/tasks/card/index.tsx index e863222a3..8257ef130 100644 --- a/src/components/tasks/card/index.tsx +++ b/src/components/tasks/card/index.tsx @@ -575,7 +575,7 @@ const Card: FC = ({ : `Started ${getStartedAgo()}`} - {!isDevMode && ( + {!isSelfTask && (

    Status:

    = ({ {showAssignButton() && }

    - {(isEditable || (isDevMode && isSelfTask)) && ( + {(isEditable || isSelfTask) && (
    Date: Sat, 17 Jan 2026 23:44:54 +0530 Subject: [PATCH 3/3] chore: bump node version to 22.x (#1385) --- .github/workflows/continuous-integration.yml | 2 +- package.json | 6 +++--- yarn.lock | 14 +++++++++++++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 7952fa48a..1217b7ea4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -13,7 +13,7 @@ jobs: strategy: matrix: - node-version: [18.x] + node-version: [22.x] steps: - uses: actions/checkout@v3 diff --git a/package.json b/package.json index a355ea0f2..24ff5563c 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@testing-library/react-hooks": "^8.0.1", "@types/jest": "^29.2.5", "@types/next": "^9.0.0", - "@types/node": "^18.7.8", + "@types/node": "22.10.5", "@types/react": "^18.0.17", "@types/react-beautiful-dnd": "^13.1.2", "@types/react-dom": "^18.0.6", @@ -96,7 +96,7 @@ "whatwg-fetch": "^3.6.2" }, "engines": { - "node": "18.x" + "node": "22.x" }, "lint-staged": { "*.+(ts|tsx)": [ @@ -107,7 +107,7 @@ "workerDirectory": "public" }, "volta": { - "node": "18.14.2", + "node": "22.12.0", "yarn": "1.22.19" } } diff --git a/yarn.lock b/yarn.lock index 36b857f56..f6fe0fd07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3219,11 +3219,18 @@ "@types/node" "*" form-data "^3.0.0" -"@types/node@*", "@types/node@^18.7.8": +"@types/node@*": version "18.11.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== +"@types/node@22.10.5": + version "22.10.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.5.tgz#95af89a3fb74a2bb41ef9927f206e6472026e48b" + integrity sha512-F8Q+SeGimwOo86fiovQh8qiXfFEh2/ocYv7tU5pJ3EXMSSxk1Joj5wefpFK2fHTf/N6HKGSxIDBT9f3gCxXPkQ== + dependencies: + undici-types "~6.20.0" + "@types/node@^14.0.10 || ^16.0.0", "@types/node@^14.14.20 || ^16.0.0": version "16.18.11" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.11.tgz#cbb15c12ca7c16c85a72b6bdc4d4b01151bb3cae" @@ -13441,6 +13448,11 @@ underscore@~1.6.0: resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.6.0.tgz#8b38b10cacdef63337b8b24e4ff86d45aea529a8" integrity sha512-z4o1fvKUojIWh9XuaVLUDdf86RQiq13AC1dmHbTpoyuu+bquHms76v16CjycCbec87J7z0k//SiQVk0sMdFmpQ== +undici-types@~6.20.0: + version "6.20.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.20.0.tgz#8171bf22c1f588d1554d55bf204bc624af388433" + integrity sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg== + unfetch@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be"