fleet icon indicating copy to clipboard operation
fleet copied to clipboard

Display `InfoBanner` component if filtered policy id does not exist on hosts page

Open gillespi314 opened this issue 3 years ago • 6 comments

Currently if a user tries to navigate to the hosts page using a URL with a non-existent policy_id query param, the policies filter button appears without a name.

hosts/manage/?order_key=hostname&order_direction=asc&team_id=2&policy_id=999999&policy_response=passing:

Screen Shot 2022-08-15 at 11 29 02 AM

Goal

As a user navigating to the list of hosts filtered by a policy, I want to know when a policy no longer exists.

Requirements

  • User sees an InfoBanner component displaying the following message: The policy does not exist. Head to the Policies page to see a list of policies.

image

Figma

https://www.figma.com/file/hdALBDsrti77QuDNSzLdkx/%F0%9F%9A%A7-Fleet-EE-(dev-ready%2C-scratchpad)?node-id=9617%3A316777

gillespi314 avatar Aug 15 '22 16:08 gillespi314

noahtalerman: I moved this out of the original issue description for safe keeping.

The button allows the user to clear the invalid policy filter without editing the URL and refreshing the page so it does provide some utility. Still the UX can be improved with a more helpful banner that better informs the user of the problem. One possibility is to replace the policies filter block (policy status dropdown and button) with a banner or other element that the user can click to clear the filter and send the user to the default manage hosts page.

As part of this ticket, it would also be a good idea to examine how other query param filters handle non-existent entities (software, mdm, operating system) on the manage hosts page and try to apply some standard approaches.

noahtalerman avatar Sep 19 '22 15:09 noahtalerman

User sees the 404 page if they navigate to the Hosts page with a non existent policy_id

@lukeheath I think we want to apply this same behavior for all query parameters in which the entity (software id, policy id, etc.) no longer exists. What do you think? Is this normal behavior for a web application?

noahtalerman avatar Sep 20 '22 14:09 noahtalerman

@noahtalerman I'm not sure a 404 page is the way to go here. That would make sense if the user was trying to load a policy details screen for a policy that no longer exists, because that page no longer exists (404). However, in this case we're attempting to pass the policy id as a query param on a page that does exist, hence not a 404. Instead, if an entity is passed as a query param that no longer exists, I suggest we pop up an error flash message stating that it no longer exists, and show the page without the filter applied. Thoughts?

lukeheath avatar Sep 20 '22 15:09 lukeheath

page that does exist, hence not a 404

Makes sense.

suggest we pop up an error flash message stating that it no longer exists

@lukeheath what do you think about showing the user the grey information banner instead of error message? Screen Shot 2022-09-21 at 9 54 05 AM

This way, the user is informed "something no longer exists" instead of "something went wrong (red error)."

noahtalerman avatar Sep 21 '22 13:09 noahtalerman

@noahtalerman Good point, that UI element does make more sense. The only concern I have is that we don't know if the policy ever existed or not. We just know it doesn't exist now. Should we change the copy to "The requested policy does not exist. Head to the Policies page to see a list of policies."?

lukeheath avatar Sep 21 '22 17:09 lukeheath

we don't know if the policy ever existed or not.

Ah, good point.

@lukeheath I like your suggested copy. I prefer removing "requested" to shorten the message:

The policy does not exist. Head to the Policies page to see a list of policies.

noahtalerman avatar Sep 21 '22 20:09 noahtalerman

@lukeheath do we want to a) prioritize #8152 to this release which is the backend portion of this (measure twice cut once) or b) remove this from the release?

RachelElysia avatar Oct 26 '22 18:10 RachelElysia

@RachelElysia Let's defer this ticket for now. Moving back to the estimated column.

lukeheath avatar Oct 26 '22 18:10 lukeheath

Screen Shot 2022-11-04 at 9 26 21 AM

This is the behavior if the software doesn't exist. I had a bunch of fake hosts I deleted, software inventory wasn't updated yet, I clicked a software that was on hosts I deleted only, and got this spinning page of doom.

RachelElysia avatar Nov 04 '22 13:11 RachelElysia

Do we have a larger ticket for consistent API error states? I know errors came up again in #8306 and would be great to track our progress. @lukeheath

RachelElysia avatar Nov 08 '22 20:11 RachelElysia

@RachelElysia Good idea, I've created #8632 to track this.

lukeheath avatar Nov 08 '22 21:11 lukeheath

The backend portion of this has been deprioritized. Unassigning for now.

lukeheath avatar Jan 03 '23 22:01 lukeheath