Ag Grid anpassungen
This commit is contained in:
@@ -8,10 +8,11 @@ import { ApiService } from '../../shared/api.service';
|
||||
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
|
||||
import { HotToastService } from '@ngxpert/hot-toast';
|
||||
import {MatProgressBarModule} from '@angular/material/progress-bar';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
|
||||
@Component({
|
||||
selector: 'app-settings',
|
||||
imports: [MatProgressBarModule, MatFormFieldModule, MatInputModule, MatButtonModule, ReactiveFormsModule, FormsModule, MatSlideToggleModule],
|
||||
imports: [MatProgressBarModule, MatFormFieldModule, MatInputModule, MatButtonModule, ReactiveFormsModule, FormsModule, MatSlideToggleModule, MatSelectModule],
|
||||
templateUrl: './settings.component.html',
|
||||
styleUrl: './settings.component.scss'
|
||||
})
|
||||
@@ -36,6 +37,7 @@ export class SettingsComponent {
|
||||
sendSystemAccessMails: new FormControl(false),
|
||||
sendSystemUpdateMails: new FormControl(false),
|
||||
sendUserDisabledMails: new FormControl(false),
|
||||
uiScale: new FormControl('s')
|
||||
})
|
||||
|
||||
open() {
|
||||
@@ -70,25 +72,20 @@ export class SettingsComponent {
|
||||
|
||||
}
|
||||
|
||||
loadSettings() {
|
||||
async loadSettings() {
|
||||
this.isLoading = true;
|
||||
this.api.getSettings().subscribe({
|
||||
next: (r: any) => {
|
||||
this.userSettings.patchValue(r)
|
||||
this.isLoading = false;
|
||||
}
|
||||
})
|
||||
const settings = await this.api.userSettings;
|
||||
this.userSettings.patchValue(settings);
|
||||
this.isLoading = false;
|
||||
}
|
||||
|
||||
save() {
|
||||
async save() {
|
||||
this.isLoading = true;
|
||||
this.api.updateSettings(this.userSettings.value).subscribe({
|
||||
next: () => {
|
||||
this.toast.success('Gespeichert')
|
||||
this.isLoading = false;
|
||||
this.userSettings.markAsPristine();
|
||||
}
|
||||
});
|
||||
const res = await this.api.updateSettings(this.userSettings.value);
|
||||
this.isLoading = false;
|
||||
if (res) {
|
||||
this.userSettings.markAsPristine();
|
||||
}
|
||||
}
|
||||
|
||||
saveUser() {
|
||||
|
||||
Reference in New Issue
Block a user