KG - Batch Delete Users + Related Email Logic Improvement #1734
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.
This pull request primarily covers this story https://www.pivotaltracker.com/story/show/164082119 but does include https://www.pivotaltracker.com/story/show/156044835 as well due to the overlapping work.
Overview
The majority of the work involves the new
batch-select.js
library that I wrote here. This library can be used in different contexts to allow users to select multiple records for an action. In the scope of this story, this allows users to delete multiple Authorized Users at once and send out a single email (that part is done separately on the server).How it Works
You can initialize the
batch-select.js
library by calling$('...').batchSelect()
. You can provide an object consisting of various options listed underDEFAULTS
to customize theming and text.After being initialized, a user may click and hold on one of the elements initialized upon (this will generally be a button). After .5 seconds, all of the elements initialized on will be hidden and replaced with checkboxes and a button will appear to submit with all of the checked rows. After selecting all of the records they want to change, users can click the new button, confirm a sweet alert, and an ajax request is sent based on the options provided to the initializer.
Also note that the library allows users to simply click one of the elements like normal.
Here is an example screenshot. This is after holding my mouse on one of the delete buttons which has been highlighted and the
Delete Selected
button appears next to that row.