Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
d4nt committed Jul 1, 2019
2 parents 2d6486e + 39c1268 commit c088967
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
7 changes: 5 additions & 2 deletions Web/Scripts/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,9 @@ nodes.Summarize = function(properties) {
return instance.AllInputColumnInfos().filter(function (col) { return tools.IsNumericType(col.Type); });
});

instance.AggFunctions = ko.computed(function() {
return instance.Tool.AggFunctions().filter(function(aggFunc) { return aggFunc.requiresNumeric === false || instance.AggColumns().length > 0 });
});

var innerGetCoreSettings = instance.GetCoreSettings;
instance.GetCoreSettings = function () {
Expand All @@ -855,7 +858,7 @@ nodes.Summarize = function(properties) {
settings.AggColumnIndexes = [];
$.each(instance.Statistics(), function (i, statistic) {
settings.AggFunctions.push(statistic.AggFunction());
settings.AggColumnIndexes.push(statistic.AggColumn());
settings.AggColumnIndexes.push(statistic.AggColumn());
});
return settings;
}
Expand Down Expand Up @@ -898,7 +901,7 @@ nodes.Summarize = function(properties) {
instance.AddStatistic = function () {
instance.Statistics.push({
"AggFunction": ko.observable(2),
"AggColumn": ko.observable()
"AggColumn": ko.observable(0)
});
};

Expand Down
14 changes: 7 additions & 7 deletions Web/Scripts/tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@ tools.Summarize = function () {
});

instance.AggFunctions = ko.observableArray([
{ id: 1, text: "Number of Rows" },
{ id: 2, text: "Total" },
{ id: 3, text: "Minimum" },
{ id: 4, text: "Maximum" },
{ id: 5, text: "Average" },
{ id: 6, text: "Median" }
{ id: 1, text: "Number of Rows", requiresNumeric: false },
{ id: 2, text: "Total", requiresNumeric: true },
{ id: 3, text: "Minimum", requiresNumeric: true },
{ id: 4, text: "Maximum", requiresNumeric: true },
{ id: 5, text: "Average", requiresNumeric: true },
{ id: 6, text: "Median", requiresNumeric: true }
]);

instance.DateFunctions = ko.observableArray([
Expand All @@ -267,7 +267,7 @@ tools.Summarize = function () {
]);

instance.MaxInputs = 1;
instance.HelpUrl = "http://querytreeapp.com/help/tools/summarize/";
instance.HelpUrl = "http://querytreeapp.com/help/tools/statistics/";

return instance;
};
Expand Down
3 changes: 1 addition & 2 deletions Web/Views/Shared/_FooterPartial.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@using System.Reflection;
@{
var version = typeof(Program).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
var version = System.Reflection.Assembly.GetEntryAssembly().GetName().Version;
}

<footer class="footer">
Expand Down
2 changes: 1 addition & 1 deletion Web/Views/Simple/Create.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
<!--ko foreach: Statistics-->
<div class="form-inline">
<div class="form-group">
<select name="AggFunction" data-bind="options: $parent.Tool.AggFunctions, optionsText: 'text', optionsValue: 'id', value: AggFunction" class="form-control"></select>
<select name="AggFunction" data-bind="options: $parent.AggFunctions, optionsText: 'text', optionsValue: 'id', value: AggFunction" class="form-control"></select>
</div>
<!--ko if: AggFunction() != 1-->
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion Web/Views/Simple/Edit.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<!--ko foreach: Statistics-->
<div class="form-inline">
<div class="form-group">
<select name="AggFunction" data-bind="options: $parent.Tool.AggFunctions, optionsText: 'text', optionsValue: 'id', value: AggFunction" class="form-control"></select>
<select name="AggFunction" data-bind="options: $parent.AggFunctions, optionsText: 'text', optionsValue: 'id', value: AggFunction" class="form-control"></select>
</div>
<!--ko if: AggFunction() != 1-->
<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion Web/wwwroot/partials/Summarize.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!--ko foreach: Statistics-->
<div class="form-group">
<label>Calculate the</label>
<select class="form-control" name="AggFunction" data-bind="options: $parent.Tool.AggFunctions, optionsText: 'text', optionsValue: 'id', value: AggFunction"></select>
<select class="form-control" name="AggFunction" data-bind="options: $parent.AggFunctions, optionsText: 'text', optionsValue: 'id', value: AggFunction"></select>
</div>
<!--ko if: AggFunction() != 1-->
<div class="form-group">
Expand Down

0 comments on commit c088967

Please sign in to comment.