From 137cb99fba50ac0402934aafdbe1c31c41e23ade Mon Sep 17 00:00:00 2001 From: PointStar Date: Mon, 11 May 2026 19:12:59 +0300 Subject: [PATCH] feat(sidebar): Hebrew case status labels + show all linked cases (not just 5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two quality-of-life tweaks on the sidebar: 1. New CaseStatusToHebrewConverter translates standard EspoCRM Case statuses (New / Assigned / Pending / Closed / Rejected / Duplicate / In Progress / On Hold / Resolved / Cancelled / Closed Won / Closed Lost / Open) to Hebrew. Unknown values pass through unchanged so custom statuses configured per-tenant still render. Wired in ReadingPaneView.xaml via Status binding. 2. MatchingService now pulls up to 50 cases per contact instead of 5. The sidebar's ScrollViewer already handles long lists. 50 is well below EspoCRM's default page size and large enough for any realistic attorney/contact relationship. Section header changed from "תיקים אחרונים" to "תיקים מקושרים" to reflect that it's the complete list, not just the most recent. Tests: 39 passing. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Services/MatchingService.cs | 6 ++- .../Converters/EntityTypeToHebrewConverter.cs | 39 +++++++++++++++++++ .../Views/ReadingPaneView.xaml | 7 +++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/OutlookAddin.Core/Services/MatchingService.cs b/src/OutlookAddin.Core/Services/MatchingService.cs index 190f28c..37aa8d7 100644 --- a/src/OutlookAddin.Core/Services/MatchingService.cs +++ b/src/OutlookAddin.Core/Services/MatchingService.cs @@ -75,7 +75,11 @@ namespace MarcusLaw.OutlookAddin.Core.Services var cases = new System.Collections.Generic.List(); try { - var list = await _client.ListCasesForContactAsync(contact.Id, 5, cancellationToken).ConfigureAwait(false); + // Pull up to 50 cases per contact so the sidebar can show the + // whole list, not just the 5 most recent. 50 is well below the + // EspoCRM default page limit and large enough for any realistic + // attorney/contact relationship. + var list = await _client.ListCasesForContactAsync(contact.Id, 50, cancellationToken).ConfigureAwait(false); cases.AddRange(list.List); } catch (Exception ex) diff --git a/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs b/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs index 3df04e6..dafff31 100644 --- a/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs +++ b/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs @@ -71,6 +71,45 @@ namespace MarcusLaw.OutlookAddin.UI.Converters } } + /// + /// Maps EspoCRM Case status values (English) to Hebrew labels. Unknown + /// values pass through unchanged so installs with custom statuses + /// still render correctly. + /// + public sealed class CaseStatusToHebrewConverter : IValueConverter + { + private static readonly Dictionary Map = + new Dictionary(StringComparer.OrdinalIgnoreCase) + { + ["New"] = "חדש", + ["Assigned"] = "הוקצה", + ["Pending"] = "ממתין", + ["In Progress"] = "בטיפול", + ["InProgress"] = "בטיפול", + ["Open"] = "פתוח", + ["Closed"] = "סגור", + ["Closed Lost"] = "סגור — אבד", + ["Closed Won"] = "סגור — נצח", + ["Rejected"] = "נדחה", + ["Duplicate"] = "כפילות", + ["On Hold"] = "מושהה", + ["OnHold"] = "מושהה", + ["Resolved"] = "טופל", + ["Cancelled"] = "בוטל", + ["Canceled"] = "בוטל" + }; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + var s = value as string; + if (string.IsNullOrWhiteSpace(s)) return string.Empty; + return Map.TryGetValue(s!, out var hebrew) ? hebrew : s!; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + => throw new NotSupportedException(); + } + /// /// Returns a small emoji marker per entity type to use next to the /// Hebrew label in group headers. diff --git a/src/OutlookAddin.UI/Views/ReadingPaneView.xaml b/src/OutlookAddin.UI/Views/ReadingPaneView.xaml index 0ee3904..075304d 100644 --- a/src/OutlookAddin.UI/Views/ReadingPaneView.xaml +++ b/src/OutlookAddin.UI/Views/ReadingPaneView.xaml @@ -1,11 +1,13 @@ + @@ -75,7 +77,7 @@ - + @@ -85,7 +87,8 @@ - +