Skip to content

Commit

Permalink
cluster mode have implied cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
nir2002 committed Sep 28, 2023
1 parent 88ea89a commit 98e83cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { isNewerVersion } from "../../utils";
import { LatestChartVersion } from "../../API/interfaces";
import useNavigateWithSearchParams from "../../hooks/useNavigateWithSearchParams";
import { useParams } from "react-router-dom";
import { useAppContext } from "../../context/AppContext";

type InstalledPackageCardProps = {
release: Release;
Expand All @@ -25,6 +26,7 @@ export default function InstalledPackageCard({
release,
}: InstalledPackageCardProps) {
const navigate = useNavigateWithSearchParams();
const { clusterMode } = useAppContext();

const { context: selectedCluster } = useParams();
const [isMouseOver, setIsMouseOver] = useState(false);
Expand Down Expand Up @@ -62,7 +64,7 @@ export default function InstalledPackageCard({
const handleOnClick = () => {
const { name, namespace } = release;
navigate(
`/${selectedCluster}/${namespace}/${name}/installed/revision/${release.revision}`,
`/${!clusterMode ? `${selectedCluster}/`: ""}${namespace}/${name}/installed/revision/${release.revision}`,
{ state: release }
);
};
Expand Down
10 changes: 7 additions & 3 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1461,10 +1461,10 @@
resolved "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz"
integrity sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==

"@esbuild/darwin-arm64@0.17.19":
"@esbuild/darwin-x64@0.17.19":
version "0.17.19"
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz"
integrity sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==
resolved "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz"
integrity sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==

"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
version "4.4.0"
Expand Down Expand Up @@ -5621,6 +5621,10 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@^2.3.2, fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==

function-bind@^1.1.1:
version "1.1.1"
Expand Down

0 comments on commit 98e83cc

Please sign in to comment.