@@ -10,7 +45,8 @@
To add an icon to the page title, you need to use Twig hooks configuration.
-Search the "title_block" in the Symfony debug profiler at the Twig hooks section.
+Search for "title_block" in the call graph of the Symfony debug profiler in the `Twig Hooks` section.
+We're going to reuse this hook and its template in our config file.
@@ -79,5 +115,5 @@ sylius_twig_hooks:
# We need to reuse the same template as 'sylius_admin.common.index.content.header.title_block'
template: '@SyliusBootstrapAdminUi/shared/crud/common/content/header/title_block/title.html.twig'
configuration:
- subheader: app.ui.managing_your_speakers # you also need add this key on your translations.
+ subheader: app.ui.managing_your_speakers # you also need to add this key to your translations
```
diff --git a/src/BootstrapAdminUi/templates/shared/helper/header.html.twig b/src/BootstrapAdminUi/templates/shared/helper/header.html.twig
index d4d9d384..4f322786 100644
--- a/src/BootstrapAdminUi/templates/shared/helper/header.html.twig
+++ b/src/BootstrapAdminUi/templates/shared/helper/header.html.twig
@@ -1,14 +1,14 @@
{% macro default(level, header, icon, subheader) %}
{% if icon %}
-
{{ ux_icon(icon, {'class': 'icon icon-md text-primary'}) }}
+
{{ ux_icon(icon, {'class': 'icon icon-md text-primary'}) }}
{% endif %}
-
+
{{ header }}
{% if subheader %}
- {{ subheader }}
+ {{ subheader }}
{% endif %}
diff --git a/tests/Functional/BookTest.php b/tests/Functional/BookTest.php
index 1e3a990f..1cca2614 100644
--- a/tests/Functional/BookTest.php
+++ b/tests/Functional/BookTest.php
@@ -46,7 +46,7 @@ public function testShowingBook(): void
self::assertResponseIsSuccessful();
// Validate Header
- self::assertSelectorTextContains('h1.page-title', 'Shinning');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Shinning');
// Validate page body
self::assertSelectorTextContains('[data-test-author-name]', 'Stephen King');
@@ -71,7 +71,7 @@ public function testBrowsingBooks(): void
self::assertResponseIsSuccessful();
// Validate Header
- self::assertSelectorTextContains('h1.page-title', 'Books');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Books');
self::assertSelectorExists('a:contains("Create")');
// Validate Custom Twig Hooks
diff --git a/tests/Functional/ConferenceTest.php b/tests/Functional/ConferenceTest.php
index 56b4de2d..a8b5451c 100644
--- a/tests/Functional/ConferenceTest.php
+++ b/tests/Functional/ConferenceTest.php
@@ -52,7 +52,7 @@ public function testBrowsingConferences(): void
self::assertResponseIsSuccessful();
// Validate Header
- self::assertSelectorTextContains('h1.page-title', 'Conferences');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Conferences');
self::assertSelectorExists('a:contains("Create")');
// Validate Table header
diff --git a/tests/Functional/DashboardTest.php b/tests/Functional/DashboardTest.php
index f4e1d6d4..374d21f9 100644
--- a/tests/Functional/DashboardTest.php
+++ b/tests/Functional/DashboardTest.php
@@ -35,6 +35,6 @@ public function testDashboard(): void
self::assertResponseIsSuccessful();
- self::assertSelectorTextContains('h1.page-title', 'Dashboard');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Dashboard');
}
}
diff --git a/tests/Functional/SpeakerTest.php b/tests/Functional/SpeakerTest.php
index 6213ecb4..a3dbe15e 100644
--- a/tests/Functional/SpeakerTest.php
+++ b/tests/Functional/SpeakerTest.php
@@ -50,7 +50,9 @@ public function testBrowsingSpeakers(): void
self::assertResponseIsSuccessful();
// Validate Header
- self::assertSelectorTextContains('h1.page-title', 'Speakers');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Browsing speakers');
+ self::assertSelectorExists('[data-test-icon="tabler:users"]');
+ self::assertSelectorTextContains('[data-test-subheader]', 'Managing your speakers');
self::assertSelectorExists('a:contains("Create")');
// Validate Table header
diff --git a/tests/Functional/TalkTest.php b/tests/Functional/TalkTest.php
index e4f70d0e..e9d4403e 100644
--- a/tests/Functional/TalkTest.php
+++ b/tests/Functional/TalkTest.php
@@ -57,7 +57,7 @@ public function testBrowsingTalks(): void
self::assertResponseIsSuccessful();
// Validate Header
- self::assertSelectorTextContains('h1.page-title', 'Talks');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Talks');
self::assertSelectorExists('a:contains("Create")');
// Validate Table header
diff --git a/tests/Translations/FrenchTranslatedUiTest.php b/tests/Translations/FrenchTranslatedUiTest.php
index e7c52842..b8921ff7 100644
--- a/tests/Translations/FrenchTranslatedUiTest.php
+++ b/tests/Translations/FrenchTranslatedUiTest.php
@@ -73,7 +73,7 @@ public function testBrowsingItems(): void
self::assertResponseIsSuccessful();
// Validate Header
- self::assertSelectorTextContains('h1.page-title', 'Livres');
+ self::assertSelectorTextContains('[data-test-page-title]', 'Livres');
// Validate Table header
self::assertSelectorTextContains('.sylius-table-column-title', 'Titre');
diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml
index 67f50628..223fef82 100644
--- a/translations/messages.en.yaml
+++ b/translations/messages.en.yaml
@@ -7,6 +7,7 @@ app:
biz: Biz
book: Book
books: Books
+ browsing_speakers: Browsing speakers
company_name: Company name
conference: Conference
conferences: Conferences
diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml
index 8f6e5217..5d610739 100644
--- a/translations/messages.fr.yaml
+++ b/translations/messages.fr.yaml
@@ -7,6 +7,7 @@ app:
biz: Biz
book: Livre
books: Livres
+ browsing_speakers: Parcourir les Conférencier-e-s
company_name: Société
conference: Conférence
conferences: Conférences