diff --git a/app/client/src/pages/common/SearchBar/ApplicationSearchItem.tsx b/app/client/src/pages/common/SearchBar/ApplicationSearchItem.tsx
index 2a7d6e96856..5a9f54c57fd 100644
--- a/app/client/src/pages/common/SearchBar/ApplicationSearchItem.tsx
+++ b/app/client/src/pages/common/SearchBar/ApplicationSearchItem.tsx
@@ -22,10 +22,12 @@ const CircleAppIcon = styled(AppIcon)`
interface Props {
applicationsList: ApplicationPayload[] | undefined;
navigateToApplication: (id: string) => void;
+ selectedWorkspaceId: string;
}
const ApplicationSearchItem = (props: Props) => {
- const { applicationsList, navigateToApplication } = props;
+ const { applicationsList, navigateToApplication, selectedWorkspaceId } =
+ props;
if (!applicationsList || applicationsList?.length === 0) return null;
@@ -34,25 +36,29 @@ const ApplicationSearchItem = (props: Props) => {
Applications
- {applicationsList.map((application: ApplicationPayload) => (
- navigateToApplication(application.id)}
- >
-
-
- {application.name}
-
-
- ))}
+ {applicationsList.map((application: ApplicationPayload) => {
+ return (
+ application.workspaceId === selectedWorkspaceId && (
+ navigateToApplication(application.id)}
+ >
+
+
+ {application.name}
+
+
+ )
+ );
+ })}
);
};
diff --git a/app/client/src/pages/common/SearchBar/DesktopEntitySearchField.tsx b/app/client/src/pages/common/SearchBar/DesktopEntitySearchField.tsx
index 6533d2ec3fa..3715e1bddfe 100644
--- a/app/client/src/pages/common/SearchBar/DesktopEntitySearchField.tsx
+++ b/app/client/src/pages/common/SearchBar/DesktopEntitySearchField.tsx
@@ -52,6 +52,7 @@ const DesktopEntitySearchField = (props: any) => {
setIsDropdownOpen,
workflowsList,
workspacesList,
+ selectedWorkspaceId,
} = props;
const isHomePage = useRouteMatch("/applications")?.isExact;
@@ -97,6 +98,7 @@ const DesktopEntitySearchField = (props: any) => {
diff --git a/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx b/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx
index 319c4e5bfe0..f1fd227c2b3 100644
--- a/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx
+++ b/app/client/src/pages/common/SearchBar/EntitySearchBar.tsx
@@ -30,6 +30,7 @@ import {
getSearchedWorkflows,
getSearchedWorkspaces,
} from "ee/selectors/workspaceSelectors";
+import { getCurrentWorkspaceId } from "ee/selectors/selectedWorkspaceSelectors";
import DesktopEntitySearchField from "pages/common/SearchBar/DesktopEntitySearchField";
import MobileEntitySearchField from "pages/common/SearchBar/MobileEntitySearchField";
import { getPackagesList } from "ee/selectors/packageSelectors";
@@ -81,6 +82,7 @@ function EntitySearchBar(props: any) {
const location = useLocation();
const searchListContainerRef = useRef(null);
const searchInputRef = useRef(null);
+ const selectedWorkspaceId = useSelector(getCurrentWorkspaceId);
useEffect(() => {
if (searchInput.trim().length > 0) {
@@ -194,6 +196,7 @@ function EntitySearchBar(props: any) {
setShowMobileSearchBar={setShowMobileSearchBar}
workflowsList={workflowsList}
workspacesList={workspacesList}
+ selectedWorkspaceId={selectedWorkspaceId}
/>
) : (
<>
@@ -255,6 +258,7 @@ function EntitySearchBar(props: any) {
setIsDropdownOpen={setIsDropdownOpen}
workflowsList={workflowsList}
workspacesList={workspacesList}
+ selectedWorkspaceId={selectedWorkspaceId}
/>
))}
diff --git a/app/client/src/pages/common/SearchBar/MobileEntitySearchField.tsx b/app/client/src/pages/common/SearchBar/MobileEntitySearchField.tsx
index 6926469184f..4aa405b5722 100644
--- a/app/client/src/pages/common/SearchBar/MobileEntitySearchField.tsx
+++ b/app/client/src/pages/common/SearchBar/MobileEntitySearchField.tsx
@@ -51,6 +51,7 @@ function MobileEntitySearchField(props: any) {
setShowMobileSearchBar,
workflowsList,
workspacesList,
+ selectedWorkspaceId,
} = props;
const isHomePage = useRouteMatch("/applications")?.isExact;
@@ -106,6 +107,7 @@ function MobileEntitySearchField(props: any) {