Applies all of the feedback for the new page

This commit is contained in:
Bryce
2024-04-14 22:29:01 -07:00
parent 6031f15246
commit 71b5b9864c
10 changed files with 74 additions and 53 deletions

View File

@@ -111,26 +111,26 @@
:active? (= "invoices" selected)}
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/all-page)
{:date-range "month"})
{:date-range "year"})
:active? (= ::invoice-route/all-page (:matched-route request))
:hx-boost "true"}
"All")
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/paid-page)
{:date-range "month"})
{:date-range "year"})
:active? (= ::invoice-route/paid-page (:matched-route request))
:hx-boost "true"}
"Paid")
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/unpaid-page)
{:date-range "month"})
{:date-range "year"})
:active? (= ::invoice-route/unpaid-page (:matched-route request))
:hx-boost "true"}
"Unpaid")
(menu-button- {:href (hu/url (bidi/path-for ssr-routes/only-routes
::invoice-route/voided-page)
{:date-range "month"})
{:date-range "year"})
:active? (= ::invoice-route/voided-page (:matched-route request))
:hx-boost "true"}
"Voided")

View File

@@ -1,26 +1,28 @@
(ns auto-ap.ssr.components.date-range
(:require [auto-ap.ssr.components :as com]
[auto-ap.time :as atime]))
[auto-ap.time :as atime]
[clj-time.coerce :as c]
[clj-time.core :as t]
[clj-time.periodic :as per]))
(defn date-range-field [{:keys [value id] }]
(defn date-range-field [{:keys [value id]}]
[:div {:id id}
(com/field {:label "Date Range"}
[:div.space-y-4
[:div.space-y-4
[:div
(com/button-group {:name "date-range"}
(com/button-group-button {:size :small :value "all" :hx-trigger "click"} "All")
(com/button-group-button {:size :small :value "week" :hx-trigger "click"} "Week")
(com/button-group-button {:size :small :value "month" :hx-trigger "click"} "Month")
(com/button-group-button {:size :small :value "year" :hx-trigger "click"} "Year"))
]
(com/button-group-button {:size :small :value "year" :hx-trigger "click"} "Year"))]
[:div.flex.space-x-1.items-baseline.w-full.justify-start
(com/date-input {:name "start-date"
:value (some-> (:start value)
(atime/unparse-local atime/normal-date))
(atime/unparse-local atime/normal-date))
:placeholder "Date"
:size :small
:class "shrink"})
(com/date-input {:name "end-date"
:value (some-> (:end value)
(atime/unparse-local atime/normal-date))

View File

@@ -20,6 +20,6 @@
[:div.flex.flex-col.gap-y-2
(for [l links]
[:div.flex-initial
[:a {:href (:link l)}
[:a {:href (:link l) :target "_blank"}
(com/pill {:color (or (:color l) :primary) :class "truncate block shrink grow-0"}
(:content l))]])]]]]))

View File

@@ -114,7 +114,7 @@
:class "dark:text-blue-500"}
"Back"])
(defn default-next-button [linear-wizard step validation-route]
(defn default-next-button [linear-wizard step validation-route & {:keys [next-button-content]}]
(let [steps (steps linear-wizard)
last? (= (step-key step) (last steps))
next-step (when-not last? (->> steps
@@ -131,9 +131,10 @@
{:from (encode-step-key (step-key step))
:to (encode-step-key (step-key next-step))})))
(if next-step
(step-name next-step)
"Save")
(or next-button-content
(if next-step
(step-name next-step)
"Save"))
(when-not last?
[:div.w-5.h-5 svg/arrow-right]))))
@@ -143,7 +144,8 @@
(defn default-step-footer [linear-wizard step & {:keys [validation-route
discard-button
next-button]}]
next-button
next-button-content]}]
[:div.flex.justify-end
[:div.flex.items-baseline.gap-x-4
(com/form-errors {:errors (:errors (:step-params fc/*form-errors*))})
@@ -157,7 +159,8 @@
next-button
validation-route
(default-next-button linear-wizard step validation-route)
(default-next-button linear-wizard step validation-route
:next-button-content next-button-content)
:else
[:div "No action possible."])]])