-
Notifications
You must be signed in to change notification settings - Fork 356
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
Showing authentication status in Physical Provider list #3199
Showing authentication status in Physical Provider list #3199
Conversation
6f12ef8
to
a7ecfb9
Compare
a0b1522
to
c7e2321
Compare
251f9ac
to
1e3dbbd
Compare
Hi @martinpovolny, can you take a look on this? |
def check_providers_credentials | ||
model.find_each do |provider| | ||
if provider.authentication_status.casecmp("invalid").zero? | ||
add_flash(_("The provider \"%<name>s\" is with invalid credentials") % {:name => provider.name}, :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.
Can we change the string to
"The provider \"%{name}\" is with invalid credentials"
so as not to confuse translators?
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.
Yes, I can, but I've get an issue of rubocop when I did so
1e3dbbd
to
e0ba050
Compare
def check_providers_credentials | ||
model.find_each do |provider| | ||
if provider.authentication_status.casecmp("invalid").zero? | ||
add_flash(_("The provider \"%{name}\" is with invalid credentials") % {:name => provider.name}, :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.
is with invalid credentials
should be has invalid credentials
, for proper English.
|
||
context "show provider with invalid credentials" do | ||
it "shows an alert to user" do | ||
expect(assigns(:flash_array).first[:message]).to include("The provider \"#{@provider.name}\" is with invalid credentials") |
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.
Same proper English change needed here. :)
e0ba050
to
285e1fb
Compare
it's done @dclarizio and @mzazrivec , please let me know if there are some more issues to address here 👍 |
I was discussing this with @martinpovolny and we concluded that this approach diverges from whatever we do in the rest of our application: we don't render flash messages informing the user of invalid credentials anywhere in our list views. I don't question that this information is useful to have, the question is where. Maybe a toolbar button which would trigger a check like this and render a flash message when needed? @Loicavenel what do you think? |
Our thinking on this implementation is that we want to provide a way for the user to reset their password to the provider via MIQ. We needed a method to let the user when this is required. Is this better served as an MIQ Alert without the flash message? |
I understand that there's a value in having this information visible somewhere and I don't question the motivation behind this. Though rendering a flash message in the list view informing of invalid credentials would really be unique just to the physical providers page (we don't do anything like that in the other list views). So I'd rather have this decided by @Loicavenel |
@douglasgabriel We are looking into this as I'm pretty sure we've solved it differently in other areas. Marking as WIP until we can respond. |
@douglasgabriel The Grid/Tile mode already shows the authentication status. Notice the green check mark in the image below - We could extend this feature for listviews as well - as in, add a column in the listview that shows To add the Auth Status column, the changes are quite simple. diff --git a/product/views/ManageIQ_Providers_PhysicalInfraManager.yaml b/product/views/ManageIQ_Providers_PhysicalInfraManager.yaml
index c8c6f6951..560ed9088 100644
--- a/product/views/ManageIQ_Providers_PhysicalInfraManager.yaml
+++ b/product/views/ManageIQ_Providers_PhysicalInfraManager.yaml
@@ -26,6 +26,7 @@ cols:
- total_vms
- total_miq_templates
- region_description
+- authentication_status
# Included tables (joined, has_one, has_many) and columns
include:
zone:
@@ -47,6 +48,7 @@ col_order:
- total_vms
- total_miq_templates
- region_description
+- authentication_status
# Column titles, in order
headers:
- Name
@@ -59,6 +61,7 @@ headers:
- VMs
- Templates
- Region
+- Authentication Status
# Condition(s) string for the SQL query
conditions:
# Order string for the SQL query With these changes, your list should look like this - Let us know what you think. |
Hmm, thanks @AparnaKarve . This way is pretty simpler, I like it 😄 |
285e1fb
to
8b7f3e7
Compare
Checked commit douglasgabriel@8b7f3e7 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
This PR is able to: