Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
Fix default statistical value for old widgets
Browse files Browse the repository at this point in the history
When a statistical widget was created with Graylog < 1.1, we used a
different value for the standard deviation statistical function. These
changes will fix the default value on the edit widget modal, so the
right statistical function is selected by default.

Refs #1565
  • Loading branch information
Edmundo Alvarez committed Aug 31, 2015
1 parent 310b89d commit 412c0e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion javascript/src/components/widgets/WidgetEditConfigModal.jsx
Expand Up @@ -185,11 +185,12 @@ var WidgetEditConfigModal = React.createClass({

switch (this.state.type) {
case this.props.widgetTypes.STATS_COUNT:
var defaultStatisticalFunction = this.state.config["stats_function"] === 'stddev' ? 'std_deviation' : this.state.config["stats_function"];
controls.push(
<Input key="statsCountStatisticalFunction"
type="select"
label="Statistical function"
defaultValue={this.state.config["stats_function"]}
defaultValue={defaultStatisticalFunction}
onChange={this._onStatisticalFunctionChange("stats_function")}
help="Statistical function applied to the data.">
{FieldStatisticsStore.FUNCTIONS.keySeq().map((statFunction) => {
Expand Down

0 comments on commit 412c0e2

Please sign in to comment.