kiln / flourish-sdk

The SDK for developing Flourish templates
Other
80 stars 16 forks source link

Conditional settings bug when setting starts with `data` #45

Closed theduncanclark closed 5 years ago

theduncanclark commented 6 years ago

I just added a condition to hide a setting if another setting for data_tables is set to true. The SDK does not like this:

đŸ˜± template.yml: “show_if” or “hide_if” property refers to non-existent data binding “data_tables”

It appears that it has treated my condition as referring to a data binding rather than another setting. Perhaps the SDK is just looking for things that start with data rather than data.?

robinhouston commented 5 years ago

Yes, the problem is that it’s matching against the regular expression /^data./, and a dot in a regular expression matches any character!

https://github.com/kiln/flourish-sdk/blob/cf17a5cb62f0d61d4829c8ccf610d4e52b5f311c/lib/validate_config.js#L238