-
Notifications
You must be signed in to change notification settings - Fork 22
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
base: notebooks-v2
Are you sure you want to change the base?
Conversation
YosiElias
commented
Dec 5, 2024
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this 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!
@@ -0,0 +1,9 @@ | |||
import { useEffect } from "react" | |||
|
|||
const useMount = (callback:()=>void): void => { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
e162dab
to
72f6ab6
Compare
Signed-off-by: yelias <[email protected]>
72f6ab6
to
fee7584
Compare
There was a problem hiding this 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.
workspaces/frontend/src/app/context/NamespaceContextProvider.tsx
Outdated
Show resolved
Hide resolved
const useMount = (callback:()=>void): void => { | ||
useEffect(() => { | ||
callback(); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}, []); | |
}); |
There was a problem hiding this comment.
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]>