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 error when clicking upload image without selecting a file #5265

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

ZitaNemeckova
Copy link
Contributor

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1650104

Go to Automation -> Automate -> Generic Objects -> Configuration -> Add a new Generic Object Class -> DO NOT chose a file for Custom Image -> click chosen image

Before:
Nothing happens
image

After:
There's error message and the input is read with a hint what's wrong (based on #5139 (comment))
image

@miq-bot add_label bug, hammer/yes, generic objects, automation/automate

@miq-bot
Copy link
Member

miq-bot commented Feb 22, 2019

Checked commit ZitaNemeckova@19a9641 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🏆

@mzazrivec
Copy link
Contributor

The changes look good.

The only think that I wonder about is whether the flash message at the top is really needed here. It says No file chosen just like the message inside the empty input box (i.e. it may seem a bit redundant). It's probably not a big deal, but I'd like to know @terezanovotna's opinion on this.

Thanks.

@himdel
Copy link
Contributor

himdel commented Feb 26, 2019

Wouldn't it be better to just disable the "Upload chosen file" button if no files are selected?

@ZitaNemeckova
Copy link
Contributor Author

@terezanovotna please have a look and tell me if this is UX-wise ok. I'm not sure if the Upload button should be clickable if no file is selected or just to show the error if user clicks it without selecting a file. Thanks :)

@terezanovotna
Copy link

@mzazrivec It's awesome we have an error notification as well as the red area in the form. We want to notify the user and then point out the area that needs to be corrected.

@himdel Yes, the button should be disabled when nothing is chosen.

Follow up question: Why do we have "upload chosen file" button?
Can we chose file and upload file in one action?

Let's say I choose my image file, it's pretty obvious I want to upload it right away.
Can we combine these actions together on one click?
@ZitaNemeckova would it make sense? it's possible I am missing some information but, but so far combining these two actions makes sense to me

@terezanovotna
Copy link

@miq-bot remove_label ux/review
@miq-bot add_label ux/approved

@mzazrivec
Copy link
Contributor

If we want to disable the Upload chosen file button, then we don't need the flash messages at all, do we? I'd say it has to be one or the other, having both doesn't make much sense really.

I also think that the Upload chosen file button is not really needed. The upload should happen automatically as a part of the form save, right? But that's beside the point of this PR really.

@terezanovotna
Copy link

I also think that the Upload chosen file button is not really needed. The upload should happen automatically as a part of the form save, right? But that's beside the point of this PR really.

agreed!

But, we need a flash message. We need to notify the user what is going on.

@himdel
Copy link
Contributor

himdel commented Feb 27, 2019

But, we need a flash message. We need to notify the user what is going on.

@terezanovotna Can you be really specific about what the message should be for please?

"No file chosen" is completely useless as a message if the user is not trying to click an upload button.
And since the file is never required, when would we ever show it?

@terezanovotna
Copy link

Looking at it now, if we combine two actions (choose and upload) together, then we don't need flash message because that error cannot happen.

@himdel you got it right! Sorry

@mzazrivec mzazrivec self-assigned this Mar 4, 2019
@mzazrivec mzazrivec added this to the Sprint 106 Ending Mar 4, 2019 milestone Mar 4, 2019
@mzazrivec mzazrivec merged commit 44a23f8 into ManageIQ:master Mar 4, 2019
@ZitaNemeckova ZitaNemeckova deleted the add_falsh_message branch May 31, 2019 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants