From dde436c6e1ea005ab30989d301493002b03f42f0 Mon Sep 17 00:00:00 2001 From: Chandrasekhar Ramakrishnan Date: Thu, 6 Feb 2025 15:14:52 +0100 Subject: [PATCH 1/3] minor: remove WIP badge from V1 secrets --- client/src/features/projectsV2/shared/WipBadge.tsx | 2 +- client/src/features/secrets/Secrets.tsx | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/src/features/projectsV2/shared/WipBadge.tsx b/client/src/features/projectsV2/shared/WipBadge.tsx index 8e6b78be0f..3bf403cd3c 100644 --- a/client/src/features/projectsV2/shared/WipBadge.tsx +++ b/client/src/features/projectsV2/shared/WipBadge.tsx @@ -29,7 +29,7 @@ interface WipBadeProps { export default function WipBadge({ className, - children = "2 .0 Early access", + children = "Work in progress", tooltip = "The platform is stable, but some core features are still being developed and will be added soon.", }: WipBadeProps) { const ref = useRef(null); diff --git a/client/src/features/secrets/Secrets.tsx b/client/src/features/secrets/Secrets.tsx index 1ec0656a03..33a0bd28e2 100644 --- a/client/src/features/secrets/Secrets.tsx +++ b/client/src/features/secrets/Secrets.tsx @@ -87,10 +87,7 @@ export default function Secrets() {
-

User Secrets

-
- -
+

User Secrets

{!user.logged ? ( From 187b23a8f1d1d38f816a9e2e4e39509f0dd1c5f5 Mon Sep 17 00:00:00 2001 From: Chandrasekhar Ramakrishnan Date: Thu, 6 Feb 2025 15:14:08 +0100 Subject: [PATCH 2/3] refactor: update navbars for v2/legacy --- .../src/components/navbar/LoggedInNavBar.tsx | 21 +++++++++++++++++-- client/src/components/navbar/NavBarItems.tsx | 4 ++-- ...kToV1Button.tsx => LearnAboutV2Button.tsx} | 17 +++++++-------- client/src/features/rootV2/NavbarV2.tsx | 8 +------ client/src/features/secrets/Secrets.tsx | 1 - 5 files changed, 30 insertions(+), 21 deletions(-) rename client/src/features/projectsV2/shared/{BackToV1Button.tsx => LearnAboutV2Button.tsx} (77%) diff --git a/client/src/components/navbar/LoggedInNavBar.tsx b/client/src/components/navbar/LoggedInNavBar.tsx index b4c1b316b2..a0b7f093aa 100644 --- a/client/src/components/navbar/LoggedInNavBar.tsx +++ b/client/src/components/navbar/LoggedInNavBar.tsx @@ -20,8 +20,16 @@ import cx from "classnames"; import { useCallback, useContext, useState } from "react"; import { List, Search } from "react-bootstrap-icons"; import { Link } from "react-router"; -import { Collapse, Nav, NavItem, Navbar, NavbarToggler } from "reactstrap"; +import { + Badge, + Collapse, + Nav, + NavItem, + Navbar, + NavbarToggler, +} from "reactstrap"; import StatusBanner from "../../features/platform/components/StatusBanner"; +import LearnAboutV2Button from "../../features/projectsV2/shared/LearnAboutV2Button"; import { NavBarWarnings } from "../../features/landing/components/NavBar/NavBarWarnings"; import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; import AppContext from "../../utils/context/appContext"; @@ -57,8 +65,17 @@ export default function LoggedInNavBar() { to={ABSOLUTE_ROUTES.v1.root} className="navbar-brand me-2 pb-0 pt-0" > - Renku + Renku Legacy + + Legacy + + diff --git a/client/src/components/navbar/NavBarItems.tsx b/client/src/components/navbar/NavBarItems.tsx index 34751a11e8..a0b6ab9bef 100644 --- a/client/src/components/navbar/NavBarItems.tsx +++ b/client/src/components/navbar/NavBarItems.tsx @@ -352,7 +352,7 @@ export function RenkuToolbarItemUser({ - Back to Renku 1.0 + Go to Renku Legacy )} @@ -361,7 +361,7 @@ export function RenkuToolbarItemUser({ <> - Renku 2.0 Early access + Renku 2.0 )} diff --git a/client/src/features/projectsV2/shared/BackToV1Button.tsx b/client/src/features/projectsV2/shared/LearnAboutV2Button.tsx similarity index 77% rename from client/src/features/projectsV2/shared/BackToV1Button.tsx rename to client/src/features/projectsV2/shared/LearnAboutV2Button.tsx index 1ad888de93..df9a62f0e7 100644 --- a/client/src/features/projectsV2/shared/BackToV1Button.tsx +++ b/client/src/features/projectsV2/shared/LearnAboutV2Button.tsx @@ -17,28 +17,27 @@ */ import cx from "classnames"; -import { BoxArrowInLeft } from "react-bootstrap-icons"; -import { Link } from "react-router"; +import { ExternalLink } from "../../../components/ExternalLinks"; -interface BackToV1ButtonProps { +interface LearnAboutV2ButtonProps { outline?: boolean; color?: string; } -export default function BackToV1Button({ +export default function LearnAboutV2Button({ outline = false, color = "light", -}: BackToV1ButtonProps) { +}: LearnAboutV2ButtonProps) { return ( - - Back to Renku 1.0 - + Learn more about Renku 2.0 + ); } diff --git a/client/src/features/rootV2/NavbarV2.tsx b/client/src/features/rootV2/NavbarV2.tsx index d7fc6830f9..290a502d50 100644 --- a/client/src/features/rootV2/NavbarV2.tsx +++ b/client/src/features/rootV2/NavbarV2.tsx @@ -46,8 +46,6 @@ import useLocationHash from "../../utils/customHooks/useLocationHash.hook"; import { GROUP_CREATION_HASH } from "../groupsV2/new/createGroup.constants"; import StatusBanner from "../platform/components/StatusBanner"; import { PROJECT_CREATION_HASH } from "../projectsV2/new/createProjectV2.constants"; -import BackToV1Button from "../projectsV2/shared/BackToV1Button"; -import WipBadge from "../projectsV2/shared/WipBadge"; const RENKU_ALPHA_LOGO = "/static/public/img/logo.svg"; @@ -165,12 +163,8 @@ export default function NavbarV2() { data-cy="link-home" to={ABSOLUTE_ROUTES.v2.root} > - Renku v2 (beta) + Renku - - 2.0 Early access - -
diff --git a/client/src/features/secrets/Secrets.tsx b/client/src/features/secrets/Secrets.tsx index 33a0bd28e2..f60a477c06 100644 --- a/client/src/features/secrets/Secrets.tsx +++ b/client/src/features/secrets/Secrets.tsx @@ -24,7 +24,6 @@ import { Loader } from "../../components/Loader"; import LoginAlert from "../../components/loginAlert/LoginAlert"; import { User } from "../../model/renkuModels.types"; import useLegacySelector from "../../utils/customHooks/useLegacySelector.hook"; -import WipBadge from "../projectsV2/shared/WipBadge"; import GeneralSecretNew from "./GeneralSecretNew"; import SecretsList from "./SecretsList"; From f3be90bf19cf30ae5ac3f1a83a5326b500b2349c Mon Sep 17 00:00:00 2001 From: Chandrasekhar Ramakrishnan Date: Fri, 7 Feb 2025 11:56:18 +0100 Subject: [PATCH 3/3] feat: add v2 announcement banner on v1 dashboard --- .../components/navbar/AnnounceV2Banner.tsx | 47 +++ .../src/components/navbar/AnonymousNavBar.tsx | 19 +- .../components/navbar/Graphics/AnnounceV2.svg | 273 ++++++++++++++++++ .../src/components/navbar/LoggedInNavBar.tsx | 2 + client/src/components/navbar/NavBarItems.tsx | 2 +- client/src/features/dashboard/Dashboard.tsx | 18 ++ .../projectsV2/shared/LearnAboutV2Button.tsx | 19 +- client/src/features/rootV2/NavbarV2.tsx | 4 +- tests/cypress/e2e/dashboard.spec.ts | 57 ++++ tests/cypress/e2e/navV2.spec.ts | 13 +- tests/cypress/e2e/newSession.spec.ts | 4 +- 11 files changed, 442 insertions(+), 16 deletions(-) create mode 100644 client/src/components/navbar/AnnounceV2Banner.tsx create mode 100644 client/src/components/navbar/Graphics/AnnounceV2.svg diff --git a/client/src/components/navbar/AnnounceV2Banner.tsx b/client/src/components/navbar/AnnounceV2Banner.tsx new file mode 100644 index 0000000000..d711610c05 --- /dev/null +++ b/client/src/components/navbar/AnnounceV2Banner.tsx @@ -0,0 +1,47 @@ +import cx from "classnames"; +import { Link, useLocation } from "react-router"; + +import LearnAboutV2Button from "../../features/projectsV2/shared/LearnAboutV2Button"; +import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; +import AnnounceV2 from "./Graphics/AnnounceV2.svg"; + +export default function AnnounceV2Banner() { + const location = useLocation(); + if ( + location.pathname !== ABSOLUTE_ROUTES.v1.root && + location.pathname !== `${ABSOLUTE_ROUTES.v1.root}/` + ) + return; + return ( +
+
+ announcement for v2 +
+
+ Connecting data, code, compute, and{" "} + + people + + . +
+
+ + Explore Renku 2.0 + +
+
+ +
+
+ ); +} diff --git a/client/src/components/navbar/AnonymousNavBar.tsx b/client/src/components/navbar/AnonymousNavBar.tsx index bd0bdaa128..f2f4194051 100644 --- a/client/src/components/navbar/AnonymousNavBar.tsx +++ b/client/src/components/navbar/AnonymousNavBar.tsx @@ -20,14 +20,22 @@ import cx from "classnames"; import { useCallback, useContext, useState } from "react"; import { List, Search } from "react-bootstrap-icons"; import { Link } from "react-router"; -import { Collapse, Nav, NavItem, Navbar, NavbarToggler } from "reactstrap"; +import { + Badge, + Collapse, + Nav, + NavItem, + Navbar, + NavbarToggler, +} from "reactstrap"; import StatusBanner from "../../features/platform/components/StatusBanner"; +import LearnAboutV2Button from "../../features/projectsV2/shared/LearnAboutV2Button"; import { NavBarWarnings } from "../../features/landing/components/NavBar/NavBarWarnings"; import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; import AppContext from "../../utils/context/appContext"; -import { Url } from "../../utils/helpers/url"; import RenkuNavLinkV2 from "../RenkuNavLinkV2"; +import AnnounceV2Banner from "./AnnounceV2Banner"; import { RenkuToolbarHelpMenu, RenkuToolbarItemUser, @@ -67,11 +75,15 @@ export default function AnonymousNavBar() { > Renku + + Legacy + + @@ -121,6 +133,7 @@ export default function AnonymousNavBar() { + diff --git a/client/src/components/navbar/Graphics/AnnounceV2.svg b/client/src/components/navbar/Graphics/AnnounceV2.svg new file mode 100644 index 0000000000..188ecb9234 --- /dev/null +++ b/client/src/components/navbar/Graphics/AnnounceV2.svg @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/client/src/components/navbar/LoggedInNavBar.tsx b/client/src/components/navbar/LoggedInNavBar.tsx index a0b7f093aa..5768805351 100644 --- a/client/src/components/navbar/LoggedInNavBar.tsx +++ b/client/src/components/navbar/LoggedInNavBar.tsx @@ -34,6 +34,7 @@ import { NavBarWarnings } from "../../features/landing/components/NavBar/NavBarW import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; import AppContext from "../../utils/context/appContext"; import RenkuNavLinkV2 from "../RenkuNavLinkV2"; +import AnnounceV2Banner from "./AnnounceV2Banner"; import { RenkuToolbarGitLabMenu, RenkuToolbarHelpMenu, @@ -134,6 +135,7 @@ export default function LoggedInNavBar() { + diff --git a/client/src/components/navbar/NavBarItems.tsx b/client/src/components/navbar/NavBarItems.tsx index a0b6ab9bef..1e3176930f 100644 --- a/client/src/components/navbar/NavBarItems.tsx +++ b/client/src/components/navbar/NavBarItems.tsx @@ -361,7 +361,7 @@ export function RenkuToolbarItemUser({ <> - Renku 2.0 + Go to Renku 2.0 )} diff --git a/client/src/features/dashboard/Dashboard.tsx b/client/src/features/dashboard/Dashboard.tsx index 9008c5708b..917b655a0a 100644 --- a/client/src/features/dashboard/Dashboard.tsx +++ b/client/src/features/dashboard/Dashboard.tsx @@ -16,6 +16,7 @@ * limitations under the License. */ +import LoginAlert from "../../components/loginAlert/LoginAlert"; import { SshModal } from "../../components/ssh/ssh"; import useLegacySelector from "../../utils/customHooks/useLegacySelector.hook"; import DashboardMessage from "./components/DashboardMessage"; @@ -25,9 +26,26 @@ import { ProjectsDashboard } from "./components/ProjectsDashboard"; import "./Dashboard.scss"; +function LoggedOutDashboard() { + return ( +
+ +
+ +
+
+ ); +} + export default function Dashboard() { const user = useLegacySelector((state) => state.stateModel.user); + if (user == null || user.data == null || user.data.name == null) + return ; + return (

Renku Dashboard - {user.data.name}

diff --git a/client/src/features/projectsV2/shared/LearnAboutV2Button.tsx b/client/src/features/projectsV2/shared/LearnAboutV2Button.tsx index df9a62f0e7..5575630c02 100644 --- a/client/src/features/projectsV2/shared/LearnAboutV2Button.tsx +++ b/client/src/features/projectsV2/shared/LearnAboutV2Button.tsx @@ -20,24 +20,29 @@ import cx from "classnames"; import { ExternalLink } from "../../../components/ExternalLinks"; interface LearnAboutV2ButtonProps { - outline?: boolean; + children?: React.ReactNode; color?: string; + outline?: boolean; } export default function LearnAboutV2Button({ - outline = false, + children = "Learn more", color = "light", + outline = false, }: LearnAboutV2ButtonProps) { return ( - Learn more about Renku 2.0 + {children} ); } diff --git a/client/src/features/rootV2/NavbarV2.tsx b/client/src/features/rootV2/NavbarV2.tsx index 290a502d50..2d24b686a2 100644 --- a/client/src/features/rootV2/NavbarV2.tsx +++ b/client/src/features/rootV2/NavbarV2.tsx @@ -47,7 +47,7 @@ import { GROUP_CREATION_HASH } from "../groupsV2/new/createGroup.constants"; import StatusBanner from "../platform/components/StatusBanner"; import { PROJECT_CREATION_HASH } from "../projectsV2/new/createProjectV2.constants"; -const RENKU_ALPHA_LOGO = "/static/public/img/logo.svg"; +const RENKU_LOGO = "/static/public/img/logo.svg"; function NavbarItemPlus() { const [isOpen, setIsOpen] = useState(false); @@ -163,7 +163,7 @@ export default function NavbarV2() { data-cy="link-home" to={ABSOLUTE_ROUTES.v2.root} > - Renku + Renku
diff --git a/tests/cypress/e2e/dashboard.spec.ts b/tests/cypress/e2e/dashboard.spec.ts index a99831c192..a5d737e1ae 100644 --- a/tests/cypress/e2e/dashboard.spec.ts +++ b/tests/cypress/e2e/dashboard.spec.ts @@ -546,3 +546,60 @@ describe("Dashboard pins", () => { ); }); }); + +describe("announce v2 banner", () => { + beforeEach(() => { + fixtures.config().versions().userTest().userPreferences(); + }); + + it("v2 banner should be visible on the v1 dashboard", () => { + fixtures + .projects() + .entitySearch({ fixture: "kgSearch/emptySearch.json", total: 0 }) + .getLastVisitedProjects({ + fixture: "projects/empty-last-visited-projects.json", + }) + .noActiveProjects() + .sessionServersEmpty(); + + cy.visit("/v1"); + cy.wait("@getUser"); + cy.wait("@getDataServiceUser"); + cy.wait("@getEntities"); + cy.wait("@getLastVisitedProjects"); + cy.wait("@getNoActiveProjects"); + + cy.getDataCy("announce-v2-banner").should("be.visible"); + + // TODO -- go to search, banner should not be visible there + }); + + it("v2 banner should not be visible outside the v1 dashboard", () => { + fixtures + .projects() + .entitySearch({ fixture: "kgSearch/emptySearch.json", total: 0 }) + .getLastVisitedProjects({ + fixture: "projects/empty-last-visited-projects.json", + }) + .noActiveProjects() + .sessionServersEmpty(); + + cy.visit("/v1/search"); + cy.wait("@getUser"); + cy.wait("@getDataServiceUser"); + cy.wait("@getEntities"); + + cy.getDataCy("announce-v2-banner").should("not.exist"); + }); +}); + +describe("anonymous dashboard", () => { + beforeEach(() => { + fixtures.config().versions().userNone(); + }); + + it("user should be prompted to log in", () => { + cy.visit("/v1"); + cy.contains("to view the Renku legacy dashboard").should("be.visible"); + }); +}); diff --git a/tests/cypress/e2e/navV2.spec.ts b/tests/cypress/e2e/navV2.spec.ts index 31c7158ff9..18328594c3 100644 --- a/tests/cypress/e2e/navV2.spec.ts +++ b/tests/cypress/e2e/navV2.spec.ts @@ -18,7 +18,7 @@ import fixtures from "../support/renkulab-fixtures"; -describe("View v2 landing page", () => { +describe("View v2 nav bar", () => { beforeEach(() => { fixtures.config().versions().userTest(); cy.visit("/"); @@ -45,3 +45,14 @@ describe("View v2 landing page", () => { cy.contains("Create a new project").should("be.visible"); }); }); + +describe("View v1 nav bar", () => { + beforeEach(() => { + fixtures.config().versions().userTest(); + cy.visit("/v1"); + }); + + it("check for legacy information", () => { + cy.get(".badge.bg-warning").contains("Legacy").should("be.visible"); + }); +}); diff --git a/tests/cypress/e2e/newSession.spec.ts b/tests/cypress/e2e/newSession.spec.ts index 055c3c7ce5..e3caf5cac8 100644 --- a/tests/cypress/e2e/newSession.spec.ts +++ b/tests/cypress/e2e/newSession.spec.ts @@ -311,8 +311,8 @@ describe("launch sessions, outdated projects", () => { .contains("Update the project to start a session.") .should("be.visible"); cy.get("a.btn") - .should("have.attr", "href", "/projects/e2e/local-test-project/settings") .contains("Settings") + .should("have.attr", "href", "/projects/e2e/local-test-project/settings") .should("be.visible"); }); @@ -332,8 +332,8 @@ describe("launch sessions, outdated projects", () => { .contains("Changes are necessary to start a session.") .should("be.visible"); cy.get("a.btn") - .should("have.attr", "href", "/projects/e2e/local-test-project/settings") .contains("Settings") + .should("have.attr", "href", "/projects/e2e/local-test-project/settings") .should("be.visible"); });