From ab07a2ffe2463234b56adacbaf5509ffafb7fddd Mon Sep 17 00:00:00 2001 From: David Newswanger Date: Tue, 10 Jul 2018 15:36:26 -0400 Subject: [PATCH 1/2] Fix tagging issue on search page. --- galaxyui/src/app/search/search-routing.module.ts | 1 + galaxyui/src/app/search/search.component.ts | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/galaxyui/src/app/search/search-routing.module.ts b/galaxyui/src/app/search/search-routing.module.ts index bddd81047..5e43f9bcc 100644 --- a/galaxyui/src/app/search/search-routing.module.ts +++ b/galaxyui/src/app/search/search-routing.module.ts @@ -21,6 +21,7 @@ const routes: Routes = [ { path: 'search', component: SearchComponent, + runGuardsAndResolvers: 'always', resolve: { cloudPlatforms: SearchCloudPlatformResolver, content: SearchContentResolver, diff --git a/galaxyui/src/app/search/search.component.ts b/galaxyui/src/app/search/search.component.ts index a3c70623e..760073bac 100644 --- a/galaxyui/src/app/search/search.component.ts +++ b/galaxyui/src/app/search/search.component.ts @@ -188,6 +188,14 @@ export class SearchComponent implements OnInit, AfterViewInit { this.route.queryParams.subscribe(params => { this.route.data.subscribe( (data) => { + // This function is called each time the route updates, so + // the default values have to be reset + this.appliedFilters = []; + this.paginationConfig.pageNumber = 1; + this.pageNumber = 1; + this.sortParams = '&order_by=-relevance'; + this.setSortConfig(this.sortParams); + this.preparePlatforms(data.platforms); this.prepareContentTypes(data.contentTypes); this.prepareCloudPlatforms(data.cloudPlatforms); From d4902f2b24d4ac42700c673ca61c2131fcbde340 Mon Sep 17 00:00:00 2001 From: David Newswanger Date: Wed, 11 Jul 2018 14:12:30 -0400 Subject: [PATCH 2/2] Display dates as N/A when they are null --- galaxyui/src/app/search/search.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/galaxyui/src/app/search/search.component.ts b/galaxyui/src/app/search/search.component.ts index 760073bac..8969f5bcd 100644 --- a/galaxyui/src/app/search/search.component.ts +++ b/galaxyui/src/app/search/search.component.ts @@ -484,7 +484,11 @@ export class SearchComponent implements OnInit, AfterViewInit { private prepareContent(data: Content[], count: number) { data.forEach(item => { - item.imported = moment(item.imported).fromNow(); + if (item.imported === null) { + item.imported = 'NA'; + } else { + item.imported = moment(item.imported).fromNow(); + } item['repository_format'] = item.summary_fields['repository']['format']; item['avatar_url'] = item.summary_fields['namespace']['avatar_url'] || '/assets/avatar.png'; if (!item.summary_fields['namespace']['is_vendor']) {