simplifies alpine for syncing props.
This commit is contained in:
29
resources/public/js/alpine-vals.js
Normal file
29
resources/public/js/alpine-vals.js
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
document.addEventListener('alpine:init', () => {
|
||||||
|
Alpine.directive('hx-val', (el, { value, expression }, { evaluateLater, effect, cleanup, evaluate }) => {
|
||||||
|
var config = function(evt) {
|
||||||
|
evt.detail.parameters[value] = evaluate(expression); // add a new parameter into the request
|
||||||
|
}
|
||||||
|
el.addEventListener('htmx:configRequest', config);
|
||||||
|
cleanup(() => {
|
||||||
|
el.removeEventListener('htmx:configRequest', config);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
Alpine.directive('dispatch', (el, { value, expression }, { evaluateLater, effect, cleanup, evaluate }) => {
|
||||||
|
let dependent_properties = evaluateLater(expression)
|
||||||
|
|
||||||
|
effect(() => {
|
||||||
|
dependent_properties(props => {
|
||||||
|
el.dispatchEvent(
|
||||||
|
new CustomEvent(value, {
|
||||||
|
props,
|
||||||
|
bubbles: true,
|
||||||
|
// Allows events to pass the shadow DOM barrier.
|
||||||
|
composed: true,
|
||||||
|
cancelable: true,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
File diff suppressed because one or more lines are too long
@@ -470,6 +470,7 @@
|
|||||||
(com/validated-field
|
(com/validated-field
|
||||||
{:errors (fc/field-errors)
|
{:errors (fc/field-errors)
|
||||||
:x-data (hx/json {:location (fc/field-value)})}
|
:x-data (hx/json {:location (fc/field-value)})}
|
||||||
|
;; TODO make this thing into a component
|
||||||
[:div {:hx-trigger "changed"
|
[:div {:hx-trigger "changed"
|
||||||
:hx-target "next *"
|
:hx-target "next *"
|
||||||
:hx-swap "outerHTML"
|
:hx-swap "outerHTML"
|
||||||
|
|||||||
338
src/clj/auto_ap/ssr/invoice/new_invoice_wizard.clj
Normal file
338
src/clj/auto_ap/ssr/invoice/new_invoice_wizard.clj
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
(ns auto-ap.ssr.invoice.new-invoice-wizard
|
||||||
|
(:require [auto-ap.datomic
|
||||||
|
:refer [conn pull-attr]]
|
||||||
|
[auto-ap.datomic.accounts :as d-accounts]
|
||||||
|
[auto-ap.logging :as alog]
|
||||||
|
[auto-ap.routes.invoice :as route]
|
||||||
|
[auto-ap.routes.utils
|
||||||
|
:refer [wrap-client-redirect-unauthenticated]]
|
||||||
|
[auto-ap.ssr-routes :as ssr-routes]
|
||||||
|
[auto-ap.ssr.common-handlers :refer [add-new-entity-handler]]
|
||||||
|
[auto-ap.ssr.components :as com]
|
||||||
|
[auto-ap.ssr.components.multi-modal :as mm]
|
||||||
|
[auto-ap.ssr.form-cursor :as fc]
|
||||||
|
[auto-ap.ssr.hx :as hx]
|
||||||
|
[auto-ap.ssr.svg :as svg]
|
||||||
|
[auto-ap.ssr.utils
|
||||||
|
:refer [apply-middleware-to-all-handlers entity-id html-response
|
||||||
|
wrap-schema-enforce]]
|
||||||
|
[auto-ap.time :as atime]
|
||||||
|
[bidi.bidi :as bidi]
|
||||||
|
[datomic.api :as dc]
|
||||||
|
[malli.core :as mc]
|
||||||
|
[malli.util :as mut]))
|
||||||
|
|
||||||
|
(def new-form-schema
|
||||||
|
[:map
|
||||||
|
[:invoice/client [:entity-map {:pull [:db/id :client/name :client/accounts]}]]
|
||||||
|
[:invoice/vendor [:entity-map {:pull [:db/id :vendor/name]}]]])
|
||||||
|
|
||||||
|
(defrecord BasicDetailsStep [linear-wizard]
|
||||||
|
mm/ModalWizardStep
|
||||||
|
(step-name [_]
|
||||||
|
"Basic Details")
|
||||||
|
(step-key [_]
|
||||||
|
:basic-details)
|
||||||
|
|
||||||
|
(edit-path [_ _]
|
||||||
|
[])
|
||||||
|
|
||||||
|
(step-schema [_]
|
||||||
|
(mut/select-keys (mm/form-schema linear-wizard) #{:invoice/client :invoice/vendor}))
|
||||||
|
|
||||||
|
(render-step [this request]
|
||||||
|
(mm/default-render-step
|
||||||
|
linear-wizard this
|
||||||
|
:head [:div.p-2 "New invoice"]
|
||||||
|
:body (mm/default-step-body
|
||||||
|
{}
|
||||||
|
[:div {}
|
||||||
|
(fc/with-field :invoice/client
|
||||||
|
(if (:client request)
|
||||||
|
(com/hidden {:name (fc/field-name)
|
||||||
|
:value (:db/id (:client request))})
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Client"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div.w-96
|
||||||
|
(com/typeahead {:name (fc/field-name)
|
||||||
|
:error? (fc/error?)
|
||||||
|
:class "w-96"
|
||||||
|
:placeholder "Search..."
|
||||||
|
:url (bidi/path-for ssr-routes/only-routes :company-search)
|
||||||
|
:value (fc/field-value)
|
||||||
|
:content-fn (fn [c] (pull-attr (dc/db conn) :client/name c))})])))
|
||||||
|
(fc/with-field :invoice/vendor
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Vendor"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div.w-96
|
||||||
|
(com/typeahead {:name (fc/field-name)
|
||||||
|
:error? (fc/error?)
|
||||||
|
:class "w-96"
|
||||||
|
:placeholder "Search..."
|
||||||
|
:url (bidi/path-for ssr-routes/only-routes :vendor-search)
|
||||||
|
:value (fc/field-value)
|
||||||
|
:content-fn (fn [c] (pull-attr (dc/db conn) :vendor/name c))})]))
|
||||||
|
|
||||||
|
[:div.flex.space-x-8
|
||||||
|
(fc/with-field :invoice/date
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Date"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div {:class "w-24"}
|
||||||
|
(com/date-input {:value (-> (fc/field-value)
|
||||||
|
(atime/unparse-local atime/normal-date))
|
||||||
|
:name (fc/field-name)
|
||||||
|
:error? (fc/field-errors)
|
||||||
|
:placeholder "1/1/2024"})]))
|
||||||
|
(fc/with-field :invoice/due
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Due (optional)"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div {:class "w-24"}
|
||||||
|
(com/date-input {:value (-> (fc/field-value)
|
||||||
|
(atime/unparse-local atime/normal-date))
|
||||||
|
:name (fc/field-name)
|
||||||
|
:error? (fc/field-errors)
|
||||||
|
:placeholder "1/1/2024"})]))
|
||||||
|
(fc/with-field :invoice/scheduled-payment
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Scheduled payment (optional)"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div {:class "w-24"}
|
||||||
|
(com/date-input {:value (-> (fc/field-value)
|
||||||
|
(atime/unparse-local atime/normal-date))
|
||||||
|
:name (fc/field-name)
|
||||||
|
:error? (fc/field-errors)
|
||||||
|
:placeholder "1/1/2024"})]))]
|
||||||
|
|
||||||
|
(fc/with-field :invoice/invoice-number
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Invoice Number"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div {:class "w-24"}
|
||||||
|
(com/text-input {:value (-> (fc/field-value))
|
||||||
|
:name (fc/field-name)
|
||||||
|
:error? (fc/field-errors)
|
||||||
|
:placeholder "HA-123"})]))
|
||||||
|
(fc/with-field :invoice/total
|
||||||
|
(com/validated-field
|
||||||
|
{:label "Total"
|
||||||
|
:errors (fc/field-errors)}
|
||||||
|
[:div {:class "w-16"}
|
||||||
|
(com/money-input {:value (-> (fc/field-value))
|
||||||
|
:name (fc/field-name)
|
||||||
|
:class "w-24"
|
||||||
|
:error? (fc/field-errors)
|
||||||
|
:placeholder "212.44"})]))])
|
||||||
|
|
||||||
|
:footer
|
||||||
|
(mm/default-step-footer linear-wizard this :validation-route ::route/new-wizard-navigate)
|
||||||
|
:validation-route ::route/new-wizard-navigate)))
|
||||||
|
|
||||||
|
(defn- location-select*
|
||||||
|
[{:keys [name account-location client-locations value]}]
|
||||||
|
(com/select {:options (into [["" ""]]
|
||||||
|
(cond account-location
|
||||||
|
[[account-location account-location]]
|
||||||
|
|
||||||
|
(seq client-locations)
|
||||||
|
(into [["Shared" "Shared"]]
|
||||||
|
(for [cl client-locations]
|
||||||
|
[cl cl]))
|
||||||
|
:else
|
||||||
|
[["Shared" "Shared"]]))
|
||||||
|
:name name
|
||||||
|
:value value
|
||||||
|
:class "w-full"}))
|
||||||
|
|
||||||
|
(defn- account-typeahead*
|
||||||
|
[{:keys [name value client-id x-model]}]
|
||||||
|
[:div.flex.flex-col
|
||||||
|
(com/typeahead {:name name
|
||||||
|
:placeholder "Search..."
|
||||||
|
:url (str (bidi/path-for ssr-routes/only-routes :account-search) "?client-id=" client-id)
|
||||||
|
:id name
|
||||||
|
:x-model x-model
|
||||||
|
:value value
|
||||||
|
:content-fn (fn [value]
|
||||||
|
(:account/name (d-accounts/clientize (dc/pull (dc/db conn) d-accounts/default-read value)
|
||||||
|
client-id)))})])
|
||||||
|
|
||||||
|
(defn- transaction-rule-account-row*
|
||||||
|
[account client-id client-locations]
|
||||||
|
(com/data-grid-row
|
||||||
|
(-> {:x-data (hx/json {:show (boolean (not (fc/field-value (:new? account))))
|
||||||
|
:accountId (:db/id (fc/field-value (:invoice/account account)))})
|
||||||
|
:data-key "show"
|
||||||
|
:x-ref "p"}
|
||||||
|
hx/alpine-mount-then-appear)
|
||||||
|
(let [account-name (fc/field-name (:transaction-rule-account/account account))]
|
||||||
|
(list
|
||||||
|
|
||||||
|
(fc/with-field :db/id
|
||||||
|
(com/hidden {:name (fc/field-name)
|
||||||
|
:value (fc/field-value)}))
|
||||||
|
(fc/with-field :transaction-rule-account/account
|
||||||
|
(com/data-grid-cell
|
||||||
|
{}
|
||||||
|
(com/validated-field
|
||||||
|
{:errors (fc/field-errors)}
|
||||||
|
(account-typeahead* {:value (fc/field-value)
|
||||||
|
:client-id client-id
|
||||||
|
:name (fc/field-name)
|
||||||
|
:x-model "accountId"}))))
|
||||||
|
(fc/with-field :transaction-rule-account/location
|
||||||
|
(com/data-grid-cell
|
||||||
|
{}
|
||||||
|
(com/validated-field
|
||||||
|
{:errors (fc/field-errors)
|
||||||
|
:x-hx-val:account-id "accountId"
|
||||||
|
:hx-vals (hx/json {:name (fc/field-name)
|
||||||
|
:clientId client-id})
|
||||||
|
:x-dispatch:changed "accountId"
|
||||||
|
:hx-trigger "changed"
|
||||||
|
:hx-get (bidi/path-for ssr-routes/only-routes ::route/location-select)
|
||||||
|
:hx-target "find *"
|
||||||
|
:hx-swap "outerHTML"}
|
||||||
|
(location-select* {:name (fc/field-name)
|
||||||
|
:account-location (:account/location (cond->> (:transaction-rule-account/account @account)
|
||||||
|
(nat-int? (:transaction-rule-account/account @account)) (dc/pull (dc/db conn)
|
||||||
|
'[:account/location])))
|
||||||
|
:client-locations client-locations
|
||||||
|
:value (fc/field-value)}))))
|
||||||
|
(fc/with-field :transaction-rule-account/percentage
|
||||||
|
(com/data-grid-cell
|
||||||
|
{}
|
||||||
|
(com/validated-field
|
||||||
|
{:errors (fc/field-errors)}
|
||||||
|
(com/money-input {:name (fc/field-name)
|
||||||
|
:class "w-16"
|
||||||
|
:value (some-> (fc/field-value)
|
||||||
|
(* 100)
|
||||||
|
(long))}))))))
|
||||||
|
(com/data-grid-cell {:class "align-top"}
|
||||||
|
(com/a-icon-button {"@click.prevent.stop" "show=false; setTimeout(() => $refs.p.remove(), 500)"} svg/x))))
|
||||||
|
|
||||||
|
(defrecord AccountsStep [linear-wizard]
|
||||||
|
mm/ModalWizardStep
|
||||||
|
(step-name [_]
|
||||||
|
"Details")
|
||||||
|
(step-key [_]
|
||||||
|
:accounts)
|
||||||
|
|
||||||
|
(edit-path [_ _]
|
||||||
|
[])
|
||||||
|
|
||||||
|
(step-schema [_]
|
||||||
|
(mut/select-keys (mm/form-schema linear-wizard) #{}))
|
||||||
|
|
||||||
|
(render-step [this {{:keys [snapshot]} :multi-form-state :as request}]
|
||||||
|
(mm/default-render-step
|
||||||
|
linear-wizard this
|
||||||
|
:head [:div.p-2 "Invoice accounts "]
|
||||||
|
:body (mm/default-step-body
|
||||||
|
{}
|
||||||
|
[:div {}
|
||||||
|
(:client/name (:invoice/client snapshot))
|
||||||
|
(fc/with-field :invoice/expense-accounts
|
||||||
|
(com/validated-field
|
||||||
|
{:errors (fc/field-errors)}
|
||||||
|
(com/data-grid {:headers [(com/data-grid-header {} "Account")
|
||||||
|
(com/data-grid-header {:class "w-32"} "Location")
|
||||||
|
(com/data-grid-header {:class "w-16"} "%")
|
||||||
|
(com/data-grid-header {:class "w-16"})]}
|
||||||
|
(fc/cursor-map #(transaction-rule-account-row* %
|
||||||
|
(some->> snapshot :invoice/client :db/id)
|
||||||
|
(some->> snapshot :invoice/client :client/locations)))
|
||||||
|
(com/data-grid-new-row {:colspan 4
|
||||||
|
:hx-get (bidi/path-for ssr-routes/only-routes
|
||||||
|
::route/new-wizard-new-account)
|
||||||
|
:index (count (fc/field-value))
|
||||||
|
:tr-params {:hx-vals (hx/json {:client-id (:db/id (:invoice/client snapshot))})}}
|
||||||
|
"New account"))))])
|
||||||
|
:footer
|
||||||
|
(mm/default-step-footer linear-wizard this :validation-route ::route/new-wizard-navigate)
|
||||||
|
:validation-route ::route/new-wizard-navigate)))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
(defrecord NewWizard2 [_ current-step]
|
||||||
|
mm/LinearModalWizard
|
||||||
|
(hydrate-from-request
|
||||||
|
[this request]
|
||||||
|
this)
|
||||||
|
(navigate [this step-key]
|
||||||
|
(assoc this :current-step step-key))
|
||||||
|
(get-current-step [this]
|
||||||
|
(if current-step
|
||||||
|
(mm/get-step this current-step)
|
||||||
|
(mm/get-step this :basic-details)))
|
||||||
|
(render-wizard [this {:keys [multi-form-state] :as request}]
|
||||||
|
(alog/peek ::MFS multi-form-state)
|
||||||
|
(mm/default-render-wizard
|
||||||
|
this request
|
||||||
|
:form-params
|
||||||
|
(-> mm/default-form-props
|
||||||
|
(assoc :hx-post
|
||||||
|
(str (bidi/path-for ssr-routes/only-routes ::route/pay-submit))))))
|
||||||
|
(steps [_]
|
||||||
|
[:basic-details
|
||||||
|
:accounts])
|
||||||
|
|
||||||
|
(get-step [this step-key]
|
||||||
|
(let [step-key-result (mc/parse mm/step-key-schema step-key)
|
||||||
|
[step-key-type step-key] step-key-result]
|
||||||
|
(get {:basic-details (->BasicDetailsStep this)
|
||||||
|
:accounts (->AccountsStep this)}
|
||||||
|
step-key)))
|
||||||
|
(form-schema [_] new-form-schema)
|
||||||
|
(submit [this {:keys [multi-form-state request-method identity] :as request}]))
|
||||||
|
|
||||||
|
(def new-wizard (->NewWizard2 nil nil))
|
||||||
|
|
||||||
|
|
||||||
|
(defn initial-new-wizard-state [request]
|
||||||
|
(mm/->MultiStepFormState {:TODO nil}
|
||||||
|
[]
|
||||||
|
{}))
|
||||||
|
|
||||||
|
(defn location-select [{{:keys [name account-id client-id value] :as qp} :query-params}]
|
||||||
|
(html-response (location-select* {:name name
|
||||||
|
:value value
|
||||||
|
:account-location (some->> account-id
|
||||||
|
(pull-attr (dc/db conn) :account/location))
|
||||||
|
:client-locations (some->> client-id
|
||||||
|
(pull-attr (dc/db conn) :client/locations))})))
|
||||||
|
(def key->handler
|
||||||
|
(apply-middleware-to-all-handlers
|
||||||
|
{::route/new-wizard (-> mm/open-wizard-handler
|
||||||
|
|
||||||
|
(mm/wrap-wizard new-wizard)
|
||||||
|
(mm/wrap-init-multi-form-state initial-new-wizard-state))
|
||||||
|
::route/location-select (-> location-select
|
||||||
|
(wrap-schema-enforce :query-schema [:map
|
||||||
|
[:name :string]
|
||||||
|
[:client-id {:optional true}
|
||||||
|
[:maybe entity-id]]
|
||||||
|
[:account-id {:optional true}
|
||||||
|
[:maybe entity-id]]]))
|
||||||
|
::route/new-wizard-navigate (-> mm/next-handler
|
||||||
|
(mm/wrap-wizard new-wizard)
|
||||||
|
(mm/wrap-decode-multi-form-state))
|
||||||
|
::route/new-wizard-new-account (->
|
||||||
|
(add-new-entity-handler [:step-params :invoice/expense-accounts]
|
||||||
|
(fn render [cursor request]
|
||||||
|
(transaction-rule-account-row*
|
||||||
|
cursor
|
||||||
|
(:client-id (:query-params request))
|
||||||
|
(some->> (:client-id (:query-params request)) (pull-attr (dc/db conn) :client/locations))))
|
||||||
|
(fn build-new-row [base _]
|
||||||
|
(assoc base :transaction-rule-account/location "Shared")))
|
||||||
|
(wrap-schema-enforce :query-schema [:map
|
||||||
|
[:client-id {:optional true}
|
||||||
|
[:maybe entity-id]]]))}
|
||||||
|
(fn [h]
|
||||||
|
(-> h
|
||||||
|
(wrap-client-redirect-unauthenticated)))))
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
[auto-ap.ssr.grid-page-helper :as helper :refer [wrap-apply-sort]]
|
[auto-ap.ssr.grid-page-helper :as helper :refer [wrap-apply-sort]]
|
||||||
[auto-ap.ssr.hiccup-helper :as hh]
|
[auto-ap.ssr.hiccup-helper :as hh]
|
||||||
[auto-ap.ssr.hx :as hx]
|
[auto-ap.ssr.hx :as hx]
|
||||||
|
[auto-ap.ssr.invoice.new-invoice-wizard :as new-invoice-wizard]
|
||||||
[auto-ap.ssr.pos.common :refer [date-range-field*]]
|
[auto-ap.ssr.pos.common :refer [date-range-field*]]
|
||||||
[auto-ap.ssr.svg :as svg]
|
[auto-ap.ssr.svg :as svg]
|
||||||
[auto-ap.ssr.utils
|
[auto-ap.ssr.utils
|
||||||
@@ -1467,57 +1468,59 @@
|
|||||||
|
|
||||||
(def key->handler
|
(def key->handler
|
||||||
(apply-middleware-to-all-handlers
|
(apply-middleware-to-all-handlers
|
||||||
{::route/all-page (-> (helper/page-route grid-page)
|
(->
|
||||||
(wrap-implied-route-param :status nil))
|
{::route/all-page (-> (helper/page-route grid-page)
|
||||||
::route/paid-page (-> (helper/page-route grid-page)
|
(wrap-implied-route-param :status nil))
|
||||||
(wrap-implied-route-param :status :invoice-status/paid))
|
::route/paid-page (-> (helper/page-route grid-page)
|
||||||
::route/unpaid-page (-> (helper/page-route grid-page)
|
(wrap-implied-route-param :status :invoice-status/paid))
|
||||||
(wrap-implied-route-param :status :invoice-status/unpaid))
|
::route/unpaid-page (-> (helper/page-route grid-page)
|
||||||
::route/voided-page (-> (helper/page-route grid-page)
|
(wrap-implied-route-param :status :invoice-status/unpaid))
|
||||||
(wrap-implied-route-param :status :invoice-status/voided))
|
::route/voided-page (-> (helper/page-route grid-page)
|
||||||
::route/pay-button (-> pay-button
|
(wrap-implied-route-param :status :invoice-status/voided))
|
||||||
(wrap-schema-enforce :query-schema query-schema))
|
::route/pay-button (-> pay-button
|
||||||
::route/delete (-> delete
|
(wrap-schema-enforce :query-schema query-schema))
|
||||||
(wrap-entity [:route-params :db/id] default-read)
|
::route/delete (-> delete
|
||||||
(wrap-schema-enforce :route-params [:map [:db/id entity-id]]))
|
(wrap-entity [:route-params :db/id] default-read)
|
||||||
::route/bulk-delete-confirm (-> bulk-delete-dialog-confirm
|
(wrap-schema-enforce :route-params [:map [:db/id entity-id]]))
|
||||||
(wrap-schema-enforce :form-schema query-schema)
|
::route/bulk-delete-confirm (-> bulk-delete-dialog-confirm
|
||||||
(wrap-admin))
|
(wrap-schema-enforce :form-schema query-schema)
|
||||||
::route/bulk-delete (-> bulk-delete-dialog
|
(wrap-admin))
|
||||||
(wrap-admin))
|
::route/bulk-delete (-> bulk-delete-dialog
|
||||||
::route/pay-wizard (-> mm/open-wizard-handler
|
(wrap-admin))
|
||||||
|
::route/pay-wizard (-> mm/open-wizard-handler
|
||||||
|
|
||||||
(mm/wrap-wizard pay-wizard)
|
(mm/wrap-wizard pay-wizard)
|
||||||
(mm/wrap-init-multi-form-state initial-pay-wizard-state))
|
(mm/wrap-init-multi-form-state initial-pay-wizard-state))
|
||||||
::route/new-wizard (-> mm/open-wizard-handler
|
::route/new-wizard (-> mm/open-wizard-handler
|
||||||
|
|
||||||
(mm/wrap-wizard new-wizard)
|
(mm/wrap-wizard new-wizard)
|
||||||
(mm/wrap-init-multi-form-state initial-new-wizard-state))
|
(mm/wrap-init-multi-form-state initial-new-wizard-state))
|
||||||
::route/new-wizard-navigate (-> mm/next-handler
|
::route/new-wizard-navigate (-> mm/next-handler
|
||||||
(mm/wrap-wizard new-wizard)
|
(mm/wrap-wizard new-wizard)
|
||||||
(mm/wrap-decode-multi-form-state))
|
(mm/wrap-decode-multi-form-state))
|
||||||
::route/new-wizard-new-account (->
|
::route/new-wizard-new-account (->
|
||||||
(add-new-entity-handler [:step-params :invoice/expense-accounts]
|
(add-new-entity-handler [:step-params :invoice/expense-accounts]
|
||||||
(fn render [cursor request]
|
(fn render [cursor request]
|
||||||
(transaction-rule-account-row*
|
(transaction-rule-account-row*
|
||||||
cursor
|
cursor
|
||||||
(:client-id (:query-params request))
|
(:client-id (:query-params request))
|
||||||
(some->> (:client-id (:query-params request)) (pull-attr (dc/db conn) :client/locations))))
|
(some->> (:client-id (:query-params request)) (pull-attr (dc/db conn) :client/locations))))
|
||||||
(fn build-new-row [base _]
|
(fn build-new-row [base _]
|
||||||
(assoc base :transaction-rule-account/location "Shared")))
|
(assoc base :transaction-rule-account/location "Shared")))
|
||||||
(wrap-schema-enforce :query-schema [:map
|
(wrap-schema-enforce :query-schema [:map
|
||||||
[:client-id {:optional true}
|
[:client-id {:optional true}
|
||||||
[:maybe entity-id]]]))
|
[:maybe entity-id]]]))
|
||||||
::route/pay-submit (-> mm/submit-handler
|
::route/pay-submit (-> mm/submit-handler
|
||||||
|
|
||||||
(mm/wrap-wizard pay-wizard)
|
(mm/wrap-wizard pay-wizard)
|
||||||
(mm/wrap-decode-multi-form-state))
|
(mm/wrap-decode-multi-form-state))
|
||||||
::route/pay-wizard-navigate
|
::route/pay-wizard-navigate
|
||||||
(-> mm/next-handler
|
(-> mm/next-handler
|
||||||
(mm/wrap-wizard pay-wizard)
|
(mm/wrap-wizard pay-wizard)
|
||||||
(mm/wrap-decode-multi-form-state))
|
(mm/wrap-decode-multi-form-state))
|
||||||
|
|
||||||
::route/table (helper/table-route grid-page)}
|
::route/table (helper/table-route grid-page)}
|
||||||
|
(merge new-invoice-wizard/key->handler))
|
||||||
(fn [h]
|
(fn [h]
|
||||||
(-> h
|
(-> h
|
||||||
(wrap-status-from-source)
|
(wrap-status-from-source)
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
[:script {:src "https://unpkg.com/dropzone@5.9.3/dist/min/dropzone.min.js"}]
|
[:script {:src "https://unpkg.com/dropzone@5.9.3/dist/min/dropzone.min.js"}]
|
||||||
[:link {:rel "stylesheet" :href "https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" :type "text/css"}]
|
[:link {:rel "stylesheet" :href "https://unpkg.com/dropzone@5/dist/min/dropzone.min.css" :type "text/css"}]
|
||||||
|
[:script {:defer true :src "/js/alpine-vals.js"}]
|
||||||
[:script {:defer true :src "https://cdn.jsdelivr.net/npm/@alpinejs/focus@3.x.x/dist/cdn.min.js"}]
|
[:script {:defer true :src "https://cdn.jsdelivr.net/npm/@alpinejs/focus@3.x.x/dist/cdn.min.js"}]
|
||||||
[:script {:defer true :src "https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"}]
|
[:script {:defer true :src "https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"}]
|
||||||
[:script {:src "https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"}]
|
[:script {:src "https://cdn.jsdelivr.net/npm/signature_pad@4.1.7/dist/signature_pad.umd.min.js"}]
|
||||||
@@ -108,5 +109,4 @@ input[type=number] {
|
|||||||
"x-transition:leave-start" "!opacity-100 !translate-y-0"
|
"x-transition:leave-start" "!opacity-100 !translate-y-0"
|
||||||
"x-transition:leave-end" "!opacity-0 !translate-y-32"}
|
"x-transition:leave-end" "!opacity-0 !translate-y-32"}
|
||||||
|
|
||||||
[:div#modal-content.flex.items-center.justify-center {:class "md:p-12"}
|
[:div#modal-content.flex.items-center.justify-center {:class "md:p-12"}]]]]]]))
|
||||||
]]]]]]))
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
"/voided" ::voided-page}
|
"/voided" ::voided-page}
|
||||||
"/new" {:get ::new-wizard
|
"/new" {:get ::new-wizard
|
||||||
"/navigate" ::new-wizard-navigate
|
"/navigate" ::new-wizard-navigate
|
||||||
"/account/new" ::new-wizard-new-account}
|
"/account/new" ::new-wizard-new-account
|
||||||
|
"/account/location-select" ::location-select}
|
||||||
"/pay-button" ::pay-button
|
"/pay-button" ::pay-button
|
||||||
"/pay" {:get ::pay-wizard
|
"/pay" {:get ::pay-wizard
|
||||||
"/navigate" ::pay-wizard-navigate
|
"/navigate" ::pay-wizard-navigate
|
||||||
|
|||||||
2
terraform/connect-ports-cloud-staging.sh
Executable file
2
terraform/connect-ports-cloud-staging.sh
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
ssh -L 2049:172.31.32.90:2049 3.213.115.86 -L 8983:solr-prod.local:8983 -L 4334:integreat-datomic.local:4334
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
"environment": [
|
"environment": [
|
||||||
{
|
{
|
||||||
"name": "DD_ENV",
|
"name": "DD_ENV",
|
||||||
"value": "prod"
|
"value": "staging"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "DD_SERVICE",
|
"name": "DD_SERVICE",
|
||||||
@@ -16,13 +16,13 @@
|
|||||||
"logConfiguration": {
|
"logConfiguration": {
|
||||||
"logDriver": "awslogs",
|
"logDriver": "awslogs",
|
||||||
"options": {
|
"options": {
|
||||||
"awslogs-group": "/ecs/solr-prod",
|
"awslogs-group": "/ecs/solr-staging",
|
||||||
"awslogs-region": "us-east-1",
|
"awslogs-region": "us-east-1",
|
||||||
"awslogs-stream-prefix": "ecs"
|
"awslogs-stream-prefix": "ecs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dockerLabels": {
|
"dockerLabels": {
|
||||||
"com.datadoghq.tags.env": "prod",
|
"com.datadoghq.tags.env": "staging",
|
||||||
"com.datadoghq.tags.service": "solr"
|
"com.datadoghq.tags.service": "solr"
|
||||||
},
|
},
|
||||||
"mountPoints": [],
|
"mountPoints": [],
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user