Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify index actions #16234

Merged
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 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
@@ -1,12 +1,25 @@
/* eslint-env browser */
import * as bootstrap from 'bootstrap';

(function () {
const dropdowns = document.querySelectorAll('.dropdown-toggle.dropdown-static');
const dropdown = [...dropdowns].map((dropdownToggleEl) => new bootstrap.Dropdown(dropdownToggleEl, {
popperConfig(defaultBsPopperConfig) {
return { ...defaultBsPopperConfig, strategy: 'fixed' };
},
}));
}());
// Fix dropdowns
(() => {
document.querySelectorAll('.dropdown-static').forEach((dropdownToggleEl) => {
const parent = dropdownToggleEl.closest('[data-bs-toggle="dropdown"]');
if (parent) {
let dropdown = new bootstrap.Dropdown(parent, {
popperConfig(defaultBsPopperConfig) {
return { ...defaultBsPopperConfig, strategy: 'fixed' };
},
});
}
});
})();

// Initialize tooltips
(() => {
document.querySelectorAll('[data-bs-toggle="tooltip"]').forEach((tooltipTriggerEl) => {
let tooltip = new bootstrap.Tooltip(tooltipTriggerEl);
});
})();

window.bootstrap = bootstrap;
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* file that was distributed with this source code.
*/

$prefix: "tblr-";

$assets-base: "/node_modules/@tabler/core/dist";
$primary: #22B99A;

Expand Down Expand Up @@ -41,3 +43,9 @@ $pagination-active-color: inherit;
$pagination-active-bg: $gray-200;

$font-family-sans-serif: 'Inter', serif;

$h1-font-size: 1.6rem;
$h1-line-height: 2.1rem;

// Page
$page-title-font-size: var(--#{$prefix}font-size-h1);
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ imports:
- { resource: "@SyliusAdminBundle/Resources/config/app/sylius/sylius_mailer.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/grids/address_log_entry.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/grids/admin_user.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/grids/catalog_promotion.yaml" }
- { resource: "@SyliusAdminBundle/Resources/config/grids/catalog_promotion.yml" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be for using .yaml instead of .yml, so not changing this one

- { resource: "@SyliusAdminBundle/Resources/config/grids/channel.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/grids/channel_pricing_log_entry.yml" }
- { resource: "@SyliusAdminBundle/Resources/config/grids/country.yml" }
Expand Down Expand Up @@ -69,6 +69,7 @@ sylius_grid:
default: '@SyliusAdmin/shared/grid/action/default.html.twig'
delete: '@SyliusAdmin/shared/grid/action/delete.html.twig'
links: '@SyliusAdmin/shared/grid/action/links.html.twig'
list: '@SyliusAdmin/shared/grid/action/list.html.twig'
show: '@SyliusAdmin/shared/grid/action/show.html.twig'
update: '@SyliusAdmin/shared/grid/action/update.html.twig'
create_payment_method: "@SyliusAdmin/payment_method/grid/action/create.html.twig"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ sylius_grid:
sorting:
createdAt: desc
fields:
email:
type: twig
label: sylius.ui.email
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/name.html.twig"
firstName:
type: string
label: sylius.ui.first_name
Expand All @@ -20,22 +26,23 @@ sylius_grid:
type: string
label: sylius.ui.username
sortable: ~
email:
type: string
label: sylius.ui.email
sortable: ~
createdAt:
type: datetime
type: twig
label: sylius.ui.registration_date
sortable: ~
options:
format: d-m-Y H:i
template: "@SyliusAdmin/shared/grid/field/date.html.twig"
vars:
th_class: "w-1 text-center"
enabled:
type: twig
label: sylius.ui.enabled
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
vars:
th_class: "w-1 text-center"
td_class: "text-center"
filters:
search:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,68 @@ sylius_grid:
sorting:
code: asc
fields:
code:
type: string
label: sylius.ui.code
priority:
type: twig
label: sylius.ui.priority
sortable: ~
options:
template: "@SyliusAdmin/catalog_promotion/grid/field/priority.html.twig"
vars:
th_class: "w-1 text-center"
td_class: "text-center"
name:
type: string
type: twig
label: sylius.ui.name
sortable: ~
startDate:
options:
template: "@SyliusAdmin/shared/grid/field/name.html.twig"
code:
type: twig
label: sylius.ui.start_date
label: sylius.ui.code
sortable: ~
options:
template: '@SyliusAdmin/catalog_promotion/grid/field/date.html.twig'
endDate:
template: "@SyliusAdmin/shared/grid/field/code.html.twig"
channels:
type: twig
label: sylius.ui.end_date
sortable: ~
label: sylius.ui.channels
options:
template: '@SyliusAdmin/catalog_promotion/grid/field/date.html.twig'
priority:
template: "@SyliusAdmin/shared/grid/field/channels.html.twig"
vars:
th_class: "w-1 text-center"
startDate:
type: twig
label: sylius.ui.priority
label: sylius.ui.start_date
sortable: ~
options:
template: '@SyliusAdmin/catalog_promotion/grid/field/priority.html.twig'
channels:
template: "@SyliusAdmin/catalog_promotion/grid/field/date.html.twig"
vars:
th_class: "text-center"
endDate:
type: twig
label: sylius.ui.channels
label: sylius.ui.end_date
sortable: ~
options:
template: '@SyliusAdmin/shared/grid/field/channels.html.twig'
template: "@SyliusAdmin/catalog_promotion/grid/field/date.html.twig"
vars:
th_class: "text-center"
state:
type: twig
label: sylius.ui.state
path: state
options:
template: '@SyliusAdmin/catalog_promotion/grid/field/state.html.twig'
template: "@SyliusAdmin/catalog_promotion/grid/field/state.html.twig"
vars:
th_class: "w-1 text-center"
td_class: "text-center"
enabled:
type: twig
label: sylius.ui.enabled
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
vars:
th_class: "w-1 text-center"
td_class: "text-center"
filters:
search:
type: string
Expand Down Expand Up @@ -95,6 +114,7 @@ sylius_grid:
type: show
show_variants:
type: show
icon: list-letters
label: sylius.ui.list_variants
options:
link:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sylius_grid:
label: sylius.ui.code
sortable: code
options:
template: "@SyliusAdmin/channel/grid/field/code.html.twig"
template: "@SyliusAdmin/shared/grid/field/code.html.twig"
themeName:
type: twig
label: sylius.ui.theme
Expand All @@ -33,6 +33,8 @@ sylius_grid:
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
vars:
th_class: "w-1 text-center"
filters:
search:
type: string
Expand Down
12 changes: 8 additions & 4 deletions src/Sylius/Bundle/AdminBundle/Resources/config/grids/country.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@ sylius_grid:
sorting:
code: asc
fields:
code:
type: string
label: sylius.ui.code
sortable: ~
name:
type: twig
label: sylius.ui.name
path: .
sortable: code
options:
template: "@SyliusAdmin/country/grid/field/name.html.twig"
code:
type: twig
label: sylius.ui.code
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/code.html.twig"
enabled:
type: twig
label: sylius.ui.enabled
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
vars:
th_class: "w-1 text-center"
filters:
code:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ sylius_grid:
code: asc
fields:
code:
type: string
type: twig
label: sylius.ui.code
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/code.html.twig"
vars:
th_class: "w-1 text-center"
name:
type: string
label: sylius.ui.name
Expand Down
23 changes: 16 additions & 7 deletions src/Sylius/Bundle/AdminBundle/Resources/config/grids/customer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,44 @@ sylius_grid:
sorting:
createdAt: desc
fields:
firstName:
type: string
label: sylius.ui.first_name
email:
type: twig
label: sylius.ui.email
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/name.html.twig"
lastName:
type: string
label: sylius.ui.last_name
sortable: ~
email:
firstName:
type: string
label: sylius.ui.email
label: sylius.ui.first_name
sortable: ~
createdAt:
type: datetime
type: twig
label: sylius.ui.registration_date
sortable: ~
options:
format: d-m-Y H:i
template: "@SyliusAdmin/shared/grid/field/date.html.twig"
vars:
th_class: "w-1 text-center"
enabled:
type: twig
label: sylius.ui.enabled
path: user?.enabled
options:
template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
vars:
th_class: "w-1 text-center"
verified:
type: twig
label: sylius.ui.verified
path: user?.verified
options:
template: "@SyliusAdmin/shared/grid/field/boolean.html.twig"
vars:
th_class: "w-1 text-center"
filters:
search:
type: string
Expand Down Expand Up @@ -66,6 +74,7 @@ sylius_grid:
show_orders:
type: show
label: sylius.ui.show_orders
icon: shopping-bag
options:
link:
route: sylius_admin_customer_order_index
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ sylius_grid:
sorting:
name: asc
fields:
code:
type: string
label: sylius.ui.code
sortable: ~
name:
type: string
type: twig
label: sylius.ui.name
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/name.html.twig"
vars:
th_class: "w-75"
code:
type: twig
label: sylius.ui.code
sortable: ~
options:
template: "@SyliusAdmin/shared/grid/field/code.html.twig"
vars:
th_class: "w-25"
filters:
search:
type: string
Expand Down
Loading
Loading