Merge pull request #605 from EverythingMe/small_fixes_11_10_2015

Feature: allow setting HighChart's turbo threshold value
This commit is contained in:
Arik Fraimovich 2015-10-11 15:30:58 +03:00
commit 1a3df37940
4 changed files with 13 additions and 2 deletions

View File

@ -272,6 +272,9 @@
};
var chartOptions = $.extend(true, {}, defaultOptions, chartsDefaults);
chartOptions.plotOptions.series = {
turboThreshold: featureFlags.highChartsTurboThreshold
}
// $timeout makes sure that this function invoked after the DOM ready. When draw/init
// invoked after the DOM is ready, we see first an empty HighCharts objects and later

View File

@ -248,7 +248,12 @@ function getKeyFromObject(obj, key) {
element.html(column.cellTemplate);
compile(element.contents())(childScope);
} else {
element.html(sanitize(scope.formatedValue));
if (typeof scope.formatedValue === 'string' || scope.formatedValue instanceof String) {
element.html(sanitize(scope.formatedValue));
} else {
element.text(scope.formatedValue);
}
}
}

View File

@ -38,7 +38,8 @@ def index(**kwargs):
features = {
'clientSideMetrics': settings.CLIENT_SIDE_METRICS,
'allowScriptsInUserInput': settings.ALLOW_SCRIPTS_IN_USER_INPUT
'allowScriptsInUserInput': settings.ALLOW_SCRIPTS_IN_USER_INPUT,
'highChartsTurboThreshold': settings.HIGHCHARTS_TURBO_THRESHOLD
}
return render_template("index.html", user=json.dumps(user), name=settings.NAME,

View File

@ -141,6 +141,8 @@ SENTRY_DSN = os.environ.get("REDASH_SENTRY_DSN", "")
# Client side toggles:
ALLOW_SCRIPTS_IN_USER_INPUT = parse_boolean(os.environ.get("REDASH_ALLOW_SCRIPTS_IN_USER_INPUT", "false"))
CLIENT_SIDE_METRICS = parse_boolean(os.environ.get("REDASH_CLIENT_SIDE_METRICS", "false"))
# http://api.highcharts.com/highcharts#plotOptions.series.turboThreshold
HIGHCHARTS_TURBO_THRESHOLD = int(os.environ.get("REDASH_HIGHCHARTS_TURBO_THRESHOLD", "1000"))
# Features:
FEATURE_ALLOW_ALL_TO_EDIT_QUERIES = parse_boolean(os.environ.get("REDASH_FEATURE_ALLOW_ALL_TO_EDIT", "true"))