feat(save-attachments): editable filenames, Hebrew status, smoother subfolder load

- 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 <Version> 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) <noreply@anthropic.com>
This commit is contained in:
PointStar
2026-05-24 17:27:49 +03:00
parent dbd7f3068b
commit 4f2f41e95f
7 changed files with 77 additions and 10 deletions
@@ -84,6 +84,10 @@ namespace MarcusLaw.OutlookAddin.UI.Converters
["New"] = "חדש",
["Assigned"] = "הוקצה",
["Pending"] = "ממתין",
["PendingHearing"] = "ממתין לדיון",
["Pending Hearing"] = "ממתין לדיון",
["PendingDecision"] = "ממתין להחלטה",
["Pending Decision"] = "ממתין להחלטה",
["In Progress"] = "בטיפול",
["InProgress"] = "בטיפול",
["Open"] = "פתוח",
@@ -1,6 +1,7 @@
<Window x:Class="MarcusLaw.OutlookAddin.UI.Dialogs.SaveAttachmentsDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:MarcusLaw.OutlookAddin.UI.Converters"
Title="שמור קבצים מצורפים ל-Klear"
Height="560" Width="620"
MinHeight="420" MinWidth="500"
@@ -11,6 +12,9 @@
Background="#F8FAFC"
FontFamily="Segoe UI, David, Frank Ruehl, Arial">
<Window.Resources>
<conv:CaseStatusToHebrewConverter x:Key="CaseStatusHe" />
<BooleanToVisibilityConverter x:Key="BoolToVis" />
<SolidColorBrush x:Key="Primary" Color="#2563EB" />
<SolidColorBrush x:Key="PrimaryHover" Color="#1D4ED8" />
<SolidColorBrush x:Key="Border" Color="#E2E8F0" />
@@ -133,7 +137,7 @@
<DataGridTextColumn Header="מס׳ תיק" Binding="{Binding Number}" Width="80" />
<DataGridTextColumn Header="שם" Binding="{Binding Name}" Width="*" />
<DataGridTextColumn Header="מס׳ בבית משפט" Binding="{Binding CourtCaseNumber}" Width="140" />
<DataGridTextColumn Header="סטטוס" Binding="{Binding Status}" Width="100" />
<DataGridTextColumn Header="סטטוס" Binding="{Binding Status, Converter={StaticResource CaseStatusHe}}" Width="110" />
</DataGrid.Columns>
</DataGrid>
</Border>
@@ -142,9 +146,22 @@
<DockPanel Grid.Row="2" Margin="0,10,0,0" LastChildFill="True">
<TextBlock DockPanel.Dock="Left" Text="תיקייה:" VerticalAlignment="Center"
Margin="0,0,8,0" Foreground="{StaticResource Muted}" FontSize="12" />
<TextBlock DockPanel.Dock="Right" Text="טוען…" VerticalAlignment="Center"
Margin="8,0,0,0" Foreground="{StaticResource Muted}" FontSize="12"
Visibility="{Binding IsLoadingSubfolders, Converter={StaticResource BoolToVis}}" />
<ComboBox ItemsSource="{Binding Subfolders}"
SelectedItem="{Binding SelectedSubfolder}"
Padding="6,4" />
Padding="6,4">
<ComboBox.Style>
<Style TargetType="ComboBox">
<Style.Triggers>
<DataTrigger Binding="{Binding IsLoadingSubfolders}" Value="True">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>
</DockPanel>
<!-- Attachments header -->
@@ -167,10 +184,14 @@
FontSize="11"
VerticalAlignment="Center"
Margin="8,0,0,0" />
<TextBlock Text="{Binding FileName}"
VerticalAlignment="Center"
TextTrimming="CharacterEllipsis"
Margin="8,0,0,0" />
<TextBox Text="{Binding FileName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsEnabled="{Binding IsSelected}"
VerticalAlignment="Center"
BorderThickness="1"
BorderBrush="{StaticResource Border}"
Padding="6,3"
Margin="8,0,0,0"
ToolTip="לחץ כדי לערוך את שם הקובץ לפני השמירה" />
</DockPanel>
</DataTemplate>
</ItemsControl.ItemTemplate>
@@ -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; }
@@ -45,6 +45,9 @@ namespace MarcusLaw.OutlookAddin.UI.ViewModels
[ObservableProperty]
private string? statusMessage;
[ObservableProperty]
private bool isLoadingSubfolders;
/// <summary>
/// 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"); }
@@ -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 <Version>, 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";
+1 -1
View File
@@ -36,7 +36,7 @@
<PublishUrl>C:\Users\Chaim\source\repos\OutlookAddin\Publish\</PublishUrl>
<InstallUrl>https://gitea.dev.marcus-law.co.il/espocrm-extensions/OutlookAddin/raw/branch/main/Publish/</InstallUrl>
<TargetCulture>en</TargetCulture>
<ApplicationVersion>1.0.7.0</ApplicationVersion>
<ApplicationVersion>1.1.2.0</ApplicationVersion>
<AutoIncrementApplicationRevision>false</AutoIncrementApplicationRevision>
<UpdateEnabled>true</UpdateEnabled>
<UpdateInterval>7</UpdateInterval>
+2 -2
View File
@@ -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")]