-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Skip contact owner even if it matches attribute routing #17015
Merged
zomars
merged 22 commits into
main
from
skip-contact-owner-even-if-it-matches-attribute-routing
Oct 9, 2024
+606
−157
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
e5e8a12
Initial commit
hariombalhara 03c0650
routingForm to Booking a particular team member working
hariombalhara 7c8b452
Happy path working
hariombalhara fb3b263
Fixes
hariombalhara 8a367da
Merge remote-tracking branch 'origin/main' into routing-forms-team-ev…
hariombalhara 4bfb2b7
Fix router query params forwarding
hariombalhara 73c9945
Merge remote-tracking branch 'origin/main' into routing-forms-team-ev…
hariombalhara 0c15120
Add basicConfig within app
hariombalhara 9aed6f2
Tests
hariombalhara 6b473e7
More tests
hariombalhara bffc946
Update packages/app-store/routing-forms/components/SingleForm.tsx
hariombalhara 6c2b77d
Merge remote-tracking branch 'origin/main' into routing-forms-team-ev…
hariombalhara 6559bc3
Merge remote-tracking branch 'origin/routing-forms-team-event-members…
hariombalhara dcbfabc
WIP
hariombalhara 6fd9751
Merge remote-tracking branch 'origin/main' into skip-contact-owner-ev…
hariombalhara f06be8c
Merge remote-tracking branch 'origin/main' into skip-contact-owner-ev…
hariombalhara 489e1b2
Fix lint issues
hariombalhara be53242
Fix tests -TS and add new logic
hariombalhara 5135fdd
Add getEventTypeRedirectUrl tests
hariombalhara b7f73c9
Remove booking title changes code
hariombalhara 36e21fb
More changes
hariombalhara c216dda
Add tests for getRoutedUsers
hariombalhara File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
packages/app-store/routing-forms/__tests__/getEventTypeRedirectUrl.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { describe, it, expect } from "vitest"; | ||
|
||
import { CAL_URL } from "@calcom/lib/constants"; | ||
|
||
import { getAbsoluteEventTypeRedirectUrl } from "../getEventTypeRedirectUrl"; | ||
|
||
describe("getAbsoluteEventTypeRedirectUrl", () => { | ||
const defaultForm = { | ||
team: null, | ||
nonOrgUsername: null, | ||
nonOrgTeamslug: null, | ||
userOrigin: "https://user.cal.com", | ||
teamOrigin: "https://team.cal.com", | ||
}; | ||
|
||
const defaultParams = { | ||
eventTypeRedirectUrl: "user/event", | ||
form: defaultForm, | ||
allURLSearchParams: new URLSearchParams(), | ||
isEmbed: false, | ||
}; | ||
|
||
it("should return CAL_URL for non-migrated user", () => { | ||
const result = getAbsoluteEventTypeRedirectUrl({ | ||
...defaultParams, | ||
eventTypeRedirectUrl: "user/event", | ||
form: { ...defaultForm, nonOrgUsername: "user" }, | ||
}); | ||
expect(result).toBe(`${CAL_URL}/user/event?`); | ||
}); | ||
|
||
it("should return user origin for migrated user", () => { | ||
const result = getAbsoluteEventTypeRedirectUrl(defaultParams); | ||
expect(result).toBe("https://user.cal.com/user/event?"); | ||
}); | ||
|
||
it("should return CAL_URL for non-migrated team", () => { | ||
const result = getAbsoluteEventTypeRedirectUrl({ | ||
...defaultParams, | ||
eventTypeRedirectUrl: "team/team1/event", | ||
form: { ...defaultForm, nonOrgTeamslug: "team1" }, | ||
}); | ||
expect(result).toBe(`${CAL_URL}/team/team1/event?`); | ||
}); | ||
|
||
it("should return team origin for migrated team", () => { | ||
const result = getAbsoluteEventTypeRedirectUrl({ | ||
...defaultParams, | ||
eventTypeRedirectUrl: "team/team1/event", | ||
}); | ||
expect(result).toBe("https://team.cal.com/team/team1/event?"); | ||
}); | ||
|
||
it("should append URL search params", () => { | ||
const result = getAbsoluteEventTypeRedirectUrl({ | ||
...defaultParams, | ||
allURLSearchParams: new URLSearchParams("foo=bar&baz=qux"), | ||
}); | ||
expect(result).toBe("https://user.cal.com/user/event?foo=bar&baz=qux"); | ||
}); | ||
|
||
it("should append /embed for embedded views", () => { | ||
const result = getAbsoluteEventTypeRedirectUrl({ | ||
...defaultParams, | ||
allURLSearchParams: new URLSearchParams("foo=bar&baz=qux"), | ||
isEmbed: true, | ||
}); | ||
expect(result).toBe("https://user.cal.com/user/event/embed?foo=bar&baz=qux"); | ||
}); | ||
|
||
it("should throw an error if invalid team event redirect URL is provided", () => { | ||
expect(() => | ||
getAbsoluteEventTypeRedirectUrl({ | ||
...defaultParams, | ||
eventTypeRedirectUrl: "team/", | ||
}) | ||
).toThrow("eventTypeRedirectUrl must have username or teamSlug"); | ||
}); | ||
}); |
2 changes: 1 addition & 1 deletion
2
...-forms/test/lib/jsonLogicToPrisma.test.ts → ...forms/__tests__/jsonLogicToPrisma.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
import { FormFieldsBaseConfig, AttributesBaseConfig } from "../components/react-awesome-query-builder/config/config"; | ||
import { | ||
FormFieldsBaseConfig, | ||
AttributesBaseConfig, | ||
} from "../components/react-awesome-query-builder/config/config"; | ||
|
||
export const FormFieldsInitialConfig = FormFieldsBaseConfig; | ||
export const AttributesInitialConfig = AttributesBaseConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allows to be able to run the lint on routing-forms directly