everything except pagination

This commit is contained in:
Bryce Covert
2020-08-23 07:59:34 -07:00
parent edbc9f85c4
commit 84137161bf
7 changed files with 24 additions and 28 deletions

View File

@@ -9511,9 +9511,12 @@ tbody tr.live-added {
animation-fill-mode: forwards;
}
.button.is-outlined {
border-width: 1.75px;
.button {
font-weight: 800;
}
.button.is-outlined {
border-width: 2.5px;
}
/*# sourceMappingURL=bulma.min.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -163,10 +163,9 @@ tbody tr.live-added {
animation: flashPrimary 1.0s ease both;
animation-fill-mode: forwards;
}
.button.is-outlined {
border-width: 1.75px;
.button {
font-weight: 800;
}
.button.is-outlined {
border-width: 2.5px;
}

View File

@@ -1,16 +1,7 @@
(ns auto-ap.datomic
(:require [datomic.api :as d]
[auto-ap.db.vendors :as v]
[auto-ap.db.companies :as c]
[auto-ap.db.invoices :as i]
[auto-ap.db.checks :as checks]
[auto-ap.db.users :as users]
[auto-ap.db.invoices-expense-accounts :as iea]
[auto-ap.db.invoices-checks :as ic]
[auto-ap.db.transactions :as transactions]
[clojure.string :as str]
[clj-time.core :as time]
(:require [auto-ap.utils :refer [default-pagination-size]]
[clj-time.coerce :as coerce]
[datomic.api :as d]
[mount.core :as mount]))
(def uri "datomic:sql://invoices?jdbc:postgresql://database:5432/datomic?user=datomic&password=datomic")
@@ -815,6 +806,6 @@
{:ids (->> results
(drop (:start args 0))
(take (:count args 100))
(take (:count args default-pagination-size))
(map last))
:count (count results)})

View File

@@ -67,3 +67,5 @@
(if (some identity vs)
(reduce #(rec-merge %1 %2) v vs)
(last vs))))
(def default-pagination-size 20)

View File

@@ -1,6 +1,7 @@
(ns auto-ap.views.components.grid
(:require [reagent.core :as r]
[auto-ap.views.utils :refer [appearing]]
[auto-ap.utils :refer [default-pagination-size]]
[react :as react]
[re-frame.core :as re-frame]
[auto-ap.views.pages.data-page :as data-page]))
@@ -54,7 +55,7 @@
y))
(defn paginator [{:keys [start end count total on-change]}]
(let [per-page 100
(let [per-page default-pagination-size
max-buttons 5
buttons-before (Math/floor (/ max-buttons 2))
total-pages (Math/max 1 (Math/ceil (/ total per-page)))
@@ -189,7 +190,7 @@
(cond (= :loading (:state status))
^{:key "loading-body"}
[:tbody.test
(for [i (range 20)]
(for [i (range default-pagination-size)]
^{:key i}
[:tr
(for [x (range column-count)]
@@ -258,9 +259,9 @@
(r/children (r/current-component)))))))
(defn virtual-paginate [start xs ]
(take 100 (drop (or start 0) xs)))
(take default-pagination-size (drop (or start 0) xs)))
(defn virtual-paginate-controls [start xs]
{:start (or start 0) :end (min (+ (or start 0) 100)
{:start (or start 0) :end (min (+ (or start 0) default-pagination-size)
(count xs))
:total (count xs)})

View File

@@ -23,8 +23,8 @@
(def cell (r/adapt-react-class js/Recharts.Cell))
(def tool-tip (r/adapt-react-class js/Recharts.Tooltip))
(def colors ["hsl(171, 100%, 41%)" "hsl(217, 71%, 53%)" "hsl(141, 71%, 48%)" "hsl(48, 100%, 67%)" "hsl(348, 100%, 61%)" "hsl(217, 71%, 53%)" "hsl(141, 53%, 53%)"])
(def light-colors ["hsl(171, 60%, 80%)" "hsl(217, 71%, 53%)" "hsl(141, 71%, 48%)" "hsl(48, 100%, 67%)" "hsl(348, 100%, 61%)" "hsl(217, 71%, 53%)"])
(def colors ["#79b52e" "#009cea" "#209b1c" "#f48017" " #ff0303" "hsl(217, 71%, 53%)" "hsl(141, 53%, 53%)"])
(def light-colors ["#a6d869" "#8ad8ff" "#2cd327" "#fac899" "#ff6b6b" "hsl(217, 71%, 53%)"])
(defn make-pie-chart
[{:keys [width height data]}]
@@ -278,8 +278,8 @@
[grid/header-cell {} "Name"]
[grid/header-cell {:class "has-text-right"} "Amount"]]]
[grid/body
(for [{:keys [date days-until type name amount] } (:data page)]
^{:key date}
(for [[i {:keys [date days-until type name amount] }] (map vector (range) (:data page))]
^{:key i}
[grid/row {}
[grid/cell {}
(if (> days-until 0)