remove material, assume revoke dispatch just passes up issue-id
and is not responsible for dispatching anything but a banner on success
This commit is contained in:
parent
9c57a61471
commit
8dc9836be2
|
@ -66,9 +66,6 @@ height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
|
||||||
/></noscript>
|
/></noscript>
|
||||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet" type="text/css" />
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet" type="text/css" />
|
||||||
<link href="https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css" rel="stylesheet" type="text/css" />
|
<link href="https://unpkg.com/tachyons@4.9.1/css/tachyons.min.css" rel="stylesheet" type="text/css" />
|
||||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
|
||||||
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
|
|
||||||
<script defer src="https://code.getmdl.io/1.3.0/material.min.js"></script>
|
|
||||||
<link href="/css/style.css?v={{commiteth-version}}" rel="stylesheet" type="text/css" />
|
<link href="/css/style.css?v={{commiteth-version}}" rel="stylesheet" type="text/css" />
|
||||||
<script type="text/javascript" src="/js/app.js?v={{commiteth-version}}"></script>
|
<script type="text/javascript" src="/js/app.js?v={{commiteth-version}}"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
|
@ -416,6 +416,10 @@
|
||||||
:revoke-bounty-success
|
:revoke-bounty-success
|
||||||
interceptors
|
interceptors
|
||||||
(fn [{:keys [db]} [_ {:keys [issue-id owner-address contract-address confirm-hash]}]]
|
(fn [{:keys [db]} [_ {:keys [issue-id owner-address contract-address confirm-hash]}]]
|
||||||
|
;; replace with dispatch of pending banner
|
||||||
|
;; confirm-payout dispatch will be called by a component
|
||||||
|
;; that subscribes to owner-bounties
|
||||||
|
;; which will get an updated confirm_hash from the scheduler
|
||||||
{:dispatch [:confirm-payout {:issue_id issue-id
|
{:dispatch [:confirm-payout {:issue_id issue-id
|
||||||
:owner_address owner-address
|
:owner_address owner-address
|
||||||
:contract_address contract-address
|
:contract_address contract-address
|
||||||
|
@ -434,13 +438,12 @@
|
||||||
(reg-event-fx
|
(reg-event-fx
|
||||||
:revoke-bounty
|
:revoke-bounty
|
||||||
interceptors
|
interceptors
|
||||||
(fn [{:keys [db]} [_ fields]]
|
(fn [{:keys [db]} [_ {:keys [issue-id]}]]
|
||||||
(let [issue-id (:issue_id fields)]
|
{:http {:method POST
|
||||||
{:http {:method POST
|
:url "/api/user/revoke"
|
||||||
:url "/api/user/revoke"
|
:on-success #(dispatch [:revoke-bounty-success %])
|
||||||
:on-success #(dispatch [:revoke-bounty-success (merge fields %)])
|
:on-error #(dispatch [:revoke-bounty-error %])
|
||||||
:on-error #(dispatch [:revoke-bounty-error issue-id %])
|
:params {:issue-id issue-id}}}))
|
||||||
:params fields}})))
|
|
||||||
|
|
||||||
(reg-event-fx
|
(reg-event-fx
|
||||||
:confirm-payout
|
:confirm-payout
|
||||||
|
|
|
@ -64,14 +64,7 @@
|
||||||
"Signed off"
|
"Signed off"
|
||||||
"Confirm Payment")])))
|
"Confirm Payment")])))
|
||||||
|
|
||||||
(defn revoke-button [{issue-id :issue-id
|
|
||||||
contract-address :contract_address
|
|
||||||
owner-address :owner_address}]
|
|
||||||
[:button.ui.button
|
|
||||||
{:on-click #(rf/dispatch [:revoke-bounty {:contract-address contract-address
|
|
||||||
:issue-id issue-id
|
|
||||||
:owner-address owner-address}])}
|
|
||||||
"Revoke"])
|
|
||||||
|
|
||||||
(defn confirm-row [bounty claim]
|
(defn confirm-row [bounty claim]
|
||||||
(let [payout-address-available? (:payout_address bounty)]
|
(let [payout-address-available? (:payout_address bounty)]
|
||||||
|
@ -252,19 +245,19 @@
|
||||||
[:div
|
[:div
|
||||||
[ui-balances/usd-value-label (:value-usd bounty)]]])
|
[ui-balances/usd-value-label (:value-usd bounty)]]])
|
||||||
|
|
||||||
|
(defn revoke-button [bounty]
|
||||||
;; [revoke-button bounty]
|
(let [{:keys [issue-id value-usd]} bounty]
|
||||||
(defn three-dots-button [{value-usd :value-usd :as bounty}]
|
(when (pos? value-usd)
|
||||||
(when (pos? value-usd)
|
[:div.fl.w-20
|
||||||
[:div.fl.w-20
|
[:button.ui.button
|
||||||
[:button#menu-lower-right.mdl-button.mdl-js-button.mdl-button--icon
|
{:on-click #(rf/dispatch [:revoke-bounty {:issue-id issue-id}])}
|
||||||
[:i.material-icons "more_horiz"]]]))
|
"Revoke"]])))
|
||||||
|
|
||||||
(defn unclaimed-bounty [bounty]
|
(defn unclaimed-bounty [bounty]
|
||||||
[:div.w-third-l.fl-l.pa2
|
[:div.w-third-l.fl-l.pa2
|
||||||
[square-card
|
[square-card
|
||||||
[bounty-title-link bounty {:show-date? true :max-length 60}]
|
[bounty-title-link bounty {:show-date? true :max-length 60}]
|
||||||
[:div [small-card-balances bounty] [three-dots-button bounty]]]])
|
[:div [small-card-balances bounty] [revoke-button bounty]]]])
|
||||||
|
|
||||||
(defn paid-bounty [bounty]
|
(defn paid-bounty [bounty]
|
||||||
[:div.w-third-l.fl-l.pa2
|
[:div.w-third-l.fl-l.pa2
|
||||||
|
|
Loading…
Reference in New Issue