Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add alt text to news page entries #1108

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions DragaliaAPI/DragaliaAPI.Database/DragaliaAPI.Database.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
<PrivateAssets>all</PrivateAssets>
Expand All @@ -14,14 +10,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" />
<PackageReference Include="Serilog" />
</ItemGroup>
Expand Down
19 changes: 13 additions & 6 deletions DragaliaAPI/DragaliaAPI.Database/Entities/DbNewsItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,22 @@ public class DbNewsItem
/// <summary>
/// Gets or sets a relative path to the summary header image.
/// </summary>
/// <remarks>
/// Will be combined with the configured CDN base address to deliver a fully qualified URL in the response.
/// </remarks>
public string? HeaderImagePath { get; set; }

/// <summary>
/// Gets or sets the alt text for the summary header image.
/// </summary>
public string? HeaderImageAltText { get; set; }

/// <summary>
/// Gets or sets a relative path to the body image.
/// </summary>
/// <remarks>
/// Will be combined with the configured CDN base address to deliver a fully qualified URL in the response.
/// </remarks>
public string? BodyImagePath { get; set; }

/// <summary>
/// Gets or sets the alt text for the body image.
/// </summary>
public string? BodyImageAltText { get; set; }
}

public class DbNewsItemConfiguration : IEntityTypeConfiguration<DbNewsItem>
Expand All @@ -60,7 +64,9 @@ public void Configure(EntityTypeBuilder<DbNewsItem> builder)
builder.Property(x => x.Headline).HasMaxLength(256);
builder.Property(x => x.Description).HasMaxLength(4096);
builder.Property(x => x.HeaderImagePath).HasMaxLength(512);
builder.Property(x => x.HeaderImageAltText).HasMaxLength(1024);
builder.Property(x => x.BodyImagePath).HasMaxLength(512);
builder.Property(x => x.BodyImageAltText).HasMaxLength(1024);

builder.HasData(
new DbNewsItem()
Expand All @@ -71,6 +77,7 @@ public void Configure(EntityTypeBuilder<DbNewsItem> builder)
Description =
"The below infographic shows the endeavour rewards available for the progressing the Mercurial Gauntlet.",
BodyImagePath = "/dawnshard/news/mg-endeavours.webp",
BodyImageAltText = "Mercurial Gauntlet rewards infographic",
Date = new DateTimeOffset(2024, 06, 02, 16, 07, 00, TimeSpan.FromHours(1)),
}
);
Expand Down
Loading
Loading