This commit is contained in:
Andrei Pohilko
2025-07-07 14:04:09 +01:00
parent f22c84c288
commit 2da8f23285
6 changed files with 25 additions and 28 deletions

View File

@@ -15,7 +15,7 @@ import { useGetLatestVersion } from "../../API/releases";
import { isNewerVersion } from "../../utils"; import { isNewerVersion } from "../../utils";
import { LatestChartVersion } from "../../API/interfaces"; import { LatestChartVersion } from "../../API/interfaces";
import useNavigateWithSearchParams from "../../hooks/useNavigateWithSearchParams"; import useNavigateWithSearchParams from "../../hooks/useNavigateWithSearchParams";
import {useInView} from "react-intersection-observer"; import { useInView } from "react-intersection-observer";
type InstalledPackageCardProps = { type InstalledPackageCardProps = {
release: Release; release: Release;
@@ -27,7 +27,7 @@ export default function InstalledPackageCard({
const navigate = useNavigateWithSearchParams(); const navigate = useNavigateWithSearchParams();
const [isMouseOver, setIsMouseOver] = useState(false); const [isMouseOver, setIsMouseOver] = useState(false);
const {ref, inView} = useInView({ const { ref, inView } = useInView({
threshold: 0.3, threshold: 0.3,
triggerOnce: true, triggerOnce: true,
}); });

View File

@@ -39,7 +39,8 @@ export default function ErrorModal({
and support.{" "} and support.{" "}
<a <a
href="https://www.komodor.com/helm-dash/?utm_campaign=Helm%20Dashboard%20%7C%20CTA&utm_source=helm-dash&utm_medium=cta&utm_content=helm-dash" href="https://www.komodor.com/helm-dash/?utm_campaign=Helm%20Dashboard%20%7C%20CTA&utm_source=helm-dash&utm_medium=cta&utm_content=helm-dash"
target="_blank" rel="noreferrer" target="_blank"
rel="noreferrer"
> >
<span className="text-link-color underline">Sign up for free.</span> <span className="text-link-color underline">Sign up for free.</span>
</a> </a>

View File

@@ -17,9 +17,12 @@ export const GeneralDetails = ({
onReleaseNameInput: (chartName: string) => void; onReleaseNameInput: (chartName: string) => void;
}) => { }) => {
const [namespaceInputValue, setNamespaceInputValue] = useState(namespace); const [namespaceInputValue, setNamespaceInputValue] = useState(namespace);
const namespaceInputValueDebounced = useDebounce<string>(namespaceInputValue, 500); const namespaceInputValueDebounced = useDebounce<string>(
namespaceInputValue,
500
);
useEffect(() => { useEffect(() => {
onNamespaceInput(namespaceInputValueDebounced); onNamespaceInput(namespaceInputValueDebounced);
}, [namespaceInputValueDebounced, onNamespaceInput]); }, [namespaceInputValueDebounced, onNamespaceInput]);
const { context } = useParams(); const { context } = useParams();
const inputClassName = ` text-lg py-1 px-2 border border-1 border-gray-300 ${ const inputClassName = ` text-lg py-1 px-2 border border-1 border-gray-300 ${

View File

@@ -21,9 +21,7 @@ export default function RevisionsList({
const { namespace, chart } = useParams(); const { namespace, chart } = useParams();
const changeRelease = (newRevision: number) => { const changeRelease = (newRevision: number) => {
navigate( navigate(`/${namespace}/${chart}/installed/revision/${newRevision}`);
`/${namespace}/${chart}/installed/revision/${newRevision}`
);
}; };
return ( return (

View File

@@ -1,19 +1,19 @@
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
function useDebounce<T>(value: T, delay : number) { function useDebounce<T>(value: T, delay: number) {
const [debouncedValue, setDebouncedValue] = useState(value); const [debouncedValue, setDebouncedValue] = useState(value);
useEffect(() => { useEffect(() => {
const handler = setTimeout(() => { const handler = setTimeout(() => {
setDebouncedValue(value); setDebouncedValue(value);
}, delay); }, delay);
return () => { return () => {
clearTimeout(handler); clearTimeout(handler);
}; };
}, [value, delay]); }, [value, delay]);
return debouncedValue; return debouncedValue;
} }
export default useDebounce; export default useDebounce;

View File

@@ -4,11 +4,10 @@ import DropDown from "../components/common/DropDown";
import WatcherIcon from "../assets/k8s-watcher.svg"; import WatcherIcon from "../assets/k8s-watcher.svg";
import ShutDownButton from "../components/ShutDownButton"; import ShutDownButton from "../components/ShutDownButton";
import { import {
BsSlack,
BsGithub,
BsArrowRepeat, BsArrowRepeat,
BsBraces,
BsBoxArrowUpRight, BsBoxArrowUpRight,
BsBraces,
BsGithub,
} from "react-icons/bs"; } from "react-icons/bs";
import { useGetApplicationStatus } from "../API/other"; import { useGetApplicationStatus } from "../API/other";
import LinkWithSearchParams from "../components/LinkWithSearchParams"; import LinkWithSearchParams from "../components/LinkWithSearchParams";
@@ -25,10 +24,6 @@ export default function Header() {
const location = useLocation(); const location = useLocation();
const openSupportChat = () => {
window.open("https://app.slack.com/client/T03Q4H8PCRW", "_blank");
};
const openProjectPage = () => { const openProjectPage = () => {
window.open("https://github.com/komodorio/helm-dashboard", "_blank"); window.open("https://github.com/komodorio/helm-dashboard", "_blank");
}; };
@@ -118,7 +113,7 @@ export default function Header() {
]} ]}
/> />
</li> </li>
{"v"+statusData?.CurVer !== statusData?.LatestVer ? ( {"v" + statusData?.CurVer !== statusData?.LatestVer ? (
<li className="min-w-[130px]"> <li className="min-w-[130px]">
<a <a
href="https://github.com/komodorio/helm-dashboard/releases" href="https://github.com/komodorio/helm-dashboard/releases"