9.6 KiB
9.6 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | |||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 12-branding-ui-views | 03 | execute | 2 |
|
|
true |
|
|
Purpose: Allows administrators to see, import, clear, and auto-pull client logos per tenant directly from the profile management dialog.
Output: Updated ProfileManagementDialog.xaml with a client logo section and increased dialog height.
<execution_context> @C:/Users/dev/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/dev/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/PROJECT.md @.planning/ROADMAP.md @.planning/STATE.md @.planning/phases/12-branding-ui-views/12-RESEARCH.mdFrom SharepointToolbox/ViewModels/ProfileManagementViewModel.cs:
public string? ClientLogoPreview { get; } // data URI string or null (added in 12-01)
public IAsyncRelayCommand BrowseClientLogoCommand { get; } // gated on SelectedProfile != null
public IAsyncRelayCommand ClearClientLogoCommand { get; } // gated on SelectedProfile != null
public IAsyncRelayCommand AutoPullClientLogoCommand { get; } // gated on SelectedProfile != null
public string ValidationMessage { get; set; } // set on error or success feedback
public TenantProfile? SelectedProfile { get; set; }
From SharepointToolbox/Views/Dialogs/ProfileManagementDialog.xaml:
<Window ... Width="500" Height="480" ResizeMode="NoResize">
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <!-- Row 0: Label "Profiles" -->
<RowDefinition Height="*" /> <!-- Row 1: Profile ListBox -->
<RowDefinition Height="Auto" /> <!-- Row 2: Input fields (Name/URL/ClientId) -->
<RowDefinition Height="Auto" /> <!-- Row 3: Action buttons -->
</Grid.RowDefinitions>
...
</Grid>
</Window>
{StaticResource Base64ToImageConverter}— converts data URI string to BitmapImage{StaticResource StringToVisibilityConverter}— Visible if non-empty, else Collapsed
a) Increase dialog height from 480 to 620:
Change `Height="480"` to `Height="620"`
b) Add a new Row 3 for the logo section. Update RowDefinitions to:
```xml
<Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <!-- Row 0: Label -->
<RowDefinition Height="*" /> <!-- Row 1: ListBox -->
<RowDefinition Height="Auto" /> <!-- Row 2: Input fields -->
<RowDefinition Height="Auto" /> <!-- Row 3: Client logo (NEW) -->
<RowDefinition Height="Auto" /> <!-- Row 4: Buttons (was Row 3) -->
</Grid.RowDefinitions>
```
c) Move existing buttons StackPanel from Grid.Row="3" to Grid.Row="4"
d) Add the client logo section at Grid.Row="3":
```xml
<!-- Client Logo -->
<StackPanel Grid.Row="3" Margin="0,8,0,8">
<Label Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[profile.logo.title]}" Padding="0,0,0,4" />
<Border BorderBrush="#DDDDDD" BorderThickness="1" Padding="8" CornerRadius="4"
HorizontalAlignment="Left" MinWidth="200" MinHeight="50">
<Grid>
<Image Source="{Binding ClientLogoPreview, Converter={StaticResource Base64ToImageConverter}}"
MaxHeight="60" MaxWidth="200" Stretch="Uniform" HorizontalAlignment="Left"
Visibility="{Binding ClientLogoPreview, Converter={StaticResource StringToVisibilityConverter}}" />
<TextBlock Text="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[profile.logo.nopreview]}"
VerticalAlignment="Center" HorizontalAlignment="Center"
Foreground="#999999" FontStyle="Italic">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Visible" />
<Style.Triggers>
<DataTrigger Binding="{Binding ClientLogoPreview, Converter={StaticResource StringToVisibilityConverter}}" Value="Visible">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
<StackPanel Orientation="Horizontal" Margin="0,6,0,0">
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[profile.logo.browse]}"
Command="{Binding BrowseClientLogoCommand}" Width="80" Margin="0,0,8,0" />
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[profile.logo.clear]}"
Command="{Binding ClearClientLogoCommand}" Width="80" Margin="0,0,8,0" />
<Button Content="{Binding Source={x:Static loc:TranslationSource.Instance}, Path=[profile.logo.autopull]}"
Command="{Binding AutoPullClientLogoCommand}" Width="130" />
</StackPanel>
<TextBlock Text="{Binding ValidationMessage}" Foreground="#CC0000" FontSize="11" Margin="0,4,0,0"
Visibility="{Binding ValidationMessage, Converter={StaticResource StringToVisibilityConverter}}" />
</StackPanel>
```
Key decisions:
- GroupBox replaced with Label + StackPanel for consistency with SettingsView pattern
- Smaller preview (60px height vs 80px in Settings) because dialog has less space
- Pull from Entra button is wider (130px) to fit localized text
- ValidationMessage already set by Browse/Clear/AutoPull commands — just needs display
- All three buttons auto-disable via ICommand.CanExecute when SelectedProfile is null
dotnet build --no-restore -warnaserror
ProfileManagementDialog shows client logo section with preview, three buttons, and feedback. Dialog resized. Build passes.
```bash
dotnet build --no-restore -warnaserror
```
Build must pass with zero failures. Visual verification requires manual testing.
<success_criteria>
- ProfileManagementDialog.xaml has a visible Client Logo section between input fields and buttons
- Image binds to ClientLogoPreview via Base64ToImageConverter
- Placeholder text shows when no logo is configured
- Import, Clear, and Pull from Entra buttons bind to existing ViewModel commands
- All logo buttons disabled when no profile selected
- ValidationMessage displays feedback when set
- Dialog height increased to 620 to accommodate new section
- Build passes with zero warnings </success_criteria>