From 85bc0089f0fbd4b6a1f7dddfe33a516fa1ba4bca Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Mon, 16 Nov 2020 13:58:25 +0000 Subject: [PATCH 1/5] Prevent password show/hide icon from receiving focus --- .../src/core/show-hide-button/show-hide-button.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/packages/core/src/core/show-hide-button/show-hide-button.component.html b/src/frontend/packages/core/src/core/show-hide-button/show-hide-button.component.html index 7dfb234302..799384cec7 100644 --- a/src/frontend/packages/core/src/core/show-hide-button/show-hide-button.component.html +++ b/src/frontend/packages/core/src/core/show-hide-button/show-hide-button.component.html @@ -1,4 +1,4 @@ - \ No newline at end of file From 42837549969699b50ec54a6912f81067866d55b2 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Mon, 16 Nov 2020 14:24:15 +0000 Subject: [PATCH 2/5] Fix lint issues --- .../card-cf-recent-apps.component.ts | 4 ++-- .../compact-app-card.component.ts | 4 ++-- .../home/cfhome-card/cfhome-card.component.ts | 18 ++++++++---------- .../core/src/features/home/home.types.ts | 5 ++--- .../favorites-side-panel.component.ts | 2 +- .../home-page-endpoint-card.component.spec.ts | 2 +- .../home-page-endpoint-card.component.ts | 18 +++++++++--------- .../features/home/home/home-page.component.ts | 12 ++++++------ .../home/kubernetes-home-card.component.ts | 8 ++++---- .../store/src/user-favorite-manager.ts | 4 ++-- 10 files changed, 37 insertions(+), 40 deletions(-) diff --git a/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/card-cf-recent-apps.component.ts b/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/card-cf-recent-apps.component.ts index bd5bfa11db..69179fc0f4 100644 --- a/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/card-cf-recent-apps.component.ts +++ b/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/card-cf-recent-apps.component.ts @@ -61,7 +61,7 @@ export class CardCfRecentAppsComponent implements OnInit { if (!this.allApps$) { this.allApps$ = this.appsPagObs.entities$; this.loading$ = this.appsPagObs.fetchingEntities$; - this.hasEntities$ = this.appsPagObs.hasEntities$ + this.hasEntities$ = this.appsPagObs.hasEntities$; } else { this.hasEntities$ = of(true); } @@ -84,7 +84,7 @@ export class CardCfRecentAppsComponent implements OnInit { } private fetchAppStats(recentApps: APIResource[]) { - if(!this.noStats) { + if (!this.noStats) { recentApps.forEach(app => { if (app.entity.state === 'STARTED') { cfEntityCatalog.appStats.api.getMultiple(app.metadata.guid, this.endpoint); diff --git a/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/compact-app-card/compact-app-card.component.ts b/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/compact-app-card/compact-app-card.component.ts index 6e3aef7245..c78c819bd1 100644 --- a/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/compact-app-card/compact-app-card.component.ts +++ b/src/frontend/packages/cloud-foundry/src/features/home/card-cf-recent-apps/compact-app-card/compact-app-card.component.ts @@ -39,7 +39,7 @@ export class CompactAppCardComponent implements OnInit { ) { } ngOnInit() { - if(this.activeRouteCfOrgSpace) { + if (this.activeRouteCfOrgSpace) { this.bcType = this.setBreadcrumbType(this.activeRouteCfOrgSpace); if (!this.endpoint) { this.endpoint = this.activeRouteCfOrgSpace.cfGuid; @@ -47,7 +47,7 @@ export class CompactAppCardComponent implements OnInit { } if (!this.app) { - return + return; } const initState = this.appStateService.get(this.app.entity, null); diff --git a/src/frontend/packages/cloud-foundry/src/features/home/cfhome-card/cfhome-card.component.ts b/src/frontend/packages/cloud-foundry/src/features/home/cfhome-card/cfhome-card.component.ts index 4c522f6129..1220e852b9 100644 --- a/src/frontend/packages/cloud-foundry/src/features/home/cfhome-card/cfhome-card.component.ts +++ b/src/frontend/packages/cloud-foundry/src/features/home/cfhome-card/cfhome-card.component.ts @@ -42,18 +42,18 @@ import { ITileConfig } from './../../../../../core/src/shared/components/tile/ti }) export class CFHomeCardComponent implements HomePageEndpointCard { - _layout: HomePageCardLayout; + pLayout: HomePageCardLayout; get layout(): HomePageCardLayout { - return this._layout; + return this.pLayout; } @Input() set layout(value: HomePageCardLayout) { if (value) { - this._layout = value; + this.pLayout = value; } this.updateLayout(); - }; + } @Input() set endpoint(value: EndpointModel) { this.guid = value.guid; @@ -89,7 +89,7 @@ export class CFHomeCardComponent implements HomePageEndpointCard { appDeploySourceTypes: ApplicationDeploySourceTypes, ) { // Set a default layout - this._layout = new HomePageCardLayout(1, 1); + this.pLayout = new HomePageCardLayout(1, 1); // Get source types for if we are showing tiles to deploy an application this.sourceTypes = appDeploySourceTypes.getTypes(); @@ -110,7 +110,7 @@ export class CFHomeCardComponent implements HomePageEndpointCard { if (tile) { const query = { [BASE_REDIRECT_QUERY]: `applications/new/${this.guid}`, - [AUTO_SELECT_CF_URL_PARAM]:this.guid + [AUTO_SELECT_CF_URL_PARAM]: this.guid }; if (tile.data.subType) { query[AUTO_SELECT_DEPLOY_TYPE_URL_PARAM] = tile.data.subType; @@ -126,7 +126,7 @@ export class CFHomeCardComponent implements HomePageEndpointCard { this.appCount$ = CloudFoundryEndpointService.fetchAppCount(this.store, this.pmf, this.guid); this.orgCount$ = CloudFoundryEndpointService.fetchOrgCount(this.store, this.pmf, this.guid); - this.appLink = () => goToAppWall(this.store, this.guid);; + this.appLink = () => goToAppWall(this.store, this.guid); const appsPagObs = cfEntityCatalog.application.store.getPaginationService(this.guid); @@ -192,8 +192,6 @@ export class CFHomeCardComponent implements HomePageEndpointCard { } private restrictApps(apps: APIResource[]): APIResource[] { - return !apps ? [] :[...apps.sort(appDataSort).slice(0, this.recentAppsRows)]; + return !apps ? [] : [...apps.sort(appDataSort).slice(0, this.recentAppsRows)]; } - } - diff --git a/src/frontend/packages/core/src/features/home/home.types.ts b/src/frontend/packages/core/src/features/home/home.types.ts index 2e60d1afc8..aeae4b9892 100644 --- a/src/frontend/packages/core/src/features/home/home.types.ts +++ b/src/frontend/packages/core/src/features/home/home.types.ts @@ -23,7 +23,6 @@ export abstract class HomePageEndpointCard { } export interface LinkMetadata { - favs: IHydrationResults[], - shortcuts: HomeCardShortcut[] + favs: IHydrationResults[]; + shortcuts: HomeCardShortcut[]; } - diff --git a/src/frontend/packages/core/src/features/home/home/favorites-side-panel/favorites-side-panel.component.ts b/src/frontend/packages/core/src/features/home/home/favorites-side-panel/favorites-side-panel.component.ts index cc886ef1dd..76dde68721 100644 --- a/src/frontend/packages/core/src/features/home/home/favorites-side-panel/favorites-side-panel.component.ts +++ b/src/frontend/packages/core/src/features/home/home/favorites-side-panel/favorites-side-panel.component.ts @@ -14,7 +14,7 @@ export class FavoritesSidePanelComponent implements PreviewableComponent { name: string; setProps(props: { [key: string]: any; }): void { - this.favorites$ = props.favorites$ + this.favorites$ = props.favorites$; this.name = props.endpoint.name; } diff --git a/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.spec.ts b/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.spec.ts index eb75b1541c..3a027f1a0a 100644 --- a/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.spec.ts +++ b/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.spec.ts @@ -42,7 +42,7 @@ describe('HomePageEndpointCardComponent', () => { afterEach(() => { component.ngOnDestroy(); - }) + }); it('should create', () => { expect(component).toBeTruthy(); diff --git a/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.ts b/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.ts index 7e2134242e..3d7bd6b162 100644 --- a/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.ts +++ b/src/frontend/packages/core/src/features/home/home/home-page-endpoint-card/home-page-endpoint-card.component.ts @@ -40,22 +40,22 @@ const MAX_LINKS = 5; }) export class HomePageEndpointCardComponent implements OnInit, OnDestroy, AfterViewInit { - @ViewChild('customCard', {read:ViewContainerRef}) customCard: ViewContainerRef; + @ViewChild('customCard', {read: ViewContainerRef}) customCard: ViewContainerRef; @Input() endpoint: EndpointModel; - _layout: HomePageCardLayout; + pLayout: HomePageCardLayout; get layout(): HomePageCardLayout { - return this._layout; + return this.pLayout; } @Input() set layout(value: HomePageCardLayout) { if (value) { - this._layout = value; + this.pLayout = value; } this.updateLayout(); - }; + } @Output() loaded = new EventEmitter(); @@ -102,7 +102,7 @@ export class HomePageEndpointCardComponent implements OnInit, OnDestroy, AfterVi ngAfterViewInit() { // Dynamically load the component for the Home Card for this endopoint - const endpointEntity = entityCatalog.getEndpoint(this.endpoint.cnsi_type, this.endpoint.sub_type) + const endpointEntity = entityCatalog.getEndpoint(this.endpoint.cnsi_type, this.endpoint.sub_type); if (endpointEntity && endpointEntity.definition.homeCard && endpointEntity.definition.homeCard.component) { this.createCard(endpointEntity); } else { @@ -116,7 +116,7 @@ export class HomePageEndpointCardComponent implements OnInit, OnDestroy, AfterVi map(f => f.map(item => this.userFavoriteManager.mapToHydrated(item))) ); - this.entity = entityCatalog.getEndpoint(this.endpoint.cnsi_type, this.endpoint.sub_type) + this.entity = entityCatalog.getEndpoint(this.endpoint.cnsi_type, this.endpoint.sub_type); if (this.entity) { this.definition = this.entity.definition; this.favorite = this.favoritesConfigMapper.getFavoriteEndpointFromEntity(this.endpoint); @@ -187,7 +187,7 @@ export class HomePageEndpointCardComponent implements OnInit, OnDestroy, AfterVi public updateLayout() { this.layout$.next(this.layout); if (this.ref && this.ref.instance) { - this.ref.instance.layout = this._layout; + this.ref.instance.layout = this.pLayout; } } @@ -196,7 +196,7 @@ export class HomePageEndpointCardComponent implements OnInit, OnDestroy, AfterVi const component = await endpointEntity.definition.homeCard.component(this.compiler, this.injector); this.ref = this.customCard.createComponent(component); this.ref.instance.endpoint = this.endpoint; - this.ref.instance.layout = this._layout; + this.ref.instance.layout = this.pLayout; this.loadCardIfReady(); } diff --git a/src/frontend/packages/core/src/features/home/home/home-page.component.ts b/src/frontend/packages/core/src/features/home/home/home-page.component.ts index 8b44305217..8c9bf1a21e 100644 --- a/src/frontend/packages/core/src/features/home/home/home-page.component.ts +++ b/src/frontend/packages/core/src/features/home/home/home-page.component.ts @@ -123,7 +123,7 @@ export class HomePageComponent implements AfterViewInit, OnInit, OnDestroy { ).subscribe(id => { const selected = this.layouts.find(hpcl => hpcl && hpcl.id === id) || this.layouts[0]; this.onChangeLayout(selected); - }) + }); } ngOnInit() { @@ -152,10 +152,10 @@ export class HomePageComponent implements AfterViewInit, OnInit, OnDestroy { } else { remaining.push(index); } - }; + } this.processCardsToLoad(); this.notLoadedCardIndices = remaining; - }) + }); } processCardsToLoad() { @@ -184,7 +184,7 @@ export class HomePageComponent implements AfterViewInit, OnInit, OnDestroy { setCardsToLoad(cards: any[]) { this.notLoadedCardIndices = []; - for(let i=0;i< cards.length; i++) { + for (let i = 0; i < cards.length; i++) { this.notLoadedCardIndices.push(i); } setTimeout(() => this.checkCardsInView(), 1); @@ -263,7 +263,7 @@ export class HomePageComponent implements AfterViewInit, OnInit, OnDestroy { processed[ep.guid] = true; result.push(ep); } - }) + }); // Filter out the disconnected ones return result.filter(ep => ep.connectionStatus === 'connected'); @@ -277,7 +277,7 @@ export class HomePageComponent implements AfterViewInit, OnInit, OnDestroy { return !!defn.definition.homeCard; })), map(eps => { - switch(eps.length) { + switch (eps.length) { case 1: return this.getLayout(1, 1); case 2: diff --git a/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.ts b/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.ts index 1d4926219c..2279a142cb 100644 --- a/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.ts +++ b/src/frontend/packages/kubernetes/src/kubernetes/home/kubernetes-home-card.component.ts @@ -17,17 +17,17 @@ export class KubernetesHomeCardComponent implements OnInit { @Input() endpoint: EndpointModel; - _layout: HomePageCardLayout; + pLayout: HomePageCardLayout; get layout(): HomePageCardLayout { - return this._layout; + return this.pLayout; } @Input() set layout(value: HomePageCardLayout) { if (value) { - this._layout = value; + this.pLayout = value; } - }; + } public shortcuts: HomeCardShortcut[]; diff --git a/src/frontend/packages/store/src/user-favorite-manager.ts b/src/frontend/packages/store/src/user-favorite-manager.ts index 030ff5dc5b..201937a283 100644 --- a/src/frontend/packages/store/src/user-favorite-manager.ts +++ b/src/frontend/packages/store/src/user-favorite-manager.ts @@ -142,10 +142,10 @@ export class UserFavoriteManager { if (f.endpointId === endpointID && f.entityId) { result.push(f); } - }) + }); return result; }) - ) + ); } public getEndpointIDFromFavoriteID(id: string): string { From 0b8a076dc2431d9163ccd6be1af8aed80e212774 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Mon, 16 Nov 2020 15:40:49 +0000 Subject: [PATCH 3/5] Clicking on a helm repository endpoint should fitler to show it's charts only --- .../login/login-page/login-page.component.ts | 2 +- .../kubernetes/src/helm/helm-entity-generator.ts | 2 +- .../list-types/monocular-charts-data-source.ts | 9 ++++++++- .../catalog-tab/catalog-tab.component.spec.ts | 9 ++++++++- .../tabs/catalog-tab/catalog-tab.component.ts | 16 +++++++++++----- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/frontend/packages/core/src/features/login/login-page/login-page.component.ts b/src/frontend/packages/core/src/features/login/login-page/login-page.component.ts index 8c9ab8e75f..385c1c9f9f 100644 --- a/src/frontend/packages/core/src/features/login/login-page/login-page.component.ts +++ b/src/frontend/packages/core/src/features/login/login-page/login-page.component.ts @@ -110,7 +110,7 @@ export class LoginPageComponent implements OnInit, OnDestroy { this.subscription.unsubscribe(); // Ensure to unsub otherwise GoToState gets caught in loop } if (this.redirect) { - this.store.dispatch(new RouterNav({ path: [this.redirect.path], query: this.redirect.queryParams || {} })); + this.store.dispatch(new RouterNav({ path: [decodeURI(this.redirect.path)], query: this.redirect.queryParams || {} })); } else { this.store.dispatch(new RouterNav({ path: ['/'] }, null)); } diff --git a/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts b/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts index 74c42fc2d0..c6c6d52c08 100644 --- a/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts +++ b/src/frontend/packages/kubernetes/src/helm/helm-entity-generator.ts @@ -107,7 +107,7 @@ export function generateHelmEntities(): StratosBaseCatalogEntity[] { function generateEndpointEntity(endpointDefinition: StratosEndpointExtensionDefinition) { helmEntityCatalog.endpoint = new StratosCatalogEndpointEntity( endpointDefinition, - metadata => `/monocular/charts`, + (metadata) => `/monocular/charts/${metadata.name}`, ); return helmEntityCatalog.endpoint; } diff --git a/src/frontend/packages/kubernetes/src/helm/list-types/monocular-charts-data-source.ts b/src/frontend/packages/kubernetes/src/helm/list-types/monocular-charts-data-source.ts index aca889afc4..07cd897afd 100644 --- a/src/frontend/packages/kubernetes/src/helm/list-types/monocular-charts-data-source.ts +++ b/src/frontend/packages/kubernetes/src/helm/list-types/monocular-charts-data-source.ts @@ -26,7 +26,14 @@ export class MonocularChartsDataSource extends ListDataSource { { type: 'filter', field: 'name' }, (entities: MonocularChart[], paginationState: PaginationEntityState) => { const repository = paginationState.clientPagination.filter.items.repository; - return repository ? entities.filter(e => repository === e.attributes.repo.name) : entities; + const isHub = repository === 'Artifact Hub'; + if (!repository) { + return entities; + } else if (isHub) { + return entities.filter(e => !!e.monocularEndpointId); + } else { + return entities.filter(e => repository === e.attributes.repo.name); + } } ] }); diff --git a/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.spec.ts b/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.spec.ts index 8459759127..37cef3dee7 100644 --- a/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.spec.ts +++ b/src/frontend/packages/kubernetes/src/helm/tabs/catalog-tab/catalog-tab.component.spec.ts @@ -1,4 +1,5 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { ActivatedRoute } from '@angular/router'; import { HelmBaseTestModules } from '../../helm-testing.module'; import { MockChartService } from '../../monocular/shared/services/chart.service.mock'; @@ -15,7 +16,13 @@ describe('CatalogTabComponent', () => { ...HelmBaseTestModules ], declarations: [CatalogTabComponent], - providers: [{ provide: ChartsService, useValue: new MockChartService() }] + providers: [ + { provide: ChartsService, useValue: new MockChartService() }, + { provide: ActivatedRoute, useValue: { + snapshot: { params: {}, queryParams: {} } + } + } + ] }) .compileComponents(); })); 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 9516d67640..d8c0943981 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,4 +1,5 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; import { distinctUntilChanged, filter, first, map, startWith } from 'rxjs/operators'; @@ -23,7 +24,7 @@ const REPO_FILTER_NAME = 'repository'; }] }) -export class CatalogTabComponent { +export class CatalogTabComponent implements OnInit { public repos$: Observable<{ artifactHubRepos: string[], @@ -38,8 +39,7 @@ export class CatalogTabComponent { public collapsed = true; public hide = true; - constructor(private store: Store) { - + constructor(private store: Store, private activatedRoute: ActivatedRoute) { // Determine the starting state of the filter by repo section stratosEntityCatalog.endpoint.store.getAll.getPaginationService().entities$.pipe( filter(entities => !!entities), @@ -96,12 +96,18 @@ export class CatalogTabComponent { }); } + ngOnInit() { + const { repo } = this.activatedRoute.snapshot.params; + if (repo.length > 0) { + setTimeout(() => this.filterCharts(repo), 0); + } + } + /** * Filter the charts list for those in the given repo */ public filterCharts(repoName: string) { this.filteredRepo = repoName; - helmEntityCatalog.chart.store.getPaginationMonitor().pagination$.pipe(first()).subscribe(pagination => { const action = helmEntityCatalog.chart.actions.getMultiple(); this.store.dispatch(new SetClientFilter(action, action.paginationKey, { From 303677e5f95c1f8c0b0c4d30cb169f70abef6335 Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Tue, 17 Nov 2020 07:32:22 +0000 Subject: [PATCH 4/5] Fix for unit test --- .../src/helm/tabs/catalog-tab/catalog-tab.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 d8c0943981..451abf794b 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 @@ -98,7 +98,7 @@ export class CatalogTabComponent implements OnInit { ngOnInit() { const { repo } = this.activatedRoute.snapshot.params; - if (repo.length > 0) { + if (repo && repo.length > 0) { setTimeout(() => this.filterCharts(repo), 0); } } From 5e1fa06634ee40ec59ffc87e0eca072372e7ceaa Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Mon, 23 Nov 2020 11:42:55 +0000 Subject: [PATCH 5/5] Address PR feedback --- .../tabs/catalog-tab/catalog-tab.component.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) 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 451abf794b..a2b313fe11 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,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; import { BehaviorSubject, combineLatest, Observable } from 'rxjs'; @@ -24,7 +24,7 @@ const REPO_FILTER_NAME = 'repository'; }] }) -export class CatalogTabComponent implements OnInit { +export class CatalogTabComponent { public repos$: Observable<{ artifactHubRepos: string[], @@ -92,17 +92,15 @@ export class CatalogTabComponent implements OnInit { helmEntityCatalog.chart.store.getPaginationMonitor().pagination$.pipe( first() ).subscribe(pagination => { - this.filteredRepo = pagination.clientPagination?.filter?.items?.[REPO_FILTER_NAME]; + const { repo } = this.activatedRoute.snapshot.params; + if (repo && repo.length > 0) { + this.filterCharts(repo); + } else { + this.filteredRepo = pagination.clientPagination?.filter?.items?.[REPO_FILTER_NAME]; + } }); } - ngOnInit() { - const { repo } = this.activatedRoute.snapshot.params; - if (repo && repo.length > 0) { - setTimeout(() => this.filterCharts(repo), 0); - } - } - /** * Filter the charts list for those in the given repo */