annotation filter icons

This commit is contained in:
Timo Bejan 2020-11-17 00:43:33 +02:00
parent c5a8be95a0
commit 817612fe74
4 changed files with 36 additions and 11 deletions

View File

@ -1,6 +1,28 @@
<redaction-annotation-icon *ngIf="filter.key === 'analysis'" type="square" label="A" color="#dd4d50"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'redaction'" type="square" label="R" color="#283241"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'hint'" type="round" label="H" color="#9398a0"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'suggestion'" type="rhombus" label="S" [color]="suggestionColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'suggestion-remove'" type="rhombus" label="S" [color]="suggestionColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'manual'" type="square" label="M" [color]="dictionaryColor"></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'ignore'" type="square" label="I" [color]="dictionaryColor"></redaction-annotation-icon>
<redaction-annotation-icon
*ngIf="
filter.key === 'suggestion-remove' ||
filter.key === 'suggestion-add' ||
filter.key === 'suggestion-remove-dictionary' ||
filter.key === 'suggestion-add-dictionary'
"
type="rhombus"
label="S"
[color]="dictionaryColor"
></redaction-annotation-icon>
<redaction-annotation-icon
*ngIf="filter.key === 'add-dictionary' || filter.key === 'remove-dictionary'"
type="square"
label="A"
color="#dd4d50"
></redaction-annotation-icon>
<redaction-annotation-icon *ngIf="filter.key === 'declined-suggestion'" type="rhombus" label="S" [color]="dictionaryColor"></redaction-annotation-icon>
{{ filter.label | translate }}

View File

@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { FilterModel } from '../../common/filter/model/filter.model';
import { AppStateService } from '../../state/app-state.service';
@ -7,12 +7,14 @@ import { AppStateService } from '../../state/app-state.service';
templateUrl: './type-filter.component.html',
styleUrls: ['./type-filter.component.scss']
})
export class TypeFilterComponent {
export class TypeFilterComponent implements OnInit {
@Input() filter: FilterModel;
dictionaryColor: string;
constructor(public appStateService: AppStateService) {}
get suggestionColor() {
return this.appStateService.getDictionaryColor('suggestion');
ngOnInit(): void {
this.dictionaryColor = this.appStateService.getDictionaryColor(this.filter.key);
}
}

View File

@ -32,9 +32,10 @@ export class AnnotationProcessingService {
key: key,
topLevelFilter: true,
label: 'annotation-type.' + key,
checked: key === 'manual',
filters: Array.from(availableAnnotationTypes[key]).map((dc: string) => {
// const defaultFilter = this._appStateService.dictionaryData[dc]?.defaultFilter;
return { key: dc, checked: false, filters: [] };
const defaultFilter = this._appStateService.dictionaryData[dc]?.defaultFilter;
return { key: dc, checked: defaultFilter, filters: [] };
})
};
handleCheckedValue(filter);

View File

@ -120,8 +120,8 @@ export class ManualAnnotationService {
.declineRequest(this._appStateService.activeProjectId, this._appStateService.activeFileId, annotationWrapper.id)
.pipe(
tap(
() => this._notify(this._getMessage('decline', removeFromDictionary)),
(error) => this._notify(this._getMessage('decline', removeFromDictionary, true), NotificationType.ERROR, error)
() => this._notify(this._getMessage('decline', false)),
(error) => this._notify(this._getMessage('decline', false, true), NotificationType.ERROR, error)
)
);
} else {