Skip to content

feat: Organizations no middleware rewrite#9548

Merged
zomars merged 24 commits intomainfrom
feat/organizations-no-middleware-rewrite
Jun 21, 2023
Merged

feat: Organizations no middleware rewrite#9548
zomars merged 24 commits intomainfrom
feat/organizations-no-middleware-rewrite

Conversation

@roae
Copy link
Copy Markdown
Contributor

@roae roae commented Jun 15, 2023

What does this PR do?

Use the rewrite beforeFiles config on next.config.js to rewrite the requests to an organization subdomain to the correct page.

https://www.loom.com/share/d4502f3b93754bb694b8655bda1eea0d

Type of change

  • New feature (non-breaking change which adds functionality)

Mandatory Tasks

  • Make sure you have self-reviewed the code. A decent size PR without self-review might be rejected.

How should this be tested?

In order to test this org routing approach, you must run the app using a local domain e.g. http://app.cal.local:3000

  • Login with the Pro user, then visit /settings/organizations/new to create the organization, owner user, teams and send invites to org members.
  • Complete the owner user onboarding.
  • Add the local subdomain for the organizations e.g. acme.cal.local.
  • Make sure the organization has teams.
  • Visit http://[your-org-slug].cal.local/ the org profile page should be displayed.
  • Visit a org team page http://[your-org-slug].cal.local/[your-team-slug] the team profile page should be displayed
  • Visit a org user profile page http://[your-org-slug].cal.local/[org-user-slug] the user profile page should be displayed.
  • Try visit a non-user profile page http://[your-org-slug].cal.local/pro you should get 404 error.
  • Try visit an org user profile page using the default app domainhttp://app.cal.local/[org-user-slug] you should get 404 error.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 15, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 9:07pm
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 9:07pm
web-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2023 9:07pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview Jun 21, 2023 9:07pm

@deploysentinel
Copy link
Copy Markdown

deploysentinel Bot commented Jun 15, 2023

Current Playwright Test Results Summary

✅ 114 Passing - ⚠️ 3 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 06/21/2023 09:11:36pm UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 9d3aaa2

Started: 06/21/2023 09:08:36pm UTC

⚠️ Flakes

📄   packages/embeds/embed-core/playwright/tests/action-based.e2e.ts • 2 Flakes

Top 1 Common Error Messages

null

2 Test Cases Affected

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Popup Tests should be able to reschedule
Retry 1Initial Attempt
19.44% (42) 42 / 216 runs
failed over last 7 days
77.31% (167) 167 / 216 runs
flaked over last 7 days
Popup Tests should open Routing Forms embed on click
Retry 1Initial Attempt
16.74% (36) 36 / 215 runs
failed over last 7 days
1.86% (4) 4 / 215 runs
flaked over last 7 days

📄   packages/embeds/embed-core/playwright/tests/inline.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Inline Iframe - Configured with Dark Theme
Retry 1Initial Attempt
18.52% (40) 40 / 216 runs
failed over last 7 days
1.85% (4) 4 / 216 runs
flaked over last 7 days

View Detailed Build Results


@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 15, 2023

📦 Next.js Bundle Analysis for @calcom/web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

New Pages Added

The following pages were added to the bundle from the code in this PR:

Page Size (compressed) First Load % of Budget (350 KB)
/org/[orgSlug] 224.76 KB 377.77 KB 107.93%
/org/[orgSlug]/[user] 244.01 KB 397.02 KB 113.43%
/org/[orgSlug]/[user]/[type] 183.74 KB 336.74 KB 96.21%
/org/[orgSlug]/team/[slug] 224.77 KB 377.77 KB 107.94%
/org/[orgSlug]/team/[slug]/[type] 183.33 KB 336.33 KB 96.09%

@hariombalhara
Copy link
Copy Markdown
Member

hariombalhara commented Jun 15, 2023

Mentioning here for awareness, /:path* matcher is also being used now to enable new booker. It's a temp change.

So, when it works, let's not remove that /:path* right now.

@zomars
Copy link
Copy Markdown
Contributor

zomars commented Jun 20, 2023

There's something breaking e2e-embed tests. We need to investigate.

Seems like the embed file is returning a 404

image

@hariombalhara any pointers on how to debug this?

@hariombalhara hariombalhara changed the title feat: Organizations no middleware rewrite feat: Organizations no middleware rewrite Jun 21, 2023
@hariombalhara
Copy link
Copy Markdown
Member

They are passing now @zomars. But I am debugging this behaviour now which sometimes happen.

Copy link
Copy Markdown
Contributor

@ericrommel ericrommel left a comment

Choose a reason for hiding this comment

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

@roae, thanks for guiding me to put my local to work. I have done some more test as I said and everything looks fine.

ericrommel
ericrommel previously approved these changes Jun 21, 2023
Copy link
Copy Markdown
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

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

Fixed conflicts. LGTM!

@zomars zomars enabled auto-merge (squash) June 21, 2023 20:59
@zomars zomars merged commit 71eafa2 into main Jun 21, 2023
@zomars zomars deleted the feat/organizations-no-middleware-rewrite branch June 21, 2023 21:12
leog added a commit that referenced this pull request Jun 23, 2023
…AL-1993] [CAL-1994] (#9693)

* Fixing signup from org invitation and other tweaks

* feat:  Organizations no middleware rewrite (#9548)

Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>

* Revert "fix: redirect to 404 page for invalid email verification token" (#9703)

* New Crowdin translations by Github Action

* refactor: Skip license checks for development (#9375)

* Allow closing the embed on clicking the black transparent area (#9706)

* New Crowdin translations by Github Action

* perf: [CAL-1928] Deduplicate eventTypes.getByViewer query (#9700)

Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>

* perf: Remove useless data on EvenTypes getByViewer endpoint (#9704)

* feat: [CAL-910] Pre-select country for phone number (CALCOM-5759) (#9526)

Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>

* Fix settings layout + org headings (#9712)

* Simplifying prop

* Removing restriction to choose username

* Formatting

---------

Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Afzal Sayed <14029371+afzalsayed96@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
kodiakhq Bot pushed a commit that referenced this pull request Jul 3, 2023
* Creating team and preview URL fixes

* Renamed function in tests too

* fix: Signup from org wizard invitation and other tweaks [CAL-1973] [CAL-1993] [CAL-1994] (#9693)

* Fixing signup from org invitation and other tweaks

* feat:  Organizations no middleware rewrite (#9548)

Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>

* Revert "fix: redirect to 404 page for invalid email verification token" (#9703)

* New Crowdin translations by Github Action

* refactor: Skip license checks for development (#9375)

* Allow closing the embed on clicking the black transparent area (#9706)

* New Crowdin translations by Github Action

* perf: [CAL-1928] Deduplicate eventTypes.getByViewer query (#9700)

Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>

* perf: Remove useless data on EvenTypes getByViewer endpoint (#9704)

* feat: [CAL-910] Pre-select country for phone number (CALCOM-5759) (#9526)

Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>

* Fix settings layout + org headings (#9712)

* Simplifying prop

* Removing restriction to choose username

* Formatting

---------

Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Afzal Sayed <14029371+afzalsayed96@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>

* Fix conditional before hook

* Fix lints

---------

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Afzal Sayed <14029371+afzalsayed96@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
fritterhoff pushed a commit to hm-edu/cal.com that referenced this pull request Jul 25, 2023
…m#9648)

* Creating team and preview URL fixes

* Renamed function in tests too

* fix: Signup from org wizard invitation and other tweaks [CAL-1973] [CAL-1993] [CAL-1994] (calcom#9693)

* Fixing signup from org invitation and other tweaks

* feat:  Organizations no middleware rewrite (calcom#9548)

Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>

* Revert "fix: redirect to 404 page for invalid email verification token" (calcom#9703)

* New Crowdin translations by Github Action

* refactor: Skip license checks for development (calcom#9375)

* Allow closing the embed on clicking the black transparent area (calcom#9706)

* New Crowdin translations by Github Action

* perf: [CAL-1928] Deduplicate eventTypes.getByViewer query (calcom#9700)

Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>

* perf: Remove useless data on EvenTypes getByViewer endpoint (calcom#9704)

* feat: [CAL-910] Pre-select country for phone number (CALCOM-5759) (calcom#9526)

Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>

* Fix settings layout + org headings (calcom#9712)

* Simplifying prop

* Removing restriction to choose username

* Formatting

---------

Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Afzal Sayed <14029371+afzalsayed96@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>

* Fix conditional before hook

* Fix lints

---------

Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Efraín Rochín <roae.85@gmail.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
Co-authored-by: alannnc <alannnc@gmail.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
Co-authored-by: Afzal Sayed <14029371+afzalsayed96@users.noreply.github.com>
Co-authored-by: GitStart-Cal.com <121884634+gitstart-calcom@users.noreply.github.com>
Co-authored-by: gitstart-calcom <gitstart@users.noreply.github.com>
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High priority Created by Linear-GitHub Sync

Projects

No open projects
Status: No status

Development

Successfully merging this pull request may close these issues.

6 participants