diff --git a/Kiss.Bff/Config/AuthenticationSetup.cs b/Kiss.Bff/Config/AuthenticationSetup.cs index cba39be49..7d1473593 100644 --- a/Kiss.Bff/Config/AuthenticationSetup.cs +++ b/Kiss.Bff/Config/AuthenticationSetup.cs @@ -116,7 +116,11 @@ public static IServiceCollection AddKissAuth(this IServiceCollection services, A options.ExpireTimeSpan = TimeSpan.FromMinutes(60); options.SlidingExpiration = true; //options.Events.OnSigningOut = (e) => e.HttpContext.RevokeRefreshTokenAsync(); - options.Events.OnRedirectToAccessDenied = HandleLoggedOut; + options.Events.OnRedirectToAccessDenied = (ctx) => + { + ctx.Response.StatusCode = StatusCodes.Status403Forbidden; + return Task.CompletedTask; + }; options.Events.OnRedirectToLogin = HandleLoggedOut; }); diff --git a/Kiss.Bff/Extern/Vacs/PostVacsCustomProxy.cs b/Kiss.Bff/Extern/Vacs/PostVacsCustomProxy.cs new file mode 100644 index 000000000..94cbc81ea --- /dev/null +++ b/Kiss.Bff/Extern/Vacs/PostVacsCustomProxy.cs @@ -0,0 +1,39 @@ +using System.Text.Json.Nodes; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; + +namespace Kiss.Bff.Vacs +{ + [ApiController] + public class PostVacsCustomProxy : ControllerBase + { + private readonly VacsProxyConfig _config; + + public PostVacsCustomProxy(VacsProxyConfig config) + { + _config = config; + } + + [HttpPost] + [Authorize(Policy = Policies.RedactiePolicy)] + [Route("api/vacs/api/{version}/objects")] + public IActionResult Post([FromRoute] string version, [FromBody] JsonObject node) + { + node["type"] = _config.ObjectTypeUrl; + + if (node.TryGetPropertyValue("record", out var record) && record is JsonObject recordObj) + { + recordObj["typeVersion"] = _config.TypeVersion; + } + + var url = $"{_config.Destination.TrimEnd('/')}/api/{version}/objects"; + + return new ProxyResult(() => + { + var request = new HttpRequestMessage(HttpMethod.Post, url) { Content = JsonContent.Create(node) }; + _config.ApplyHeaders(request.Headers); + return request; + }); + } + } +} diff --git a/Kiss.Bff/Extern/Vacs/VacsProxyConfig.cs b/Kiss.Bff/Extern/Vacs/VacsProxyConfig.cs index 35912c0b0..851bd8593 100644 --- a/Kiss.Bff/Extern/Vacs/VacsProxyConfig.cs +++ b/Kiss.Bff/Extern/Vacs/VacsProxyConfig.cs @@ -8,13 +8,14 @@ public static class VacsExtensions { public static IServiceCollection AddVacsProxy(this IServiceCollection services, string destination, string token, string objectTypeUrl, string typeVersion) { - return services.AddSingleton(s => + return services.AddSingleton(s => { var authorizationService = s.GetRequiredService(); var policyProvider = s.GetRequiredService(); return new VacsProxyConfig(destination, token, objectTypeUrl, typeVersion, authorizationService, policyProvider); - }); + }) + .AddSingleton(s => s.GetRequiredService()); } } diff --git a/src/components/ckeditor/CkEditorAsync.vue b/src/components/ckeditor/CkEditorAsync.vue index be181d00d..ff5194294 100644 --- a/src/components/ckeditor/CkEditorAsync.vue +++ b/src/components/ckeditor/CkEditorAsync.vue @@ -37,7 +37,12 @@ const config: EditorConfig = { "blockQuote", "undo", "redo", + "insertTable", ], + table: { + defaultHeadings: { rows: 1 }, + contentToolbar: ["tableColumn", "tableRow"], + }, }; diff --git a/src/components/ckeditor/ckeditor-exports.ts b/src/components/ckeditor/ckeditor-exports.ts index 35294f25c..ad9c3ab9c 100644 --- a/src/components/ckeditor/ckeditor-exports.ts +++ b/src/components/ckeditor/ckeditor-exports.ts @@ -19,6 +19,8 @@ export { Link, List, Paragraph, + Table, + TableToolbar, type EditorConfig, } from "ckeditor5"; diff --git a/src/features/search/types.ts b/src/features/search/types.ts index e5b0c9483..8bdcc9648 100644 --- a/src/features/search/types.ts +++ b/src/features/search/types.ts @@ -42,7 +42,11 @@ export type Vac = { uuid?: string; vraag: string; antwoord: string; + toelichting?: string; afdelingen?: VacAfdeling[]; + trefwoorden?: { trefwoord: string }[]; + status?: string; + doelgroep?: string; }; export type Nieuwsbericht = { diff --git a/src/views/Beheer/vacs/VacBeheer.vue b/src/views/Beheer/vacs/VacBeheer.vue index 1610b729f..c1ec9db8b 100644 --- a/src/views/Beheer/vacs/VacBeheer.vue +++ b/src/views/Beheer/vacs/VacBeheer.vue @@ -1,20 +1,243 @@ + + diff --git a/src/views/Beheer/vacs/VacsBeheer.vue b/src/views/Beheer/vacs/VacsBeheer.vue index 80aeae7e1..b258210c9 100644 --- a/src/views/Beheer/vacs/VacsBeheer.vue +++ b/src/views/Beheer/vacs/VacsBeheer.vue @@ -1,9 +1,20 @@