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 e9b64eddf..a2179d019 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,24 +1,5 @@
-
-
-
-
-
-
+
-
-
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/apps/red-ui/src/app/common/service/permissions.service.ts b/apps/red-ui/src/app/common/service/permissions.service.ts
index ae87066d1..251a56f1a 100644
--- a/apps/red-ui/src/app/common/service/permissions.service.ts
+++ b/apps/red-ui/src/app/common/service/permissions.service.ts
@@ -49,6 +49,13 @@ export class PermissionsService {
);
}
+ displayReanalyseBtn(project?: ProjectWrapper) {
+ if (!project) {
+ project = this._appStateService.activeProject;
+ }
+ return this.isManagerAndOwner(project) && project.files.filter((file) => this.fileRequiresReanalysis(file)).length > 0;
+ }
+
canReanalyseFile(fileStatus?: FileStatusWrapper) {
if (!fileStatus) {
fileStatus = this._appStateService.activeFile;
@@ -66,7 +73,7 @@ export class PermissionsService {
return fileStatus.currentReviewer === this._userService.userId;
}
- canDeleteFile(fileStatus?: FileStatusWrapper, project?: Project) {
+ canDeleteFile(fileStatus?: FileStatusWrapper, project?: ProjectWrapper) {
return this.isManagerAndOwner(project) || fileStatus.isUnassigned;
}
@@ -110,22 +117,22 @@ export class PermissionsService {
return fileStatus.status === 'UNDER_REVIEW' && this.isReviewerOrOwner(fileStatus);
}
- isManagerAndOwner(project?: Project, user?: UserWrapper) {
+ isManagerAndOwner(project?: ProjectWrapper, user?: UserWrapper) {
if (!user) {
user = this._userService.user;
}
if (!project) {
- project = this._appStateService.activeProject.project;
+ project = this._appStateService.activeProject;
}
return user.isManager && project.ownerId === user.id;
}
- isProjectMember(project?: Project, user?: UserWrapper) {
+ isProjectMember(project?: ProjectWrapper, user?: UserWrapper) {
if (!user) {
user = this._userService.user;
}
if (!project) {
- project = this._appStateService.activeProject.project;
+ project = this._appStateService.activeProject;
}
return project.memberIds?.includes(user.id);
}
@@ -194,6 +201,6 @@ export class PermissionsService {
if (!project) {
project = this._appStateService.activeProject;
}
- return project.files.reduce((acc, file) => acc && this.canDeleteFile(file, project.project), true);
+ return project.files.reduce((acc, file) => acc && this.canDeleteFile(file, project), true);
}
}
diff --git a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts b/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts
index 2a6ffd323..9398c607c 100644
--- a/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts
+++ b/apps/red-ui/src/app/dialogs/add-edit-project-dialog/add-edit-project-dialog.component.ts
@@ -3,6 +3,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Project } from '@redaction/red-ui-http';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AppStateService } from '../../state/app-state.service';
+import { ProjectWrapper } from '../../state/model/project.wrapper';
@Component({
selector: 'redaction-add-edit-project-dialog',
@@ -16,7 +17,7 @@ export class AddEditProjectDialogComponent implements OnInit {
private readonly _appStateService: AppStateService,
private readonly _formBuilder: FormBuilder,
public dialogRef: MatDialogRef,
- @Inject(MAT_DIALOG_DATA) public project: Project
+ @Inject(MAT_DIALOG_DATA) public project: ProjectWrapper
) {}
ngOnInit(): void {
diff --git a/apps/red-ui/src/app/dialogs/dialog.service.ts b/apps/red-ui/src/app/dialogs/dialog.service.ts
index 0272202a8..b96956e68 100644
--- a/apps/red-ui/src/app/dialogs/dialog.service.ts
+++ b/apps/red-ui/src/app/dialogs/dialog.service.ts
@@ -12,6 +12,7 @@ import { ManualRedactionEntryWrapper } from '../screens/file/model/manual-redact
import { AnnotationWrapper } from '../screens/file/model/annotation.wrapper';
import { ManualAnnotationDialogComponent } from './manual-redaction-dialog/manual-annotation-dialog.component';
import { ManualAnnotationService } from '../screens/file/service/manual-annotation.service';
+import { ProjectWrapper } from '../state/model/project.wrapper';
const dialogConfig = {
width: '600px',
@@ -124,7 +125,7 @@ export class DialogService {
return ref;
}
- public openEditProjectDialog($event: MouseEvent, project: Project, cb?: Function): MatDialogRef {
+ public openEditProjectDialog($event: MouseEvent, project: ProjectWrapper, cb?: Function): MatDialogRef {
$event.stopPropagation();
const ref = this._dialog.open(AddEditProjectDialogComponent, {
...dialogConfig,
@@ -139,7 +140,7 @@ export class DialogService {
return ref;
}
- public openDeleteProjectDialog($event: MouseEvent, project: Project, cb?: Function): MatDialogRef {
+ public openDeleteProjectDialog($event: MouseEvent, project: ProjectWrapper, cb?: Function): MatDialogRef {
$event.stopPropagation();
const ref = this._dialog.open(ConfirmationDialogComponent, dialogConfig);
ref.afterClosed().subscribe(async (result) => {
@@ -151,7 +152,7 @@ export class DialogService {
return ref;
}
- public openAssignProjectMembersAndOwnerDialog($event: MouseEvent, project: Project, cb?: Function): MatDialogRef {
+ public openAssignProjectMembersAndOwnerDialog($event: MouseEvent, project: ProjectWrapper, cb?: Function): MatDialogRef {
$event?.stopPropagation();
const ref = this._dialog.open(AssignOwnerDialogComponent, {
...dialogConfig,
diff --git a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html
index 7ace6afa7..5d61e2c8b 100644
--- a/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html
+++ b/apps/red-ui/src/app/screens/project-listing-screen/project-listing-screen.component.html
@@ -105,7 +105,7 @@