-
Notifications
You must be signed in to change notification settings - Fork 6
feat: provide more information when shutting down sessions #3779
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: provide more information when shutting down sessions #3779
Conversation
You can access the deployment of this PR at https://renku-ci-ui-3779.dev.renku.ch |
307f277
to
5823752
Compare
d1a15fd
to
03a5d58
Compare
This should help preventing users from accidentally losing non-saved and non-synced files
}: { | ||
datetime: DateTime | Date | string; | ||
now: DateTime; |
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.
Please revert this, now
should be given as a DateTime
, that is create it with luxon
.
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 can't it be just a Date
? That's often going to be new Date()
, we don't need luxon
for that.
|
||
interface CollapseBodyProps { | ||
className?: string; | ||
children: React.ReactNode; |
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.
nitpick: prefer import { ReactNode } from 'react';
so that we do not rely on a shadow import.
import { Loader } from "../../components/Loader"; | ||
import { User } from "../../model/renkuModels.types"; | ||
import { NOTIFICATION_TOPICS } from "../../notifications/Notifications.constants"; | ||
import { NotificationsManager } from "../../notifications/notifications.types"; | ||
import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; | ||
import AppContext from "../../utils/context/appContext"; | ||
import useLegacySelector from "../../utils/customHooks/useLegacySelector.hook"; | ||
import styles from "../session/components/SessionModals.module.scss"; |
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.
move to its own line below code imports
<ModalHeader toggle={toggleModal}> | ||
{action === "pause" ? "Pause Session" : "Shut Down Session"} | ||
<ModalHeader | ||
className={cx(action === "delete" ? "text-danger" : "")} |
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.
className={cx(action === "delete" ? "text-danger" : "")} | |
className={cx(action === "delete" && "text-danger")} |
{hibernationThreshold} of inactivity. | ||
</InfoAlert> | ||
)} */} | ||
{hibernateThreshold && ( |
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.
{hibernateThreshold && ( | |
{hibernateThreshold != null && ( |
@@ -386,11 +397,12 @@ function DeleteSessionModalContent({ | |||
</ModalBody> | |||
<ModalFooter> | |||
<Button | |||
color="outline-danger" | |||
color="outline-primary" |
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 should be outline-danger
when the dialog is "delete" (see designs).
const now = new Date(); | ||
const hibernateThreshold = session?.status?.will_hibernate_at | ||
? toHumanRelativeDuration({ | ||
datetime: session?.status?.will_hibernate_at, | ||
now, | ||
}) | ||
: 0; |
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.
Do not do this by hand, use the <TimeCaption>
component, it will re-render as appropriate and provide a tooltip with the exact timestamp.
Check your workspace is clear: Ensure no important files | ||
remain in | ||
<code>/home/jovyan/work/</code>. |
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.
What does this mean? Do I need to remove all the files in there?
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.
I guess that means any file there would be lost.
It makes sense to me, but feel free to ping the product team if you think the copy text should be different here
)} | ||
<li> | ||
Check your workspace is clear: Ensure no important files | ||
remain in |
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.
remain in | |
remain in{" "} |
Commit and push code changes: Run <code>git commit</code>{" "} | ||
and <code>git push</code> in all repositories ( | ||
<span className="fst-italic"> | ||
{codeRepositories.join(", ")} |
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 lists repositories I cannot git push
to, is it OK?
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.
I think it's acceptable here; even if we check users can push through the integrations, that might have changed and not be valid for the sessions for many reasons, ranging from permissions revoked on the platform to users who authenticated in the sessions or git push using a token.
@leafty I've addressed most points except the copy text. There were quite a few iterations on that from the product team. Ofc feel free to ping them if the text should be different, but I prefer to have them involved. |
client/src/features/sessionsV2/components/SessionModals/ShoutdownSessionContent.tsx
Outdated
Show resolved
Hide resolved
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.
LGTM, nitpick below
Check your workspace is clear: Ensure no important files | ||
remain | ||
{launcherMountDirectory && ( | ||
<span> |
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.
<span> | |
<> |
Tearing down the temporary RenkuLab deplyoment for this PR. |
This PR adds more context to the session shutdown modal to help prevent users from accidentally losing non-saved and non-synced files.
The content is customized based on the project's attached resources:
Project with Code and writable Data Connectors

Project with no storage attached

/deploy
fix https://www.notion.so/renku/Improve-Shut-Down-Modal-22d0df2efafc809aa88aff84697d397c?d=2370df2efafc80229d5d001cf13126c9#2370df2efafc8035a5cbd3e11f3e8203