diff --git a/src/renderer/components/+namespaces/namespace-select.tsx b/src/renderer/components/+namespaces/namespace-select.tsx index 4fde4104c4..c69f7c0518 100644 --- a/src/renderer/components/+namespaces/namespace-select.tsx +++ b/src/renderer/components/+namespaces/namespace-select.tsx @@ -21,7 +21,7 @@ export type NamespaceSelectSort = (left: string, right: string) => number; export interface NamespaceSelectProps extends Omit, "options" | "value"> { showIcons?: boolean; sort?: NamespaceSelectSort; - value: string | null; + value: string | null | undefined; } interface Dependencies { diff --git a/src/renderer/components/dock/install-chart/view.tsx b/src/renderer/components/dock/install-chart/view.tsx index 0cfbe4b62b..a089a78f5a 100644 --- a/src/renderer/components/dock/install-chart/view.tsx +++ b/src/renderer/components/dock/install-chart/view.tsx @@ -30,6 +30,7 @@ import { Notifications } from "../../notifications"; import type { NavigateToHelmReleases } from "../../../../common/front-end-routing/routes/cluster/helm/releases/navigate-to-helm-releases.injectable"; import navigateToHelmReleasesInjectable from "../../../../common/front-end-routing/routes/cluster/helm/releases/navigate-to-helm-releases.injectable"; import assert from "assert"; +import type { SingleValue } from "react-select"; export interface InstallCharProps { tab: DockTab; @@ -87,9 +88,9 @@ class NonInjectedInstallChart extends Component this.props.installChartStore.setData(this.tabId, { ...this.chartData, ...data }); } - onVersionChange = (version: string | null) => { - if (version) { - this.save({ version, values: "" }); + onVersionChange = (option: SingleValue<{ version: string }>) => { + if (option) { + this.save({ ...option, values: "" }); this.props.installChartStore.loadValues(this.tabId); } }; @@ -103,9 +104,9 @@ class NonInjectedInstallChart extends Component this.error = error.toString(); }); - onNamespaceChange = (namespace: string | null) => { - if (namespace) { - this.save({ namespace }); + onNamespaceChange = (option: SingleValue<{ namespace: string }>) => { + if (option) { + this.save(option); } }; @@ -178,6 +179,8 @@ class NonInjectedInstallChart extends Component } const { repo, name, version, namespace, releaseName } = chartData; + const versionOptions = versions.map(version => ({ version })); + const selectedVersionOption = versionOptions.find(opt => opt.version === version); return (
@@ -190,8 +193,8 @@ class NonInjectedInstallChart extends Component Version