From ac0dbef961afe11bc77a64aff15bfab201da2950 Mon Sep 17 00:00:00 2001 From: Bryce Date: Fri, 31 Jan 2025 19:22:24 -0800 Subject: [PATCH] Makes link dropdown not get cut off --- .../auto_ap/ssr/components/link_dropdown.clj | 2 +- src/clj/auto_ap/ssr/invoices.clj | 52 ++++++++++--------- src/clj/auto_ap/ssr/payments.clj | 8 +-- 3 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/clj/auto_ap/ssr/components/link_dropdown.clj b/src/clj/auto_ap/ssr/components/link_dropdown.clj index cd824a3b..721087b3 100644 --- a/src/clj/auto_ap/ssr/components/link_dropdown.clj +++ b/src/clj/auto_ap/ssr/components/link_dropdown.clj @@ -8,7 +8,7 @@ [:div (com/a-icon-button {:class "relative" - "@click.prevent" "$tooltip($refs.tooltip, {content: ()=>$refs.tooltip.innerHTML, theme: 'light', allowHTML: true, interactive:true})" + "@click.prevent" "$tooltip($refs.tooltip, {content: ()=>$refs.tooltip.innerHTML, theme: 'light', allowHTML: true, interactive:true, popperOptions: {strategy: 'fixed', modifiers: [{name: 'flip', options: {fallbackPlacements: ['top']}}]}})" } svg/paperclip (com/badge {:color "blue"} (count links))) diff --git a/src/clj/auto_ap/ssr/invoices.clj b/src/clj/auto_ap/ssr/invoices.clj index 55f160b9..fdcbb901 100644 --- a/src/clj/auto_ap/ssr/invoices.clj +++ b/src/clj/auto_ap/ssr/invoices.clj @@ -625,31 +625,33 @@ :class "w-8" :render (fn [i] (link-dropdown - (concat (->> i - :invoice/payments - (map :invoice-payment/payment) - (filter (fn [p] - (not= :payment-status/voided - (:payment/status p)))) - (mapcat (fn [p] - (cond-> [{:link (hu/url (bidi/path-for ssr-routes/only-routes - ::payment-route/all-page) - {:exact-match-id (:db/id p)}) - :content (str (format "$%,.2f" (:payment/amount p)) - (some-> (:payment/date p) coerce/to-date-time (atime/unparse-local atime/normal-date) (#(str " payment on " %))))}] - (:payment/transaction p) (conj {:link (hu/url (bidi/path-for client-routes/routes :transactions) - {:exact-match-id (:db/id (first (:payment/transaction p)))}) - :color :secondary - :content "Transaction"}))))) - (when (:invoice/journal-entry i) - [{:link (hu/url (bidi/path-for client-routes/routes :ledger) - {:exact-match-id (:db/id (first (:invoice/journal-entry i)))}) - :color :yellow - :content "Ledger entry"}]) - (when (:invoice/source-url i) - [{:link (:invoice/source-url i) - :color :secondary - :content "File"}]))))}]})) + (into [] + (repeat 5 + (concat (->> i + :invoice/payments + (map :invoice-payment/payment) + (filter (fn [p] + (not= :payment-status/voided + (:payment/status p)))) + (mapcat (fn [p] + (cond-> [{:link (hu/url (bidi/path-for ssr-routes/only-routes + ::payment-route/all-page) + {:exact-match-id (:db/id p)}) + :content (str (format "$%,.2f" (:payment/amount p)) + (some-> (:payment/date p) coerce/to-date-time (atime/unparse-local atime/normal-date) (#(str " payment on " %))))}] + (:payment/transaction p) (conj {:link (hu/url (bidi/path-for client-routes/routes :transactions) + {:exact-match-id (:db/id (first (:payment/transaction p)))}) + :color :secondary + :content "Transaction"}))))) + (when (:invoice/journal-entry i) + [{:link (hu/url (bidi/path-for client-routes/routes :ledger) + {:exact-match-id (:db/id (first (:invoice/journal-entry i)))}) + :color :yellow + :content "Ledger entry"}]) + (when (:invoice/source-url i) + [{:link (:invoice/source-url i) + :color :secondary + :content "File"}]))))))}]})) (def row* (partial helper/row* grid-page)) diff --git a/src/clj/auto_ap/ssr/payments.clj b/src/clj/auto_ap/ssr/payments.clj index 9c0639b7..a7ed513c 100644 --- a/src/clj/auto_ap/ssr/payments.clj +++ b/src/clj/auto_ap/ssr/payments.clj @@ -421,10 +421,10 @@ (map :invoice-payment/invoice) (filter identity) (map (fn [invoice] - {:link (hu/url (bidi/path-for ssr-routes/only-routes - ::invoice-route/all-page) - {:exact-match-id (:db/id invoice)}) - :content (str "Inv. " (:invoice/invoice-number invoice))}))) + {:link (hu/url (bidi/path-for ssr-routes/only-routes + ::invoice-route/all-page) + {:exact-match-id (:db/id invoice)}) + :content (str "Inv. " (:invoice/invoice-number invoice))}))) (some-> p :transaction/_payment ((fn [t] [{:link (hu/url (bidi/path-for client-routes/routes :transactions)