Bläddra i källkod

HUE-8701 [tb] Prevent eternal spinner when there are no namespaces

Johan Ahlen 6 år sedan
förälder
incheckning
66b8645

+ 1 - 1
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -56,7 +56,7 @@ var MetastoreViewModel = (function () {
       if (!self.source()) {
         return true;
       }
-      if (!self.source().namespace()) {
+      if (self.source().loading()) {
         return true;
       }
       return false;

+ 5 - 0
apps/metastore/src/metastore/templates/metastore.mako

@@ -86,9 +86,14 @@ ${ components.menubar(is_embeddable) }
     <div data-bind="component: { name: 'hue-drop-down', params: { value: source, entries: sources, onSelect: sourceChanged, labelAttribute: 'name', searchable: true, linkTitle: '${ _ko('Source') }' } }" style="display: inline-block"></div>
     <!-- ko with: source -->
     <!-- ko if: window.HAS_MULTI_CLUSTER -->
+    <!-- ko if: namespaces().length === 0 -->
+    <i class="margin-left-10 fa fa-warning"></i> ${ _('No namespaces found') }
+    <!-- /ko -->
+    <!-- ko if: namespaces().length > 0 -->
     <div class="margin-left-10" data-bind="component: { name: 'hue-drop-down', params: { value: namespace, entries: namespaces, onSelect: namespaceChanged, labelAttribute: 'name', searchable: true, linkTitle: '${ _ko('Namespace') }' } }" style="display: inline-block"></div>
     <!-- /ko -->
     <!-- /ko -->
+    <!-- /ko -->
   </div>
   <ul style="padding-top: 0" class="nav nav-pills hue-breadcrumbs-bar" id="breadcrumbs">
     <!-- ko with: source -->