profile + i18n
This commit is contained in:
@@ -4,6 +4,7 @@ import {FormBuilder, FormGroup, Validators} from '@angular/forms';
|
||||
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
|
||||
import {I18nService} from '../../services/i18n.service';
|
||||
import {ProfileService} from '../../services/profile.service';
|
||||
import {ConfirmDialog} from '../confirm/confirm.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-profilefields',
|
||||
@@ -55,7 +56,7 @@ export class ProfileFieldsComponent implements OnInit {
|
||||
|
||||
const dialogRef = this.dialog.open(ProfileFieldDialog, {
|
||||
data: profileField,
|
||||
minWidth : '400px'
|
||||
minWidth: '400px'
|
||||
});
|
||||
|
||||
|
||||
@@ -74,16 +75,27 @@ export class ProfileFieldsComponent implements OnInit {
|
||||
}
|
||||
|
||||
confirmDelete(profileField) {
|
||||
this.profileService.delete(profileField.name).subscribe((result: any) => {
|
||||
this.profileFields.splice(this.profileFields.indexOf(profileField), 1);
|
||||
this.profileFields = [...this.profileFields];
|
||||
const dialogRef = this.dialog.open(ConfirmDialog, {
|
||||
data: {
|
||||
'label': 'profileField.confirmDelete',
|
||||
'args': ['profileField.name.' + profileField.name]
|
||||
}
|
||||
})
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
if(result) {
|
||||
this.profileService.delete(profileField.name).subscribe((result: any) => {
|
||||
this.profileFields.splice(this.profileFields.indexOf(profileField), 1);
|
||||
this.profileFields = [...this.profileFields];
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openCreate() {
|
||||
const dialogRef = this.dialog.open(ProfileFieldDialog, {
|
||||
data: {"type": "TEXT", "visibility": "PRIVATE"},
|
||||
minWidth : '400px'
|
||||
minWidth: '400px'
|
||||
});
|
||||
|
||||
dialogRef.afterClosed().subscribe(result => {
|
||||
@@ -100,7 +112,7 @@ export class ProfileFieldsComponent implements OnInit {
|
||||
openBlob(profileField) {
|
||||
this.dialog.open(ProfileFieldBlob, {
|
||||
data: profileField,
|
||||
minWidth : '400px'
|
||||
minWidth: '400px'
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user