Minor fixes

This commit is contained in:
Bryce Covert
2020-09-17 22:28:53 -07:00
parent 2e18e2da26
commit 12f9982cd7
5 changed files with 66 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
(ns auto-ap.views.pages.error
(:require [re-frame.core :as re-frame]
[auto-ap.views.components.layouts :refer [side-bar-layout]]))
(re-frame/reg-sub
::error
(fn [db]
(:initial-error db)))
(defn error-page []
[:div.container
[:section.is-fullheight.hero
[:div.hero-body
[:div.container
[:div.column.is-8.is-offset-2.has-text-centered
[:div.box.slideInFromBelow
[:img {:src "http://www.integreatconsult.com/wp-content/uploads/2016/11/logo.png"}]
[:div.notification.is-danger.is-light "An unexpected error has occured. "
[:a {:on-click #(.reload (.-location js/document )) } "Click here"]
" to try again."]]
[:p.has-text-gray
"Copyright Integreat 2020"]]]]]]
)

View File

@@ -15,7 +15,9 @@
[cljs-time.core :as c]
[clojure.spec.alpha :as s]
[clojure.string :as str]
[re-frame.core :as re-frame]))
[re-frame.core :as re-frame]
[vimsical.re-frame.fx.track :as track]
[reagent.core :as r]))
;; SUBS
(re-frame/reg-sub
@@ -228,7 +230,20 @@
:submit-event [::saving ]
:id ::form}))
(defn form [{:keys [can-change-amount?] :as params}]
(re-frame/reg-event-fx
::mounted
(fn []
{::track/register [{:id ::client
:subscription [::subs/client]
:event-fn (fn [c]
[::changed [:client] c])}]}))
(re-frame/reg-event-fx
::unmounted
(fn []
{::track/dispose [{:id ::client}]}))
(defn form-content [{:keys [can-change-amount?] :as params}]
[layouts/side-bar {:on-close (dispatch-event [::forms/form-closing ::form ])}
(let [{:keys [data active? error id]} @(re-frame/subscribe [::forms/form ::form])
{:keys [form-inline field raw-field error-notification submit-button ]} invoice-form
@@ -349,3 +364,12 @@
(submit-button "Save")]]])
{:key id}))])
(defn form [p]
(r/create-class
{:display-name "invoice-form"
:component-did-mount #(re-frame/dispatch [::mounted])
:component-will-unmount #(re-frame/dispatch [::unmounted])
:reagent-render (fn [p]
[form-content p])}))

View File

@@ -40,7 +40,6 @@
(mapcat second)
(map :location)
(map not-empty)
(filter #(not= "A" %))
(filter identity)
(set)