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

feat(api-headless-cms-tasks): HCMS bulk actions via background tasks #4112

Merged
merged 110 commits into from
Aug 15, 2024

Conversation

leopuleo
Copy link
Contributor

@leopuleo leopuleo commented May 6, 2024

Changes

With this PR, we are introducing the bulk actions handled via background tasks.

By default, the users will be able to perform the following bulk actions:

  • Publish entries
  • Unpublish entries
  • Move entries to a folder
  • Move entries to the trash bin
  • Restore entries from the trash bin
  • Permanently delete entries

api-headless-cms-tasks

The package is responsible for:

  • adding task definitions that create subtasks after listing entries selected for the provided bulk action
  • adding task definitions responsible for processing the subtasks created after listing
  • registering the CmsGraphQLSchemaPlugin allowing to trigger bulk actions via custom mutation

app-headless-cms + app-trash-bin

When all entries are selected, a new banner will prompt asking if the user wants to select all of them.

The banner will appear if:

  • more entries are present but not yet loaded in the list (hasMoreItems: true)
  • the current folder contains child folders - currently, we are not checking if child folders are empty

In case the user confirms the selection, the action will be performed by the designated background task instead of the default in-series client worker.

At the moment:

  • In the case of selecting “all entries,” the selected count (e.g., 15 entries selected) will be replaced by a generic “All entries selected” as the application doesn't know the number of entries in sub-folders without additional queries.
  • We are not providing real-time feedback on the background task status. The user needs to reload the page to see the status update.

How Has This Been Tested?

Jest + manually

Documentation

Needed user guide + developer guide

leopuleo and others added 30 commits April 3, 2024 08:10
# Conflicts:
#	apps/api/graphql/tsconfig.json
#	packages/cwp-template-aws/template/ddb-es/apps/api/graphql/src/types.ts
#	packages/cwp-template-aws/template/ddb-os/apps/api/graphql/src/types.ts
#	packages/cwp-template-aws/template/ddb/apps/api/graphql/src/types.ts
@leopuleo leopuleo requested review from Pavel910 and brunozoric June 19, 2024 03:05
@leopuleo leopuleo added the api label Jun 19, 2024
@leopuleo leopuleo changed the title wip: HCMS bulk actions via background tasks feat(api-headless-cms-tasks): HCMS bulk actions via background tasks Jun 19, 2024
@leopuleo leopuleo marked this pull request as ready for review June 19, 2024 03:06
@leopuleo leopuleo merged commit 20bf08f into next Aug 15, 2024
94 checks passed
@leopuleo leopuleo deleted the leo/feat/hcms-bulk-actions-background-task branch September 9, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants