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: add translations for emails and type error fixes overall #994
Conversation
mihaic195
commented
Oct 19, 2021
•
edited
edited
- I still need to translate the dates displayed in emails (day and month), but it's already hard to follow the PR. We can do it in a follow-up PR.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/cal/calendso/4fA4zjNPmgGio5YGAPMaP5cEDyY8 |
…ndso/calendso into i18n/i18n-extract-strings-2
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.
Looks decent - just rename that function to something more readable
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.
Overall looks pretty good, got some concerns about a specific error handler so let's discuss.
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.
@@ -157,7 +159,7 @@ export default function ForgotPassword({ csrfToken }) { | |||
); | |||
} | |||
|
|||
ForgotPassword.getInitialProps = async (context) => { | |||
ForgotPassword.getInitialProps = async (context: GetServerSidePropsContext) => { |
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.
Isn't getInitialProps
deprecated?
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.
Indeed it should be changed!
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.
Nice work mate
constructor( | ||
calEvent: CalendarEvent, | ||
uid: string, | ||
videoCallData: VideoCallData, | ||
additionInformation: AdditionInformation = null | ||
) { | ||
super(calEvent, uid); | ||
this.videoCallData = videoCallData; | ||
this.additionInformation = additionInformation; | ||
} | ||
|
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.
Is this not needed anymore?
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.
Not anymore. Everything is on calEvent
😁
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.
Unsure how to test but it looks like an improvement overall!
@@ -38,14 +33,22 @@ export default class CalEventParser { | |||
* Returns a unique identifier for the given calendar event. | |||
*/ | |||
public getUid(): string { | |||
return this.maybeUid ?? translator.fromUUID(uuidv5(JSON.stringify(this.calEvent), uuidv5.URL)); | |||
return this.calEvent.uid ?? translator.fromUUID(uuidv5(JSON.stringify(this.calEvent), uuidv5.URL)); |
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.
Can the calEvent contain dates and stuff? Then this would (wrongly?) give a new unique id if the event is rescheduled
Not sure if it matters at all.
Can use lodash/pick
to pick the things you wan to make the uuid-hash based on
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.
I've moved most of the dangling stuff into the calEvent
. I've specifically tested this flow to make sure that the uid
is only there when rescheduling or updating a booking. Otherwise, it will be a new uid
.
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.
Was assuming the typescript errors needed fixing first, but without those; this is good to go