Skip to content

Commit

Permalink
Merge pull request #863 from newswangerd/tagging-sadness
Browse files Browse the repository at this point in the history
Fix tagging issue on search page.
  • Loading branch information
Chris Houseknecht authored Jul 12, 2018
2 parents 45c5a6d + d4902f2 commit 0f93cbe
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions galaxyui/src/app/search/search-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const routes: Routes = [
{
path: 'search',
component: SearchComponent,
runGuardsAndResolvers: 'always',
resolve: {
cloudPlatforms: SearchCloudPlatformResolver,
content: SearchContentResolver,
Expand Down
14 changes: 13 additions & 1 deletion galaxyui/src/app/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -476,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']) {
Expand Down

0 comments on commit 0f93cbe

Please sign in to comment.