From 3c31f7cadde9eefa4c3e4f82255d39b6fb8dd9c6 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 c6815c4b93..a487672a92 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 { apiBaseInjectionToken } from "../../api-base"; 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 e9a5c74a65..c20be5467a 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`] = ` + +
+
+
+