Adds a restore action for soft deleted bundled themes

This commit is contained in:
BinaryAlley committed 2026-08-21 11:47:51 -07:00
1 parent 15945c2e56
commit 7e54c990ad
49 files changed
+1666 -26

No files matched your search

@@ -25,6 +25,7 @@ public class ThemeInfoDtoFixture
/// <param name="version">Optional semantic version of the theme.</param>
/// <param name="previewUrl">Optional URL of the theme preview image.</param>
/// <param name="isBundled">Whether the theme ships with the application.</param>
/// <param name="isDeleted">Whether the theme was deleted by the user.</param>
/// <returns>A configured <see cref="ThemeInfoDto"/> instance.</returns>
public ThemeInfoDto Create(
string? id = null,
@@ -33,7 +34,8 @@ public class ThemeInfoDtoFixture
string? author = null,
string? version = null,
string? previewUrl = null,
bool? isBundled = null)
bool? isBundled = null,
bool? isDeleted = null)
{
Faker faker = new();
return new ThemeInfoDto(
@@ -43,7 +45,8 @@ public class ThemeInfoDtoFixture
Author: author ?? faker.Name.FullName(),
Version: version ?? faker.System.Semver(),
PreviewUrl: previewUrl ?? $"/theme-assets/{faker.Lorem.Word()}/preview.png",
IsBundled: isBundled ?? faker.Random.Bool()
IsBundled: isBundled ?? faker.Random.Bool(),
IsDeleted: isDeleted ?? faker.Random.Bool()
);
}
@@ -31,6 +31,7 @@ public class ThemeResponseDtoFixture
/// <param name="isCurrent">Optional value indicating whether the theme is the active one.</param>
/// <param name="includeIsCurrent">Whether to set <paramref name="isCurrent"/>, or <see langword="null"/> when <see langword="false"/>.</param>
/// <param name="installedAtUtc">Optional UTC timestamp at which the theme was installed.</param>
/// <param name="isDeleted">Optional value indicating whether the theme was deleted by the user.</param>
/// <returns>A configured <see cref="ThemeResponseDto"/> instance.</returns>
public ThemeResponseDto Create(
Guid? id = null,
@@ -44,7 +45,8 @@ public class ThemeResponseDtoFixture
ThemeInstallSource? installSource = null,
bool? isCurrent = null,
bool includeIsCurrent = false,
DateTime? installedAtUtc = null)
DateTime? installedAtUtc = null,
bool? isDeleted = null)
{
Faker faker = new();
return new ThemeResponseDto(
@@ -57,7 +59,8 @@ public class ThemeResponseDtoFixture
PreviewPath: includePreviewPath ? (previewPath ?? (faker.Random.Bool() ? faker.System.FilePath() : null)) : null,
InstallSource: installSource ?? ThemeInstallSource.Uploaded,
IsCurrent: includeIsCurrent ? (isCurrent ?? (faker.Random.Bool() ? true : null)) : null,
InstalledAtUtc: installedAtUtc ?? faker.Date.Recent()
InstalledAtUtc: installedAtUtc ?? faker.Date.Recent(),
IsDeleted: isDeleted ?? faker.Random.Bool()
);
}