Pull request #164: RED-1313

Merge in RED/ui from RED-1313 to master

* commit '8b2899b6956da27cbce9143551da35095a946099':
  add comment icon to workload column
This commit is contained in:
Timo Bejan 2021-04-21 14:16:27 +02:00
commit d2891ca3aa
3 changed files with 19 additions and 8 deletions

View File

@ -5,4 +5,5 @@
<redaction-annotation-icon *ngIf="hasImages" type="square" label="I" [color]="imageColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="needsWorkInput.hintsOnly" type="circle" label="H" [color]="hintColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="needsWorkInput.hasRequests" type="rhombus" label="S" [color]="suggestionColor"></redaction-annotation-icon>
<mat-icon svgIcon="red:comment" *ngIf="hasAnnotationComments"></mat-icon>
</div>

View File

@ -1,3 +1,5 @@
@import '/apps/red-ui/src/assets/styles/red-variables';
.needs-work {
display: flex;
flex-direction: row;
@ -7,4 +9,10 @@
> *:not(:last-child) {
margin-right: 4px;
}
mat-icon {
width: 16px;
height: 16px;
fill-opacity: 0.6;
}
}

View File

@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input } from '@angular/core';
import { AppStateService } from '../../../../state/app-state.service';
import { PermissionsService } from '../../../../services/permissions.service';
import { FileStatusWrapper } from '../../../../models/file/file-status.wrapper';
@ -9,18 +9,16 @@ import { ProjectWrapper } from '../../../../state/model/project.wrapper';
templateUrl: './needs-work-badge.component.html',
styleUrls: ['./needs-work-badge.component.scss']
})
export class NeedsWorkBadgeComponent implements OnInit {
export class NeedsWorkBadgeComponent {
@Input() needsWorkInput: FileStatusWrapper | ProjectWrapper;
constructor(public appStateService: AppStateService, public permissionsService: PermissionsService) {}
ngOnInit(): void {}
constructor(private readonly _appStateService: AppStateService, private readonly _permissionsService: PermissionsService) {}
reanalysisRequired() {
if (this.needsWorkInput instanceof ProjectWrapper) {
return this.permissionsService.projectReanalysisRequired(this.needsWorkInput);
return this._permissionsService.projectReanalysisRequired(this.needsWorkInput);
} else {
return this.permissionsService.fileRequiresReanalysis(this.needsWorkInput);
return this._permissionsService.fileRequiresReanalysis(this.needsWorkInput);
}
}
@ -56,12 +54,16 @@ export class NeedsWorkBadgeComponent implements OnInit {
return this.needsWorkInput instanceof FileStatusWrapper && this.needsWorkInput.hasUpdates;
}
get hasAnnotationComments(): boolean {
return this.needsWorkInput instanceof FileStatusWrapper && (<any>this.needsWorkInput).hasAnnotationComments;
}
private _getDictionaryColor(type: string) {
let ruleSetId = null;
if (this.needsWorkInput instanceof ProjectWrapper) {
ruleSetId = this.needsWorkInput.ruleSetId;
}
return this.appStateService.getDictionaryColor(type, ruleSetId);
return this._appStateService.getDictionaryColor(type, ruleSetId);
}
}