From 7711058ce3a3f3c976c55f29513380821dd0b1a1 Mon Sep 17 00:00:00 2001 From: tomjose92 Date: Mon, 13 Oct 2025 22:25:13 +0530 Subject: [PATCH] chore: navigate to applications page with workspace context on click of All Apps icon or logo (#41298) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description Made changes to ensure that workspace id is also added to the /applications url when clicking on All Apps icon or logo from editor page. Fixes #`41296` ## Automation /ok-to-test tags="@tag.All" ### :mag: Cypress test results > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: > Commit: 73d0192dfaf32c350335a2fb6d57d2ad81c65413 > Cypress dashboard. > Tags: `@tag.All` > Spec: >
Mon, 13 Oct 2025 15:26:00 UTC ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No ## Summary by CodeRabbit * **New Features** * Navigation to Applications is now workspace-aware: the Back to Apps button (App Viewer) and the Appsmith link (Editor) route to the Applications page scoped to the selected workspace when present. * Ctrl/Cmd-click opens the workspace-scoped Applications page in a new tab. * Navigation updates dynamically when the current workspace changes. * Behavior for anonymous users remains unchanged. --- .../Navigation/components/BackToAppsButton.tsx | 15 ++++++++++++--- app/client/src/pages/Editor/AppsmithLink.tsx | 12 +++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/client/src/pages/AppViewer/Navigation/components/BackToAppsButton.tsx b/app/client/src/pages/AppViewer/Navigation/components/BackToAppsButton.tsx index 67b09e4357..5148b7ca53 100644 --- a/app/client/src/pages/AppViewer/Navigation/components/BackToAppsButton.tsx +++ b/app/client/src/pages/AppViewer/Navigation/components/BackToAppsButton.tsx @@ -14,6 +14,8 @@ import { getCurrentUser } from "selectors/usersSelectors"; import type { User } from "constants/userConstants"; import { ANONYMOUS_USERNAME } from "constants/userConstants"; import { Icon, Tooltip } from "@appsmith/ads"; +import { getCurrentWorkspaceId } from "ee/selectors/selectedWorkspaceSelectors"; +import { APPLICATIONS_URL } from "constants/routes"; interface BackToAppsButtonProps { currentApplicationDetails?: ApplicationPayload; @@ -44,11 +46,20 @@ const BackToAppsButton = (props: BackToAppsButtonProps) => { ); const history = useHistory(); const currentUser: User | undefined = useSelector(getCurrentUser); + const currentWorkspaceId = useSelector(getCurrentWorkspaceId); if (currentUser?.username === ANONYMOUS_USERNAME) { return null; } + const handleNavigation = () => { + const applicationsUrl = currentWorkspaceId + ? `${APPLICATIONS_URL}?workspaceId=${currentWorkspaceId}` + : APPLICATIONS_URL; + + history.push(applicationsUrl); + }; + return ( { insideSidebar={insideSidebar} isMinimal={isMinimal} navColorStyle={navColorStyle} - onClick={() => { - history.push("/applications"); - }} + onClick={handleNavigation} primaryColor={primaryColor} text={insideSidebar && !isMinimal && createMessage(ALL_APPS)} /> diff --git a/app/client/src/pages/Editor/AppsmithLink.tsx b/app/client/src/pages/Editor/AppsmithLink.tsx index 216cf98506..95ebd5bc19 100644 --- a/app/client/src/pages/Editor/AppsmithLink.tsx +++ b/app/client/src/pages/Editor/AppsmithLink.tsx @@ -7,6 +7,7 @@ import AppsmithLogo from "assets/images/appsmith_logo_square.png"; import history from "utils/history"; import { useSelector } from "react-redux"; import { getOrganizationConfig } from "ee/selectors/organizationSelectors"; +import { getCurrentWorkspaceId } from "ee/selectors/selectedWorkspaceSelectors"; export const StyledLink = styled((props) => { // we are removing non input related props before passing them in the components @@ -27,18 +28,23 @@ export const StyledLink = styled((props) => { export const AppsmithLink = () => { const organizationConfig = useSelector(getOrganizationConfig); + const currentWorkspaceId = useSelector(getCurrentWorkspaceId); const handleOnClick = useCallback( (e: React.MouseEvent) => { e.stopPropagation(); + const applicationsUrl = currentWorkspaceId + ? `${APPLICATIONS_URL}?workspaceId=${currentWorkspaceId}` + : APPLICATIONS_URL; + if (e.ctrlKey || e.metaKey) { - window.open(APPLICATIONS_URL, "_blank"); + window.open(applicationsUrl, "_blank"); } else { - history.push(APPLICATIONS_URL); + history.push(applicationsUrl); } }, - [], + [currentWorkspaceId], ); return (