mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
Feedback processed: - pagesize comcol changed to 50 &
- loadCommunities inside ngZone.runOutsideAngular - Chevron size small unexpanded and large expanded when logged in fixed
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
::ng-deep {
|
||||
:host ::ng-deep {
|
||||
.fa-chevron-right {
|
||||
padding-left: $spacer/2;
|
||||
font-size: 0.5rem;
|
||||
@@ -16,4 +16,4 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
import { NgZone } from '@angular/core';
|
||||
import { FindListOptions } from '../core/data/request.models';
|
||||
import { CommunityListService, FlatNode } from './community-list-service';
|
||||
import { CollectionViewer, DataSource } from '@angular/cdk/typings/collections';
|
||||
@@ -15,7 +16,8 @@ export class CommunityListDatasource implements DataSource<FlatNode> {
|
||||
private communityList$ = new BehaviorSubject<FlatNode[]>([]);
|
||||
public loading$ = new BehaviorSubject<boolean>(false);
|
||||
|
||||
constructor(private communityListService: CommunityListService) {
|
||||
constructor(private communityListService: CommunityListService,
|
||||
private zone: NgZone) {
|
||||
}
|
||||
|
||||
connect(collectionViewer: CollectionViewer): Observable<FlatNode[]> {
|
||||
@@ -25,11 +27,13 @@ export class CommunityListDatasource implements DataSource<FlatNode> {
|
||||
loadCommunities(findOptions: FindListOptions, expandedNodes: FlatNode[]) {
|
||||
this.loading$.next(true);
|
||||
|
||||
this.communityListService.loadCommunities(findOptions, expandedNodes).pipe(
|
||||
take(1),
|
||||
finalize(() => this.loading$.next(false)),
|
||||
).subscribe((flatNodes: FlatNode[]) => {
|
||||
this.communityList$.next(flatNodes);
|
||||
this.zone.runOutsideAngular(() => {
|
||||
this.communityListService.loadCommunities(findOptions, expandedNodes).pipe(
|
||||
take(1),
|
||||
finalize(() => this.loading$.next(false)),
|
||||
).subscribe((flatNodes: FlatNode[]) => {
|
||||
this.communityList$.next(flatNodes);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -99,7 +99,7 @@ const communityListStateSelector = (state: AppState) => state.communityList;
|
||||
const expandedNodesSelector = createSelector(communityListStateSelector, (communityList: CommunityListState) => communityList.expandedNodes);
|
||||
const loadingNodeSelector = createSelector(communityListStateSelector, (communityList: CommunityListState) => communityList.loadingNode);
|
||||
|
||||
export const MAX_COMCOLS_PER_PAGE = 2;
|
||||
export const MAX_COMCOLS_PER_PAGE = 50;
|
||||
|
||||
/**
|
||||
* Service class for the community list, responsible for the creating of the flat list used by communityList dataSource
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Component, NgZone, OnDestroy, OnInit } from '@angular/core';
|
||||
import { take } from 'rxjs/operators';
|
||||
import { SortDirection, SortOptions } from '../../core/cache/models/sort-options.model';
|
||||
import { FindListOptions } from '../../core/data/request.models';
|
||||
@@ -31,7 +31,8 @@ export class CommunityListComponent implements OnInit, OnDestroy {
|
||||
|
||||
paginationConfig: FindListOptions;
|
||||
|
||||
constructor(private communityListService: CommunityListService) {
|
||||
constructor(private communityListService: CommunityListService,
|
||||
private zone: NgZone) {
|
||||
this.paginationConfig = new FindListOptions();
|
||||
this.paginationConfig.elementsPerPage = 2;
|
||||
this.paginationConfig.currentPage = 1;
|
||||
@@ -39,7 +40,7 @@ export class CommunityListComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.dataSource = new CommunityListDatasource(this.communityListService);
|
||||
this.dataSource = new CommunityListDatasource(this.communityListService, this.zone);
|
||||
this.communityListService.getLoadingNodeFromStore().pipe(take(1)).subscribe((result) => {
|
||||
this.loadingNode = result;
|
||||
});
|
||||
|
Reference in New Issue
Block a user