violet_rails icon indicating copy to clipboard operation
violet_rails copied to clipboard

Fix urls for root domains

Open Pralish opened this issue 2 years ago โ€ข 13 comments
trafficstars

We are familiar with the fact that we need to pass host and/or subdomain parameters in url helper for it to work properly, especially for asset urls.

And we were passing either Subdomain.current.hostname or Apartment::Tenant.current as the subdomain, which is not consistent. Subdomain.current.hostname returns nil for root domain, which is fine, but Apartment::Tenant.current returns 'public' which causes all the asset urls to be prefixed with 'public'

rails_blob_url(attachment, subdomain: Apartment::Tenant.current, subdomain: Apartment::Tenant.current)

Issue: https://github.com/restarone/violet_rails/issues/1537

With this PR, we will no longer have to pass host and subdomain value to url helper. They are set by default based on the request host.

rails_blob_url(attachment)

You can pass the host and subdomain parameters if you want to override the default value

Pralish avatar Mar 28 '23 16:03 Pralish

test plan ๐Ÿงช

  1. API Renderer - car app, car video app โœ…
  2. sign in โŒ
  3. Password reset flow โŒ
  4. account creation flow โŒ›
  5. user invite flow โŒ›
  6. forum file uploads โŒ›
  7. CMS file uploads โŒ›
  8. Forum post URL's โŒ›
  9. temporary deployment to nikean.org โŒ›
  10. downloading API Resources from an API Namespace (with non primitive properties) โŒ›
  11. export Namespace in JSON format with associations (with non primitive properties) โŒ›

donrestarone avatar Mar 28 '23 16:03 donrestarone

@Pralish I see the API surface for URL's and asset linking as changed, could you write some documentation to include as part of the release for server engineers to use as reference?

donrestarone avatar Mar 28 '23 16:03 donrestarone

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Mar 28 '23 18:03 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 18 '23 07:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 18 '23 08:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 18 '23 11:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 18 '23 12:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 18 '23 13:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 24 '23 13:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 27 '23 20:04 github-actions[bot]

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar Apr 29 '23 02:04 github-actions[bot]

@Pralish could you please take a look at the review app? There are some major breakages that prevent UAT:

Admin redirect broken:

https://user-images.githubusercontent.com/35935196/235655799-86f198f7-565b-4f3e-9a66-3350c6a7c411.mov

password reset email link is broken

Screen Shot 2023-05-02 at 7 35 21 AM

donrestarone avatar May 02 '23 11:05 donrestarone

Deployed review-app can be viewed at https://review-1507.violet-test.net

github-actions[bot] avatar May 02 '23 11:05 github-actions[bot]