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

Nebulab/bulk actions #91

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Commits on Jan 22, 2021

  1. Add Modal logic

    This commit is going to add a standard way to load the modals in solidus.
    They can be load and store as global object Spree.Views.Modals.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    56f2417 View commit details
    Browse the repository at this point in the history
  2. Add Spree::BatchAction::Base Object

    This is the base object to create the batch actions.
    Any batch action object should inherit from it and overriding the `call` method.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    312e7df View commit details
    Browse the repository at this point in the history
  3. Add Spree::Backend::Batch

    Include this concern into controller to manage a batch action list.
    
    e.g.
    
    ```
    include Spree::Backend::Batch
          set_batch_actions [
            { action: 'Spree::BatchAction::DestroyRecordAction', icon: :trash, label: :delete }
          ]
    ```
    
    In this way the controller will be able to run the specified batch
    actions
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    5181505 View commit details
    Browse the repository at this point in the history
  4. Add modal Preview

    This modal will show when a batch action is clicked.
    When the modal is shown it will be possible to show to the user an
    action preview, in this way we can ask to the user other configuration
    or just show what the action will do
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    672f7d8 View commit details
    Browse the repository at this point in the history
  5. Open Preview Modal

    This commit adds to the Spree::Backend::Batch concern the
    `preview_batch` action.
    It will render the related partial under
    `spree/admin/batch_actions/*BATCH_ACTION_NAME*/preview` template.
    In this way, any BatchAction would have been its template and ask to the
    user other fields required to process the collection.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    4a08ee3 View commit details
    Browse the repository at this point in the history
  6. Add Modal Batch Result

    This modal will render the batch action result.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    162cfe2 View commit details
    Browse the repository at this point in the history
  7. Add controller action to process BatchAction

    process_batch action is used to execute the BatchAction and return the
    result as js.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    c7ff27f View commit details
    Browse the repository at this point in the history
  8. Execute BatchAction Process

    Execute the batch action and return the result in a modal.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    202dac6 View commit details
    Browse the repository at this point in the history
  9. Add DestroyRecordAction

    This is the first batch action.
    It will handle the delete of multiple records.
    
    The partials _preview.html.erb and _result.html.erb are required to
    support admin user during usage.
    DanielePalombo committed Jan 22, 2021
    Configuration menu
    Copy the full SHA
    3b1a45f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    df0d786 View commit details
    Browse the repository at this point in the history