Contactformulier-module, banners, thema's, taalbestanden en CI-herstructurering #15

Merged
Sluijsens merged 84 commits from feature/contact-forms-module into master 2026-11-16 11:51:12 +01:00
3 changed files with 19 additions and 0 deletions
Showing only changes of commit b39fc5b6ea - Show all commits
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using SlpModularCms.Core.Availability;
using SlpModularCms.Core.Email;
namespace SlpModularCms.Core.Hosting;
@@ -25,6 +27,8 @@ public class SystemController : ControllerBase
}
[HttpGet("capabilities")]
[AllowAnonymous]
[PublicSiteEndpoint]
public IActionResult GetCapabilities()
{
// EmailEnabled tells the UI whether mail actions exist on this site; DefaultLanguage is the
@@ -161,6 +161,7 @@ public class PublicSiteEndpointGateTests
$"{nameof(OfferingsController)}.{nameof(OfferingsController.GetOfferings)}",
$"{nameof(ContactMessagesController)}.{nameof(ContactMessagesController.GetToken)}",
$"{nameof(ContactMessagesController)}.{nameof(ContactMessagesController.Submit)}",
$"{nameof(SystemController)}.{nameof(SystemController.GetCapabilities)}",
];
private static IReadOnlyList<MethodInfo> AllActions() =>
@@ -315,4 +315,18 @@ public class ContactPipelineGateTests(EnabledContactHostFactory factory) : IClas
post.StatusCode.Should().Be(HttpStatusCode.Accepted);
(await factory.WithDb(db => db.ContactMessages.CountAsync(m => m.Name == "Pipeline Gate"))).Should().Be(1);
}
[Fact]
public async Task TheLoginPageRoutes_NeverAnswer503_WhileTheCmsIsDisabled()
{
await factory.WithDb(db => db.Database.ExecuteSqlRawAsync(
"INSERT INTO AvailabilityState (Id, Status, Message, LastUpdatedAt, UpdatedBy) VALUES (UUID(), 2, 'maintenance pipeline test', NOW(), 'pipeline test')"));
var client = factory.CreateClient();
// A guest on a disabled or maintenance CMS must still be able to read what the login page needs.
(await client.GetAsync("/api/v1/System/capabilities")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/Availability/status")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/offerings")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/contact-messages")).StatusCode.Should().Be(HttpStatusCode.ServiceUnavailable, "the management routes stay behind the gate");
}
}