diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-25 09:44:04 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-04-25 09:44:04 +0300 |
| commit | 318f448e58fec63e5dd6bd12ed0df53cc70c28cf (patch) | |
| tree | 7eed74696424e008ebef05e6b75b23333234c265 /Software/Visual_Studio | |
| parent | 7c10379224a47b92da09ec3bfd48f6e6fc1e1ebb (diff) | |
| download | Tango-318f448e58fec63e5dd6bd12ed0df53cc70c28cf.tar.gz Tango-318f448e58fec63e5dd6bd12ed0df53cc70c28cf.zip | |
Test Runner.
Diffstat (limited to 'Software/Visual_Studio')
9 files changed, 295 insertions, 2 deletions
diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj index 32e1de862..d4b5b2442 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Tango.FSE.Stubs.csproj @@ -127,6 +127,12 @@ <Compile Include="Views\TestDesignerView.xaml.cs"> <DependentUpon>TestDesignerView.xaml</DependentUpon> </Compile> + <Compile Include="Views\TestRunnerCatalogView.xaml.cs"> + <DependentUpon>TestRunnerCatalogView.xaml</DependentUpon> + </Compile> + <Compile Include="Views\TestRunnerExecutionView.xaml.cs"> + <DependentUpon>TestRunnerExecutionView.xaml</DependentUpon> + </Compile> <Compile Include="Views\TestRunnerView.xaml.cs"> <DependentUpon>TestRunnerView.xaml</DependentUpon> </Compile> @@ -243,6 +249,14 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Views\TestRunnerCatalogView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> + <Page Include="Views\TestRunnerExecutionView.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Views\TestRunnerView.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs index d3e968774..f58d14c88 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/ViewModels/TestRunnerViewVM.cs @@ -3,11 +3,89 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; using Tango.FSE.Common; namespace Tango.FSE.Stubs.ViewModels { - public class TestRunnerViewVM : FSEViewModel + public class TestRunnerViewVM : FSEViewModel { + public enum RunnerView + { + TestRunnerCatalogView, + TestRunnerExecutionView + } + + private RunnerView _selectedView; + public RunnerView SelectedView + { + get { return _selectedView; } + set { _selectedView = value; RaisePropertyChangedAuto(); } + } + + private List<PublishedTestProject> _publishedTestProjects; + public List<PublishedTestProject> PublishedTestProjects + { + get { return _publishedTestProjects; } + set { _publishedTestProjects = value; RaisePropertyChangedAuto(); } + } + + private TestProject _runningTestProject; + public TestProject RunningTestProject + { + get { return _runningTestProject; } + set { _runningTestProject = value; RaisePropertyChangedAuto(); } + } + + private ProjectRunner _projectRunner; + public ProjectRunner ProjectRunner + { + get { return _projectRunner; } + set { _projectRunner = value; RaisePropertyChangedAuto(); } + } + + private bool _isLoadingProjects; + public bool IsLoadingProjects + { + get { return _isLoadingProjects; } + set { _isLoadingProjects = value; RaisePropertyChangedAuto(); } + } + + public TestRunnerViewVM() + { + + } + + public override void OnNavigatedTo() + { + base.OnNavigatedTo(); + LoadPublishedTestProjects(); + } + + private async void LoadPublishedTestProjects() + { + if (PublishedTestProjects == null) + { + try + { + IsFree = false; + IsLoadingProjects = true; + + PublishedTestProjects = await Services.PublishedTestProjectsService.GetPublishedTestProjects(); + + IsFree = true; + } + catch (Exception ex) + { + IsFree = false; + LogManager.Log(ex, "Error retrieving published test projects."); + await NotificationProvider.ShowError($"Error occurred while trying to retrieve the test projects.\n{ex.FlattenMessage()}"); + } + finally + { + IsLoadingProjects = false; + } + } + } } } diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml new file mode 100644 index 000000000..94ed1d58f --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml @@ -0,0 +1,82 @@ +<UserControl x:Class="Tango.FSE.Stubs.Views.TestRunnerCatalogView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" + xmlns:global="clr-namespace:Tango.FSE.Stubs" + xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Stubs.Views" + xmlns:controls="clr-namespace:Tango.FSE.Common.Controls;assembly=Tango.FSE.Common" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid Margin="10"> + <DockPanel> + <Grid DockPanel.Dock="Top" Height="200"> + <TextBlock>Some into here</TextBlock> + </Grid> + <Grid Margin="0 20 0 0"> + <ListBox Style="{StaticResource FSE_BlankListBox}" ItemsSource="{Binding PublishedTestProjects}"> + <ListBox.ItemsPanel> + <ItemsPanelTemplate> + <WrapPanel Orientation="Horizontal" IsItemsHost="True" /> + </ItemsPanelTemplate> + </ListBox.ItemsPanel> + <ListBox.ItemTemplate> + <DataTemplate> + <Border> + <Border.Effect> + <DropShadowEffect ShadowDepth="0" BlurRadius="10" Color="{StaticResource FSE_PrimaryBackgroundDarkColor}" Opacity="0.5" /> + </Border.Effect> + <Border x:Name="border" Margin="10" Width="350" Height="200" Background="{StaticResource FSE_PrimaryBackgroundLightBrush}" CornerRadius="5" BorderThickness="0 1 1 0"> + <Border.BorderBrush> + <LinearGradientBrush StartPoint="0,0" EndPoint="0,1"> + <GradientStop Color="{StaticResource FSE_BorderColor}" Offset="0" /> + <GradientStop Color="Transparent" Offset="1" /> + </LinearGradientBrush> + </Border.BorderBrush> + + <Border.Clip> + <RectangleGeometry RadiusX="5" RadiusY="5" Rect="0,0,350,200" /> + </Border.Clip> + <Grid> + <Polygon Fill="{StaticResource FSE_PrimaryBackgroundLighterBrush}" Points="0,0 150,0 0,170"></Polygon> + <DockPanel> + <Border CornerRadius="0 0 5 5" Padding="8" BorderThickness="0 1 0 0" BorderBrush="{StaticResource FSE_BorderBrush}" DockPanel.Dock="Bottom" Background="{StaticResource FSE_PrimaryBackgroundDarkBrush}" > + <Button Height="30" Width="140" HorizontalAlignment="Right" Style="{StaticResource FSE_RaisedButton_Dark_Hover}"> + <DockPanel> + <material:PackIcon Kind="Play" Height="24" Width="24" Foreground="{StaticResource FSE_GreenBrush}" /> + <TextBlock Margin="10 2 0 0" VerticalAlignment="Center">RUN</TextBlock> + </DockPanel> + </Button> + </Border> + <DockPanel Margin="10"> + <Image VerticalAlignment="Top" Source="../Images/project.png" Width="48" RenderOptions.BitmapScalingMode="Fant" /> + <DockPanel Margin="10 0 0 0"> + <TextBlock Text="{Binding Name}" DockPanel.Dock="Top" TextWrapping="Wrap" FontSize="{StaticResource FSE_LargerFontSize}"> + <TextBlock.Style> + <Style TargetType="TextBlock"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding ElementName=border,Path=IsMouseOver}" Value="True"> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryAccentBrush}"></Setter> + </DataTrigger> + </Style.Triggers> + </Style> + </TextBlock.Style> + </TextBlock> + <TextBlock Margin="0 5 0 0" Foreground="{StaticResource FSE_GrayBrush}" TextWrapping="Wrap" Text="{Binding Description}" /> + </DockPanel> + </DockPanel> + </DockPanel> + </Grid> + </Border> + </Border> + </DataTemplate> + </ListBox.ItemTemplate> + </ListBox> + </Grid> + </DockPanel> + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml.cs new file mode 100644 index 000000000..ddc08aaed --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerCatalogView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.FSE.Stubs.Views +{ + /// <summary> + /// Interaction logic for TestRunnerCatalogView.xaml + /// </summary> + public partial class TestRunnerCatalogView : UserControl + { + public TestRunnerCatalogView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml new file mode 100644 index 000000000..e7de383f8 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml @@ -0,0 +1,15 @@ +<UserControl x:Class="Tango.FSE.Stubs.Views.TestRunnerExecutionView" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:global="clr-namespace:Tango.FSE.Stubs" + xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" + xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" + xmlns:local="clr-namespace:Tango.FSE.Stubs.Views" + mc:Ignorable="d" + d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid> + + </Grid> +</UserControl> diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml.cs b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml.cs new file mode 100644 index 000000000..a232547f5 --- /dev/null +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerExecutionView.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Tango.FSE.Stubs.Views +{ + /// <summary> + /// Interaction logic for TestRunnerExecutionView.xaml + /// </summary> + public partial class TestRunnerExecutionView : UserControl + { + public TestRunnerExecutionView() + { + InitializeComponent(); + } + } +} diff --git a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml index daf1d2ac0..710decea5 100644 --- a/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml +++ b/Software/Visual_Studio/FSE/Modules/Tango.FSE.Stubs/Views/TestRunnerView.xaml @@ -3,6 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" xmlns:global="clr-namespace:Tango.FSE.Stubs" xmlns:vm="clr-namespace:Tango.FSE.Stubs.ViewModels" xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes" @@ -10,5 +11,11 @@ mc:Ignorable="d" d:DesignHeight="720" d:DesignWidth="1280" d:DataContext="{d:DesignInstance Type=vm:TestRunnerViewVM, IsDesignTimeCreatable=False}" DataContext="{x:Static global:ViewModelLocator.TestRunnerViewVM}" Background="{StaticResource FSE_PrimaryBackgroundBrush}" Foreground="{StaticResource FSE_PrimaryForegroundBrush}"> + <Grid> + <controls:NavigationControl TransitionType="Slide"> + <local:TestRunnerCatalogView/> + <local:TestRunnerExecutionView/> + </controls:NavigationControl> + </Grid> </UserControl> diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml index cda28595a..6614db25d 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Resources/Styles.xaml @@ -672,4 +672,45 @@ <Setter Property="CellStyle" Value="{StaticResource LogsGridCellStyle}" /> </Style> + <Style TargetType="{x:Type ListBoxItem}" x:Key="FSE_BlankListBoxItem"> + <Setter Property="Background" Value="Transparent"/> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="Foreground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter> + <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter> + <Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter> + <Setter Property="Padding" Value="0"/> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBoxItem}"> + <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Padding="0" SnapsToDevicePixels="true"> + <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> + </Border> + <ControlTemplate.Triggers> + <Trigger Property="IsSelected" Value="true"> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </Trigger> + <MultiTrigger> + <MultiTrigger.Conditions> + <Condition Property="IsSelected" Value="true"/> + <Condition Property="Selector.IsSelectionActive" Value="false"/> + </MultiTrigger.Conditions> + <Setter Property="Background" TargetName="Bd" Value="Transparent"/> + </MultiTrigger> + <Trigger Property="IsEnabled" Value="false"> + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> + </Trigger> + </ControlTemplate.Triggers> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type ListBox}" x:Key="FSE_BlankListBox"> + <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"></Setter> + <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"></Setter> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="ItemContainerStyle" Value="{StaticResource FSE_BlankListBoxItem}"></Setter> + </Style> + </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml index 8b41332c2..771f35ccc 100644 --- a/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml +++ b/Software/Visual_Studio/FSE/Tango.FSE.UI/Views/LayoutView.xaml @@ -99,7 +99,7 @@ <material:PackIcon.Style> <Style TargetType="material:PackIcon"> <Setter Property="Foreground" Value="{StaticResource FSE_WarningBrush}"></Setter> - <Setter Property="ToolTip" Value="The system is currently offline. Please check your internet connection, some features might be disabled."></Setter> + <Setter Property="ToolTip" Value="The system is currently offline. Please check your internet connection, some features might not work."></Setter> <Style.Triggers> <DataTrigger Binding="{Binding ConnectivityProvider.IsOnline}" Value="True"> <Setter Property="Foreground" Value="{StaticResource FSE_SuccessBrush}"></Setter> |
