feat(metadata): add configurable enabled fields for metadata editor and picker + UI tweaks (#2299)
Co-authored-by: acx10 <acx10@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {inject, Injectable, Injector} from '@angular/core';
|
||||
import {HttpClient} from '@angular/common/http';
|
||||
import {BehaviorSubject, Observable, of} from 'rxjs';
|
||||
import {catchError, finalize, shareReplay, tap} from 'rxjs/operators';
|
||||
import {catchError, finalize, map, shareReplay, switchMap, tap} from 'rxjs/operators';
|
||||
import {API_CONFIG} from '../../core/config/api-config';
|
||||
import {AppSettings, OidcProviderDetails} from '../model/app-settings.model';
|
||||
import {AuthService} from './auth.service';
|
||||
@@ -99,20 +99,8 @@ export class AppSettingsService {
|
||||
}));
|
||||
|
||||
return this.http.put<void>(this.apiUrl, payload).pipe(
|
||||
tap(() => {
|
||||
const current = this.appSettingsSubject.value;
|
||||
if (current) {
|
||||
settings.forEach(s => (current as any)[s.key] = s.newValue);
|
||||
this.appSettingsSubject.next({...current});
|
||||
this.syncPublicSettings(current);
|
||||
} else {
|
||||
this.loading$ = this.fetchAppSettings().pipe(
|
||||
shareReplay(1),
|
||||
finalize(() => (this.loading$ = null))
|
||||
);
|
||||
this.loading$.subscribe();
|
||||
}
|
||||
}),
|
||||
switchMap(() => this.fetchAppSettings()),
|
||||
map(() => void 0),
|
||||
catchError(err => {
|
||||
console.error('Error saving settings:', err);
|
||||
return of();
|
||||
|
||||
Reference in New Issue
Block a user