temporary fix active filter
This commit is contained in:
parent
809ad98ed1
commit
51417fb3ae
@ -1,12 +1,4 @@
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
Injector,
|
||||
OnDestroy,
|
||||
OnInit,
|
||||
TemplateRef,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, Injector, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { Dossier, DossierTemplateModel } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { UserService } from '@services/user.service';
|
||||
@ -41,13 +33,9 @@ import { ScreenNames, SortingService } from '../../../../services/sorting.servic
|
||||
@Component({
|
||||
templateUrl: './dossier-listing-screen.component.html',
|
||||
styleUrls: ['./dossier-listing-screen.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
providers: [FilterService, SearchService, ScreenStateService, SortingService]
|
||||
})
|
||||
export class DossierListingScreenComponent
|
||||
extends BaseListingComponent<DossierWrapper>
|
||||
implements OnInit, OnDestroy, OnAttach, OnDetach
|
||||
{
|
||||
export class DossierListingScreenComponent extends BaseListingComponent<DossierWrapper> implements OnInit, OnDestroy, OnAttach, OnDetach {
|
||||
dossiersChartData: DoughnutChartConfig[] = [];
|
||||
documentsChartData: DoughnutChartConfig[] = [];
|
||||
buttonConfigs: ButtonConfig[] = [
|
||||
@ -147,10 +135,6 @@ export class DossierListingScreenComponent
|
||||
});
|
||||
}
|
||||
|
||||
filtersChanged() {
|
||||
this.filterService.filterEntities();
|
||||
}
|
||||
|
||||
private _loadEntitiesFromState() {
|
||||
this._screenStateService.setEntities(this._appStateService.allDossiers);
|
||||
}
|
||||
@ -160,9 +144,7 @@ export class DossierListingScreenComponent
|
||||
}
|
||||
|
||||
private get _activeDossiersCount(): number {
|
||||
return this._screenStateService.entities.filter(
|
||||
p => p.dossier.status === Dossier.StatusEnum.ACTIVE
|
||||
).length;
|
||||
return this._screenStateService.entities.filter(p => p.dossier.status === Dossier.StatusEnum.ACTIVE).length;
|
||||
}
|
||||
|
||||
private get _inactiveDossiersCount(): number {
|
||||
@ -188,9 +170,7 @@ export class DossierListingScreenComponent
|
||||
});
|
||||
}
|
||||
this.documentsChartData.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
|
||||
this.documentsChartData = this._translateChartService.translateStatus(
|
||||
this.documentsChartData
|
||||
);
|
||||
this.documentsChartData = this._translateChartService.translateStatus(this.documentsChartData);
|
||||
}
|
||||
|
||||
private _computeAllFilters() {
|
||||
@ -205,8 +185,7 @@ export class DossierListingScreenComponent
|
||||
// Needs work
|
||||
entry.files.forEach(file => {
|
||||
allDistinctFileStatus.add(file.status);
|
||||
if (this.permissionsService.fileRequiresReanalysis(file))
|
||||
allDistinctNeedsWork.add('analysis');
|
||||
if (this.permissionsService.fileRequiresReanalysis(file)) allDistinctNeedsWork.add('analysis');
|
||||
if (entry.hintsOnly) allDistinctNeedsWork.add('hint');
|
||||
if (entry.hasRedactions) allDistinctNeedsWork.add('redaction');
|
||||
if (entry.hasRequests) allDistinctNeedsWork.add('suggestion');
|
||||
@ -276,17 +255,14 @@ export class DossierListingScreenComponent
|
||||
this.filterService.addFilter({
|
||||
slug: 'quickFilters',
|
||||
values: quickFilters,
|
||||
checker: (dw: DossierWrapper) =>
|
||||
quickFilters.reduce((acc, f) => acc || (f.checked && f.checker(dw)), false)
|
||||
checker: (dw: DossierWrapper) => quickFilters.reduce((acc, f) => acc || (f.checked && f.checker(dw)), false)
|
||||
});
|
||||
|
||||
this.filterService.filterEntities();
|
||||
}
|
||||
|
||||
private _createQuickFilters() {
|
||||
const myDossiersLabel = this._translateService.instant(
|
||||
'dossier-listing.quick-filters.my-dossiers'
|
||||
);
|
||||
const myDossiersLabel = this._translateService.instant('dossier-listing.quick-filters.my-dossiers');
|
||||
const filters: FilterModel[] = [
|
||||
{
|
||||
key: 'my-dossiers',
|
||||
@ -310,8 +286,6 @@ export class DossierListingScreenComponent
|
||||
}
|
||||
];
|
||||
|
||||
return filters.filter(
|
||||
f => f.label === myDossiersLabel || this._userPreferenceService.areDevFeaturesEnabled
|
||||
);
|
||||
return filters.filter(f => f.label === myDossiersLabel || this._userPreferenceService.areDevFeaturesEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user