makes cloud search possible.

This commit is contained in:
2023-05-04 17:07:08 -07:00
parent 2bb1da1636
commit b200728c6a
30 changed files with 1308 additions and 451 deletions

View File

@@ -158,6 +158,7 @@
:else
{:db (-> db
(assoc :active-route handler
:auto-ap.views.components.modal/state nil
:page-failure nil
:menu nil
:query-params params

View File

@@ -4,6 +4,7 @@
[auto-ap.routes :as routes]
[auto-ap.subs :as subs]
[auto-ap.views.components.modal :as modal]
[auto-ap.views.components.search :as search]
[auto-ap.views.components.vendor-dialog :as vendor-dialog]
[auto-ap.views.utils
:refer [active-when
@@ -33,8 +34,7 @@
(println (.-activeElement js/document))
(when-not (.contains @!child (.-activeElement js/document))
(re-frame/dispatch [::events/toggle-menu id])))
2))
}
2))}
[:a {:class "navbar-link login" :on-click (fn [e]
(.preventDefault e)
(.stopPropagation e)
@@ -127,7 +127,7 @@
clients (re-frame/subscribe [::subs/clients])
is-initial-loading @(re-frame/subscribe [::subs/is-initial-loading?])]
[:nav {:class "navbar has-shadow is-fixed-top is-grey"}
[:div {:class "container"}
[:div {:class "navbar-brand"}
[:a {:class "navbar-item", :href "../"}
@@ -166,14 +166,13 @@
(when-not is-initial-loading
[:div.navbar-end
(when (> (count @clients) 1)
[client-dropdown])])]
[client-dropdown])
])]
(when-not is-initial-loading
[login-dropdown])]
]))))
(when (= "admin" (:user/role @user))
[:div {:style {:position "fixed" :top "4px" :right "8px"}}
[search/search-button ]])]))))
(defn appearing-side-bar [{:keys [visible?]} ]
@@ -188,6 +187,7 @@
[:div
[modal/global-modal]
[navbar ap]
[:div {:class "columns has-shadow", :style {:margin-bottom "0px" :height "calc(100vh - 46px)" } :id "mail-app" }
[:aside {:class "column aside menu is-2 " }
[:div.main.left-nav

View File

@@ -0,0 +1,30 @@
(ns auto-ap.views.components.search
(:require
[auto-ap.views.utils :refer [dispatch-event]]
[auto-ap.views.components.modal :as modal]
[reagent.core :as reagent]))
(defn search-dialog-body []
(let [a (atom nil)]
(reagent/create-class
{
:component-did-mount
(fn [this]
(.process js/htmx @a))
:should-component-update
(fn [this]
false)
:reagent-render
(fn []
[:div {:ref (fn [x] (reset! a x))
"hx-get" "/search"
"hx-trigger" "load"}
""])})))
(defn search-button []
[:i.fa.fa-search.button {:on-click
(dispatch-event [::modal/modal-requested
{:title "Search"
:body [search-dialog-body]
:class "semi-wide"}])}
#_[:i.fa.fa-search]])

View File

@@ -190,7 +190,8 @@
(defn content []
(let [is-admin? @(re-frame/subscribe [::subs/is-admin?])]
(let [is-admin? @(re-frame/subscribe [::subs/is-admin?])
_ @(re-frame/subscribe [::data-page/params ::page])]
[:div
[:h1.title "Transactions"]
[status/status-notification {:statuses [[::status/single ::delete-selected]