Got all typeaheads to one place

This commit is contained in:
2021-05-23 15:47:22 -07:00
parent 8214b30a3e
commit 21dd112395
34 changed files with 2509 additions and 440 deletions

View File

@@ -16,7 +16,7 @@
[auto-ap.views.components.modal :as modal]
[auto-ap.views.components.money-field :refer [money-field]]
[auto-ap.views.components.switch-field :refer [switch-field]]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.typeahead :refer [typeahead-v3]]
[auto-ap.views.pages.invoices.common :refer [invoice-read]]
[auto-ap.views.utils
:refer
@@ -348,22 +348,22 @@
(when-not @(re-frame/subscribe [::subs/client])
(field [:span "Client"
[:span.has-text-danger " *"]]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/clients])
:match->text :name
:type "typeahead"
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/clients])
:entity->text :name
:type "typeahead-v3"
:auto-focus (if @(re-frame/subscribe [::subs/client]) false true)
:field [:client]
:disabled exists?
:spec ::invoice/client}]))
(field [:span "Vendor"
[:span.has-text-danger " *"]]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/vendors])
:match->text :name
:type "typeahead"
:disabled exists?
:auto-focus (if @(re-frame/subscribe [::subs/client]) true false)
:field [: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"
:disabled exists?
:auto-focus (if @(re-frame/subscribe [::subs/client]) true false)
:field [:vendor]}])
(field [:span "Date"
[:span.has-text-danger " *"]]