it's now possible to link across each entity type

This commit is contained in:
Bryce Covert
2021-01-24 09:45:13 -08:00
parent 88b0dcde3b
commit 10785b9c85
13 changed files with 161 additions and 105 deletions

View File

@@ -14,6 +14,6 @@
[:forecast-match [:id :identifier]]
:status
:description_original
[:payment [:check_number :s3_url :id]]
[:payment [:check_number :s3_url :id :date]]
[:client [:name :id]]
[:bank-account [:name :yodlee-account-id]]])

View File

@@ -1,15 +1,17 @@
(ns auto-ap.views.pages.transactions.side-bar
(:require [auto-ap.routes :as routes]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[auto-ap.views.components.bank-account-filter
:refer
[bank-account-filter]]
[auto-ap.views.components.date-range-filter :refer [date-range-filter]]
[auto-ap.views.components.number-filter :refer [number-filter]]
[auto-ap.views.components.bank-account-filter :refer [bank-account-filter]]
[auto-ap.views.components.switch-field :refer [switch-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.pages.data-page :as data-page]
[auto-ap.views.utils :refer [active-when dispatch-event dispatch-value-change]]
[bidi.bidi :as bidi]
[re-frame.core :as re-frame]
[auto-ap.views.pages.data-page :as data-page]))
[re-frame.core :as re-frame]))
(defn side-bar [{:keys [data-page]}]
(let [ap @(re-frame/subscribe [::subs/active-page])
@@ -103,6 +105,12 @@
[:div.control [:input.input {:placeholder "CHECK 123 ABC"
:value @(re-frame/subscribe [::data-page/filter data-page :description])
:on-change (dispatch-value-change [::data-page/filter-changed data-page :description])} ]]]]
(when-let [exact-match-id @(re-frame/subscribe [::data-page/filter data-page :exact-match-id])]
[:div
[:p.menu-label "Specific Payment"]
[:span.tag.is-medium exact-match-id " "
[:button.delete.is-small {:on-click
(dispatch-event [::data-page/filter-changed data-page :exact-match-id nil])}]]])
(when (= "admin" (:user/role user))
[:<>

View File

@@ -8,7 +8,7 @@
[auto-ap.views.pages.transactions.form :as edit]
[auto-ap.views.utils
:refer
[action-cell-width date->str dispatch-event nf]]
[action-cell-width date->str dispatch-event dispatch-event-with-propagation nf pretty]]
[goog.string :as gstring]
[re-frame.core :as re-frame]
[auto-ap.views.components.buttons :as buttons]
@@ -114,24 +114,22 @@
:class (status/class-for (get states id))
:icon "fa-pencil"}]
(when payment
[:a.button {:href (str (bidi/path-for routes/routes :payments )
"?"
(url/map->query {:exact-match-id (:id payment)}))}
[:span.icon
[:i.fa.fa-money]]
#_(if (:check-number (:payment payment))
(str "Check " (:check-number (:payment payment))
" (" (gstring/format "$%.2f" (:amount payment) ) ")"
(when (= :cleared (:status (:payment payment)))
(str " - " (:post-date (:transaction (:payment payment))))))
(str "Debit (" (gstring/format "$%.2f" (:amount payment) ) ") "
(when (= :cleared (:status (:payment payment)))
(str " - " (:post-date (:transaction (:payment payment)))))
(when (= :cleared (:status (:payment payment)))
(str " - " (:post-date (:transaction (:payment payment))))))) ]
#_[:a.tag {:href (:s3-url payment) :target "_new"}
[:span.icon [:i.fa.fa-money]]
(str " " (:check-number payment) " (" (gstring/format "$%.2f" amount ) ")")])]]])]]]))
[drop-down {:id [::links id]
:is-right? true
:header [buttons/fa-icon {:class "badge"
:on-click (dispatch-event-with-propagation [::events/toggle-menu [::links id]])
:data-badge (str 1)
:icon "fa-paperclip"}]}
[drop-down-contents
[:div.dropdown-item
[:table.table.grid.compact
[:tbody
[:tr
[:td
"Payment"]
[:td (date->str (:date payment) pretty)]
[:td
[buttons/fa-icon {:icon "fa-external-link"
:href (str (bidi/path-for routes/routes :payments )
"?"
(url/map->query {:exact-match-id (:id payment)}))}]]]]]]]])]]])]]]))