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

React Context and Project Nested Routing #508

Merged
merged 5 commits into from
Sep 24, 2024

Conversation

mshriver
Copy link
Contributor

@mshriver mshriver commented Aug 1, 2024

This pulls the commits from #504 that implement react context and update the react-routing tree.

This introduces some new components for admin and profile pages, splits sidebar into a new component, and refactors many components to use a react context instead of local storage.

This also provides static routing for projects, dashboards, and updated paths for runs and results that are project scoped.

@mshriver mshriver added enhancement New feature or request frontend labels Aug 1, 2024
@mshriver mshriver marked this pull request as draft August 1, 2024 15:26
@mshriver mshriver requested a review from jjaquish August 5, 2024 11:20
@mshriver mshriver force-pushed the react-context-and-routing branch from f082196 to e61d263 Compare August 5, 2024 12:15
@mshriver mshriver requested a review from ColeHiggins2 August 6, 2024 11:39
@mshriver mshriver changed the title React context and routing React Context and Project Nested Routing Aug 6, 2024
@mshriver mshriver force-pushed the react-context-and-routing branch 3 times, most recently from a99ef9f to 2c10aed Compare August 20, 2024 14:12
@mshriver mshriver marked this pull request as ready for review August 20, 2024 14:12
@mshriver mshriver force-pushed the react-context-and-routing branch 4 times, most recently from a1bde43 to d2ab5fa Compare August 20, 2024 18:49
Copy link
Collaborator

@LightOfHeaven1994 LightOfHeaven1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, I love context usage and I see some component were converted to functional. There are some things I found and mentioned in my comments. Plus I see some styling issues, I will let you know about them on slack

@mshriver mshriver marked this pull request as draft August 21, 2024 12:23
@mshriver mshriver marked this pull request as ready for review August 21, 2024 14:02
Copy link
Collaborator

@jjaquish jjaquish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments for now. Functionally it looks fine to me so far (I have some more testing I'd like to do on Monday though) but there were a few style issues

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the about page style is a little messed up now. Not sure exactly why

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you provide a bit more context? screenshots against production ibutsu on 2.5.8?

@mshriver mshriver force-pushed the react-context-and-routing branch 2 times, most recently from bc64354 to fba4293 Compare September 3, 2024 17:42
@mshriver mshriver requested a review from jjaquish September 4, 2024 11:57
@mshriver mshriver force-pushed the react-context-and-routing branch from fba4293 to fa3c728 Compare September 4, 2024 14:25
Frontend updates for admin portal-edit and portal-list are working

React context used to track active dashboard and project, instead of
browser local storage. Dashboard, IbutsuHeader, IbutsuPage rewritten for
using the context.

Static routes set for project dashboard/runs/results/reportbuilder using
UUID. Page component state needs to be updated in some areas when
navigation orginates from the URL with params set and not component
selection.

Project selection and dashboard selection are hooked up to the routing
with ugly event handler prop passing. Moving these to functional
components will allow using useEffect with dependencies instead to
control interaction between these components

In progress:

sidebar moved into new functional component, project views need to be
accounted for in component state or in the context itself.

Now when a project is not selected, there is no page rendered (no
sidebar). This will need an empty state page to look good, something
easy just saying to select a project or portal.

Class component callbacks on setState don't pick up modified context, so
I'm having to hack a function parameter into the callback functions

Split Admin and Profile pages into separate component for sane routing
Both now use Page instead of IbutsuPage, keeping IbutsuHeader

Use an outlet in the admin and profile pages for easy routing

run and result updates for routing change

path relative links for react-router so that runs and results are nested
under `/project/:id`

Page refreshes now set both the project and dashboard selection from
URL params!

DRAFT remove utility functions, update Links

use path relative links from components where the route relative paths
don't compose correctly.

Update widget-config-controller to allow view type widgets to not have
any project set

needs testing

Updating FileUpload to remove params

Updating unit test to provide the necessary context for the FileUpload
component
use the HTML class to control theme instead of applying to every element

Update upload button to use ariaDisabled, add tooltip
It's not necessary for the usecase and the cypress test was failing to
detect the mocked method being called.
@mshriver mshriver force-pushed the react-context-and-routing branch from 36beade to 3678c98 Compare September 5, 2024 15:54
@mshriver
Copy link
Contributor Author

mshriver commented Sep 9, 2024

@LightOfHeaven1994 want to take another look with the latest commits?

@LightOfHeaven1994
Copy link
Collaborator

@mshriver will do tomorrow 👍

Copy link
Collaborator

@ColeHiggins2 ColeHiggins2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me! Cant wait to use it

@mshriver
Copy link
Contributor Author

I'm going to proceed with merging and squashing commits, thanks for the reviews and input!

I'll be testing the master branch DB migration against an internal RH stage instance before tagging a release with this commit.

@mshriver mshriver merged commit 11a4362 into ibutsu:master Sep 24, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants