fix error handler, change listing details filters
This commit is contained in:
parent
5ba302bd83
commit
13d8a7da04
@ -10,7 +10,7 @@
|
||||
<div class="dossier-stats-item">
|
||||
<mat-icon svgIcon="red:needs-work"></mat-icon>
|
||||
<div>
|
||||
<div class="heading">{{ totalPages | number }}</div>
|
||||
<div class="heading">{{ appStateService.totalAnalysedPages | number }}</div>
|
||||
<div translate="dossier-listing.stats.analyzed-pages"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -18,7 +18,7 @@
|
||||
<div class="dossier-stats-item">
|
||||
<mat-icon svgIcon="red:user"></mat-icon>
|
||||
<div>
|
||||
<div class="heading">{{ totalPeople }}</div>
|
||||
<div class="heading">{{ appStateService.totalPeople }}</div>
|
||||
<div translate="dossier-listing.stats.total-people"></div>
|
||||
</div>
|
||||
</div>
|
||||
@ -26,9 +26,9 @@
|
||||
</div>
|
||||
<div>
|
||||
<redaction-simple-doughnut-chart
|
||||
(toggleFilter)="toggleFilter('statusFilters', $event)"
|
||||
(toggleFilter)="toggleFilter($event)"
|
||||
[config]="documentsChartData"
|
||||
[filter]="filters.statusFilters"
|
||||
[filter]="filters"
|
||||
[radius]="80"
|
||||
[strokeWidth]="15"
|
||||
[subtitle]="'dossier-listing.stats.charts.total-documents'"
|
||||
|
||||
@ -11,21 +11,13 @@ import { FilterModel } from '@shared/components/filters/popup-filter/model/filte
|
||||
export class DossierListingDetailsComponent {
|
||||
@Input() dossiersChartData: DoughnutChartConfig[];
|
||||
@Input() documentsChartData: DoughnutChartConfig[];
|
||||
@Input() filters: { statusFilters: FilterModel[] };
|
||||
@Input() filters: FilterModel[];
|
||||
@Output() filtersChanged = new EventEmitter();
|
||||
|
||||
constructor(private readonly _appStateService: AppStateService) {}
|
||||
constructor(readonly appStateService: AppStateService) {}
|
||||
|
||||
get totalPages() {
|
||||
return this._appStateService.totalAnalysedPages;
|
||||
}
|
||||
|
||||
get totalPeople() {
|
||||
return this._appStateService.totalPeople;
|
||||
}
|
||||
|
||||
toggleFilter(filterType: 'needsWorkFilters' | 'statusFilters', key: string): void {
|
||||
const filter = this.filters[filterType].find(f => f.key === key);
|
||||
toggleFilter(key: string): void {
|
||||
const filter = this.filters.find(f => f.key === key);
|
||||
filter.checked = !filter.checked;
|
||||
this.filtersChanged.emit(this.filters);
|
||||
}
|
||||
|
||||
@ -69,10 +69,8 @@
|
||||
| async
|
||||
| sortBy: sortingOption.order:sortingOption.column
|
||||
"
|
||||
[class.pointer]="canOpenDossier(dw)"
|
||||
[routerLink]="[
|
||||
canOpenDossier(dw) ? '/main/dossiers/' + dw.dossier.dossierId : []
|
||||
]"
|
||||
[class.pointer]="!!dw"
|
||||
[routerLink]="[!!dw ? '/main/dossiers/' + dw.dossier.dossierId : []]"
|
||||
class="table-item"
|
||||
>
|
||||
<div class="filename">
|
||||
@ -100,7 +98,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:user"></mat-icon>
|
||||
{{ userCount(dw) }}
|
||||
{{ dw.numberOfMembers }}
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:calendar"></mat-icon>
|
||||
|
||||
@ -7,7 +7,7 @@ import { groupBy } from '@utils/functions';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { PermissionsService } from '@services/permissions.service';
|
||||
import { DossierWrapper } from '@state/model/dossier.wrapper';
|
||||
import { Observable, Subscription, timer } from 'rxjs';
|
||||
import { Subscription, timer } from 'rxjs';
|
||||
import { filter, tap } from 'rxjs/operators';
|
||||
import { TranslateChartService } from '@services/translate-chart.service';
|
||||
import { RedactionFilterSorter } from '@utils/sorters/redaction-filter-sorter';
|
||||
@ -31,7 +31,7 @@ import { SearchService } from '../../../shared/services/search.service';
|
||||
import { ScreenStateService } from '../../../shared/services/screen-state.service';
|
||||
import { NewBaseListingComponent } from '../../../shared/base/new-base-listing.component';
|
||||
import { FilterWrapper } from '../../../shared/components/filters/popup-filter/model/filter-wrapper.model';
|
||||
import { SortingService } from '../../../../services/sorting.service';
|
||||
import { ScreenNames, SortingService } from '../../../../services/sorting.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './dossier-listing-screen.component.html',
|
||||
@ -48,11 +48,7 @@ export class DossierListingScreenComponent
|
||||
peopleFilters: FilterModel[];
|
||||
needsWorkFilters: FilterModel[];
|
||||
dossierTemplateFilters: FilterModel[];
|
||||
detailsContainerFilters: {
|
||||
statusFilters: FilterModel[];
|
||||
} = {
|
||||
statusFilters: []
|
||||
};
|
||||
detailsContainerFilters: FilterModel[] = [];
|
||||
quickFilters: FilterModel[];
|
||||
filterConfigs: FilterConfig[];
|
||||
buttonConfigs: ButtonConfig[] = [
|
||||
@ -87,13 +83,14 @@ export class DossierListingScreenComponent
|
||||
protected readonly _injector: Injector
|
||||
) {
|
||||
super(_injector);
|
||||
this._sortingService.screenName = 'dossier-listing';
|
||||
this._sortingService.screenName = ScreenNames.DOSSIER_LISTING;
|
||||
this._appStateService.reset();
|
||||
this._searchService.searchKey = 'name';
|
||||
this._loadEntitiesFromState();
|
||||
}
|
||||
|
||||
get activeDossiersCount(): number {
|
||||
console.log('active dossiers');
|
||||
return this._screenStateService.entities.filter(
|
||||
p => p.dossier.status === Dossier.StatusEnum.ACTIVE
|
||||
).length;
|
||||
@ -180,14 +177,6 @@ export class DossierListingScreenComponent
|
||||
return dossier.files.length;
|
||||
}
|
||||
|
||||
userCount(dossier: DossierWrapper) {
|
||||
return dossier.numberOfMembers;
|
||||
}
|
||||
|
||||
canOpenDossier(dw: DossierWrapper): boolean {
|
||||
return !!dw;
|
||||
}
|
||||
|
||||
getDossierTemplate(dw: DossierWrapper): DossierTemplateModel {
|
||||
return this._appStateService.getDossierTemplateById(dw.dossier.dossierTemplateId);
|
||||
}
|
||||
@ -214,9 +203,7 @@ export class DossierListingScreenComponent
|
||||
}
|
||||
|
||||
protected _preFilter() {
|
||||
this.detailsContainerFilters = {
|
||||
statusFilters: this.statusFilters.map(f => ({ ...f }))
|
||||
};
|
||||
this.detailsContainerFilters = this.statusFilters.map(f => ({ ...f }));
|
||||
}
|
||||
|
||||
private _loadEntitiesFromState() {
|
||||
@ -257,14 +244,12 @@ export class DossierListingScreenComponent
|
||||
const allDistinctPeople = new Set<string>();
|
||||
const allDistinctNeedsWork = new Set<string>();
|
||||
const allDistinctDossierTemplates = new Set<string>();
|
||||
this._screenStateService.logCurrentState();
|
||||
this._screenStateService?.entities?.forEach(entry => {
|
||||
// all people
|
||||
entry.dossier.memberIds.forEach(f => allDistinctPeople.add(f));
|
||||
// file statuses
|
||||
entry.files.forEach(f => allDistinctFileStatus.add(f.status));
|
||||
// Needs work
|
||||
entry.files.forEach(file => {
|
||||
allDistinctFileStatus.add(file.status);
|
||||
if (this.permissionsService.fileRequiresReanalysis(file))
|
||||
allDistinctNeedsWork.add('analysis');
|
||||
if (entry.hintsOnly) allDistinctNeedsWork.add('hint');
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import { orderBy } from 'lodash';
|
||||
import { SortingOrders } from '@services/sorting.service';
|
||||
|
||||
@Pipe({ name: 'sortBy' })
|
||||
export class SortByPipe implements PipeTransform {
|
||||
@ -8,7 +9,7 @@ export class SortByPipe implements PipeTransform {
|
||||
return value;
|
||||
} // no array
|
||||
if (!column || column === '') {
|
||||
if (order === 'asc') {
|
||||
if (order === SortingOrders.ASC) {
|
||||
return value.sort();
|
||||
} else {
|
||||
return value.sort().reverse();
|
||||
|
||||
@ -37,9 +37,7 @@ export class ScreenStateService<T> {
|
||||
}
|
||||
|
||||
setDisplayedEntities(newEntities: Partial<T[]>) {
|
||||
console.log(this.displayedEntities);
|
||||
this.displayedEntities$.next(newEntities);
|
||||
console.log(this.displayedEntities);
|
||||
}
|
||||
|
||||
set selectionKey(value: string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user