some css and label fixes

This commit is contained in:
Timo Bejan 2020-10-27 21:41:10 +02:00
parent 446cbab809
commit 1f0b0f952e
20 changed files with 220 additions and 137 deletions

View File

@ -37,7 +37,6 @@ import { FileDetailsDialogComponent } from './dialogs/file-details-dialog/file-d
import { ToastrModule } from 'ngx-toastr';
import { ServiceWorkerModule } from '@angular/service-worker';
import { environment } from '../environments/environment';
import { ProjectDetailsDialogComponent } from './dialogs/project-details-dialog/project-details-dialog.component';
import { AuthModule } from './auth/auth.module';
import { FileUploadModule } from './upload/file-upload.module';
import { FullPageLoadingIndicatorComponent } from './utils/full-page-loading-indicator/full-page-loading-indicator.component';
@ -76,7 +75,6 @@ export function HttpLoaderFactory(httpClient: HttpClient) {
FilePreviewScreenComponent,
PdfViewerComponent,
FileDetailsDialogComponent,
ProjectDetailsDialogComponent,
AssignOwnerDialogComponent,
FullPageLoadingIndicatorComponent,
InitialsAvatarComponent,

View File

@ -7,7 +7,7 @@
<form (submit)="saveUsers()" [formGroup]="usersForm">
<div class="dialog-content">
<div class="red-input-group">
<mat-form-field>
<mat-form-field floatLabel="always">
<mat-label>{{
'assign-' + data.type + '-owner.dialog.single-user.label' | translate
}}</mat-label>
@ -22,7 +22,7 @@
</mat-form-field>
</div>
<div class="red-input-group">
<mat-form-field *ngIf="data.type === 'project'">
<mat-form-field *ngIf="data.type === 'project'" floatLabel="always">
<mat-label>{{
'assign-' + data.type + '-owner.dialog.multi-user.label' | translate
}}</mat-label>

View File

@ -11,10 +11,9 @@ import {
import { ConfirmationDialogComponent } from '../common/confirmation-dialog/confirmation-dialog.component';
import { NotificationService, NotificationType } from '../notification/notification.service';
import { TranslateService } from '@ngx-translate/core';
import { AppStateService, ProjectWrapper } from '../state/app-state.service';
import { AppStateService } from '../state/app-state.service';
import { AddEditProjectDialogComponent } from './add-edit-project-dialog/add-edit-project-dialog.component';
import { AssignOwnerDialogComponent } from './assign-owner-dialog/assign-owner-dialog.component';
import { ProjectDetailsDialogComponent } from './project-details-dialog/project-details-dialog.component';
import { ManualRedactionDialogComponent } from './manual-redaction-dialog/manual-redaction-dialog.component';
import { Annotations } from '@pdftron/webviewer';
@ -250,17 +249,6 @@ export class DialogService {
return ref;
}
public openProjectDetailsDialog(
$event: MouseEvent,
project: ProjectWrapper
): MatDialogRef<ProjectDetailsDialogComponent> {
$event.stopPropagation();
return this._dialog.open(ProjectDetailsDialogComponent, {
...dialogConfig,
data: project
});
}
public openAddProjectDialog(cb?: Function): MatDialogRef<AddEditProjectDialogComponent> {
const ref = this._dialog.open(AddEditProjectDialogComponent, {
...dialogConfig,

View File

@ -1,7 +1,7 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FileStatus, FileUploadControllerService } from '@redaction/red-ui-http';
import { FileStatus } from '@redaction/red-ui-http';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { download } from '../../utils/file-download-utils';
import { AppStateService } from '../../state/app-state.service';
@Component({
selector: 'redaction-file-details-dialog',
@ -10,7 +10,7 @@ import { download } from '../../utils/file-download-utils';
})
export class FileDetailsDialogComponent implements OnInit {
constructor(
private readonly _fileUploadControllerService: FileUploadControllerService,
private readonly _appStateService: AppStateService,
public dialogRef: MatDialogRef<FileDetailsDialogComponent>,
@Inject(MAT_DIALOG_DATA) public fileStatus: FileStatus
) {}
@ -18,10 +18,6 @@ export class FileDetailsDialogComponent implements OnInit {
ngOnInit(): void {}
downloadRedactionReport() {
this._fileUploadControllerService
.downloadRedactionReport({ fileIds: [this.fileStatus.fileId] }, true, 'response')
.subscribe((data) => {
download(data, 'redaction-report-' + this.fileStatus.filename + '.docx');
});
this._appStateService.downloadFileRedactionReport(this.fileStatus);
}
}

View File

@ -1,43 +0,0 @@
<section class="dialog">
<div [translate]="'project-details.dialog.title.label'" class="dialog-header heading-l"></div>
<div class="dialog-content">
<div class="file-details">
<div class="detail-row">
{{ projectDetails.project.projectName }}
</div>
<div class="detail-row">
{{ projectDetails.project.description }}
</div>
<div class="detail-row">
{{ projectDetails.project.date | date: 'short' }}
</div>
<div class="detail-row">
{{
'project-details.dialog.info.file-count.label'
| translate
: { fileCount: projectDetails.files ? projectDetails.files.length : 0 }
}}
</div>
</div>
</div>
<div class="dialog-actions">
<button
(click)="downloadRedactionReport()"
color="primary"
mat-flat-button
translate="project-details.dialog.actions.download-redaction-report.label"
></button>
<button
(click)="reanalyseProject()"
color="primary"
mat-flat-button
translate="project-details.dialog.actions.reanalyse-project.label"
></button>
</div>
<button (click)="dialogRef.close()" class="dialog-close" mat-icon-button>
<mat-icon svgIcon="red:close"></mat-icon>
</button>
</section>

View File

@ -1,44 +0,0 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FileUploadControllerService, ReanalysisControllerService } from '@redaction/red-ui-http';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { download } from '../../utils/file-download-utils';
import { ProjectWrapper } from '../../state/app-state.service';
@Component({
selector: 'redaction-project-details-dialog',
templateUrl: './project-details-dialog.component.html',
styleUrls: ['./project-details-dialog.component.scss']
})
export class ProjectDetailsDialogComponent implements OnInit {
constructor(
private readonly _fileUploadControllerService: FileUploadControllerService,
private readonly _reanalysisControllerService: ReanalysisControllerService,
public dialogRef: MatDialogRef<ProjectDetailsDialogComponent>,
@Inject(MAT_DIALOG_DATA) public projectDetails: ProjectWrapper
) {}
ngOnInit(): void {}
downloadRedactionReport() {
this._fileUploadControllerService
.downloadRedactionReportForProject(
this.projectDetails.project.projectId,
true,
'response'
)
.subscribe((data) => {
download(
data,
'redaction-report-' + this.projectDetails.project.projectName + '.docx'
);
});
}
reanalyseProject() {
this._reanalysisControllerService
.reanalyzeProject(this.projectDetails.project.projectId)
.subscribe(() => {
this.dialogRef.close();
});
}
}

View File

@ -1,4 +1,4 @@
<section>
<section [class.hidden]="!viewReady">
<div class="page-header">
<div class="flex-1">
<mat-slide-toggle color="primary" labelPosition="after" [(ngModel)]="redactedView">
@ -273,4 +273,6 @@
</div>
</section>
<!--<redaction-full-page-loading-indicator [displayed]="!viewReady"></redaction-full-page-loading-indicator>-->
<redaction-full-page-loading-indicator
[displayed]="!viewReady"
></redaction-full-page-loading-indicator>

View File

@ -48,6 +48,7 @@ export class FilePreviewScreenComponent implements OnInit {
public filters: AnnotationFilters;
public expandedFilters: AnnotationFilters = { hint: false };
public pagesPanelActive = true;
public viewReady: boolean = false;
constructor(
public readonly appStateService: AppStateService,
@ -91,11 +92,9 @@ export class FilePreviewScreenComponent implements OnInit {
public ngOnInit(): void {
// PDFTRON cache fix
localStorage.clear();
this._reloadFiles();
this.appStateService.fileStatusChanged.subscribe((fileStatus) => {
if (fileStatus.fileId === this.fileId) {
console.log(fileStatus);
this._reloadFiles();
}
});
@ -184,6 +183,7 @@ export class FilePreviewScreenComponent implements OnInit {
public selectPage(pageNumber: number) {
this._viewerComponent.navigateToPage(pageNumber);
this._scrollAnnotationsToPage(pageNumber, 'always');
}
public openManualRedactionDialog($event: ManualRedactionEntry) {
@ -213,17 +213,24 @@ export class FilePreviewScreenComponent implements OnInit {
if (this.selectedAnnotation?.getPageNumber() === this.activeViewerPage) {
return;
}
const elements: any[] = this._annotationsElement.nativeElement.querySelectorAll(
`div[anotation-page-header="${this.activeViewerPage}"]`
);
this._scrollToFirstElement(elements);
this._scrollAnnotationsToPage(this.activeViewerPage);
}
private _scrollToFirstElement(elements: HTMLElement[]) {
private _scrollAnnotationsToPage(page: number, mode: 'always' | 'if-needed' = 'if-needed') {
const elements: any[] = this._annotationsElement.nativeElement.querySelectorAll(
`div[anotation-page-header="${page}"]`
);
this._scrollToFirstElement(elements, mode);
}
private _scrollToFirstElement(
elements: HTMLElement[],
mode: 'always' | 'if-needed' = 'if-needed'
) {
if (elements.length > 0) {
scrollIntoView(elements[0], {
behavior: 'smooth',
scrollMode: 'if-needed',
scrollMode: mode,
block: 'start',
inline: 'start'
});
@ -445,6 +452,7 @@ export class FilePreviewScreenComponent implements OnInit {
viewerReady($event: WebViewerInstance) {
this.instance = $event;
this.viewReady = true;
}
handleAnnotationsAdded(annotations: Annotations.Annotation[]) {

View File

@ -127,6 +127,7 @@ export class PdfViewerComponent implements OnInit, AfterViewInit, OnChanges {
private _disableElements() {
this.instance.disableElements([
'menuButton',
'textHighlightToolButton',
'textUnderlineToolButton',
'textSquigglyToolButton',

View File

@ -132,7 +132,7 @@
<button
mat-icon-button
color="accent"
(click)="openProjectDetailsDialog($event, pw)"
(click)="downloadRedactionReport($event, pw.project)"
[matTooltip]="'project-listing.report.action.label' | translate"
>
<mat-icon svgIcon="red:report"></mat-icon>
@ -145,6 +145,14 @@
>
<mat-icon svgIcon="red:assign"></mat-icon>
</button>
<button
color="accent"
(click)="reanalyseProject($event, pw.project)"
mat-icon-button
[matTooltip]="'project-listing.reanalyse.action.label' | translate"
>
<mat-icon svgIcon="red:refresh"></mat-icon>
</button>
</div>
</div>
</div>

View File

@ -1,11 +1,12 @@
import { Component, OnInit } from '@angular/core';
import { Project } from '@redaction/red-ui-http';
import { FileUploadControllerService, Project } from '@redaction/red-ui-http';
import { AppStateService, ProjectWrapper } from '../../state/app-state.service';
import { UserService } from '../../user/user.service';
import { DoughnutChartConfig } from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
import { SortingOption } from '../../utils/types';
import { groupBy } from '../../utils/functions';
import { DialogService } from '../../dialogs/dialog.service';
import { download } from '../../utils/file-download-utils';
@Component({
selector: 'redaction-project-listing-screen',
@ -27,6 +28,7 @@ export class ProjectListingScreenComponent implements OnInit {
constructor(
public readonly appStateService: AppStateService,
private readonly _fileUploadControllerService: FileUploadControllerService,
private readonly _userService: UserService,
private readonly _dialogService: DialogService
) {}
@ -94,8 +96,9 @@ export class ProjectListingScreenComponent implements OnInit {
});
}
public openProjectDetailsDialog($event: MouseEvent, project: ProjectWrapper) {
this._dialogService.openProjectDetailsDialog($event, project);
downloadRedactionReport($event: MouseEvent, project: Project) {
$event.preventDefault();
this.appStateService.downloadRedactionReport(project);
}
public openAssignProjectOwnerDialog($event: MouseEvent, project: Project) {
@ -117,4 +120,9 @@ export class ProjectListingScreenComponent implements OnInit {
.sort()
.map((status) => ({ length: obj[status], color: status }));
}
reanalyseProject($event: MouseEvent, project: Project) {
$event.preventDefault();
this.appStateService.reanalyseProject(project);
}
}

View File

@ -191,7 +191,7 @@
<mat-icon svgIcon="red:trash"></mat-icon>
</button>
<button
(click)="$event.stopPropagation()"
(click)="downloadFileRedactionReport($event, fileStatus)"
color="accent"
mat-icon-button
[matTooltip]="'project-overview.report.action.label' | translate"
@ -210,9 +210,9 @@
(click)="reanalyseFile($event, fileStatus)"
color="accent"
mat-icon-button
[matTooltip]="'project-overview.bar-charts.action.label' | translate"
[matTooltip]="'project-overview.reanalyse.action.label' | translate"
>
<mat-icon svgIcon="red:analyse"></mat-icon>
<mat-icon svgIcon="red:refresh"></mat-icon>
</button>
</div>
</div>
@ -228,7 +228,7 @@
<button mat-icon-button (click)="openEditProjectDialog($event)">
<mat-icon svgIcon="red:edit"></mat-icon>
</button>
<button mat-icon-button (click)="openDetailsDialog($event)">
<button mat-icon-button (click)="downloadRedactionReport($event)">
<mat-icon svgIcon="red:report"></mat-icon>
</button>
</div>

View File

@ -2,6 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import {
FileStatus,
FileUploadControllerService,
ReanalysisControllerService,
StatusControllerService
} from '@redaction/red-ui-http';
@ -16,6 +17,7 @@ import { SortingOption } from '../../utils/types';
import { DoughnutChartConfig } from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
import { groupBy } from '../../utils/functions';
import { DialogService } from '../../dialogs/dialog.service';
import { download } from '../../utils/file-download-utils';
@Component({
selector: 'redaction-project-overview-screen',
@ -50,6 +52,7 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
constructor(
public readonly appStateService: AppStateService,
private readonly _activatedRoute: ActivatedRoute,
private readonly _fileUploadControllerService: FileUploadControllerService,
private readonly _statusControllerService: StatusControllerService,
private readonly _notificationService: NotificationService,
private readonly _dialogService: DialogService,
@ -152,8 +155,14 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
);
}
public openDetailsDialog($event: MouseEvent) {
this._dialogService.openProjectDetailsDialog($event, this.appStateService.activeProject);
downloadFileRedactionReport($event: MouseEvent, file: FileStatus) {
$event.stopPropagation();
this.appStateService.downloadFileRedactionReport(file);
}
downloadRedactionReport($event: MouseEvent) {
$event.stopPropagation();
this.appStateService.downloadRedactionReport();
}
public openEditProjectDialog($event: MouseEvent) {

View File

@ -1,6 +1,7 @@
import { EventEmitter, Injectable } from '@angular/core';
import {
FileStatus,
FileUploadControllerService,
Project,
ProjectControllerService,
ReanalysisControllerService,
@ -12,6 +13,7 @@ import { Router } from '@angular/router';
import { UserService } from '../user/user.service';
import { interval } from 'rxjs';
import { tap } from 'rxjs/operators';
import { download } from '../utils/file-download-utils';
export interface AppState {
projects: ProjectWrapper[];
@ -41,6 +43,7 @@ export class AppStateService {
constructor(
private readonly _router: Router,
private readonly _userService: UserService,
private readonly _fileUploadControllerService: FileUploadControllerService,
private readonly _projectControllerService: ProjectControllerService,
private readonly _notificationService: NotificationService,
private readonly _reanalysisControllerService: ReanalysisControllerService,
@ -74,6 +77,13 @@ export class AppStateService {
return this._appState.activeProject?.project?.ownerId === this._userService.userId;
}
get isActiveProjectOwnerAndManager() {
return (
this._appState.activeProject?.project?.ownerId === this._userService.userId &&
this._userService.isManager(this._userService.user)
);
}
get isActiveProjectMember() {
return (
this._appState.activeProject?.project?.memberIds?.indexOf(this._userService.userId) >= 0
@ -181,6 +191,24 @@ export class AppStateService {
return files;
}
reanalyseProject(project?: Project) {
if (!project) {
project = this.activeProject.project;
}
this._reanalysisControllerService.reanalyzeProject(project.projectId).subscribe(() => {});
}
downloadRedactionReport(project?: Project) {
if (!project) {
project = this.activeProject.project;
}
this._fileUploadControllerService
.downloadRedactionReportForProject(project.projectId, true, 'response')
.subscribe((data) => {
download(data, 'redaction-report-' + project.projectName + '.docx');
});
}
activateProject(projectId: string) {
this._appState.activeFile = null;
this._appState.activeProject = this._appState.projects.find(
@ -295,4 +323,12 @@ export class AppStateService {
.toPromise();
await this.reloadActiveProjectFiles();
}
downloadFileRedactionReport(file: FileStatus) {
this._fileUploadControllerService
.downloadRedactionReport({ fileIds: [file.fileId] }, true, 'response')
.subscribe((data) => {
download(data, 'redaction-report-' + file.filename + '.docx');
});
}
}

View File

@ -17,6 +17,14 @@
}
},
"manual-redaction": {
"confirm-annotation": {
"success": {
"label": "Anmerkung bestätigt!"
},
"failed": {
"label": "Fehler beim Bestätigen des Entfernens von Anmerkungen!"
}
},
"remove-annotation": {
"success": {
"label": "Anmerkung Zum Entfernen empfohlen!"
@ -44,16 +52,19 @@
},
"content": {
"text": {
"label": "<strong>Ausgewählter Text:</strong> {{value}}"
"label": "Ausgewählter Text:"
},
"dictionary": {
"add": {
"label": "Zum Wörterbuch hinzufügen"
},
"label": "Wörterbuch"
"label": "Art"
},
"reason": {
"label": "Grund"
},
"comment": {
"label": "Kommentar"
}
}
}
@ -165,6 +176,17 @@
"label": "Kürzlich"
}
},
"table-col-names": {
"name": {
"label": "Name"
},
"owner": {
"label": "Inhaber"
},
"status": {
"label": "Status"
}
},
"stats": {
"analyzed-pages": {
"label": "Analysierte Seiten"
@ -194,6 +216,9 @@
},
"name": {
"label": "Name"
},
"due-date": {
"label": "Geburtstermin"
}
},
"actions": {
@ -298,6 +323,9 @@
"recent": {
"label": "Kürzlich"
},
"oldest": {
"label": "Älteste"
},
"alphabetically": {
"label": "Alphabetisch"
},
@ -361,6 +389,17 @@
},
"no-project": {
"label": "Angefordertes Projekt: {{projectId}} existiert nicht! <a href='/ui/projects'>Zurück zur Projektliste.</a>"
},
"legend": {
"contains-hints": {
"label": "Enthält Hinweise"
},
"contains-redactions": {
"label": "Enthält Redaktionen"
},
"contains-suggestions": {
"label": "Enthält Vorschläge zur Redaktion"
}
}
},
"file-preview": {
@ -446,6 +485,35 @@
"label": "Nicht zugewiesen"
}
},
"assign-file-owner": {
"dialog": {
"single-user": {
"label": "Gutachter"
},
"title": {
"label": "File Reviewer verwalten"
},
"save": {
"label": "speichern"
}
}
},
"assign-project-owner": {
"dialog": {
"single-user": {
"label": "Inhaber"
},
"multi-user": {
"label": "Mitglieder"
},
"title": {
"label": "Projektbesitzer und Mitglieder verwalten"
},
"save": {
"label": "speichern"
}
}
},
"unassigned": "Nicht zugewiesen",
"under-review": "Wird überprüft",
"under-approval": "In Genehmigung",

View File

@ -165,6 +165,21 @@
}
},
"project-listing": {
"report": {
"action": {
"label": "Download Redaction Report"
}
},
"reanalyse": {
"action": {
"label": "Reanalyse entire Project"
}
},
"assign": {
"action": {
"label": "Assign Owner & Members"
}
},
"table-header": {
"title": {
"label": "{{length}} active projects"
@ -291,6 +306,16 @@
}
},
"project-overview": {
"report": {
"action": {
"label": "Download Redaction Report"
}
},
"assign": {
"action": {
"label": "Assign Reviewer"
}
},
"table-header": {
"title": {
"label": "{{length}} documents"

View File

@ -2,8 +2,7 @@
viewBox="0 0 487.23 487.23"
width="487.23px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg"
y="0px">
<g>
<g>
<g fill="currentColor">
<path d="M55.323,203.641c15.664,0,29.813-9.405,35.872-23.854c25.017-59.604,83.842-101.61,152.42-101.61
c37.797,0,72.449,12.955,100.23,34.442l-21.775,3.371c-7.438,1.153-13.224,7.054-14.232,14.512
c-1.01,7.454,3.008,14.686,9.867,17.768l119.746,53.872c5.249,2.357,11.33,1.904,16.168-1.205
@ -17,6 +16,5 @@
c-0.042,7.506,4.85,14.144,12.024,16.332c7.185,2.188,14.948-0.59,19.104-6.839l16.505-24.805
c44.004,43.32,104.303,70.098,170.788,70.098c100.811,0,187.481-61.561,224.446-149.059
C473.197,326.043,471.903,312.157,464.635,301.184z"/>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -6,6 +6,16 @@
flex-direction: column;
margin-top: 13px;
.mat-form-field-underline {
display: none;
}
.mat-form-field-label {
opacity: 0.7 !important;
color: $grey-1 !important;
transform: translateY(-1.34em) !important;
}
&:first-child {
margin-top: 0;
}
@ -57,6 +67,7 @@
letter-spacing: 0;
line-height: 14px;
margin-bottom: 2px;
color: $grey-1;
&.mat-checkbox-layout {
opacity: 1;

View File

@ -117,3 +117,17 @@ Your user doesn't have the required RED-* roles to access this application. Plea
Your user doesn't have the required RED-* roles to access this application. Please contact <a href={{adminUrl}} target=_blank >{{adminName}}</a> for access!|Ihr Benutzer verfügt nicht über die erforderlichen RED- * -Rollen, um auf diese Anwendung zuzugreifen. Bitte kontaktieren Sie <a href={{adminUrl}} target=_blank >{{adminName}}</a> für den Zugriff!
Your user doesn't have the required RED-* roles to access this application. Please contact {{adminName}} for access!|Ihr Benutzer verfügt nicht über die erforderlichen RED- * -Rollen, um auf diese Anwendung zuzugreifen. Bitte kontaktieren Sie {{adminName}} für den Zugriff!
Your user doesn't have the required RED-* roles to access this application. Please contact <a href={{adminUrl}} target=_blank >your admin</a> for access!|Ihr Benutzer verfügt nicht über die erforderlichen RED- * -Rollen, um auf diese Anwendung zuzugreifen. Bitte kontaktieren Sie <a href={{adminUrl}} target=_blank >Ihren Administrator</a> für den Zugriff!
Annotation Confirmed!|Anmerkung bestätigt!
Error confirming Annotation removal!|Fehler beim Bestätigen des Entfernens von Anmerkungen!
Selected text:|Ausgewählter Text:
Type|Art
Owner|Inhaber
Oldest|Älteste
Contains hints |Enthält Hinweise
Contains redactions |Enthält Redaktionen
Contains suggestions for redaction |Enthält Vorschläge zur Redaktion
Reviewer|Gutachter
Manage File Reviewer|File Reviewer verwalten
Save|speichern
Members|Mitglieder
Manage Project Owner and Members|Projektbesitzer und Mitglieder verwalten