Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulczy authored and GSadee committed May 14, 2024
1 parent 4e6f42d commit 7d37d78
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Page/Admin/Crud/IndexPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function deleteResourceOnPage(array $parameters): void
$deletedRow = $tableAccessor->getRowWithFields($table, $parameters);
$actionButtons = $tableAccessor->getFieldFromRow($table, $deletedRow, 'actions');

$actionButtons->pressButton('Delete');
$actionButtons->pressButton('delete');
}

public function getActionsForResource(array $parameters): NodeElement
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Page/Admin/Product/IndexPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function showProductPage(string $productName): void
$table = $this->getElement('table');
$row = $tableAccessor->getRowWithFields($table, ['name' => $productName]);
$field = $tableAccessor->getFieldFromRow($table, $row, 'actions');
$field->clickLink('Details');
$field->clickLink('details');
}

public function goToPage(int $page): void
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Behat/Page/Admin/ShippingMethod/IndexPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function isArchivalFilterEnabled(): bool
public function archiveShippingMethod(string $name): void
{
$actions = $this->getActionsForResource(['name' => $name]);
$actions->pressButton('Archive');
$actions->pressButton('archive');
$this->getElement('confirm_action_button')->press();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ sylius_grid:
label: sylius.ui.start_date
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/date.html.twig"
template: "@SyliusAdmin/catalog_promotion/grid/field/date.html.twig"
vars:
th_class: "text-center"
endDate:
type: twig
label: sylius.ui.end_date
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/date.html.twig"
template: "@SyliusAdmin/catalog_promotion/grid/field/date.html.twig"
vars:
th_class: "text-center"
state:
Expand Down
16 changes: 8 additions & 8 deletions src/Sylius/Bundle/AdminBundle/Resources/config/grids/payment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ sylius_grid:
sorting:
createdAt: desc
fields:
number:
type: twig
label: sylius.ui.order
path: order
options:
template: "@SyliusAdmin/shared/grid/field/order_number.html.twig"
vars:
th_class: "w-1"
createdAt:
type: twig
label: sylius.ui.date
Expand All @@ -26,6 +18,14 @@ sylius_grid:
template: "@SyliusAdmin/shared/grid/field/date.html.twig"
vars:
th_class: "w-1 text-center"
number:
type: twig
label: sylius.ui.order
path: order
options:
template: "@SyliusAdmin/shared/grid/field/order_number.html.twig"
vars:
th_class: "w-1"
customer:
type: twig
label: sylius.ui.customer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ sylius_grid:
sorting:
createdAt: desc
fields:
number:
type: twig
label: sylius.ui.order
path: order
options:
template: "@SyliusAdmin/shared/grid/field/order_number.html.twig"
vars:
th_class: "w-1"
createdAt:
type: twig
label: sylius.ui.created_at
Expand All @@ -34,6 +26,14 @@ sylius_grid:
template: "@SyliusAdmin/shared/grid/field/date.html.twig"
vars:
th_class: "w-1 text-center"
number:
type: twig
label: sylius.ui.order
path: order
options:
template: "@SyliusAdmin/shared/grid/field/order_number.html.twig"
vars:
th_class: "w-1"
channel:
type: twig
label: sylius.ui.channel
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="text-center fs-5">
{% if data is null %}
<span class="text-secondary">-</span>
{% else %}
<div>{{ data|date('Y-m-d') }}</div>
<div>{{ data|date('H:i') }}</div>
{% endif %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if data is null %}
<span class="text-secondary">-</span>
{% else %}
<div>{{ data|date('Y-m-d') }}</div>
<div>{{ data|date('H:i') }}</div>
<div>{{ data|date('d-m-Y') }}</div>
<div>{{ data|date('H:i:s') }}</div>
{% endif %}
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<input type="hidden" name="sylius_archivable[_token]" value="{{ csrf_token('sylius_archivable') }}" />

{% if data.archivedAt is not null %}
<button class="btn" type="submit" data-confirm-btn-submit>
<button name="archive" class="btn" type="submit" data-confirm-btn-submit>
{{ icon({ icon: action.icon ?? 'archive', class: 'icon icon-tabler dropdown-item-icon' }) }}
{{ action.options.restore_label|default('sylius.ui.restore')|trans }}
</button>
{% else %}
<button class="btn btn-icon" type="submit" data-confirm-btn-submit data-bs-toggle="tooltip" data-bs-title="{{ action.label|default('sylius.ui.archive')|trans }}">
<button name="archive" class="btn btn-icon" type="submit" data-confirm-btn-submit data-bs-toggle="tooltip" data-bs-title="{{ action.label|default('sylius.ui.archive')|trans }}">
{{ icon({ icon: action.icon ?? 'archive', class: 'icon icon-tabler dropdown-item-icon' }) }}
</button>
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<form action="{{ path }}" method="post">
<input type="hidden" name="_method" value="DELETE">
<button class="btn btn-icon" type="submit" data-confirm-btn-submit {{ sylius_test_html_attribute('delete-button') }} data-bs-toggle="tooltip" data-bs-title="{{ message|trans }}">
<button name="delete" class="btn btn-icon" type="submit" data-confirm-btn-submit {{ sylius_test_html_attribute('delete-button') }} data-bs-toggle="tooltip" data-bs-title="{{ message|trans }}">
{{ icon({ icon: action.icon ?? 'trash-x', class: 'icon icon-tabler text-danger' }) }}
</button>
<input type="hidden" name="_csrf_token" value="{{ csrf_token(data.id) }}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('show')), options.link.parameters|default({'id': data.id}))) %}
{% set message = action.label|default('sylius.ui.show') %}

<a href="{{ path }}" class="btn btn-icon" data-bs-toggle="tooltip" data-bs-title="{{ message|trans }}">
<a title="details" href="{{ path }}" class="btn btn-icon" data-bs-toggle="tooltip" data-bs-title="{{ message|trans }}">
{{ icon({ icon: action.icon|default('eye'), class: 'icon icon-tabler' }) }}
</a>

0 comments on commit 7d37d78

Please sign in to comment.