mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
65600: Theme changes&improvements and route calculation moved to tree creation
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user