This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-25
Channels
- # alda (7)
- # aleph (10)
- # announcements (3)
- # babashka (103)
- # beginners (54)
- # calva (62)
- # clerk (2)
- # clj-yaml (27)
- # cljs-dev (1)
- # clojure (61)
- # clojure-europe (64)
- # clojure-nl (3)
- # clojure-norway (34)
- # clojure-sweden (4)
- # clojure-uk (4)
- # conjure (9)
- # cursive (1)
- # data-science (3)
- # fulcro (20)
- # gratitude (1)
- # hyperfiddle (54)
- # lsp (9)
- # malli (7)
- # meander (4)
- # membrane (17)
- # off-topic (23)
- # releases (3)
- # sci (1)
- # shadow-cljs (5)
- # sql (1)
- # tree-sitter (8)
- # vim (6)
I have a resolver: #?(:clj (defresolver all-itineraries-resolver [env params] {::pc/output [{:itinerary/all-itineraries [:itinerary/id {:itinerary/destination-city [:city/city-name]}]}]} {:itinerary/all-itineraries (get-all-itineraries env params)})) which when I run a report gives me a query: [({:itinerary/all-itineraries [:itinerary/id :itinerary/date {:itinerary/destination-city [:city/city-name]} :itinerary/raw-price :itinerary/formatted-price]})] with results: {:itinerary/all-itineraries [{:itinerary/raw-price 167, :itinerary/formatted-price "$167", :itinerary/id #uuid "018acbc2-e4b6-8aaa-807e-c86a735d1202", :itinerary/destination-city {:city/city-name "London"}, :itinerary/date #inst "2023-09-26T00:00:00.000-00:00"} {:itinerary/raw-price 402.99, :itinerary/formatted-price "$403", :itinerary/id #uuid "018acbc2-e4b6-8aaa-807e-c86a735d11fd", :itinerary/destination-city {:city/city-name "London"}, :itinerary/date #inst "2023-09-26T00:00:00.000-00:00"} .... How would I display the city-name in the report? Or is there a better way to do this?
Or you could add a virtual attribute to the model that flattens this value up a level, use that on the report, and provide a resolver for it.
See https://gist.github.com/holyjak/207ed33c9ee7e003b9a779fa47c32d91#displaying-to-one-ref-attributes
File: jar:file:/home/circleci/.m2/repository/com/fulcrologic/fulcro-rad/1.5.6/fulcro-rad-1.5.6.jar!/com/fulcrologic/rad/report.cljc
failed to require macro-ns "com.fulcrologic.rad.report", it was required by "com.fulcrologic.rad.report"
Error in phase :compile-syntax-check
RuntimeException: No such var: comp/sc
Looks like sc
was removed from comp
in the newest rad iterations but report
wasn't updated.yep that was totally the problem - upgrading to fulcro 3.6.6 worked. Sorry! I forgot rad depended on updates fulcro pretty closely
I just realized I never documented this feature: https://book.fulcrologic.com/#_shadow_cljs_build_tool_configuration You can turn on HTML source annotations which tell you what line of code emits what DOM element. It’s been there for years, but undocumented 😕