fix profile names

This commit is contained in:
_Bastler
2021-11-17 20:40:09 +01:00
parent d2eb8fd261
commit 0f528ac7e0
7 changed files with 29 additions and 11 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ export class ConfirmDialog {
constructor(private i18nService: I18nService,
public dialogRef: MatDialogRef<ConfirmDialog>,
@Inject(MAT_DIALOG_DATA) public data: any) {
this.text = i18nService.get(data.label, data.args);
this.text = data.empty ? i18nService.getEmpty(data.label, data.args) : i18nService.get(data.label, data.args);
}
}
@@ -1,4 +1,4 @@
<h1 mat-dialog-title>{{'profileField.name.' + profileField.name | i18n}}</h1>
<h1 mat-dialog-title>{{'profileField.name.' + profileField.name | i18nEmpty}}</h1>
<mat-dialog-content>
<pre>
{{profileField.blob}}
@@ -1,4 +1,4 @@
<h1 mat-dialog-title>{{'profileField.name.' + profileField.name | i18n}}</h1>
<h1 mat-dialog-title>{{'profileField.name.' + profileField.name | i18nEmpty}}</h1>
<mat-dialog-content>
<form [formGroup]="form">
<mat-form-field>
@@ -2,7 +2,7 @@
<ng-container matColumnDef="name">
<th mat-header-cell *matHeaderCellDef mat-sort-header="name"> {{'profileField.name' | i18n}} </th>
<td mat-cell *matCellDef="let profileField"> {{'profileField.name.' + profileField.name | i18n}} </td>
<td mat-cell *matCellDef="let profileField"> {{'profileField.name.' + profileField.name | i18nEmpty}} </td>
</ng-container>
<ng-container matColumnDef="value">
@@ -61,7 +61,7 @@ export class ProfileFieldsComponent implements OnInit {
this.profileFields = data.sort((a, b) => {
const isAsc = sort.direction === 'asc';
switch(sort.active) {
case 'name': return this.compare(this.i18n.get('profileField.name.' + a.name, []), this.i18n.get('profileField.name.' + b.name, []), isAsc);
case 'name': return this.compare(this.i18n.getEmpty('profileField.name.' + a.name, []), this.i18n.getEmpty('profileField.name.' + b.name, []), isAsc);
case 'value': return this.compare(a.value, b.value, isAsc);
case 'index': return this.compare(a.index, b.index, isAsc);
case 'visibility': return this.compare(this.i18n.get('visibility.' + a.visibility, []), this.i18n.get('visibility.' + b.visibility, []), isAsc);
@@ -105,6 +105,7 @@ export class ProfileFieldsComponent implements OnInit {
const dialogRef = this.dialog.open(ConfirmDialog, {
data: {
'label': 'profileField.confirmDelete',
'empty' : true,
'args': ['profileField.name.' + profileField.name]
}
})