Skip to content

Conversation

@S78901
Copy link
Contributor

@S78901 S78901 commented Apr 29, 2024

No description provided.

@S78901 S78901 changed the title [2228] Initial Start [2228] Allow planning review period timeline Apr 29, 2024
@S78901 S78901 linked an issue Apr 29, 2024 that may be closed by this pull request
8 tasks
@S78901 S78901 marked this pull request as ready for review May 1, 2024 22:19
@S78901
Copy link
Contributor Author

S78901 commented May 3, 2024

Added console logs to illustrate the API receiving the date as a string and returning it as a serialized array that can't be utilized. @mjperry91 for your review:

Input:
launchDate: "2024-05-03T05:00:00.000Z"

API returns:
[
2024,
5,
3,
5,
0
]


return () => clearTimeout(timeout);
}
return () => {};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is line 20 really needed?

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 this is not needed, this was from the MUI example. Deleted.


return (
<div className="datePickerField">
<LocalizationProvider dateAdapter={AdapterDayjs}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like Prettier didn't run on this file because this element isn't indented inside the div.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

if (data) {
dispatch({ type: ADD_REVIEW_PERIOD, payload: data });
} else {
console.log(res?.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I imagine we need better error handling here like display a message in a dialog.
I'm not familiar with how other similar errors are handled in Check-ins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a toast for the error to update the user on what went wrong.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! If you also want to keep the console output, I would change it to use console.error instead of console.log. That will make it appear in red.

if (data) {
dispatch({ type: UPDATE_REVIEW_PERIODS, payload: [...periods] });
} else {
console.log(res?.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

I imagine we need better error handling here like display a message in a dialog.
I'm not familiar with how other similar errors are handled in Check-ins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adjusted with toast

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! If you also want to keep the console output, I would change it to use console.error instead of console.log. That will make it appear in red.

launchDate: isoDate
};

setPeriodToAdd(newPeriod);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you move line 424 into the updateReviewPeriodDates function then you can delete lines 424, 434, and 444.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

/>
<div className="datePickerFlexWrapper">
<DatePickerField
date={dayjs(launchDate)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

What happens if you change this line to date={launchDate} ?
Maybe you don't need the dayjs function.
Same on lines 575 and 590.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was ok to remove as long as we use null for empty values.

Copy link
Collaborator

@jackkeller jackkeller left a comment

Choose a reason for hiding this comment

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

🎉 Approved

if (data) {
dispatch({ type: UPDATE_REVIEW_PERIODS, payload: [...periods] });
} else {
console.log(res?.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! If you also want to keep the console output, I would change it to use console.error instead of console.log. That will make it appear in red.

templates?.sort((t1, t2) => t1.title.localeCompare(t2.title));
setTemplates(templates);
} else {
console.log(res?.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! If you also want to keep the console output, I would change it to use console.error instead of console.log. That will make it appear in red.

dispatch({ type: UPDATE_REVIEW_PERIODS, payload: data });
setLoading(false);
} else {
console.log(res?.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! If you also want to keep the console output, I would change it to use console.error instead of console.log. That will make it appear in red.

if (data) {
reviews[period.id] = data[0];
} else {
console.log(res?.error);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! If you also want to keep the console output, I would change it to use console.error instead of console.log. That will make it appear in red.

@S78901 S78901 merged commit 34200cf into develop May 7, 2024
@S78901 S78901 deleted the feature-2228/planning-review-timeline-calendar branch May 7, 2024 20:24
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.

Allow planning review period timeline

5 participants