Skip to content
Snippets Groups Projects
Unverified Commit e2a5c605 authored by Art Lowel's avatar Art Lowel Committed by GitHub
Browse files

Merge pull request #236 from tdonohue/122_fix_collection_listing

Fix #122 : ensure collections are listed based on current community
parents 605c3524 46d9847a
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@
[logo]="(logoRDObs | async)?.payload"
[alternateText]="'Community Logo'">
</ds-comcol-page-logo>
<!-- Introductionary text -->
<!-- Introductory text -->
<ds-comcol-page-content
[content]="communityPayload.introductoryText"
[hasInnerHtml]="true">
......@@ -24,7 +24,7 @@
[content]="communityPayload.copyrightText"
[hasInnerHtml]="true">
</ds-comcol-page-content>
<ds-community-page-sub-collection-list></ds-community-page-sub-collection-list>
<ds-community-page-sub-collection-list [community]="communityPayload"></ds-community-page-sub-collection-list>
</div>
</div>
<ds-error *ngIf="communityRD?.hasFailed" message="{{'error.community' | translate}}"></ds-error>
......
......@@ -2,7 +2,7 @@
<div *ngIf="subCollectionsRD?.hasSucceeded" @fadeIn>
<h2>{{'community.sub-collection-list.head' | translate}}</h2>
<ul>
<li *ngFor="let collection of subCollectionsRD?.payload?.page">
<li *ngFor="let collection of subCollectionsRD?.payload">
<p>
<span class="lead"><a [routerLink]="['/collections', collection.id]">{{collection.name}}</a></span><br>
<span class="text-muted">{{collection.shortDescription}}</span>
......
import { Component, OnInit } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { CollectionDataService } from '../../core/data/collection-data.service';
import { PaginatedList } from '../../core/data/paginated-list';
import { RemoteData } from '../../core/data/remote-data';
import { Collection } from '../../core/shared/collection.model';
import { Community } from '../../core/shared/community.model';
import { fadeIn } from '../../shared/animations/fade';
......@@ -15,13 +14,10 @@ import { fadeIn } from '../../shared/animations/fade';
animations:[fadeIn]
})
export class CommunityPageSubCollectionListComponent implements OnInit {
subCollectionsRDObs: Observable<RemoteData<PaginatedList<Collection>>>;
constructor(private cds: CollectionDataService) {
}
@Input() community: Community;
subCollectionsRDObs: Observable<RemoteData<Collection[]>>;
ngOnInit(): void {
this.subCollectionsRDObs = this.cds.findAll();
this.subCollectionsRDObs = this.community.collections;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment