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

Update Breadcrumbs/Add Activity Stream UI #9083

Merged
merged 17 commits into from
Jan 21, 2021

Conversation

jlmitch5
Copy link
Contributor

@jlmitch5 jlmitch5 commented Jan 14, 2021

This PR is broken up into 3 main commits. Some detail on each:

TODO:

  • Adding some more detailed tests around the description/link building

"update Breadcrumb component to ScreenHeader"

Relevant issues: #7727, #8465

Screen Shot 2021-01-14 at 10 36 38 AM

Part of the requirements for the Activity Stream UI (that is pulled over from the legacy UI), is that each view (aside from Managment Jobs), has an activity stream link which pre-filters the view to the specific type of resource(s) that page shows. So for example, when you are on the Organizations page and you click the Activity Stream link in the top-right header, it should take you to the Activity Stream route and only show you Organization-based activity (creating, editing, deleting, etc.)

Because we already had a component that rendered the header across the app in a consistent way (<Breadcrumbs />, I decided to extend that component (with an additional prop for the stream type to filter), and rename it to <ScreenHeader /> in order for the name to better encapsulate its new responsibilities.

While making these changes, I decided to tackle an issue that was raised a few weeks ago...Patternfly has stopped rendering the BreadcrumbHeading component (always our last breadcrumb) in a similar way to the Title component. I talked with taufique, and he said we still want this functionality--projects are moving to a system where this functionality is implemented by rolling your own solution with Title for the last breadcrumb. Basically, I just duplicated the recursive Crumb component, and only render the final step (as Title). I also get rid of the Breadcrumbs bar (and the unnecessary top padding it creates) when there is only one crumb.

For testing, due to the way this utilizes the useRouteMatch hook, the solution I settled on was to utilize the actual React Router lib in the relevant files as they would fail if I didn't (open to other approaches on this point if anyone has any better ideas).

"don't strip out non-namespaced params when encoding url search params"

When designing the qs libs, we made sure all lists had a namespace with which we could add to the params, so that when interacting with various UI elements which update the list (such as search, sort and pagination/page size setting), any other search params that were hanging around would not be stripped out. while adding the params was done correctly, it seemed like the encoding side of things was not. I updated the qs lib's function for encoding the params into the url param to accept an addtional "other search params" argument, and in all the places where it is called, I get those other params so they can be passed.

This was necessary because the activity stream type needed to be a search param, but it kept getting stripped out and set back to "all activity".

"add activity stream ui"

Relevant Issues:

Screen Shot 2021-01-14 at 10 37 11 AM
Screen Shot 2021-01-14 at 10 37 25 AM

This commit contains all the new activity stream UI code (api model, route, list, etc.). It uses the new react-table component.
It is virtually identical to the old UI, with a few small differences which are:

  • there are a few additional/updated activity stream types in the dropdown to cover all screens in ui_next. oauth2 applications and tokens have been consolidated to a single type so that they can be linked to together in the applications routes.
  • anchor links have been updated in a few places to match the equivalent routes in the new UI. The most notable change in this respect is that settings-related events used to link to "sub-sections", but because these sub-sections are defined in the UI (as opposed to the small number of categories the api defines them under), I just updated these links to the root settings page.
  • the description/link string builder is virtually identical to that in the old UI (which I did so that functionality would be identical), but has been updated to conform to our coding standards (no more string +=). It also does not render html strings (which is against our new CSP), but rather JSX components.
  • sorting can be done by timestamp and initiated by (by userrname), but not the description column. The description column's params that were used in the old UI were actually not the same ones that are displayed, so they didn't actually work correctly. There's no real way to sort this way because the descrriptions are generated from a bunch of different pieces of data from the api. Note for initiated by "system" (even usernames that come alphabetically after it) will always be at the end, because it is written when no actor__username is given by the api.
  • Note that "keyword search" maps to ?search= on the backend. It can return puzzling results, but after talking with Taufique it made more sense to leave it (to maintain consistent functionality across old and new UI). It would be nice in the future to see if there are ways to retool the activity stream's API view to return the description and initiated by data in a way that is more accurately searchable.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@unlikelyzero
Copy link

@qe we should add a visual test here #3786 (comment)

@unlikelyzero unlikelyzero added the type:feature prioritized on a feature board label Jan 15, 2021
@tiagodread tiagodread self-assigned this Jan 15, 2021
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@tiagodread
Copy link
Contributor

Hey @jlmitch5 this looks awesome, I've found so far:

  • Performing a search and then changing the activity stream type, the search term still set:

as1

  • Missing space between text and link:

image

  • Paginate through the list and then select an Activity Stream type that doesn't contain events, the Not Found view is displayed instead of No Events Found view.

image

  • Trying to perform an advanced search with Key set to Type:

image

  • Team -> Roles Tab missing title:

image

  • JT -> Schedules tab -> Add schedule -> Schedule details missing title:

image

  • Inventories -> groups tab -> Add group -> group details -> Related Groups tab only appear "Groups" as title AND navigating between the tabs Related Groups and Hosts you can see that the UI has a resizing (updown) weird problem

as2

  • Inventories -> inventory -> Sources Tab -> Add Source -> Source notification tab missing title:

image

@jlmitch5
Copy link
Contributor Author

Thanks for the review @tiagodread !

Performing a search and then changing the activity stream type, the search term still set:

Fixed

Missing space between text and link:

Fixed

Paginate through the list and then select an Activity Stream type that doesn't contain events, the Not Found view is displayed instead of No Events Found view.

I've reset the page to 1 when the activity stream type changes

Trying to perform an advanced search with Key set to Type:

We talked about this offline. It's due to the fact type doesn't accept the __icontains suffix operator.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@jlmitch5
Copy link
Contributor Author

@tiagodread fixed all the breadcrumb issues you mentioned. Thanks again for such a thorough review!

  • Team -> Roles Tab missing title:

Fixed

  • JT -> Schedules tab -> Add schedule -> Schedule details missing title:

Fixed

  • Inventories -> groups tab -> Add group -> group details -> Related Groups tab only appear "Groups" as title

Fixed

  • navigating between the tabs Related Groups and Hosts you can see that the UI has a resizing (updown) weird problem

Fixed (and I added a min-height to the title section, so even if it's not rendered yet, it's render want cause updown flashing in any case)

  • Inventories -> inventory -> Sources Tab -> Add Source -> Source notification tab missing title:

Fixed

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@unlikelyzero
Copy link

@jlmitch5 @marshmalien added #9122 to track the settings work

John Mitchell added 3 commits January 21, 2021 10:01
- show last breadcrum item as Title on new line
- add activity stream type (to display activity stream icon link in header)
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@unlikelyzero
Copy link

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:ui type:feature prioritized on a feature board
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants