This commit is contained in:
2023-09-28 22:24:27 -07:00
11 changed files with 183 additions and 48 deletions

View File

@@ -25,7 +25,7 @@
(defn fastlink-dialog [{:keys [session]}]
(defn fastlink-dialog [{:keys [client]}]
(html-response
(com/modal
{}
@@ -39,14 +39,19 @@
(format "
fastlink.open({fastLinkURL: '%s',
accessToken: '%s',
params: {'configName': 'Aggregation'}},
params: {'configName': 'Aggregation'},
onError: function(e) {
console.log(e);
htmx.trigger(\"#yodlee-table\", \"notification\", {value: \"Yodlee returned the following error: '\" + e.message + \"'.\\n\\nYou may want to refresh your browser and try again.\"});
setTimeout(hideModal, 300);
}},
'fa-spot');
" (:yodlee2-fastlink env) (yodlee/get-access-token (:client/code (:client session)))))]
" (:yodlee2-fastlink env) (yodlee/get-access-token (:client/code client))))]
]
[:div]))))
(defn reauthenticate [{:keys [session form-params]}]
(defn reauthenticate [{:keys [form-params]}]
(html-response
(com/modal
{}
@@ -91,7 +96,6 @@ fastlink.open({fastLinkURL: '%s',
:breadcrumbs [[:a {:href (bidi/path-for ssr-routes/only-routes
:company)}
"My Company"]
[:a {:href (bidi/path-for ssr-routes/only-routes
:company-yodlee)}
"Yodlee"]]
@@ -99,13 +103,20 @@ fastlink.open({fastLinkURL: '%s',
:entity-name "Yodlee accounts"
:route :company-yodlee-table
:action-buttons (fn [request]
[(com/button {:color :primary
:on-click "openFastlink()"
:hx-get (bidi/path-for ssr-routes/only-routes
:company-yodlee-fastlink-dialog)
:hx-target "#modal-holder"}
(com/button-icon {} svg/refresh)
"Link new account")])
[[:div.flex.flex-col.flex-shrink
[:div.flex-shrink
(com/button {:color :primary
:on-click "openFastlink()"
:disabled (if (:client request)
false
true)
:hx-get (bidi/path-for ssr-routes/only-routes
:company-yodlee-fastlink-dialog)
:hx-target "#modal-holder"}
(com/button-icon {} svg/refresh)
"Link new account")]
(when-not (:client request)
[:div.text-xs "Note: please select a specific customer to link a new account."])]])
:row-buttons (fn [request _]
[
(com/button {:hx-put (bidi/path-for ssr-routes/only-routes