applying feedback
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -91,4 +91,5 @@
|
|||||||
(def data-grid-card data-grid/data-grid-card-)
|
(def data-grid-card data-grid/data-grid-card-)
|
||||||
|
|
||||||
(def periods-dropdown periods/periods-dropdown-)
|
(def periods-dropdown periods/periods-dropdown-)
|
||||||
|
(def dates-dropdown periods/dates-dropdown-)
|
||||||
|
|
||||||
|
|||||||
@@ -74,4 +74,55 @@
|
|||||||
[:span {:x-text "p.end"}])]]
|
[:span {:x-text "p.end"}])]]
|
||||||
(buttons/button- {"@click.prevent.stop" "periods.push({start: '', end: ''}); calendarTarget=0" :class "w-32"} "Add new period")]
|
(buttons/button- {"@click.prevent.stop" "periods.push({start: '', end: ''}); calendarTarget=0" :class "w-32"} "Add new period")]
|
||||||
]}]
|
]}]
|
||||||
:active "Quick"}) ]]]])
|
:active "Quick"}) ]]]])
|
||||||
|
|
||||||
|
(defn dates-dropdown- [{:keys [value name]}]
|
||||||
|
[:div {:x-data (hx/json {:dates (map #(atime/unparse-local % atime/normal-date) value)})}
|
||||||
|
[:template {:x-for "v in dates"}
|
||||||
|
[:input {:type "hidden"
|
||||||
|
:name name
|
||||||
|
:x-model "v"}]]
|
||||||
|
(buttons/a-button- {"x-tooltip.on.click.theme.dropdown.placement.bottom.interactive" "{content: ()=> $refs.tooltip.innerHTML, allowHTML: true, appendTo: $root}"
|
||||||
|
:indicator? false}
|
||||||
|
|
||||||
|
[:template {:x-if "dates.length == 0"}
|
||||||
|
[:span.text-left.text-gray-400 "None selected"]]
|
||||||
|
[:template {:x-if "dates.length < 3 && dates.length > 0"}
|
||||||
|
[:span.inline-flex.gap-2
|
||||||
|
[:template {:x-for "v in dates"}
|
||||||
|
(tags/pill- {:color :secondary}
|
||||||
|
[:span {:x-text "v"}])]]]
|
||||||
|
[:template {:x-if "dates.length >= 3"}
|
||||||
|
(tags/pill- {:color :secondary}
|
||||||
|
[:span {:x-text "dates.length"}]
|
||||||
|
" dates")]
|
||||||
|
[:div {:class "w-3 h-3 m-1 inline ml-1 justify-self-end text-gray-500 self-center"}
|
||||||
|
svg/drop-down])
|
||||||
|
[:template {:x-ref "tooltip"}
|
||||||
|
[:div.p-4 {:class "bg-gray-100 dark:bg-gray-600 rounded-lg shadow-2xl w-max z-50 ring-1 p-4"}
|
||||||
|
[:div.flex.flex-col.gap-2
|
||||||
|
(tabs/tabs-
|
||||||
|
{:tabs [{:name "Quick"
|
||||||
|
:content [:div.flex.flex.gap-2
|
||||||
|
(inputs/multi-calendar-input- {:placeholder "12/21/2020"
|
||||||
|
:x-model "dates"})
|
||||||
|
[:div.flex.flex-col.gap-2
|
||||||
|
(buttons/a-button- {"@click" "dates=getFourWeekPeriods(dates[dates.length -1])"} "13 periods")
|
||||||
|
(buttons/a-button- {"@click" "dates=withLastYear(dates[dates.length -1])"} "Add prior year")
|
||||||
|
(buttons/a-button- {"@click" "dates=[]"} "Clear")]]}
|
||||||
|
{:name "Advanced"
|
||||||
|
:content [:div.flex.gap-4 {:class "overflow-hidden max-h-[300px]"
|
||||||
|
:x-data (hx/json {:calendarTarget "0" })}
|
||||||
|
(inputs/calendar-input- {:x-model "dates[calendarTarget]"})
|
||||||
|
[:div.flex.flex-col.gap-4.p-2
|
||||||
|
[:div.overflow-y-scroll.flex.flex-col.gap-4
|
||||||
|
[:template {:x-for "(p, i) in dates" ":key" "i"}
|
||||||
|
[:div.flex.gap-4.
|
||||||
|
(inputs/text-input- {:x-model "p" "@focus" "calendarTarget =i; 'start'"})
|
||||||
|
(buttons/a-icon-button- {"@click.prevent.stop" "dates=dates.filter((_, i2) => i !== i2); calendarTarget=0"} svg/x)]
|
||||||
|
#_(com/pill {:color :secondary}
|
||||||
|
[:span {:x-text "p.start"}]
|
||||||
|
" - "
|
||||||
|
[:span {:x-text "p.end"}])]]
|
||||||
|
(buttons/button- {"@click.prevent.stop" "dates.push(null); calendarTarget=0" :class "w-32"} "Add new period")]]}]
|
||||||
|
:active "Quick"})]]]])
|
||||||
@@ -44,11 +44,14 @@
|
|||||||
(def query-schema (mc/schema
|
(def query-schema (mc/schema
|
||||||
[:maybe [:map
|
[:maybe [:map
|
||||||
[:client {:unspecified/value :all}
|
[:client {:unspecified/value :all}
|
||||||
[:or
|
[:or
|
||||||
[:enum :all]
|
[:enum :all]
|
||||||
[:vector {:coerce? true :min 1 }
|
[:vector {:coerce? true :min 1}
|
||||||
[:entity-map {:pull [:db/id :client/name]}]]
|
[:entity-map {:pull [:db/id :client/name]}]]]]
|
||||||
]]
|
[:include-deltas {:default false}
|
||||||
|
[:boolean {:decode/string {:enter #(if (= % "on") true
|
||||||
|
|
||||||
|
(boolean %))}}]]
|
||||||
[:date {:unspecified/fn (fn [] [(atime/local-now)])}
|
[:date {:unspecified/fn (fn [] [(atime/local-now)])}
|
||||||
[:vector {:coerce? true
|
[:vector {:coerce? true
|
||||||
:decode/string (fn [s] (if (string? s) (str/split s #", ")
|
:decode/string (fn [s] (if (string? s) (str/split s #", ")
|
||||||
@@ -146,36 +149,12 @@
|
|||||||
(fc/with-field :date
|
(fc/with-field :date
|
||||||
(com/validated-inline-field {:label "Date"
|
(com/validated-inline-field {:label "Date"
|
||||||
:errors (fc/field-errors)}
|
:errors (fc/field-errors)}
|
||||||
[:div {:x-data (hx/json {:dates (map #(atime/unparse-local % atime/normal-date) (fc/field-value))}) }
|
(com/dates-dropdown {:value (fc/field-value)
|
||||||
[:template {:x-for "v in dates"}
|
:name (fc/field-name)})))
|
||||||
[:input {:type "hidden"
|
(fc/with-field :include-deltas
|
||||||
:name (fc/field-name)
|
(com/toggle {:name (fc/field-name)
|
||||||
:x-model "v"}] ]
|
:checked (fc/field-value)}
|
||||||
(com/a-button {"x-tooltip.on.click.theme.dropdown.placement.bottom.interactive" "{content: ()=> $refs.tooltip.innerHTML, allowHTML: true, appendTo: $root}"
|
"Include Deltas"))
|
||||||
:indicator? false}
|
|
||||||
|
|
||||||
[:template {:x-if "dates.length == 0"}
|
|
||||||
[:span.text-left.text-gray-400 "None selected"]]
|
|
||||||
[:template { :x-if "dates.length < 3 && dates.length > 0"}
|
|
||||||
[:span.inline-flex.gap-2
|
|
||||||
[:template {:x-for "v in dates" }
|
|
||||||
(com/pill {:color :secondary}
|
|
||||||
[:span {:x-text "v"}])]]]
|
|
||||||
[:template {:x-if "dates.length >= 3"}
|
|
||||||
(com/pill {:color :secondary}
|
|
||||||
[:span {:x-text "dates.length"}]
|
|
||||||
" dates")]
|
|
||||||
[:div {:class "w-3 h-3 m-1 inline ml-1 justify-self-end text-gray-500 self-center"}
|
|
||||||
svg/drop-down])
|
|
||||||
[:template {:x-ref "tooltip"}
|
|
||||||
[:div.p-4 {:class "bg-gray-100 dark:bg-gray-600 rounded-lg shadow-2xl w-max z-50 ring-1 p-4"}
|
|
||||||
[:div.flex.flex-col.gap-2
|
|
||||||
(com/multi-calendar-input {:placeholder "12/21/2020"
|
|
||||||
:x-model "dates" })
|
|
||||||
(com/a-button {"@click" "dates=getFourWeekPeriods(dates[dates.length -1])"} "13 periods")
|
|
||||||
(com/a-button {"@click" "dates=withLastYear(dates[dates.length -1])"} "Add prior year")
|
|
||||||
(com/a-button {"@click" "dates=[]"} "Clear")]]]]))
|
|
||||||
|
|
||||||
(com/button {:color :primary :class "w-32"}
|
(com/button {:color :primary :class "w-32"}
|
||||||
"Run")
|
"Run")
|
||||||
(com/button {:formaction (bidi.bidi/path-for ssr-routes/only-routes ::route/export-balance-sheet) } "Export PDF")]]] ]
|
(com/button {:formaction (bidi.bidi/path-for ssr-routes/only-routes ::route/export-balance-sheet) } "Export PDF")]]] ]
|
||||||
|
|||||||
@@ -806,7 +806,8 @@
|
|||||||
[index p] (map vector (range) (:periods (:args pnl-data)))
|
[index p] (map vector (range) (:periods (:args pnl-data)))
|
||||||
:let [is-first? (= 0 index)
|
:let [is-first? (= 0 index)
|
||||||
period-date (date->str p)
|
period-date (date->str p)
|
||||||
period-headers (if is-first?
|
period-headers (if (or is-first?
|
||||||
|
(not (:include-deltas (:args pnl-data))))
|
||||||
[{:value period-date}]
|
[{:value period-date}]
|
||||||
[{:value period-date}
|
[{:value period-date}
|
||||||
{:value "+/-"}])]
|
{:value "+/-"}])]
|
||||||
@@ -902,7 +903,8 @@
|
|||||||
(negate #{:cogs :payroll :controllable :fixed-overhead :ownership-controllable}))
|
(negate #{:cogs :payroll :controllable :fixed-overhead :ownership-controllable}))
|
||||||
pnl-datas)
|
pnl-datas)
|
||||||
"Retained Earnings")))
|
"Retained Earnings")))
|
||||||
table (if (> (count (:periods (:args pnl-data))) 1)
|
table (if (and (> (count (:periods (:args pnl-data))) 1)
|
||||||
|
(:include-deltas (:args pnl-data)))
|
||||||
(append-deltas table)
|
(append-deltas table)
|
||||||
table)]
|
table)]
|
||||||
{:warning (warning-message pnl-data)
|
{:warning (warning-message pnl-data)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
sudo docker run --rm -ti -v ~/dev/integreat/data/solr:/var/solr --network=bridge -p 8983:8983 bryce-solr
|
#sudo docker run --rm -ti -v ~/dev/integreat/data/solr:/var/solr --network=bridge -p 8983:8983 bryce-solr
|
||||||
#sudo podman container run --user 1000 --privileged --volume /home/notid/dev/integreat/data/solr:/var/solr -p 8983:8983 bryce-solr
|
sudo podman container run --user 1000 --privileged --volume /home/notid/dev/integreat/data/solr:/var/solr -p 8983:8983 bryce-solr
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user