Pull request #301: RED-2579
Merge in RED/ui from RED-2579 to master * commit '9aef5c8c9dfc118f48d8d1f5128096fa90f12035': deleted files count in observable added link to deleted files & trash icon
This commit is contained in:
commit
347efe13a3
@ -43,6 +43,10 @@
|
||||
<mat-icon svgIcon="red:dictionary"></mat-icon>
|
||||
<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>
|
||||
|
||||
<ng-container *ngIf="dossierAttributes?.length">
|
||||
<div (click)="attributesExpanded = true" *ngIf="!attributesExpanded" class="all-caps-label show-attributes">
|
||||
@ -50,7 +54,11 @@
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="attributesExpanded">
|
||||
<div (click)="openEditDossierAttributesDialog(dossier)" *ngFor="let attr of dossierAttributes" class="link-property">
|
||||
<div
|
||||
(click)="openEditDossierAttributesDialog(dossier, '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>
|
||||
|
||||
@ -4,6 +4,9 @@ import { Dossier, DossierAttributeWithValue, DossierTemplate } from '@red/domain
|
||||
import { DossiersDialogService } from '../../../../services/dossiers-dialog.service';
|
||||
import { DossiersService } from '@services/entity-services/dossiers.service';
|
||||
import { DossierTemplatesService } from '@services/entity-services/dossier-templates.service';
|
||||
import { FilesService } from '../../../../../../services/entity-services/files.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { distinctUntilChanged, map, switchMap } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-dossier-details-stats',
|
||||
@ -12,6 +15,7 @@ import { DossierTemplatesService } from '@services/entity-services/dossier-templ
|
||||
})
|
||||
export class DossierDetailsStatsComponent {
|
||||
attributesExpanded = false;
|
||||
deletedFilesCount$: Observable<number>;
|
||||
@Input() dossierAttributes: DossierAttributeWithValue[];
|
||||
@Output() readonly openDossierDictionaryDialog = new EventEmitter();
|
||||
|
||||
@ -19,17 +23,24 @@ export class DossierDetailsStatsComponent {
|
||||
private readonly _appStateService: AppStateService,
|
||||
private readonly _dossierTemplatesService: DossierTemplatesService,
|
||||
private readonly _dialogService: DossiersDialogService,
|
||||
private readonly _filesService: FilesService,
|
||||
readonly dossiersService: DossiersService,
|
||||
) {}
|
||||
) {
|
||||
this.deletedFilesCount$ = dossiersService.activeDossier$.pipe(
|
||||
switchMap(dossier => _filesService.getDeletedFilesFor(dossier.id)),
|
||||
map(files => files.length),
|
||||
distinctUntilChanged(),
|
||||
);
|
||||
}
|
||||
|
||||
dossierTemplate(dossier: Dossier): DossierTemplate {
|
||||
return this._dossierTemplatesService.find(dossier.dossierTemplateId);
|
||||
}
|
||||
|
||||
openEditDossierAttributesDialog(dossier: Dossier) {
|
||||
openEditDossierAttributesDialog(dossier: Dossier, section: string) {
|
||||
this._dialogService.openDialog('editDossier', null, {
|
||||
dossier,
|
||||
section: 'dossierAttributes',
|
||||
section: section,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -618,7 +618,8 @@
|
||||
"created-on": "Erstellt am {date}",
|
||||
"documents": "{count} Dokumente",
|
||||
"due-date": "Geburtstermin",
|
||||
"people": "{count} Benutzer"
|
||||
"people": "{count} Benutzer",
|
||||
"deleted": "{count} "
|
||||
}
|
||||
},
|
||||
"download-file": "Herunterladen",
|
||||
|
||||
@ -683,7 +683,8 @@
|
||||
"created-on": "Created on {date}",
|
||||
"documents": "{count} {count, plural, one{document} other{documents}}",
|
||||
"due-date": "Due {date}",
|
||||
"people": "{count} {count, plural, one{user} other{users}}"
|
||||
"people": "{count} {count, plural, one{user} other{users}}",
|
||||
"deleted": "{count} deleted files"
|
||||
}
|
||||
},
|
||||
"download-file": "Download",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user