Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added dashboard xmla filter #62

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}
}
Loading