fixed warnings.
This commit is contained in:
@@ -29,9 +29,8 @@
|
||||
[goog.string :as gstring]
|
||||
[re-frame.core :as re-frame]
|
||||
[reagent.core :as r]
|
||||
[vimsical.re-frame.fx.track :as track]
|
||||
[vimsical.re-frame.cofx.inject :as inject]
|
||||
[react-dom :as react-dom]))
|
||||
[vimsical.re-frame.fx.track :as track]))
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::params-change
|
||||
@@ -51,7 +50,7 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::unmounted
|
||||
(fn [{:keys [db]} _]
|
||||
(fn [_ _]
|
||||
{:dispatch-n [[::data-page/dispose :invoices]
|
||||
[::forms/form-closing ::form/form]]
|
||||
::forward/dispose [{:id ::updated}
|
||||
@@ -60,7 +59,7 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::mounted
|
||||
(fn [{:keys [db]} _]
|
||||
(fn [_ _]
|
||||
{::track/register [{:id ::params
|
||||
:subscription [::data-page/params :invoices]
|
||||
:event-fn (fn [params]
|
||||
@@ -111,7 +110,7 @@
|
||||
(re-frame/reg-event-fx
|
||||
::pay-invoices-from-balance
|
||||
[with-user (re-frame/inject-cofx ::inject/sub [::data-page/checked :invoices])]
|
||||
(fn [{:keys [db user] ::data-page/keys [checked] :as cofx} _]
|
||||
(fn [{:keys [db user] ::data-page/keys [checked]} _]
|
||||
{:graphql
|
||||
{:token user
|
||||
:owns-state {:single ::print-checks}
|
||||
@@ -135,7 +134,7 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::checks-printed
|
||||
(fn [{:keys [db]} [_ invoices pdf-url]]
|
||||
(fn [_ [_ invoices pdf-url]]
|
||||
{:dispatch-n (cond->> [[::data-page/reset-checked :invoices]]
|
||||
true (into (mapv
|
||||
(fn [i]
|
||||
@@ -150,14 +149,14 @@
|
||||
|
||||
(re-frame/reg-event-fx
|
||||
::new-invoice-clicked
|
||||
(fn [{:keys [db]} _]
|
||||
(fn [_ _]
|
||||
{:dispatch [::form/adding {:client @(re-frame/subscribe [::subs/client])
|
||||
:status :unpaid
|
||||
#_#_:date (date->str (c/now) standard)
|
||||
:location (first (:locations @(re-frame/subscribe [::subs/client])))}]}))
|
||||
(re-frame/reg-event-fx
|
||||
::voided-selected
|
||||
(fn [cofx [_]]
|
||||
(fn [_ [_]]
|
||||
{:dispatch-n [[::modal/modal-closed]
|
||||
[::params-change @(re-frame/subscribe [::data-page/params ::page])]
|
||||
[::data-page/reset-checked :invoices]]}))
|
||||
@@ -242,7 +241,7 @@
|
||||
:is-right? true}
|
||||
[:div
|
||||
(list
|
||||
(for [{:keys [id number name type]} (->> (:bank-accounts current-client) (filter :visible) (sort-by :sort-order))]
|
||||
(for [{:keys [id name type]} (->> (:bank-accounts current-client) (filter :visible) (sort-by :sort-order))]
|
||||
(if (= :cash type)
|
||||
^{:key id} [:a.dropdown-item {:on-click (dispatch-event [::print-checks id :cash])
|
||||
:disabled (status/disabled-for print-checks-status)} "With cash"]
|
||||
@@ -276,7 +275,7 @@
|
||||
|
||||
(defn unpaid-invoices-content [{:keys [status]}]
|
||||
(let [page @(re-frame/subscribe [::data-page/page :invoices])
|
||||
current-client @(re-frame/subscribe [::subs/client])]
|
||||
_ @(re-frame/subscribe [::subs/client])]
|
||||
[:div
|
||||
[:h1.title (str (str/capitalize (name (or status :all))) " invoices")]
|
||||
[status/status-notification {:statuses [[::status/single ::print-checks]
|
||||
@@ -297,28 +296,28 @@
|
||||
:main [unpaid-invoices-content params]
|
||||
:right-side-bar [appearing-side-bar {:visible? invoice-bar-active?} [form/form {}]]}]))
|
||||
|
||||
(defn unpaid-invoices-page [params]
|
||||
(defn unpaid-invoices-page []
|
||||
(r/create-class
|
||||
{:display-name "unpaid-invoices-page"
|
||||
:component-will-unmount #(re-frame/dispatch-sync [::unmounted])
|
||||
:component-did-mount #(re-frame/dispatch [::mounted])
|
||||
:reagent-render layout}))
|
||||
|
||||
(defn paid-invoices-page [params]
|
||||
(defn paid-invoices-page []
|
||||
(r/create-class
|
||||
{:display-name "paid-invoices-page"
|
||||
:component-will-unmount #(re-frame/dispatch-sync [::unmounted])
|
||||
:component-did-mount #(re-frame/dispatch [::mounted])
|
||||
:reagent-render layout}))
|
||||
|
||||
(defn voided-invoices-page [params]
|
||||
(defn voided-invoices-page []
|
||||
(r/create-class
|
||||
{:display-name "voided-invoices-page"
|
||||
:component-will-unmount #(re-frame/dispatch-sync [::unmounted])
|
||||
:component-did-mount #(re-frame/dispatch [::mounted])
|
||||
:reagent-render layout}))
|
||||
|
||||
(defn all-invoices-page [params]
|
||||
(defn all-invoices-page []
|
||||
(r/create-class
|
||||
{:display-name "all-invoices-page"
|
||||
:component-will-unmount #(re-frame/dispatch-sync [::unmounted])
|
||||
|
||||
Reference in New Issue
Block a user