Skip to content

Commit

Permalink
fix: edit many modal draft action button order and style (#9046)
Browse files Browse the repository at this point in the history
### What?

Fix for See #9045 - this PR adjusts the order and the style of the draft
button to be consistent with the default edit-collection view.

### Why?

If "drafts" are enabled the "draft" action button is rendered on the 
- edit-many-modal: as a "primary" button, on the right side of the
"publish" button
- edit-collection view: as a "secondary" button, to the left of the
"publish" button

--> This is inconsistent and can lead to user mistakes pushing the wrong
button because muscle-memory+human-brains

### How?

Adjusted `EditMany/index.tsx`
 - setting the `buttonStyle` attribute for the `SaveDraft` component 
- switching the positions of the action buttons in the `EditMany`
component

### Fix

 - Before

![image](https://github.com/user-attachments/assets/f20ea03f-99a1-44d5-8402-a26d3daf9e95)

 - After

![image](https://github.com/user-attachments/assets/da556fc1-bf03-47e4-a619-202198df8be1)

---------

Co-authored-by: Patrik Kozak <[email protected]>
  • Loading branch information
abernh and PatrikKozak authored Nov 6, 2024
1 parent 9c25754 commit a907480
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const SaveDraft: React.FC<{ action: string; disabled: boolean }> = ({ action, di
}, [action, submit])

return (
<FormSubmit className={`${baseClass}__draft`} disabled={disabled} onClick={save}>
<FormSubmit buttonStyle="secondary" className={`${baseClass}__draft`} disabled={disabled} onClick={save}>
{t('saveDraft')}
</FormSubmit>
)
Expand Down Expand Up @@ -147,11 +147,11 @@ const EditMany: React.FC<Props> = (props) => {
<div className={`${baseClass}__document-actions`}>
{collection.versions ? (
<React.Fragment>
<Publish
<SaveDraft
action={`${serverURL}${api}/${slug}${getQueryParams()}&draft=true`}
disabled={selected.length === 0}
/>
<SaveDraft
<Publish
action={`${serverURL}${api}/${slug}${getQueryParams()}&draft=true`}
disabled={selected.length === 0}
/>
Expand Down

0 comments on commit a907480

Please sign in to comment.