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:
Marie Verdonck
2020-06-19 13:17:46 +02:00
parent 53779cf69e
commit 94e3f2d5e0
4 changed files with 17 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
::ng-deep {
:host ::ng-deep {
.fa-chevron-right {
padding-left: $spacer/2;
font-size: 0.5rem;

View File

@@ -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,12 +27,14 @@ export class CommunityListDatasource implements DataSource<FlatNode> {
loadCommunities(findOptions: FindListOptions, expandedNodes: FlatNode[]) {
this.loading$.next(true);
this.zone.runOutsideAngular(() => {
this.communityListService.loadCommunities(findOptions, expandedNodes).pipe(
take(1),
finalize(() => this.loading$.next(false)),
).subscribe((flatNodes: FlatNode[]) => {
this.communityList$.next(flatNodes);
});
});
}
disconnect(collectionViewer: CollectionViewer): void {

View File

@@ -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

View File

@@ -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;
});