accordproject / cicero-ui

A library of React components for Accord Project templates
Apache License 2.0
29 stars 46 forks source link

Check if clause node src is a template uri before calling loadTemplateCallback #371

Closed petrgazarov closed 4 years ago

petrgazarov commented 4 years ago

This ensures that we are calling loadTemplateCallback function with a template uri. We have added support for kits in Clause and the src attribute may now also point to a kit uri. The regex for kit uri differs from the regex for template uri.

petrgazarov commented 4 years ago

@dselman Yes, it can

irmerk commented 4 years ago

Will look at this more when I have a chance, but you'll want to adjust your commits (guide)

dselman commented 4 years ago

I would rather not hard code the format of template URIs into the component like this. If you can handle this check inside the callback yourself I think that would be preferable.