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

1 of 4 - refactor(config): sw-625 generate routes #1045

Merged

Conversation

cdcabrera
Copy link
Member

@cdcabrera cdcabrera commented Feb 2, 2023

What's included

  • refactor(config): sw-625 generate routes
  • refactor(redux): sw-625 remove connectRouter
  • refactor(useRouter): sw-625 combine routerContext

Notes

  • THIS AFFECTS ALL PRODUCT ROUTING. RHEL, OpenShift, RHODS, RHACS, RHOSAK/Streams, Satellite, etc
    • This update, because its generating routes from aspects of product configurations potentially allows one-off names to load the correct product.
  • no visual changes associated with this update
  • refactor prep for moving over to router 6, generate routes from available product configs
    • we're temporarily adding more code than we're removing in an effort to create fallbacks and history. the route generator will be removed in PR 3 of 4 in favor of a :productParameter along with some other removals.
    • The primary work is around generating a single product config via Webpack under ./src/config/products.js. This is prep for moving towards the API configuration endpoint
  • appears to be a known route double load issue (manifests/displays as history having 2 entries if you hover over the browser back button, and potentially causes loading of api calls twice, for every route that's loaded. Curiosity cancels dup calls that have not resolved) when using the left navigation. this is being correlated by the consoledot ui team with the diff between react router 6 vs 5
    • this issue is currently in env. this pr does not resolve the issue

How to test

Coverage and basic unit test check

  1. update the NPM packages with $ yarn
  2. $ yarn test
  3. confirm tests come back clean

Local run check

  1. update the NPM packages with $ yarn
  2. $ yarn start
  3. confirm products can still be navigated towards locally

Proxy run check

  1. update the NPM packages with $ yarn
  2. make sure Docker is running, plus on network, then
  3. $ yarn start:proxy
  4. confirm
    • left navigation brings up the appropriate product for all products
    • optin is still activated
    • manual url updates still navigate towards a product, ie. [consoledot]/subscriptions/[some random path]/rhel

Example

...

Updates issue/story

sw-625

@cdcabrera cdcabrera added the 202304 project phase label Feb 2, 2023
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch 2 times, most recently from 4cdd211 to 8a27059 Compare February 3, 2023 04:05
@codecov-commenter
Copy link

codecov-commenter commented Feb 3, 2023

Codecov Report

Merging #1045 (14c288f) into dev (f8a813f) will increase coverage by 0.22%.
The diff coverage is 93.84%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1045      +/-   ##
==========================================
+ Coverage   93.31%   93.54%   +0.22%     
==========================================
  Files         122      122              
  Lines        4071     4075       +4     
  Branches     1662     1640      -22     
==========================================
+ Hits         3799     3812      +13     
+ Misses        255      246       -9     
  Partials       17       17              
Impacted Files Coverage Δ
src/components/router/router.js 95.23% <ø> (-1.32%) ⬇️
src/config/index.js 100.00% <ø> (ø)
src/config/product.openshiftDedicated.js 80.76% <ø> (ø)
src/config/product.rhacs.js 85.71% <ø> (ø)
src/config/product.rhods.js 85.71% <ø> (ø)
src/config/product.rhosak.js 83.72% <ø> (ø)
src/components/productView/productViewMissing.js 87.50% <66.66%> (-1.39%) ⬇️
src/components/router/redirect.js 94.11% <90.00%> (-5.89%) ⬇️
src/components/router/routerContext.js 94.44% <90.90%> (-5.56%) ⬇️
src/config/products.js 90.90% <90.90%> (ø)
... and 14 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8a813f...14c288f. Read the comment docs.

cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 3, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 3, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from 8a27059 to a96ce16 Compare February 3, 2023 04:31
@cdcabrera cdcabrera added the hold label Feb 3, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 3, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 3, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from a96ce16 to 628f57e Compare February 3, 2023 20:08
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 6, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 8, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 8, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 8, 2023
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from 14c288f to 2cb1f30 Compare February 8, 2023 01:13
cdcabrera added a commit that referenced this pull request Feb 9, 2023
* refactor(redux): sw-625 remove connectRouter (#1045)
* refactor(config): sw-625 generate routes (#1045)
* refactor(useRouter): sw-625 combine routerContext (#1045)
* refactor(routerContext): sw-625 useRedirect hook
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
@cdcabrera cdcabrera changed the title refactor(config): sw-625 generate routes 1 of 4 - refactor(config): sw-625 generate routes Feb 14, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 14, 2023
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from 2cb1f30 to 60abaf0 Compare February 14, 2023 01:42
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from 60abaf0 to 5af7354 Compare February 15, 2023 20:43
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
@cdcabrera cdcabrera removed the hold label Feb 15, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 15, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 20, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 20, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 20, 2023
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from 5af7354 to 150b9f0 Compare February 20, 2023 19:46
cdcabrera and others added 3 commits February 20, 2023 15:54
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
@cdcabrera cdcabrera force-pushed the 20230202-sw-625-generate-routes branch from 150b9f0 to f09907c Compare February 20, 2023 20:55
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 20, 2023
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 20, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit to cdcabrera/curiosity-frontend that referenced this pull request Feb 20, 2023
@cdcabrera cdcabrera merged commit 4e97ff0 into RedHatInsights:dev Feb 21, 2023
cdcabrera added a commit that referenced this pull request Feb 21, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
cdcabrera added a commit that referenced this pull request Mar 2, 2023
* authentication, redirect errorRoute ref
* build, spelling, jest, local run nav
* config, generate products, routes
* productView, replaced routerHelpers array ref
* productViewMissing, updated routerHelpers
* redirect, simplify, prep router npm update
* redux, viewReducer, updated routerHelpers
* router, prep router npm update
* routerHelpers, refactor, removed unused funcs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
202304 project phase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants