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

chore: add type to bulk action actions #20256

Merged

Conversation

joshuaellis
Copy link
Member

What does it do?

  • adds type to the action signature (no the description interface)

Why is it needed?

  • users can use the reducer pattern for adding bulk actions and remove ones like publish or delete or swap them out, similar to how document actions work

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
contributor-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 9:00am

Copy link
Contributor

@madhurisandbhor madhurisandbhor left a comment

Choose a reason for hiding this comment

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

Merci!!

@@ -138,7 +138,6 @@ const BulkActionAction = (action: Action) => {
break;
case 'dialog':
case 'modal': {
if (action.actionType === 'delete') trackUsage('willBulkDeleteEntries');
Copy link
Contributor

Choose a reason for hiding this comment

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

I changed type to actionType because I needed to do this 😥 and I polluted it. Thanks for the changes!!

Copy link
Member Author

Choose a reason for hiding this comment

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

You could add this to the action call of delete before the API request is sent?

@madhurisandbhor madhurisandbhor merged commit a4e2e61 into fix/bulk-actions-migration May 3, 2024
26 of 31 checks passed
@madhurisandbhor madhurisandbhor deleted the chore/use-type-for-actions branch May 3, 2024 09:28
Feranchz added a commit that referenced this pull request May 9, 2024
* fix: added bulk actions

* chore: migrate bulk publish & unpublish to v5

* chore: change findLocales type to accept arrays

* chore: fix lint error

* chore: migrate bulkDelete to v5 (#20161)

* chore: migrate bulkDelete to v5

* chore: change findLocales type to accept strings array

* fix: docs prettier styles

* chore: remove console.log

* enhancement: migrate countManyDraftRelations to v5

* feat: bulk delete with locale selection option

* fix: bulk unpublish working without locale support

* test: e2e tests updated

* fix: documents api change, deleteMany tags updated, test skipped

* chore: renaming

* test: reverting e2e tests for delete action changes

* fix: reverting publish action changes

* fix: hide add to release as its not ready to be migrated

* fix: error message updated

* fix: tests updated for useDocumentAction

* fix: updated request params

* fix: reverting wrong commit message

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>

* fix: comments updated

* chore: renaming

* chore: add type to bulk action actions (#20256)

* chore: actionType renamed to just type

* fix: dont show unpublish button on contentTypes without draft and publish

* fix: set a fixed width for FieldActionWrapper on UID input

---------

Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
@echoes-hq echoes-hq bot added the echoes/type: maintenance Upkeeping efforts, chores and catch-up corrective improvements that are not features nor bugs label May 23, 2024
Feranchz added a commit that referenced this pull request May 28, 2024
* fix: added bulk actions

* chore: migrate bulk publish & unpublish to v5

* chore: change findLocales type to accept arrays

* chore: fix lint error

* chore: migrate bulkDelete to v5 (#20161)

* chore: migrate bulkDelete to v5

* chore: change findLocales type to accept strings array

* fix: docs prettier styles

* chore: remove console.log

* enhancement: migrate countManyDraftRelations to v5

* feat: bulk delete with locale selection option

* fix: bulk unpublish working without locale support

* test: e2e tests updated

* fix: documents api change, deleteMany tags updated, test skipped

* chore: renaming

* test: reverting e2e tests for delete action changes

* feat: publish action changes

* fix: reverting publish action changes

* fix: hide add to release as its not ready to be migrated

* fix: error message updated

* fix: tests updated for useDocumentAction

* fix: updated request params

* fix: publish action added

* fix: publish action changes with documentId

* fix: reverting wrong commit message

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>

* fix: comments updated

* chore: renaming

* chore: add type to bulk action actions (#20256)

* chore: actionType renamed to just type

* fix: added missing import

* test: fixed

* fix(content-manager): edit entry button on bulk publish modal

* fix: validationError message type is not as expected

* fix: ts error

* only fetch entries when modal is opened

* fix(content-releases): use status to show the published instead of publishedAt

---------

Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
madhurisandbhor added a commit that referenced this pull request May 29, 2024
* fix: added bulk actions

* chore: migrate bulk publish & unpublish to v5

* chore: change findLocales type to accept arrays

* chore: fix lint error

* chore: migrate bulkDelete to v5 (#20161)

* chore: migrate bulkDelete to v5

* chore: change findLocales type to accept strings array

* fix: docs prettier styles

* chore: remove console.log

* enhancement: migrate countManyDraftRelations to v5

* feat: bulk delete with locale selection option

* fix: bulk unpublish working without locale support

* test: e2e tests updated

* fix: documents api change, deleteMany tags updated, test skipped

* chore: renaming

* test: reverting e2e tests for delete action changes

* feat: publish action changes

* fix: reverting publish action changes

* fix: hide add to release as its not ready to be migrated

* fix: error message updated

* fix: tests updated for useDocumentAction

* fix: updated request params

* fix: publish action added

* fix: publish action changes with documentId

* fix: reverting wrong commit message

Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>

* fix: comments updated

* chore: renaming

* chore: add type to bulk action actions (#20256)

* chore: actionType renamed to just type

* fix: added missing import

* test: fixed

* fix(content-manager): edit entry button on bulk publish modal

* fix: validationError message type is not as expected

* fix: ts error

* only fetch entries when modal is opened

* fix(content-releases): use status to show the published instead of publishedAt

* fix: alignment fix, update selectedEntries to reflect count, reset selectedEntries on locale change

* fix: fixed type error

---------

Co-authored-by: Fernando Chavez <fernando.chavez@strapi.io>
Co-authored-by: Josh <37798644+joshuaellis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes/type: maintenance Upkeeping efforts, chores and catch-up corrective improvements that are not features nor bugs pr: chore This PR contains chore tasks (cleanups, configs, tooling...) source: core:content-manager Source is core/content-manager package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants