diff --git a/config/reference.php b/config/reference.php index 28286634..8aca308e 100644 --- a/config/reference.php +++ b/config/reference.php @@ -767,6 +767,7 @@ * } * @psalm-type LiveComponentConfig = array{ * secret?: scalar|Param|null, // The secret used to compute fingerprints and checksums // Default: "%kernel.secret%" + * fetch_credentials?: "same-origin"|"include"|"omit"|Param, // The default fetch credentials mode for all Live Components ('same-origin', 'include', 'omit') // Default: "same-origin" * } * @psalm-type StimulusConfig = array{ * controller_paths?: list, @@ -1474,6 +1475,9 @@ * path?: scalar|Param|null, // The local icon set directory path. (cannot be used with 'alias') * alias?: scalar|Param|null, // The remote icon set identifier. (cannot be used with 'path') * icon_attributes?: array, + * suffixes?: array, + * }>, * }>, * aliases?: array, * iconify?: bool|array{ // Configuration for the remote icon service. diff --git a/config/routes.yaml b/config/routes.yaml index bb6939d7..9790f123 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -3,3 +3,27 @@ index: controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController defaults: template: base.html.twig + +basic_create: + path: /basic/create + controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController + defaults: + template: basic/create.html.twig + +basic_update: + path: /basic/update + controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController + defaults: + template: basic/update.html.twig + +basic_index: + path: /basic/index + controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController + defaults: + template: basic/index.html.twig + +basic_show: + path: /basic/show + controller: Symfony\Bundle\FrameworkBundle\Controller\TemplateController + defaults: + template: basic/show.html.twig diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig index 2b838019..dacf3d35 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/form.html.twig @@ -1,25 +1,27 @@ {% if form is not defined %} - {% set form = hookable_metadata.context.form %} + {% set form = hookable_metadata.context.form|default(null) %} {% endif %} {% if resource is not defined %} {% set resource = hookable_metadata.context.resource|default(null) %} {% endif %} -{% form_theme form '@SyliusBootstrapAdminUi/shared/form_theme.html.twig' %} +{% if form is not null %} + {% form_theme form '@SyliusBootstrapAdminUi/shared/form_theme.html.twig' %} -
- {{ form_start(form, {'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }} -
- {% if hookable_metadata.configuration.method is defined %} - - {% elseif form.vars.data.id|default(null) is not null %} - - {% endif %} - {{ form_errors(form) }} - {{ form_widget(form._token) }} +
+ {{ form_start(form, {'attr': {'novalidate': 'novalidate', 'id': form.vars.id}}) }} +
+ {% if hookable_metadata.configuration.method is defined %} + + {% elseif form.vars.data.id|default(null) is not null %} + + {% endif %} + {{ form_errors(form) }} + {{ form_widget(form._token) }} - {% hook 'form' with { form, resource } %} + {% hook 'form' with { form, resource } %} +
+ {{ form_end(form, {render_rest: hookable_metadata.configuration.render_rest|default(false)}) }}
- {{ form_end(form, {render_rest: hookable_metadata.configuration.render_rest|default(false)}) }} -
+{% endif %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions.html.twig index 55432949..e49782dc 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions.html.twig @@ -1,4 +1,4 @@ -{% set resources = hookable_metadata.context.resources %} +{% set resources = hookable_metadata.context.resources|default(null) %}
diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/cancel.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/cancel.html.twig index 0e212628..1edf9d70 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/cancel.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/cancel.html.twig @@ -1,10 +1,12 @@ {% import '@SyliusBootstrapAdminUi/shared/helper/button.html.twig' as button %} -{% set configuration = hookable_metadata.context.configuration %} +{% set configuration = hookable_metadata.context.configuration|default(null) %} -{% set index_url = sylius_generate_redirect_path(app.request.headers.get('referer')|default(path( - configuration.vars.index.route.name|default(configuration.getRouteName('index')), - configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) -))) %} +{% if app.request.headers.has('referer') or configuration is not null %} + {% set index_url = sylius_generate_redirect_path(app.request.headers.get('referer')|default(path( + configuration.vars.index.route.name|default(configuration.getRouteName('index')), + configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) + ))) %} -{{ button.cancel(sylius_test_form_attribute('cancel-changes-button')|merge({ text: 'sylius.ui.cancel'|trans, url: index_url, class: 'btn' })) }} + {{ button.cancel(sylius_test_form_attribute('cancel-changes-button')|merge({ text: 'sylius.ui.cancel'|trans, url: index_url, class: 'btn' })) }} +{% endif %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/create.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/create.html.twig index 9efbf212..2667e5fe 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/create.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/create.html.twig @@ -1,5 +1,5 @@ {% import '@SyliusBootstrapAdminUi/shared/helper/button.html.twig' as button %} -{% set form = hookable_metadata.context.form %} +{% set form = hookable_metadata.context.form|default(null) %} -{{ button.primary({ text: 'sylius.ui.create'|trans, type: 'submit', form: form.vars.id }) }} +{{ button.primary({ text: 'sylius.ui.create'|trans, type: 'submit', form: form.vars.id|default(null) }) }} diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/update.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/update.html.twig index 4d7a81e1..489d7d3e 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/update.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/actions/update.html.twig @@ -4,6 +4,6 @@ sylius_test_form_attribute('update-changes-button')|merge({ text: 'sylius.ui.update'|trans, type: 'submit', - form: hookable_metadata.context.form.vars.id + form: hookable_metadata.context.form.vars.id|default(null) }) ) }} diff --git a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/title.html.twig b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/title.html.twig index 32e7d92a..be302753 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/title.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/common/content/header/title_block/title.html.twig @@ -4,7 +4,7 @@ {% set metadata = hookable_metadata.context.metadata %} {% set header = hookable_metadata.configuration.title|default(metadata.applicationName~'.ui.'~metadata.pluralName) %} {% else %} - {% set header = hookable_metadata.configuration.title %} + {% set header = hookable_metadata.configuration.title|default(null) %} {% endif %} {% set icon = hookable_metadata.configuration.icon|default(null) %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/create/content/header/breadcrumbs.html.twig b/src/BootstrapAdminUi/templates/shared/crud/create/content/header/breadcrumbs.html.twig index 22dbe025..0a198fa1 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/create/content/header/breadcrumbs.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/create/content/header/breadcrumbs.html.twig @@ -4,18 +4,27 @@ {% set metadata = hookable_metadata.context.metadata %} {% set resource_name = hookable_metadata.configuration.resource_name|default(metadata.applicationName~'.ui.'~metadata.pluralName) %} {% else %} - {% set resource_name = hookable_metadata.configuration.resource_name %} + {% set resource_name = hookable_metadata.configuration.resource_name|default(null) %} {% endif %} -{% set configuration = hookable_metadata.context.configuration %} -{% set index_url = path( - configuration.vars.index.route.name|default(configuration.getRouteName('index')), - configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) -) -%} +{% set configuration = hookable_metadata.context.configuration|default(null) %} -{{ breadcrumbs([ - { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, - { name: resource_name, url: index_url, active: false }, - { name: 'sylius.ui.new'|trans, active: true} -]) }} +{% if configuration is not null %} + {% set index_url = path( + configuration.vars.index.route.name|default(configuration.getRouteName('index')), + configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) + ) %} +{% endif %} + +{% if index_url is defined and resource_name is not null %} + {{ breadcrumbs([ + { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, + { name: resource_name, url: index_url, active: false }, + { name: 'sylius.ui.new'|trans, active: true} + ]) }} +{% else %} + {{ breadcrumbs([ + { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, + { name: 'sylius.ui.new'|trans, active: true} + ]) }} +{% endif %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/create/content/header/title_block/title.html.twig b/src/BootstrapAdminUi/templates/shared/crud/create/content/header/title_block/title.html.twig index 11556bd1..6693dace 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/create/content/header/title_block/title.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/create/content/header/title_block/title.html.twig @@ -7,8 +7,8 @@ {% set singular_name = hookable_metadata.configuration.resource_name|default(metadata.applicationName ~ '.ui.' ~ _context.metadata.name) %} {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header|default(null)) %} {% else %} - {% set singular_name = hookable_metadata.configuration.resource_name %} - {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header) %} + {% set singular_name = hookable_metadata.configuration.resource_name|default(null) %} + {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header|default(null)) %} {% endif %} {% set icon = hookable_metadata.configuration.icon|default(null) %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/filters.html.twig b/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/filters.html.twig index 079bdb90..3619f3e4 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/filters.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/filters.html.twig @@ -1,7 +1,7 @@ {% from "@SyliusBootstrapAdminUi/shared/helper/accordion.html.twig" import accordion %} {% import "@SyliusBootstrapAdminUi/shared/helper/button.html.twig" as button %} -{% set resources = hookable_metadata.context.resources %} +{% set resources = resources|default(hookable_metadata.context.resources|default(null)) %} {% set path = path(app.request.attributes.get('_route'), app.request.attributes.all('_route_params')) %} {% set are_criteria_set = app.request.query.has('criteria') %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/no_results.html.twig b/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/no_results.html.twig index d8b77b8b..ad0625d3 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/no_results.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/index/content/grid/no_results.html.twig @@ -1,4 +1,4 @@ -{% set resources = hookable_metadata.context.resources %} +{% set resources = resources|default(hookable_metadata.context.resources|default(null)) %} {% if resources.data is defined and resources.data|length == 0 %}
diff --git a/src/BootstrapAdminUi/templates/shared/crud/index/content/header/breadcrumbs.html.twig b/src/BootstrapAdminUi/templates/shared/crud/index/content/header/breadcrumbs.html.twig index b6501cdd..a3e0f509 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/index/content/header/breadcrumbs.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/index/content/header/breadcrumbs.html.twig @@ -6,10 +6,10 @@ {% if title_from_context is not null or resource_metadata is not null %} {% set title = title_from_context|default(resource_metadata.applicationName~'.ui.'~resource_metadata.pluralName) %} {% else %} - {% set title = hookable_metadata.configuration.title|default('') %} + {% set title = hookable_metadata.configuration.title|default(null) %} {% endif %} {{ breadcrumbs([ { 'name': 'sylius.ui.dashboard', 'url': path('sylius_admin_ui_dashboard'), 'active': false }, - { 'name': title, 'active': true }, + { 'name': title|default('sylius.ui.index'|trans), 'active': true }, ]) }} diff --git a/src/BootstrapAdminUi/templates/shared/crud/show/content/header/breadcrumbs.html.twig b/src/BootstrapAdminUi/templates/shared/crud/show/content/header/breadcrumbs.html.twig index ab88f6db..a2a68356 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/show/content/header/breadcrumbs.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/show/content/header/breadcrumbs.html.twig @@ -1,15 +1,18 @@ {% from '@SyliusBootstrapAdminUi/shared/helper/breadcrumbs.html.twig' import breadcrumbs %} -{% set configuration = hookable_metadata.context.configuration %} -{% set resource = hookable_metadata.context.resource %} -{% set metadata = hookable_metadata.context.metadata %} +{% set configuration = hookable_metadata.context.configuration|default(null) %} +{% set resource = hookable_metadata.context.resource|default(null) %} +{% set metadata = hookable_metadata.context.metadata|default(null) %} -{% set resource_index = metadata.applicationName~'.ui.'~metadata.pluralName %} -{% set index_url = path( - configuration.vars.index.route.name|default(configuration.getRouteName('index')), - configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) -) %} +{% if configuration and metadata %} + {% set resource_index = metadata.applicationName~'.ui.'~metadata.pluralName %} + {% set index_url = path( + configuration.vars.index.route.name|default(configuration.getRouteName('index')), + configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) + ) %} +{% endif %} +{% set title = hookable_metadata.configuration.title|default(null) %} {% set rendered_field_prefix = hookable_metadata.configuration.rendered_field_prefix|default(null) %} {% set field_name = hookable_metadata.configuration.rendered_field|default('') %} {% set rendered_field = rendered_field_prefix ~ (attribute(resource, field_name) is defined ? attribute(resource, field_name) : null) %} @@ -19,18 +22,26 @@ : {} %} -{% set resource_show_name = rendered_field|default(resource.translations[app.locale].name|default(resource.code|default(resource.id))) %} +{% set resource_show_name = title|default(rendered_field|default(resource.translations[app.locale].name|default(resource.code|default(resource.id|default(null))))) %} {% if action is defined and action.name is defined %} {% set show_url = path(configuration.getRouteName('show'), { id: resource.id }) %} {% set resource_show = { name: resource_show_name, url: show_url} %} {% else %} - {% set resource_show = { name: resource_show_name, active: true} %} + {% set resource_show = { name: resource_show_name|default('sylius.ui.show'|trans), active: true} %} {% endif %} -{{ breadcrumbs([ - { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, - { name: resource_index, url: index_url, active: false }, - resource_show, - action -]) }} +{% if resource_index is defined and index_url is defined %} + {{ breadcrumbs([ + { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, + { name: resource_index, url: index_url, active: false }, + resource_show, + action + ]) }} +{% else %} + {{ breadcrumbs([ + { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, + resource_show, + action + ]) }} +{% endif %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/show/content/header/title_block/title.html.twig b/src/BootstrapAdminUi/templates/shared/crud/show/content/header/title_block/title.html.twig index f4bdb389..bba57c86 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/show/content/header/title_block/title.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/show/content/header/title_block/title.html.twig @@ -7,8 +7,8 @@ {% set singular_name = hookable_metadata.configuration.resource_name|default(metadata.applicationName ~ '.ui.' ~ _context.metadata.name) %} {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header|default(null)) %} {% else %} - {% set singular_name = hookable_metadata.configuration.resource_name %} - {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header) %} + {% set singular_name = hookable_metadata.configuration.resource_name|default(null) %} + {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header|default(null)) %} {% endif %} {% set icon = hookable_metadata.configuration.icon|default(null) %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/update/content/header/breadcrumbs.html.twig b/src/BootstrapAdminUi/templates/shared/crud/update/content/header/breadcrumbs.html.twig index caf3b769..3aa145d3 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/update/content/header/breadcrumbs.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/update/content/header/breadcrumbs.html.twig @@ -1,32 +1,41 @@ {% from '@SyliusBootstrapAdminUi/shared/helper/breadcrumbs.html.twig' import breadcrumbs %} -{% set configuration = hookable_metadata.context.configuration %} -{% set resource = hookable_metadata.context.resource %} -{% set metadata = hookable_metadata.context.metadata %} +{% set configuration = hookable_metadata.context.configuration|default(null) %} +{% set resource = hookable_metadata.context.resource|default(null) %} +{% set metadata = hookable_metadata.context.metadata|default(null) %} -{% set resource_index = metadata.applicationName~'.ui.'~metadata.pluralName %} -{% set index_url = path( - configuration.vars.index.route.name|default(configuration.getRouteName('index')), - configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) -) %} +{% if metadata is not null and configuration is not null %} + {% set resource_index = metadata.applicationName~'.ui.'~metadata.pluralName %} + {% set index_url = path( +configuration.vars.index.route.name|default(configuration.getRouteName('index')), +configuration.vars.index.route.parameters|default(configuration.vars.route.parameters|default({})) + ) %} +{% endif %} {% set rendered_field_prefix = hookable_metadata.configuration.rendered_field_prefix|default(null) %} {% set field_name = hookable_metadata.configuration.rendered_field|default('') %} {% set rendered_field = rendered_field_prefix ~ (attribute(resource, field_name) is defined ? attribute(resource, field_name) : null) %} -{% set resource_edit_name = rendered_field|default(resource.translations[app.locale].name|default(resource.code|default(resource.id))) %} -{% set show_route_name = configuration.vars.index.route.name|default(configuration.getRouteName('show')) %} +{% set resource_edit_name = rendered_field|default(resource.translations[app.locale].name|default(resource.code|default(resource.id|default(null)))) %} +{% set show_route_name = configuration.vars.index.route.name|default(configuration.getRouteName('show')|default(null)) %} -{% if sylius_route_exists(show_route_name) %} +{% if show_route_name is not null and sylius_route_exists(show_route_name) %} {% set show_url = path(show_route_name, { id: resource.id }) %} {% set resource_edit = { name: resource_edit_name, url: show_url} %} {% else %} {% set resource_edit = { name: resource_edit_name, active: true} %} {% endif %} -{{ breadcrumbs([ - { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, - { name: resource_index, url: index_url, active: false }, - resource_edit, - { name: 'sylius.ui.edit'|trans, active: false } -]) }} +{% if resource_index is defined %} + {{ breadcrumbs([ + { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, + { name: resource_index, url: index_url, active: false }, + resource_edit, + { name: 'sylius.ui.edit'|trans, active: false } + ]) }} +{% else %} + {{ breadcrumbs([ + { name: 'sylius.ui.dashboard', url: path('sylius_admin_ui_dashboard'), active: false }, + { name: 'sylius.ui.edit'|trans, active: false } + ]) }} +{% endif %} diff --git a/src/BootstrapAdminUi/templates/shared/crud/update/content/header/title_block/title.html.twig b/src/BootstrapAdminUi/templates/shared/crud/update/content/header/title_block/title.html.twig index 1f61fb14..1a34653f 100644 --- a/src/BootstrapAdminUi/templates/shared/crud/update/content/header/title_block/title.html.twig +++ b/src/BootstrapAdminUi/templates/shared/crud/update/content/header/title_block/title.html.twig @@ -7,8 +7,8 @@ {% set singular_name = hookable_metadata.configuration.resource_name|default(metadata.applicationName ~ '.ui.' ~ _context.metadata.name) %} {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header|default(null)) %} {% else %} - {% set singular_name = hookable_metadata.configuration.resource_name %} - {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header) %} + {% set singular_name = hookable_metadata.configuration.resource_name|default(null) %} + {% set header = hookable_metadata.configuration.title|default(hookable_metadata.configuration.header|default(null)) %} {% endif %} {% set icon = hookable_metadata.configuration.icon|default(null) %} diff --git a/src/UiTranslations/translations/messages.en.yaml b/src/UiTranslations/translations/messages.en.yaml index 5bf9ddee..b8deeff5 100644 --- a/src/UiTranslations/translations/messages.en.yaml +++ b/src/UiTranslations/translations/messages.en.yaml @@ -30,6 +30,7 @@ sylius: from: From hello: Hello in: 'In' + index: 'Index' info: Info license: 'License' login: Login diff --git a/src/UiTranslations/translations/messages.fr.yaml b/src/UiTranslations/translations/messages.fr.yaml index 88743bea..2a7477b6 100644 --- a/src/UiTranslations/translations/messages.fr.yaml +++ b/src/UiTranslations/translations/messages.fr.yaml @@ -30,6 +30,7 @@ sylius: from: 'De' hello: 'Bonjour' in: 'Dans' + index: 'Index' info: 'Info' license: Licence login: 'Connexion' diff --git a/templates/basic/create.html.twig b/templates/basic/create.html.twig new file mode 100644 index 00000000..76c3d34f --- /dev/null +++ b/templates/basic/create.html.twig @@ -0,0 +1,5 @@ +{% extends '@SyliusAdminUi/base.html.twig' %} + +{% block body %} + {% hook ['sylius_admin.common.create'] %} +{% endblock %} diff --git a/templates/basic/index.html.twig b/templates/basic/index.html.twig new file mode 100644 index 00000000..65ab5de4 --- /dev/null +++ b/templates/basic/index.html.twig @@ -0,0 +1,5 @@ +{% extends '@SyliusAdminUi/base.html.twig' %} + +{% block body %} + {% hook ['sylius_admin.common.index'] %} +{% endblock %} diff --git a/templates/basic/show.html.twig b/templates/basic/show.html.twig new file mode 100644 index 00000000..3c75ce74 --- /dev/null +++ b/templates/basic/show.html.twig @@ -0,0 +1,5 @@ +{% extends '@SyliusAdminUi/base.html.twig' %} + +{% block body %} + {% hook ['sylius_admin.common.show'] %} +{% endblock %} diff --git a/templates/basic/update.html.twig b/templates/basic/update.html.twig new file mode 100644 index 00000000..e7b813f9 --- /dev/null +++ b/templates/basic/update.html.twig @@ -0,0 +1,5 @@ +{% extends '@SyliusAdminUi/base.html.twig' %} + +{% block body %} + {% hook ['sylius_admin.common.update'] %} +{% endblock %} diff --git a/tests/Functional/BasicRouteTests.php b/tests/Functional/BasicRouteTests.php new file mode 100644 index 00000000..0ba79937 --- /dev/null +++ b/tests/Functional/BasicRouteTests.php @@ -0,0 +1,48 @@ +client = self::createClient(); + } + + public function testCreate(): void + { + $this->client->request('GET', '/basic/create'); + + $this->assertResponseIsSuccessful(); + } + + public function testUpdate(): void + { + $this->client->request('GET', '/basic/update'); + + $this->assertResponseIsSuccessful(); + } + + public function testIndex(): void + { + $this->client->request('GET', '/basic/index'); + + $this->assertResponseIsSuccessful(); + } + + public function testShow(): void + { + $this->client->request('GET', '/basic/show'); + + $this->assertResponseIsSuccessful(); + } +}