# HG changeset patch # User cmlenz # Date 1185730200 0 # Node ID 3ba9430a5d8713e086e2649621a3db612a70b46c # Parent 7cd9a26134f51a6f73cff661d724f1528cfd5439 Fix for hardcoded chart generators in UI. Closes #153. diff --git a/bitten/trac_ext/web_ui.py b/bitten/trac_ext/web_ui.py --- a/bitten/trac_ext/web_ui.py +++ b/bitten/trac_ext/web_ui.py @@ -35,6 +35,7 @@ from bitten.queue import collect_changes from bitten.recipe import Recipe, InvalidRecipeError from bitten.trac_ext.api import ILogFormatter, IReportSummarizer +from bitten.trac_ext.charts import ReportChartController from bitten.util import xmlio _status_label = {Build.PENDING: 'pending', @@ -492,10 +493,13 @@ break if has_reports: - req.hdf['config.charts'] = [ - {'href': req.href.build(config.name, 'chart/test')}, - {'href': req.href.build(config.name, 'chart/coverage')} - ] + chart_generators = [] + for generator in self.chart_generators: + for category in generator.get_supported_categories(): + chart_generators.append({ + 'href': req.href.build(config.name, 'chart/' + category) + }) + req.hdf['config.charts'] = chart_generators charts_license = self.config.get('bitten', 'charts_license') if charts_license: req.hdf['config.charts_license'] = charts_license