fulcrologic / fulcro-rad

Fulcro Rapid Application Development
MIT License
201 stars 46 forks source link

run-report with app and registry key not working #97

Closed evaogbe closed 1 year ago

evaogbe commented 1 year ago

Calling run-report! with 2 parameters results in this error:

Uncaught Error: No protocol method IAssociative.-assoc defined for type object: [object Object]
    at Object.cljs$core$missing_protocol [as missing_protocol] (core.cljs:324:4)
    at cljs$core$IAssociative$_assoc$dyn_31789 (core.cljs:640:1)
    at Object.cljs$core$_assoc [as _assoc] (core.cljs:640:1)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (core.cljs:2007:9)
    at Function.eval [as cljs$core$IFn$_invoke$arity$4] (core.cljs:5388:5)
    at Function.eval [as cljs$core$IFn$_invoke$arity$4] (ui_state_machines.cljc:808:5)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (ui_state_machines.cljc:805:5)
    at Function.eval [as cljs$core$IFn$_invoke$arity$2] (report.cljc:496:5)
    at eval (home.cljc:41:17)
    at HTMLUnknownElement.callCallback (module$node_modules$react_dom$cjs$react_dom_development.js:653:470)

This is because the definition of run-report! is wrong:

(defn run-report!
  "Run a report with the current parameters"
  ([this]
   (uism/trigger! this (comp/get-ident this) :event/run))
  ([app-ish class-or-registry-key]
   (uism/trigger app-ish (report-ident class-or-registry-key) :event/run))) ; should use trigger! not trigger

uism/trigger without any exclamation points expects the first argument to be the uism env.

awkay commented 1 year ago

Thanks! Fixed in 5f59bda8ee3c40d77f405ec448186800fb6f9df4