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: add bulk actions to HCMS #3501

Merged
merged 9 commits into from
Sep 12, 2023
Merged

feat: add bulk actions to HCMS #3501

merged 9 commits into from
Sep 12, 2023

Conversation

leopuleo
Copy link
Contributor

Changes

With this PR, we allow bulk actions to headless CMS entries. The default bulk actions are:

  • Publish
  • Unpublish
  • Move
  • Delete

Third-party developers can add bulk actions: a new article describing the process will be added to the developer docs.

How Has This Been Tested?

Jest + manually

Documentation

Inline + Developer Doc article (TBD)

@leopuleo leopuleo added this to the 5.38.0 milestone Aug 28, 2023
@leopuleo leopuleo requested a review from Pavel910 August 28, 2023 16:11
@leopuleo leopuleo self-assigned this Aug 28, 2023
Copy link
Collaborator

@Pavel910 Pavel910 left a comment

Choose a reason for hiding this comment

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

Just a few comments here, and we are good. In general, it's great that you developed a system first (the configuration), then followed the same approach for every action.

@@ -34,7 +36,7 @@ export const Buttons: React.VFC<ButtonsProps> = props => {
return (
<>
{props.actions.map(action => (
<ButtonContainer key={action.name}>
<ButtonContainer key={action.name} className={"button-container"}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding CSS classes randomly is a bad idea. It's better to either add props to the component, or simply create a component variant, like <NoMarginButtonContainer>, and you can even keep it local to this view.

const NoMarginButtonContainer = styled(ButtonContainer)`
    margin: 0;
`;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here is the problem: We are using the same component to render Entry Editor Actions and now the Entry List Bulk actions.

I don't like to use the CSS class but I need to target the single action from different parts of the UI.

I changed it: now I'm exporting the styled component from the @webiny/app-admin package so I can target it inside the specific component.

# Conflicts:
#	packages/app-headless-cms/src/admin/components/ContentEntries/Table/index.tsx
@leopuleo leopuleo merged commit 55f4764 into next Sep 12, 2023
59 checks passed
@leopuleo leopuleo deleted the leo/feat/hcms-bulk-actions branch September 20, 2023 07:20
brunozoric pushed a commit that referenced this pull request Oct 10, 2023
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.

None yet

2 participants