remove some activeDossier calls
This commit is contained in:
parent
0dd26a1eea
commit
41bc7a0055
@ -12,7 +12,7 @@ import { PermissionsService } from '@services/permissions.service';
|
|||||||
|
|
||||||
class DialogData {
|
class DialogData {
|
||||||
mode: 'approver' | 'reviewer';
|
mode: 'approver' | 'reviewer';
|
||||||
dossier?: Dossier;
|
dossierId: string;
|
||||||
files?: File[];
|
files?: File[];
|
||||||
ignoreChanged?: boolean;
|
ignoreChanged?: boolean;
|
||||||
}
|
}
|
||||||
@ -24,6 +24,7 @@ class DialogData {
|
|||||||
export class AssignReviewerApproverDialogComponent {
|
export class AssignReviewerApproverDialogComponent {
|
||||||
usersForm: FormGroup;
|
usersForm: FormGroup;
|
||||||
searchForm: FormGroup;
|
searchForm: FormGroup;
|
||||||
|
readonly dossier: Dossier | undefined;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly userService: UserService,
|
readonly userService: UserService,
|
||||||
@ -36,6 +37,7 @@ export class AssignReviewerApproverDialogComponent {
|
|||||||
private readonly _dialogRef: MatDialogRef<AssignReviewerApproverDialogComponent, boolean>,
|
private readonly _dialogRef: MatDialogRef<AssignReviewerApproverDialogComponent, boolean>,
|
||||||
@Inject(MAT_DIALOG_DATA) readonly data: DialogData,
|
@Inject(MAT_DIALOG_DATA) readonly data: DialogData,
|
||||||
) {
|
) {
|
||||||
|
this.dossier = this._dossiersService.find(data.dossierId);
|
||||||
this._loadData();
|
this._loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,8 +48,8 @@ export class AssignReviewerApproverDialogComponent {
|
|||||||
get singleUsersSelectOptions() {
|
get singleUsersSelectOptions() {
|
||||||
const unassignUser = this._canUnassignFiles ? [undefined] : [];
|
const unassignUser = this._canUnassignFiles ? [undefined] : [];
|
||||||
return this.data.mode === 'approver'
|
return this.data.mode === 'approver'
|
||||||
? [...this._dossiersService.activeDossier.approverIds, ...unassignUser]
|
? [...this.dossier.approverIds, ...unassignUser]
|
||||||
: [...this._dossiersService.activeDossier.memberIds, ...unassignUser];
|
: [...this.dossier.memberIds, ...unassignUser];
|
||||||
}
|
}
|
||||||
|
|
||||||
get changed(): boolean {
|
get changed(): boolean {
|
||||||
@ -80,7 +82,7 @@ export class AssignReviewerApproverDialogComponent {
|
|||||||
await this._filesService
|
await this._filesService
|
||||||
.setReviewerFor(
|
.setReviewerFor(
|
||||||
this.data.files.map(f => f.fileId),
|
this.data.files.map(f => f.fileId),
|
||||||
this._dossiersService.activeDossierId,
|
this.data.dossierId,
|
||||||
selectedUser,
|
selectedUser,
|
||||||
)
|
)
|
||||||
.toPromise();
|
.toPromise();
|
||||||
@ -88,7 +90,7 @@ export class AssignReviewerApproverDialogComponent {
|
|||||||
await this._filesService
|
await this._filesService
|
||||||
.setUnderApprovalFor(
|
.setUnderApprovalFor(
|
||||||
this.data.files.map(f => f.fileId),
|
this.data.files.map(f => f.fileId),
|
||||||
this._dossiersService.activeDossierId,
|
this.data.dossierId,
|
||||||
selectedUser,
|
selectedUser,
|
||||||
)
|
)
|
||||||
.toPromise();
|
.toPromise();
|
||||||
|
|||||||
@ -41,7 +41,7 @@ export class EditDossierDialogComponent {
|
|||||||
private readonly _dialogRef: MatDialogRef<EditDossierDialogComponent>,
|
private readonly _dialogRef: MatDialogRef<EditDossierDialogComponent>,
|
||||||
@Inject(MAT_DIALOG_DATA)
|
@Inject(MAT_DIALOG_DATA)
|
||||||
private readonly _data: {
|
private readonly _data: {
|
||||||
dossier: Dossier;
|
dossierId: string;
|
||||||
afterSave: Function;
|
afterSave: Function;
|
||||||
section?: Section;
|
section?: Section;
|
||||||
},
|
},
|
||||||
@ -77,7 +77,7 @@ export class EditDossierDialogComponent {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
this.dossier = _data.dossier;
|
this.dossier = this._dossiersService.find(_data.dossierId);
|
||||||
this.activeNav = _data.section || 'dossierInfo';
|
this.activeNav = _data.section || 'dossierInfo';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ export class EditDossierDialogComponent {
|
|||||||
updatedDossier() {
|
updatedDossier() {
|
||||||
this._toaster.success(_('edit-dossier-dialog.change-successful'), { params: { dossierName: this.dossier.dossierName } });
|
this._toaster.success(_('edit-dossier-dialog.change-successful'), { params: { dossierName: this.dossier.dossierName } });
|
||||||
this.dossier = this._dossiersService.find(this.dossier.id);
|
this.dossier = this._dossiersService.find(this.dossier.id);
|
||||||
this._changeRef.detectChanges();
|
this._changeRef.markForCheck();
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,76 +1,65 @@
|
|||||||
<ng-container *ngIf="dossiersService.activeDossier$ | async as dossier">
|
<div>
|
||||||
<div>
|
<mat-icon svgIcon="iqser:document"></mat-icon>
|
||||||
<mat-icon svgIcon="iqser:document"></mat-icon>
|
<span>{{ 'dossier-overview.dossier-details.stats.documents' | translate: { count: dossier.files.length } }}</span>
|
||||||
<span>{{ 'dossier-overview.dossier-details.stats.documents' | translate: { count: dossier.files.length } }}</span>
|
</div>
|
||||||
</div>
|
|
||||||
<div>
|
<div>
|
||||||
<mat-icon svgIcon="red:user"></mat-icon>
|
<mat-icon svgIcon="red:user"></mat-icon>
|
||||||
<span>{{ 'dossier-overview.dossier-details.stats.people' | translate: { count: dossier.memberIds.length } }}</span>
|
<span>{{ 'dossier-overview.dossier-details.stats.people' | translate: { count: dossier.memberIds.length } }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<mat-icon svgIcon="iqser:pages"></mat-icon>
|
<div>
|
||||||
<span>{{
|
<mat-icon svgIcon="iqser:pages"></mat-icon>
|
||||||
'dossier-overview.dossier-details.stats.analysed-pages' | translate: { count: dossier.totalNumberOfPages | number }
|
<span>{{ 'dossier-overview.dossier-details.stats.analysed-pages' | translate: { count: dossier.totalNumberOfPages | number } }}</span>
|
||||||
}}</span>
|
</div>
|
||||||
</div>
|
|
||||||
<div>
|
<div *ngIf="dossier.date | date: 'd MMM. yyyy' as date">
|
||||||
<mat-icon svgIcon="red:calendar"></mat-icon>
|
<mat-icon svgIcon="red:calendar"></mat-icon>
|
||||||
<span
|
<span>{{ 'dossier-overview.dossier-details.stats.created-on' | translate: { date: date } }}</span>
|
||||||
>{{
|
</div>
|
||||||
'dossier-overview.dossier-details.stats.created-on'
|
|
||||||
| translate
|
<div *ngIf="dossier.dueDate | date: 'd MMM. yyyy' as dueDate">
|
||||||
: {
|
<mat-icon svgIcon="red:lightning"></mat-icon>
|
||||||
date: dossier.date | date: 'd MMM. yyyy'
|
<span>{{ 'dossier-overview.dossier-details.stats.due-date' | translate: { date: dueDate } }}</span>
|
||||||
}
|
</div>
|
||||||
}}
|
|
||||||
</span>
|
<div>
|
||||||
</div>
|
<mat-icon svgIcon="red:template"></mat-icon>
|
||||||
<div *ngIf="dossier.dueDate">
|
<span>{{ dossierTemplate(dossier).name }} </span>
|
||||||
<mat-icon svgIcon="red:lightning"></mat-icon>
|
</div>
|
||||||
<span>{{
|
|
||||||
'dossier-overview.dossier-details.stats.due-date'
|
<div (click)="openDossierDictionaryDialog.emit()" *ngIf="dossier.type" class="link-property">
|
||||||
| translate
|
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
||||||
: {
|
<span>{{ 'dossier-overview.dossier-details.dictionary' | translate }} </span>
|
||||||
date: dossier.dueDate | date: 'd MMM. yyyy'
|
</div>
|
||||||
}
|
|
||||||
}}</span>
|
<div (click)="openEditDossierAttributesDialog(dossier.dossierId, 'deletedDocuments')" class="link-property">
|
||||||
</div>
|
<mat-icon svgIcon="iqser:trash"></mat-icon>
|
||||||
<div>
|
<span>{{ 'dossier-overview.dossier-details.stats.deleted' | translate: { count: deletedFilesCount$ | async } }}</span>
|
||||||
<mat-icon svgIcon="red:template"></mat-icon>
|
</div>
|
||||||
<span>{{ dossierTemplate(dossier).name }} </span>
|
|
||||||
</div>
|
<ng-container *ngIf="dossierAttributes?.length">
|
||||||
<div (click)="openDossierDictionaryDialog.emit()" *ngIf="dossier.type" class="link-property">
|
<div (click)="attributesExpanded = true" *ngIf="!attributesExpanded" class="all-caps-label show-attributes">
|
||||||
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
{{ 'dossier-overview.dossier-details.attributes.expand' | translate: { count: dossierAttributes.length } }}
|
||||||
<span>{{ 'dossier-overview.dossier-details.dictionary' | translate }} </span>
|
|
||||||
</div>
|
|
||||||
<div (click)="openEditDossierAttributesDialog(dossier, 'deletedDocuments')" class="link-property">
|
|
||||||
<mat-icon svgIcon="iqser:trash"></mat-icon>
|
|
||||||
<span>{{ 'dossier-overview.dossier-details.stats.deleted' | translate: { count: deletedFilesCount$ | async } }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="dossierAttributes?.length">
|
<ng-container *ngIf="attributesExpanded">
|
||||||
<div (click)="attributesExpanded = true" *ngIf="!attributesExpanded" class="all-caps-label show-attributes">
|
<div
|
||||||
{{ 'dossier-overview.dossier-details.attributes.expand' | translate: { count: dossierAttributes.length } }}
|
(click)="openEditDossierAttributesDialog(dossier.dossierId, 'dossierAttributes')"
|
||||||
|
*ngFor="let attr of dossierAttributes"
|
||||||
|
class="link-property"
|
||||||
|
>
|
||||||
|
<mat-icon svgIcon="red:attribute"></mat-icon>
|
||||||
|
<span *ngIf="!attr.value"> {{ attr.label + ': -' }}</span>
|
||||||
|
<span *ngIf="attr.value && attr.type === 'DATE'"> {{ attr.label + ': ' + (attr.value | date: 'd MMM. yyyy') }}</span>
|
||||||
|
<span *ngIf="attr.value && attr.type === 'IMAGE'">
|
||||||
|
{{ attr.label + ': ' + ('dossier-overview.dossier-details.attributes.image-uploaded' | translate) }}</span
|
||||||
|
>
|
||||||
|
<span *ngIf="attr.value && (attr.type === 'TEXT' || attr.type === 'NUMBER')"> {{ attr.label + ': ' + attr.value }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="attributesExpanded">
|
<div (click)="attributesExpanded = false" class="all-caps-label hide-attributes">
|
||||||
<div
|
{{ 'dossier-overview.dossier-details.attributes.show-less' | translate }}
|
||||||
(click)="openEditDossierAttributesDialog(dossier, 'dossierAttributes')"
|
</div>
|
||||||
*ngFor="let attr of dossierAttributes"
|
|
||||||
class="link-property"
|
|
||||||
>
|
|
||||||
<mat-icon svgIcon="red:attribute"></mat-icon>
|
|
||||||
<span *ngIf="!attr.value"> {{ attr.label + ': -' }}</span>
|
|
||||||
<span *ngIf="attr.value && attr.type === 'DATE'"> {{ attr.label + ': ' + (attr.value | date: 'd MMM. yyyy') }}</span>
|
|
||||||
<span *ngIf="attr.value && attr.type === 'IMAGE'">
|
|
||||||
{{ attr.label + ': ' + ('dossier-overview.dossier-details.attributes.image-uploaded' | translate) }}</span
|
|
||||||
>
|
|
||||||
<span *ngIf="attr.value && (attr.type === 'TEXT' || attr.type === 'NUMBER')"> {{ attr.label + ': ' + attr.value }}</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div (click)="attributesExpanded = false" class="all-caps-label hide-attributes">
|
|
||||||
{{ 'dossier-overview.dossier-details.attributes.show-less' | translate }}
|
|
||||||
</div>
|
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@ -1,33 +1,36 @@
|
|||||||
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
||||||
import { AppStateService } from '@state/app-state.service';
|
|
||||||
import { Dossier, DossierAttributeWithValue, DossierTemplate } from '@red/domain';
|
import { Dossier, DossierAttributeWithValue, DossierTemplate } from '@red/domain';
|
||||||
import { DossiersDialogService } from '../../../../services/dossiers-dialog.service';
|
import { DossiersDialogService } from '../../../../services/dossiers-dialog.service';
|
||||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||||
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
||||||
import { FilesService } from '@services/entity-services/files.service';
|
import { FilesService } from '@services/entity-services/files.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { distinctUntilChanged, map, switchMap } from 'rxjs/operators';
|
import { distinctUntilChanged, map } from 'rxjs/operators';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-dossier-details-stats',
|
selector: 'redaction-dossier-details-stats',
|
||||||
templateUrl: './dossier-details-stats.component.html',
|
templateUrl: './dossier-details-stats.component.html',
|
||||||
styleUrls: ['./dossier-details-stats.component.scss'],
|
styleUrls: ['./dossier-details-stats.component.scss'],
|
||||||
})
|
})
|
||||||
export class DossierDetailsStatsComponent {
|
export class DossierDetailsStatsComponent implements OnInit {
|
||||||
attributesExpanded = false;
|
attributesExpanded = false;
|
||||||
deletedFilesCount$: Observable<number>;
|
deletedFilesCount$: Observable<number>;
|
||||||
@Input() dossierAttributes: DossierAttributeWithValue[];
|
@Input()
|
||||||
@Output() readonly openDossierDictionaryDialog = new EventEmitter();
|
dossierAttributes: DossierAttributeWithValue[];
|
||||||
|
@Input()
|
||||||
|
dossier: Dossier;
|
||||||
|
@Output()
|
||||||
|
readonly openDossierDictionaryDialog = new EventEmitter();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _appStateService: AppStateService,
|
|
||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
private readonly _dialogService: DossiersDialogService,
|
private readonly _dialogService: DossiersDialogService,
|
||||||
private readonly _filesService: FilesService,
|
private readonly _filesService: FilesService,
|
||||||
readonly dossiersService: DossiersService,
|
readonly dossiersService: DossiersService,
|
||||||
) {
|
) {}
|
||||||
this.deletedFilesCount$ = dossiersService.activeDossier$.pipe(
|
|
||||||
switchMap(dossier => _filesService.getDeletedFilesFor(dossier.id)),
|
ngOnInit() {
|
||||||
|
this.deletedFilesCount$ = this._filesService.getDeletedFilesFor(this.dossier.id).pipe(
|
||||||
map(files => files.length),
|
map(files => files.length),
|
||||||
distinctUntilChanged(),
|
distinctUntilChanged(),
|
||||||
);
|
);
|
||||||
@ -37,9 +40,9 @@ export class DossierDetailsStatsComponent {
|
|||||||
return this._dossierTemplatesService.find(dossier.dossierTemplateId);
|
return this._dossierTemplatesService.find(dossier.dossierTemplateId);
|
||||||
}
|
}
|
||||||
|
|
||||||
openEditDossierAttributesDialog(dossier: Dossier, section: string) {
|
openEditDossierAttributesDialog(dossierId: string, section: string) {
|
||||||
this._dialogService.openDialog('editDossier', null, {
|
this._dialogService.openDialog('editDossier', null, {
|
||||||
dossier,
|
dossierId,
|
||||||
section: section,
|
section: section,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<ng-container *ngIf="dossiersService.activeDossier$ | async as dossier">
|
<ng-container *ngIf="dossier$ | async as dossier">
|
||||||
<div class="collapsed-wrapper">
|
<div class="collapsed-wrapper">
|
||||||
<ng-container *ngTemplateOutlet="collapsible; context: { action: 'expand', tooltip: (expandTooltip | translate) }"></ng-container>
|
<ng-container *ngTemplateOutlet="collapsible; context: { action: 'expand', tooltip: (expandTooltip | translate) }"></ng-container>
|
||||||
<div class="all-caps-label" translate="dossier-details.title"></div>
|
<div class="all-caps-label" translate="dossier-details.title"></div>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<div class="all-caps-label" translate="dossier-details.owner"></div>
|
<div class="all-caps-label" translate="dossier-details.owner"></div>
|
||||||
<div class="mt-12 d-flex">
|
<div class="mt-12 d-flex">
|
||||||
<ng-container *ngIf="!editingOwner; else editOwner">
|
<ng-container *ngIf="!editingOwner; else editOwner">
|
||||||
<redaction-initials-avatar [user]="owner" [withName]="true" color="gray" size="large"></redaction-initials-avatar>
|
<redaction-initials-avatar [user]="dossier.ownerId" [withName]="true" color="gray" size="large"></redaction-initials-avatar>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="editingOwner = true"
|
(action)="editingOwner = true"
|
||||||
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
<div *ngIf="dossier.hasFiles" class="mt-24">
|
<div *ngIf="dossier.hasFiles" class="mt-24">
|
||||||
<redaction-simple-doughnut-chart
|
<redaction-simple-doughnut-chart
|
||||||
[config]="documentsChartData"
|
[config]="calculateChartConfig(dossier)"
|
||||||
[radius]="63"
|
[radius]="63"
|
||||||
[strokeWidth]="15"
|
[strokeWidth]="15"
|
||||||
[subtitle]="'dossier-overview.dossier-details.charts.documents-in-dossier' | translate"
|
[subtitle]="'dossier-overview.dossier-details.charts.documents-in-dossier' | translate"
|
||||||
@ -62,6 +62,7 @@
|
|||||||
<redaction-dossier-details-stats
|
<redaction-dossier-details-stats
|
||||||
(openDossierDictionaryDialog)="openDossierDictionaryDialog.emit()"
|
(openDossierDictionaryDialog)="openDossierDictionaryDialog.emit()"
|
||||||
[dossierAttributes]="dossierAttributes"
|
[dossierAttributes]="dossierAttributes"
|
||||||
|
[dossier]="dossier"
|
||||||
></redaction-dossier-details-stats>
|
></redaction-dossier-details-stats>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -69,16 +70,16 @@
|
|||||||
<div class="heading" translate="dossier-overview.dossier-details.description"></div>
|
<div class="heading" translate="dossier-overview.dossier-details.description"></div>
|
||||||
<div class="mt-8">{{ description }}</div>
|
<div class="mt-8">{{ description }}</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-template #editOwner>
|
<ng-template #editOwner>
|
||||||
<redaction-assign-user-dropdown
|
<redaction-assign-user-dropdown
|
||||||
(cancel)="editingOwner = false"
|
(cancel)="editingOwner = false"
|
||||||
(save)="editingOwner = false; assignOwner($event)"
|
(save)="editingOwner = false; assignOwner($event, dossier)"
|
||||||
[options]="managers"
|
[options]="managers"
|
||||||
[value]="owner"
|
[value]="dossier.ownerId"
|
||||||
></redaction-assign-user-dropdown>
|
></redaction-assign-user-dropdown>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
</ng-container>
|
||||||
|
|
||||||
<ng-template #collapsible let-action="action" let-tooltip="tooltip">
|
<ng-template #collapsible let-action="action" let-tooltip="tooltip">
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
|
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
|
||||||
import { AppStateService } from '@state/app-state.service';
|
import { AppStateService } from '@state/app-state.service';
|
||||||
import { groupBy } from '@utils/index';
|
import { groupBy } from '@utils/index';
|
||||||
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
import { DoughnutChartConfig } from '@shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||||
@ -7,8 +7,10 @@ import { UserService } from '@services/user.service';
|
|||||||
import { FilterService, Toaster } from '@iqser/common-ui';
|
import { FilterService, Toaster } from '@iqser/common-ui';
|
||||||
import { fileStatusTranslations } from '../../../../translations/file-status-translations';
|
import { fileStatusTranslations } from '../../../../translations/file-status-translations';
|
||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { DossierAttributeWithValue, IDossierRequest, StatusSorter, User } from '@red/domain';
|
import { Dossier, DossierAttributeWithValue, IDossierRequest, StatusSorter, User } from '@red/domain';
|
||||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-dossier-details',
|
selector: 'redaction-dossier-details',
|
||||||
@ -16,9 +18,7 @@ import { DossiersService } from '@services/entity-services/dossiers.service';
|
|||||||
styleUrls: ['./dossier-details.component.scss'],
|
styleUrls: ['./dossier-details.component.scss'],
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class DossierDetailsComponent implements OnInit {
|
export class DossierDetailsComponent {
|
||||||
documentsChartData: DoughnutChartConfig[] = [];
|
|
||||||
owner: User;
|
|
||||||
editingOwner = false;
|
editingOwner = false;
|
||||||
@Input() dossierAttributes: DossierAttributeWithValue[];
|
@Input() dossierAttributes: DossierAttributeWithValue[];
|
||||||
@Output() readonly openAssignDossierMembersDialog = new EventEmitter();
|
@Output() readonly openAssignDossierMembersDialog = new EventEmitter();
|
||||||
@ -29,6 +29,8 @@ export class DossierDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
readonly needsWorkFilters$ = this.filterService.getFilterModels$('needsWorkFilters');
|
readonly needsWorkFilters$ = this.filterService.getFilterModels$('needsWorkFilters');
|
||||||
readonly currentUser = this._userService.currentUser;
|
readonly currentUser = this._userService.currentUser;
|
||||||
|
readonly dossierId: string;
|
||||||
|
readonly dossier$: Observable<Dossier>;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
readonly appStateService: AppStateService,
|
readonly appStateService: AppStateService,
|
||||||
@ -38,43 +40,39 @@ export class DossierDetailsComponent implements OnInit {
|
|||||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||||
private readonly _userService: UserService,
|
private readonly _userService: UserService,
|
||||||
private readonly _toaster: Toaster,
|
private readonly _toaster: Toaster,
|
||||||
) {}
|
activatedRoute: ActivatedRoute,
|
||||||
|
) {
|
||||||
|
this.dossierId = activatedRoute.snapshot.paramMap.get('dossierId');
|
||||||
|
this.dossier$ = this.dossiersService.getEntityChanged$(this.dossierId);
|
||||||
|
// this.documentsChartData$ = this.dossier$.pipe(
|
||||||
|
// switchMap(dossier => dossier.stats$),
|
||||||
|
// map(stats => this._calculateChartConfig(stats.fileCountPerWorkflowStatus)),
|
||||||
|
// );
|
||||||
|
}
|
||||||
|
|
||||||
get managers() {
|
get managers() {
|
||||||
return this._userService.managerUsers;
|
return this._userService.managerUsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
calculateChartConfig(dossier: Dossier): DoughnutChartConfig[] {
|
||||||
this.owner = this._userService.find(this.dossiersService.activeDossier.ownerId);
|
const groups = groupBy(dossier?.files, 'status');
|
||||||
}
|
const documentsChartData: DoughnutChartConfig[] = Object.keys(groups).map(status => ({
|
||||||
|
|
||||||
calculateChartConfig(): void {
|
|
||||||
const activeDossier = this.dossiersService.activeDossier;
|
|
||||||
if (!activeDossier) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const groups = groupBy(activeDossier?.files, 'status');
|
|
||||||
let documentsChartData: DoughnutChartConfig[] = Object.keys(groups).map(status => ({
|
|
||||||
value: groups[status].length,
|
value: groups[status].length,
|
||||||
color: status,
|
color: status,
|
||||||
label: fileStatusTranslations[status],
|
label: fileStatusTranslations[status],
|
||||||
key: status,
|
key: status,
|
||||||
}));
|
}));
|
||||||
documentsChartData.sort((a, b) => StatusSorter.byStatus(a.key, b.key));
|
documentsChartData.sort((a, b) => StatusSorter.byStatus(a.key, b.key));
|
||||||
documentsChartData = this.translateChartService.translateStatus(documentsChartData);
|
return this.translateChartService.translateStatus(documentsChartData);
|
||||||
this.documentsChartData = documentsChartData;
|
|
||||||
this._changeDetectorRef.detectChanges();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async assignOwner(user: User | string) {
|
async assignOwner(user: User | string, dossier: Dossier) {
|
||||||
this.owner = typeof user === 'string' ? this._userService.find(user) : user;
|
const owner = typeof user === 'string' ? this._userService.find(user) : user;
|
||||||
const activeDossier = this.dossiersService.activeDossier;
|
const dossierRequest: IDossierRequest = { ...dossier, ownerId: owner.id };
|
||||||
const dossierRequest: IDossierRequest = { ...activeDossier, dossierId: activeDossier.dossierId, ownerId: this.owner.id };
|
|
||||||
await this.dossiersService.createOrUpdate(dossierRequest).toPromise();
|
await this.dossiersService.createOrUpdate(dossierRequest).toPromise();
|
||||||
|
|
||||||
const ownerName = this._userService.getNameForId(this.owner.id);
|
const ownerName = this._userService.getNameForId(owner.id);
|
||||||
const dossierName = activeDossier.dossierName;
|
const dossierName = dossier.dossierName;
|
||||||
this._toaster.info(_('assignment.owner'), { params: { ownerName, dossierName } });
|
this._toaster.info(_('assignment.owner'), { params: { ownerName, dossierName } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import { Injectable, TemplateRef } from '@angular/core';
|
import { Injectable, TemplateRef } from '@angular/core';
|
||||||
import {
|
import {
|
||||||
|
ActionConfig,
|
||||||
IFilterGroup,
|
IFilterGroup,
|
||||||
INestedFilter,
|
INestedFilter,
|
||||||
keyChecker,
|
keyChecker,
|
||||||
|
List,
|
||||||
ListingMode,
|
ListingMode,
|
||||||
ListingModes,
|
ListingModes,
|
||||||
LoadingService,
|
LoadingService,
|
||||||
@ -41,11 +43,11 @@ export class ConfigService {
|
|||||||
private readonly _appConfigService: AppConfigService,
|
private readonly _appConfigService: AppConfigService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
get actionConfig() {
|
actionConfig(dossierId: string): List<ActionConfig> {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: this._translateService.instant('dossier-overview.header-actions.edit'),
|
label: this._translateService.instant('dossier-overview.header-actions.edit'),
|
||||||
action: $event => this._openEditDossierDialog($event),
|
action: $event => this._openEditDossierDialog($event, dossierId),
|
||||||
icon: 'iqser:edit',
|
icon: 'iqser:edit',
|
||||||
hide: !this._userService.currentUser.isManager,
|
hide: !this._userService.currentUser.isManager,
|
||||||
},
|
},
|
||||||
@ -341,10 +343,8 @@ export class ConfigService {
|
|||||||
].map(filter => new NestedFilter(filter));
|
].map(filter => new NestedFilter(filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
private _openEditDossierDialog($event: MouseEvent) {
|
private _openEditDossierDialog($event: MouseEvent, dossierId: string) {
|
||||||
this._dialogService.openDialog('editDossier', $event, {
|
this._dialogService.openDialog('editDossier', $event, { dossierId });
|
||||||
dossier: this._dossiersService.activeDossier,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private _unassignFn = (reloadDossiers: () => Promise<void>) => async (file: File) => {
|
private _unassignFn = (reloadDossiers: () => Promise<void>) => async (file: File) => {
|
||||||
|
|||||||
@ -1,91 +1,100 @@
|
|||||||
<section (longPress)="forceReanalysisAction($event)" *ngIf="!!currentDossier" redactionLongPress>
|
<ng-container *ngIf="dossier$ | async as dossier">
|
||||||
<iqser-page-header
|
<section (longPress)="forceReanalysisAction($event)" redactionLongPress>
|
||||||
(closeAction)="routerHistoryService.navigateToLastDossiersScreen()"
|
<iqser-page-header
|
||||||
[actionConfigs]="actionConfigs"
|
(closeAction)="routerHistoryService.navigateToLastDossiersScreen()"
|
||||||
[showCloseButton]="true"
|
[actionConfigs]="actionConfigs"
|
||||||
[viewModeSelection]="viewModeSelection"
|
[showCloseButton]="true"
|
||||||
>
|
[viewModeSelection]="viewModeSelection"
|
||||||
<redaction-file-download-btn
|
>
|
||||||
[dossier]="currentDossier"
|
<redaction-file-download-btn
|
||||||
[files]="entitiesService.all$ | async"
|
[dossier]="dossier"
|
||||||
tooltipPosition="below"
|
[files]="entitiesService.all$ | async"
|
||||||
></redaction-file-download-btn>
|
tooltipPosition="below"
|
||||||
|
></redaction-file-download-btn>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="exportFilesAsCSV()"
|
(action)="exportFilesAsCSV()"
|
||||||
[tooltip]="'dossier-overview.header-actions.download-csv' | translate"
|
[tooltip]="'dossier-overview.header-actions.download-csv' | translate"
|
||||||
icon="red:csv"
|
icon="red:csv"
|
||||||
tooltipPosition="below"
|
tooltipPosition="below"
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="reanalyseDossier()"
|
(action)="reanalyseDossier()"
|
||||||
*ngIf="permissionsService.displayReanalyseBtn(currentDossier) && analysisForced"
|
*ngIf="permissionsService.displayReanalyseBtn(dossier) && analysisForced"
|
||||||
[tooltipClass]="'small ' + ((listingService.areSomeSelected$ | async) ? '' : 'warn')"
|
[tooltipClass]="'small ' + ((listingService.areSomeSelected$ | async) ? '' : 'warn')"
|
||||||
[tooltip]="'dossier-overview.new-rule.toast.actions.reanalyse-all' | translate"
|
[tooltip]="'dossier-overview.new-rule.toast.actions.reanalyse-all' | translate"
|
||||||
[type]="circleButtonTypes.warn"
|
[type]="circleButtonTypes.warn"
|
||||||
icon="iqser:refresh"
|
icon="iqser:refresh"
|
||||||
tooltipPosition="below"
|
tooltipPosition="below"
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
|
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="fileInput.click()"
|
(action)="fileInput.click()"
|
||||||
[tooltip]="'dossier-overview.header-actions.upload-document' | translate"
|
[tooltip]="'dossier-overview.header-actions.upload-document' | translate"
|
||||||
[type]="circleButtonTypes.primary"
|
[type]="circleButtonTypes.primary"
|
||||||
class="ml-14"
|
class="ml-14"
|
||||||
icon="iqser:upload"
|
icon="iqser:upload"
|
||||||
tooltipPosition="below"
|
tooltipPosition="below"
|
||||||
></iqser-circle-button>
|
></iqser-circle-button>
|
||||||
</iqser-page-header>
|
</iqser-page-header>
|
||||||
|
|
||||||
<div class="overlay-shadow"></div>
|
<div class="overlay-shadow"></div>
|
||||||
|
|
||||||
<div class="content-inner">
|
<div class="content-inner">
|
||||||
<div *ngIf="listingMode$ | async as mode" [class.extended]="collapsedDetails" class="content-container">
|
<div *ngIf="listingMode$ | async as mode" [class.extended]="collapsedDetails" class="content-container">
|
||||||
<iqser-table
|
<iqser-table
|
||||||
(noDataAction)="fileInput.click()"
|
(noDataAction)="fileInput.click()"
|
||||||
*ngIf="mode === listingModes.table"
|
*ngIf="mode === listingModes.table"
|
||||||
[bulkActions]="bulkActions"
|
[bulkActions]="bulkActions"
|
||||||
[hasScrollButton]="true"
|
[hasScrollButton]="true"
|
||||||
[itemSize]="80"
|
[itemSize]="80"
|
||||||
[noDataButtonLabel]="'dossier-overview.no-data.action' | translate"
|
[noDataButtonLabel]="'dossier-overview.no-data.action' | translate"
|
||||||
[noDataText]="'dossier-overview.no-data.title' | translate"
|
[noDataText]="'dossier-overview.no-data.title' | translate"
|
||||||
[noMatchText]="'dossier-overview.no-match.title' | translate"
|
[noMatchText]="'dossier-overview.no-match.title' | translate"
|
||||||
[selectionEnabled]="true"
|
[selectionEnabled]="true"
|
||||||
[showNoDataButton]="true"
|
[showNoDataButton]="true"
|
||||||
[tableItemClasses]="{ disabled: disabledFn, 'last-opened': lastOpenedFn }"
|
[tableItemClasses]="{ disabled: disabledFn, 'last-opened': lastOpenedFn }"
|
||||||
noDataButtonIcon="iqser:upload"
|
noDataButtonIcon="iqser:upload"
|
||||||
noDataIcon="iqser:document"
|
noDataIcon="iqser:document"
|
||||||
></iqser-table>
|
></iqser-table>
|
||||||
|
|
||||||
<iqser-workflow
|
<iqser-workflow
|
||||||
(addElement)="fileInput.click()"
|
(addElement)="fileInput.click()"
|
||||||
(noDataAction)="fileInput.click()"
|
(noDataAction)="fileInput.click()"
|
||||||
*ngIf="mode === listingModes.workflow"
|
*ngIf="mode === listingModes.workflow"
|
||||||
[config]="workflowConfig"
|
[config]="workflowConfig"
|
||||||
[itemClasses]="{ disabled: disabledFn }"
|
[itemClasses]="{ disabled: disabledFn }"
|
||||||
[itemTemplate]="workflowItemTemplate"
|
[itemTemplate]="workflowItemTemplate"
|
||||||
[noDataButtonLabel]="'dossier-overview.no-data.action' | translate"
|
[noDataButtonLabel]="'dossier-overview.no-data.action' | translate"
|
||||||
[noDataText]="'dossier-overview.no-data.title' | translate"
|
[noDataText]="'dossier-overview.no-data.title' | translate"
|
||||||
[showNoDataButton]="true"
|
[showNoDataButton]="true"
|
||||||
addElementColumn="UNASSIGNED"
|
addElementColumn="UNASSIGNED"
|
||||||
addElementIcon="iqser:upload"
|
addElementIcon="iqser:upload"
|
||||||
itemHeight="56px"
|
itemHeight="56px"
|
||||||
noDataButtonIcon="iqser:upload"
|
noDataButtonIcon="iqser:upload"
|
||||||
noDataIcon="iqser:document"
|
noDataIcon="iqser:document"
|
||||||
></iqser-workflow>
|
></iqser-workflow>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div [class.collapsed]="collapsedDetails" class="right-container" iqserHasScrollbar>
|
||||||
|
<redaction-dossier-details
|
||||||
|
(openAssignDossierMembersDialog)="openAssignDossierMembersDialog()"
|
||||||
|
(openDossierDictionaryDialog)="openDossierDictionaryDialog()"
|
||||||
|
(toggleCollapse)="toggleCollapsedDetails()"
|
||||||
|
[dossierAttributes]="dossierAttributes"
|
||||||
|
></redaction-dossier-details>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
<div [class.collapsed]="collapsedDetails" class="right-container" iqserHasScrollbar>
|
<ng-template #bulkActions>
|
||||||
<redaction-dossier-details
|
<redaction-dossier-overview-bulk-actions
|
||||||
(openAssignDossierMembersDialog)="openAssignDossierMembersDialog()"
|
(reload)="bulkActionPerformed()"
|
||||||
(openDossierDictionaryDialog)="openDossierDictionaryDialog()"
|
[dossier]="dossier"
|
||||||
(toggleCollapse)="toggleCollapsedDetails()"
|
></redaction-dossier-overview-bulk-actions>
|
||||||
[dossierAttributes]="dossierAttributes"
|
</ng-template>
|
||||||
></redaction-dossier-details>
|
</ng-container>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<ng-template #needsWorkFilterTemplate let-filter="filter">
|
<ng-template #needsWorkFilterTemplate let-filter="filter">
|
||||||
<redaction-type-filter [filter]="filter"></redaction-type-filter>
|
<redaction-type-filter [filter]="filter"></redaction-type-filter>
|
||||||
@ -93,13 +102,6 @@
|
|||||||
|
|
||||||
<input #fileInput (change)="uploadFiles($event.target['files'])" class="file-upload-input" multiple="true" type="file" />
|
<input #fileInput (change)="uploadFiles($event.target['files'])" class="file-upload-input" multiple="true" type="file" />
|
||||||
|
|
||||||
<ng-template #bulkActions>
|
|
||||||
<redaction-dossier-overview-bulk-actions
|
|
||||||
(reload)="bulkActionPerformed()"
|
|
||||||
[dossier]="currentDossier"
|
|
||||||
></redaction-dossier-overview-bulk-actions>
|
|
||||||
</ng-template>
|
|
||||||
|
|
||||||
<ng-template #viewModeSelection>
|
<ng-template #viewModeSelection>
|
||||||
<div *ngIf="listingMode$ | async as mode" class="view-mode-selection">
|
<div *ngIf="listingMode$ | async as mode" class="view-mode-selection">
|
||||||
<div class="all-caps-label" translate="view-mode.view-as"></div>
|
<div class="all-caps-label" translate="view-mode.view-as"></div>
|
||||||
|
|||||||
@ -17,12 +17,10 @@ import { FileDropOverlayService } from '@upload-download/services/file-drop-over
|
|||||||
import { FileUploadModel } from '@upload-download/model/file-upload.model';
|
import { FileUploadModel } from '@upload-download/model/file-upload.model';
|
||||||
import { FileUploadService } from '@upload-download/services/file-upload.service';
|
import { FileUploadService } from '@upload-download/services/file-upload.service';
|
||||||
import { StatusOverlayService } from '@upload-download/services/status-overlay.service';
|
import { StatusOverlayService } from '@upload-download/services/status-overlay.service';
|
||||||
import { TranslateService } from '@ngx-translate/core';
|
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
import { DossierDetailsComponent } from '../components/dossier-details/dossier-details.component';
|
|
||||||
import { UserService } from '@services/user.service';
|
import { UserService } from '@services/user.service';
|
||||||
import { timer } from 'rxjs';
|
import { Observable, timer } from 'rxjs';
|
||||||
import { take, tap } from 'rxjs/operators';
|
import { take, tap, withLatestFrom } from 'rxjs/operators';
|
||||||
import { convertFiles, Files, handleFileDrop } from '@utils/index';
|
import { convertFiles, Files, handleFileDrop } from '@utils/index';
|
||||||
import { DossiersDialogService } from '../../../services/dossiers-dialog.service';
|
import { DossiersDialogService } from '../../../services/dossiers-dialog.service';
|
||||||
import {
|
import {
|
||||||
@ -44,7 +42,7 @@ import { DossierAttributesService } from '@shared/services/controller-wrappers/d
|
|||||||
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker';
|
||||||
import { PermissionsService } from '@services/permissions.service';
|
import { PermissionsService } from '@services/permissions.service';
|
||||||
import { RouterHistoryService } from '@services/router-history.service';
|
import { RouterHistoryService } from '@services/router-history.service';
|
||||||
import { Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
import { FileAttributesService } from '@services/entity-services/file-attributes.service';
|
||||||
import { ConfigService as AppConfigService } from '@services/config.service';
|
import { ConfigService as AppConfigService } from '@services/config.service';
|
||||||
import { ConfigService } from '../config.service';
|
import { ConfigService } from '../config.service';
|
||||||
@ -66,7 +64,6 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
readonly currentUser = this._userService.currentUser;
|
readonly currentUser = this._userService.currentUser;
|
||||||
readonly tableHeaderLabel = _('dossier-overview.table-header.title');
|
readonly tableHeaderLabel = _('dossier-overview.table-header.title');
|
||||||
|
|
||||||
currentDossier = this._dossiersService.activeDossier;
|
|
||||||
collapsedDetails = false;
|
collapsedDetails = false;
|
||||||
dossierAttributes: DossierAttributeWithValue[] = [];
|
dossierAttributes: DossierAttributeWithValue[] = [];
|
||||||
tableColumnConfigs: readonly TableColumnConfig<File>[];
|
tableColumnConfigs: readonly TableColumnConfig<File>[];
|
||||||
@ -74,8 +71,10 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
displayedInFileListAttributes: IFileAttributeConfig[] = [];
|
displayedInFileListAttributes: IFileAttributeConfig[] = [];
|
||||||
displayedAttributes: IFileAttributeConfig[] = [];
|
displayedAttributes: IFileAttributeConfig[] = [];
|
||||||
readonly workflowConfig: WorkflowConfig<File, FileStatus> = this._configService.workflowConfig(() => this.reloadDossiers());
|
readonly workflowConfig: WorkflowConfig<File, FileStatus> = this._configService.workflowConfig(() => this.reloadDossiers());
|
||||||
readonly actionConfigs: readonly ActionConfig[] = this._configService.actionConfig;
|
readonly actionConfigs: readonly ActionConfig[];
|
||||||
@ViewChild(DossierDetailsComponent, { static: false }) private readonly _dossierDetailsComponent: DossierDetailsComponent;
|
readonly dossier$: Observable<Dossier>;
|
||||||
|
readonly dossierId: string;
|
||||||
|
currentDossier: Dossier;
|
||||||
private _lastScrolledIndex: number;
|
private _lastScrolledIndex: number;
|
||||||
@ViewChild('needsWorkFilterTemplate', { read: TemplateRef, static: true })
|
@ViewChild('needsWorkFilterTemplate', { read: TemplateRef, static: true })
|
||||||
private readonly _needsWorkFilterTemplate: TemplateRef<unknown>;
|
private readonly _needsWorkFilterTemplate: TemplateRef<unknown>;
|
||||||
@ -94,7 +93,6 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||||
readonly routerHistoryService: RouterHistoryService,
|
readonly routerHistoryService: RouterHistoryService,
|
||||||
private readonly _appConfigService: AppConfigService,
|
private readonly _appConfigService: AppConfigService,
|
||||||
private readonly _translateService: TranslateService,
|
|
||||||
private readonly _dialogService: DossiersDialogService,
|
private readonly _dialogService: DossiersDialogService,
|
||||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||||
private readonly _fileUploadService: FileUploadService,
|
private readonly _fileUploadService: FileUploadService,
|
||||||
@ -104,8 +102,13 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
private readonly _fileAttributesService: FileAttributesService,
|
private readonly _fileAttributesService: FileAttributesService,
|
||||||
private readonly _configService: ConfigService,
|
private readonly _configService: ConfigService,
|
||||||
private readonly _userPreferenceService: UserPreferenceService,
|
private readonly _userPreferenceService: UserPreferenceService,
|
||||||
|
activatedRoute: ActivatedRoute,
|
||||||
) {
|
) {
|
||||||
super(_injector);
|
super(_injector);
|
||||||
|
this.dossierId = activatedRoute.snapshot.paramMap.get('dossierId');
|
||||||
|
this.actionConfigs = this._configService.actionConfig(this.dossierId);
|
||||||
|
this.dossier$ = this._dossiersService.getEntityChanged$(this.dossierId);
|
||||||
|
this.currentDossier = this._dossiersService.find(this.dossierId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private _fileAttributeConfigs: IFileAttributeConfig[];
|
private _fileAttributeConfigs: IFileAttributeConfig[];
|
||||||
@ -219,20 +222,20 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
calculateData(): void {
|
calculateData(): void {
|
||||||
if (!this._dossiersService.activeDossierId) {
|
if (!this.dossierId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._loadEntitiesFromState();
|
this._loadEntitiesFromState();
|
||||||
this._computeAllFilters();
|
this._computeAllFilters();
|
||||||
|
|
||||||
this._dossierDetailsComponent?.calculateChartConfig();
|
this._changeDetectorRef.markForCheck();
|
||||||
this._changeDetectorRef.detectChanges();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('drop', ['$event'])
|
@HostListener('drop', ['$event'])
|
||||||
onDrop(event: DragEvent): void {
|
onDrop(event: DragEvent): void {
|
||||||
handleFileDrop(event, this.currentDossier, this._uploadFiles.bind(this));
|
const currentDossier = this._dossiersService.find(this.dossierId);
|
||||||
|
handleFileDrop(event, currentDossier, this._uploadFiles.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('dragover', ['$event'])
|
@HostListener('dragover', ['$event'])
|
||||||
@ -242,8 +245,8 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
exportFilesAsCSV() {
|
exportFilesAsCSV() {
|
||||||
this.sortedDisplayedEntities$.pipe(take(1)).subscribe(entities => {
|
this.sortedDisplayedEntities$.pipe(take(1), withLatestFrom(this.dossier$)).subscribe(([entities, dossier]) => {
|
||||||
const fileName = this._dossiersService.activeDossier.dossierName + '.export.csv';
|
const fileName = dossier.dossierName + '.export.csv';
|
||||||
saveAsCSV(
|
saveAsCSV(
|
||||||
fileName,
|
fileName,
|
||||||
entities,
|
entities,
|
||||||
@ -279,12 +282,12 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
openAssignDossierMembersDialog(): void {
|
openAssignDossierMembersDialog(): void {
|
||||||
const data = { dossier: this.currentDossier, section: 'members' };
|
const data = { dossierId: this.dossierId, section: 'members' };
|
||||||
this._dialogService.openDialog('editDossier', null, data, async () => this.reloadDossiers());
|
this._dialogService.openDialog('editDossier', null, data, async () => this.reloadDossiers());
|
||||||
}
|
}
|
||||||
|
|
||||||
openDossierDictionaryDialog() {
|
openDossierDictionaryDialog() {
|
||||||
const data = { dossier: this.currentDossier, section: 'dossierDictionary' };
|
const data = { dossierId: this.dossierId, section: 'dossierDictionary' };
|
||||||
this._dialogService.openDialog('editDossier', null, data, async () => {
|
this._dialogService.openDialog('editDossier', null, data, async () => {
|
||||||
await this.reloadDossiers();
|
await this.reloadDossiers();
|
||||||
});
|
});
|
||||||
@ -298,7 +301,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
moment(file.lastUpdated).add(this._appConfigService.values.RECENT_PERIOD_IN_HOURS, 'hours').isAfter(moment());
|
moment(file.lastUpdated).add(this._appConfigService.values.RECENT_PERIOD_IN_HOURS, 'hours').isAfter(moment());
|
||||||
|
|
||||||
private _loadEntitiesFromState() {
|
private _loadEntitiesFromState() {
|
||||||
this.currentDossier = this._dossiersService.activeDossier;
|
this.currentDossier = this._dossiersService.find(this.dossierId);
|
||||||
if (this.currentDossier) {
|
if (this.currentDossier) {
|
||||||
this.entitiesService.setEntities([...this.currentDossier.files]);
|
this.entitiesService.setEntities([...this.currentDossier.files]);
|
||||||
}
|
}
|
||||||
@ -312,10 +315,6 @@ export class DossierOverviewScreenComponent extends ListingComponent<File> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _computeAllFilters() {
|
private _computeAllFilters() {
|
||||||
if (!this.currentDossier) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const filterGroups = this._configService.filterGroups(
|
const filterGroups = this._configService.filterGroups(
|
||||||
this.entitiesService.all,
|
this.entitiesService.all,
|
||||||
this.listingMode,
|
this.listingMode,
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<iqser-status-bar [configs]="statusConfig"></iqser-status-bar>
|
<iqser-status-bar [configs]="statusConfig"></iqser-status-bar>
|
||||||
<div class="action-buttons" (longPress)="forceReanalysisAction($event)" redactionLongPress>
|
<div (longPress)="forceReanalysisAction($event)" class="action-buttons" redactionLongPress>
|
||||||
<iqser-circle-button
|
<iqser-circle-button
|
||||||
(action)="openEditDossierDialog($event, dossier)"
|
(action)="openEditDossierDialog($event, dossier.dossierId)"
|
||||||
*ngIf="currentUser.isManager"
|
*ngIf="currentUser.isManager"
|
||||||
[tooltip]="'dossier-listing.edit.action' | translate"
|
[tooltip]="'dossier-listing.edit.action' | translate"
|
||||||
[type]="circleButtonTypes.dark"
|
[type]="circleButtonTypes.dark"
|
||||||
|
|||||||
@ -55,9 +55,9 @@ export class DossiersListingActionsComponent {
|
|||||||
this.analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled;
|
this.analysisForced = !$event.touchEnd && this._userPreferenceService.areDevFeaturesEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
openEditDossierDialog($event: MouseEvent, dossier: Dossier): void {
|
openEditDossierDialog($event: MouseEvent, dossierId: string): void {
|
||||||
this._dialogService.openDialog('editDossier', $event, {
|
this._dialogService.openDialog('editDossier', $event, {
|
||||||
dossier,
|
dossierId,
|
||||||
afterSave: () => this.actionPerformed.emit(),
|
afterSave: () => this.actionPerformed.emit(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,8 @@ import { DossiersService } from '@services/entity-services/dossiers.service';
|
|||||||
})
|
})
|
||||||
export class DossiersListingScreenComponent
|
export class DossiersListingScreenComponent
|
||||||
extends ListingComponent<Dossier>
|
extends ListingComponent<Dossier>
|
||||||
implements OnInit, AfterViewInit, OnDestroy, OnAttach, OnDetach {
|
implements OnInit, AfterViewInit, OnDestroy, OnAttach, OnDetach
|
||||||
|
{
|
||||||
readonly currentUser = this._userService.currentUser;
|
readonly currentUser = this._userService.currentUser;
|
||||||
readonly tableColumnConfigs = this._configService.tableConfig;
|
readonly tableColumnConfigs = this._configService.tableConfig;
|
||||||
readonly tableHeaderLabel = _('dossier-listing.table-header.title');
|
readonly tableHeaderLabel = _('dossier-listing.table-header.title');
|
||||||
@ -111,7 +112,7 @@ export class DossiersListingScreenComponent
|
|||||||
await this._router.navigate([`/main/dossiers/${addResponse.dossier.id}`]);
|
await this._router.navigate([`/main/dossiers/${addResponse.dossier.id}`]);
|
||||||
if (addResponse.addMembers) {
|
if (addResponse.addMembers) {
|
||||||
this._dialogService.openDialog('editDossier', null, {
|
this._dialogService.openDialog('editDossier', null, {
|
||||||
dossier: addResponse.dossier,
|
dossierId: addResponse.dossier.dossierId,
|
||||||
section: 'members',
|
section: 'members',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,6 +70,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
excludePages = false;
|
excludePages = false;
|
||||||
@ViewChild(PdfViewerComponent) readonly viewerComponent: PdfViewerComponent;
|
@ViewChild(PdfViewerComponent) readonly viewerComponent: PdfViewerComponent;
|
||||||
@ViewChild('fileActions') fileActions: FileActionsComponent;
|
@ViewChild('fileActions') fileActions: FileActionsComponent;
|
||||||
|
readonly dossierId: string;
|
||||||
private _instance: WebViewerInstance;
|
private _instance: WebViewerInstance;
|
||||||
private _lastPage: string;
|
private _lastPage: string;
|
||||||
private _reloadFileOnReanalysis = false;
|
private _reloadFileOnReanalysis = false;
|
||||||
@ -103,6 +104,7 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
private readonly _translateService: TranslateService,
|
private readonly _translateService: TranslateService,
|
||||||
) {
|
) {
|
||||||
super();
|
super();
|
||||||
|
this.dossierId = _activatedRoute.snapshot.paramMap.get('dossierId');
|
||||||
this._loadingService.start();
|
this._loadingService.start();
|
||||||
document.documentElement.addEventListener('fullscreenchange', () => {
|
document.documentElement.addEventListener('fullscreenchange', () => {
|
||||||
if (!document.fullscreenElement) {
|
if (!document.fullscreenElement) {
|
||||||
@ -243,9 +245,9 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
|
|||||||
super.ngOnDestroy();
|
super.ngOnDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
async ngOnAttach(previousRoute: ActivatedRouteSnapshot): Promise<void> {
|
async ngOnAttach(previousRoute: ActivatedRouteSnapshot): Promise<boolean> {
|
||||||
if (!this.appStateService.activeFile.canBeOpened) {
|
if (!this.appStateService.activeFile.canBeOpened) {
|
||||||
return this.dossiersService.goToActiveDossier();
|
return this._router.navigate([this.dossiersService.find(this.dossierId)?.routerLink]);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.ngOnInit();
|
await this.ngOnInit();
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import { OverlayRef } from '@angular/cdk/overlay';
|
|||||||
import { StatusOverlayService } from '../services/status-overlay.service';
|
import { StatusOverlayService } from '../services/status-overlay.service';
|
||||||
import { handleFileDrop } from '@utils/file-drop-utils';
|
import { handleFileDrop } from '@utils/file-drop-utils';
|
||||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'redaction-file-drop',
|
selector: 'redaction-file-drop',
|
||||||
@ -18,6 +19,7 @@ export class FileDropComponent {
|
|||||||
private readonly _dossiersService: DossiersService,
|
private readonly _dossiersService: DossiersService,
|
||||||
private readonly _changeDetectorRef: ChangeDetectorRef,
|
private readonly _changeDetectorRef: ChangeDetectorRef,
|
||||||
private readonly _statusOverlayService: StatusOverlayService,
|
private readonly _statusOverlayService: StatusOverlayService,
|
||||||
|
private readonly _activatedRoute: ActivatedRoute,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
@ -33,7 +35,9 @@ export class FileDropComponent {
|
|||||||
|
|
||||||
@HostListener('drop', ['$event'])
|
@HostListener('drop', ['$event'])
|
||||||
onDrop(event: DragEvent) {
|
onDrop(event: DragEvent) {
|
||||||
handleFileDrop(event, this._dossiersService.activeDossier, this.uploadFiles.bind(this));
|
const dossierId = this._activatedRoute.snapshot.paramMap.get('dossierId');
|
||||||
|
console.log(dossierId);
|
||||||
|
handleFileDrop(event, this._dossiersService.find(dossierId), this.uploadFiles.bind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@HostListener('dragover', ['$event'])
|
@HostListener('dragover', ['$event'])
|
||||||
@ -48,6 +52,6 @@ export class FileDropComponent {
|
|||||||
this._statusOverlayService.openUploadStatusOverlay();
|
this._statusOverlayService.openUploadStatusOverlay();
|
||||||
}
|
}
|
||||||
this._dialogRef.detach();
|
this._dialogRef.detach();
|
||||||
this._changeDetectorRef.detectChanges();
|
this._changeDetectorRef.markForCheck();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,7 +29,7 @@ export class AppStateGuard implements CanActivate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this._userService.currentUser.isUser) {
|
if (this._userService.currentUser.isUser) {
|
||||||
await this._appStateService.loadAllDossiersIfNecessary();
|
await this._dossiersService.loadAllIfEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
const { dossierId, fileId, dossierTemplateId, type } = route.params;
|
const { dossierId, fileId, dossierTemplateId, type } = route.params;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { IListable, List } from '@iqser/common-ui';
|
import { Entity, List } from '@iqser/common-ui';
|
||||||
import { StatusSorter } from '../shared';
|
import { StatusSorter } from '../shared';
|
||||||
import { FileStatus, FileStatuses } from './types';
|
import { FileStatus, FileStatuses } from './types';
|
||||||
import { IFile } from './file';
|
import { IFile } from './file';
|
||||||
@ -12,7 +12,7 @@ const processingStatuses: List<FileStatus> = [
|
|||||||
FileStatuses.PROCESSING,
|
FileStatuses.PROCESSING,
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export class File implements IFile, IListable {
|
export class File extends Entity<IFile> implements IFile {
|
||||||
readonly added?: string;
|
readonly added?: string;
|
||||||
readonly allManualRedactionsApplied: boolean;
|
readonly allManualRedactionsApplied: boolean;
|
||||||
readonly analysisDuration?: number;
|
readonly analysisDuration?: number;
|
||||||
@ -64,6 +64,7 @@ export class File implements IFile, IListable {
|
|||||||
readonly canBeOCRed: boolean;
|
readonly canBeOCRed: boolean;
|
||||||
|
|
||||||
constructor(file: IFile, readonly reviewerName: string, fileAttributesConfig?: IFileAttributesConfig) {
|
constructor(file: IFile, readonly reviewerName: string, fileAttributesConfig?: IFileAttributesConfig) {
|
||||||
|
super(file);
|
||||||
this.added = file.added;
|
this.added = file.added;
|
||||||
this.allManualRedactionsApplied = !!file.allManualRedactionsApplied;
|
this.allManualRedactionsApplied = !!file.allManualRedactionsApplied;
|
||||||
this.analysisDuration = file.analysisDuration;
|
this.analysisDuration = file.analysisDuration;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user