From 99b924656e825730ef96cc513bca8d0f171903cc Mon Sep 17 00:00:00 2001 From: Chandrasekhar Ramakrishnan Date: Thu, 18 Aug 2022 14:00:06 +0200 Subject: [PATCH] feat: new session start flow (#1990) (#2003) Fix #1990 --- client/src/notebooks/Notebooks.present.js | 12 +++++++----- client/src/project/Project.present.js | 14 ++++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/client/src/notebooks/Notebooks.present.js b/client/src/notebooks/Notebooks.present.js index a3017e214e..273a9cd29b 100644 --- a/client/src/notebooks/Notebooks.present.js +++ b/client/src/notebooks/Notebooks.present.js @@ -96,19 +96,21 @@ function ShowSession(props) { return handlers.fetchLogs(notebook.data.name); }; - const urlList = Url.get(Url.pages.project.session, { + const urlList = Url.get(Url.pages.sessions); + const urlProject = Url.get(Url.pages.project.base, { namespace: filters.namespace, path: filters.project, }); // redirect immediately if the session fail if (props.history && notebook.data?.status?.state === SessionStatus.failed) - props.history.push(urlList); + props.history.push(urlProject); // Always add all sub-components and hide them one by one to preserve the iframe navigation where needed return (
- +
@@ -123,14 +125,14 @@ function ShowSession(props) { } function SessionInformation(props) { - const { notebook, stopNotebook, urlList } = props; + const { notebook, stopNotebook, urlProject } = props; const [stopping, setStopping] = useState(false); const stop = async () => { setStopping(true); // ? no need to handle the error here since we use the notifications at container level - const success = await stopNotebook(notebook.data.name, urlList); + const success = await stopNotebook(notebook.data.name, urlProject); if (success !== false) return; setStopping(false); diff --git a/client/src/project/Project.present.js b/client/src/project/Project.present.js index 2dc4bee6ac..88eaea402d 100644 --- a/client/src/project/Project.present.js +++ b/client/src/project/Project.present.js @@ -578,9 +578,6 @@ class ProjectNav extends Component { - - - @@ -1076,8 +1073,8 @@ const ProjectSessions = (props) => { const locationFrom = props.history?.location?.state?.from; const filePath = props.history?.location?.state?.filePath; const backNotebookLabel = filePath ? `Back to ${filePath}` : "Back to notebook file"; - const backButtonLabel = locationFrom ? backNotebookLabel : "Back to sessions list"; - const backUrl = locationFrom ?? props.notebookServersUrl; + const backButtonLabel = locationFrom ? backNotebookLabel : `Back to ${props.metadata.pathWithNamespace}`; + const backUrl = locationFrom ?? props.baseUrl; const backButton = (); @@ -1403,9 +1400,14 @@ class ProjectView extends Component { render={props => } /> } /> + null} /> } /> - + + null} /> + } /> +