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

Showing authentication status in Physical Provider list #3199

Merged

Conversation

douglasgabriel
Copy link
Member

@douglasgabriel douglasgabriel commented Jan 9, 2018

This PR is able to:

  • Add authentication status column in the Physical Providers list

@douglasgabriel douglasgabriel changed the title Showing alert for physical providers with invalid credentials [WIP] Showing alert for physical providers with invalid credentials Jan 9, 2018
@douglasgabriel douglasgabriel force-pushed the invalid_credentials_alert branch from 6f12ef8 to a7ecfb9 Compare January 9, 2018 12:41
@miq-bot miq-bot added the wip label Jan 9, 2018
@douglasgabriel douglasgabriel changed the title [WIP] Showing alert for physical providers with invalid credentials Showing alert for physical providers with invalid credentials Jan 9, 2018
@miq-bot miq-bot removed the wip label Jan 9, 2018
@douglasgabriel douglasgabriel changed the title Showing alert for physical providers with invalid credentials [WIP] Showing alert for physical providers with invalid credentials Jan 9, 2018
@miq-bot miq-bot added the wip label Jan 9, 2018
@douglasgabriel douglasgabriel force-pushed the invalid_credentials_alert branch 4 times, most recently from a0b1522 to c7e2321 Compare January 10, 2018 20:31
@douglasgabriel douglasgabriel changed the title [WIP] Showing alert for physical providers with invalid credentials Showing alert for physical providers with invalid credentials Jan 11, 2018
@miq-bot miq-bot removed the wip label Jan 11, 2018
@douglasgabriel douglasgabriel force-pushed the invalid_credentials_alert branch 2 times, most recently from 251f9ac to 1e3dbbd Compare January 11, 2018 12:34
@douglasgabriel
Copy link
Member Author

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)
Copy link
Contributor

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?

Copy link
Member Author

@douglasgabriel douglasgabriel Jan 12, 2018

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

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)

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")

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. :)

@douglasgabriel
Copy link
Member Author

douglasgabriel commented Jan 22, 2018

it's done @dclarizio and @mzazrivec , please let me know if there are some more issues to address here 👍

@mzazrivec
Copy link
Contributor

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?

@douglasgabriel
Copy link
Member Author

I agree with you, this feature doesn't exists yet. But the information of invalid credentials is already being save on database, just left to show this information by a util way for the user. I believe that this is a good feature that improves the user experience.

A button that checks the credentials already exist, however none message about the result of the check is shown to user. Like we can see in the image:
image

Well IMHO, this feature provides an approach a little more automated and a button is a more manual approach

But yeah, I'm waiting the definitions from you guys

@rodneyhbrown7
Copy link

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?

@mzazrivec
Copy link
Contributor

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

@dclarizio dclarizio changed the title Showing alert for physical providers with invalid credentials [WIP] Showing alert for physical providers with invalid credentials Apr 27, 2018
@dclarizio dclarizio added the wip label Apr 27, 2018
@dclarizio
Copy link

@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.

@AparnaKarve
Copy link
Contributor

@douglasgabriel The Grid/Tile mode already shows the authentication status. Notice the green check mark in the image below -
screen shot 2018-04-30 at 3 41 33 pm

We could extend this feature for listviews as well - as in, add a column in the listview that shows Authentication Status

To add the Auth Status column, the changes are quite simple.
(the diff below shows the changes required)

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 -
screen shot 2018-04-30 at 3 50 06 pm

Let us know what you think.
Thanks.

@douglasgabriel
Copy link
Member Author

Hmm, thanks @AparnaKarve . This way is pretty simpler, I like it 😄

@douglasgabriel douglasgabriel force-pushed the invalid_credentials_alert branch from 285e1fb to 8b7f3e7 Compare May 2, 2018 12:41
@douglasgabriel douglasgabriel changed the title [WIP] Showing alert for physical providers with invalid credentials Showing authentication status in Physical Provider list May 2, 2018
@miq-bot
Copy link
Member

miq-bot commented May 2, 2018

Checked commit douglasgabriel@8b7f3e7 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. 🏆

@miq-bot miq-bot removed the wip label May 2, 2018
@mzazrivec mzazrivec added this to the Sprint 86 Ending May 21, 2018 milestone May 9, 2018
@mzazrivec mzazrivec merged commit ffa6111 into ManageIQ:master May 9, 2018
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