fully removes old invoice experience
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
(ns auto-ap.ssr.invoice.glimpse
|
||||
(:require [amazonica.aws.s3 :as s3]
|
||||
[amazonica.aws.textract :as textract]
|
||||
[auto-ap.client-routes :as client-routes]
|
||||
[auto-ap.datomic :refer [conn pull-attr]]
|
||||
[auto-ap.datomic.clients :as d-clients]
|
||||
[auto-ap.datomic.vendors :as d-vendors]
|
||||
[auto-ap.datomic.invoices :as d-invoices]
|
||||
[auto-ap.datomic.vendors :as d-vendors]
|
||||
[auto-ap.graphql.utils :refer [extract-client-ids]]
|
||||
[auto-ap.logging :as alog]
|
||||
[auto-ap.routes.invoice :as i-route]
|
||||
[auto-ap.solr :as solr]
|
||||
[auto-ap.ssr-routes :as ssr-routes]
|
||||
[auto-ap.ssr.components :as com]
|
||||
@@ -443,8 +443,8 @@ invoice_dropzone = new Dropzone(\"#invoice\", {
|
||||
:headers {"hx-push-url" (bidi/path-for ssr-routes/only-routes :invoice-glimpse)
|
||||
"hx-retarget" "#invoice-glimpse-content"
|
||||
"hx-trigger" (cheshire/generate-string {"notification" (str (hiccup/html [:div "Successfully created "
|
||||
(com/link {:href (str (bidi/path-for client-routes/routes
|
||||
:invoices)
|
||||
(com/link {:href (str (bidi/path-for ssr-routes/only-routes
|
||||
::i-route/all-page)
|
||||
"?exact-match-id="
|
||||
new-invoice-id)}
|
||||
(format "invoice %s" (:invoice/invoice-number new-invoice)))
|
||||
|
||||
@@ -339,7 +339,7 @@
|
||||
|
||||
[:div.flex.justify-between.items-center [:h1.text-2xl.mb-3.font-bold "Import new invoices"]
|
||||
|
||||
[:div.flex.gap-2.items-baseline "Trouble with the new upload experience?"
|
||||
#_[:div.flex.gap-2.items-baseline "Trouble with the new upload experience?"
|
||||
[:a {:href (bidi/path-for client-routes/routes :import-invoices)}
|
||||
(com/pill {:color :secondary}
|
||||
"Go back to previous version")]]]
|
||||
|
||||
@@ -1266,6 +1266,12 @@
|
||||
[]
|
||||
{:mode :simple
|
||||
:has-warning? (boolean has-warning?)}))))
|
||||
(defn redirect-handler [target-route]
|
||||
(fn handle [request]
|
||||
{:status 302
|
||||
:headers {"Location" (str (hu/url (bidi.bidi/path-for ssr-routes/only-routes
|
||||
target-route)
|
||||
(:query-params request)))}}))
|
||||
|
||||
(def key->handler
|
||||
(apply-middleware-to-all-handlers
|
||||
@@ -1278,6 +1284,12 @@
|
||||
(wrap-implied-route-param :status :invoice-status/unpaid))
|
||||
::route/voided-page (-> (helper/page-route grid-page :parse-query-params? false)
|
||||
(wrap-implied-route-param :status :invoice-status/voided))
|
||||
::route/legacy-invoices (redirect-handler ::route/all-page)
|
||||
::route/legacy-import-invoices (redirect-handler ::route/import-page)
|
||||
::route/legacy-unpaid-invoices (redirect-handler ::route/unpaid-page)
|
||||
::route/legacy-paid-invoices (redirect-handler ::route/paid-page)
|
||||
::route/legacy-voided-invoices (redirect-handler ::route/voided-page)
|
||||
::route/legacy-new-invoice (redirect-handler ::route/new-wizard)
|
||||
::route/unvoid (-> unvoid-invoice
|
||||
(wrap-entity [:route-params :db/id] default-read)
|
||||
(wrap-schema-enforce :route-params [:map [:db/id entity-id]]))
|
||||
|
||||
Reference in New Issue
Block a user