Skip to content
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

fix: bookerEmbed atom #18168

Merged
merged 24 commits into from
Dec 17, 2024
Merged

fix: bookerEmbed atom #18168

merged 24 commits into from
Dec 17, 2024

Conversation

Ryukemeister
Copy link
Contributor

@Ryukemeister Ryukemeister commented Dec 13, 2024

What does this PR do?

  • Last few tweaks before embed is ready for website
Screenshot 2024-12-13 at 8 19 45 PM Screenshot 2024-12-13 at 8 20 04 PM

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • (N/A) I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • (N/A) I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

Can be tested in the examples app under packages/platform/examples/base

@keithwillcode keithwillcode added core area: core, team members only platform Anything related to our platform plan labels Dec 13, 2024
@Ryukemeister Ryukemeister marked this pull request as ready for review December 13, 2024 14:51
@graphite-app graphite-app bot requested a review from a team December 13, 2024 14:51
Copy link

vercel bot commented Dec 13, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
cal ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 11:49am
calcom-web-canary ⬜️ Ignored (Inspect) Visit Preview Dec 17, 2024 11:49am

@dosubot dosubot bot added bookings area: bookings, availability, timezones, double booking embed area: embed, widget, react embed labels Dec 13, 2024
Copy link

graphite-app bot commented Dec 13, 2024

Graphite Automations

"Add platform team as reviewer" took an action on this PR • (12/13/24)

1 reviewer was added to this PR based on Keith Williams's automation.

"Add ready-for-e2e label" took an action on this PR • (12/17/24)

1 label was added to this PR based on Keith Williams's automation.

@IsString()
@IsOptional()
@DocsProperty()
teamName?: string;
Copy link
Contributor

@supalarry supalarry Dec 16, 2024

Choose a reason for hiding this comment

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

The request is to fetch team event type, but we have added properties like weekStart, brandColor that makes it seem like they reside on the team event type level while in the reality all of the newly added output properties are part of a team, not team event type, and we should not mix them on the same level. We are coupling API with what atom needs too much.

So either:

  1. Add a new query parameter to the endpoint returning team event type which is a comma separated string expand to which we can pass which team event type properties we want to expand e.g. ?expand=team and then if it is passed instead return new team object in response (see campsite thread)
  2. Create atoms specific endpoint that returns event type just for the atom in format it needs with all the information it needs. This would also allow us to get ride of the transformApiEventTypeForAtom.ts function.
  3. Quickest (albeit suboptimal) solution - define property team on the output under which you store all newly added properties and always return them aka it is basically the same as now but creating a nested team in this output to not mix event type with team properties.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think for now the third option of defining a team in the output seems good so I'll just go with that.

@github-actions github-actions bot marked this pull request as draft December 16, 2024 06:27
@Ryukemeister Ryukemeister marked this pull request as ready for review December 17, 2024 09:22
@IsInt()
@IsOptional()
@DocsProperty()
id?: number | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Team id will be defined if the team is defined, so check prisma schema for the team and see which properties are defined and not.

@IsObject()
@IsOptional()
@DocsProperty()
team!: Team | null;
Copy link
Contributor

Choose a reason for hiding this comment

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

If you add docs property did you check the docs that the team object is actually appearing in docs? Because i think first need to add @ValidateNested decorator to actually validate the team, and then add @Type(() => Team). Also, there might already be a dto called Team so better rename it to EventTypeTeam.

Copy link
Contributor

Choose a reason for hiding this comment

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

After you do this and then rebuild platform types locally and run v2 and go to http://localhost:5555/docs and confirm team is seen in output its good to go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2024-12-17 at 3 28 21 PM

supalarry
supalarry previously approved these changes Dec 17, 2024
Copy link
Contributor

@supalarry supalarry left a comment

Choose a reason for hiding this comment

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

Well done!

Copy link
Contributor

github-actions bot commented Dec 17, 2024

E2E results are ready!

@Ryukemeister Ryukemeister enabled auto-merge (squash) December 17, 2024 11:44
@supalarry supalarry self-requested a review December 17, 2024 11:44
@Ryukemeister Ryukemeister merged commit c732c06 into main Dec 17, 2024
38 checks passed
@Ryukemeister Ryukemeister deleted the fix-booker-embed branch December 17, 2024 12:07
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Jan 10, 2025
* update translations

* add custom hook for platform embed

* update event type ouput DTO response

* fixup

* display terms and conditions for embed

* update v2 docs

* PR feedback

* update docs

* PR feedback

* update docs

* update output DTO

* update docs

* update output typing

* docs update

* resolve merge conflicts

* merge conflicts resolving

* resolve merge conflicts

* fixup

* update docs
MuhammadAimanSulaiman pushed a commit to hit-pay/cal.com that referenced this pull request Feb 20, 2025
* update translations

* add custom hook for platform embed

* update event type ouput DTO response

* fixup

* display terms and conditions for embed

* update v2 docs

* PR feedback

* update docs

* PR feedback

* update docs

* update output DTO

* update docs

* update output typing

* docs update

* resolve merge conflicts

* merge conflicts resolving

* resolve merge conflicts

* fixup

* update docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bookings area: bookings, availability, timezones, double booking core area: core, team members only embed area: embed, widget, react embed platform Anything related to our platform plan ready-for-e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants