Commit 5bb252b4186d69a561bae07f0040f165246e71aa
Committed by
GitHub
Merge pull request #4307 from vvlladd28/bug/update-device-profiles/add-new
UI: Fixed updated device profiles table after added new profiles
Showing
1 changed file
with
9 additions
and
4 deletions
@@ -36,7 +36,6 @@ import { | @@ -36,7 +36,6 @@ import { | ||
36 | import { DeviceProfileService } from '@core/http/device-profile.service'; | 36 | import { DeviceProfileService } from '@core/http/device-profile.service'; |
37 | import { DeviceProfileComponent } from '@home/components/profile/device-profile.component'; | 37 | import { DeviceProfileComponent } from '@home/components/profile/device-profile.component'; |
38 | import { DeviceProfileTabsComponent } from './device-profile-tabs.component'; | 38 | import { DeviceProfileTabsComponent } from './device-profile-tabs.component'; |
39 | -import { Observable } from 'rxjs'; | ||
40 | import { MatDialog } from '@angular/material/dialog'; | 39 | import { MatDialog } from '@angular/material/dialog'; |
41 | import { | 40 | import { |
42 | AddDeviceProfileDialogComponent, | 41 | AddDeviceProfileDialogComponent, |
@@ -138,8 +137,8 @@ export class DeviceProfilesTableConfigResolver implements Resolve<EntityTableCon | @@ -138,8 +137,8 @@ export class DeviceProfilesTableConfigResolver implements Resolve<EntityTableCon | ||
138 | return actions; | 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 | DeviceProfile>(AddDeviceProfileDialogComponent, { | 142 | DeviceProfile>(AddDeviceProfileDialogComponent, { |
144 | disableClose: true, | 143 | disableClose: true, |
145 | panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], | 144 | panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], |
@@ -147,7 +146,13 @@ export class DeviceProfilesTableConfigResolver implements Resolve<EntityTableCon | @@ -147,7 +146,13 @@ export class DeviceProfilesTableConfigResolver implements Resolve<EntityTableCon | ||
147 | deviceProfileName: null, | 146 | deviceProfileName: null, |
148 | transportType: null | 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 | setDefaultDeviceProfile($event: Event, deviceProfile: DeviceProfile) { | 158 | setDefaultDeviceProfile($event: Event, deviceProfile: DeviceProfile) { |