-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR was merged into the poc-new-resource-metadata branch. Discussion ---------- | Q | A | --------------- | ----- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Related tickets | fixes #X, partially #Y, mentioned in #Z | License | MIT Commits ------- 52bdbcc Add Bulk delete 735cee2 Uncomment line to test redirection
- Loading branch information
Showing
16 changed files
with
263 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/Bundle/test/templates/grid/bulk_action/delete.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% set path = options.link.url|default(path(options.link.route|default(grid.requestConfiguration.getRouteName('bulk_delete')), options.link.parameters|default({}))) %} | ||
|
||
<form action="{{ path }}" method="post"> | ||
<input type="hidden" name="_method" value="DELETE"> | ||
<button type="submit"> | ||
<i class="icon trash"></i> Bulk delete | ||
</button> | ||
<input type="hidden" name="_csrf_token" value="{{ csrf_token('bulk_delete') }}" /> | ||
|
||
{% for resource in grid.data %} | ||
<input type="hidden" name="ids[]" value="{{ resource.id }}" /> | ||
{% endfor %} | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Component\Resource\Metadata; | ||
|
||
/** | ||
* @experimental | ||
*/ | ||
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] | ||
final class BulkDelete extends HttpOperation implements DeleteOperationInterface, BulkOperationInterface | ||
{ | ||
public function __construct( | ||
?array $methods = null, | ||
?string $path = null, | ||
?string $routePrefix = null, | ||
?string $template = null, | ||
?string $shortName = null, | ||
?string $name = null, | ||
string|callable|null $provider = null, | ||
string|callable|null $processor = null, | ||
string|callable|null $responder = null, | ||
string|callable|null $repository = null, | ||
?string $repositoryMethod = null, | ||
?bool $read = null, | ||
?bool $write = null, | ||
?string $formType = null, | ||
?array $formOptions = null, | ||
?string $redirectToRoute = null, | ||
) { | ||
parent::__construct( | ||
methods: $methods ?? ['DELETE'], | ||
path: $path, | ||
routePrefix: $routePrefix, | ||
template: $template, | ||
shortName: $shortName ?? 'bulk_delete', | ||
name: $name, | ||
provider: $provider, | ||
processor: $processor, | ||
responder: $responder, | ||
repository: $repository, | ||
repositoryMethod: $repositoryMethod, | ||
read: $read, | ||
write: $write, | ||
formType: $formType, | ||
formOptions: $formOptions, | ||
redirectToRoute: $redirectToRoute, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Sylius package. | ||
* | ||
* (c) Paweł Jędrzejewski | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\Component\Resource\Metadata; | ||
|
||
/** | ||
* The Operation returns a collection. | ||
* | ||
* @experimental | ||
*/ | ||
interface BulkOperationInterface | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.