Skip to content

Commit

Permalink
Fix Issue with hidden aggregate fields (#790)
Browse files Browse the repository at this point in the history
* Added the option to keep showing aggregate fields on attributes even when the query is not aggregating.

* - variable name change
- text change
- fixed logic

Co-authored-by: Floris Schild <floris@2at.nl>
Co-authored-by: Jonas Rapp <jonas@jonasr.app>
  • Loading branch information
3 people authored Nov 19, 2022
1 parent 95b2697 commit 908901b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion FetchXmlBuilder/Controls/attributeControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public attributeControl(TreeNode node, AttributeMetadata[] attributes, FetchXmlB
protected override void PopulateControls()
{
cmbAttribute.Items.Clear();
aggregate = Node.IsFetchAggregate();
aggregate = !fxb.settings.HideAggregationFieldsWhenNotAggregating || Node.IsFetchAggregate();
panAggregate.Visible = aggregate;
grpLayout.Visible = !aggregate;
cmbAggregate.Enabled = aggregate;
Expand Down
25 changes: 19 additions & 6 deletions FetchXmlBuilder/Forms/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions FetchXmlBuilder/Forms/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private void PopulateSettings(FXBSettings settings)
txtFetch.ConfigureForXml(settings);
txtFetch.FormatXML(settings.QueryOptions.NewQueryTemplate, settings);
chkTryMetadataCache.Checked = settings.TryMetadataCache;
chkHideFieldsOnAggregate.Checked = settings.HideAggregationFieldsWhenNotAggregating;
if (chkTryMetadataCache.Checked)
{
chkWaitUntilMetadataLoaded.Enabled = true;
Expand Down Expand Up @@ -100,6 +101,7 @@ internal FXBSettings GetSettings()
settings.XmlColors = propXmlColors.SelectedObject as XmlColors;
settings.TryMetadataCache = chkTryMetadataCache.Checked;
settings.WaitUntilMetadataLoaded = chkWaitUntilMetadataLoaded.Checked;
settings.HideAggregationFieldsWhenNotAggregating = chkHideFieldsOnAggregate.Checked;
return settings;
}

Expand Down
3 changes: 2 additions & 1 deletion FetchXmlBuilder/Settings/FXBSettings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Rappen.XTB.FetchXmlBuilder.DockControls;
using Rappen.XTB.FetchXmlBuilder.DockControls;
using ScintillaNET;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -46,6 +46,7 @@ public bool UseFriendlyNames
public bool ShowRepository { get; set; } = false;
public bool TryMetadataCache { get; set; } = true;
public bool WaitUntilMetadataLoaded { get; set; } = false;
public bool HideAggregationFieldsWhenNotAggregating { get; set; } = true;
public CodeGenerators CodeGenerators { get; set; } = new CodeGenerators();
}

Expand Down

0 comments on commit 908901b

Please sign in to comment.