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
formatters for JS charts #4003
formatters for JS charts #4003
Conversation
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
<gemfile_checker />Gemfile changes detected in commits https://github.com/himdel/manageiq/compare/ddb185bc281a0869b077df7db6f5ace6cf227cca...dbd6847f2cb79950d10a699d1506f53f2c3f85c1. /cc @JPrause @simaishi |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@martinpovolny depending on how the moment-strftime problem goes you may need to fix the version in the gemfile, but otherwise it should be ready |
@martinpovolny There are some JS test failures, hopefully you can find someone to help fix them up while @himdel is out. |
@dclarizio..They should be taken care of soon, it's just that the new release of moment-strftime included the old minified version instead of the new one (and rails assets picks just that file). (see the link in the top comment) |
@JPrause : are you ok with these gems' inclusion? |
Btw: thx! 🍻 |
@himdel : One small problem: jqplot calls the formatter with an extra argument: wherefor I need something like this:
but again the curried version. Can you fix that for me? There's |
I just wrote this.. but can't actually commit it because github&IE8... Updated the ManageIQ.charts.formatters object so that you can pick between 3 function signatures:
EDIT: commited, fixed and added tests; still waiting for a new moment-strftime release |
…ntation for JS including a js reimplementation of a few rails helper functions registered moment-strftime in bower registry add sprintf-js add numeral.js
this adds specs and fixes various omissions from the previous commit
Updated the ManageIQ.charts.formatters object so that you can pick between 3 function signatures: * formatters.foo will take value and options and return the result directly * formatters.foo.c3 will take options and return a function taking a value * formatters.foo.jqplot will do the same except the resulting function ignores its first argument and works with the second Also, tests.
Tests failures fixed by a new moment-strftime release, ready for merging :) |
formatters for JS charts
Checked commits https://github.com/himdel/manageiq/compare/a09b208a3ee4bd28732e362d1e1d898e9352d1f3~...07a37d65103a3be39dac0977741dcb5cfb0ada2f with ruby 1.9.3, rubocop 0.33.0, and haml-lint 0.13.0 |
JS implementation of
MiqReport::Formatting#format_*
, meant to be used by code from #3894.Curried so that we can say things like
axis.x.tick.formatter = ManageIQ.charts.formatters.boolean({ format: 't_f' });
. (ManageIQ.charts.formatters.number_with_delimiter({ precision: 3, separator: '!', delimiter: '@' })(123456.7891)
yields"123@456!789"
).TODO:
Will do a separate PR addressing these issues later:
EDIT:
The date-related test failures will be gone after benjaminoakes/moment-strftime#15 .