IGNITE-10538 Web Console: Fixed "no-data" component for "Queries" screen.
authorAlexander Kalinin <verbalab@yandex.ru>
Thu, 14 Feb 2019 11:22:13 +0000 (18:22 +0700)
committerAlexey Kuznetsov <akuznetsov@apache.org>
Thu, 14 Feb 2019 11:22:13 +0000 (18:22 +0700)
modules/web-console/frontend/app/components/page-queries/components/queries-notebook/controller.ts
modules/web-console/frontend/app/components/page-queries/components/queries-notebook/style.scss
modules/web-console/frontend/app/components/page-queries/components/queries-notebook/template.tpl.pug

index 6d17aca..83e9723 100644 (file)
@@ -18,7 +18,7 @@
 import _ from 'lodash';
 import {nonEmpty, nonNil} from 'app/utils/lodashMixins';
 import id8 from 'app/utils/id8';
-import {timer, merge, defer, of} from 'rxjs';
+import {timer, merge, defer, of, EMPTY} from 'rxjs';
 import {tap, switchMap, exhaustMap, take, pluck, distinctUntilChanged, filter, map, catchError} from 'rxjs/operators';
 
 import {CSV} from 'app/services/CSV';
@@ -942,8 +942,13 @@ export class NotebookCtrl {
 
             this.refresh$ = cluster$.pipe(
                 switchMap((cluster) => {
-                    if (!cluster && !agentMgr.isDemoMode())
-                        return of(null);
+                    if (!cluster && !agentMgr.isDemoMode()) {
+                        return of(EMPTY).pipe(
+                            tap(() => {
+                                $scope.caches = [];
+                            })
+                        );
+                    }
 
                     return of(cluster).pipe(
                         tap(() => Loading.start('sqlLoading')),
index e632cdb..8645316 100644 (file)
@@ -107,7 +107,6 @@ queries-notebook {
     }
 
     .empty-caches {
-        color: $ignite-placeholder-color;
         display: flex;
         padding: 10px;
         align-items: center;
@@ -152,6 +151,17 @@ queries-notebook {
 
         overflow-y: auto;
     }
+
+    .notebook-failed--block {
+        text-align: center;
+        display: flex;
+        min-height: 200px;
+        align-items: center;
+        justify-content: center;
+        margin-bottom: 30px;
+        background: white;
+        box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2);
+    }
 }
 
 .popover.settings.refresh-rate {
index e7334cb..5342333 100644 (file)
@@ -66,11 +66,6 @@ mixin chart-settings
         .col-xs-2
             +result-toolbar
 
-mixin notebook-error
-    h2 Failed to load notebook
-    label.col-sm-12 Notebook not accessible any more. Go back to notebooks list.
-    button.h3.btn.btn-primary(ui-sref='default-state') Leave Notebook
-
 mixin query-settings
     div
         .form-field--inline(
@@ -496,8 +491,10 @@ div
                         readonly='true'
                     )
 
-    div(ng-if='notebookLoadFailed' style='text-align: center')
-        +notebook-error
+    .notebook-failed--block(ng-if='notebookLoadFailed')
+        no-data
+            h2 Failed to load notebook
+            label.col-sm-12 Notebook not accessible any more. Go back to notebooks list.
 
     div(ng-if='notebook' ignite-loading='sqlLoading' ignite-loading-text='{{ loadingText }}' ignite-loading-position='top')
         .docs-body.paragraphs