diff --git a/resources/sql/queries.sql b/resources/sql/queries.sql index 47e2bdb..6ade165 100644 --- a/resources/sql/queries.sql +++ b/resources/sql/queries.sql @@ -128,16 +128,14 @@ INSERT INTO issues (repo_id, issue_id, issue_number, title) -- :name update-commit-sha : - + - - - - - - - - - - diff --git a/src/clj/commiteth/db/bounties.clj b/src/clj/commiteth/db/bounties.clj index bda501b..27ccf7e 100644 --- a/src/clj/commiteth/db/bounties.clj +++ b/src/clj/commiteth/db/bounties.clj @@ -71,6 +71,10 @@ (jdbc/with-db-connection [con-db *db*] (db/get-bounty con-db {:owner owner :repo repo :issue_number issue-number}))) +(defn get-bounty-winner + [issue-id] + (jdbc/with-db-connection [con-db *db*] + (db/get-bounty-winner con-db {:issue_id issue-id}))) (defn open-bounty-contracts [] diff --git a/src/clj/commiteth/routes/services.clj b/src/clj/commiteth/routes/services.clj index f9f9bbc..e7c6185 100644 --- a/src/clj/commiteth/routes/services.clj +++ b/src/clj/commiteth/routes/services.clj @@ -126,9 +126,10 @@ (let [owner-bounties (bounties-db/owner-bounties (:id user))] (into {} (for [ob owner-bounties - :let [b (update ob :value_usd usd-decimal->str)]] + :let [b (update ob :value_usd usd-decimal->str) + winner (first (bounties-db/get-bounty-winner (:issue_id b)))]] [(:issue_id b) - (conj b + (conj (conj b {:winner winner}) (let [claims (map #(update % :value_usd usd-decimal->str) (bounties-db/bounty-claims (:issue_id b)))] diff --git a/src/cljs/commiteth/activity.cljs b/src/cljs/commiteth/activity.cljs index 30e032c..97a52c4 100644 --- a/src/cljs/commiteth/activity.cljs +++ b/src/cljs/commiteth/activity.cljs @@ -54,7 +54,8 @@ (defn activity-list [activity-items] [:div.ui.container.activity-container (if (empty? activity-items) - [:div.ui.text "No data"] + [:div.view-no-data-container + [:p "No recent activity yet"]] (into [:div.ui.items] (for [item activity-items] ^{:key item} [activity-item item])))] ) diff --git a/src/cljs/commiteth/bounties.cljs b/src/cljs/commiteth/bounties.cljs index b6594e2..be04b73 100644 --- a/src/cljs/commiteth/bounties.cljs +++ b/src/cljs/commiteth/bounties.cljs @@ -42,7 +42,8 @@ [:div.ui.container.open-bounties-container [:div.open-bounties-header "Bounties"] (if (empty? open-bounties) - [:div.ui.text "No data"] + [:div.view-no-data-container + [:p "No recent activity yet"]] (into [:div.ui.items] (for [bounty open-bounties] [bounty-item bounty])))]) diff --git a/src/cljs/commiteth/core.cljs b/src/cljs/commiteth/core.cljs index 26e465d..3a12f68 100644 --- a/src/cljs/commiteth/core.cljs +++ b/src/cljs/commiteth/core.cljs @@ -138,7 +138,8 @@ (let [top-hunters (rf/subscribe [:top-hunters])] (fn [] (if (empty? @top-hunters) - [:div.ui.text "No data"] + [:div.view-no-data-container + [:p "No recent activity yet"]] (into [:div.ui.items] (map-indexed (fn [idx hunter] [:div.item diff --git a/src/cljs/commiteth/manage_payouts.cljs b/src/cljs/commiteth/manage_payouts.cljs index b9d6475..79674bd 100644 --- a/src/cljs/commiteth/manage_payouts.cljs +++ b/src/cljs/commiteth/manage_payouts.cljs @@ -17,6 +17,8 @@ issue-title :issue_title} claim merged? (= 1 (:pr_state claim)) paid? (not-empty (:payout_hash claim)) + winner (:winner bounty) + winner-login (:payee_login winner) bot-confirm-unmined? (empty? (:confirm_hash bounty)) confirming? (:confirming? bounty) updated (:updated bounty)] @@ -30,7 +32,7 @@ [:div.description "Submitted a claim for " [:a {:href (pr-url claim)} issue-title]] [:div.description (if paid? - "(paid)" + (str "(paid to " winner-login ")") (str "(" (if merged? "merged" "open") ")"))] [:div.time (moment-timestamp updated)] [:button.ui.button diff --git a/src/less/style.less b/src/less/style.less index 3006ad1..ed174db 100644 --- a/src/less/style.less +++ b/src/less/style.less @@ -304,6 +304,23 @@ } } +.view-no-data-container { + padding: 64px; + display: flex; + flex-direction: column; + justify-content: center; + height: auto; + + p { + text-align: center; + font-family: "PostGrotesk-Book"; + color: #8d99a4; + font-size: 15 px; + + } +} + + .view-loading-label { font-size: 18px !important; }