0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Prevented post history from being viewed for emailed posts (#16704)

refs https://github.com/orgs/TryGhost/projects/88/views/2?pane=issue&itemId=26198422

Prevented post history from being viewed in the following scenarios:

- When a post is sent as and email only
- When a post is published and sent as an email
This commit is contained in:
Michael Barrett 2023-05-02 15:58:56 +01:00 committed by GitHub
parent 6aa8fa2a8e
commit b60761706b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -149,7 +149,7 @@
</div>
</li>
{{/unless}}
{{#if (and (feature 'postHistory') this.post.lexical)}}
{{#if this.canViewPostHistory}}
<li class="nav-list-item">
<button type="button" {{on "click" this.openPostHistory}} data-test-toggle="post-history">
<span>{{svg-jar "history" class="history"}} Post history</span>

View file

@ -144,6 +144,18 @@ export default class GhPostSettingsMenu extends Component {
return urlParts.join(' ');
}
get canViewPostHistory() {
let showPostHistory = this.feature.postHistory === true
&& this.post.lexical !== null
&& this.post.emailOnly === false;
if (this.post.isPublished === true) {
showPostHistory = this.post.hasEmail === false;
}
return showPostHistory;
}
willDestroyElement() {
super.willDestroyElement(...arguments);