65600: Theme changes&improvements and route calculation moved to tree creation

This commit is contained in:
Marie Verdonck
2019-10-15 13:41:05 +02:00
parent c99b6adb31
commit e950c23f40
3 changed files with 31 additions and 31 deletions

View File

@@ -2,8 +2,6 @@ import {Component, OnInit} from '@angular/core';
import {CommunityListAdapter, FlatNode} from '../community-list-adapter';
import {CommunityListDatasource} from '../community-list-datasource';
import {FlatTreeControl} from '@angular/cdk/tree';
import {getCollectionPageRoute} from '../../+collection-page/collection-page-routing.module';
import {getCommunityPageRoute} from '../../+community-page/community-page-routing.module';
@Component({
selector: 'ds-community-list',
@@ -13,6 +11,7 @@ import {getCommunityPageRoute} from '../../+community-page/community-page-routin
export class CommunityListComponent implements OnInit {
private expandedNodes: FlatNode[] = [];
private Arr = Array;
treeControl = new FlatTreeControl<FlatNode>(
(node) => node.level, (node) => node.isExpandable
@@ -36,11 +35,6 @@ export class CommunityListComponent implements OnInit {
return node.isShowMoreNode;
}
shouldRender(node: FlatNode) {
const parent = node.parent;
return !parent || parent.isExpanded;
}
toggleExpanded(node: FlatNode) {
if (node.isExpanded) {
this.expandedNodes = this.expandedNodes.filter((node2) => node2.name !== node.name);
@@ -52,14 +46,6 @@ export class CommunityListComponent implements OnInit {
this.dataSource.loadCommunities(this.expandedNodes);
}
getCollectionRoute(node: FlatNode): string {
return getCollectionPageRoute(node.id);
}
getCommunityRoute(node: FlatNode): string {
return getCommunityPageRoute(node.id);
}
getNextPage(): void {
console.log('go to next page');
// TODO