1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Show helm details fetch errors in Notifications (#4905)

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-02-24 07:52:45 +03:00 committed by GitHub
parent 9d04c23290
commit 2bed34ccd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,7 @@ import { Badge } from "../badge";
import { Tooltip, withStyles } from "@material-ui/core"; import { Tooltip, withStyles } from "@material-ui/core";
import { withInjectables } from "@ogre-tools/injectable-react"; import { withInjectables } from "@ogre-tools/injectable-react";
import createInstallChartTabInjectable from "../dock/install-chart/create-install-chart-tab.injectable"; import createInstallChartTabInjectable from "../dock/install-chart/create-install-chart-tab.injectable";
import { Notifications } from "../notifications";
interface Props { interface Props {
chart: HelmChart; chart: HelmChart;
@ -40,7 +41,6 @@ class NonInjectedHelmChartDetails extends Component<Props & Dependencies> {
@observable chartVersions: HelmChart[]; @observable chartVersions: HelmChart[];
@observable selectedChart?: HelmChart; @observable selectedChart?: HelmChart;
@observable readme?: string; @observable readme?: string;
@observable error?: string;
private abortController?: AbortController; private abortController?: AbortController;
@ -67,7 +67,7 @@ class NonInjectedHelmChartDetails extends Component<Props & Dependencies> {
this.chartVersions = versions; this.chartVersions = versions;
this.selectedChart = versions[0]; this.selectedChart = versions[0];
} catch (error) { } catch (error) {
this.error = error; Notifications.error(error);
this.selectedChart = null; this.selectedChart = null;
} }
}, { }, {
@ -89,7 +89,7 @@ class NonInjectedHelmChartDetails extends Component<Props & Dependencies> {
this.readme = readme; this.readme = readme;
} catch (error) { } catch (error) {
this.error = error; Notifications.error(error);
} }
} }
@ -167,14 +167,6 @@ class NonInjectedHelmChartDetails extends Component<Props & Dependencies> {
} }
renderContent() { renderContent() {
if (this.error) {
return (
<div className="box grow">
<p className="error">{this.error}</p>
</div>
);
}
if (!this.selectedChart) { if (!this.selectedChart) {
return <Spinner center />; return <Spinner center />;
} }