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

[5.x] Use Create Revision instead of Publish in publish form if no publish permission #10424

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions resources/js/components/entries/PublishForm.vue
edalzell marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
v-if="revisionsEnabled && !isCreating"
class="rtl:mr-4 ltr:ml-4 btn-primary flex items-center"
:disabled="!canPublish"
@click="confirmingPublish = true">
<span>{{ __('Publish') }}…</span>
</button>
@click="confirmingPublish = true"
v-text="publishButtonText"
/>
</div>

<slot name="action-buttons-right" />
Expand Down Expand Up @@ -471,6 +471,14 @@ export default {
}
},

publishButtonText() {
if (this.canManagePublishState) {
return `${__('Publish')}…`
}

return `${__('Create Revision')}…`
},

isUnpublishing() {
return this.initialPublished && ! this.published && ! this.isCreating;
},
Expand Down
Loading