Skip to content
Snippets Groups Projects
Commit 491269b4 authored by Cam Saul's avatar Cam Saul
Browse files

:smiling_imp: Show empty tables in explore

parent 97a70187
No related branches found
No related tags found
No related merge requests found
......@@ -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>
......
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment