-
Notifications
You must be signed in to change notification settings - Fork 363
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
Improve the assign input on Alerts View. #8002
Improve the assign input on Alerts View. #8002
Conversation
7d332f7
to
abc058f
Compare
abc058f
to
9f8548f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8002 +/- ##
=======================================
Coverage 77.07% 77.07%
=======================================
Files 545 545
Lines 26962 26967 +5
Branches 3383 3389 +6
=======================================
+ Hits 20782 20786 +4
- Misses 6013 6014 +1
Partials 167 167 ☔ View full report in Codecov by Sentry. |
if (event.key === 'Enter') { | ||
event.preventDefault(); |
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.
Could you quickly explain why did you move it?
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 moved this line (event.preventDefault();) inside the if statement because it was also preventing the onchange event on the input field, and that's why the input field was not editable. However, we still need that line because inside the if statement, 'const { failureStatus } = await updateAssignee(newAssigneeUsername);' is called. This line at the end of the function will try to redirect you to '/alerts' regardless of whether the assignment was successful or not.
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.
Thanks for the explanation
@@ -33,7 +33,9 @@ export default class Assignee extends React.Component { | |||
inEditMode: true, | |||
// input prefills with this field, so | |||
// we must have it prepared | |||
newAssigneeUsername: assigneeUsername, | |||
newAssigneeUsername: assigneeUsername | |||
? assigneeUsername.split('/')[1] |
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 don't think you need to do that because on line 70 you already set the username correctly when using the "Take" functionality. For the case where the user fills in the information themselves this is not needed because they are required to only fill in the email. Let me know what you think.
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 line is necessary when we want to reassign an alert. If that line doesn't exist, when enter in edit mode on an already assigned alert, we will see 'mozilla-ldap/[email protected]' instead of '[email protected]'
No description provided.