Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/ui/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,16 @@ describe('AppComponent', () => {
});
}));

it('should update interfaces', () => {
it('should update interfaces and config', () => {
fixture.detectChanges();

spyOn(component.settings, 'getSystemInterfaces');
spyOn(component.settings, 'getSystemConfig');

component.openGeneralSettings(false);

expect(component.settings.getSystemInterfaces).toHaveBeenCalled();
expect(component.settings.getSystemConfig).toHaveBeenCalled();
});

it('should call settingsDrawer open on openSetting', fakeAsync(() => {
Expand Down Expand Up @@ -650,6 +652,7 @@ class FakeGeneralSettingsComponent {
@Output() closeSettingEvent = new EventEmitter<void>();
@Output() reloadInterfacesEvent = new EventEmitter<void>();
getSystemInterfaces = () => {};
getSystemConfig = () => {};
}

@Component({
Expand Down
1 change: 1 addition & 0 deletions modules/ui/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export class AppComponent implements OnInit {
async openGeneralSettings(openSettingFromToggleBtn: boolean) {
this.openedSettingFromToggleBtn = openSettingFromToggleBtn;
this.settings.getSystemInterfaces();
this.settings.getSystemConfig();
await this.settingsDrawer.open();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
Component,
inject,
Input,
OnDestroy,
OnInit,
} from '@angular/core';
import {
Expand Down Expand Up @@ -38,7 +37,7 @@ import { KeyValuePipe, NgForOf, NgIf } from '@angular/common';
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SettingsDropdownComponent implements OnInit, OnDestroy {
export class SettingsDropdownComponent implements OnInit {
@Input() key = '';
@Input({ required: true }) controlName = '';
@Input() groupLabel = '';
Expand All @@ -55,9 +54,6 @@ export class SettingsDropdownComponent implements OnInit, OnDestroy {
this.parentFormGroup.addControl(this.controlName, new FormControl(''));
this.parentFormGroup.addControl(this.controlName, new FormControl(''));
}
ngOnDestroy() {
this.parentFormGroup.removeControl(this.controlName);
}

get control(): FormControl {
return this.parentFormGroup.get(this.controlName) as FormControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export class GeneralSettingsComponent implements OnInit, OnDestroy {
this.hideLoading();
}

getSystemConfig(): void {
this.settingsStore.getSystemConfig();
}

private showLoading() {
this.loaderService.setLoading(true);
}
Expand Down