diff --git a/resources/frontend_client/app/explore/partials/database_list.html b/resources/frontend_client/app/explore/partials/database_list.html index 18e59b00da66bd0af8570cbeafa19385849c59b2..64364e397edd62dde50ecb8e6f9807ffab370281 100644 --- a/resources/frontend_client/app/explore/partials/database_list.html +++ b/resources/frontend_client/app/explore/partials/database_list.html @@ -21,11 +21,16 @@ <div class="col col-sm-12 mt4" ng-if="show_non_entities[dbId]"> <h5 class="text-bold mb2" ng-if="database.entities.length > 0">Other tables</h5> <ul> - <li class="border-bottom py1" ng-repeat="table in database.non_entities" ng-if="table.rows > 0"> + <li class="border-bottom py1" ng-repeat="table in database.non_entities"> <div class="clearfix"> <span class="float-right text-grey-3 mt1">{{table.rows}} rows</span> <h4 class="text-normal inline-block"> - <a class="link" cv-org-href="/explore/table/{{table.id}}">{{table.name}}</a> + <a ng-if="table.rows > 0" class="link" cv-org-href="/explore/table/{{table.id}}"> + {{table.name}} + </a> + <span ng-if="table.rows === 0"> + {{table.name}} + </span> </h4> </div> <p class="text-grey-3 m0 pb1" ng-if="table.description">{{table.description}}</p> diff --git a/src/metabase/api/meta/table.clj b/src/metabase/api/meta/table.clj index 8bf3494f183403aef23fc2d3b955ff62d104397e..da25dcc0c95f1948ab3870b684d662525a428d9b 100644 --- a/src/metabase/api/meta/table.clj +++ b/src/metabase/api/meta/table.clj @@ -24,7 +24,12 @@ (read-check Org org) (let [db-ids (sel :many :id Database :organization_id org)] (-> (sel :many Table :active true :db_id [in db-ids] (order :name :ASC)) - (hydrate :db)))) + (hydrate :db) + ;; if for some reason a Table doesn't have rows set then set it to 0 so UI doesn't barf + (#(map (fn [{:keys [rows] :as table}] + (cond-> table + (not rows) (assoc :rows 0))) + %))))) (defendpoint GET "/:id"