fix some rebase errors
This commit is contained in:
parent
99f9083ccb
commit
7cb8fc5854
@ -1,4 +1,4 @@
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
||||
import { AppStateService } from '../../../../../../state/app-state.service';
|
||||
import { FileManagementControllerService, ReanalysisControllerService } from '@redaction/red-ui-http';
|
||||
import { PermissionsService } from '../../../../../../services/permissions.service';
|
||||
@ -10,6 +10,7 @@ import { CircleButtonTypes, EntitiesService, LoadingService } from '@iqser/commo
|
||||
import { ConfirmationDialogInput } from '../../../../../shared/dialogs/confirmation-dialog/confirmation-dialog.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { Dossier } from '@state/model/dossier';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-overview-bulk-actions',
|
||||
@ -19,6 +20,7 @@ import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
export class DossierOverviewBulkActionsComponent {
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
|
||||
@Input() dossier: Dossier;
|
||||
@Output() readonly reload = new EventEmitter();
|
||||
|
||||
constructor(
|
||||
@ -33,19 +35,12 @@ export class DossierOverviewBulkActionsComponent {
|
||||
private readonly _entitiesService: EntitiesService<File>
|
||||
) {}
|
||||
|
||||
get dossier() {
|
||||
return this._appStateService?.activeDossier;
|
||||
}
|
||||
|
||||
get selectedFiles(): File[] {
|
||||
return this._entitiesService.selected;
|
||||
}
|
||||
|
||||
get areAllFilesSelected() {
|
||||
return (
|
||||
this._appStateService.activeDossier.files.length !== 0 &&
|
||||
this.selectedFiles.length === this._appStateService.activeDossier.files.length
|
||||
);
|
||||
return this.dossier.files.length !== 0 && this.selectedFiles.length === this.dossier.files.length;
|
||||
}
|
||||
|
||||
get areSomeFilesSelected() {
|
||||
@ -134,7 +129,7 @@ export class DossierOverviewBulkActionsComponent {
|
||||
await this._fileManagementControllerService
|
||||
.deleteFiles(
|
||||
this.selectedFiles.map(item => item.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
this.dossier.dossierId
|
||||
)
|
||||
.toPromise();
|
||||
await this._appStateService.reloadActiveDossierFiles();
|
||||
@ -147,20 +142,16 @@ export class DossierOverviewBulkActionsComponent {
|
||||
|
||||
setToUnderApproval() {
|
||||
// If more than 1 approver - show dialog and ask who to assign
|
||||
if (this._appStateService.activeDossier.approverIds.length > 1) {
|
||||
if (this.dossier.approverIds.length > 1) {
|
||||
this._assignFiles('approver', true);
|
||||
} else {
|
||||
this._performBulkAction(
|
||||
this._fileActionService.setFilesUnderApproval(this.selectedFiles, this._appStateService.activeDossier.approverIds[0])
|
||||
);
|
||||
this._performBulkAction(this._fileActionService.setFilesUnderApproval(this.selectedFiles, this.dossier.approverIds[0]));
|
||||
}
|
||||
}
|
||||
|
||||
async reanalyse() {
|
||||
const fileIds = this.selectedFiles.filter(file => file.analysisRequired).map(file => file.fileId);
|
||||
this._performBulkAction(
|
||||
this._reanalysisControllerService.reanalyzeFilesForDossier(fileIds, this._appStateService.activeDossier.id)
|
||||
);
|
||||
this._performBulkAction(this._reanalysisControllerService.reanalyzeFilesForDossier(fileIds, this.dossier.id));
|
||||
}
|
||||
|
||||
ocr() {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<ng-container *ngIf="dossiersService.activeDossier as dossier">
|
||||
<ng-container *ngIf="dossiersService.activeDossier$ | async as dossier">
|
||||
<div>
|
||||
<mat-icon svgIcon="red:document"></mat-icon>
|
||||
<span>{{ 'dossier-overview.dossier-details.stats.documents' | translate: { count: dossier.files.length } }}</span>
|
||||
@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<mat-icon svgIcon="red:template"></mat-icon>
|
||||
<span>{{ dossierTemplate?.name }} </span>
|
||||
<span>{{ dossierTemplate(dossier).name }} </span>
|
||||
</div>
|
||||
<div (click)="openDossierDictionaryDialog.emit()" *ngIf="dossier.type" class="link-property">
|
||||
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
||||
|
||||
@ -4,6 +4,7 @@ import { AppStateService } from '@state/app-state.service';
|
||||
import { Dossier } from '@state/model/dossier';
|
||||
import { IDossierTemplate } from '@redaction/red-ui-http';
|
||||
import { DossiersDialogService } from '../../../../services/dossiers-dialog.service';
|
||||
import { DossiersService } from '../../../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-details-stats',
|
||||
@ -15,19 +16,19 @@ export class DossierDetailsStatsComponent {
|
||||
@Input() dossierAttributes: DossierAttributeWithValue[];
|
||||
@Output() readonly openDossierDictionaryDialog = new EventEmitter();
|
||||
|
||||
constructor(private readonly _appStateService: AppStateService, private readonly _dialogService: DossiersDialogService) {}
|
||||
constructor(
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
readonly dossiersService: DossiersService
|
||||
) {}
|
||||
|
||||
get activeDossier(): Dossier {
|
||||
return this._appStateService.activeDossier;
|
||||
dossierTemplate(dossier: Dossier): IDossierTemplate {
|
||||
return this._appStateService.getDossierTemplateById(dossier.dossierTemplateId);
|
||||
}
|
||||
|
||||
get dossierTemplate(): IDossierTemplate {
|
||||
return this._appStateService.getDossierTemplateById(this.activeDossier.dossierTemplateId);
|
||||
}
|
||||
|
||||
openEditDossierAttributesDialog() {
|
||||
openEditDossierAttributesDialog(dossier: Dossier) {
|
||||
this._dialogService.openDialog('editDossier', null, {
|
||||
dossier: this.activeDossier,
|
||||
dossier,
|
||||
section: 'dossierAttributes'
|
||||
});
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import { fileStatusTranslations } from '../../../../translations/file-status-tra
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { DossierRequest } from '@redaction/red-ui-http';
|
||||
import { User } from '@models/user';
|
||||
import { DossiersService } from '../../services/dossiers.service';
|
||||
import { DossiersService } from '../../../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-details',
|
||||
|
||||
@ -14,6 +14,4 @@ export class TableItemComponent {
|
||||
@Input() @Required() statsTemplate!: TemplateRef<unknown>;
|
||||
@Input() @Required() displayedAttributes!: IFileAttributeConfig[];
|
||||
@Output() readonly calculateData = new EventEmitter<void>();
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import { annotationFilterChecker, RedactionFilterSorter, StatusSorter } from '@u
|
||||
import { workloadTranslations } from '../../translations/workload-translations';
|
||||
import * as moment from 'moment';
|
||||
import { ConfigService as AppConfigService } from '@services/config.service';
|
||||
import { DossiersService } from '../../services/dossiers.service';
|
||||
|
||||
@Injectable()
|
||||
export class ConfigService {
|
||||
@ -21,6 +22,7 @@ export class ConfigService {
|
||||
private readonly _fileActionService: FileActionService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _permissionsService: PermissionsService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _userService: UserService,
|
||||
@ -331,7 +333,7 @@ export class ConfigService {
|
||||
|
||||
private _openEditDossierDialog($event: MouseEvent) {
|
||||
this._dialogService.openDialog('editDossier', $event, {
|
||||
dossier: this._appStateService.activeDossier
|
||||
dossier: this._dossiersService.activeDossier
|
||||
});
|
||||
}
|
||||
|
||||
@ -345,7 +347,7 @@ export class ConfigService {
|
||||
};
|
||||
|
||||
private _underApprovalFn = (reloadDossiers: () => Promise<void>) => async (file: File) => {
|
||||
if (this._appStateService.activeDossier.approverIds.length > 1) {
|
||||
if (this._dossiersService.activeDossier.approverIds.length > 1) {
|
||||
this._fileActionService.assignFile('approver', null, file, () => this._loadingService.loadWhile(reloadDossiers()), true);
|
||||
} else {
|
||||
this._loadingService.start();
|
||||
|
||||
@ -48,6 +48,7 @@ import { Router } from '@angular/router';
|
||||
import { FileAttributesService } from '../../../services/file-attributes.service';
|
||||
import { ConfigService as AppConfigService } from '@services/config.service';
|
||||
import { ConfigService } from '../config.service';
|
||||
import { DossiersService } from '../../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './dossier-overview-screen.component.html',
|
||||
@ -58,7 +59,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
readonly listingModes = ListingModes;
|
||||
readonly circleButtonTypes = CircleButtonTypes;
|
||||
readonly currentUser = this._userService.currentUser;
|
||||
currentDossier = this._appStateService.activeDossier;
|
||||
currentDossier = this._dossiersService.activeDossier;
|
||||
readonly tableHeaderLabel = _('dossier-overview.table-header.title');
|
||||
collapsedDetails = false;
|
||||
dossierAttributes: DossierAttributeWithValue[] = [];
|
||||
@ -81,6 +82,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
readonly routerHistoryService: RouterHistoryService,
|
||||
private readonly _appConfigService: AppConfigService,
|
||||
private readonly _translateService: TranslateService,
|
||||
@ -94,10 +96,6 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
private readonly _configService: ConfigService
|
||||
) {
|
||||
super(_injector);
|
||||
this._loadEntitiesFromState();
|
||||
this.fileAttributeConfigs = this._fileAttributesService.getFileAttributeConfig(
|
||||
this.currentDossier.dossierTemplateId
|
||||
)?.fileAttributeConfigs;
|
||||
this.tableColumnConfigs = this._configService.tableConfig(this.displayedAttributes);
|
||||
}
|
||||
|
||||
@ -131,6 +129,10 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
|
||||
async ngOnInit(): Promise<void> {
|
||||
this._loadingService.start();
|
||||
this._loadEntitiesFromState();
|
||||
this.fileAttributeConfigs = this._fileAttributesService.getFileAttributeConfig(
|
||||
this.currentDossier.dossierTemplateId
|
||||
)?.fileAttributeConfigs;
|
||||
try {
|
||||
this._fileDropOverlayService.initFileDropHandling();
|
||||
|
||||
@ -195,7 +197,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
}
|
||||
|
||||
calculateData(): void {
|
||||
if (!this._appStateService.activeDossierId) {
|
||||
if (!this._dossiersService.activeDossierId) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -247,9 +249,9 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
||||
moment(file.lastUpdated).add(this._appConfigService.values.RECENT_PERIOD_IN_HOURS, 'hours').isAfter(moment());
|
||||
|
||||
private _loadEntitiesFromState() {
|
||||
this.currentDossier = this._appStateService.activeDossier;
|
||||
this.currentDossier = this._dossiersService.activeDossier;
|
||||
if (this.currentDossier) {
|
||||
this.entitiesService.setEntities(this.currentDossier.files);
|
||||
this.entitiesService.setEntities([...this.currentDossier.files]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { FilterService } from '@iqser/common-ui';
|
||||
import { DossiersService } from '../../services/dossiers.service';
|
||||
import { DossiersService } from '../../../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossiers-listing-details',
|
||||
|
||||
@ -9,7 +9,5 @@ import { Required } from '@iqser/common-ui';
|
||||
})
|
||||
export class TableItemComponent {
|
||||
@Input() @Required() dossier!: Dossier;
|
||||
@Output() readonly calculateData = new EventEmitter<void>();
|
||||
|
||||
constructor() {}
|
||||
@Output() readonly calculateData = new EventEmitter();
|
||||
}
|
||||
|
||||
@ -11,15 +11,22 @@ import { tap } from 'rxjs/operators';
|
||||
import { Router } from '@angular/router';
|
||||
import { DossiersDialogService } from '../../../services/dossiers-dialog.service';
|
||||
import { groupBy, OnAttach, OnDetach, StatusSorter } from '@utils/index';
|
||||
import { DefaultListingServices, ListingComponent, TableComponent } from '@iqser/common-ui';
|
||||
import { EntitiesService, FilterService, ListingComponent, SearchService, SortingService, TableComponent } from '@iqser/common-ui';
|
||||
import { fileStatusTranslations } from '../../../translations/file-status-translations';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { ConfigService } from '../config.service';
|
||||
import { DossiersService } from '../../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
templateUrl: './dossiers-listing-screen.component.html',
|
||||
styleUrls: ['./dossiers-listing-screen.component.scss'],
|
||||
providers: [...DefaultListingServices, { provide: ListingComponent, useExisting: forwardRef(() => DossiersListingScreenComponent) }]
|
||||
providers: [
|
||||
FilterService,
|
||||
SearchService,
|
||||
SortingService,
|
||||
{ provide: EntitiesService, useExisting: DossiersService },
|
||||
{ provide: ListingComponent, useExisting: forwardRef(() => DossiersListingScreenComponent) }
|
||||
]
|
||||
})
|
||||
export class DossiersListingScreenComponent
|
||||
extends ListingComponent<Dossier>
|
||||
@ -45,13 +52,13 @@ export class DossiersListingScreenComponent
|
||||
private readonly _userService: UserService,
|
||||
readonly permissionsService: PermissionsService,
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossiersService: DossiersService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _translateChartService: TranslateChartService,
|
||||
private readonly _configService: ConfigService
|
||||
) {
|
||||
super(_injector);
|
||||
this._appStateService.reset();
|
||||
this._loadEntitiesFromState();
|
||||
}
|
||||
|
||||
private get _activeDossiersCount(): number {
|
||||
@ -67,7 +74,6 @@ export class DossiersListingScreenComponent
|
||||
|
||||
this.addSubscription = timer(0, 10000).subscribe(async () => {
|
||||
await this._appStateService.loadAllDossiers();
|
||||
this._loadEntitiesFromState();
|
||||
this.calculateData();
|
||||
});
|
||||
|
||||
@ -84,7 +90,6 @@ export class DossiersListingScreenComponent
|
||||
|
||||
ngOnAttach(): void {
|
||||
this._appStateService.reset();
|
||||
this._loadEntitiesFromState();
|
||||
this.ngOnInit();
|
||||
this.ngAfterViewInit();
|
||||
this._tableComponent.scrollViewport.scrollToIndex(this._lastScrolledIndex, 'smooth');
|
||||
@ -113,7 +118,7 @@ export class DossiersListingScreenComponent
|
||||
{ value: this._activeDossiersCount, color: 'ACTIVE', label: _('active') },
|
||||
{ value: this._inactiveDossiersCount, color: 'DELETED', label: _('archived') }
|
||||
];
|
||||
const groups = groupBy(this._appStateService.aggregatedFiles, 'status');
|
||||
const groups = groupBy(this._dossiersService.allFiles, 'status');
|
||||
this.documentsChartData = [];
|
||||
|
||||
for (const status of Object.keys(groups)) {
|
||||
@ -128,10 +133,6 @@ export class DossiersListingScreenComponent
|
||||
this.documentsChartData = this._translateChartService.translateStatus(this.documentsChartData);
|
||||
}
|
||||
|
||||
private _loadEntitiesFromState() {
|
||||
this.entitiesService.setEntities(this._appStateService.allDossiers);
|
||||
}
|
||||
|
||||
private _computeAllFilters() {
|
||||
const filterGroups = this._configService.filterGroups(this.entitiesService.all, this._needsWorkFilterTemplate);
|
||||
for (const filterGroup of filterGroups) {
|
||||
|
||||
@ -12,6 +12,7 @@ import { filter } from 'rxjs/operators';
|
||||
import { UserPreferenceService } from '@services/user-preference.service';
|
||||
import { LongPressEvent } from '@shared/directives/long-press.directive';
|
||||
import { FileActionService } from '../../services/file-action.service';
|
||||
import { DossiersService } from '../../../services/dossiers.service';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-file-actions',
|
||||
@ -52,6 +53,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnInit, OnD
|
||||
constructor(
|
||||
readonly permissionsService: PermissionsService,
|
||||
readonly appStateService: AppStateService,
|
||||
readonly dossiersService: DossiersService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _fileActionService: FileActionService,
|
||||
private readonly _loadingService: LoadingService,
|
||||
@ -164,7 +166,7 @@ export class FileActionsComponent extends AutoUnsubscribe implements OnInit, OnD
|
||||
|
||||
setFileUnderApproval($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
if (this.appStateService.activeDossier.approverIds.length > 1) {
|
||||
if (this.dossiersService.activeDossier.approverIds.length > 1) {
|
||||
this._fileActionService.assignFile('approver', $event, this.file, () => this.reloadDossiers('assign-reviewer'), true);
|
||||
} else {
|
||||
this.addSubscription = this._fileActionService.setFilesUnderApproval([this.file]).subscribe(() => {
|
||||
|
||||
@ -8,6 +8,7 @@ import { DossiersDialogService } from '../../services/dossiers-dialog.service';
|
||||
import { ConfirmationDialogInput } from '@shared/dialogs/confirmation-dialog/confirmation-dialog.component';
|
||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||
import { FilesService } from '../../services/files.service';
|
||||
import { DossiersService } from '../../services/dossiers.service';
|
||||
|
||||
@Injectable()
|
||||
export class FileActionService {
|
||||
@ -17,11 +18,12 @@ export class FileActionService {
|
||||
private readonly _userService: UserService,
|
||||
private readonly _fileService: FilesService,
|
||||
private readonly _reanalysisControllerService: ReanalysisControllerService,
|
||||
private readonly _appStateService: AppStateService
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossiersService: DossiersService
|
||||
) {}
|
||||
|
||||
reanalyseFile(file = this._appStateService.activeFile) {
|
||||
return this._reanalysisControllerService.reanalyzeFile(this._appStateService.activeDossier.id, file.fileId, true);
|
||||
return this._reanalysisControllerService.reanalyzeFile(this._dossiersService.activeDossier.id, file.fileId, true);
|
||||
}
|
||||
|
||||
toggleAnalysis(file = this._appStateService.activeFile) {
|
||||
@ -51,34 +53,34 @@ export class FileActionService {
|
||||
|
||||
setFilesUnderApproval(files: File[], approverId?: string) {
|
||||
if (!approverId) {
|
||||
approverId = this._appStateService.activeDossier.approverIds[0];
|
||||
approverId = this._dossiersService.activeDossier.approverIds[0];
|
||||
}
|
||||
|
||||
return this._fileService.setUnderApprovalFor(
|
||||
files.map(f => f.fileId),
|
||||
approverId,
|
||||
this._appStateService.activeDossierId
|
||||
this._dossiersService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
setFilesApproved(files: File[]) {
|
||||
return this._fileService.setApprovedFor(
|
||||
files.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
this._dossiersService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
setFilesUnderReview(files: File[]) {
|
||||
return this._fileService.setUnderReviewFor(
|
||||
files.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
this._dossiersService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
ocrFiles(files: File[]) {
|
||||
return this._reanalysisControllerService.ocrFiles(
|
||||
files.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId
|
||||
this._dossiersService.activeDossierId
|
||||
);
|
||||
}
|
||||
|
||||
@ -101,7 +103,7 @@ export class FileActionService {
|
||||
await this._fileService
|
||||
.setReviewerFor(
|
||||
files.map(f => f.fileId),
|
||||
this._appStateService.activeDossierId,
|
||||
this._dossiersService.activeDossierId,
|
||||
this._userService.currentUser.id
|
||||
)
|
||||
.toPromise();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { AppStateService } from '../../../../state/app-state.service';
|
||||
import { AppStateService } from '@state/app-state.service';
|
||||
import { INestedFilter } from '@iqser/common-ui';
|
||||
|
||||
@Component({
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user