Better UX for bank account balances
This commit is contained in:
6
resources/public/css/bulma.min.css
vendored
6
resources/public/css/bulma.min.css
vendored
@@ -507,7 +507,7 @@ a.box:active {
|
||||
}
|
||||
.button:active, .button.is-active {
|
||||
border-color: #4a4a4a;
|
||||
color: #363636;
|
||||
color: #009cea;
|
||||
}
|
||||
.button.is-text {
|
||||
background-color: transparent;
|
||||
@@ -5897,7 +5897,7 @@ body.has-spaced-navbar-fixed-bottom {
|
||||
}
|
||||
.panel-tabs a.is-active {
|
||||
border-bottom-color: #4a4a4a;
|
||||
color: #363636;
|
||||
color: #009cea;
|
||||
}
|
||||
|
||||
.panel-list a {
|
||||
@@ -5927,7 +5927,7 @@ body.has-spaced-navbar-fixed-bottom {
|
||||
}
|
||||
.panel-block.is-active {
|
||||
border-left-color: #009cea;
|
||||
color: #363636;
|
||||
color: #009cea;
|
||||
}
|
||||
.panel-block.is-active .panel-icon {
|
||||
color: #009cea;
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
resources/sass/bulma.scss
vendored
1
resources/sass/bulma.scss
vendored
@@ -46,6 +46,7 @@ $success: #209b1c;
|
||||
$danger: #ff0303;
|
||||
$warning: #f48017;
|
||||
$custom-colors: ("primary-two": (#209b1c));
|
||||
$link-active: $link;
|
||||
|
||||
// Set your brand colors
|
||||
// Update Bulma's global variables
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
[:location-matches [:id :location :match]]
|
||||
[:bank-accounts [:id :start-date :code :number :bank-name :bank-code :check-number :name :routing :type :sort-order :visible :yodlee-account-id
|
||||
[:yodlee-account [:name :id :number]]
|
||||
:locations :include-in-reports] ]
|
||||
:locations :include-in-reports :current-balance] ]
|
||||
[:address [:street1 :street2 :city :state :zip]]
|
||||
[:forecasted-transactions [:id :amount :identifier :day-of-month]]]
|
||||
(= "admin" (or (get (jwt->data token) "role") (get (jwt->data token) "user/role")) ) (conj [:yodlee-provider-accounts [:id [:accounts [:id :name :number :available-balance]]]])))
|
||||
|
||||
@@ -3,17 +3,35 @@
|
||||
[clojure.spec.alpha :as s]
|
||||
[auto-ap.entities.invoice :as invoice]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead]]
|
||||
[auto-ap.views.utils :refer [bind-field]]))
|
||||
[auto-ap.views.utils :refer [bind-field ->$]]
|
||||
[auto-ap.subs :as subs]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
(defn bank-account-filter [{:keys [value on-change-event bank-accounts]}]
|
||||
[:div.field
|
||||
[:div.control
|
||||
[bind-field
|
||||
[typeahead {:matches (map (fn [x] [(:id x) (:name x)]) bank-accounts)
|
||||
:type "typeahead"
|
||||
:auto-focus true
|
||||
:field [:id]
|
||||
:text-field [:name]
|
||||
:event on-change-event
|
||||
:spec (s/nilable ::invoice/vendor-id)
|
||||
:subscription value}]]]])
|
||||
(defn bank-account-filter [{:keys [on-change-event value bank-accounts]}]
|
||||
(let [is-power-user? (or @(re-frame/subscribe [::subs/is-power-user?])
|
||||
@(re-frame/subscribe [::subs/is-admin?]))]
|
||||
[:nav.panel
|
||||
(for [ba bank-accounts
|
||||
:when (not= :cash (:type ba))]
|
||||
^{:key (:id ba)}
|
||||
[:a.panel-block {:class (when (= (:id value)
|
||||
(:id ba))
|
||||
"is-active")
|
||||
:on-click (fn []
|
||||
(if (= (:id value)
|
||||
(:id ba))
|
||||
(re-frame/dispatch (conj on-change-event nil ))
|
||||
(re-frame/dispatch (conj on-change-event (select-keys ba #{:name :id})))))}
|
||||
[:span.panel-icon
|
||||
(cond
|
||||
(#{:check ":check"} (:type ba)) [:span.icon-check-payment-sign]
|
||||
|
||||
(#{:credit ":credit"} (:type ba))
|
||||
[:span.icon-credit-card-1]
|
||||
|
||||
:else
|
||||
[:i.fa.fa-icon-check])
|
||||
]
|
||||
(:name ba) (when (and (:current-balance ba)
|
||||
is-power-user?)
|
||||
(str ": " (->$ (:current-balance ba))))])]))
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
[auto-ap.subs :as subs]
|
||||
[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.typeahead :refer [typeahead-entity]]
|
||||
[auto-ap.views.pages.data-page :as data-page]
|
||||
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
|
||||
@@ -43,17 +44,13 @@
|
||||
[:a.item {:href (bidi/path-for routes/routes :external-import-ledger)
|
||||
:class [(active-when ap = :external-import-ledger)]}
|
||||
[:span.icon [:i {:class "fa fa-download"}]]
|
||||
[:span {:class "name"} "External Ledger Import"]]])
|
||||
(when (#{ :ledger :external-ledger} ap)
|
||||
[:span {:class "name"} "External Ledger Import"]]])]
|
||||
(when (#{ :ledger :external-ledger} ap)
|
||||
[:div
|
||||
[:p.menu-label "Bank Account"]
|
||||
[:div
|
||||
[typeahead-entity {:matches @(re-frame/subscribe [::subs/bank-accounts])
|
||||
:match->text :name
|
||||
:include-keys [:name :id]
|
||||
:type "typeahead-entity"
|
||||
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :bank-account %])
|
||||
:value @(re-frame/subscribe [::data-page/filter data-page :bank-account])}]]
|
||||
[bank-account-filter {:value @(re-frame/subscribe [::data-page/filter data-page :bank-account])
|
||||
:bank-accounts @(re-frame/subscribe [::subs/bank-accounts])
|
||||
:on-change-event [::data-page/filter-changed data-page :bank-account]}]
|
||||
|
||||
|
||||
|
||||
@@ -102,4 +99,4 @@
|
||||
[:div.field
|
||||
[:div.control [:input.input {:placeholder "External id"
|
||||
:value @(re-frame/subscribe [::data-page/filter data-page :external-id])
|
||||
:on-change (dispatch-value-change [::data-page/filter-changed data-page :external-id])} ]]]]])])]]))
|
||||
:on-change (dispatch-value-change [::data-page/filter-changed data-page :external-id])} ]]]]])])]))
|
||||
|
||||
@@ -9,14 +9,16 @@
|
||||
[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]]
|
||||
[auto-ap.views.utils :refer [active-when dispatch-event dispatch-value-change ->$]]
|
||||
[bidi.bidi :as bidi]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
(defn side-bar [{:keys [data-page]}]
|
||||
(let [ap @(re-frame/subscribe [::subs/active-page])
|
||||
user @(re-frame/subscribe [::subs/user])
|
||||
accounts @(re-frame/subscribe [::subs/accounts])]
|
||||
|
||||
accounts @(re-frame/subscribe [::subs/accounts])
|
||||
]
|
||||
[:div
|
||||
[:div [:p.menu-label "Type"]
|
||||
[:ul.menu-list
|
||||
@@ -58,6 +60,7 @@
|
||||
{:on-change-event [::data-page/filter-changed data-page :bank-account]
|
||||
:value @(re-frame/subscribe [::data-page/filter data-page :bank-account])
|
||||
:bank-accounts @(re-frame/subscribe [::subs/bank-accounts])}]]
|
||||
|
||||
|
||||
[:p.menu-label "Financial Account"]
|
||||
[:div
|
||||
|
||||
@@ -95,12 +95,7 @@
|
||||
|
||||
#_[:td description-original]
|
||||
[grid/cell {}
|
||||
(if (and (:current-balance bank-account)
|
||||
(or is-power-user?
|
||||
is-admin?))
|
||||
[:span.has-tooltip-arrow.has-tooltip-right {:data-tooltip (str "Current Balance: " (nf (:current-balance bank-account) ))}
|
||||
(:name bank-account ) ]
|
||||
(:name bank-account ))]
|
||||
(:name bank-account )]
|
||||
[grid/cell {} (cond vendor
|
||||
(:name vendor)
|
||||
yodlee-merchant
|
||||
|
||||
Reference in New Issue
Block a user