Update Flex endpoint

This commit is contained in:
github-action[bot]
2023-08-08 20:07:54 +00:00
parent 1d0ca16800
commit f80d138abd
4 changed files with 312 additions and 5 deletions
@@ -0,0 +1,70 @@
{
"manifests": {
"api-platform/admin-pack": {
"manifest": {
"copy-from-recipe": {
"assets/": "assets/",
"config/": "%CONFIG_DIR%/",
"templates/": "templates/"
},
"post-install-output": [
" * Your admin is almost ready:",
" 1. Install the JavaScript dependencies by running <comment>npm add @api-platform/admin @babel/preset-react</comment>",
" 2. Edit <comment>webpack.config.js</comment> and <info>uncomment</info> the following lines:",
"",
" Encore",
" // ...",
" .enableReactPreset()",
" .addEntry('admin', './assets/js/admin.js')",
"",
" * Mark entities you want in the admin with the <comment>@ApiResource</comment> annotation, it appears in the admin!",
"",
" * Using MakerBundle? Try <info>php bin/console make:entity --api-resource</info>"
]
},
"files": {
"assets/js/admin.js": {
"contents": [
"import React from 'react';",
"import ReactDOM from 'react-dom';",
"import { HydraAdmin } from '@api-platform/admin';",
"",
"const entrypoint = document.getElementById('api-entrypoint').innerText;",
"",
"ReactDOM.render(<HydraAdmin entrypoint={entrypoint}/>, document.getElementById('api-platform-admin'));",
""
],
"executable": false
},
"config/routes/api_platform_admin.yaml": {
"contents": [
"admin:",
" path: /admin",
" controller: Symfony\\Bundle\\FrameworkBundle\\Controller\\TemplateController",
" defaults:",
" template: admin.html.twig",
""
],
"executable": false
},
"templates/admin.html.twig": {
"contents": [
"{% extends 'base.html.twig' %}",
"",
"{% block title %}API Platform Admin{% endblock %}",
"",
"{% block body %}<div id=\"api-platform-admin\"></div>{% endblock %}",
"",
"{% block javascripts %}",
" <script type=\"text/plain\" id=\"api-entrypoint\">{{ path('api_entrypoint') }}</script>",
" {{ encore_entry_script_tags('admin') }}",
"{% endblock %}",
""
],
"executable": false
}
},
"ref": "b5a9213db0daaa3c3f2908de5f069ca812b08c4c"
}
}
}