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

Grid row delete confirmation modal - Catalog > Brands > Addresses #18324

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -30,7 +30,6 @@
use PrestaShop\PrestaShop\Core\Grid\Action\GridActionCollection;
use PrestaShop\PrestaShop\Core\Grid\Action\Row\RowActionCollection;
use PrestaShop\PrestaShop\Core\Grid\Action\Row\Type\LinkRowAction;
use PrestaShop\PrestaShop\Core\Grid\Action\Row\Type\SubmitRowAction;
use PrestaShop\PrestaShop\Core\Grid\Action\Type\LinkGridAction;
use PrestaShop\PrestaShop\Core\Grid\Action\Type\SimpleGridAction;
use PrestaShop\PrestaShop\Core\Grid\Column\ColumnCollection;
Expand All @@ -42,13 +41,15 @@
use PrestaShopBundle\Form\Admin\Type\CountryChoiceType;
use PrestaShopBundle\Form\Admin\Type\SearchAndResetType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\HttpFoundation\Request;

/**
* Class ManufacturerAddressGridDefinitionFactory is responsible for creating Manufacturers address grid definition.
*/
final class ManufacturerAddressGridDefinitionFactory extends AbstractGridDefinitionFactory
{
use BulkDeleteActionTrait;
use DeleteActionTrait;

const GRID_ID = 'manufacturer_address';

Expand Down Expand Up @@ -135,19 +136,13 @@ protected function getColumns()
'clickable_row' => true,
])
)
->add((new SubmitRowAction('delete'))
->setName($this->trans('Delete', [], 'Admin.Actions'))
->setIcon('delete')
->setOptions([
'route' => 'admin_manufacturer_addresses_delete',
'route_param_name' => 'addressId',
'route_param_field' => 'id_address',
'confirm_message' => $this->trans(
'Delete selected item?',
[],
'Admin.Notifications.Warning'
),
])
->add(
$this->buildDeleteAction(
'admin_manufacturer_addresses_delete',
'addressId',
'id_address',
Request::METHOD_DELETE
)
),
])
)
Expand Down
Expand Up @@ -130,7 +130,7 @@ admin_manufacturer_addresses_edit:

admin_manufacturer_addresses_delete:
path: addresses/{addressId}/delete
methods: POST
methods: [POST, DELETE]
defaults:
_controller: 'PrestaShopBundle:Admin/Sell/Catalog/Manufacturer:deleteAddress'
_legacy_controller: AdminManufacturers
Expand Down