浏览代码

[assist] Show a message when no databases are found

This is unlikely to happen but in case the backend for whatever reason returns an empty list for any of the sources it's better to show a message than an empty panel.
Johan Ahlen 10 年之前
父节点
当前提交
99f31ee
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      desktop/core/src/desktop/templates/assist.mako

+ 3 - 1
desktop/core/src/desktop/templates/assist.mako

@@ -373,7 +373,6 @@ from desktop.views import _ko
       <!-- /ko -->
       <!-- /ko -->
     </ul>
-    <ul></ul>
     <!-- ko template: { if: ! hasEntries() && ! loading() && (definition.isTable || definition.isView), name: 'assist-no-table-entries' } --><!-- /ko -->
     <!-- ko template: { if: ! hasEntries() && ! loading() && definition.isDatabase, name: 'assist-no-database-entries' } --><!-- /ko -->
   </script>
@@ -618,6 +617,9 @@ from desktop.views import _ko
     <div class="assist-flex-fill" data-bind="visible: hasErrors() && ! loading()" style="display: none;">
       <span class="assist-errors">${ _('Error loading databases.') }</span>
     </div>
+    <div class="assist-flex-fill" data-bind="visible: ! hasErrors() && ! loading() && ! hasEntries()" style="display: none;">
+      <span class="assist-errors">${ _('No databases found.') }</span>
+    </div>
   </script>
 
   <script type="text/html" id="assist-tables-template">