From bf6550918c6ce8c36c723c04242fdc75e096d981 Mon Sep 17 00:00:00 2001 From: Alex Andreev Date: Mon, 19 Dec 2022 16:14:49 +0300 Subject: [PATCH] Fix helm chart readme load app crash (#6781) * Change request readme types to be AsyncResult Signed-off-by: Alex Andreev * Linter fix Signed-off-by: Alex Andreev Signed-off-by: Alex Andreev --- .../request-readme.injectable.ts | 3 +- ...tab-for-installing-helm-chart.test.ts.snap | 913 ++++++++++++++++++ ...installing-helm-chart-from-new-tab.test.ts | 10 +- ...dock-tab-for-installing-helm-chart.test.ts | 23 +- ...eadme-of-selected-helm-chart.injectable.ts | 4 +- 5 files changed, 947 insertions(+), 6 deletions(-) diff --git a/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts b/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts index 4314d68578..fb8eaafa10 100644 --- a/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts +++ b/src/common/k8s-api/endpoints/helm-charts.api/request-readme.injectable.ts @@ -3,12 +3,13 @@ * Licensed under MIT License. See LICENSE in root directory for more information. */ import { getInjectable } from "@ogre-tools/injectable"; +import type { AsyncResult } from "../../../utils/async-result"; import { urlBuilderFor } from "../../../utils/buildUrl"; import apiBaseInjectable from "../../api-base.injectable"; const requestReadmeEndpoint = urlBuilderFor("/v2/charts/:repo/:name/readme"); -export type RequestHelmChartReadme = (repo: string, name: string, version?: string) => Promise; +export type RequestHelmChartReadme = (repo: string, name: string, version?: string) => Promise>; const requestHelmChartReadmeInjectable = getInjectable({ id: "request-helm-chart-readme", diff --git a/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap b/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap index bdd6779b76..e949e6c3c6 100644 --- a/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap +++ b/src/features/helm-charts/installing-chart/__snapshots__/opening-dock-tab-for-installing-helm-chart.test.ts.snap @@ -4631,6 +4631,919 @@ exports[`opening dock tab for installing helm chart given application is started `; +exports[`opening dock tab for installing helm chart given application is started, when navigating to helm charts when charts resolve when opening details of a chart when chart versions resolve when readme resolves when selecting different version when readme rejects renders 1`] = ` + +
+
+
+