feat: move test buttons to right panel, add user auth dialog for reports
Move Start/Stop/Report buttons from the middle panel to the top of TestPanelView (automated tests section), matching the old application layout. Remove inline Operator/Client text fields — operator identity now comes from a UserCheckDialog (username/password) shown before the existing ReportDialog. Add credential storage to ConfigurationService. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,7 +80,8 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<Label Content="Operator:" VerticalAlignment="Center" FontSize="13"/>
|
||||
<TextBox Grid.Column="1" Text="{Binding OperatorName, UpdateSourceTrigger=PropertyChanged}"
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0" Height="24"/>
|
||||
VerticalAlignment="Center" FontSize="13" Margin="4,0" Height="24"
|
||||
IsReadOnly="True" Background="#F0F0F0"/>
|
||||
</Grid>
|
||||
|
||||
<!-- ── Company name ─────────────────────────────────────────────────── -->
|
||||
|
||||
43
Views/Dialogs/UserCheckDialog.xaml
Normal file
43
Views/Dialogs/UserCheckDialog.xaml
Normal file
@@ -0,0 +1,43 @@
|
||||
<Window x:Class="HC_APTBS.Views.Dialogs.UserCheckDialog"
|
||||
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"
|
||||
mc:Ignorable="d"
|
||||
Title="User Authentication"
|
||||
Height="170" Width="420"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner">
|
||||
|
||||
<Grid Margin="16,12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="90"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Username -->
|
||||
<Label Content="Username:" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
<TextBox Grid.Column="1" Margin="8,4" Height="26" VerticalContentAlignment="Center"
|
||||
Text="{Binding Username, UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
<!-- Password -->
|
||||
<Label Grid.Row="1" Content="Password:" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
||||
<PasswordBox x:Name="PBPassword" Grid.Row="1" Grid.Column="1"
|
||||
Margin="8,4" Height="26" VerticalContentAlignment="Center"
|
||||
PasswordChanged="OnPasswordChanged"/>
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="1"
|
||||
Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
||||
<Button Content="Accept" Width="80" Height="26" Margin="0,0,8,0"
|
||||
Command="{Binding AcceptCommand}" IsDefault="True"/>
|
||||
<Button Content="Cancel" Width="80" Height="26"
|
||||
Command="{Binding CancelCommand}" IsCancel="True"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
30
Views/Dialogs/UserCheckDialog.xaml.cs
Normal file
30
Views/Dialogs/UserCheckDialog.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using HC_APTBS.ViewModels.Dialogs;
|
||||
|
||||
namespace HC_APTBS.Views.Dialogs
|
||||
{
|
||||
/// <summary>
|
||||
/// Authentication dialog that collects username and password before report generation.
|
||||
/// </summary>
|
||||
public partial class UserCheckDialog : Window
|
||||
{
|
||||
/// <summary>Creates the dialog and wires the ViewModel.</summary>
|
||||
public UserCheckDialog(UserCheckViewModel vm)
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = vm;
|
||||
vm.RequestClose += Close;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Forwards the PasswordBox value to the ViewModel.
|
||||
/// WPF intentionally does not expose Password as a DependencyProperty.
|
||||
/// </summary>
|
||||
private void OnPasswordChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is UserCheckViewModel vm)
|
||||
vm.Password = ((PasswordBox)sender).Password;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user