cleaned up how these are generated.

This commit is contained in:
2022-07-25 05:15:16 -07:00
parent bc07ad8f01
commit f6f73a6110
7 changed files with 122 additions and 117 deletions

View File

@@ -129,27 +129,28 @@
(when (:sample-error result)
(str " Sample error: " (:info (:sample-error result)))))])}]}))
(defn content []
(defn action-buttons []
(let [is-admin? @(re-frame/subscribe [::subs/is-admin?])
params @(re-frame/subscribe [::data-page/params ::page])
checked @(re-frame/subscribe [::data-page/checked ::page])]
[:div
[:h1.title "Transactions"]
[status/status-notification {:statuses [[::status/single ::delete-selected]
[::status/single ::manual-import]]}]
(when is-admin?
[:div.is-pulled-right
params @(re-frame/subscribe [::data-page/params ::page])
checked @(re-frame/subscribe [::data-page/checked ::page])]
(when is-admin?
[:<>
[:div.level-item
[:div.tags
(map (fn [[z {:keys [id]}]]
(if (= "header" z)
^{:key "header"}
[:span.tag.is-medium {:on-click
(dispatch-event [::data-page/remove-check ::page "header"])}
"All visible transactions"]
^{:key id}
[:span.tag.is-medium id
[:button.delete.is-small {:on-click
(dispatch-event [::data-page/remove-check ::page id])}]]))
checked)]]
[:div.level-item
[:div.buttons
(into [:div.tags ] (map (fn [[z {:keys [id]}]]
(if (= "header" z)
[:span.tag.is-medium {:on-click
(dispatch-event [::data-page/remove-check ::page "header"])}
"All visible transactions"]
[:span.tag.is-medium id
[:button.delete.is-small {:on-click
(dispatch-event [::data-page/remove-check ::page id])}]]))
checked))
[:button.button.is-outlined.is-primary {:on-click (dispatch-event [::manual/opening])}
"Manual Yodlee Import"]
(when (:client-id params)
@@ -161,10 +162,20 @@
"Delete"]
[:button.button.is-danger {:on-click (dispatch-event [::delete-selected-requested params true])
:disabled (not (seq checked))}
"Suppress"]]])
"Suppress"]]]])))
(defn content []
(let [is-admin? @(re-frame/subscribe [::subs/is-admin?])]
[:div
[:h1.title "Transactions"]
[status/status-notification {:statuses [[::status/single ::delete-selected]
[::status/single ::manual-import]]}]
[table/table {:id :transactions
:check-boxes? is-admin?
:data-page ::page}]]))
:data-page ::page
:action-buttons [action-buttons]}]]))
(defn transactions-page [{:keys [approval-status]}]