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:
16
modules/api-docs/web/js/pages/admin-api-docs-index.js
Normal file
16
modules/api-docs/web/js/pages/admin-api-docs-index.js
Normal 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',
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user