reverted.
This commit is contained in:
@@ -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-v3]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||
[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-v3 {:entities @(re-frame/subscribe [::subs/clients])
|
||||
:style {:width "20em"}
|
||||
:entity->text :name
|
||||
:type "typeahead-v3"
|
||||
:field [:client]}]
|
||||
:template [[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
|
||||
:style {:width "20em"}
|
||||
:match->text :name
|
||||
:type "typeahead"
|
||||
:field [:client]}]
|
||||
[:input.input {:type "text"
|
||||
:style {:width "20em"}
|
||||
:placeholder "Bubblegum"
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
(: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.utils :refer [active-when dispatch-value-change]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]))
|
||||
|
||||
|
||||
(re-frame/reg-sub
|
||||
|
||||
@@ -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-v3]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||
[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-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]}]]])
|
||||
[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]}]]])
|
||||
(when (#{:credit ":credit"} type )
|
||||
[:div
|
||||
|
||||
@@ -405,10 +405,10 @@
|
||||
:type "text"
|
||||
:field [:bank-accounts sort-order :yodlee-account-id]}]]
|
||||
[field "Yodlee Account (new)"
|
||||
[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]}]]])
|
||||
[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]}]]])
|
||||
[:div.field
|
||||
[:label.label "Locations"]
|
||||
[:div.control
|
||||
|
||||
@@ -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-v3]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead]]
|
||||
[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 :id)}}
|
||||
{:vendor {:name v :default-account-id (-> db ::expense-accounts (get v) :default-account-id)}}
|
||||
[:id :name]]})
|
||||
|
||||
(get-in db [::excel-import :create-vendors]))}
|
||||
@@ -138,12 +138,11 @@
|
||||
|
||||
[:p.control
|
||||
[bind-field
|
||||
[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}]]]])])]
|
||||
[typeahead {:matches (map (fn [x] [(:id x) (:name x)]) chooseable-expense-accounts)
|
||||
:type "typeahead"
|
||||
:field [v :default-account-id]
|
||||
:event change-event
|
||||
:subscription data}]]]])])]
|
||||
[:div
|
||||
[:button.button.is-pulled-right
|
||||
{:on-click (dispatch-event [::create-vendors])
|
||||
|
||||
@@ -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-v3]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||
[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,8 +180,7 @@
|
||||
[[:accounts] (expense-accounts-field/default-account (:accounts data)
|
||||
@(re-frame/subscribe [::subs/vendor-default-account (:vendor data) value])
|
||||
(:total data)
|
||||
[])
|
||||
[:bank-account] nil]
|
||||
[])]
|
||||
|
||||
:else
|
||||
[]))))
|
||||
@@ -246,29 +245,25 @@
|
||||
|
||||
|
||||
(field "Client"
|
||||
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
|
||||
:auto-focus true
|
||||
:entity->text :name
|
||||
:type "typeahead-v3"
|
||||
:field [:client]
|
||||
:spec ::entity/client}])
|
||||
[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
|
||||
:auto-focus true
|
||||
:match->text :name
|
||||
:type "typeahead-entity"
|
||||
:field [:client]
|
||||
:spec ::entity/client}])
|
||||
|
||||
|
||||
(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 "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}])
|
||||
|
||||
(field "Yodlee Merchant"
|
||||
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/yodlee-merchants])
|
||||
:entity->text #(str (:name %) " - " (:yodlee-id %))
|
||||
:type "typeahead-v3"
|
||||
:field [:yodlee-merchant]}])
|
||||
[typeahead-entity {:matches @(re-frame/subscribe [::subs/yodlee-merchants])
|
||||
:match->text #(str (:name %) " - " (:yodlee-id %))
|
||||
:type "typeahead-entity"
|
||||
:field [:yodlee-merchant]}])
|
||||
|
||||
(field [:span "Description (" [:a {:href "https://regex101.com" :target "_new"} "regex tester"] ")" ]
|
||||
[:input.input {:type "text"
|
||||
@@ -320,12 +315,11 @@
|
||||
[:h2.title.is-4 "Outcomes"]
|
||||
|
||||
(field "Assign 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}])
|
||||
[typeahead-entity {:matches @(re-frame/subscribe [::subs/all-vendors])
|
||||
:match->text :name
|
||||
:type "typeahead-entity"
|
||||
:field [:vendor]
|
||||
:spec ::entity/vendor}])
|
||||
|
||||
(field nil
|
||||
[expense-accounts-field {:type "expense-accounts"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
(:require
|
||||
[re-frame.core :as re-frame]
|
||||
[auto-ap.subs :as subs]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||
[auto-ap.views.pages.data-page :as data-page]))
|
||||
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
[:div
|
||||
[:p.menu-label "Vendor"]
|
||||
[:div
|
||||
[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])}]]])
|
||||
[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])}]]])
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
[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]
|
||||
|
||||
@@ -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-v3]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
|
||||
[auto-ap.views.utils :refer [dispatch-event]]
|
||||
[re-frame.core :as re-frame]))
|
||||
|
||||
@@ -28,22 +28,20 @@
|
||||
(form-inline {}
|
||||
[:<>
|
||||
(field "Form Vendor (will be deleted)"
|
||||
[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]}])
|
||||
[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]}])
|
||||
|
||||
|
||||
(field "To Vendor"
|
||||
[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]}])])))
|
||||
[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]}])])))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::show
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
(: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.utils :refer [active-when dispatch-value-change]]
|
||||
[auto-ap.views.components.typeahead :refer [typeahead-entity]]))
|
||||
|
||||
(re-frame/reg-sub
|
||||
::specific-filters
|
||||
|
||||
Reference in New Issue
Block a user