Files
Sharepoint-Toolbox/.planning/phases/08-simplified-permissions/08-05-PLAN.md
Dev c871effa87 docs(08-simplified-permissions): create phase plan (6 plans, 5 waves)
Plans cover plain-language permission labels, risk-level color coding,
summary counts, detail-level toggle, export integration, and unit tests.
PermissionEntry record is NOT modified — uses wrapper pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:00:08 +02:00

9.8 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
08-simplified-permissions 05 execute 4
08-02
08-03
08-04
SharepointToolbox/Localization/Strings.resx
SharepointToolbox/Localization/Strings.fr.resx
SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs
true
SIMP-01
SIMP-02
SIMP-03
truths artifacts key_links
All new UI strings have EN and FR localization keys
Export commands pass SimplifiedResults when IsSimplifiedMode is true
PermissionsView.xaml display options GroupBox uses localization keys not hardcoded strings
path provides contains
SharepointToolbox/Localization/Strings.resx EN localization keys for simplified permissions UI grp.display.opts
path provides contains
SharepointToolbox/Localization/Strings.fr.resx FR localization keys for simplified permissions UI grp.display.opts
from to via pattern
SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs SharepointToolbox/Services/Export/CsvExportService.cs ExportCsvAsync calls simplified overload when IsSimplifiedMode SimplifiedResults
from to via pattern
SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs SharepointToolbox/Services/Export/HtmlExportService.cs ExportHtmlAsync calls simplified overload when IsSimplifiedMode SimplifiedResults
Wire the simplified export paths, add all EN/FR localization keys, and finalize the integration between ViewModel export commands and the simplified export service overloads.

Purpose: Completes the integration: export commands use simplified data when mode is active, and all UI strings are properly localized in both languages. Output: Updated Strings.resx, Strings.fr.resx, updated PermissionsViewModel export methods

<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/phases/08-simplified-permissions/08-01-SUMMARY.md @.planning/phases/08-simplified-permissions/08-02-SUMMARY.md @.planning/phases/08-simplified-permissions/08-03-SUMMARY.md @.planning/phases/08-simplified-permissions/08-04-SUMMARY.md From PermissionsViewModel (current ExportCsvAsync): ```csharp private async Task ExportCsvAsync() { if (_csvExportService == null || Results.Count == 0) return; // ... SaveFileDialog ... await _csvExportService.WriteAsync(Results, dialog.FileName, CancellationToken.None); } ```

From PermissionsViewModel (current ExportHtmlAsync):

private async Task ExportHtmlAsync()
{
    if (_htmlExportService == null || Results.Count == 0) return;
    // ... SaveFileDialog ...
    await _htmlExportService.WriteAsync(Results, dialog.FileName, CancellationToken.None);
}

From CsvExportService:

public async Task WriteAsync(IReadOnlyList<SimplifiedPermissionEntry> entries, string filePath, CancellationToken ct);

From HtmlExportService:

public async Task WriteAsync(IReadOnlyList<SimplifiedPermissionEntry> entries, string filePath, CancellationToken ct);
Task 1: Add EN and FR localization keys for simplified permissions SharepointToolbox/Localization/Strings.resx, SharepointToolbox/Localization/Strings.fr.resx Add the following keys to `SharepointToolbox/Localization/Strings.resx` (EN). Insert them in alphabetical order among existing keys, following the existing `` element format:
```xml
<data name="chk.simplified.mode" xml:space="preserve"><value>Simplified mode</value></data>
<data name="grp.display.opts" xml:space="preserve"><value>Display Options</value></data>
<data name="lbl.detail.level" xml:space="preserve"><value>Detail level:</value></data>
<data name="rad.detail.detailed" xml:space="preserve"><value>Detailed (all rows)</value></data>
<data name="rad.detail.simple" xml:space="preserve"><value>Simple (summary only)</value></data>
<data name="lbl.summary.users" xml:space="preserve"><value>user(s)</value></data>
```

Add the corresponding French translations to `SharepointToolbox/Localization/Strings.fr.resx`:

```xml
<data name="chk.simplified.mode" xml:space="preserve"><value>Mode simplifie</value></data>
<data name="grp.display.opts" xml:space="preserve"><value>Options d'affichage</value></data>
<data name="lbl.detail.level" xml:space="preserve"><value>Niveau de detail :</value></data>
<data name="rad.detail.detailed" xml:space="preserve"><value>Detaille (toutes les lignes)</value></data>
<data name="rad.detail.simple" xml:space="preserve"><value>Simple (resume uniquement)</value></data>
<data name="lbl.summary.users" xml:space="preserve"><value>utilisateur(s)</value></data>
```

Note: French accented characters (e, a with accents) should be used if the resx file supports it. Check existing FR entries for the pattern — if they use plain ASCII, match that convention.
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj --no-incremental 2>&1 | tail -5 6 new localization keys added to both Strings.resx and Strings.fr.resx. Keys match the binding paths used in PermissionsView.xaml (grp.display.opts, chk.simplified.mode, lbl.detail.level, rad.detail.simple, rad.detail.detailed, lbl.summary.users). Task 2: Wire export commands to use simplified overloads and update summary card text SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs Modify `SharepointToolbox/ViewModels/Tabs/PermissionsViewModel.cs` to update the export commands to pass simplified data when IsSimplifiedMode is active.
Update `ExportCsvAsync`:
```csharp
private async Task ExportCsvAsync()
{
    if (_csvExportService == null || Results.Count == 0) return;
    var dialog = new SaveFileDialog
    {
        Title = "Export permissions to CSV",
        Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*",
        DefaultExt = "csv",
        FileName = "permissions"
    };
    if (dialog.ShowDialog() != true) return;
    try
    {
        if (IsSimplifiedMode && SimplifiedResults.Count > 0)
            await _csvExportService.WriteAsync(SimplifiedResults.ToList(), dialog.FileName, CancellationToken.None);
        else
            await _csvExportService.WriteAsync(Results, dialog.FileName, CancellationToken.None);
        OpenFile(dialog.FileName);
    }
    catch (Exception ex)
    {
        StatusMessage = $"Export failed: {ex.Message}";
        _logger.LogError(ex, "CSV export failed.");
    }
}
```

Update `ExportHtmlAsync`:
```csharp
private async Task ExportHtmlAsync()
{
    if (_htmlExportService == null || Results.Count == 0) return;
    var dialog = new SaveFileDialog
    {
        Title = "Export permissions to HTML",
        Filter = "HTML files (*.html)|*.html|All files (*.*)|*.*",
        DefaultExt = "html",
        FileName = "permissions"
    };
    if (dialog.ShowDialog() != true) return;
    try
    {
        if (IsSimplifiedMode && SimplifiedResults.Count > 0)
            await _htmlExportService.WriteAsync(SimplifiedResults.ToList(), dialog.FileName, CancellationToken.None);
        else
            await _htmlExportService.WriteAsync(Results, dialog.FileName, CancellationToken.None);
        OpenFile(dialog.FileName);
    }
    catch (Exception ex)
    {
        StatusMessage = $"Export failed: {ex.Message}";
        _logger.LogError(ex, "HTML export failed.");
    }
}
```

Note: `SimplifiedResults.ToList()` converts `IReadOnlyList<SimplifiedPermissionEntry>` to `List<SimplifiedPermissionEntry>` which satisfies the `IReadOnlyList<SimplifiedPermissionEntry>` parameter. This is needed because the field type is `IReadOnlyList` but the service expects `IReadOnlyList`.

Also add `using System.Linq;` if not already present (it likely is via global using or existing code).

Do NOT change constructor signatures, RunOperationAsync, or any other method besides ExportCsvAsync and ExportHtmlAsync.
cd "C:\Users\dev\Documents\projets\Sharepoint" && dotnet build SharepointToolbox/SharepointToolbox.csproj --no-incremental 2>&1 | tail -5 ExportCsvAsync and ExportHtmlAsync check IsSimplifiedMode and pass SimplifiedResults to the overloaded WriteAsync when active. Standard PermissionEntry path unchanged when simplified mode is off. - `dotnet build SharepointToolbox/SharepointToolbox.csproj` succeeds with 0 errors - Strings.resx contains keys: grp.display.opts, chk.simplified.mode, lbl.detail.level, rad.detail.simple, rad.detail.detailed, lbl.summary.users - Strings.fr.resx contains the same keys with French values - ExportCsvAsync branches on IsSimplifiedMode to call the simplified overload - ExportHtmlAsync branches on IsSimplifiedMode to call the simplified overload

<success_criteria> The full pipeline is wired: UI toggles -> ViewModel mode -> simplified data -> export services. All new UI text has EN/FR localization. Exports produce simplified output when the user has simplified mode active. </success_criteria>

After completion, create `.planning/phases/08-simplified-permissions/08-05-SUMMARY.md`