-
Notifications
You must be signed in to change notification settings - Fork 589
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
Conversation
There was a problem hiding this 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"}> |
There was a problem hiding this comment.
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;
`;
There was a problem hiding this comment.
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.
packages/app-headless-cms/src/admin/components/ContentEntries/BulkActions/styles.tsx
Outdated
Show resolved
Hide resolved
# Conflicts: # packages/app-headless-cms/src/admin/components/ContentEntries/Table/index.tsx
Changes
With this PR, we allow bulk actions to headless CMS entries. The default bulk actions are:
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)