Fork me on GitHub
#fulcro
<
2020-06-10
>
folcon11:06:40

Our little fulcro study group, is meeting again in 10 mins =)…

👍 4
souenzzo12:06:52

Hey please ping me next time too. would love to join.

folcon12:06:57

Oh sure =)…

Jakub Holý (HolyJak)14:06:43

hi! I am sorry, I have work meetings at the same time 😞

Chris O’Donnell15:06:09

Thanks for the ping! I am at the mercy of my 6 week old baby's whims right now. Can only join if he allows it.

Jakub Holý (HolyJak)15:06:35

Gods be with you :-)

folcon15:06:26

No problem, just let me know if you don’t want me to ping you ;)…

lgessler20:06:31

i'm interested in joining next week! please ping me if you can

3
folcon10:06:04

Hey everyone, we’ll be meeting in an hour from now if anyone want’s to join in? Pinging @U0522TWDA@U04VBBS6N@U0DUNNKT2, @U2J4FRT2T, @U49U72C4V =)…

Jakub Holý (HolyJak)10:06:25

Thx! I am on a conference today.... 😞

😞 3
folcon12:06:38

Just wrapped up =)…

zilti13:06:01

What exactly triggers the error-action in a client mutation? I tried as much as throwing an exception in the server-side pathom mutation, but that still triggers the ok-action

Jakub Holý (HolyJak)14:06:24

I can describe how this works for normal loads, I guess the same applies to mutations. By default only non-200 status is considered an error. To change that, set :remote-error? on the Fulcro app, checking e.g. for the top-level :com.wsscode.pathom.core/errorskey in the body (beware: make sure it is included in your query, e.g. via global-eql-transform). When this returns true then it will trigger the :global-error-action , which you can also override. I assume that for a mutation it would invoke its error-action

zilti15:06:22

Oh I am fine with only non-200 being an error, but in all Fulcro examples, the error-action gets triggered by throwing an exception, yet in fulcro-rad-demo that does not work

Jakub Holý (HolyJak)15:06:16

Try what I suggested. BTW latest RAD adds the psthom/errors automatically to the query. Check the raw network response in the browser dev tools I bet you will see the error there

zilti15:06:39

Hm yes, it is in the raw response

Jakub Holý (HolyJak)06:06:58

cool. Can you access it in the :remote-error? fn, and return true when present?

zilti09:06:04

I'll try that, but it feels hacky

zilti13:06:21

Okay I checked again, and I don't have it as a top-level. All I have is a :com.fulcrologic.rad.pathom/errors key that is inside :body namespace/mutation-name. But I guess that'll have to do.

👍 4
Jakub Holý (HolyJak)16:06:27

It is not hacky, that's what remote error is for.

zilti13:06:55

The parameters sent back to the client mutation's ok-action contain the :outgoing-request under the :result key

tvaughan16:06:13

Is a route-segement with more than two items, like :route-segment ["drawing" :drawing/id "view"], valid? This produces /drawing/:drawing/id/39d38f08-4255-410d-93c8-4ace2209fb06. This does work when there are just two items, like :route-segment ["view-drawing" :drawing/id]

tony.kay18:06:55

@tvaughan don’t remember, to be honest

tony.kay18:06:42

in that I don’t remember if there is a real limitation necessary, or if misbehavior would be a bug

tony.kay18:06:31

I see no problem with it on the surface, and would lean towards “it should work”…but you have to run through the nesting cases. What if someone started with a parameter? IF two siblings did that matching could get difficult

tony.kay18:06:31

so route segments need to start with a solid string, and a trailing string really strains the possible problems with route matching. I would recommend making the 3rd a parameter if that really needs to vary, instead of trying to make route matching figure it out

tony.kay18:06:00

["drawing" :drawing/id :drawing/action], and dispatch within your target to the different functionalities

tvaughan18:06:23

Thanks @tony.kay I'll give this a try

tvaughan14:06:07

This :route-segment ["drawing" :drawing/id "view"] works with (dynamic-routing/path-to DrawingView id "view") FYI

grant18:06:00

@tony.kay, you mentioned yesterday that you could use query-inclusion on a report to get extra data for controls. I thought query-inclusion only worked for forms, fo/query-inclusion. There is ro/row-query-inclusion, that solves the problem for row controls. What if I want to get additional data to a report level control like “Add Item”? Should there be a ro/query-inclusion too?

tony.kay18:06:48

report level controls are what ro/controls are about

tony.kay18:06:26

ah, but you’re saying you want the report to get that data from where? There is no query for the report, only the rows

grant18:06:47

Yup. 🙂

grant18:06:28

If I put a report level control, it gets this, which means I can get the props, but if I want more information, like the current user, or the user’s department, information that would let me fill in better defaults or fill in hidden form attributes. Being able to add a query at the top level of the report instead of the rows would allow getting extra attributes for the report level controls. Unless there is already a better way to handle this sort of thing?

Jakub Holý (HolyJak)06:06:37

Hi! I was thinking about the same, that I might need it. So you are not the only one 🙂

tony.kay18:06:19

ah, ok, so you want like link-level queries and such. Sure, thats fine. Send a PR. Add an option to report-options, and then tweak the macro. It’s straightforward.

🙏 4
zilti18:06:08

So I think I might add an "actual" pick-many to the form generator, but I am not sure if you have some kind of policy as to the kind of elements allowed in fulcro-rad-semantic-ui. Would it be okay if I use Semantic UI React components in there? Because for what I've seen, right now there are only "normal" components in there.

Jakub Holý (HolyJak)07:06:54

As discussed here previously, it makes sense to use dom + semantic ui classes for simple cases and Semantic React components if you also need their built-in behavior.

tony.kay21:06:22

the types of elements allowed in f-r-sui right now are anything that is in the deps, which includes SUI react.

tony.kay21:06:06

I’m considering adding one or two more deps, like react-number-format , which I find handy for a number of fields and use in my own projects…but I’m torn on that in the lib

tony.kay21:06:43

and it’s easy enough to just add your own per project…they are pretty darn simple to make

dvingo22:06:14

PSA, new version of shadow-cljs is out with improved inspect support: https://clojureverse.org/t/status-update-inspect-cljs-eval/6074

👍 6