[feat:] enable/disable label export (to only export running sheets
This commit is contained in:
@@ -13,7 +13,7 @@ namespace Logof_Client;
|
||||
public static class SchemaMigration
|
||||
{
|
||||
// Current schema version - increment when you make breaking changes
|
||||
public const int CURRENT_SCHEMA_VERSION = 4;
|
||||
public const int CURRENT_SCHEMA_VERSION = 5;
|
||||
|
||||
// Dictionary of migration functions, keyed by the version they migrate TO
|
||||
private static readonly Dictionary<int, Func<JObject, JObject>> Migrations = new()
|
||||
@@ -24,6 +24,7 @@ public static class SchemaMigration
|
||||
|
||||
// Example: Migration from v2 to v3
|
||||
{ 4, MigrateV3ToV4 },
|
||||
{ 5, MigrateV4ToV5 },
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -104,6 +105,16 @@ public static class SchemaMigration
|
||||
|
||||
return obj;
|
||||
}
|
||||
private static JObject MigrateV4ToV5(JObject obj)
|
||||
{
|
||||
// Example: Add a new field that didn't exist before
|
||||
if (!obj.ContainsKey("expLabEnable"))
|
||||
{
|
||||
obj["expLabEnable"] = JToken.FromObject(new PdfExportSettings().expLabEnable);
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Registers a new migration function that will be called when upgrading to a specific version.
|
||||
|
||||
@@ -98,6 +98,7 @@ public enum LCModule
|
||||
|
||||
public class PdfExportSettings
|
||||
{
|
||||
public bool expLabEnable {get; set;} = true;
|
||||
public double cellPaddingTopMm { get; set; } = 4;
|
||||
public double cellPaddingBottomMm { get; set; } = 4;
|
||||
public double cellPaddingLeftMm { get; set; } = 4;
|
||||
|
||||
Reference in New Issue
Block a user