Skip to content

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented May 5, 2023

Related tickets:
https://topcoder.atlassian.net/browse/TCA-1281
https://topcoder.atlassian.net/browse/TCA-1226

Updates the Router implementation to support apps hosted from subdomains. To be more precise, the current apps can be served from:

platform-ui.topcoder.com/learn → academy.topcoder.com
platform-ui.topcoder.com/dev-center → devcenter.topcoder.com
platform-ui.topcoder.com/gamification-admin → gamification-admin.topcoder.com
platform-ui.topcoder.com/work → work.topcoder.com

For local development support and ease, if the subdomain doesn't match any known app subdomain, it will use the subdomain as a starting prefix for the path. Eg:

  • academy.topcoder-dev.com can be served locally from local.topcoder-dev.com/academy
  • devcenter.topcoder-dev.com can be served locally from local.topcoder-dev.com/devcenter
  • gamification-admin.topcoder-dev.com can be served locally from local.topcoder-dev.com/gamification-admin
  • work.topcoder-dev.com can be served locally from local.topcoder-dev.com/work

Note: to accommodate the part where we removed the base path for all routes, for the self service, I ditched the "/work" part from the urls. The urls were a bit messed, but I think this should make them more straight forward. eg:

  • platform-ui.topcoder-dev.com/work -> work.topcoder-dev.com
  • platform-ui.topcoder-dev.com/self-service/work/new/data-exploration/basic-info -> work.topcoder-dev.com/self-service/new/data-exploration/basic-info

@vas3a vas3a requested review from kkartunov, maxtopc and testflyjets May 5, 2023 09:44
WEBSITE_DESIGN_LEGACY: "/self-service/work/new/website-design-legacy/basic-info",
INTAKE_FORM: `${selfServiceRootRoute}/wizard`,
HOME_PAGE: `${selfServiceRootRoute}`,
DASHBOARD_PAGE: `/work/dashboard`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the work subdomain, should this be just /dashboard ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, thanks for catching that! I used rootRoute as a base, to keep support for local development (so when you're note on work.topcoder-dev.com, you can go to local.topcoder-dev.com/work/dashboard).

Copy link
Contributor

@testflyjets testflyjets left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work. I'm sure this was tedious but it makes the code cleaner and sets up some actually human-rememberable routes!

@vas3a
Copy link
Collaborator Author

vas3a commented May 8, 2023

Really great work. I'm sure this was tedious but it makes the code cleaner and sets up some actually human-rememberable routes!

Exactly! it doesn't matter the tedious work as long as the end result is worth it 👍

@vas3a vas3a merged commit 29195fb into dev May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants