Merge branch 'staging' into add-scheduled-payment-filter

This commit is contained in:
Bryce Covert
2021-01-11 12:09:10 -08:00
7 changed files with 73 additions and 40 deletions

View File

@@ -23,6 +23,24 @@
(def signature-canvas (r/adapt-react-class (.-default canvas)))
(defn upload-replacement-button [{:keys [on-change]} text]
(let [button (atom nil)]
(r/create-class {:display-name "Upload button"
:reagent-render
(fn []
[:<>
[:label.button {:for "upload_replacement_signature"} text]
[:input.button {:type "file" :id "upload_replacement_signature"
:style {:display "none"}
:on-change (fn []
(let [fr (js/FileReader.)]
(.addEventListener fr "load" (fn []
(on-change (.-result fr))))
(.readAsDataURL fr (aget (.-files @button) 0)))
)
:ref (fn [i] (reset! button i))} ]])})))
(defn signature [{:keys [signature-file signature-data on-change]}]
(let [canvas (atom nil)
edit-mode? (r/atom false)
@@ -56,7 +74,9 @@
[:div.buttons
[:a.button {:on-click (fn []
(reset! edit-mode? true))}
"Replace Signature"]]]
"Replace Signature"]
[upload-replacement-button {:on-change on-change} "Upload replacement"]]]
[:div
[:div.has-text-centered.is-vcentered {:style {:width w
:height h
@@ -66,7 +86,9 @@
[:div.buttons
[:a.button.is-primary.is-outlined {:on-click (fn []
(reset! edit-mode? true))}
"New Signature"]]]))
"New Signature"]
[upload-replacement-button {:on-change on-change} "Upload signature"]]]))
])))
(re-frame/reg-sub

View File

@@ -410,23 +410,28 @@
(let [authentication @(re-frame/subscribe [::authentication])
status @(re-frame/subscribe [::status/single ::authenticating])
client-code (:code @(re-frame/subscribe [::subs/client]))]
(if (and authentication client-code)
[:div
"Authentication successful!"
[:div#fa-spot]
[:button.button.is-primary {:on-click (fn []
(.open (.-fastlink js/window)
#js {"fastLinkURL" (:url authentication)
"accessToken" (:token authentication)
"params" #js { "configName" "Aggregation"}}
"fa-spot")
)}
[:span [:span.icon [:i.fa.fa-external-link]] " Go to yodlee"]]]
[:button.button.is-primary {:disabled (status/disabled-for status)
:class (status/class-for status)
:on-click (dispatch-event [::authenticate-with-yodlee client-code])}
"Authenticate with Yodlee (" client-code ")"]))])
(cond (and authentication client-code)
[:div
"Authentication successful!"
[:div#fa-spot]
[:button.button.is-primary {:on-click (fn []
(.open (.-fastlink js/window)
#js {"fastLinkURL" (:url authentication)
"accessToken" (:token authentication)
"params" #js { "configName" "Aggregation"}}
"fa-spot")
)}
[:span [:span.icon [:i.fa.fa-external-link]] " Go to yodlee"]]]
client-code
[:button.button.is-primary {:disabled (status/disabled-for status)
:class (status/class-for status)
:on-click (dispatch-event [::authenticate-with-yodlee client-code])}
"Authenticate with Yodlee (" client-code ")"]
:else
nil))])
(defn admin-yodlee-provider-accounts-content []
[:div