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

Add comment to course reset #379

Merged
merged 2 commits into from
Mar 29, 2024
Merged

Conversation

hajorg
Copy link
Contributor

@hajorg hajorg commented Mar 27, 2024

Summary

This PR allows for comment to be added when resetting a learner's course
See: https://2u-internal.atlassian.net/browse/AU-1935

Screenshot 2024-03-27 at 14 27 03 Screenshot 2024-03-27 at 14 28 41

Copy link

codecov bot commented Mar 27, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 88.35%. Comparing base (c7b0faf) to head (75ac4c2).
Report is 2 commits behind head on master.

Files Patch % Lines
src/users/CourseReset.jsx 93.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #379      +/-   ##
==========================================
+ Coverage   88.34%   88.35%   +0.01%     
==========================================
  Files         164      164              
  Lines        3448     3462      +14     
  Branches      850      856       +6     
==========================================
+ Hits         3046     3059      +13     
- Misses        398      399       +1     
  Partials        4        4              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

@jansenk jansenk left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@AfaqShuaib09 AfaqShuaib09 left a comment

Choose a reason for hiding this comment

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

Just a couple of suggestions otherwise looks good to me 👍🏻

@@ -17,8 +17,20 @@ function CourseReset({ username, intl }) {
const [courseResetData, setCourseResetData] = useState([]);
const [error, setError] = useState('');
const [isOpen, open, close] = useToggle(false);
const [comment, setComment] = useState();

Choose a reason for hiding this comment

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

Suggested change
const [comment, setComment] = useState();
const [comment, setComment] = useState('');

const handleCommentChange = (e) => {
const text = e.target.value;
setComment(text);
if (text.length > 255) {
Copy link

@AfaqShuaib09 AfaqShuaib09 Mar 29, 2024

Choose a reason for hiding this comment

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

would be nice if we store this 255 in a variable

MAX_COMMENT_LENGTH = 255

so we can use this in comment message error too

@hajorg hajorg merged commit da37a62 into master Mar 29, 2024
7 checks passed
@hajorg hajorg deleted the hajorg/au-1933-course-reset-comment branch March 29, 2024 14:51
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.

3 participants