Browse Source

UI: Fix show toast in single dashboard mode

pull/5232/head
Vladyslav_Prykhodko 5 years ago
parent
commit
d14e8df135
  1. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
  2. 10
      ui-ngx/src/app/modules/home/models/widget-component.models.ts

2
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html

@ -15,7 +15,7 @@
limitations under the License.
-->
<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" style="padding-top: 150px;"
<div class="tb-dashboard-page mat-content" [ngClass]="{'mobile-app': isMobileApp && !isEdit}" style="padding-top: 150px;" tb-toast toastTarget="dashboardRoot"
fxFlex tb-fullscreen [fullscreen]="widgetEditMode || iframeMode || forceFullscreen || isFullscreen">
<tb-hotkeys-cheatsheet #cheatSheetComponent></tb-hotkeys-cheatsheet>
<section class="tb-dashboard-toolbar"

10
ui-ngx/src/app/modules/home/models/widget-component.models.ts

@ -262,35 +262,35 @@ export class WidgetContext {
showSuccessToast(message: string, duration: number = 1000,
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
target: string = 'dashboardRoot') {
this.showToast('success', message, duration, verticalPosition, horizontalPosition, target);
}
showInfoToast(message: string,
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
target: string = 'dashboardRoot') {
this.showToast('info', message, undefined, verticalPosition, horizontalPosition, target);
}
showWarnToast(message: string,
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
target: string = 'dashboardRoot') {
this.showToast('warn', message, undefined, verticalPosition, horizontalPosition, target);
}
showErrorToast(message: string,
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
target: string = 'dashboardRoot') {
this.showToast('error', message, undefined, verticalPosition, horizontalPosition, target);
}
showToast(type: NotificationType, message: string, duration: number,
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
target: string = 'dashboardRoot') {
this.store.dispatch(new ActionNotificationShow(
{
message,

Loading…
Cancel
Save