removed useless stuff & show button if annotation has references

This commit is contained in:
Edi Cziszter 2022-01-16 13:43:01 +02:00
parent 22b9a51210
commit 32d6a894fc
10 changed files with 42 additions and 16 deletions

View File

@ -89,7 +89,7 @@
<iqser-circle-button
(action)="annotationReferencesService.show(annotations)"
*ngIf="!multiSelectService.isActive"
*ngIf="annotationReferencesService.hasReferences(annotations) && !multiSelectService.isActive"
[tooltipPosition]="tooltipPosition"
[tooltip]="'annotation-actions.see-references.label' | translate"
[type]="buttonType"

View File

@ -3,12 +3,13 @@
<div class="dialog references-dialog">
<div class="references-header flex">
<div class="small-label">
{{ annotationReferences.length }} {{ annotationReferences.length === 1 ? 'REFERENCE' : 'REFERENCES' }}
{{ annotationReferences.length }}
{{ (annotationReferences.length === 1 ? 'references.singular' : 'references.plural') | translate }}
</div>
<iqser-circle-button (action)="annotationReferencesService.hide()" icon="iqser:close"></iqser-circle-button>
</div>
<div class="annotations-container flex">
<div class="annotation-container" [style.background-color]="'var(--iqser-grey-8)'">
<div class="annotation-container">
<div class="annotation-card-container flex">
<redaction-annotation-card [annotation]="annotation" [file]="file"></redaction-annotation-card>
<redaction-annotation-references-page-indicator
@ -16,12 +17,7 @@
></redaction-annotation-references-page-indicator>
</div>
</div>
<div
class="annotation-container"
*ngFor="let reference of annotationReferences"
(click)="referenceClicked.emit(reference)"
[style.cursor]="'pointer'"
>
<div class="annotation-container" *ngFor="let reference of annotationReferences" (click)="referenceClicked.emit(reference)">
<div class="annotation-card-container flex">
<redaction-annotation-card [annotation]="reference" [file]="file"></redaction-annotation-card>
<redaction-annotation-references-page-indicator

View File

@ -22,6 +22,14 @@
width: 100%;
border-top: 1px solid rgba(226, 228, 233, 0.9);
&:first-child {
background-color: var(--iqser-grey-8);
}
&:not(:first-child) {
cursor: pointer;
}
.annotation-card-container {
padding: 11px 16px 16px 10px;
justify-content: space-between;

View File

@ -26,6 +26,7 @@ export class AnnotationReferencesDialogComponent implements OnInit, OnChanges {
) {}
async ngOnInit(): Promise<void> {
console.log(this.annotation);
await this.setReferences();
}

View File

@ -89,7 +89,6 @@ export class FilePreviewScreenComponent extends AutoUnsubscribe implements OnIni
ready = false;
private _instance: WebViewerInstance;
private _lastPage: string;
private _reloadFileOnReanalysis = false;
@ViewChild('fileWorkloadComponent') private readonly _workloadComponent: FileWorkloadComponent;
@ViewChild('annotationFilterTemplate', {

View File

@ -12,6 +12,10 @@ export class AnnotationReferencesService {
this.annotation$ = this._annotation$.asObservable().pipe(shareDistinctLast());
}
hasReferences(annotations: AnnotationWrapper[]): boolean {
return !!annotations[0].reference && annotations[0].reference.length !== 0;
}
show(annotations: AnnotationWrapper[]) {
this._annotation$.next(annotations[0]);
}

View File

@ -11,7 +11,6 @@ import { ChangeLegalBasisDialogComponent } from '../dialogs/change-legal-basis-d
import { RecategorizeImageDialogComponent } from '../dialogs/recategorize-image-dialog/recategorize-image-dialog.component';
import { ConfirmationDialogComponent, DialogConfig, DialogService, largeDialogConfig } from '@iqser/common-ui';
import { ResizeAnnotationDialogComponent } from '../dialogs/resize-annotation-dialog/resize-annotation-dialog.component';
import { AnnotationReferencesDialogComponent } from '../screens/file-preview-screen/components/annotation-references-dialog/annotation-references-dialog.component';
type DialogType =
| 'confirm'

View File

@ -141,7 +141,20 @@
"settings": "Einstellungen"
},
"annotation": "Anmerkung",
"references": {
"singular": "",
"plural": ""
},
"annotation-actions": {
"resize": {
"label": "Größe ändern"
},
"resize-accept": {
"label": "Größe speichern"
},
"resize-cancel": {
"label": "Größenänderung abbrechen"
},
"accept-recommendation": {
"label": "Empfehlung annehmen"
},
@ -151,12 +164,15 @@
"edit-reason": {
"label": "Begründung bearbeiten"
},
"force-hint": {
"label": "Hinweis erzwingen"
},
"force-redaction": {
"label": "Schwärzung erzwingen"
},
"see-references": {
"label": ""
},
"force-hint": {
"label": "Hinweis erzwingen"
},
"hide": "Ausblenden",
"message": {
"dictionary": {

View File

@ -141,6 +141,10 @@
"settings": "Settings"
},
"annotation": "Annotation",
"references": {
"singular": "REFERENCE",
"plural": "REFERENCES"
},
"annotation-actions": {
"accept-recommendation": {
"label": "Accept Recommendation"

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="14px" height="14px" viewBox="0 0 14 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>status</title>
<g id="Styleguide" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Styleguide-Actions" transform="translate(-979.000000, -588.000000)" fill="#283241" fill-rule="nonzero">
<g id="reference" transform="translate(969.000000, 578.000000)">
@ -10,4 +9,4 @@
</g>
</g>
</g>
</svg>
</svg>

Before

Width:  |  Height:  |  Size: 906 B

After

Width:  |  Height:  |  Size: 881 B