addressed all compilation errors.

This commit is contained in:
2021-05-27 22:04:30 -07:00
parent 766715cdde
commit bcdc181f86
36 changed files with 2497 additions and 448 deletions

View File

@@ -3,7 +3,7 @@
[auto-ap.forms :as forms]
[auto-ap.subs :as subs]
[auto-ap.views.components.layouts :refer [side-bar]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils :refer [dispatch-event multi-field]]
[clojure.spec.alpha :as s]
[clojure.string :as str]
@@ -138,11 +138,11 @@
(field "Customizations"
[multi-field {:type "multi-field"
:field [:client-overrides]
:template [[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:style {:width "20em"}
:match->text :name
:type "typeahead"
:field [:client]}]
:template [[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:style {:width "20em"}
:entity->text :name
:type "typeahead-v3"
:field [:client]}]
[:input.input {:type "text"
:style {:width "20em"}
:placeholder "Bubblegum"

View File

@@ -2,8 +2,7 @@
(:require
[re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]))
[auto-ap.views.utils :refer [active-when dispatch-value-change]]))
(re-frame/reg-sub

View File

@@ -4,7 +4,7 @@
[auto-ap.subs :as subs]
[auto-ap.events :as events]
[auto-ap.views.components.address :refer [address-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.components.layouts :refer [side-bar]]
[auto-ap.views.utils
:refer
@@ -377,10 +377,10 @@
:type "text"
:field [:bank-accounts sort-order :yodlee-account-id]}]]
[field "Yodlee Account (new)"
[typeahead-entity {:matches @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:match->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead"
:field [:bank-accounts sort-order :yodlee-account]}]]])
[typeahead-v3 {:entities @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:entity->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead-v3"
:field [:bank-accounts sort-order :yodlee-account]}]]])
(when (#{:credit ":credit"} type )
[:div
@@ -405,10 +405,10 @@
:type "text"
:field [:bank-accounts sort-order :yodlee-account-id]}]]
[field "Yodlee Account (new)"
[typeahead-entity {:matches @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:match->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead"
:field [:bank-accounts sort-order :yodlee-account]}]]])
[typeahead-v3 {:entities @(re-frame/subscribe [::yodlee-accounts (:id new-client)])
:entity->text (fn [m] (str (:name m) " - " (:number m)))
:type "typeahead-v3"
:field [:bank-accounts sort-order :yodlee-account]}]]])
[:div.field
[:label.label "Locations"]
[:div.control

View File

@@ -4,7 +4,7 @@
[auto-ap.subs :as subs]
[auto-ap.views.components.admin.side-bar :refer [admin-side-bar]]
[auto-ap.views.components.layouts :refer [side-bar-layout]]
[auto-ap.views.components.typeahead :refer [typeahead]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils :refer [bind-field dispatch-event]]
[re-frame.core :as re-frame]))
@@ -77,7 +77,7 @@
:venia/queries (map (fn [v ]
{:query/data [:upsert-vendor
{:vendor {:name v :default-account-id (-> db ::expense-accounts (get v) :default-account-id)}}
{:vendor {:name v :default-account-id (-> db ::expense-accounts (get v) :default-account-id :id)}}
[:id :name]]})
(get-in db [::excel-import :create-vendors]))}
@@ -138,11 +138,12 @@
[:p.control
[bind-field
[typeahead {:matches (map (fn [x] [(:id x) (:name x)]) chooseable-expense-accounts)
:type "typeahead"
:field [v :default-account-id]
:event change-event
:subscription data}]]]])])]
[typeahead-v3 {:entities chooseable-expense-accounts
:entity->text (fn [x ] (str (:numeric-code x) " - " (:name x)))
:type "typeahead-v3"
:field [v :default-account-id]
:event change-event
:subscription data}]]]])])]
[:div
[:button.button.is-pulled-right
{:on-click (dispatch-event [::create-vendors])

View File

@@ -8,7 +8,7 @@
[auto-ap.views.components.dropdown :refer [drop-down]]
[auto-ap.views.components.expense-accounts-field :as expense-accounts-field :refer [expense-accounts-field recalculate-amounts]]
[auto-ap.views.components.layouts :as layouts]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.admin.rules.common :refer [default-read]]
[auto-ap.views.pages.admin.rules.results-modal :as results-modal]
[auto-ap.views.utils :refer [date->str date-picker dispatch-event standard with-user]]
@@ -180,7 +180,8 @@
[[:accounts] (expense-accounts-field/default-account (:accounts data)
@(re-frame/subscribe [::subs/vendor-default-account (:vendor data) value])
(:total data)
[])]
[])
[:bank-account] nil]
:else
[]))))
@@ -245,25 +246,29 @@
(field "Client"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:auto-focus true
:match->text :name
:type "typeahead-entity"
:field [:client]
:spec ::entity/client}])
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:auto-focus true
:entity->text :name
:type "typeahead-v3"
:field [:client]
:spec ::entity/client}])
(field "Bank account"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/real-bank-accounts-for-client (:client data)])
:match->text :name
:type "typeahead-entity"
:field [:bank-account]
:spec ::entity/bank-account}])
(with-meta
(field "Bank account"
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/real-bank-accounts-for-client (:client data)])
:entity->text :name
:type "typeahead-v3"
:field [:bank-account]
:spec ::entity/bank-account}])
;; TODO this forces unmounting when client changes, since it is an "uncontorlled" input
{:key (str "client-" (:id (:client data)))})
(field "Yodlee Merchant"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/yodlee-merchants])
:match->text #(str (:name %) " - " (:yodlee-id %))
:type "typeahead-entity"
:field [:yodlee-merchant]}])
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/yodlee-merchants])
:entity->text #(str (:name %) " - " (:yodlee-id %))
:type "typeahead-v3"
:field [:yodlee-merchant]}])
(field [:span "Description (" [:a {:href "https://regex101.com" :target "_new"} "regex tester"] ")" ]
[:input.input {:type "text"
@@ -315,11 +320,12 @@
[:h2.title.is-4 "Outcomes"]
(field "Assign Vendor"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/all-vendors])
:match->text :name
:type "typeahead-entity"
:field [:vendor]
:spec ::entity/vendor}])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:entity->text :name
:type "typeahead-v3"
:field [:vendor]
:spec ::entity/vendor}])
(field nil
[expense-accounts-field {:type "expense-accounts"

View File

@@ -2,7 +2,7 @@
(:require
[re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.data-page :as data-page]))
@@ -10,10 +10,10 @@
[:div
[:p.menu-label "Vendor"]
[:div
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor %])
:match->text :name
:include-keys [:name :id]
:type "typeahead-entity"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:on-change #(re-frame/dispatch [::data-page/filter-changed data-page :vendor (some-> % (select-keys [:name :id]))])
:entity->text :name
:type "typeahead-v3"
:value @(re-frame/subscribe [::data-page/filter data-page :vendor])}]]])

View File

@@ -17,8 +17,6 @@
[auto-ap.views.utils :refer [login-url dispatch-value-change dispatch-event bind-field horizontal-field action-cell-width]]
[auto-ap.views.pages.admin.vendors.table :as table]
[auto-ap.views.pages.admin.vendors.merge-dialog :as merge-dialog]
[auto-ap.views.components.typeahead :refer [typeahead]]
[cljs.reader :as edn]
[auto-ap.routes :as routes]
[bidi.bidi :as bidi]

View File

@@ -3,7 +3,7 @@
[auto-ap.status :as status]
[auto-ap.subs :as subs]
[auto-ap.views.components.modal :as modal]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.utils :refer [dispatch-event]]
[re-frame.core :as re-frame]))
@@ -28,20 +28,22 @@
(form-inline {}
[:<>
(field "Form Vendor (will be deleted)"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:type "typeahead-entity"
:auto-focus true
:match->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:from]}])
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:type "typeahead-v3"
:auto-focus true
:entity->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:from]}])
(field "To Vendor"
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:type "typeahead-entity"
:match->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:to]}])])))
[typeahead-v3 {:entities-by-id @(re-frame/subscribe [::subs/vendors-by-id])
:entity-index @(re-frame/subscribe [::subs/searchable-vendors-index])
:type "typeahead-v3"
:entity->text (fn [x]
(str (:name x) " (" (reduce + 0 (map :count (:usage x))) " usages)") )
:field [:to]}])])))
(re-frame/reg-event-fx
::show

View File

@@ -2,8 +2,7 @@
(:require
[re-frame.core :as re-frame]
[auto-ap.subs :as subs]
[auto-ap.views.utils :refer [active-when dispatch-value-change]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]))
[auto-ap.views.utils :refer [active-when dispatch-value-change]]))
(re-frame/reg-sub
::specific-filters