From 8f1ebec4d5ec07b79577720b4c59b0554ccc633a Mon Sep 17 00:00:00 2001 From: Sebastian Rodriguez Date: Wed, 25 Sep 2024 15:17:56 -0300 Subject: [PATCH 1/2] Mininmal changes to support CategoryVisualizationDataspec as an assignable spec for girds --- src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs | 3 +++ .../Visualizations/GridVisualization.cs | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs index a1c468b..56ca9d6 100644 --- a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs +++ b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs @@ -120,5 +120,8 @@ public enum DataSourceProvider [EnumMember(Value = "WEBSERVICE")] WebService, + + [EnumMember(Value = "GOOGLE_ADS")] + GoogleAds, } } diff --git a/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs b/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs index b1b7a1b..eacb0e8 100644 --- a/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs +++ b/src/Reveal.Sdk.Dom/Visualizations/GridVisualization.cs @@ -27,9 +27,18 @@ public GridVisualization(DataSourceItem dataSourceItem) : this(null, dataSourceI public GridVisualization(string title, DataSourceItem dataSourceItem) : base(title, dataSourceItem) { ChartType = ChartType.Grid; } [JsonIgnore] - public List Columns { get { return VisualizationDataSpec.Columns; } } + public List Columns { get { + if (VisualizationDataSpec is GridVisualizationDataSpec gds) + { + return gds.Columns; + } + else + { + return new List(); + } + } } [JsonProperty(Order = 7)] - GridVisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec(); + VisualizationDataSpec VisualizationDataSpec { get; set; } = new GridVisualizationDataSpec(); } } From ed2539be865d6056ead5b4dd8be1563eba4613bf Mon Sep 17 00:00:00 2001 From: Sebastian Rodriguez Date: Wed, 25 Sep 2024 17:12:26 -0300 Subject: [PATCH 2/2] Moved the GOOGLE_ADS enum value to preserve the alphabetical order --- src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs index 56ca9d6..cad78b1 100644 --- a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs +++ b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceProvider.cs @@ -25,6 +25,9 @@ public enum DataSourceProvider [EnumMember(Value = "DROPBOXPROVIDER")] Dropbox, + [EnumMember(Value = "GOOGLE_ADS")] + GoogleAds, + [EnumMember(Value = "GOOGLE_ANALYTICS")] GoogleAnalytics, @@ -120,8 +123,5 @@ public enum DataSourceProvider [EnumMember(Value = "WEBSERVICE")] WebService, - - [EnumMember(Value = "GOOGLE_ADS")] - GoogleAds, } }