forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 3
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
DanielePalombo
wants to merge
10
commits into
nebulab:main
Choose a base branch
from
DanielePalombo:nebulab/bulk-actions
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Commits on Jan 22, 2021
-
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.
Configuration menu - View commit details
-
Copy full SHA for 56f2417 - Browse repository at this point
Copy the full SHA 56f2417View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 312e7df - Browse repository at this point
Copy the full SHA 312e7dfView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 5181505 - Browse repository at this point
Copy the full SHA 5181505View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 672f7d8 - Browse repository at this point
Copy the full SHA 672f7d8View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 4a08ee3 - Browse repository at this point
Copy the full SHA 4a08ee3View commit details -
This modal will render the batch action result.
Configuration menu - View commit details
-
Copy full SHA for 162cfe2 - Browse repository at this point
Copy the full SHA 162cfe2View commit details -
Add controller action to process BatchAction
process_batch action is used to execute the BatchAction and return the result as js.
Configuration menu - View commit details
-
Copy full SHA for c7ff27f - Browse repository at this point
Copy the full SHA c7ff27fView commit details -
Execute the batch action and return the result in a modal.
Configuration menu - View commit details
-
Copy full SHA for 202dac6 - Browse repository at this point
Copy the full SHA 202dac6View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 3b1a45f - Browse repository at this point
Copy the full SHA 3b1a45fView commit details -
Configuration menu - View commit details
-
Copy full SHA for df0d786 - Browse repository at this point
Copy the full SHA df0d786View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.