diff --git a/apps/red-ui/src/app/app.module.ts b/apps/red-ui/src/app/app.module.ts
index caccfd437..fa74b8195 100644
--- a/apps/red-ui/src/app/app.module.ts
+++ b/apps/red-ui/src/app/app.module.ts
@@ -95,6 +95,8 @@ import { RulesScreenComponent } from './screens/admin/rules-screen/rules-screen.
import { WatermarkScreenComponent } from './screens/admin/watermark-screen/watermark-screen.component';
import { PdfViewerScreenComponent } from './screens/pdf-viewer-screen/pdf-viewer-screen.component';
import { HtmlDebugScreenComponent } from './screens/html-debug-screen/html-debug-screen.component';
+import { ReportDownloadBtnComponent } from './components/buttons/report-download-btn/report-download-btn.component';
+import { ProjectListingActionsComponent } from './screens/project-listing-screen/project-listing-actions/project-listing-actions.component';
export function HttpLoaderFactory(httpClient: HttpClient) {
return new TranslateHttpLoader(httpClient, '/assets/i18n/', '.json');
@@ -287,7 +289,9 @@ const matImports = [
RulesScreenComponent,
WatermarkScreenComponent,
PdfViewerScreenComponent,
- HtmlDebugScreenComponent
+ HtmlDebugScreenComponent,
+ ReportDownloadBtnComponent,
+ ProjectListingActionsComponent
],
imports: [
BrowserModule,
diff --git a/apps/red-ui/src/app/common/file-actions/file-actions.component.html b/apps/red-ui/src/app/common/file-actions/file-actions.component.html
index eb2505a8b..4e5039e9e 100644
--- a/apps/red-ui/src/app/common/file-actions/file-actions.component.html
+++ b/apps/red-ui/src/app/common/file-actions/file-actions.component.html
@@ -1,4 +1,4 @@
-
+
-
-
+
();
+ actionMenuOpen: boolean;
screen: 'file-preview' | 'project-overview';
diff --git a/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss b/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss
index d63b4b056..46a9a7873 100644
--- a/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss
+++ b/apps/red-ui/src/app/components/buttons/circle-button/circle-button.component.scss
@@ -1,5 +1,10 @@
@import '../../../../assets/styles/red-variables';
+:host {
+ height: 34px;
+ width: 34px;
+}
+
button {
height: 34px;
width: 34px;
@@ -24,6 +29,7 @@ button {
&.warn {
background-color: $yellow-2;
+
&:hover {
background-color: $yellow-2;
}
diff --git a/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.html b/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.html
new file mode 100644
index 000000000..3e4c2e7ea
--- /dev/null
+++ b/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.html
@@ -0,0 +1,20 @@
+
+
+
+
+
+
diff --git a/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.scss b/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.ts b/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.ts
new file mode 100644
index 000000000..b9ccedd79
--- /dev/null
+++ b/apps/red-ui/src/app/components/buttons/report-download-btn/report-download-btn.component.ts
@@ -0,0 +1,52 @@
+import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
+import { PermissionsService } from '../../../common/service/permissions.service';
+import { AppStateService } from '../../../state/app-state.service';
+import { ProjectWrapper } from '../../../state/model/project.wrapper';
+import { FileStatusWrapper } from '../../../screens/file/model/file-status.wrapper';
+
+export type MenuState = 'OPEN' | 'CLOSED';
+
+@Component({
+ selector: 'redaction-report-download-btn',
+ templateUrl: './report-download-btn.component.html',
+ styleUrls: ['./report-download-btn.component.scss']
+})
+export class ReportDownloadBtnComponent implements OnInit {
+ @Input() project: ProjectWrapper;
+ @Input() file: FileStatusWrapper;
+ @Input() tooltipPosition: 'above' | 'below' | 'before' | 'after' = 'above';
+ @Input() type: 'default' | 'primary' | 'warn' | 'dark-bg' = 'default';
+ @Input() tooltipClass: string;
+
+ @Output() menuStateChanged = new EventEmitter();
+
+ constructor(public readonly permissionsService: PermissionsService, private readonly _appStateService: AppStateService) {}
+
+ ngOnInit(): void {}
+
+ openReportMenu($event: MouseEvent) {
+ $event.stopPropagation();
+ this.menuStateChanged.emit('OPEN');
+ }
+
+ onMenuClosed() {
+ this.menuStateChanged.emit('CLOSED');
+ }
+
+ get isApproved() {
+ if (this.file) {
+ return this.file.isApproved;
+ } else {
+ return this.project.allFilesApproved;
+ }
+ }
+
+ downloadRedactionReport($event: MouseEvent, template: string) {
+ $event.preventDefault();
+ if (this.file) {
+ this._appStateService.downloadFileRedactionReport(this.file, template);
+ } else {
+ this._appStateService.downloadRedactionReport(this.project, template);
+ }
+ }
+}
diff --git a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html b/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html
index b99461ad6..fd0f49496 100644
--- a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html
+++ b/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.html
@@ -16,10 +16,10 @@
/>
-
+
+
+ {{ 'EFSA 1 (Vertebrate Authors)' }}
+
diff --git a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
index 93ca31757..ad724dac4 100644
--- a/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
+++ b/apps/red-ui/src/app/screens/project-overview-screen/project-overview-screen.component.html
@@ -57,14 +57,9 @@
tooltipPosition="below"
icon="red:assign"
>
-
+
+
+
{
this.reloadProjects();
diff --git a/apps/red-ui/src/app/state/app-state.service.ts b/apps/red-ui/src/app/state/app-state.service.ts
index e690beaae..5a29fd507 100644
--- a/apps/red-ui/src/app/state/app-state.service.ts
+++ b/apps/red-ui/src/app/state/app-state.service.ts
@@ -267,7 +267,7 @@ export class AppStateService {
await this._reanalysisControllerService.reanalyzeProject(project.projectId).toPromise();
}
- downloadRedactionReport(project?: ProjectWrapper) {
+ downloadRedactionReport(project?: ProjectWrapper, template?: string) {
if (!project) {
project = this.activeProject;
}
@@ -339,7 +339,9 @@ export class AppStateService {
return foundProject.project;
} catch (error) {
this._notificationService.showToastNotification(
- this._translateService.instant('projects.add-edit-dialog.errors.save'),
+ this._translateService.instant(
+ error.status === 409 ? 'projects.add-edit-dialog.errors.project-already-exists' : 'projects.add-edit-dialog.errors.generic'
+ ),
null,
NotificationType.ERROR
);
@@ -384,7 +386,7 @@ export class AppStateService {
}
}
- downloadFileRedactionReport(file?: FileStatusWrapper) {
+ downloadFileRedactionReport(file?: FileStatusWrapper, template?: string) {
if (!file) {
file = this.activeFile;
}
@@ -407,6 +409,7 @@ export class AppStateService {
tap((typesResponse) => {
for (const type of typesResponse.types) {
this._dictionaryData[type.type] = type;
+ this._dictionaryData[type.type].virtual = type.type === 'false_positive';
}
})
);
diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json
index 33d1e5183..454b3a304 100644
--- a/apps/red-ui/src/assets/i18n/en.json
+++ b/apps/red-ui/src/assets/i18n/en.json
@@ -67,7 +67,11 @@
"report": {
"unavailable": "Redaction report is only available once all files have been approved.",
"unavailable-single": "Redaction report is only available once this file has been approved.",
- "action": "Download Redaction Report"
+ "action": {
+ "label": "Download Redaction Report",
+ "efsa": "Download with EFSA Template",
+ "syngenta": "Download with Syngenta Template"
+ }
},
"project-listing": {
"search": "Project name...",
@@ -114,6 +118,10 @@
"due-date": "Due Date",
"template": "Project Template"
},
+ "errors": {
+ "project-already-exists": "Project with this name already exists!",
+ "generic": "Failed to save project"
+ },
"actions": {
"save": "Save",
"save-and-add-members": "Save and Edit Team"
@@ -469,6 +477,7 @@
"rectangle": "Custom Rectangle",
"dictionary": "Dictionary",
"reason": "Reason",
+ "reason-placeholder": "Select a reason ...",
"legalBasis": "Legal Basis",
"comment": "Comment"
}
diff --git a/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg b/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg
new file mode 100644
index 000000000..1de523d7d
--- /dev/null
+++ b/apps/red-ui/src/assets/icons/general/pdftron-action-false-positive.svg
@@ -0,0 +1,32 @@
+
diff --git a/apps/red-ui/src/assets/icons/general/template.svg b/apps/red-ui/src/assets/icons/general/template.svg
new file mode 100644
index 000000000..da96bbb7c
--- /dev/null
+++ b/apps/red-ui/src/assets/icons/general/template.svg
@@ -0,0 +1,7 @@
+
diff --git a/apps/red-ui/src/assets/styles/red-tables.scss b/apps/red-ui/src/assets/styles/red-tables.scss
index 33076b503..52a5f9df0 100644
--- a/apps/red-ui/src/assets/styles/red-tables.scss
+++ b/apps/red-ui/src/assets/styles/red-tables.scss
@@ -81,6 +81,12 @@
mat-icon {
width: 14px;
}
+
+ &.active {
+ display: flex;
+ // compensate for scroll
+ padding-right: 23px;
+ }
}
&:hover {