Commit b95df0b
authored
fix(ui): document status shows changed after publishing specific locale (#15765)
### What?
When `localizeStatus` is enabled and `defaultLocalePublishOption` is set
to `active`, publishing a specific locale leaves the document status
showing "Changed" instead of "Published" until the page is refreshed.
### Why?
The `publishSpecificLocale` callback in `PublishButton` only called
`setHasPublishedDoc(true)` on success, but did not reset
`unpublishedVersionCount` or `mostRecentVersionIsAutosaved`. The
`Status` component uses `unpublishedVersionCount > 0 && hasPublishedDoc`
to render "Changed", so the stale count kept the status incorrect.
The `publish` (all locales) callback already handled this correctly,
`publishSpecificLocale` was just missing the same state resets.
### How?
Added `setUnpublishedVersionCount(0)` and
`setMostRecentVersionIsAutosaved(false)` to the `publishSpecificLocale`
success handler, matching what `publish` already does. Added an e2e test
that reproduces the issue.1 parent b97b4e7 commit b95df0b
File tree
2 files changed
+33
-1
lines changed- packages/ui/src/elements/PublishButton
- test/admin/e2e/document-view
2 files changed
+33
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| 238 | + | |
| 239 | + | |
238 | 240 | | |
239 | 241 | | |
240 | 242 | | |
241 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
242 | 254 | | |
243 | 255 | | |
244 | 256 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
749 | 769 | | |
750 | 770 | | |
751 | 771 | | |
| |||
0 commit comments