WEB-538:fix translation issue in notes module (#2955)
This commit is contained in:
@@ -18,14 +18,7 @@
|
|||||||
cdkAutosizeMinRows="2"
|
cdkAutosizeMinRows="2"
|
||||||
></textarea>
|
></textarea>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<button
|
<button type="submit" mat-raised-button class="flex-1" color="primary" [disabled]="!noteForm.valid">
|
||||||
type="button"
|
|
||||||
mat-raised-button
|
|
||||||
class="flex-1"
|
|
||||||
color="primary"
|
|
||||||
[disabled]="!noteForm.valid"
|
|
||||||
(click)="addNote()"
|
|
||||||
>
|
|
||||||
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
|
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
@@ -41,7 +34,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="note-footer">
|
<div class="note-footer">
|
||||||
<div class="note-meta">
|
<div class="note-meta">
|
||||||
<div class="created-by">Created by {{ entityNote.createdByUsername }}</div>
|
<div class="created-by">
|
||||||
|
{{ 'labels.inputs.Created By' | translate }} {{ entityNote.createdByUsername }}
|
||||||
|
</div>
|
||||||
<div class="created-date">
|
<div class="created-date">
|
||||||
{{ entityNote.createdOn | dateFormat }}
|
{{ entityNote.createdOn | dateFormat }}
|
||||||
</div>
|
</div>
|
||||||
@@ -52,18 +47,18 @@
|
|||||||
mat-raised-button
|
mat-raised-button
|
||||||
color="primary"
|
color="primary"
|
||||||
(click)="editNote(entityNote.id, entityNote.note, i)"
|
(click)="editNote(entityNote.id, entityNote.note, i)"
|
||||||
title="Edit note"
|
[title]="'labels.heading.Edit Note' | translate"
|
||||||
>
|
>
|
||||||
Edit
|
{{ 'labels.buttons.Edit' | translate }}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
mat-raised-button
|
mat-raised-button
|
||||||
color="warn"
|
color="warn"
|
||||||
(click)="deleteNote(entityNote.id, i)"
|
(click)="deleteNote(entityNote.id, i)"
|
||||||
title="Delete note"
|
[title]="('labels.inputs.Note' | translate) + ': ' + ('labels.buttons.Delete' | translate)"
|
||||||
>
|
>
|
||||||
Delete
|
{{ 'labels.buttons.Delete' | translate }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { CdkTextareaAutosize } from '@angular/cdk/text-field';
|
|||||||
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
|
||||||
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
|
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
|
||||||
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
|
||||||
|
import { TranslateService } from '@ngx-translate/core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-entity-notes-tab',
|
selector: 'mifosx-entity-notes-tab',
|
||||||
@@ -30,6 +31,7 @@ export class EntityNotesTabComponent implements OnInit {
|
|||||||
private clientsService = inject(ClientsService);
|
private clientsService = inject(ClientsService);
|
||||||
private groupsService = inject(GroupsService);
|
private groupsService = inject(GroupsService);
|
||||||
private dialog = inject(MatDialog);
|
private dialog = inject(MatDialog);
|
||||||
|
private translateService = inject(TranslateService);
|
||||||
|
|
||||||
@ViewChild('formRef', { static: true }) formRef: any;
|
@ViewChild('formRef', { static: true }) formRef: any;
|
||||||
|
|
||||||
@@ -69,14 +71,14 @@ export class EntityNotesTabComponent implements OnInit {
|
|||||||
required: true,
|
required: true,
|
||||||
value: noteContent,
|
value: noteContent,
|
||||||
controlType: 'input',
|
controlType: 'input',
|
||||||
label: 'Note'
|
label: this.translateService.instant('labels.inputs.Note')
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
layout: {
|
layout: {
|
||||||
columns: 1,
|
columns: 1,
|
||||||
addButtonText: 'Confirm'
|
addButtonText: 'Confirm'
|
||||||
},
|
},
|
||||||
title: 'Edit Note'
|
title: this.translateService.instant('labels.heading.Edit Note')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
editNoteDialogRef.afterClosed().subscribe((response: any) => {
|
editNoteDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
@@ -87,8 +89,9 @@ export class EntityNotesTabComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deleteNote(noteId: string, index: number) {
|
deleteNote(noteId: string, index: number) {
|
||||||
|
const noteLabel = this.translateService.instant('labels.inputs.Note');
|
||||||
const deleteNoteDialogRef = this.dialog.open(DeleteDialogComponent, {
|
const deleteNoteDialogRef = this.dialog.open(DeleteDialogComponent, {
|
||||||
data: { deleteContext: `Note: ${this.entityNotes[index].note}` }
|
data: { deleteContext: `${noteLabel}: ${this.entityNotes[index].note}` }
|
||||||
});
|
});
|
||||||
deleteNoteDialogRef.afterClosed().subscribe((response: any) => {
|
deleteNoteDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.delete) {
|
if (response.delete) {
|
||||||
|
|||||||
Reference in New Issue
Block a user