Commit 5bb252b4186d69a561bae07f0040f165246e71aa

Authored by Igor Kulikov
Committed by GitHub
2 parents ccd316a9 1aeb03c0

Merge pull request #4307 from vvlladd28/bug/update-device-profiles/add-new

UI: Fixed updated device profiles table after added new profiles
... ... @@ -36,7 +36,6 @@ import {
36 36 import { DeviceProfileService } from '@core/http/device-profile.service';
37 37 import { DeviceProfileComponent } from '@home/components/profile/device-profile.component';
38 38 import { DeviceProfileTabsComponent } from './device-profile-tabs.component';
39   -import { Observable } from 'rxjs';
40 39 import { MatDialog } from '@angular/material/dialog';
41 40 import {
42 41 AddDeviceProfileDialogComponent,
... ... @@ -138,8 +137,8 @@ export class DeviceProfilesTableConfigResolver implements Resolve<EntityTableCon
138 137 return actions;
139 138 }
140 139
141   - addDeviceProfile(): Observable<DeviceProfile> {
142   - return this.dialog.open<AddDeviceProfileDialogComponent, AddDeviceProfileDialogData,
  140 + addDeviceProfile() {
  141 + this.dialog.open<AddDeviceProfileDialogComponent, AddDeviceProfileDialogData,
143 142 DeviceProfile>(AddDeviceProfileDialogComponent, {
144 143 disableClose: true,
145 144 panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
... ... @@ -147,7 +146,13 @@ export class DeviceProfilesTableConfigResolver implements Resolve<EntityTableCon
147 146 deviceProfileName: null,
148 147 transportType: null
149 148 }
150   - }).afterClosed();
  149 + }).afterClosed().subscribe(
  150 + (res) => {
  151 + if (res) {
  152 + this.config.table.updateData();
  153 + }
  154 + }
  155 + );
151 156 }
152 157
153 158 setDefaultDeviceProfile($event: Event, deviceProfile: DeviceProfile) {
... ...