Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"nowo-tech/form-kit-bundle": "^2.10",
"nowo-tech/transaction-contract": "^1.0",
"nowo-tech/transaction-doctrine": "^1.8.1",
"nowo-tech/ui-kit-bundle": "^2.2",
"nowo-tech/ui-kit-bundle": "^2.21",
"psr/clock": "^1.0",
"psr/event-dispatcher": "^1.0",
"psr/log": "^1 || ^2 || ^3",
Expand Down
5 changes: 3 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- `web_ui.header_actions` (`toolbar` default, `split`): `split` renders the list header through the UiKit split header (Export and Purge in the square more menu, Purge last, confirmation kept). The actions stay `page.header.actions`, so a host with the UiKit compact header (`compact_actions: bar`) takes them into its top bar. Default output unchanged.
- `web_ui.filter_actions` (`scaffold` default, `filter_bar`): `filter_bar` renders the filters as a UiKit `.nowo-ui-filter-bar` with the `_filter_actions` partial (Filter + Clear, Clear always shown).
- New translation keys `filter.any_method`, `filter.any_body_type`, `filter.any_channel`, `filter.client_ip_placeholder` (all 7 locales).

### Changed

- The method, body type and channel selects now offer a named empty option (Any method, ...) and the client IP field has a placeholder, so no filter field is an unlabelled box. Requires `nowo-tech/ui-kit-bundle` ^2.21.
- The method, body type and channel placeholders are `TranslatableMessage`s in the bundle domain: the choice placeholder is no longer left untranslated by `choice_translation_domain: false`.

## [1.24.0] - 2026-11-21

### Added
Expand Down
15 changes: 15 additions & 0 deletions docs/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,21 @@ nowo_http_log:
access_checker: App\Security\MyHttpLogAccessChecker
```

### Header actions and filter actions (1.25, opt-in)

```yaml
nowo_http_log:
web_ui:
header_actions: split # toolbar (default) | split
filter_actions: filter_bar # scaffold (default) | filter_bar
```

- `split`: UiKit split header (needs UiKit >= 2.21): Export and *Purge old entries* go in the square more menu, Purge last, with its confirmation dialog.
- The header actions are always `page.header.actions` (`View\Action`, Purge last, with its confirmation). With the UiKit compact header and `compact_actions: bar` the host takes them into its top bar and the page header leaves them out; the bundle renders no menu of its own.
- `filter_bar`: the filters render as a UiKit filter bar and Filter + Clear come from `_filter_actions` (Clear is always shown). A host `web_ui.templates.filter` partial is not used in this mode.

The method, body type and channel selects show a named empty option (*Any method*, *Any body type*, *Any channel*) and every field keeps its label.

## Twig template overrides

Since **1.8** the admin pages follow the UiKit 2.1 page contract (REQ-UI-003): `admin/index.html.twig` extends the
Expand Down
22 changes: 15 additions & 7 deletions src/Controller/HttpLogAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,25 +139,33 @@ public function index(Request $request): Response
}
}

$pages = $this->pages();
$purgeForm = $this->createForm(HttpLogPurgeType::class, null, [
'action' => $this->generateUrl('nowo_http_log_admin_purge'),
])->createView();
$canExport = $this->canExport();
$canPurge = $this->canPurge();
$downloads = $canExport ? $this->readyExports() : [];

return $this->render($this->template('index'), [
'page' => $this->pages()->listPage(
'page' => $pages->listPage(
$result['items'],
$result['total'],
$page,
$this->pageSize,
$filterForm->createView(),
$exportForms,
$this->createForm(HttpLogPurgeType::class, null, [
'action' => $this->generateUrl('nowo_http_log_admin_purge'),
])->createView(),
$purgeForm,
$criteria !== [],
$this->canExport(),
$this->canPurge(),
$this->canExport() ? $this->readyExports() : [],
$canExport,
$canPurge,
$downloads,
$result['total_capped'],
$result['cursor'],
),
'criteria' => $criteria,
// 1.25: web_ui.filter_actions
'filter_actions' => $pages->filterActionsMode(),
]);
}

Expand Down
11 changes: 11 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use Nowo\HttpLogBundle\Enum\ExportFormat;
use Nowo\HttpLogBundle\Inbound\HttpRequestContextFactory;
use Nowo\HttpLogBundle\View\AdminChrome;
use Nowo\HttpLogBundle\View\AdminPages;
use Nowo\TransactionDoctrine\Symfony\Conflict\ConflictResponsePolicy;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
Expand Down Expand Up @@ -358,6 +359,16 @@ public function getConfigTreeBuilder(): TreeBuilder
->setDeprecated(self::PACKAGE, '1.8', 'The "%path%.%node%" option is deprecated and has no effect: the admin layout loads nowo-ui.css.')
->defaultTrue()
->end()
->enumNode('header_actions')
->info('1.25: how the list page presents its header actions (export, download, purge; always `page.header.actions`, Purge last with its confirmation). toolbar (default, the 1.24 output): one button per action in the page header. split: UiKit split header (needs nowo-tech/ui-kit-bundle >= 2.21) - the actions go in the square "more" menu. With the UiKit compact header and compact_actions `bar` the host takes `page.header.actions` into its top bar and the page header leaves them out; the bundle renders no menu of its own.')
->values([AdminPages::HEADER_ACTIONS_TOOLBAR, AdminPages::HEADER_ACTIONS_SPLIT])
->defaultValue(AdminPages::HEADER_ACTIONS_TOOLBAR)
->end()
->enumNode('filter_actions')
->info('1.25: scaffold (default, the 1.24 output): the filter row of the UiKit list scaffold. filter_bar: the filters render as a UiKit `.nowo-ui-filter-bar` whose Filter + Clear buttons come from the UiKit `_filter_actions` partial (Clear is always shown). A host that sets web_ui.templates.filter keeps the scaffold row.')
->values([AdminPages::FILTER_ACTIONS_SCAFFOLD, AdminPages::FILTER_ACTIONS_FILTER_BAR])
->defaultValue(AdminPages::FILTER_ACTIONS_SCAFFOLD)
->end()
->booleanNode('header_actions_in_layout')
->info('Deprecated, no effect: header actions are part of the page header the layout renders (nowo_ui_page_header).')
->setDeprecated(self::PACKAGE, '1.8', 'The "%path%.%node%" option is deprecated and has no effect: header actions render in the page header (nowo_ui_page_header block).')
Expand Down
9 changes: 5 additions & 4 deletions src/Form/HttpLogFilterType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Translation\TranslatableMessage;

/**
* @extends AbstractType<array<string, mixed>>
Expand All @@ -29,7 +30,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
$this->addChoiceField('method', [
'required' => false,
'label' => 'filter.method',
'placeholder' => 'filter.any',
'placeholder' => new TranslatableMessage('filter.any_method', [], 'NowoHttpLogBundle'),
// HTTP methods are literals: not looked up in the bundle domain (REQ: no profiler missing messages).
'choice_translation_domain' => false,
'choices' => [
Expand All @@ -43,13 +44,13 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
],
]);
$this->addIntegerField('statusCode', ['required' => false, 'label' => 'filter.status_code', 'attr' => ['min' => 100, 'max' => 599, 'placeholder' => 'filter.status_code_placeholder']]);
$this->addTextField('clientIp', ['required' => false, 'label' => 'filter.client_ip']);
$this->addTextField('clientIp', ['required' => false, 'label' => 'filter.client_ip', 'attr' => ['placeholder' => 'filter.client_ip_placeholder']]);
$this->addTextField('path', ['required' => false, 'label' => 'filter.path', 'attr' => ['placeholder' => 'filter.path_placeholder']]);
$this->addTextField('routeName', ['required' => false, 'label' => 'filter.route_name', 'attr' => ['placeholder' => 'filter.route_name_placeholder']]);
$this->addChoiceField('bodyContentType', [
'required' => false,
'label' => 'filter.body_content_type',
'placeholder' => 'filter.any',
'placeholder' => new TranslatableMessage('filter.any_body_type', [], 'NowoHttpLogBundle'),
// Body types are enum values (json, xml…), not translation keys.
'choice_translation_domain' => false,
'choices' => array_combine(
Expand Down Expand Up @@ -87,7 +88,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
$this->addChoiceField('channel', [
'required' => false,
'label' => 'filter.channel',
'placeholder' => 'filter.any',
'placeholder' => new TranslatableMessage('filter.any_channel', [], 'NowoHttpLogBundle'),
// Channel names are literals (web, outbound, mailer), not translation keys.
'choice_translation_domain' => false,
'choices' => array_combine($channels, $channels),
Expand Down
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.de.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Anbieter'
filter.tenant_key: 'Mandant'
filter.project_key: 'Projekt'
filter.credential_kind: 'Art der Zugangsdaten'
filter.any_method: 'Jede Methode'
filter.any_body_type: 'Jeder Body-Typ'
filter.any_channel: 'Jeder Kanal'
filter.client_ip_placeholder: '203.0.113.7'
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Provider'
filter.tenant_key: 'Tenant'
filter.project_key: 'Project'
filter.credential_kind: 'Credential kind'
filter.any_method: 'Any method'
filter.any_body_type: 'Any body type'
filter.any_channel: 'Any channel'
filter.client_ip_placeholder: '203.0.113.7'
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.es.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Proveedor'
filter.tenant_key: 'Organización'
filter.project_key: 'Proyecto'
filter.credential_kind: 'Tipo de credencial'
filter.any_method: 'Cualquier método'
filter.any_body_type: 'Cualquier tipo de cuerpo'
filter.any_channel: 'Cualquier canal'
filter.client_ip_placeholder: '203.0.113.7'
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.fr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Fournisseur'
filter.tenant_key: 'Organisation'
filter.project_key: 'Projet'
filter.credential_kind: 'Type d''identifiant'
filter.any_method: 'Toutes les méthodes'
filter.any_body_type: 'Tous les types de corps'
filter.any_channel: 'Tous les canaux'
filter.client_ip_placeholder: '203.0.113.7'
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.it.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Fornitore'
filter.tenant_key: 'Organizzazione'
filter.project_key: 'Progetto'
filter.credential_kind: 'Tipo di credenziale'
filter.any_method: 'Qualsiasi metodo'
filter.any_body_type: 'Qualsiasi tipo di corpo'
filter.any_channel: 'Qualsiasi canale'
filter.client_ip_placeholder: '203.0.113.7'
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.nl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Aanbieder'
filter.tenant_key: 'Organisatie'
filter.project_key: 'Project'
filter.credential_kind: 'Soort referentie'
filter.any_method: 'Elke methode'
filter.any_body_type: 'Elk body-type'
filter.any_channel: 'Elk kanaal'
filter.client_ip_placeholder: '203.0.113.7'
4 changes: 4 additions & 0 deletions src/Resources/translations/NowoHttpLogBundle.pt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ filter.provider: 'Fornecedor'
filter.tenant_key: 'Organização'
filter.project_key: 'Projeto'
filter.credential_kind: 'Tipo de credencial'
filter.any_method: 'Qualquer método'
filter.any_body_type: 'Qualquer tipo de corpo'
filter.any_channel: 'Qualquer canal'
filter.client_ip_placeholder: '203.0.113.7'
24 changes: 24 additions & 0 deletions src/Resources/views/admin/_filter_bar.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{#
Filter bar of the list page (web_ui.filter_actions: filter_bar, 1.25): a UiKit `.nowo-ui-filter-bar` form — every
filter field as a labelled row — and the UiKit `_filter_actions` partial (Filter + Clear, Clear always shown).

Variables: page (View\ListPage; page.filters is the filter FormView), region, bundle.
Fields keep the width tokens of page.filterFields; the input classes come from the `input` theme slot.
#}
{% set _b = bundle|default(page.bundle) %}
{% set _filters = page.filters %}
{{ form_start(_filters, {attr: {class: 'nowo-ui-filter-bar', role: 'search', 'data-nowo-ui-filters': '', 'data-nowo-ui-region': region|default('filters')}}) }}
{% for child in _filters %}
{% if not child.rendered %}
{% set _prefixes = child.vars.block_prefixes %}
{% set _attr = child.vars.attr %}
{% if 'checkbox' not in _prefixes and 'radio' not in _prefixes and 'hidden' not in _prefixes %}
{% set _attr = _attr|merge({class: ((_attr.class ?? '') ~ ' ' ~ nowo_ui_class('input', _b))|trim}) %}
{% endif %}
<div class="nowo-ui-filter-bar__field{{ 'q' == child.vars.name ? ' nowo-ui-filter-bar__field--search' }}">
{{ form_row(child, {attr: _attr}) }}
</div>
{% endif %}
{% endfor %}
{{ include('@NowoUiKitBundle/partials/_filter_actions.html.twig', {clear_href: path('nowo_http_log_admin_index'), submit_label: 'admin.action.filter'|trans({}, 'NowoHttpLogBundle'), framework: null}, false) }}
{{ form_end(_filters) }}
14 changes: 14 additions & 0 deletions src/Resources/views/admin/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,20 @@
#}
{% extends '@NowoUiKit/page/list.html.twig' %}

{#
1.25 (opt-in, the default keeps the 1.24 output): web_ui.filter_actions: filter_bar -> `filter_actions` is 'filter_bar': the
filters render as a UiKit filter bar with the `_filter_actions` partial (Filter + Clear), see admin/_filter_bar.html.twig.
The header actions (export, purge) are always `page.header.actions`: a host layout with the UiKit compact header
and compact_actions `bar` takes them into its top bar; this template renders no menu of its own.
#}
{% block nowo_ui_list_filters %}
{% if page.filters and filter_actions|default('scaffold') == 'filter_bar' %}
{{ include('@NowoHttpLogBundle/admin/_filter_bar.html.twig', {page: page, region: 'filters', bundle: page.bundle}, false) }}
{% else %}
{{ parent() }}
{% endif %}
{% endblock %}

{% block nowo_ui_list_row %}
{%- set _b = page.bundle -%}
{%- set _cell = nowo_ui_class('table_cell', _b) -%}
Expand Down
Loading
Loading