suggestions flag updates

This commit is contained in:
Timo Bejan 2021-08-13 11:52:38 +03:00
parent f4dcabea29
commit c6d2f91602
7 changed files with 13 additions and 16 deletions

View File

@ -27,7 +27,6 @@ export class FileStatusWrapper implements FileStatus {
readonly hasHints = this.fileStatus.hasHints; readonly hasHints = this.fileStatus.hasHints;
readonly hasImages = this.fileStatus.hasImages; readonly hasImages = this.fileStatus.hasImages;
readonly hasRedactions = this.fileStatus.hasRedactions; readonly hasRedactions = this.fileStatus.hasRedactions;
readonly hasRequests = this.fileStatus.hasRequests;
readonly hasUpdates = this.fileStatus.hasUpdates; readonly hasUpdates = this.fileStatus.hasUpdates;
readonly lastOCRTime = this.fileStatus.lastOCRTime; readonly lastOCRTime = this.fileStatus.lastOCRTime;
readonly lastProcessed = this.fileStatus.lastProcessed; readonly lastProcessed = this.fileStatus.lastProcessed;
@ -41,6 +40,7 @@ export class FileStatusWrapper implements FileStatus {
readonly status = this._status; readonly status = this._status;
readonly uploader = this.fileStatus.uploader; readonly uploader = this.fileStatus.uploader;
readonly excludedPages = this.fileStatus.excludedPages; readonly excludedPages = this.fileStatus.excludedPages;
readonly hasSuggestions = this.fileStatus.hasSuggestions;
primaryAttribute: string; primaryAttribute: string;
@ -64,9 +64,8 @@ export class FileStatusWrapper implements FileStatus {
readonly pages = this._pages; readonly pages = this._pages;
readonly cacheIdentifier = btoa(this.lastUploaded + this.lastOCRTime); readonly cacheIdentifier = btoa(this.lastUploaded + this.lastOCRTime);
readonly hasUnappliedSuggestions = !this.allManualRedactionsApplied;
readonly hintsOnly = this.hasHints && !this.hasRedactions; readonly hintsOnly = this.hasHints && !this.hasRedactions;
readonly hasNone = !this.hasRedactions && !this.hasHints && !this.hasRequests; readonly hasNone = !this.hasRedactions && !this.hasHints && !this.hasSuggestions;
readonly isError = this.status === FileStatus.StatusEnum.ERROR; readonly isError = this.status === FileStatus.StatusEnum.ERROR;
readonly isProcessing = processingStatuses.includes(this.status); readonly isProcessing = processingStatuses.includes(this.status);
@ -74,7 +73,7 @@ export class FileStatusWrapper implements FileStatus {
readonly isPending = this.status === FileStatus.StatusEnum.UNPROCESSED; readonly isPending = this.status === FileStatus.StatusEnum.UNPROCESSED;
readonly isUnderReview = this.status === FileStatus.StatusEnum.UNDERREVIEW; readonly isUnderReview = this.status === FileStatus.StatusEnum.UNDERREVIEW;
readonly isUnderApproval = this.status === FileStatus.StatusEnum.UNDERAPPROVAL; readonly isUnderApproval = this.status === FileStatus.StatusEnum.UNDERAPPROVAL;
readonly canBeApproved = !this.analysisRequired && !this.hasRequests; readonly canBeApproved = !this.analysisRequired && !this.hasSuggestions;
readonly canBeOpened = !this.isError && !this.isPending; readonly canBeOpened = !this.isError && !this.isPending;
readonly isWorkable = !this.isProcessing && this.canBeOpened; readonly isWorkable = !this.isProcessing && this.canBeOpened;
readonly canBeOCRed = !this.excluded && !this.lastOCRTime && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(this.status); readonly canBeOCRed = !this.excluded && !this.lastOCRTime && ['UNASSIGNED', 'UNDER_REVIEW', 'UNDER_APPROVAL'].includes(this.status);

View File

@ -10,7 +10,7 @@
<redaction-annotation-icon *ngIf="hasImages" [color]="imageColor" label="I" type="square"></redaction-annotation-icon> <redaction-annotation-icon *ngIf="hasImages" [color]="imageColor" label="I" type="square"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="needsWorkInput.hintsOnly" [color]="hintColor" label="H" type="circle"></redaction-annotation-icon> <redaction-annotation-icon *ngIf="needsWorkInput.hintsOnly" [color]="hintColor" label="H" type="circle"></redaction-annotation-icon>
<redaction-annotation-icon <redaction-annotation-icon
*ngIf="needsWorkInput.hasRequests" *ngIf="needsWorkInput.hasSuggestions"
[color]="suggestionColor" [color]="suggestionColor"
label="S" label="S"
type="rhombus" type="rhombus"

View File

@ -206,7 +206,7 @@ export class DossierListingScreenComponent
if (file.analysisRequired) allDistinctNeedsWork.add('analysis'); if (file.analysisRequired) allDistinctNeedsWork.add('analysis');
if (entry.dossier.hintsOnly) allDistinctNeedsWork.add('hint'); if (entry.dossier.hintsOnly) allDistinctNeedsWork.add('hint');
if (entry.dossier.hasRedactions) allDistinctNeedsWork.add('redaction'); if (entry.dossier.hasRedactions) allDistinctNeedsWork.add('redaction');
if (entry.dossier.hasRequests) allDistinctNeedsWork.add('suggestion'); if (entry.dossier.hasSuggestions) allDistinctNeedsWork.add('suggestion');
if (entry.dossier.hasNone) allDistinctNeedsWork.add('none'); if (entry.dossier.hasNone) allDistinctNeedsWork.add('none');
}); });

View File

@ -275,7 +275,7 @@ export class DossierOverviewScreenComponent extends ListingComponent<FileStatusW
if (file.analysisRequired) allDistinctNeedsWork.add('analysis'); if (file.analysisRequired) allDistinctNeedsWork.add('analysis');
if (file.hintsOnly) allDistinctNeedsWork.add('hint'); if (file.hintsOnly) allDistinctNeedsWork.add('hint');
if (file.hasRedactions) allDistinctNeedsWork.add('redaction'); if (file.hasRedactions) allDistinctNeedsWork.add('redaction');
if (file.hasRequests) allDistinctNeedsWork.add('suggestion'); if (file.hasSuggestions) allDistinctNeedsWork.add('suggestion');
if (file.hasUpdates) allDistinctNeedsWork.add('updated'); if (file.hasUpdates) allDistinctNeedsWork.add('updated');
if (file.hasImages) allDistinctNeedsWork.add('image'); if (file.hasImages) allDistinctNeedsWork.add('image');
if (file.hasNone) allDistinctNeedsWork.add('none'); if (file.hasNone) allDistinctNeedsWork.add('none');

View File

@ -55,7 +55,7 @@ export const annotationFilterChecker = (input: FileStatusWrapper | DossierWrappe
} }
} }
case 'suggestion': { case 'suggestion': {
return input.hasRequests; return input.hasSuggestions;
} }
case 'redaction': { case 'redaction': {
return input.hasRedactions; return input.hasRedactions;

View File

@ -31,7 +31,7 @@ export class DossierWrapper implements Dossier {
totalNumberOfPages?: number; totalNumberOfPages?: number;
hintsOnly?: boolean; hintsOnly?: boolean;
hasRedactions?: boolean; hasRedactions?: boolean;
hasRequests?: boolean; hasSuggestions?: boolean;
hasNone?: boolean; hasNone?: boolean;
hasPendingOrProcessing?: boolean; hasPendingOrProcessing?: boolean;
@ -66,7 +66,7 @@ export class DossierWrapper implements Dossier {
private _recomputeFileStatus() { private _recomputeFileStatus() {
this.hintsOnly = false; this.hintsOnly = false;
this.hasRedactions = false; this.hasRedactions = false;
this.hasRequests = false; this.hasSuggestions = false;
this.hasNone = false; this.hasNone = false;
this.allFilesApproved = true; this.allFilesApproved = true;
this.totalNumberOfPages = 0; this.totalNumberOfPages = 0;
@ -74,12 +74,12 @@ export class DossierWrapper implements Dossier {
this._files.forEach(f => { this._files.forEach(f => {
this.hintsOnly = this.hintsOnly || f.hintsOnly; this.hintsOnly = this.hintsOnly || f.hintsOnly;
this.hasRedactions = this.hasRedactions || f.hasRedactions; this.hasRedactions = this.hasRedactions || f.hasRedactions;
this.hasRequests = this.hasRequests || f.hasRequests; this.hasSuggestions = this.hasSuggestions || f.hasSuggestions;
this.allFilesApproved = this.allFilesApproved && f.isApproved; this.allFilesApproved = this.allFilesApproved && f.isApproved;
this.totalNumberOfPages += f.numberOfPages; this.totalNumberOfPages += f.numberOfPages;
this.hasPendingOrProcessing = this.hasPendingOrProcessing || f.isPending || f.isProcessing; this.hasPendingOrProcessing = this.hasPendingOrProcessing || f.isPending || f.isProcessing;
}); });
this.hasNone = !this.hasRequests && !this.hasRedactions && !this.hintsOnly; this.hasNone = !this.hasSuggestions && !this.hasRedactions && !this.hintsOnly;
this.hasFiles = this._files.length > 0; this.hasFiles = this._files.length > 0;
this.filesLength = this._files.length; this.filesLength = this._files.length;
this.reanalysisRequired = this._files.some(file => file.analysisRequired); this.reanalysisRequired = this._files.some(file => file.analysisRequired);

View File

@ -84,10 +84,6 @@ export interface FileStatus {
* Shows if any redactions were found during the analysis. * Shows if any redactions were found during the analysis.
*/ */
hasRedactions?: boolean; hasRedactions?: boolean;
/**
* Shows if any requests were found during the analysis.
*/
hasRequests?: boolean;
/** /**
* Shows if there is any change between the previous and current analysis. * Shows if there is any change between the previous and current analysis.
*/ */
@ -140,6 +136,8 @@ export interface FileStatus {
* The list of excluded pages. * The list of excluded pages.
*/ */
excludedPages?: number[]; excludedPages?: number[];
hasSuggestions?: boolean;
} }
export namespace FileStatus { export namespace FileStatus {