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

Refactor Navigation to use react-router-dom v6 #250

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

Griffin-Sullivan
Copy link
Contributor

Description

  • Upgraded react-router-dom from v5.3.4 to v6.4.1
  • Setup routes and navigation data
  • Created a new NavSidebar in a separate file to host the sidebar and it's items
  • Changed app/index to app/App since it exports <App />
  • Updated index.tsx and app/App.tsx to reflect all the changes

How Has This Been Tested?

Running the frontend and making sure routes work as expected and nav groups work correctly. Make sure the sidebar can open and close correctly.

We could consider adding a UI test for the nav, however I'm not sure how beneficial this is yet since we plan on adding "real" pages soon. At the moment everything is placeholder.

Merge criteria:

  • The commits and have meaningful messages; the author will squash them after approval or will ask to merge with squash.
  • Testing instructions have been added in the PR body (for PRs involving changes that are not immediately obvious).
  • The developer has manually tested the changes and verified that the changes work


export const useAdminSettings = (): NavDataItem[] => {
// get auth access for example set admin as true
const isAdmin = true //this should be a call to getting auth / role access
Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can also test that changing this to false will remove the fake Settings nav items

Copy link
Contributor

Choose a reason for hiding this comment

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

mmm not quite what I expected, this is great to hide the settings for the user, but they can still navigate to those routes adding the path to the browser.
A great example would be havving Setting 1 as a new mock page called "Admin", and inside either not mounting that route with conditional rendering or creating a private route.

Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

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

Left my main concern in your comment, rest looks good.


export const useAdminSettings = (): NavDataItem[] => {
// get auth access for example set admin as true
const isAdmin = true //this should be a call to getting auth / role access
Copy link
Contributor

Choose a reason for hiding this comment

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

mmm not quite what I expected, this is great to hide the settings for the user, but they can still navigate to those routes adding the path to the browser.
A great example would be havving Setting 1 as a new mock page called "Admin", and inside either not mounting that route with conditional rendering or creating a private route.

Signed-off-by: Griffin-Sullivan <gsulliva@redhat.com>
Copy link
Contributor

@lucferbux lucferbux left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link

@lucferbux: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ederign
Copy link
Member

ederign commented Aug 8, 2024

/lgtm

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ederign, lucferbux

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 869fb58 into kubeflow:main Aug 8, 2024
14 checks passed
dhirajsb pushed a commit to dhirajsb/model-registry-kfp that referenced this pull request Aug 30, 2024
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.

3 participants