Files
Sharepoint-Toolbox/.planning/phases/19-app-registration-removal/19-02-SUMMARY.md
Dev 5d0b5cf85e docs(19-02): complete register/remove app UI plan
- 19-02-SUMMARY.md created
- STATE.md: progress 100%, decisions, session updated
- ROADMAP.md: phase 19 marked complete
- REQUIREMENTS.md: APPREG-01, APPREG-04, APPREG-05 marked complete
2026-04-09 15:20:55 +02:00

3.8 KiB

phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
phase plan subsystem tags dependency_graph tech_stack key_files decisions metrics
19-app-registration-removal 02 ViewModels/UI
app-registration
viewmodel
xaml
localization
unit-tests
requires provides affects
19-01
register-app-ui
remove-app-ui
fallback-instructions-panel
ProfileManagementViewModel
ProfileManagementDialog
App.xaml.cs
added patterns
IAsyncRelayCommand
ObservableProperty
BooleanToVisibilityConverter
TranslationSource
created modified
SharepointToolbox.Tests/ViewModels/ProfileManagementViewModelRegistrationTests.cs
SharepointToolbox/ViewModels/ProfileManagementViewModel.cs
SharepointToolbox/Views/Dialogs/ProfileManagementDialog.xaml
SharepointToolbox/Localization/Strings.resx
SharepointToolbox/Localization/Strings.fr.resx
SharepointToolbox/App.xaml.cs
SharepointToolbox.Tests/ViewModels/ProfileManagementViewModelLogoTests.cs
ProfileManagementViewModel constructor gains IAppRegistrationService as last param — existing logo tests updated to 5-param
RegisterAppAsync/RemoveAppAsync use CancellationToken from IAsyncRelayCommand overload
TranslationSource.Instance used directly in ViewModel for status strings (consistent with runtime locale switching)
BooleanToVisibilityConverter declared in Window.Resources (WPF built-in, no custom converter needed)
duration completed_date tasks_completed files_modified
~5 minutes 2026-04-09 2 7

Phase 19 Plan 02: Register/Remove App UI Summary

Register and Remove app commands wired into ProfileManagementViewModel with fallback instructions panel, DI registration, EN/FR localization, and 7 passing unit tests.

Tasks Completed

# Task Commit Status
1 ViewModel commands + DI + Localization 42b5eda Done
2 Profile dialog XAML + ViewModel tests 809ac86 Done

What Was Built

ProfileManagementViewModel gained:

  • IAppRegistrationService constructor injection
  • RegisterAppCommand / RemoveAppCommand (IAsyncRelayCommand)
  • IsRegistering, ShowFallbackInstructions, RegistrationStatus observable properties
  • HasRegisteredApp computed property
  • CanRegisterApp / CanRemoveApp guards (profile selected, AppId null/non-null, not busy)
  • RegisterAppAsync: admin check → fallback panel or full registration → AppId persistence
  • RemoveAppAsync: app removal + MSAL clear + AppId null + persistence
  • OnIsRegisteringChanged partial: notifies both commands on busy state change

ProfileManagementDialog.xaml:

  • Height 750 (was 620)
  • New Row 4: Register/Remove buttons, RegistrationStatus TextBlock, fallback instructions Border (6 steps)
  • BooleanToVisibilityConverter added to Window.Resources
  • Buttons row shifted from Row 4 to Row 5

Localization: 16 new keys in both Strings.resx and Strings.fr.resx (register/remove/fallback flow, all accented FR characters).

App.xaml.cs: IAppRegistrationService registered as singleton.

Tests: 7 unit tests, all passing — CanExecute guards, fallback on non-admin, AppId set on success, AppId cleared on remove.

Deviations from Plan

Auto-fixed Issues

1. [Rule 2 - Missing critical update] Updated ProfileManagementViewModelLogoTests to 5-param constructor

  • Found during: Task 2
  • Issue: Existing logo tests used the 4-param constructor which no longer exists after adding IAppRegistrationService
  • Fix: Added Mock<IAppRegistrationService> field and passed _mockAppReg.Object as 5th param in all 3 constructor calls
  • Files modified: SharepointToolbox.Tests/ViewModels/ProfileManagementViewModelLogoTests.cs
  • Commit: 809ac86

Self-Check: PASSED

All key files found. Both task commits verified (42b5eda, 809ac86). Full solution builds clean. 7/7 tests pass.