Easyadminbundle: Batch actions

Created on 30 Jan 2017  路  11Comments  路  Source: EasyCorp/EasyAdminBundle

Hi all,
I'm bringing this up again because my company is using this bundle in a couple projects.
We are already writing something down to have something "temporary" to show,
if you like, have a look at it: https://github.com/Coolshop/EasyAdminBundle/tree/batch-actions

Are you interested in including this feature in EasyAdmin?

Thank you

feature

Most helpful comment

Our focus is to keep the config as much as friendly as possible with the possibility to override the templates if needed.

An example of the configuration will be as follows. Comments on our additions:

easy_admin:
  site_name: 'Easy Admin'
  design:
    templates:
      batch_checkbox: '@EasyAdmin:default:batch_checkbox.html.twig' # Template of the checkboxes onto the table 
      batch_actions: '@EasyAdmin:default:batch_actions.html.twig' # Template of the batch actions select, execute button and modal to confirm execution    

  list:
    batch_actions: ['delete', 'customAction'] # global batchable action for every entity
  entities:
    Vehicle:
      class: AppBundle\Entity\Vehicle
      disabled_actions: ["new", "delete"]
      list:
        action: ["customAction"]
        batch_actions: ["customAction2"] # additional batchable action for vehicle entity
    User:
      class: AppBundle\Entity\User
      list:
          fields: ['id', 'firstName', 'lastName', 'email']
          batch_actions: ['-delete'] # disable delete from batchable action for user entity

User Experience will be like "Delete" action.
First batch action select will remain disabled until a row is selected:
image

After a action is selected as follows_
image

user can click on the execute button (the blu one):
image

And a modal will ask for confirmation:
image

What do you think?

All 11 comments

@alberto-coolshop thanks for this proposal. I'm interested ... unless implementing the new feature is "too complex". First, could you show me how this feature could work for end-users? Do you have an example of the config needed? Thanks!

Our focus is to keep the config as much as friendly as possible with the possibility to override the templates if needed.

An example of the configuration will be as follows. Comments on our additions:

easy_admin:
  site_name: 'Easy Admin'
  design:
    templates:
      batch_checkbox: '@EasyAdmin:default:batch_checkbox.html.twig' # Template of the checkboxes onto the table 
      batch_actions: '@EasyAdmin:default:batch_actions.html.twig' # Template of the batch actions select, execute button and modal to confirm execution    

  list:
    batch_actions: ['delete', 'customAction'] # global batchable action for every entity
  entities:
    Vehicle:
      class: AppBundle\Entity\Vehicle
      disabled_actions: ["new", "delete"]
      list:
        action: ["customAction"]
        batch_actions: ["customAction2"] # additional batchable action for vehicle entity
    User:
      class: AppBundle\Entity\User
      list:
          fields: ['id', 'firstName', 'lastName', 'email']
          batch_actions: ['-delete'] # disable delete from batchable action for user entity

User Experience will be like "Delete" action.
First batch action select will remain disabled until a row is selected:
image

After a action is selected as follows_
image

user can click on the execute button (the blu one):
image

And a modal will ask for confirmation:
image

What do you think?

Hi all,
anyone would add something to this?
I'm almost ready for merge-request, just the time to refine and translate some message...

@alberto-coolshop @javiereguiluz Hi ,
I'm trying to implement your bundle into my project , the probl茅m when i set the configuration under template, get this error:
Unrecognized options "batch_checkbox, batch_actions" under "easy_admin.design.templates"

take a look to the exception :


any idea plz !!!

is there any progress with this?

Let's close this for now and rethink about this feature for the next major version of the bundle. Thanks!

This is important feature!
please implement it !

How can this be achieved in 2.0? I need to generate certificates for selected registrations.

up

@yceruto thanks for the tip! Tried upgrading from 1.17 to 2.1, got huge problems hehehe.
Even though I followed both
https://github.com/EasyCorp/EasyAdminBundle/blob/master/UPGRADE-2.0.md
and
https://github.com/EasyCorp/EasyAdminBundle/blob/master/UPGRADE.md

Was this page helpful?
0 / 5 - 0 ratings

Related issues

devkbsc picture devkbsc  路  3Comments

joazvsoares picture joazvsoares  路  4Comments

javiereguiluz picture javiereguiluz  路  4Comments

lukasluecke picture lukasluecke  路  3Comments

ghost picture ghost  路  3Comments