diff --git a/ghost/admin/app/components/editor/modals/publish-flow/confirm.hbs b/ghost/admin/app/components/editor/modals/publish-flow/confirm.hbs index 4006d594d6..e216ebc21d 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/confirm.hbs +++ b/ghost/admin/app/components/editor/modals/publish-flow/confirm.hbs @@ -67,6 +67,7 @@ @class="gh-btn gh-btn-large" @idleClass="gh-btn-pulse" @runningClass="gh-btn-green gh-btn-icon" + @failureClass="gh-btn-red gh-btn-icon" data-test-button="confirm-publish" /> diff --git a/ghost/admin/app/components/editor/modals/publish-flow/confirm.js b/ghost/admin/app/components/editor/modals/publish-flow/confirm.js index 6247e07415..b6e2a68185 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/confirm.js +++ b/ghost/admin/app/components/editor/modals/publish-flow/confirm.js @@ -101,15 +101,19 @@ export default class PublishFlowOptions extends Component { let errorMessage = ''; + const payloadError = e?.payload?.errors?.[0]; + if (isServerUnreachableError(e)) { errorMessage = 'Unable to connect, please check your internet connection and try again.'; + } else if (payloadError?.type === 'HostLimitError') { + errorMessage = htmlSafe(payloadError.context.replace(/please upgrade/i, '$&')); } else if (e && isString(e)) { errorMessage = e; } else if (e && isArray(e)) { // This is here because validation errors are returned as an array // TODO: remove this once validations are fixed errorMessage = e[0]; - } else if (e?.payload?.errors?.[0].message) { + } else if (payloadError?.message) { errorMessage = e.payload.errors[0].message; } else { errorMessage = 'Unknown Error'; diff --git a/ghost/admin/app/components/editor/modals/publish-flow/options.hbs b/ghost/admin/app/components/editor/modals/publish-flow/options.hbs index 59ad2f737c..40cb88be4e 100644 --- a/ghost/admin/app/components/editor/modals/publish-flow/options.hbs +++ b/ghost/admin/app/components/editor/modals/publish-flow/options.hbs @@ -2,13 +2,23 @@
+ {{@publishOptions.publishDisabledError}} +
+ {{/if}} {{else}}