From 18b6640e57cff4dee9a3d4354e83dbc53e1446bb Mon Sep 17 00:00:00 2001 From: PointStar Date: Sun, 24 May 2026 17:27:49 +0300 Subject: [PATCH] feat(save-attachments): editable filenames, Hebrew status, smoother subfolder load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DataGrid case picker now shows status via CaseStatusToHebrewConverter (added PendingHearing / PendingDecision mappings) - Attachment row replaces the read-only filename TextBlock with a TwoWay TextBox so users can rename a file before saving (flows through EspoAttachment.Name into the upload + the on-disk path) - SaveAttachmentsViewModel.IsLoadingSubfolders gates the folder ComboBox while EnsureCaseSubfolders / GetCase / ListNetworkStorageFolder run, so users can't pick a stale "(שורש התיק)" before the real list arrives - About tab: ResolveDisplayVersion now reads from the host VSTO assembly (*.OutlookAddin) instead of the UI assembly. The UI csproj is SDK-style with no so it always reported 1.0.0.0, which leaked into the About line on dev installs - Bump to 1.1.2.0 (csproj + AssemblyInfo) to match the v1.1.2 tag that will trigger the Gitea Actions auto-publish to platform.dev Co-Authored-By: Claude Opus 4.7 (1M context) --- .../Converters/EntityTypeToHebrewConverter.cs | 4 +++ .../Dialogs/SaveAttachmentsDialog.xaml | 33 +++++++++++++++---- .../ViewModels/AttachmentRowViewModel.cs | 12 ++++++- .../ViewModels/SaveAttachmentsViewModel.cs | 16 +++++++++ .../ViewModels/SettingsViewModel.cs | 16 +++++++++ src/OutlookAddin/OutlookAddin.csproj | 2 +- src/OutlookAddin/Properties/AssemblyInfo.cs | 4 +-- 7 files changed, 77 insertions(+), 10 deletions(-) diff --git a/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs b/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs index dafff31..78a17d9 100644 --- a/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs +++ b/src/OutlookAddin.UI/Converters/EntityTypeToHebrewConverter.cs @@ -84,6 +84,10 @@ namespace MarcusLaw.OutlookAddin.UI.Converters ["New"] = "חדש", ["Assigned"] = "הוקצה", ["Pending"] = "ממתין", + ["PendingHearing"] = "ממתין לדיון", + ["Pending Hearing"] = "ממתין לדיון", + ["PendingDecision"] = "ממתין להחלטה", + ["Pending Decision"] = "ממתין להחלטה", ["In Progress"] = "בטיפול", ["InProgress"] = "בטיפול", ["Open"] = "פתוח", diff --git a/src/OutlookAddin.UI/Dialogs/SaveAttachmentsDialog.xaml b/src/OutlookAddin.UI/Dialogs/SaveAttachmentsDialog.xaml index 7daf05c..acdfb83 100644 --- a/src/OutlookAddin.UI/Dialogs/SaveAttachmentsDialog.xaml +++ b/src/OutlookAddin.UI/Dialogs/SaveAttachmentsDialog.xaml @@ -1,6 +1,7 @@ + + + @@ -133,7 +137,7 @@ - + @@ -142,9 +146,22 @@ + + Padding="6,4"> + + + + @@ -167,10 +184,14 @@ FontSize="11" VerticalAlignment="Center" Margin="8,0,0,0" /> - + diff --git a/src/OutlookAddin.UI/ViewModels/AttachmentRowViewModel.cs b/src/OutlookAddin.UI/ViewModels/AttachmentRowViewModel.cs index f510a0a..1123a45 100644 --- a/src/OutlookAddin.UI/ViewModels/AttachmentRowViewModel.cs +++ b/src/OutlookAddin.UI/ViewModels/AttachmentRowViewModel.cs @@ -10,7 +10,17 @@ namespace MarcusLaw.OutlookAddin.UI.ViewModels [ObservableProperty] private bool isSelected = true; - public string FileName => Data.Name; + public string FileName + { + get => Data.Name; + set + { + var newName = value ?? string.Empty; + if (Data.Name == newName) return; + Data.Name = newName; + OnPropertyChanged(); + } + } public string SizeDisplay { get; } diff --git a/src/OutlookAddin.UI/ViewModels/SaveAttachmentsViewModel.cs b/src/OutlookAddin.UI/ViewModels/SaveAttachmentsViewModel.cs index 61621de..c114e7b 100644 --- a/src/OutlookAddin.UI/ViewModels/SaveAttachmentsViewModel.cs +++ b/src/OutlookAddin.UI/ViewModels/SaveAttachmentsViewModel.cs @@ -45,6 +45,9 @@ namespace MarcusLaw.OutlookAddin.UI.ViewModels [ObservableProperty] private string? statusMessage; + [ObservableProperty] + private bool isLoadingSubfolders; + /// /// Resolved server-side case folder path for the currently /// selected case (e.g. "47-אריאל מונאס"). Populated by @@ -140,6 +143,19 @@ namespace MarcusLaw.OutlookAddin.UI.ViewModels var c = SelectedCase; if (c == null || string.IsNullOrEmpty(c.Id)) return; + IsLoadingSubfolders = true; + try + { + await RefreshSubfoldersCoreAsync(c).ConfigureAwait(true); + } + finally + { + IsLoadingSubfolders = false; + } + } + + private async Task RefreshSubfoldersCoreAsync(CaseEntity c) + { try { await _client.EnsureCaseSubfoldersAsync(c.Id).ConfigureAwait(true); } catch (Exception ex) { _logger.Warning(ex, "EnsureCaseSubfolders failed; subfolders may be missing on disk"); } diff --git a/src/OutlookAddin.UI/ViewModels/SettingsViewModel.cs b/src/OutlookAddin.UI/ViewModels/SettingsViewModel.cs index ace73a8..031edd4 100644 --- a/src/OutlookAddin.UI/ViewModels/SettingsViewModel.cs +++ b/src/OutlookAddin.UI/ViewModels/SettingsViewModel.cs @@ -105,6 +105,22 @@ namespace MarcusLaw.OutlookAddin.UI.ViewModels // Not running under ClickOnce (dev / F5), or System.Deployment // is not available — fall through to the AssemblyVersion. } + // The host VSTO assembly is where versioning policy lives + // (csproj + AssemblyInfo). The UI assembly is SDK-style with + // no , so it always reports 1.0.0.0 — don't fall back + // to it. Walk loaded assemblies for the host by name suffix. + if (v == null) + { + foreach (var asm in AppDomain.CurrentDomain.GetAssemblies()) + { + var name = asm.GetName().Name; + if (name != null && name.EndsWith(".OutlookAddin", StringComparison.Ordinal)) + { + v = asm.GetName().Version; + break; + } + } + } v ??= typeof(SettingsViewModel).Assembly.GetName().Version; if (v == null) return "1.0.0"; diff --git a/src/OutlookAddin/OutlookAddin.csproj b/src/OutlookAddin/OutlookAddin.csproj index 2a64b20..d571eec 100644 --- a/src/OutlookAddin/OutlookAddin.csproj +++ b/src/OutlookAddin/OutlookAddin.csproj @@ -36,7 +36,7 @@ C:\Users\Chaim\source\repos\OutlookAddin\Publish\ https://gitea.dev.marcus-law.co.il/espocrm-extensions/OutlookAddin/raw/branch/main/Publish/ en - 1.0.7.0 + 1.1.2.0 false true 7 diff --git a/src/OutlookAddin/Properties/AssemblyInfo.cs b/src/OutlookAddin/Properties/AssemblyInfo.cs index c7e239d..c848049 100644 --- a/src/OutlookAddin/Properties/AssemblyInfo.cs +++ b/src/OutlookAddin/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ using System.Security; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.7.0")] -[assembly: AssemblyFileVersion("1.0.7.0")] +[assembly: AssemblyVersion("1.1.2.0")] +[assembly: AssemblyFileVersion("1.1.2.0")]