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

Add bulk action handling to our excerpt generation #523

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Jun 30, 2023

Description of the Change

In #405 we added the ability to manually generate excerpts on individual items. This is a follow up that adds bulk handling support so you can generate excerpts on multiple items in the admin UI.

There are two ways to do this:

Select multiple items in a post list view and then choose the Generate excerpt option from the Bulk actions dropdown:

Bulk action support

Or hover over a single item's row and click on the Generate excerpt link:

Generate excerpt inline option

Both of these options should only show up if the current user's role matches a role that has been chosen in the ChatGPT Excerpt settings (and if someone were to manually make a request to the endpoint, it should fail if their role isn't allowed).

How to test the Change

See screenshots above for the location of the two changes introduced in this PR.

Test generating excerpts using both options and ensure they work

Ensure users without a proper role can't use these options

Changelog Entry

Added - Ability to generate excerpts in bulk using the Bulk actions dropdown
Added - Ability to generate excerpts on an individual item from the post lists screen

Credits

Props @dkotter

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@dkotter dkotter added this to the 2.2.3 milestone Jun 30, 2023
@dkotter dkotter self-assigned this Jun 30, 2023
@dkotter dkotter requested review from a team and jeffpaul as code owners June 30, 2023 23:00
@dkotter dkotter requested review from a team, peterwilsoncc and Sidsector9 and removed request for a team, jeffpaul and peterwilsoncc June 30, 2023 23:01
Copy link
Member

@Sidsector9 Sidsector9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dkotter this works well 👍

I have a suggestion, maybe we can handle it iteratively.
Sites that perform bulk operations like these will benefit from running in the background, what do you say?

@dkotter
Copy link
Collaborator Author

dkotter commented Jul 5, 2023

I have a suggestion, maybe we can handle it iteratively. Sites that perform bulk operations like these will benefit from running in the background, what do you say?

Yeah, some sort of background processor would be ideal but out of scope for this particular PR. That is something I would love to see added though

@dkotter dkotter merged commit 40c8b69 into develop Jul 5, 2023
@dkotter dkotter deleted the feature/bulk-excerpts branch July 5, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants