Skip to content

Commit 17513bd

Browse files
committed
Rename clear button components and update translations for consistency
1 parent a97b309 commit 17513bd

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/bundle/Resources/translations/ibexa_design_system_twig.en.xliff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
<note>The source node in most cases contains the sample message as written by the developer. If it looks like a dot-delimitted string such as "form.label.firstname", then the developer has not provided a default message.</note>
77
</header>
88
<body>
9-
<trans-unit id="61c7070a29f932eb0b1a343509d049aa52c92c09" resname="ibexa.clear-btn.label">
9+
<trans-unit id="325602325410dfc0d83e43dec9a10976368c7154" resname="ibexa.clear-button.label">
1010
<source>Clear</source>
1111
<target state="new">Clear</target>
12-
<note>key: ibexa.clear-btn.label</note>
12+
<note>key: ibexa.clear-button.label</note>
1313
</trans-unit>
1414
<trans-unit id="6c89c5a149a0c096f007f1774344ec53cd18bb20" resname="ibexa.expander.label.collapse">
1515
<source>Hide</source>

src/bundle/Resources/views/themes/standard/design_system/components/input_text/input.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
%}
3131

3232
{% set clear_action %}
33-
<twig:ibexa:ui:clear_btn :disabled="disabled" />
33+
<twig:ibexa:ui:clear_button :disabled="disabled" />
3434
{% endset %}
3535

3636
{% set actions = [

src/bundle/Resources/views/themes/standard/design_system/components/ui/clear_btn.html.twig renamed to src/bundle/Resources/views/themes/standard/design_system/components/ui/clear_button.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% trans_default_domain 'ibexa_design_system_twig' %}
22

3-
{% set clear_msg = 'ibexa.clear-btn.label'|trans|desc('Clear') %}
3+
{% set clear_msg = 'ibexa.clear-button.label'|trans|desc('Clear') %}
44

55
<twig:ibexa:button
66
type="tertiary-alt"

src/lib/Twig/Components/UI/ClearBtn.php renamed to src/lib/Twig/Components/UI/ClearButton.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent;
1313
use Symfony\UX\TwigComponent\Attribute\PreMount;
1414

15-
#[AsTwigComponent('ibexa:ui:clear_btn')]
16-
final class ClearBtn
15+
#[AsTwigComponent('ibexa:ui:clear_button')]
16+
final class ClearButton
1717
{
1818
public bool $disabled = false;
1919

tests/integration/Twig/Components/UI/ClearBtnTest.php renamed to tests/integration/Twig/Components/UI/ClearButtonTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88

99
namespace Ibexa\Tests\Integration\DesignSystemTwig\Twig\Components\UI;
1010

11-
use Ibexa\DesignSystemTwig\Twig\Components\UI\ClearBtn;
11+
use Ibexa\DesignSystemTwig\Twig\Components\UI\ClearButton;
1212
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
1313
use Symfony\Component\DomCrawler\Crawler;
1414
use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
1515
use Symfony\UX\TwigComponent\Test\InteractsWithTwigComponents;
1616

17-
final class ClearBtnTest extends KernelTestCase
17+
final class ClearButtonTest extends KernelTestCase
1818
{
1919
use InteractsWithTwigComponents;
2020

2121
public function testMount(): void
2222
{
23-
$component = $this->mountTwigComponent(ClearBtn::class, ['disabled' => true]);
23+
$component = $this->mountTwigComponent(ClearButton::class, ['disabled' => true]);
2424

25-
self::assertInstanceOf(ClearBtn::class, $component, 'Component should mount as UI\\ClearBtn.');
25+
self::assertInstanceOf(ClearButton::class, $component, 'Component should mount as UI\\ClearButton.');
2626
self::assertTrue($component->disabled, 'Prop "disabled" should be true.');
2727
}
2828

2929
public function testDefaultRenderProducesConfiguredButton(): void
3030
{
31-
$crawler = $this->renderTwigComponent(ClearBtn::class)->crawler();
31+
$crawler = $this->renderTwigComponent(ClearButton::class)->crawler();
3232

3333
$button = $this->getButton($crawler);
3434
$class = $this->getClassAttr($button);
@@ -53,7 +53,7 @@ public function testDefaultRenderProducesConfiguredButton(): void
5353

5454
public function testDisabledTrueAddsAttributeAndClass(): void
5555
{
56-
$crawler = $this->renderTwigComponent(ClearBtn::class, ['disabled' => true])->crawler();
56+
$crawler = $this->renderTwigComponent(ClearButton::class, ['disabled' => true])->crawler();
5757

5858
$button = $this->getButton($crawler);
5959
$class = $this->getClassAttr($button);
@@ -65,7 +65,7 @@ public function testDisabledTrueAddsAttributeAndClass(): void
6565
public function testInvalidDisabledTypeCausesResolverErrorOnMount(): void
6666
{
6767
$this->expectException(InvalidOptionsException::class);
68-
$this->mountTwigComponent(ClearBtn::class, ['disabled' => 'yes']);
68+
$this->mountTwigComponent(ClearButton::class, ['disabled' => 'yes']);
6969
}
7070

7171
private function getButton(Crawler $crawler): Crawler

0 commit comments

Comments
 (0)