-
Notifications
You must be signed in to change notification settings - Fork 6
[2228] Allow planning review period timeline #2277
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
[2228] Allow planning review period timeline #2277
Conversation
|
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: API returns: |
…ing-review-timeline-calendar
…ing-review-timeline-calendar
|
|
||
| return () => clearTimeout(timeout); | ||
| } | ||
| return () => {}; |
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 line 20 really needed?
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 think this is not needed, this was from the MUI example. Deleted.
|
|
||
| return ( | ||
| <div className="datePickerField"> | ||
| <LocalizationProvider dateAdapter={AdapterDayjs}> |
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 like Prettier didn't run on this file because this element isn't indented inside the div.
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.
Done
| if (data) { | ||
| dispatch({ type: ADD_REVIEW_PERIOD, payload: data }); | ||
| } else { | ||
| console.log(res?.error); |
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 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.
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.
Added a toast for the error to update the user on what went wrong.
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! 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); |
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 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.
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.
Adjusted with toast
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! 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); |
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.
If you move line 424 into the updateReviewPeriodDates function then you can delete lines 424, 434, and 444.
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.
Good idea.
| /> | ||
| <div className="datePickerFlexWrapper"> | ||
| <DatePickerField | ||
| date={dayjs(launchDate)} |
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.
What happens if you change this line to date={launchDate} ?
Maybe you don't need the dayjs function.
Same on lines 575 and 590.
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.
This was ok to remove as long as we use null for empty values.
…s://github.com/objectcomputing/check-ins into feature-2228/planning-review-timeline-calendar
…ing-review-timeline-calendar
jackkeller
left a comment
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.
🎉 Approved
| if (data) { | ||
| dispatch({ type: UPDATE_REVIEW_PERIODS, payload: [...periods] }); | ||
| } else { | ||
| console.log(res?.error); |
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! 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); |
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! 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); |
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! 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); |
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! 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.
No description provided.