fix(07): fix people picker selection and audit service authentication
People picker ListBox used MouseBinding which fires before SelectedItem updates, causing null CommandParameter. Replaced with SelectionChanged event handler in code-behind. AuditUsersAsync created TenantProfile with empty ClientId, causing ArgumentException in SessionManager. Added currentProfile parameter to pass the authenticated tenant's ClientId through. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System.Windows.Controls;
|
||||
using SharepointToolbox.Services;
|
||||
using SharepointToolbox.ViewModels.Tabs;
|
||||
|
||||
namespace SharepointToolbox.Views.Tabs;
|
||||
@@ -10,4 +11,17 @@ public partial class UserAccessAuditView : UserControl
|
||||
InitializeComponent();
|
||||
DataContext = viewModel;
|
||||
}
|
||||
|
||||
private void SearchResultsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (sender is ListBox listBox && listBox.SelectedItem is GraphUserResult user)
|
||||
{
|
||||
var vm = (UserAccessAuditViewModel)DataContext;
|
||||
if (vm.AddUserCommand.CanExecute(user))
|
||||
vm.AddUserCommand.Execute(user);
|
||||
|
||||
// Clear selection so the same item can be re-selected if needed
|
||||
listBox.SelectedItem = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user