Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to customise the base size and layout of widgets in the grid? #102

Open
jameswtelfer opened this issue Sep 17, 2017 · 10 comments

Comments

@jameswtelfer
Copy link

With the original dashing it is possible to customise the size & layout of the widget grid via the application.coffee script that is generated for each dashboard.

I tried lifting the version out of the dashing-rails gem and replicating within my application assets with the new values, which worked so long as config.assets.debug = true is present within the environment config, which obviously means it doesn't work in production. In production the updated code is present within application.js, but does not get executed, instead the code from the gem is executed.

Any suggestions appreciated as I've reached the limit of my abilities at this point!

@gottfrois
Copy link
Owner

have you tried to override this file? https://github.com/gottfrois/dashing-rails/blob/master/app/assets/javascripts/dashing/dashing.coffee

On your rails app, create an exact copy of this file, located at the same location and add your custom code.

Please let me know.

@jameswtelfer
Copy link
Author

Oddly, that works in the development environment, but not in production. Looking at the generated application.js it looks like the overridden version of the file is not included in the compiled assets.

@gottfrois
Copy link
Owner

Have you tried adding it manually in your application.rb?

@jameswtelfer
Copy link
Author

That does something different again. The new code is included in the generated js, but never gets executed (I'm basing that on changing the text that gets printed to the JS console, plus the widgets don't change size. Works as expected in development environment.

@gottfrois
Copy link
Owner

That's progress :)
It's weird though that if the JS file is included it does not get executed :-/

@jameswtelfer
Copy link
Author

Agree it's weird, will have a poke at it over the weekend. It's a toy project at present so if I end up running it in development env then so be it!

@gottfrois
Copy link
Owner

yeah, to be honest, dashing rails is not really production ready due to using the rails action live...

@NashL
Copy link

NashL commented Nov 24, 2017

Hi @jameswtelfer, did you solve this problem? I'm trying to customize the size at production too

@jameswtelfer
Copy link
Author

@NashL not really I'm afraid. It sort of worked if I tuned on all the options to enable the asset generation pipeline in production, but at that point you're practically in development anyway.

@gottfrois
Copy link
Owner

the ideal approach would be to refactor the project using action cable instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants