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: wrong locale in attendee email ics #8945

Merged
merged 7 commits into from May 22, 2023
Merged

Conversation

G3root
Copy link
Contributor

@G3root G3root commented May 17, 2023

What does this PR do?

fixes the issue as mentioned in #8893

Type of change

  • Bug fix (non-breaking change which fixes an issue)

@G3root G3root requested a review from hariombalhara May 17, 2023 11:36
@G3root G3root requested a review from zomars as a code owner May 17, 2023 11:36
@G3root G3root requested a review from a team May 17, 2023 11:36
@vercel
Copy link

vercel bot commented May 17, 2023

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

Name Status Preview Comments Updated (UTC)
cal ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2023 5:56am
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2023 5:56am

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2023

📦 Next.js Bundle Analysis for @calcom/web

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

One Page Changed Size

The following page changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (350 KB)
/auth/setup 174.07 KB 324.97 KB 92.85% (🟢 -0.16%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@deploysentinel
Copy link

deploysentinel bot commented May 17, 2023

Current Playwright Test Results Summary

✅ 98 Passing - ⚠️ 3 Flaky

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

(Last updated on 05/22/2023 06:14:03am UTC)

Run Details

Running Workflow PR Update on Github Actions

Commit: 6c4203f

Started: 05/22/2023 06:02:22am UTC

⚠️ Flakes

📄   apps/web/playwright/event-types.e2e.ts • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Event Types tests user -- old-booker can add new event type
Retry 1Initial Attempt
0% (0) 0 / 244 runs
failed over last 7 days
1.23% (3) 3 / 244 runs
flaked over last 7 days

📄   apps/web/playwright/booking-seats.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
Booking with Seats -- new-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1Initial Attempt
0% (0) 0 / 248 runs
failed over last 7 days
84.27% (209) 209 / 248 runs
flaked over last 7 days
Booking with Seats -- old-booker Reschedule for booking with seats -- old-booker Should reschedule booking with seats and if everyone rescheduled it should be deleted
Retry 1Initial Attempt
0% (0) 0 / 248 runs
failed over last 7 days
19.35% (48) 48 / 248 runs
flaked over last 7 days

View Detailed Build Results


Copy link
Member

@CarinaWolli CarinaWolli left a comment

Choose a reason for hiding this comment

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

@G3root Can you fix the type error? Besides that, it looks good 👍

@G3root
Copy link
Contributor Author

G3root commented May 18, 2023

@CarinaWolli pushed some changes

@@ -91,7 +91,7 @@ ${this.t("request_reschedule_subtitle", {
})},
${this.getWhen()}
${this.t("need_to_reschedule_or_cancel")}
${getManageLink(this.calEvent)}
${getManageLink(this.calEvent, this.calEvent.organizer.language.translate)}
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be the language of the attendee here?

Also, I tried to test it, and the whole request to reschedule email for the attendee was in the organizer's language. But this doesn't need to be fixed in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

as per the current implementation i need to pass an instance of translate. should i keep this as it is and do a follow up PR

Copy link
Member

Choose a reason for hiding this comment

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

Let's use this.t as in the lines above. And then we still need a follow-up as this email is sent to the attendee but I think the organizer language is used

Copy link
Member

@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.

Left some comments

@@ -112,7 +112,7 @@ ${this.t(
)}
${this.t(subtitle)}

${getRichDescription(this.calEvent)}
${getRichDescription(this.calEvent, this.attendee.language.translate)}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
${getRichDescription(this.calEvent, this.attendee.language.translate)}
${getRichDescription(this.calEvent, this.t)}

@@ -91,7 +91,7 @@ ${this.t("request_reschedule_subtitle", {
})},
${this.getWhen()}
${this.t("need_to_reschedule_or_cancel")}
${getManageLink(this.calEvent)}
${getManageLink(this.calEvent, this.calEvent.organizer.language.translate)}
Copy link
Member

Choose a reason for hiding this comment

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

As per @CarinaWolli comment. Let's use the short notation here.

Suggested change
${getManageLink(this.calEvent, this.calEvent.organizer.language.translate)}
${getManageLink(this.calEvent, this.t)}

@G3root
Copy link
Contributor Author

G3root commented May 18, 2023

@zomars @CarinaWolli pushed some changes to address the requested changes

@@ -176,38 +177,40 @@ export const getRescheduleLink = (calEvent: CalendarEvent): string => {
return `${WEBAPP_URL}/reschedule/${seatUid ? seatUid : Uid}`;
};

export const getRichDescription = (calEvent: CalendarEvent /*, attendee?: Person*/) => {
export const getRichDescription = (calEvent: CalendarEvent, t_?: TFunction /*, attendee?: Person*/) => {
const t = t_ ?? calEvent.organizer.language.translate;
Copy link
Member

Choose a reason for hiding this comment

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

I would recommend making t_ required here so that from everywhere we are passing the language explicitly and it would avoid accidental use of organizer language for attendee if it's not passed.

Copy link
Member

@hariombalhara hariombalhara left a comment

Choose a reason for hiding this comment

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

Looks good. I have just one suggestion

@CarinaWolli CarinaWolli added this pull request to the merge queue May 22, 2023
Merged via the queue into main with commit 8871e1e May 22, 2023
21 checks passed
@CarinaWolli CarinaWolli deleted the fix-wrong-ics-locale branch May 22, 2023 06:35
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.

None yet

5 participants