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

feat(ws): add namespace dropdown to UI #154

Open
wants to merge 2 commits into
base: notebooks-v2
Choose a base branch
from

Conversation

YosiElias
Copy link

image
image

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign ederign for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link

@paulovmr paulovmr left a comment

Choose a reason for hiding this comment

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

Hi @YosiElias , thanks for the PR! I added a few comments inline, and I would like to ask you a few things to align this PR with the Kubeflow contributing guide and to make the review easier:

  • I can see a few extra commits in this PR's branch, please consider adding just the one related to your changes, with your sign-off.
  • To follow the commit naming convention, please consider having the text "feat(ws): Notebooks 2.0 // Frontend // Namespace selector" for the commit message and PR label.

Also please consider adding some Cypress tests to automate the namespace changing verification. Thanks!

workspaces/frontend/src/app/DropDwon.tsx Outdated Show resolved Hide resolved
workspaces/frontend/src/app/DropDwon.tsx Outdated Show resolved Hide resolved
@@ -0,0 +1,9 @@
import { useEffect } from "react"

const useMount = (callback:()=>void): void => {
Copy link

Choose a reason for hiding this comment

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

IMHO, the useEffect could be used directly, without this hook.

Choose a reason for hiding this comment

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

It is a preparation for future useEffect calls without dependencies, meaning, it's much for "readable" and compact this way in our opinion (one line simple call wrapping a function, instead of whole useEffect syntax)
If you still think a direct useEffect call is better, we will refactor it back.

workspaces/frontend/src/app/DropDwon.tsx Outdated Show resolved Hide resolved
@thesuperzapper thesuperzapper changed the title Namespace UI feat(ws): add namespace dropdown to UI Dec 11, 2024
@YosiElias YosiElias force-pushed the namespace-ui branch 2 times, most recently from e162dab to 72f6ab6 Compare December 17, 2024 13:31
Copy link

@Griffin-Sullivan Griffin-Sullivan left a comment

Choose a reason for hiding this comment

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

If you make the changes I suggested, you can then run the following in the frontend/ dir:

npm run test:fix

and that should fix your CI failure.

const useMount = (callback:()=>void): void => {
useEffect(() => {
callback();
}, []);

Choose a reason for hiding this comment

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

Suggested change
}, []);
});

Copy link
Author

Choose a reason for hiding this comment

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

@Griffin-Sullivan thanks for you comments!
I have a question, why would you want to remove the dependencies array?
If we do that, it’ll run after every render (and re-render), but we only want it to run on the first render, don’t we? (that was the intention of useMount)

Signed-off-by: yelias <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Needs Triage
Development

Successfully merging this pull request may close these issues.

5 participants