added typedoc for toplevel communities component

This commit is contained in:
lotte
2019-03-28 13:29:30 +01:00
parent bf83f7f91b
commit 19636a16ad

View File

@@ -11,6 +11,9 @@ import { fadeInOut } from '../../shared/animations/fade';
import { PaginationComponentOptions } from '../../shared/pagination/pagination-component-options.model';
import { take } from 'rxjs/operators';
/**
* this component renders the Top-Level Community list
*/
@Component({
selector: 'ds-top-level-community-list',
styleUrls: ['./top-level-community-list.component.scss'],
@@ -20,8 +23,19 @@ import { take } from 'rxjs/operators';
})
export class TopLevelCommunityListComponent implements OnInit {
/**
* A list of remote data objects of all top communities
*/
communitiesRD$: BehaviorSubject<RemoteData<PaginatedList<Community>>> = new BehaviorSubject<RemoteData<PaginatedList<Community>>>({} as any);
/**
* The pagination configuration
*/
config: PaginationComponentOptions;
/**
* The sorting configuration
*/
sortConfig: SortOptions;
constructor(private cds: CommunityDataService) {
@@ -36,6 +50,10 @@ export class TopLevelCommunityListComponent implements OnInit {
this.updatePage();
}
/**
* Called when one of the pagination settings is changed
* @param event The new pagination data
*/
onPaginationChange(event) {
this.config.currentPage = event.page;
this.config.pageSize = event.pageSize;
@@ -44,6 +62,9 @@ export class TopLevelCommunityListComponent implements OnInit {
this.updatePage();
}
/**
* Update the list of top communities
*/
updatePage() {
this.cds.findTop({
currentPage: this.config.currentPage,