Merge branch 'microsoft:main' into main
This commit is contained in:
Коммит
59c02f446c
|
@ -106,7 +106,7 @@
|
|||
<Flyout x:Name="EditListNameFlyout" Opening="EditListNameFlyout_Opening">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock TextWrapping="Wrap" x:Uid="RenameListBlock" Style="{ThemeResource FlyoutPickerTitleTextBlockStyle}"/>
|
||||
<TextBox TextWrapping="Wrap" x:Name="RenameBox"/>
|
||||
<TextBox TextWrapping="Wrap" x:Name="RenameBox" AutomationProperties.Name="Rename Tasklist"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="CancelNameEdit" x:Uid="CancelEdit" Padding="5" Margin="5" Click="CancelNameEdit_Click">
|
||||
<SymbolIcon Symbol="Cancel"/>
|
||||
|
|
|
@ -737,7 +737,6 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
CloseButtonText = resourceLoader.GetString("Ok")
|
||||
};
|
||||
RenameBox.Text = activeList.Name;
|
||||
RenameBox.SetValue(AutomationProperties.NameProperty, activeList.Name);
|
||||
_ = await failedEdit.ShowAsync();
|
||||
}
|
||||
else if (!activeList.Name.Equals(RenameBox.Text, StringComparison.InvariantCulture))
|
||||
|
@ -751,7 +750,6 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
private void EditListNameFlyout_Opening(object sender, object e)
|
||||
{
|
||||
RenameBox.Text = activeList.Name;
|
||||
RenameBox.SetValue(AutomationProperties.NameProperty, activeList.Name);
|
||||
}
|
||||
|
||||
private ObservableCollection<TaskBase> TasksCollection;
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
<Flyout x:Name="SaveFlyout" x:Key="SaveFlyout" Closing="SaveFlyout_Closing">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="SaveFlyoutTextHeader" x:Uid="SaveFlyoutTextHeader" Style="{ThemeResource FlyoutPickerTitleTextBlockStyle}" Padding="5"/>
|
||||
<TextBox x:Name="SaveFlyoutUserPath" Text="" KeyDown="ConfirmSave_KeyDown" AutomationProperties.LabeledBy="{Binding ElementName=SaveFlyoutTextHeader}"/>
|
||||
<TextBox x:Name="SaveFlyoutUserPath" Text="" KeyDown="ConfirmSave_KeyDown" AutomationProperties.LabeledBy="{Binding ElementName=SaveFlyoutTextHeader}" TextChanged="SaveFlyout_TextChanged"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="CancelSave" Padding="5" Margin="5" Click="CancelSave_Click" AutomationProperties.Name="Cancel Save">
|
||||
<Button x:Name="CancelSave" Padding="5" Margin="5" Click="CancelSave_Click" AutomationProperties.Name="Cancel Save" IsEnabled="False">
|
||||
<SymbolIcon Symbol="Cancel"/>
|
||||
</Button>
|
||||
<Button x:Name="ConfirmSave" Padding="5" Margin="5" Click="ConfirmSave_Click" AutomationProperties.Name="Confirm Save">
|
||||
<Button x:Name="ConfirmSave" Padding="5" Margin="5" Click="ConfirmSave_Click" AutomationProperties.Name="Confirm Save" IsEnabled="False">
|
||||
<SymbolIcon Symbol="Save"/>
|
||||
</Button>
|
||||
<ProgressBar x:Name="SaveProgressBar" Margin="5" IsIndeterminate="True" Visibility="Collapsed" />
|
||||
|
@ -28,18 +28,28 @@
|
|||
<Flyout x:Name="LoadFlyout" x:Key="LoadFlyout" Closing="LoadFlyout_Closing">
|
||||
<StackPanel>
|
||||
<TextBlock x:Name="LoadFlyoutTextHeader" Text="" Style="{ThemeResource FlyoutPickerTitleTextBlockStyle}" Padding="5"/>
|
||||
<TextBox x:Name="LoadFlyoutUserPath" Text="" KeyDown="ConfirmLoad_KeyDown" AutomationProperties.LabeledBy="{Binding ElementName=LoadFlyoutTextHeader}"/>
|
||||
<TextBox x:Name="LoadFlyoutUserPath" Text="" KeyDown="ConfirmLoad_KeyDown" AutomationProperties.LabeledBy="{Binding ElementName=LoadFlyoutTextHeader}" TextChanged="LoadFlyout_TextChanged"/>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="CancelLoad" Padding="5" Margin="5" Click="CancelLoad_Click" AutomationProperties.Name="Cancel load">
|
||||
<Button x:Name="CancelLoad" Padding="5" Margin="5" Click="CancelLoad_Click" AutomationProperties.Name="Cancel load" IsEnabled="False">
|
||||
<SymbolIcon Symbol="Cancel"/>
|
||||
</Button>
|
||||
<Button x:Name="ConfirmLoad" Padding="5" Margin="5" Click="ConfirmLoad_Click" AutomationProperties.Name="Confirm load">
|
||||
<Button x:Name="ConfirmLoad" Padding="5" Margin="5" Click="ConfirmLoad_Click" AutomationProperties.Name="Confirm load" IsEnabled="False">
|
||||
<SymbolIcon Symbol="Accept"/>
|
||||
</Button>
|
||||
<ProgressBar x:Name="LoadProgressBar" Margin="5" IsIndeterminate="True" Visibility="Collapsed" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
<Flyout x:Name="DeleteFlyout" x:Key="DeleteFlyout" >
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Button x:Name="CancelDelete" Padding="5" Margin="5" Click="CancelDelete_Click" AutomationProperties.Name="Cancel Delete">
|
||||
<SymbolIcon Symbol="Cancel"/>
|
||||
</Button>
|
||||
<Button x:Name="ConfirmDelete" Padding="5" Margin="5" Click="ConfirmDelete_Click" AutomationProperties.Name="Confirm Delete">
|
||||
<SymbolIcon Symbol="Accept"/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Flyout>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
|
@ -102,7 +112,7 @@
|
|||
<Button x:Name="SaveListButton" Click="SaveListButton_Click" FlyoutBase.AttachedFlyout="{StaticResource SaveFlyout}" AutomationProperties.Name="Export Task List" ToolTipService.ToolTip="Export TaskList">
|
||||
<SymbolIcon Symbol="Save"/>
|
||||
</Button>
|
||||
<Button x:Name="DeleteListButton" Margin="5,0,5,0" Click="DeleteListButton_Click" AutomationProperties.Name="Delete task list">
|
||||
<Button x:Name="DeleteListButton" Margin="5,0,5,0" Click="DeleteListButton_Click" FlyoutBase.AttachedFlyout="{StaticResource DeleteFlyout}" AutomationProperties.Name="Delete task list">
|
||||
<FontIcon FontFamily="{StaticResource SymbolThemeFontFamily}" Glyph=""/>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
|
|
@ -133,8 +133,70 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
LoadProgressBar.Visibility = Visibility.Collapsed;
|
||||
LoadFlyout.Hide();
|
||||
}
|
||||
}
|
||||
|
||||
// cancel delete flyout action
|
||||
private void CancelDelete_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DeleteFlyout.Hide();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Confirm delete flyout
|
||||
/// </summary>
|
||||
private async void ConfirmDelete_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Client.DeleteTaskList(_activeGuid);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.GetType() != typeof(FactoryOrchestratorConnectionException))
|
||||
{
|
||||
ContentDialog failedDeleteDialog = new ContentDialog
|
||||
{
|
||||
Title = resourceLoader.GetString("FOXMLSaveFailed"),
|
||||
Content = $"{ex.Message}",
|
||||
CloseButtonText = resourceLoader.GetString("Ok")
|
||||
};
|
||||
|
||||
_ = await failedDeleteDialog.ShowAsync();
|
||||
}
|
||||
}
|
||||
DeleteFlyout.Hide();
|
||||
}
|
||||
|
||||
//Function monitors text box changes to enable/disable the cancel and save buttons for save feature.
|
||||
private void SaveFlyout_TextChanged(Object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(SaveFlyoutUserPath.Text))
|
||||
{
|
||||
ConfirmSave.IsEnabled = true;
|
||||
CancelSave.IsEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConfirmSave.IsEnabled = false;
|
||||
CancelSave.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Function monitors text box changes to enable/disable the cancel and save buttons for load feature.
|
||||
private void LoadFlyout_TextChanged(Object sender, TextChangedEventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(LoadFlyoutUserPath.Text))
|
||||
{
|
||||
ConfirmLoad.IsEnabled = true;
|
||||
CancelLoad.IsEnabled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ConfirmLoad.IsEnabled = false;
|
||||
CancelLoad.IsEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
private async void ShowLoadFailure(bool isFileLoad, string path, string error)
|
||||
{
|
||||
var type = isFileLoad ? resourceLoader.GetString("FOXML") : resourceLoader.GetString("Folder");
|
||||
|
@ -160,10 +222,12 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
/// <summary>
|
||||
/// Delete the selected tasklist
|
||||
/// </summary>
|
||||
private async void DeleteListButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var guid = GetTaskListGuidFromButton(sender as Button);
|
||||
await Client.DeleteTaskList(guid);
|
||||
private void DeleteListButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var button = sender as Button;
|
||||
_activeGuid = GetTaskListGuidFromButton(button);
|
||||
SaveFlyoutUserPath.Text = _activeGuid.ToString();
|
||||
Flyout.ShowAttachedFlyout(button);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -131,14 +131,14 @@
|
|||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ListView x:Name="TaskListsView" Grid.Column="0" ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind TaskListCollection, Mode=OneWay}" SelectionMode="Single" SelectionChanged="TaskListsView_SelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<ListView x:Name="TaskListsView" Grid.Column="0" ScrollViewer.HorizontalScrollMode="Disabled" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind TaskListCollection, Mode=OneWay}" SelectionMode="Single" SelectionChanged="TaskListsView_SelectionChanged" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="1" MinWidth="1">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="core:TaskListSummary">
|
||||
<TextBlock x:Name="TaskListName" Text="{x:Bind Name}" ToolTipService.ToolTip="{x:Bind Name}" VerticalAlignment="Center" TextWrapping="Wrap" Margin="10,0" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<ListView x:Name="TaskListsResultsAndButtonsView" Grid.Column="1" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind TaskListCollection, Mode=OneWay}" ItemTemplateSelector="{StaticResource TaskListViewSelector}" SelectionMode="Single" HorizontalAlignment="Right" SelectionChanged="TaskListsResultsAndButtonsView_SelectionChanged"/>
|
||||
<ListView x:Name="TaskListsResultsAndButtonsView" Grid.Column="1" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind TaskListCollection, Mode=OneWay}" ItemTemplateSelector="{StaticResource TaskListViewSelector}" SelectionMode="Single" HorizontalAlignment="Right" Loaded="TaskListResultButtonView_Loaded" SelectionChanged="TaskListsResultsAndButtonsView_SelectionChanged" MinHeight="1" MinWidth="1"/>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
|
@ -149,14 +149,14 @@
|
|||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ProgressRing x:Name="LoadingTasksRing" Grid.ColumnSpan="2" IsActive="False" Width="100" Height="100"/>
|
||||
<ListView x:Name="ActiveTestsView" Grid.Column="0" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind ActiveListCollection, Mode=OneWay}" SelectionMode="Single" SelectionChanged="ActiveTestsView_SelectionChanged" ItemClick="ActiveTestsResultsView_ItemClick" IsItemClickEnabled="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<ListView x:Name="ActiveTestsView" Grid.Column="0" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind ActiveListCollection, Mode=OneWay}" SelectionMode="Single" SelectionChanged="ActiveTestsView_SelectionChanged" ItemClick="ActiveTestsResultsView_ItemClick" IsItemClickEnabled="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="1" MinWidth="1">
|
||||
<ListView.ItemTemplate>
|
||||
<DataTemplate x:DataType="local:TaskBaseWithTemplate">
|
||||
<TextBlock x:Name="TaskName" Text="{x:Bind Task.Name}" ToolTipService.ToolTip="{x:Bind Task.Name}" VerticalAlignment="Center" Margin="10,0" />
|
||||
</DataTemplate>
|
||||
</ListView.ItemTemplate>
|
||||
</ListView>
|
||||
<ListView x:Name="ActiveTestsResultsView" Grid.Column="1" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind ActiveListCollection, Mode=OneWay}" ItemTemplateSelector="{StaticResource ResultsViewSelector}" SelectionMode="Single" SelectionChanged="ActiveTestsResultsView_SelectionChanged" ItemClick="ActiveTestsResultsView_ItemClick" IsItemClickEnabled="True" HorizontalAlignment="Right"/>
|
||||
<ListView x:Name="ActiveTestsResultsView" Grid.Column="1" ScrollViewer.VerticalScrollMode="Disabled" ItemsSource="{x:Bind ActiveListCollection, Mode=OneWay}" ItemTemplateSelector="{StaticResource ResultsViewSelector}" SelectionMode="Single" SelectionChanged="ActiveTestsResultsView_SelectionChanged" ItemClick="ActiveTestsResultsView_ItemClick" IsItemClickEnabled="True" HorizontalAlignment="Right" MinHeight="1" MinWidth="1" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
|
||||
|
|
|
@ -69,7 +69,11 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
}
|
||||
|
||||
// Keep indicies in sync
|
||||
TaskListsResultsAndButtonsView.SelectedIndex = _selectedTaskList;
|
||||
TaskListsResultsAndButtonsView.SelectedIndex = _selectedTaskList;
|
||||
|
||||
var item = TaskListsResultsAndButtonsView.ContainerFromIndex(TaskListsResultsAndButtonsView.SelectedIndex) as FrameworkElement;
|
||||
string status = ((TaskListSummary)TaskListsResultsAndButtonsView.SelectedItem).Status.ToString();
|
||||
AutomationProperties.SetName(item, status);
|
||||
|
||||
// Create new poller
|
||||
if (_activeListPoller != null)
|
||||
|
@ -96,12 +100,25 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
}
|
||||
}
|
||||
|
||||
//Setting default Tasklist item on startup to trigger accessiblity name update
|
||||
private void TaskListResultButtonView_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if(_selectedTaskList == -1)
|
||||
{
|
||||
_selectedTaskList = 0;
|
||||
TaskListsResultsAndButtonsView.SelectedIndex = _selectedTaskList;
|
||||
}
|
||||
}
|
||||
|
||||
private void TaskListsResultsAndButtonsView_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if ((TaskListsResultsAndButtonsView.SelectedIndex != -1) && (_selectedTaskList != TaskListsResultsAndButtonsView.SelectedIndex))
|
||||
{
|
||||
// Select the tasklist to trigger TaskListsView_SelectionChanged
|
||||
TaskListsView.SelectedIndex = TaskListsResultsAndButtonsView.SelectedIndex;
|
||||
TaskListsView.SelectedIndex = TaskListsResultsAndButtonsView.SelectedIndex;
|
||||
var item = TaskListsResultsAndButtonsView.ContainerFromIndex(TaskListsResultsAndButtonsView.SelectedIndex) as FrameworkElement;
|
||||
string status = ((TaskListSummary)TaskListsResultsAndButtonsView.SelectedItem).Status.ToString();
|
||||
AutomationProperties.SetName(item, status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -330,7 +347,7 @@ namespace Microsoft.FactoryOrchestrator.UWP
|
|||
{
|
||||
TaskListsView.SelectedIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Prune non-existent Lists
|
||||
int j = newSummaries.Count;
|
||||
|
|
Загрузка…
Ссылка в новой задаче