feat(api-docs): extract API docs viewer into standalone module

Move the Swagger UI viewer from core (pages/admin/api-docs/) into
modules/api-docs/ as a self-contained module. Create module manifest
with routes, permission, sidebar.admin_nav_item slot, asset group,
and authorization policy. Remove API docs ability from core
OperationsAuthorizationPolicy and UiCapabilityMap. Remove hardcoded
sidebar nav item — now contributed via module slot. Add
admin-automation group meta to sidebar template for module nav items.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-26 14:02:42 +01:00
parent 5c86c56dec
commit 02a7d2fe90
15 changed files with 142 additions and 25 deletions

View File

@@ -0,0 +1,16 @@
const container = document.getElementById('swagger-ui');
if (container && window.SwaggerUIBundle) {
window.SwaggerUIBundle({
url: container.dataset.specUrl || '',
dom_id: '#swagger-ui',
deepLinking: false,
displayRequestDuration: true,
filter: true,
docExpansion: 'list',
supportedSubmitMethods: [],
tryItOutEnabled: false,
presets: [window.SwaggerUIBundle.presets.apis],
layout: 'BaseLayout',
});
}