aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-07 17:19:25 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-07 17:19:25 +0200
commit2a21fe4c9ac87cceed96a03d5ff5ff1aa0d64016 (patch)
tree5e4332a86e760aae0e50bfe643f64a0c74046b6a /Software/Visual_Studio
parentbd3cb640be12621ac37253e8a8c627ae40692e4d (diff)
downloadTango-2a21fe4c9ac87cceed96a03d5ff5ff1aa0d64016.tar.gz
Tango-2a21fe4c9ac87cceed96a03d5ff5ff1aa0d64016.zip
Fixed and improved bug reporting in machine studio.
Diffstat (limited to 'Software/Visual_Studio')
-rw-r--r--Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnkbin1516 -> 1516 bytes
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml27
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs64
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs10
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest2
-rw-r--r--Software/Visual_Studio/Tango.TFS/Area.cs11
-rw-r--r--Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs39
8 files changed, 137 insertions, 18 deletions
diff --git a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk
index 5edf8db16..35386360d 100644
--- a/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk
+++ b/Software/Visual_Studio/Build/Shortcuts/Machine Studio.lnk
Binary files differ
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml
index 7387c4ae5..5f5e1042b 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml
@@ -35,7 +35,7 @@
</StackPanel>
</Grid>
- <Grid Grid.Row="1">
+ <Grid Grid.Row="1" Focusable="True">
<DockPanel>
<StackPanel DockPanel.Dock="Top">
<DockPanel>
@@ -50,7 +50,28 @@
<DockPanel Margin="0 10 0 0">
<materialDesign:PackIcon Kind="Star" Width="24" Height="24" VerticalAlignment="Center" Margin="0 0 10 0" />
- <ComboBox materialDesign:HintAssist.Hint="Area" materialDesign:HintAssist.IsFloating="True" ItemsSource="{Binding Project.Areas}" SelectedItem="{Binding WorkItem.Area}" DisplayMemberPath="Name"></ComboBox>
+ <Grid>
+ <TextBox IsReadOnly="True" materialDesign:HintAssist.Hint="Area" materialDesign:HintAssist.IsFloating="True" Text="{Binding WorkItem.Area.Name}" VerticalAlignment="Bottom" Margin="0 0 0 3"></TextBox>
+ <ToggleButton x:Name="toggleArea">
+ <ToggleButton.Template>
+ <ControlTemplate TargetType="ToggleButton">
+ <Grid Background="Transparent">
+ <Popup Height="200" AllowsTransparency="True" Width="{TemplateBinding ActualWidth}" PopupAnimation="Slide" IsOpen="{Binding IsChecked, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
+ <Border Background="White" Margin="0 2 0 0" BorderBrush="Silver" BorderThickness="1" CornerRadius="3">
+ <TreeView Loaded="TreeView_Loaded" ItemsSource="{Binding Project.Areas}" SelectedItemChanged="TreeView_SelectedItemChanged">
+ <TreeView.ItemTemplate>
+ <HierarchicalDataTemplate ItemsSource="{Binding SubAreas}">
+ <TextBlock Text="{Binding Name}" />
+ </HierarchicalDataTemplate>
+ </TreeView.ItemTemplate>
+ </TreeView>
+ </Border>
+ </Popup>
+ </Grid>
+ </ControlTemplate>
+ </ToggleButton.Template>
+ </ToggleButton>
+ </Grid>
</DockPanel>
<DockPanel Margin="0 10 0 0">
@@ -101,7 +122,7 @@
<TextBox IsReadOnly="True" Text="{Binding ImageFile}"></TextBox>
</DockPanel>
</StackPanel>
-
+
<Grid>
<DockPanel>
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs
index 72bef1205..b6e701841 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Views/ReportIssueView.xaml.cs
@@ -12,6 +12,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Tango.MachineStudio.UI.ViewModels;
+using Tango.TFS;
namespace Tango.MachineStudio.UI.Views
{
@@ -20,16 +22,78 @@ namespace Tango.MachineStudio.UI.Views
/// </summary>
public partial class ReportIssueView : UserControl
{
+ private ReportIssueViewVM _vm;
+
public ReportIssueView()
{
InitializeComponent();
this.Loaded += ReportIssueView_Loaded;
+ this.DataContextChanged += ReportIssueView_DataContextChanged;
+ }
+
+ private void ReportIssueView_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ _vm = this.DataContext as ReportIssueViewVM;
}
private void ReportIssueView_Loaded(object sender, RoutedEventArgs e)
{
txt_title.Focus();
}
+
+ private void TreeView_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
+ {
+ _vm.WorkItem.Area = e.NewValue as Area;
+ toggleArea.IsChecked = false;
+ }
+
+ private TreeView tree;
+
+ private void TreeView_Loaded(object sender, RoutedEventArgs e)
+ {
+ tree = sender as TreeView;
+ tree.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
+ }
+
+ private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
+ {
+ if (tree.ItemContainerGenerator.Status == System.Windows.Controls.Primitives.GeneratorStatus.ContainersGenerated)
+ {
+ TreeViewItem i = tree.ItemContainerGenerator.ContainerFromIndex(0) as TreeViewItem;
+ i.IsExpanded = true;
+ }
+ }
+
+ static TreeViewItem GetTreeViewItem(ItemsControl parent, object item, bool isExpanded)
+ {
+ if (item is TreeViewItem tvi)
+ return tvi;
+
+ var result = ContainerFromItem(parent, item);
+ if (result == null && isExpanded)
+ {
+ parent.UpdateLayout();
+ result = ContainerFromItem(parent, item);
+ }
+ return result;
+ }
+
+ static TreeViewItem ContainerFromItem(ItemsControl parent, object item) => (TreeViewItem)parent.ItemContainerGenerator.ContainerFromItem(item);
+
+ void SelectTreeViewItem(TreeView treeView, TreeViewItem Item)
+ {
+ Item.IsExpanded = Item.DataContext == areaCombo.SelectedItem;
+
+ foreach (var item in Item.Items)
+ {
+ var i = GetTreeViewItem(treeView, item, false);
+
+ i.IsExpanded = i.DataContext == areaCombo.SelectedItem;
+
+ if (i.HasItems)
+ SelectTreeViewItem(treeView, i);
+ }
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs
index b2abd9466..fdaa673ed 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Publisher/MainWindowVM.cs
@@ -56,7 +56,7 @@ namespace Tango.PPC.Publisher
public String SelectedBuildConfiguration
{
get { return _selectedBuildConfiguration; }
- set { _selectedBuildConfiguration = value; RaisePropertyChangedAuto(); }
+ set { _selectedBuildConfiguration = value; RaisePropertyChangedAuto(); OnSelectedBuildConfigurationChanged(); }
}
private String _localVersion;
@@ -186,13 +186,19 @@ namespace Tango.PPC.Publisher
SettingsManager.Default.GetOrCreate<CoreSettings>();
SettingsManager.Default.Save();
- LocalVersion = FileVersionInfo.GetVersionInfo(Core.Helpers.AssemblyHelper.GetCurrentAssemblyFolder() + "\\Tango.PPC.UI.exe").ProductVersion;
+ OnSelectedBuildConfigurationChanged();
PublishCommand = new RelayCommand(Publish);
CreateTupCommand = new RelayCommand(PublishTupFile);
FirmwareUpgradePackageBrowseCommand = new RelayCommand(BrowseFirmwareUpgradePackage);
}
+ private void OnSelectedBuildConfigurationChanged()
+ {
+ String _appPath = String.Format(AppDomain.CurrentDomain.BaseDirectory + "..\\{0}", SelectedBuildConfiguration);
+ LocalVersion = FileVersionInfo.GetVersionInfo(_appPath + "\\Tango.PPC.UI.exe").ProductVersion;
+ }
+
private async void OnSelectedMachineVersionChanged()
{
if (SelectedMachineVersion != null)
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
index e9e31e73b..f0559df50 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Properties/AssemblyInfo.cs
@@ -8,4 +8,4 @@ using System.Windows;
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Tango PPC Application")]
-[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyVersion("1.0.1.0")]
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
index efc5f8179..d72e75011 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/app.manifest
@@ -16,7 +16,7 @@
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
- <!--<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />-->
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
diff --git a/Software/Visual_Studio/Tango.TFS/Area.cs b/Software/Visual_Studio/Tango.TFS/Area.cs
index a79f9c0f1..956cbe8cf 100644
--- a/Software/Visual_Studio/Tango.TFS/Area.cs
+++ b/Software/Visual_Studio/Tango.TFS/Area.cs
@@ -10,5 +10,16 @@ namespace Tango.TFS
{
public String Name { get; set; }
public String Path { get; set; }
+ public List<Area> SubAreas { get; set; }
+
+ public Area()
+ {
+ SubAreas = new List<Area>();
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
}
}
diff --git a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs
index 5665caf3c..5c4746567 100644
--- a/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs
+++ b/Software/Visual_Studio/Tango.TFS/TeamFoundationServiceClient.cs
@@ -162,15 +162,14 @@ namespace Tango.TFS
p.UserStories.Add(story);
}
- p.Areas.Add(new Area() { Name = project.Name, Path = project.Name });
+ var mainArea = new Area() { Name = project.Name, Path = project.Name };
+ p.Areas.Add(mainArea);
foreach (var area in store.Projects[project.Name].AreaRootNodes.OfType<Node>())
{
- p.Areas.Add(new Area()
- {
- Name = area.Name,
- Path = area.Path,
- });
+ Area a = new Area();
+ FillArea(a, area);
+ mainArea.SubAreas.Add(a);
}
foreach (var iteration in store.Projects[project.Name].IterationRootNodes.OfType<Node>())
@@ -186,6 +185,21 @@ namespace Tango.TFS
});
}
+ private Area FillArea(Area area, Node node)
+ {
+ area.Name = node.Name;
+ area.Path = node.Path;
+
+ foreach (var child in node.ChildNodes.OfType<Node>())
+ {
+ var subArea = new Area();
+ FillArea(subArea, child);
+ area.SubAreas.Add(subArea);
+ }
+
+ return area;
+ }
+
/// <summary>
/// Uploads a work item to the specified team project.
/// </summary>
@@ -230,12 +244,15 @@ namespace Tango.TFS
});
}
- patchDocument.Add(new JsonPatchOperation
+ if (workItem.Iteration != null)
{
- Operation = Operation.Add,
- Path = GetFieldNameForWrite(CoreField.IterationPath),
- Value = workItem.Iteration.Path,
- });
+ patchDocument.Add(new JsonPatchOperation
+ {
+ Operation = Operation.Add,
+ Path = GetFieldNameForWrite(CoreField.IterationPath),
+ Value = workItem.Iteration.Path,
+ });
+ }
patchDocument.Add(new JsonPatchOperation
{