Revert "Revert "Enabling signature editing.""

This reverts commit b52f3231e8.
This commit is contained in:
Bryce Covert
2020-12-21 08:47:53 -08:00
parent b52f3231e8
commit 3d0b190702
17 changed files with 1917 additions and 140 deletions

View File

@@ -12,12 +12,12 @@
[auto-ap.entities.vendors :as vendor]
[auto-ap.views.components.typeahead :refer [typeahead-entity]]
[auto-ap.views.components.invoice-table :refer [invoice-table] :as invoice-table]
[cljsjs.dropzone :as dropzone]
[cljs.reader :as edn]
[clojure.string :as str]
[vimsical.re-frame.cofx.inject :as inject]
[auto-ap.status :as status]
[vimsical.re-frame.fx.track :as track]
[dropzone :as dz]
[auto-ap.views.pages.data-page :as data-page]
[clojure.set :as set]
[auto-ap.effects.forward :as forward]))
@@ -29,23 +29,23 @@
(reagent/create-class
{:display-name "dropzone"
:component-did-mount (fn [this]
(js/Dropzone. (rdom/dom-node this)
(clj->js {:init (fn []
(.on (js-this) "addedfiles"
(fn []
(re-frame/dispatch [::status/completed ::import])))
(.on (js-this) "success" (fn [_ files]
(re-frame/dispatch [::invalidated])))
(.on (js-this) "error" (fn [_ error]
(re-frame/dispatch [::status/error ::import [(edn/read-string error)]]))))
:paramName "file"
:headers {"Authorization" (str "Token " @token)}
:url (str "/api/invoices/upload"
(when-let [client-name (-> @client :id)]
(str "?client=" client-name)))
:previewsContainer "#dz-hidden"
:previewTemplate "<div class='dz-hidden-preview'></div>"})))
(dz. (rdom/dom-node this)
(clj->js {:init (fn []
(.on (js-this) "addedfiles"
(fn []
(re-frame/dispatch [::status/completed ::import])))
(.on (js-this) "success" (fn [_ files]
(re-frame/dispatch [::invalidated])))
(.on (js-this) "error" (fn [_ error]
(re-frame/dispatch [::status/error ::import [(edn/read-string error)]]))))
:paramName "file"
:headers {"Authorization" (str "Token " @token)}
:url (str "/api/invoices/upload"
(when-let [client-name (-> @client :id)]
(str "?client=" client-name)))
:previewsContainer "#dz-hidden"
:previewTemplate "<div class='dz-hidden-preview'></div>"})))
:reagent-render (fn []
{:key batch}
[:form.dz {:action "/api/invoices/upload"}