diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html index faad02a62..a256d59de 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html +++ b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.html @@ -11,7 +11,7 @@ formControlName="type" > - {{ option }} + {{ 'recategorize-image-dialog.options.' + option | translate }} diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts index 01605fad2..e803cd26a 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/recategorize-image-dialog/recategorize-image-dialog.component.ts @@ -1,7 +1,5 @@ import { Component, Inject, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; -import { AppStateService } from '../../../../state/app-state.service'; import { PermissionsService } from '../../../../services/permissions.service'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; @@ -14,11 +12,9 @@ import { AnnotationWrapper } from '../../../../models/file/annotation.wrapper'; export class RecategorizeImageDialogComponent implements OnInit { recategorizeImageForm: FormGroup; isDocumentAdmin: boolean; - typeOptions: string[] = ['signature', 'image', 'logo']; + typeOptions: string[] = ['signature', 'logo', 'formula', 'image']; constructor( - private readonly _translateService: TranslateService, - private readonly _appStateService: AppStateService, private readonly _permissionsService: PermissionsService, private readonly _formBuilder: FormBuilder, public dialogRef: MatDialogRef, @@ -26,31 +22,16 @@ export class RecategorizeImageDialogComponent implements OnInit { ) {} get changed(): boolean { - return true; - // return this.recategorizeImageForm.get('reason'). - // value.legalBasis !== this.annotation.legalBasis; + return this.recategorizeImageForm.get('type').value !== this.annotation.dictionary; } async ngOnInit() { this.isDocumentAdmin = this._permissionsService.isApprover(); this.recategorizeImageForm = this._formBuilder.group({ - type: [null, Validators.required], + type: [this.annotation.dictionary, Validators.required], comment: this.isDocumentAdmin ? [null] : [null, Validators.required] }); - - // this.typeOptions = data - // .map(lbm => ({ - // legalBasis: lbm.reason, - // description: lbm.description, - // label: lbm.name - // })) - // .sort((a, b) => a.label.localeCompare(b.label)); - - // this.annotation. - this.recategorizeImageForm.patchValue({ - type: 'signature' - }); } save() { diff --git a/apps/red-ui/src/assets/i18n/en.json b/apps/red-ui/src/assets/i18n/en.json index 51647c432..1a7b16d64 100644 --- a/apps/red-ui/src/assets/i18n/en.json +++ b/apps/red-ui/src/assets/i18n/en.json @@ -330,7 +330,13 @@ "type": "Select image type", "type-placeholder": "Select a type..." }, - "header": "Edit Image Type" + "header": "Edit Image Type", + "options": { + "image": "Image", + "logo": "Logo", + "signature": "Signature", + "formula": "Formula" + } }, "comment": "Comment", "comments": {