Skip to content

Commit

Permalink
Merge pull request #62 from RevealBi/xmla-filter
Browse files Browse the repository at this point in the history
added dashboard xmla filter
  • Loading branch information
brianlagunas authored Sep 9, 2024
2 parents f5aa563 + ba52c26 commit d0c1fbf
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Reveal.Sdk.Dom/Core/Constants/SchemaTypeNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ internal class SchemaTypeNames
internal const string DateTimeFilterType = "DateTimeFilterType";
internal const string StringFilterType = "StringFilterType";
internal const string TimeFilterType = "TimeFilterType";
internal const string XmlaGlobalFilterType = "XmlaGlobalFilterType";
internal const string XmlaDateFilterType = "XmlaDateFilterType";
internal const string XmlaRegularFilterType = "XmlaRegularFilterType";
internal const string XmlaStringFilterRuleType = "XmlaStringFilterRuleType";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public DashboardFilterConverter()
{
{ SchemaTypeNames.DateGlobalFilterType, typeof(DashboardDateFilter) },
{ SchemaTypeNames.TabularGlobalFilterType, typeof(DashboardDataFilter) },
{ SchemaTypeNames.XmlaGlobalFilterType, typeof(DashboardXmlaFilter) }
};
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Reveal.Sdk.Dom/Filters/DashboardDataFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ public sealed class DashboardDataFilter : DashboardDataFilterBase
internal DashboardDataFilter() : this(null) { }

public DashboardDataFilter(DataSourceItem dataSourceItem)
: this (null, dataSourceItem) { }
: this(null, dataSourceItem) { }

public DashboardDataFilter(string fieldName, DataSourceItem dataSourceItem)
: this (fieldName, null, dataSourceItem) { }
: this(fieldName, null, dataSourceItem) { }

public DashboardDataFilter(string fieldName, string title, DataSourceItem dataSourceItem)
{
Expand Down
25 changes: 25 additions & 0 deletions src/Reveal.Sdk.Dom/Filters/DashboardXmlaFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using Reveal.Sdk.Dom.Core.Constants;
using Reveal.Sdk.Dom.Data;
using Newtonsoft.Json;

namespace Reveal.Sdk.Dom.Filters
{
public sealed class DashboardXmlaFilter : DashboardDataFilterBase
{
[JsonProperty("DataSourceItem")]
internal DataSourceItem DataSourceItem { get; set; }
public string DimensionUniqueName { get; set; }
public string HierarchyUniqueName { get; set; }
public string LevelUniqueName { get; set; }
public string MeasureUniqueName { get; set; }
public int? Expiration { get; set; }

internal DashboardXmlaFilter() : this(null) { }

public DashboardXmlaFilter(DataSourceItem dataSourceItem)
{
SchemaTypeName = SchemaTypeNames.XmlaGlobalFilterType;
DataSourceItem = dataSourceItem;
}
}
}

0 comments on commit d0c1fbf

Please sign in to comment.