Commit d14e8df1355862cb6f9ce038d41c41fb7d2f48fb
1 parent
e2929442
UI: Fix show toast in single dashboard mode
Showing
2 changed files
with
6 additions
and
6 deletions
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | limitations under the License. | 15 | limitations under the License. |
16 | 16 | ||
17 | --> | 17 | --> |
18 | -<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" style="padding-top: 150px;" | 18 | +<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" style="padding-top: 150px;" tb-toast toastTarget="dashboardRoot" |
19 | fxFlex tb-fullscreen [fullscreen]="widgetEditMode || iframeMode || forceFullscreen || isFullscreen"> | 19 | fxFlex tb-fullscreen [fullscreen]="widgetEditMode || iframeMode || forceFullscreen || isFullscreen"> |
20 | <tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet> | 20 | <tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet> |
21 | <section class="tb-dashboard-toolbar" | 21 | <section class="tb-dashboard-toolbar" |
@@ -262,35 +262,35 @@ export class WidgetContext { | @@ -262,35 +262,35 @@ export class WidgetContext { | ||
262 | showSuccessToast(message: string, duration: number = 1000, | 262 | showSuccessToast(message: string, duration: number = 1000, |
263 | verticalPosition: NotificationVerticalPosition = 'bottom', | 263 | verticalPosition: NotificationVerticalPosition = 'bottom', |
264 | horizontalPosition: NotificationHorizontalPosition = 'left', | 264 | horizontalPosition: NotificationHorizontalPosition = 'left', |
265 | - target?: string) { | 265 | + target: string = 'dashboardRoot') { |
266 | this.showToast('success', message, duration, verticalPosition, horizontalPosition, target); | 266 | this.showToast('success', message, duration, verticalPosition, horizontalPosition, target); |
267 | } | 267 | } |
268 | 268 | ||
269 | showInfoToast(message: string, | 269 | showInfoToast(message: string, |
270 | verticalPosition: NotificationVerticalPosition = 'bottom', | 270 | verticalPosition: NotificationVerticalPosition = 'bottom', |
271 | horizontalPosition: NotificationHorizontalPosition = 'left', | 271 | horizontalPosition: NotificationHorizontalPosition = 'left', |
272 | - target?: string) { | 272 | + target: string = 'dashboardRoot') { |
273 | this.showToast('info', message, undefined, verticalPosition, horizontalPosition, target); | 273 | this.showToast('info', message, undefined, verticalPosition, horizontalPosition, target); |
274 | } | 274 | } |
275 | 275 | ||
276 | showWarnToast(message: string, | 276 | showWarnToast(message: string, |
277 | verticalPosition: NotificationVerticalPosition = 'bottom', | 277 | verticalPosition: NotificationVerticalPosition = 'bottom', |
278 | horizontalPosition: NotificationHorizontalPosition = 'left', | 278 | horizontalPosition: NotificationHorizontalPosition = 'left', |
279 | - target?: string) { | 279 | + target: string = 'dashboardRoot') { |
280 | this.showToast('warn', message, undefined, verticalPosition, horizontalPosition, target); | 280 | this.showToast('warn', message, undefined, verticalPosition, horizontalPosition, target); |
281 | } | 281 | } |
282 | 282 | ||
283 | showErrorToast(message: string, | 283 | showErrorToast(message: string, |
284 | verticalPosition: NotificationVerticalPosition = 'bottom', | 284 | verticalPosition: NotificationVerticalPosition = 'bottom', |
285 | horizontalPosition: NotificationHorizontalPosition = 'left', | 285 | horizontalPosition: NotificationHorizontalPosition = 'left', |
286 | - target?: string) { | 286 | + target: string = 'dashboardRoot') { |
287 | this.showToast('error', message, undefined, verticalPosition, horizontalPosition, target); | 287 | this.showToast('error', message, undefined, verticalPosition, horizontalPosition, target); |
288 | } | 288 | } |
289 | 289 | ||
290 | showToast(type: NotificationType, message: string, duration: number, | 290 | showToast(type: NotificationType, message: string, duration: number, |
291 | verticalPosition: NotificationVerticalPosition = 'bottom', | 291 | verticalPosition: NotificationVerticalPosition = 'bottom', |
292 | horizontalPosition: NotificationHorizontalPosition = 'left', | 292 | horizontalPosition: NotificationHorizontalPosition = 'left', |
293 | - target?: string) { | 293 | + target: string = 'dashboardRoot') { |
294 | this.store.dispatch(new ActionNotificationShow( | 294 | this.store.dispatch(new ActionNotificationShow( |
295 | { | 295 | { |
296 | message, | 296 | message, |