-
Notifications
You must be signed in to change notification settings - Fork 150
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 optional "comment" field for emergency_shutoff #2604
Conversation
<Button | ||
disabled={actionExecuting} | ||
onClick={onClose} | ||
action={actions => actions && actions.focusVisible()}> |
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 behavior (fucusVisible()
) makes typing the comment impossible. Seems not a big problem remove it. Let me know if has any other approach.
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.
@gabrielBusta may have input on this, I'm afraid this is beyond me :/
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 am not worried about it, but there might be a reason the code is calling focusVisible
there. So I will take a closer look
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.
@jcristau this code was focusing / highlighting the cancel button on the dialogs (i.e. the signing-off pop-ups) This was probably done so pressing enter would cancel the action / close the pop-up.
I think this change is an improvement. Now we can tab through the buttons in the dialogs and press enter to "click" them (this is the way they should behave imo). Also the button wont take away the focus from other UI elements we might want to put in the body of these dialogs (e.g. @allan-silva's TextField)
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.
@gabrielBusta Thanks for take a close look on this!
Add comment field on spec; Insert comment on database Add comment information on balrog ui
@jcristau My last contribution was long time ago, let me know if I missed any step. |
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 looks good to me. Thank you very much!
Since @jcristau originally opened the issue, I'd like him to give final approval here; he is on vacation currently - hope you don't mind waiting a couple of weeks.
@gbrownmozilla no problem. |
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.
A couple of nits but this looks great. (Not approving just yet because I'd like to play with it locally, but I do want to get to it shortly.)
src/auslib/db.py
Outdated
@@ -2912,6 +2912,7 @@ def __init__(self, db, metadata, dialect): | |||
metadata, | |||
Column("product", String(15), nullable=False, primary_key=True), | |||
Column("channel", String(75), nullable=False, primary_key=True), | |||
Column("comment", String(500), nullable=True), |
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.
Let's omit nullable=True
, it's the default and we don't seem to have it anywhere else
<Button | ||
disabled={actionExecuting} | ||
onClick={onClose} | ||
action={actions => actions && actions.focusVisible()}> |
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.
@gabrielBusta may have input on this, I'm afraid this is beyond me :/
|
||
def test_get_notfound(self): | ||
resp = self._get("/emergency_shutoff/foo/bar") | ||
self.assertStatusCode(resp, 404) | ||
|
||
def test_create(self): | ||
data = {"product": "Thunderbird", "channel": "release"} | ||
data = {"product": "Thunderbird", "channel": "release", "comment": "Thunderbird panic!()"} |
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.
We should keep a test for POST to /emergency_shutoff without a comment, to make sure that still works.
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 good to me. Deferring to @jcristau for final approval here. Thank you!
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 great. Thanks again @allan-silva!
Changes on balrogui:
Resolves #1862