From 830d6d524d5e819f1b4376f54e780da1fe3935ed Mon Sep 17 00:00:00 2001 From: Phat Vo Date: Mon, 9 Dec 2024 18:52:06 +0700 Subject: [PATCH 1/6] implmeting the Orable --- src/Reveal.Sdk.Dom/Data/DataSourceItemFactory.cs | 1 + .../Data/DataSourceItems/OracleDataSourceItem.cs | 7 ++++++- src/Reveal.Sdk.Dom/Data/DataSources/OracleDataSource.cs | 2 +- src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Reveal.Sdk.Dom/Data/DataSourceItemFactory.cs b/src/Reveal.Sdk.Dom/Data/DataSourceItemFactory.cs index f57fa80e..4473aa96 100644 --- a/src/Reveal.Sdk.Dom/Data/DataSourceItemFactory.cs +++ b/src/Reveal.Sdk.Dom/Data/DataSourceItemFactory.cs @@ -25,6 +25,7 @@ public DataSourceItem Create(DataSourceType type, string id, string title, strin { DataSourceType.MicrosoftSqlServer => new MicrosoftSqlServerDataSourceItem(title, dataSource), DataSourceType.REST => new RestDataSourceItem(title, dataSource), + DataSourceType.Oracle => new OracleDataSourceItem(title, dataSource), _ => throw new NotImplementedException($"No builder implemented for provider: {type}") }; diff --git a/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs b/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs index eca6a727..0a9dcb25 100644 --- a/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs +++ b/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs @@ -1,9 +1,14 @@ namespace Reveal.Sdk.Dom.Data { - internal class OracleDataSourceItem : ProcedureDataSourceItem + public class OracleDataSourceItem : ProcedureDataSourceItem { public OracleDataSourceItem(string title, DataSource dataSource) : base(title, dataSource) { } + + protected override DataSource CreateDataSourceInstance(DataSource dataSource) + { + return Create(dataSource); + } } } diff --git a/src/Reveal.Sdk.Dom/Data/DataSources/OracleDataSource.cs b/src/Reveal.Sdk.Dom/Data/DataSources/OracleDataSource.cs index 4987dd99..4f2f2f4a 100644 --- a/src/Reveal.Sdk.Dom/Data/DataSources/OracleDataSource.cs +++ b/src/Reveal.Sdk.Dom/Data/DataSources/OracleDataSource.cs @@ -3,7 +3,7 @@ namespace Reveal.Sdk.Dom.Data { - internal class OracleDataSource : HostDataSource + public class OracleDataSource : HostDataSource { public OracleDataSource() { diff --git a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs index 949210b7..3e82afa4 100644 --- a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs +++ b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs @@ -3,6 +3,7 @@ public enum DataSourceType { REST, - MicrosoftSqlServer + MicrosoftSqlServer, + Oracle } } From 2db8630329c68ec11d5efc9eb7215e7ead972ef8 Mon Sep 17 00:00:00 2001 From: Tan Phat VO Date: Tue, 10 Dec 2024 20:42:31 +0700 Subject: [PATCH 2/6] sandbox dashboard --- .../OracleDataSourceDashboard.cs | 74 +++++++++++++++++++ e2e/Sandbox/MainWindow.xaml.cs | 8 +- e2e/Sandbox/Reveal/AuthenticationProvider.cs | 5 ++ 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs diff --git a/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs b/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs new file mode 100644 index 00000000..d3524f2d --- /dev/null +++ b/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs @@ -0,0 +1,74 @@ +using Reveal.Sdk.Data.MySql; +using Reveal.Sdk.Dom; +using Reveal.Sdk.Dom.Data; +using Reveal.Sdk.Dom.Filters; +using Reveal.Sdk.Dom.Visualizations; +using Sandbox.DashboardFactories; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using static Antlr4.Runtime.Atn.SemanticContext; + +namespace Sandbox.DashboardCreators +{ + public class OracleDataSourceDashboard : IDashboardCreator + { + public string Name => "Oracle Data Source"; + + public RdashDocument CreateDashboard() + { + var oracleDataSource = new OracleDataSource + { + Id = "oracleSIDId", + Title = "Oracle SID DS", + Subtitle = "Oracle SID Datasource", + Host = "revealdb01.infragistics.local", + Database = "HR", + SID = "orcl", + Port = 1521 + }; + + var oracleDataSourceItem = new OracleDataSourceItem("employees report to ID", oracleDataSource) + { + Id = "oracleSIDDSItemId", + Title = "Oracle SID DSItem", + Database = "HR", + Table = "EMPLOYEES", + Fields = new List + { + new NumberField("ReportsTo"), + new NumberField("EmployeeID"), + new TextField("Country"), + } + }; + + var document = new RdashDocument() + { + Title = "Oracle", + Description = "Example for Oracle", + UseAutoLayout = false, + }; + + var dateFilter = new DashboardDateFilter("My Date Filter"); + document.Filters.Add(dateFilter); + + var countryFilter = new DashboardDataFilter("Country", oracleDataSourceItem); + document.Filters.Add(countryFilter); + + document.Visualizations.Add(CreateEmployeeReportColumnVisualization(oracleDataSourceItem, countryFilter)); + + return document; + } + + private static Visualization CreateEmployeeReportColumnVisualization(DataSourceItem dsi, params DashboardFilter[] filters) + { + return new ColumnChartVisualization("Employees report", dsi) + .SetLabel("ReportsTo") + .SetValue("EmployeeID") + .ConnectDashboardFilters(filters) + .SetPosition(20, 11); + } + } +} diff --git a/e2e/Sandbox/MainWindow.xaml.cs b/e2e/Sandbox/MainWindow.xaml.cs index 1992d24c..77e29524 100644 --- a/e2e/Sandbox/MainWindow.xaml.cs +++ b/e2e/Sandbox/MainWindow.xaml.cs @@ -22,6 +22,8 @@ using Reveal.Sdk.Data.Rest; using Reveal.Sdk.Data.Snowflake; using Reveal.Sdk.Dom; +using Reveal.Sdk.Dom.Data; +using Sandbox.DashboardCreators; using Sandbox.DashboardFactories; using Sandbox.RevealSDK; using System; @@ -51,6 +53,7 @@ public partial class MainWindow : Window new RestDataSourceDashboard(), new SalesDashboard(), new SqlServerDataSourceDashboards(), + new OracleDataSourceDashboard(), }; public MainWindow() @@ -60,7 +63,8 @@ public MainWindow() RevealSdkSettings.DataSourceProvider = new Sandbox.RevealSDK.DataSourceProvider(); RevealSdkSettings.AuthenticationProvider = new AuthenticationProvider(); RevealSdkSettings.DataSources.RegisterMicrosoftSqlServer().RegisterMicrosoftAnalysisServices(); - + RevealSdkSettings.DataSources.RegisterOracle(); + RevealSdkSettings.License = "eyJhbGciOiJQUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImEwV1ZNMDAwMDAwTDY1ZDJBQyIsInByb2R1Y3RfY29kZSI6IkE4IiwicHJvZHVjdF92ZXJzaW9uIjoiNzAiLCJzZXJ2aWNlX2VuZF9kYXRlIjoiMjAzMS0wMS0wM1QwMDowMDowMC4wMDAwMDAwWiIsInNlcnZpY2VfbGV2ZWwiOiJQcmlvcml0eSIsImlhdCI6MTcwNjYzMTIzMCwibmJmIjoxNzA2NjMxMjMwfQ.NW9e1Nyo5PMBz9TYnF2DNrgW6EIb2dCRVzkEN_ovMBcM3vp4oCBmjBIRTs492EgpRktM7Bm1TMtfZO0A3wPEhR5sn9_1qxSWGmlyjF1ncFgT5zrEpXqfMzNx3DA9k7aJcD7VzcErXiF2RHTukHdP6x1jXBzBFJVbBBai806mOOnzoSp2C3584EmYE2ZQR9ArjcUk_8aoObh_YwtEGMoUsU1r_MKdoeZaHeiRVRpw6HcZV4RMqgeh8TqWCGHtgFSKeUCpD0XQcL7MIa71MLZ-NB1vVBykfaYmYIq4UQd9R6QThmapr48A_Mu8xmEnD_B1A7BlwqsqXTBCXFP03wRPGw"; LoadDashboards(); _revealView.LinkedDashboardProvider = (string dashboardId, string linkTitle) => @@ -175,7 +179,7 @@ private void RevealView_DataSourcesRequested(object sender, DataSourcesRequested //httpItem.Title = "HTTP Analysis Services Item"; //httpItem.Subtitle = "HTTP Analysis Services Item Subtitle"; //httpItem.Cube = "Adventure Works"; - //dsi.Add(httpItem); + //dsi.Add(httpItem); e.Callback(new RevealDataSources(ds, dsi, true)); } diff --git a/e2e/Sandbox/Reveal/AuthenticationProvider.cs b/e2e/Sandbox/Reveal/AuthenticationProvider.cs index 07e9fce2..22fda743 100644 --- a/e2e/Sandbox/Reveal/AuthenticationProvider.cs +++ b/e2e/Sandbox/Reveal/AuthenticationProvider.cs @@ -1,6 +1,7 @@ using Reveal.Sdk.Data; using Reveal.Sdk.Data.Microsoft.AnalysisServices; using Reveal.Sdk.Data.Microsoft.SqlServer; +using Reveal.Sdk.Data.Oracle; using System.Threading.Tasks; namespace Sandbox.RevealSDK @@ -18,6 +19,10 @@ public Task ResolveCredentialsAsync(RVDashboardDataSour { userCredential = new RVUsernamePasswordDataSourceCredential("username", "password", "domain"); } + else if (dataSource is RVOracleDataSource) + { + userCredential = new RVUsernamePasswordDataSourceCredential("northwind", "northwind"); + } return Task.FromResult(userCredential); } } From c9af53851be46885f3edf0ea46bd6c647d6f57d9 Mon Sep 17 00:00:00 2001 From: Tan Phat VO Date: Wed, 11 Dec 2024 21:42:25 +0700 Subject: [PATCH 3/6] add UTs --- .../OracleDataSourceDashboard.cs | 14 +-- .../Dashboards/TestOracle.rdash | Bin 0 -> 1428 bytes .../OracleDataSourceItemFixture.cs | 94 ++++++++++++++++++ .../DataSources/OracleDataSourceFixture.cs | 93 +++++++++++++++++ .../Reveal.Sdk.Dom.Tests.csproj | 7 +- .../DataSourceItems/OracleDataSourceItem.cs | 2 +- 6 files changed, 196 insertions(+), 14 deletions(-) create mode 100644 src/Reveal.Sdk.Dom.Tests/Dashboards/TestOracle.rdash diff --git a/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs b/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs index d3524f2d..7f2fe53e 100644 --- a/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs +++ b/e2e/Sandbox/DashboardCreators/OracleDataSourceDashboard.cs @@ -38,9 +38,8 @@ public RdashDocument CreateDashboard() Table = "EMPLOYEES", Fields = new List { - new NumberField("ReportsTo"), - new NumberField("EmployeeID"), - new TextField("Country"), + new NumberField("MANAGER_ID"), + new NumberField("EMPLOYEE_ID"), } }; @@ -54,10 +53,7 @@ public RdashDocument CreateDashboard() var dateFilter = new DashboardDateFilter("My Date Filter"); document.Filters.Add(dateFilter); - var countryFilter = new DashboardDataFilter("Country", oracleDataSourceItem); - document.Filters.Add(countryFilter); - - document.Visualizations.Add(CreateEmployeeReportColumnVisualization(oracleDataSourceItem, countryFilter)); + document.Visualizations.Add(CreateEmployeeReportColumnVisualization(oracleDataSourceItem)); return document; } @@ -65,8 +61,8 @@ public RdashDocument CreateDashboard() private static Visualization CreateEmployeeReportColumnVisualization(DataSourceItem dsi, params DashboardFilter[] filters) { return new ColumnChartVisualization("Employees report", dsi) - .SetLabel("ReportsTo") - .SetValue("EmployeeID") + .SetLabel("MANAGER_ID") + .SetValue("EMPLOYEE_ID") .ConnectDashboardFilters(filters) .SetPosition(20, 11); } diff --git a/src/Reveal.Sdk.Dom.Tests/Dashboards/TestOracle.rdash b/src/Reveal.Sdk.Dom.Tests/Dashboards/TestOracle.rdash new file mode 100644 index 0000000000000000000000000000000000000000..d59ab355c85dace7affdbfec2dc6bbbbd37d9d00 GIT binary patch literal 1428 zcmV;F1#9|HO9KQH0000809~4kSuks8oEUZ*7wNuvZ6`KhCt1szZdwEZElp&ilqist6Sv5}?~uAuk}tc! z0^66=oWtSp%!M=h_3?w_bXHU`==|n%?ga7he`jWO4AK)cR+L9tHhCjq%)oi!!m)6x z4TNw@LZd-!$3$+{oCtrxlSmO78F_{s2_OpmuT*U`dI?(~tn2zex?>(@7?*5IM7DO# zMM%^G2$@>*IbHr!!Z1;MPIf#|xcowxgjDpE`T;13i{JHc$N821LD93?#m3kav(mrL z3hB((BKUl{_Ixrpzk)tFza;*r^Dp3iJ|B>QcXibptgpTdDw~%4)s2a^?4nn$jyOxg zC=>Mil{2KF{DDfkHq0xLKq)T#F+s-p4nR5rVlGtW#4%CCjln}$akJ{(R%D$pB6660 z$$URgga42!8CS-$lzFMCzt?=(TwpXNF-w}!EfQBb4`Kym0U^x)hRKk zJkb}!+u_Y*`8*ppxG}gnSpz!-xXJ?UHVM}t8km`!Qs0ND)rCerBFw`mP_0)p7#C9q zDKe+<2pVT#84)8=RJsEe+adG5-{l9n%VXv^c}J1|KlTope2BjC$5S;l%fKyz)B^mG zQ18bzWm$IF!lCa|Z5UxDVVeLK#Flz+6qmY%N>yhg$CU2xU|CNHqd!e5yP#AvZ_D~R z+7O{ycQi`2g~}a2nhuvM3uZJHV)F!9@*!h*>(mF0O5kqz>l^}z4AZrWiq1d*qY)Hg zR||-ai9X3}k9*MN$=io=Q395#{vJ?8PYt5opxOAVCBJgnV~cErH9Fv8r{#BB5RB+JJMVQb z_MvVJqSw7VR-=yflDX2>O^q^D@71l_5B(|ku+brr5B`LKj;)q#=dVY*k+MUjs6?NY zx7$sdQgV|p#GFs9H)W*R_Eq&-_$36o(=6ZIv&O~~+auju3d-1+zef8A$Z$DNx=pV4 zcgCNmJfLa1pUmb0h)e|hms}c)PG<5zKk-l6rQ^+zj?N$u5LoXkTHd1SNKbTHXLY!D z`WLRgrf+~vN(6SWRMH;HoH8BNi%C*EwhA?RpR(z{n8Oaw&?T;Qj&2>_bRW2-KK846 zAY2Yd^GS8GwZA)917ii|CTrC;RH8l7*khm9I_Y($$cOoCVLn9o>t4T0qZdH}?DVK7 zyNv4^UZ0!W=fVyipI+Isx7_Q=9p8b$MZa)KlkgkH*MwCX*+Y~=72QhwvyZ6CYB7K> zcA6t_(!JGh7zr!-x;c^R5lB@$i#(S2u;M=1WzW;TOFUqz*V<@3fZ;0u%rg0000809~4kSuk("Table")); + Assert.NotNull(dataSourceItem.Properties.GetValue("Database")); + } + + [Fact] + public void ToJsonString_CreatesFormattedJson_ForMySQLDataSource() + { + // Arrange + var expectedJson = + """ + { + "_type": "DataSourceItemType", + "Id": "oracleSIDDSItemId", + "Title": "Oracle SID DSItem", + "DataSourceId": "oracleSIDId", + "HasTabularData": true, + "HasAsset": false, + "Properties": { + "Database": "HR", + "Table": "EMPLOYEES" + }, + "Parameters": {} + } + """; + + var oracleDataSource = new OracleDataSource + { + Id = "oracleSIDId", + Title = "Oracle SID DS", + Subtitle = "Oracle SID Datasource", + Host = "revealdb01.infragistics.local", + Database = "HR", + SID = "orcl", + Port = 1521 + }; + + var oracleDataSourceItem = new OracleDataSourceItem("employees report to ID", oracleDataSource) + { + Id = "oracleSIDDSItemId", + Title = "Oracle SID DSItem", + Database = "HR", + Table = "EMPLOYEES", + Fields = new List + { + new NumberField("MANAGER_ID"), + new NumberField("EMPLOYEE_ID"), + } + }; + + var document = new RdashDocument() + { + Title = "Oracle", + Description = "Example for Oracle", + UseAutoLayout = false, + }; + + document.Visualizations.Add(new ColumnChartVisualization("Employees report", oracleDataSourceItem) + .SetLabel("MANAGER_ID") + .SetValue("EMPLOYEE_ID") + .SetPosition(20, 11)); + var expectedJObject = JObject.Parse(expectedJson); + + // Act + RdashSerializer.SerializeObject(document); + var json = document.ToJsonString(); + var jObject = JObject.Parse(json); + var actualJObject = jObject["Widgets"][0]["DataSpec"]["DataSourceItem"]; + + // Assert + Assert.Equal(expectedJObject, actualJObject); + } } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs index 6fcab269..008e6ba2 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs @@ -1,6 +1,13 @@ using Reveal.Sdk.Dom.Core.Extensions; using Reveal.Sdk.Dom.Data; +using System.IO; +using System.Linq; +using System; using Xunit; +using Newtonsoft.Json.Linq; +using System.Collections.Generic; +using Reveal.Sdk.Dom.Visualizations; +using Reveal.Sdk.Dom.Core.Serialization; namespace Reveal.Sdk.Dom.Tests.Data.DataSources { @@ -47,5 +54,91 @@ public void SID_SetsAndGetsValue_WithDifferentInputs(string sid) Assert.Equal(sid, dataSource.SID); Assert.Equal(sid, dataSource.Properties.GetValue("SID")); } + + [Fact] + public void RDashDocument_HasCorrectDataSource_WhenLoadFromFile() + { + // Arrange + var filePath = Path.Combine(Environment.CurrentDirectory, "Dashboards", "TestOracle.rdash"); + + // Act + var document = RdashDocument.Load(filePath); + var dataSource = document.DataSources.FirstOrDefault(); + + // Assert + Assert.Equal(DataSourceProvider.Oracle, dataSource.Provider); + Assert.NotNull(dataSource.Properties.GetValue("Host")); + Assert.NotNull(dataSource.Properties.GetValue("Database")); + Assert.NotNull(dataSource.Properties.GetValue("SID")); + Assert.NotNull(dataSource.Properties.GetValue("Port")); + } + + [Fact] + public void ToJsonString_CreatesFormattedJson_ForOracleDataSource() + { + // Arrange + var expectedJson = + """ + { + "_type": "DataSourceType", + "Id": "oracleSIDId", + "Provider": "ORACLE", + "Description": "Oracle SID DS", + "Subtitle": "Oracle SID Datasource", + "Properties": { + "Host": "revealdb01.infragistics.local", + "Database": "HR", + "SID": "orcl", + "Port": 1521 + } + } + """; + + var oracleDataSource = new OracleDataSource + { + Id = "oracleSIDId", + Title = "Oracle SID DS", + Subtitle = "Oracle SID Datasource", + Host = "revealdb01.infragistics.local", + Database = "HR", + SID = "orcl", + Port = 1521 + }; + + var oracleDataSourceItem = new OracleDataSourceItem("employees report to ID", oracleDataSource) + { + Id = "oracleSIDDSItemId", + Title = "Oracle SID DSItem", + Database = "HR", + Table = "EMPLOYEES", + Fields = new List + { + new NumberField("MANAGER_ID"), + new NumberField("EMPLOYEE_ID"), + } + }; + + var document = new RdashDocument() + { + Title = "Oracle", + Description = "Example for Oracle", + UseAutoLayout = false, + }; + + document.Visualizations.Add(new ColumnChartVisualization("Employees report", oracleDataSourceItem) + .SetLabel("MANAGER_ID") + .SetValue("EMPLOYEE_ID") + .SetPosition(20, 11)); + var expectedJObject = JObject.Parse(expectedJson); + + // Act + RdashSerializer.SerializeObject(document); + var json = document.ToJsonString(); + var jObject = JObject.Parse(json); + var actualJObject = jObject["DataSources"].FirstOrDefault(); + + // Assert + Assert.Equal(expectedJObject, actualJObject); + } } } \ No newline at end of file diff --git a/src/Reveal.Sdk.Dom.Tests/Reveal.Sdk.Dom.Tests.csproj b/src/Reveal.Sdk.Dom.Tests/Reveal.Sdk.Dom.Tests.csproj index f3313f39..70c64760 100644 --- a/src/Reveal.Sdk.Dom.Tests/Reveal.Sdk.Dom.Tests.csproj +++ b/src/Reveal.Sdk.Dom.Tests/Reveal.Sdk.Dom.Tests.csproj @@ -36,10 +36,9 @@ PreserveNewest - - - - + + PreserveNewest + diff --git a/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs b/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs index 0a9dcb25..49fd02aa 100644 --- a/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs +++ b/src/Reveal.Sdk.Dom/Data/DataSourceItems/OracleDataSourceItem.cs @@ -8,7 +8,7 @@ public OracleDataSourceItem(string title, DataSource dataSource) : protected override DataSource CreateDataSourceInstance(DataSource dataSource) { - return Create(dataSource); + return Create(dataSource); } } } From 61ffc9ebb527e2e828941177c95dcaa4a2286c03 Mon Sep 17 00:00:00 2001 From: Tan Phat VO Date: Wed, 11 Dec 2024 21:55:24 +0700 Subject: [PATCH 4/6] fix UT --- .../Data/DataSources/OracleDataSourceFixture.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs index 008e6ba2..88500777 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSources/OracleDataSourceFixture.cs @@ -90,7 +90,8 @@ public void ToJsonString_CreatesFormattedJson_ForOracleDataSource() "Database": "HR", "SID": "orcl", "Port": 1521 - } + }, + "Settings": {} } """; From 70f0fed1c217695fee51b9289d5dd1cf346f8091 Mon Sep 17 00:00:00 2001 From: Phat Vo Date: Thu, 12 Dec 2024 20:17:00 +0700 Subject: [PATCH 5/6] refactor --- .../Data/DataSourceItems/OracleDataSourceItemFixture.cs | 2 +- src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/OracleDataSourceItemFixture.cs b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/OracleDataSourceItemFixture.cs index dea74bc5..664951bb 100644 --- a/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/OracleDataSourceItemFixture.cs +++ b/src/Reveal.Sdk.Dom.Tests/Data/DataSourceItems/OracleDataSourceItemFixture.cs @@ -48,7 +48,7 @@ public void RDashDocument_HasCorrectDataSourceItem_WhenLoadFromFile() } [Fact] - public void ToJsonString_CreatesFormattedJson_ForMySQLDataSource() + public void ToJsonString_CreatesFormattedJson_ForOracleDataSource() { // Arrange var expectedJson = diff --git a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs index 2d987fb3..10d41a31 100644 --- a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs +++ b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs @@ -4,7 +4,7 @@ public enum DataSourceType { REST, MicrosoftSqlServer, + Oracle, PostgreSQL, - Oracle } } From 503bf691e2ab015c47962da4361e528c1212aa0c Mon Sep 17 00:00:00 2001 From: Brian Lagunas <835562+brianlagunas@users.noreply.github.com> Date: Thu, 12 Dec 2024 15:03:19 -0700 Subject: [PATCH 6/6] small fixes --- e2e/Sandbox/MainWindow.xaml.cs | 1 - src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/e2e/Sandbox/MainWindow.xaml.cs b/e2e/Sandbox/MainWindow.xaml.cs index 3ba18ae0..ac2933ac 100644 --- a/e2e/Sandbox/MainWindow.xaml.cs +++ b/e2e/Sandbox/MainWindow.xaml.cs @@ -22,7 +22,6 @@ using Reveal.Sdk.Data.Rest; using Reveal.Sdk.Data.Snowflake; using Reveal.Sdk.Dom; -using Reveal.Sdk.Dom.Data; using Sandbox.DashboardCreators; using Sandbox.DashboardFactories; using Sandbox.RevealSDK; diff --git a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs index f665e5fd..06822a5d 100644 --- a/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs +++ b/src/Reveal.Sdk.Dom/Data/Enums/DataSourceType.cs @@ -4,8 +4,8 @@ public enum DataSourceType { REST, MicrosoftSqlServer, - Oracle, MySql, + Oracle, PostgreSQL, } }