exclude files from redaction

This commit is contained in:
Dan Percic 2021-04-06 14:11:24 +03:00
parent f38b2e9600
commit 8e044a9128
11 changed files with 93 additions and 0 deletions

View File

@ -0,0 +1,34 @@
@import '../../../../../assets/styles/red-mixins';
:host {
display: block;
position: absolute;
height: 100%;
background: white;
z-index: 1;
width: 100%;
@include inset-shadow;
}
.section {
padding: 40px;
flex-direction: column;
&:not(:last-child) {
border-bottom: 1px solid $separator;
}
}
p {
height: 48px;
width: 234px;
text-align: center;
color: #9398a0;
}
mat-icon {
width: 60px;
height: 60px;
opacity: 10%;
}

View File

@ -0,0 +1,12 @@
import { Component } from '@angular/core';
@Component({
selector: 'redaction-disabled-for-redaction',
template:
"<div class='section flex-align-items-center'>\n" +
' <mat-icon [svgIcon]="\'red:needs-work\'"></mat-icon>\n' +
" <p class='heading-l'>Redaction is disabled for this document.</p>\n" +
'</div>',
styleUrls: ['./disabled-for-redaction.component.scss']
})
export class DisabledForRedactionComponent {}

View File

@ -135,5 +135,15 @@
type="dark-bg"
>
</redaction-circle-button>
<!-- exclude from redaction -->
<div class='red-input-group'>
<mat-slide-toggle
(click)='toggleAnalysis($event)'
[checked]='!fileStatus.isExcluded'
color='primary'
>
</mat-slide-toggle>
</div>
</div>
</ng-template>

View File

@ -20,3 +20,9 @@
redaction-status-bar {
margin-left: 2px;
}
mat-slide-toggle {
height: 34px;
width: 34px;
line-height: 33px;
}

View File

@ -103,4 +103,10 @@ export class FileActionsComponent implements OnInit {
this.actionPerformed.emit(action);
});
}
async toggleAnalysis($event: MouseEvent) {
$event.stopPropagation();
await this._fileActionService.toggleAnalysis(this.fileStatus).toPromise();
await this.appStateService.getFiles();
}
}

View File

@ -35,6 +35,7 @@ import { PdfViewerDataService } from './services/pdf-viewer-data.service';
import { ManualAnnotationService } from './services/manual-annotation.service';
import { AnnotationDrawService } from './services/annotation-draw.service';
import { AnnotationProcessingService } from './services/annotation-processing.service';
import { DisabledForRedactionComponent } from './components/disabled-for-redaction/disabled-for-redaction.component';
const screens = [ProjectListingScreenComponent, ProjectOverviewScreenComponent, FilePreviewScreenComponent];
@ -66,6 +67,7 @@ const components = [
ProjectListingActionsComponent,
DocumentInfoComponent,
FileWorkloadComponent,
DisabledForRedactionComponent,
...screens,
...dialogs

View File

@ -204,6 +204,11 @@
</div>
<div class="right-container">
<redaction-disabled-for-redaction
*ngIf='viewReady && appStateService.activeFile.isExcluded'
>
</redaction-disabled-for-redaction>
<redaction-document-info
*ngIf="viewReady && viewDocumentInfo"
[file]="fileData.fileStatus.fileStatus"

View File

@ -175,6 +175,7 @@
[class.pointer]="permissionsService.canOpenFile(fileStatus)"
[routerLink]="fileLink(fileStatus)"
class="table-item"
[class.disabled]='fileStatus.isExcluded'
>
<div class="pr-0" (click)="toggleFileSelected($event, fileStatus)">
<div *ngIf="!isFileSelected(fileStatus)" class="select-oval"></div>

View File

@ -110,3 +110,8 @@ cdk-virtual-scroll-viewport {
.mr-4 {
margin-right: 4px;
}
.disabled {
background-color: #F4F5F7;
color: #9398A0;
}

View File

@ -25,6 +25,13 @@ export class FileActionService {
return this._reanalysisControllerService.reanalyzeFile(this._appStateService.activeProject.project.projectId, fileStatusWrapper.fileId, priority);
}
public toggleAnalysis(fileStatusWrapper?: FileStatusWrapper) {
if (!fileStatusWrapper) {
fileStatusWrapper = this._appStateService.activeFile;
}
return this._reanalysisControllerService.toggleAnalysis(fileStatusWrapper.projectId, fileStatusWrapper.fileId, fileStatusWrapper.isExcluded);
}
public async assignProjectReviewerFromOverview(file?: FileStatusWrapper, callback?: Function) {
if (this._permissionsService.isManagerAndOwner()) {
this._openAssignReviewerDialog(file, callback);

View File

@ -190,6 +190,11 @@ body {
justify-content: center;
}
.flex-align-items-center {
display: flex;
align-items: center;
}
.flex-1 {
flex: 1;
}