-
Notifications
You must be signed in to change notification settings - Fork 6
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: set resource class for a session launcher #3196
Conversation
You can access the deployment of this PR at https://renku-ci-ui-3196.dev.renku.ch |
e2f4046
to
15e547b
Compare
5516411
to
e030808
Compare
e030808
to
3b4097a
Compare
94a8b76
to
004c5d1
Compare
004c5d1
to
9c95aa6
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.
Some code comments:
const onClickCustomLaunch = useCallback(() => { | ||
const customStartUrl = generatePath( | ||
ABSOLUTE_ROUTES.v2.projects.show.sessions.startCustom, | ||
{ | ||
launcherId, | ||
namespace, | ||
slug, | ||
} | ||
); | ||
navigate(customStartUrl); | ||
}, [launcherId, namespace, slug, navigate]); |
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.
Why is this not a link component? This breaks navigation for keyboard users.
startCustom: | ||
"/v2/projects/:namespace/:slug/sessions/:launcherId/start?custom", |
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.
This is not needed. Add a constant for the query param you can re-use (e.g. in client/src/features/sessionsV2/SessionStartPage.tsx
).
launcher, | ||
project, | ||
}); | ||
const { isPendingResourceClass, setResourceClass } = useSessionResourceClass({ |
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.
Why is this not part of the useSessionLauncherState
hook? It seems more natural to host all state in there.
const cancelLaunchSession = useCallback(() => { | ||
const url = generatePath(ABSOLUTE_ROUTES.v2.projects.show.root, { | ||
namespace: project.namespace, | ||
slug: project.slug, | ||
}); | ||
navigate(url); | ||
}, [navigate, project]); |
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.
Why is this not just a Link
component?
import { toHumanDuration } from "../../../../utils/helpers/DurationUtils"; | ||
import { FetchingResourcePools } from "../../../sessionsV2/components/SessionModals/ResourceClassWarning.tsx"; |
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.
import { FetchingResourcePools } from "../../../sessionsV2/components/SessionModals/ResourceClassWarning.tsx"; | |
import { FetchingResourcePools } from "../../../sessionsV2/components/SessionModals/ResourceClassWarning"; |
resourcePools, | ||
startSessionOptionsV2, | ||
} = useSessionLauncherState({ | ||
const hasCustomQuery = new URLSearchParams(location.search).has("custom"); |
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.
"custom"
should probably be defined as a constant. Also, this should use a hook to get the query params:
const hasCustomQuery = new URLSearchParams(location.search).has("custom"); | |
const [searchParams] = useSearchParams(); // from "react-router-dom-v5-compat" | |
const hasCustomQuery = searchParams.has("custom"); |
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.
Note: this form doesn't seem to let users unset the resource class.
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.
Non-blocking: it seems that the project page uses different icons to indicate "edit".
Only one icon should be used for all these cases.
Also the edit button doesn't feel like it's a button at all, there should be some hover and activation styles to communicate to the user that it is an interactive element in the page.
Thanks @leafty for your suggestions. You can find them implemented in the latest commit. Regarding the icon, I share your opinion, but I will create a separate PR for those changes. |
components, | ||
} from "react-select"; | ||
import { useGetNotebooksVersionQuery } from "../../../versions/versions.api.ts"; |
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.
import { useGetNotebooksVersionQuery } from "../../../versions/versions.api.ts"; | |
import { useGetNotebooksVersionQuery } from "../../../versions/versions.api"; |
Tearing down the temporary RenkuLab deplyoment for this PR. |
Description
PR to add a feature for selecting a resource class in a session launcher and prompt users to choose a resource class if they lack access to the default one.
Type of Change
Feat
it requires a new version of renku-data-services
Related Tickets & Documents
Other documents:
Screenshots
UI Accessibility Checklist
For UI changes, ensure the following:
Use Semantic HTML
Keyboard Navigation, issue created for bug not fixed here: [A11Y] Fix keyboard navigation for adding a new launcher #3222
Color contrast
Lighthouse screenshot
Screen Reader Compatibility Not included
Resizing and Zooming
Testing
Cases to test:
Added/Updated Unit Tests?
Added/Updated E2E Tests?
Renku Acceptance Tests
Does this involve adding or modifying acceptance tests in Renku Repository? No
Storybook
Not included new stories because the components may change due to ongoing app redesigns.
/deploy