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

@@ -2,7 +2,7 @@
(:require [re-frame.core :as re-frame]
[auto-ap.views.utils :refer [dispatch-event horizontal-field bind-field with-user with-is-admin? active-when account->match-text]]
[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.dropdown :refer [drop-down drop-down-contents]]
[auto-ap.events :as events]
[clj-fuzzy.metrics :refer [jaccard jaro-winkler]]
@@ -154,12 +154,12 @@
[:div.columns
[:div.column
[bind-field
[typeahead-entity {:matches clients
:match->text :name
:type "typeahead-entity"
:field [override-key i]
:event change-event
:subscription data}]]]
[typeahead-v3 {:entities clients
:entity->text :name
:type "typeahead-v3"
:field [override-key i]
:event change-event
:subscription data}]]]
[:div.column.is-1
[:a.button {:on-click (dispatch-event [::removed-override override-key i])} [:span.icon [:span.icon-remove]]]]]))])))
@@ -186,12 +186,12 @@
[:div.columns
[:div.column
[bind-field
[typeahead-entity {:matches clients
:match->text :name
:type "typeahead-entity"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[typeahead-v3 {:entities clients
:entity->text :name
:type "typeahead-v3"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[:div.column
[bind-field
(template
@@ -215,12 +215,12 @@
[:div.columns
[:div.column
[bind-field
[typeahead-entity {:matches clients
:match->text :name
:type "typeahead-entity"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[typeahead-v3 {:entities clients
:entity->text :name
:type "typeahead-v3"
:field [override-key i :client]
:event change-event
:subscription data}]]]
[:div.column
[bind-field
(template
@@ -306,12 +306,12 @@
:override-key :account-overrides}
(fn [field client]
[typeahead-entity {:matches @(re-frame/subscribe [::subs/accounts client])
:match->text account->match-text
:field field
:type "typeahead-entity"
:event change-event
:subscription data}])]
[typeahead-v3 {:entities @(re-frame/subscribe [::subs/accounts client])
:entity->text account->match-text
:field field
:type "typeahead-v3"
:event change-event
:subscription data}])]
[:h2.subtitle "Address"]
[address-field {:field [:address]