Skip to content

Commit

Permalink
Merge branch 'main' into data-source/mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
recca5p authored Dec 4, 2024
2 parents 6479e54 + ff1bb42 commit 5b4e5b6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
11 changes: 6 additions & 5 deletions e2e/Sandbox/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Button Click="Load_Dashboard">Load Dashboard</Button>
<Button Click="Read_Dashboard">Read Dashboard</Button>
<Button Click="Create_Dashboard">Create Dashboard</Button>
<Button Click="Clear_Dashboard">Clear Dashboard</Button>
<Button Click="Read_Dashboard">Read Dashboard</Button>
<Button Click="Clear_Dashboard" Content="Clear Dashboard"/>
</StackPanel>

<rv:RevealView Grid.Row="1" x:Name="_revealView" ShowEditDataSource="True" ShowDataBlending="True"
SaveDashboard="RevealView_SaveDashboard"/>
SaveDashboard="RevealView_SaveDashboard" Margin="0,34,0,0"/>
<ComboBox Name="_dashboardTypeSelector" HorizontalAlignment="Left" Margin="1,5,0,0" Grid.Row="1" VerticalAlignment="Top" Width="120"/>
<Button Content="Create Dashboard with Type" Name="_createDashboardWithTypeBtn" HorizontalAlignment="Left" Margin="126,6,0,0" Grid.Row="1" VerticalAlignment="Top" Width="164" Click="CreateDashboardWithTypeBtn_Click"/>
</Grid>

</Window>
32 changes: 29 additions & 3 deletions e2e/Sandbox/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public partial class MainWindow : Window
static readonly string _dashboardFilePath = Path.Combine(Environment.CurrentDirectory, "Dashboards");

//readonly string _readFilePath = Path.Combine(_dashboardFilePath, DashboardFileNames.Sales);
readonly string _readFilePath = Path.Combine(_dashboardFilePath, "New Dashboard.rdash");
readonly string _readFilePath = Path.Combine(_dashboardFilePath, "Healthcare.rdash");

readonly string _saveJsonToPath = Path.Combine(_dashboardFilePath, "MyDashboard.json");
readonly string _saveRdashToPath = Path.Combine(_dashboardFilePath, DashboardFileNames.MyDashboard);
Expand All @@ -61,7 +61,7 @@ public MainWindow()
RevealSdkSettings.AuthenticationProvider = new AuthenticationProvider();
RevealSdkSettings.DataSources.RegisterMicrosoftSqlServer().RegisterMicrosoftAnalysisServices();
RevealSdkSettings.DataSources.RegisterMySql();
RevealSdkSettings.License = "eyJhbGciOiJQUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImEwV1ZNMDAwMDAwTDY1ZDJBQyIsInByb2R1Y3RfY29kZSI6IkE4IiwicHJvZHVjdF92ZXJzaW9uIjoiNzAiLCJzZXJ2aWNlX2VuZF9kYXRlIjoiMjAzMS0wMS0wM1QwMDowMDowMC4wMDAwMDAwWiIsInNlcnZpY2VfbGV2ZWwiOiJQcmlvcml0eSIsImlhdCI6MTcwNjYzMTIzMCwibmJmIjoxNzA2NjMxMjMwfQ.NW9e1Nyo5PMBz9TYnF2DNrgW6EIb2dCRVzkEN_ovMBcM3vp4oCBmjBIRTs492EgpRktM7Bm1TMtfZO0A3wPEhR5sn9_1qxSWGmlyjF1ncFgT5zrEpXqfMzNx3DA9k7aJcD7VzcErXiF2RHTukHdP6x1jXBzBFJVbBBai806mOOnzoSp2C3584EmYE2ZQR9ArjcUk_8aoObh_YwtEGMoUsU1r_MKdoeZaHeiRVRpw6HcZV4RMqgeh8TqWCGHtgFSKeUCpD0XQcL7MIa71MLZ-NB1vVBykfaYmYIq4UQd9R6QThmapr48A_Mu8xmEnD_B1A7BlwqsqXTBCXFP03wRPGw";
_dashboardTypeSelector.ItemsSource = Enum.GetValues(typeof(DataSourceType)).Cast<DataSourceType>();

_revealView.LinkedDashboardProvider = (string dashboardId, string linkTitle) =>
{
Expand Down Expand Up @@ -240,7 +240,7 @@ private async void Read_Dashboard(object sender, RoutedEventArgs e)
_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
}

private async void Create_Dashboard(object sender, RoutedEventArgs e)
private async void CreateDashboardWithTypeBtn_Click(object sender, RoutedEventArgs e)
{
//var document = MarketingDashboard.CreateDashboard();
var document = SalesDashboard.CreateDashboard();
Expand All @@ -256,6 +256,32 @@ private async void Create_Dashboard(object sender, RoutedEventArgs e)
var json = document.ToJsonString();

_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
var selectedDSTypeItem = _dashboardTypeSelector.SelectedItem;
if (selectedDSTypeItem != null)
{
var dataSourceType = _dashboardTypeSelector.SelectedItem;
RdashDocument document = null;
switch (dataSourceType)
{
case DataSourceType.REST:
document = SalesDashboard.CreateDashboard();
break;
case DataSourceType.MicrosoftSqlServer:
break;
default:
break;
}

if (document != null)
{
var json = document.ToJsonString();
_revealView.Dashboard = await RVDashboard.LoadFromJsonAsync(json);
}
else
{
_revealView.Dashboard = new RVDashboard();
}
}
}
}
}

0 comments on commit 5b4e5b6

Please sign in to comment.