nfms4redd / portal

NFMS web portal client
1 stars 1 forks source link

Fix highcharts (chart library) version on chart template #28

Closed fergonco closed 10 years ago

fergonco commented 10 years ago

Currently the template references a highcharts URL that has no version information. We should use a concrete version instead because a new release of highcharts may break that is not compatible with the usage we are doing may break the production of charts.

Damianofds commented 10 years ago

Currently the only chart template under version control I found is the basic one in the chef-nfms-portal repository [1] and it uses the following URL[2] to download the highchart library that is relative to the nfms-portal context.

The chef cookbook still use the old version of the portal[3] and In that project the highchart library is stored inside the js directory, the version is 2.1.5 so no issue about the version.

The new portal (this) still not include the highchart library so, when the chef-nfms-portal cookbook will be update the problem of managing highchart library will occur. But this is a future issue related to another issue tracker so I'm going to close this.

Just a last comment about how to manage the highchart library loading: Instead of host the library files on our server we can hotlink a version on the highcharts servers, see the discussion here [4] as we do with jquery library.

[1] https://github.com/nfms4redd/chef-nfms-portal/blob/master/cookbooks/unredd-nfms-portal/files/default/geobatch_dir/config/chartscripts/deforestation_chart_template.html [2] /portal/js/highcharts/highcharts.js [3] https://github.com/nfms4redd/nfms-portal/tree/master/src/main/webapp/js/highcharts [4] https://github.com/nfms4redd/nfms-portal/commit/2dde10b79f23d18f9315ad0e32ed1eec77f84f5a

fergonco commented 10 years ago

Still a problem here: portal/src/main/resources/org/fao/unredd/charts/highcharts-template.vtl

Damianofds commented 10 years ago

ah ok, in that template the highchart library is downloaded from highcharts website (I think it is preferable than host the library on our portal) so we have only to replace there the latest stable link [1] with the 2.2.4 [2] link, right Fernando?

Here [3] can be found the links to all versions.

[1] http://code.highcharts.com/highcharts.js [2] http://code.highcharts.com/2.2.4/highcharts.js [3] http://code.highcharts.com/

fergonco commented 10 years ago

Yes, I'll do.