This commit is contained in:
2023-10-26 15:54:41 -07:00
parent 8c3d792b28
commit 5ed23f26be
13 changed files with 37 additions and 100 deletions

View File

@@ -232,7 +232,6 @@
"hx-reswap" "afterbegin")
(= :put request-method) (assoc "hx-retarget" (format "#entity-table tr[data-id=\"%d\"]" (:db/id updated-account)))))))
;; TODO decide when cursors are used. other cases it's not, some are
(defn client-override* [override]
(com/data-grid-row (-> {:x-ref "p"
:data-key "show"
@@ -245,7 +244,7 @@
(fc/with-field :account-client-override/client
(com/data-grid-cell {}
(com/validated-field {:errors (fc/field-errors)}
(com/typeahead-2 {:name (fc/field-name)
(com/typeahead {:name (fc/field-name)
:placeholder "Search..."
:class "w-96"
:url (bidi/path-for ssr-routes/only-routes
@@ -262,20 +261,6 @@
(com/data-grid-cell {:class "align-top"}
(com/a-icon-button {"@click.prevent.stop" "show=false; setTimeout(() => $refs.p.remove(), 500)"} svg/x))))
;; TODO each form:
;; elimante typeahead1
;; work with new dialog
;; use cursor
;; ensure all dialogs are opened the same way
;; form level validation
;; form level validation
;; componentize
;; ensure all dependency oriented stuff works the same way
;; make sure that "new row index" stuff works ok
;; TODO figure out when hx-targets are decided
;; ensure that adding a new one results in a new row
(defn dialog* [{:keys [entity form-params form-errors]}]
(fc/start-form form-params form-errors
[:div {:x-data (hx/json {"accountName" (or (:account/name form-params) (:account/numeric-code entity))
@@ -383,8 +368,6 @@
(com/validated-save-button {:errors (seq form-errors)}
"Save account")])]])]))
;; TODO saving new row should att it to the tbody
(defn new-client-override [{ {:keys [index]} :query-params}]
(html-response
(fc/start-form-with-prefix

View File

@@ -182,7 +182,7 @@
(fc/with-field :client
(com/validated-field {:label "Client"
:errors (fc/field-errors)}
(com/typeahead-2 {:name (fc/field-name)
(com/typeahead {:name (fc/field-name)
:value (fc/field-value)
:placeholder "Search..."
:url (bidi/path-for ssr-routes/only-routes

View File

@@ -56,7 +56,7 @@
[:fieldset.space-y-6
(com/field {:label "Vendor"}
(com/typeahead-2 {:name "vendor"
(com/typeahead {:name "vendor"
:placeholder "Search..."
:url (bidi/path-for ssr-routes/only-routes
:vendor-search)
@@ -318,7 +318,7 @@
(defn- account-typeahead*
[{:keys [name value client-id x-model]}]
[:div.flex.flex-col
(com/typeahead-2 {:name name
(com/typeahead {:name name
:placeholder "Search..."
:url (str (bidi/path-for ssr-routes/only-routes :account-search) "?client-id=" client-id)
:id name
@@ -389,7 +389,6 @@
(com/data-grid-cell {:class "align-top"}
(com/a-icon-button {"@click.prevent.stop" "show=false; setTimeout(() => $refs.p.remove(), 500)"} svg/x))))
;; TODO background jobs and company 1099
(defn dialog* [{:keys [entity form-params form-errors]}]
(fc/start-form form-params form-errors
(com/modal
@@ -448,7 +447,7 @@
:x-show "clientFilter"}
(hx/alpine-appear))
[:div.w-96
(com/typeahead-2 {:name (fc/field-name)
(com/typeahead {:name (fc/field-name)
:error? (fc/error?)
:class "w-96"
:placeholder "Search..."
@@ -520,7 +519,7 @@
(com/validated-field {:label "Assign Vendor"
:errors (fc/field-errors)}
[:div.w-96
(com/typeahead-2 {:name (fc/field-name)
(com/typeahead {:name (fc/field-name)
:placeholder "Search..."
:url (bidi/path-for ssr-routes/only-routes :vendor-search)
:class "w-96"
@@ -572,7 +571,6 @@
(some->> client-id (pull-attr (dc/db conn) :client/locations) client-id)))))
;; TODO check to see if it should be called "Shared" or "shared" for the value
(defn location-select [{{:keys [name account-id client-id value] :as qp} :query-params}]
(html-response (location-select* {:name name