diff --git a/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.html b/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.html
index f89ef9ce0a..0843429c5c 100644
--- a/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.html
+++ b/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.html
@@ -2,18 +2,21 @@
Sorry, we couldn't find the chart
+
+ Sorry, we couldn't find the version information for this chart
+
-
-
+
diff --git a/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.ts b/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.ts
index 9ca80fd5d9..125f9ac710 100644
--- a/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.ts
+++ b/src/frontend/packages/kubernetes/src/helm/monocular/chart-details/chart-details.component.ts
@@ -1,6 +1,6 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Params } from '@angular/router';
-import { first } from 'rxjs/operators';
+import { finalize, first, switchMap, tap } from 'rxjs/operators';
import { Chart } from '../shared/models/chart';
import { ChartVersion } from '../shared/models/chart-version';
@@ -39,24 +39,30 @@ export class ChartDetailsComponent implements OnInit {
const chartName = params.chartName;
if (!!chartName) {
- this.chartsService.getChart(repo, chartName).pipe(first()).subscribe(chart => {
- clearTimeout(this.loadingDelay);
- this.loading = false;
- this.initing = false;
- this.chart = chart;
- this.chartSubTitle = chart.attributes.repo.name;
- if (getMonocularEndpoint(this.route, chart) !== stratosMonocularEndpointGuid) {
- this.chartSubTitle = 'Artifact Hub - ' + this.chartSubTitle;
- }
- const version = params.version || this.chart.relationships.latestChartVersion.data.version;
- this.chartsService.getVersion(repo, chartName, version).pipe(first())
- .subscribe(chartVersion => {
- this.currentVersion = chartVersion;
- this.titleVersion = this.currentVersion.attributes.app_version || '';
- this.updateMetaTags();
- this.iconUrl = this.chartsService.getChartIconURL(this.chart, chartVersion);
- });
- });
+ this.chartsService.getChart(repo, chartName).pipe(
+ first(),
+ switchMap(chart => {
+ clearTimeout(this.loadingDelay);
+ this.chart = chart;
+ this.chartSubTitle = chart.attributes.repo.name;
+ if (getMonocularEndpoint(this.route, chart) !== stratosMonocularEndpointGuid) {
+ this.chartSubTitle = 'Artifact Hub - ' + this.chartSubTitle;
+ }
+ const version = params.version || this.chart.relationships.latestChartVersion.data.version;
+ return this.chartsService.getVersion(repo, chartName, version).pipe(first());
+ }),
+ tap(chartVersion => {
+ this.currentVersion = chartVersion;
+ this.titleVersion = this.currentVersion.attributes.app_version || '';
+ this.updateMetaTags();
+ this.iconUrl = this.chartsService.getChartIconURL(this.chart, chartVersion);
+ }),
+ finalize(() => {
+ clearTimeout(this.loadingDelay);
+ this.loading = false;
+ this.initing = false;
+ })
+ ).subscribe();
}
});
}
diff --git a/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.ts b/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.ts
index a2b313fe11..654b23bf00 100644
--- a/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.ts
+++ b/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.ts
@@ -1,7 +1,7 @@
-import { Component } from '@angular/core';
+import { Component, OnDestroy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Store } from '@ngrx/store';
-import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
+import { BehaviorSubject, combineLatest, Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, filter, first, map, startWith } from 'rxjs/operators';
import { ListConfig } from '../../../../../core/src/shared/components/list/list.component.types';
@@ -24,7 +24,7 @@ const REPO_FILTER_NAME = 'repository';
}]
})
-export class CatalogTabComponent {
+export class CatalogTabComponent implements OnDestroy {
public repos$: Observable<{
artifactHubRepos: string[],
@@ -39,6 +39,9 @@ export class CatalogTabComponent {
public collapsed = true;
public hide = true;
+ private initStateSet = false;
+ private sub: Subscription;
+
constructor(private store: Store, private activatedRoute: ActivatedRoute) {
// Determine the starting state of the filter by repo section
stratosEntityCatalog.endpoint.store.getAll.getPaginationService().entities$.pipe(
@@ -89,15 +92,20 @@ export class CatalogTabComponent {
startWith(null)
);
- helmEntityCatalog.chart.store.getPaginationMonitor().pagination$.pipe(
- first()
- ).subscribe(pagination => {
- const { repo } = this.activatedRoute.snapshot.params;
- if (repo && repo.length > 0) {
- this.filterCharts(repo);
- } else {
- this.filteredRepo = pagination.clientPagination?.filter?.items?.[REPO_FILTER_NAME];
+ const { repo: repoFromRoute } = this.activatedRoute.snapshot.params;
+ const repoFromStore$ = helmEntityCatalog.chart.store.getPaginationMonitor().pagination$.pipe(
+ map(pagination => pagination.clientPagination?.filter?.items?.[REPO_FILTER_NAME])
+ );
+
+ // Set the initial state... and watch for changes (aka reset filters button)
+ this.sub = repoFromStore$.subscribe(repoFromStore => {
+ // Only apply repo from url on first load (and if we have one)
+ if (!this.initStateSet && repoFromRoute && repoFromRoute.length > 0) {
+ this.filterCharts(repoFromRoute);
+ } else if (this.filteredRepo !== repoFromStore) {
+ this.filteredRepo = repoFromStore;
}
+ this.initStateSet = true;
});
}
@@ -123,4 +131,10 @@ export class CatalogTabComponent {
public searchRepos(repoName: string) {
this.searchReposSub.next(repoName);
}
+
+ ngOnDestroy(): void {
+ if (this.sub) {
+ this.sub.unsubscribe();
+ }
+ }
}
diff --git a/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.html b/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.html
index bebe8b03a3..60e90d0c4c 100644
--- a/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.html
+++ b/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.html
@@ -1,18 +1,18 @@
-
+
-
+
-
+