Add configuration to wysihtml5 widget #1326

Merged
merged 3 commits into from Oct 12, 2012

3 participants

@ahhrrr

Hello,

I'd love to write a patch to allow configuration of the wysihtml5 widget from the rails_admin config DSL. I'd like to be able to set the first set of options here: https://github.com/jhollingworth/bootstrap-wysihtml5/#advanced

Would such a patch be accepted? If so, I'll give it a shot!

@ahhrrr

I began work on a patch, but the spec fails. Following the example of the other wysihtml5 spec, I'm checking for existence (and absence) of the button elements I'm enabling/disabling with the config options. But because they are created with javascript, capybara won't ever see them.

I'd be happy to rework the spec if you can give me an idea about how to test this feature! This is working with manual tests.

Additionally, I'm not totally thrilled with the use .to_json and $.parseJSON and am open to alternative means of data sharing.

Thanks,
Ezra

@bbenezech
Collaborator

Hello @ahhrrr

We don't have any way to test JS at the moment. Just test the JSON presence, it'll be fine.

Is it ready to be merged or do you still need some time ?

@ahhrrr

Hi @bbenezech, I've updated the spec as you requested. It failed one of the CI jobs, but it appears to be because of a bundler issue. So, I think it should be ready to merge. Let me know if there's anything else you need.

@bbenezech
Collaborator

Perfect! Thank you very much.

I'll rebase it to merge. Thanks.

@bbenezech bbenezech merged commit d883601 into sferik:master Oct 12, 2012

1 check failed

Details default The Travis build failed
@RafaelMCarvalho

Awesome! Thank you @ahhrrr. But i'm having a problem.

When access directly a path (Ex. '/admin/posts/new'), it works great, like you did at the spec tests. But when access navigating (Ex. Click link 'Add post'), it doesn't load setted configurations.

Are you having the same problem?
Is it a problem with pjax?

Thank you for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment