Ghost/ghost/admin/app/components/editor/modals/publish-flow.hbs

55 lines
2.3 KiB
Handlebars
Raw Normal View History

<div class="flex flex-column h-100 items-center overflow-auto">
<header class="gh-publish-header" data-test-modal="publish-flow">
2022-05-16 14:50:54 +03:00
<button class="gh-btn-editor gh-publish-back-button" title="Close" type="button" {{on "click" @close}}>
<span>{{svg-jar "arrow-left"}} Editor</span>
</button>
{{#if (and (not this.emailErrorMessage) (not this.isComplete))}}
<div class="flex items-center pe-auto h-100">
<button
type="button"
class="gh-btn gh-btn-editor gh-editor-preview-trigger"
{{on "click" @data.togglePreviewPublish}}
>
<span>Preview</span>
</button>
<button class="gh-btn gh-btn-editor darkgrey gh-publish-trigger active" title="Close" type="button" {{on "click" @close}}>
<span>Publish</span>
</button>
<div class="settings-menu-toggle-spacer"></div>
</div>
{{/if}}
</header>
<div class="gh-publish-settings-container {{unless @data.skipAnimation "fade-in"}}">
{{#if this.emailErrorMessage}}
<Editor::Modals::PublishFlow::CompleteWithEmailError
@emailErrorMessage={{this.emailErrorMessage}}
@publishOptions={{@data.publishOptions}}
@close={{@close}}
/>
{{else if this.isConfirming}}
<Editor::Modals::PublishFlow::Confirm
@publishOptions={{@data.publishOptions}}
@recipientType={{this.recipientType}}
Added first iteration of saving to new publish flow refs https://github.com/TryGhost/Team/issues/1542 - extracted before/after save routines in the editor controller into separate actions - allows saving to occur in the publish flow without it needing any editor-specific knowledge - allows for easier cleanup of email related logic from the editor save tasks later on - added `saveTask` to `PublishOptions` - applies the selected options to the post model where they correspond to model attributes and keeps the previous values in memory so the changes can be undone on failure - this keeps the local model state in sync because if a publish fails we want the editor to continue showing the draft state, non-scheduled publish time, and not have an unexpected email-only state - saves the post model directly passing `adapterOptions` so the save request query params match the chosen publish options - added a `saveTask` to the `<PublishManagement>` component - passed through to the `publish-flow` modal and is triggered by the confirm button on the confirmation screen - runs the before/afterSave arguments passed in from the editor - runs the `saveTask` on `PublishOptions` which handles everything needed to change status and send emails - polls the post after saving to wait for the attached email to switch to submitted/failed which lets us show a failure message and retry button as required (message + retry not yet implemented) - adds "complete" state to publish flow once save has finished - confirms what just happened based on saved post data rather than chosen publish options - has a link to the view the post
2022-05-04 12:30:37 +03:00
@saveTask={{this.saveTask}}
@cancel={{this.toggleConfirm}}
@close={{@close}}
/>
Added first iteration of saving to new publish flow refs https://github.com/TryGhost/Team/issues/1542 - extracted before/after save routines in the editor controller into separate actions - allows saving to occur in the publish flow without it needing any editor-specific knowledge - allows for easier cleanup of email related logic from the editor save tasks later on - added `saveTask` to `PublishOptions` - applies the selected options to the post model where they correspond to model attributes and keeps the previous values in memory so the changes can be undone on failure - this keeps the local model state in sync because if a publish fails we want the editor to continue showing the draft state, non-scheduled publish time, and not have an unexpected email-only state - saves the post model directly passing `adapterOptions` so the save request query params match the chosen publish options - added a `saveTask` to the `<PublishManagement>` component - passed through to the `publish-flow` modal and is triggered by the confirm button on the confirmation screen - runs the before/afterSave arguments passed in from the editor - runs the `saveTask` on `PublishOptions` which handles everything needed to change status and send emails - polls the post after saving to wait for the attached email to switch to submitted/failed which lets us show a failure message and retry button as required (message + retry not yet implemented) - adds "complete" state to publish flow once save has finished - confirms what just happened based on saved post data rather than chosen publish options - has a link to the view the post
2022-05-04 12:30:37 +03:00
{{else if this.isComplete}}
<Editor::Modals::PublishFlow::Complete
Added first iteration of saving to new publish flow refs https://github.com/TryGhost/Team/issues/1542 - extracted before/after save routines in the editor controller into separate actions - allows saving to occur in the publish flow without it needing any editor-specific knowledge - allows for easier cleanup of email related logic from the editor save tasks later on - added `saveTask` to `PublishOptions` - applies the selected options to the post model where they correspond to model attributes and keeps the previous values in memory so the changes can be undone on failure - this keeps the local model state in sync because if a publish fails we want the editor to continue showing the draft state, non-scheduled publish time, and not have an unexpected email-only state - saves the post model directly passing `adapterOptions` so the save request query params match the chosen publish options - added a `saveTask` to the `<PublishManagement>` component - passed through to the `publish-flow` modal and is triggered by the confirm button on the confirmation screen - runs the before/afterSave arguments passed in from the editor - runs the `saveTask` on `PublishOptions` which handles everything needed to change status and send emails - polls the post after saving to wait for the attached email to switch to submitted/failed which lets us show a failure message and retry button as required (message + retry not yet implemented) - adds "complete" state to publish flow once save has finished - confirms what just happened based on saved post data rather than chosen publish options - has a link to the view the post
2022-05-04 12:30:37 +03:00
@publishOptions={{@data.publishOptions}}
@recipientType={{this.recipientType}}
@postCount={{this.postCount}}
Added first iteration of saving to new publish flow refs https://github.com/TryGhost/Team/issues/1542 - extracted before/after save routines in the editor controller into separate actions - allows saving to occur in the publish flow without it needing any editor-specific knowledge - allows for easier cleanup of email related logic from the editor save tasks later on - added `saveTask` to `PublishOptions` - applies the selected options to the post model where they correspond to model attributes and keeps the previous values in memory so the changes can be undone on failure - this keeps the local model state in sync because if a publish fails we want the editor to continue showing the draft state, non-scheduled publish time, and not have an unexpected email-only state - saves the post model directly passing `adapterOptions` so the save request query params match the chosen publish options - added a `saveTask` to the `<PublishManagement>` component - passed through to the `publish-flow` modal and is triggered by the confirm button on the confirmation screen - runs the before/afterSave arguments passed in from the editor - runs the `saveTask` on `PublishOptions` which handles everything needed to change status and send emails - polls the post after saving to wait for the attached email to switch to submitted/failed which lets us show a failure message and retry button as required (message + retry not yet implemented) - adds "complete" state to publish flow once save has finished - confirms what just happened based on saved post data rather than chosen publish options - has a link to the view the post
2022-05-04 12:30:37 +03:00
@close={{@close}}
/>
{{else}}
<Editor::Modals::PublishFlow::Options
@publishOptions={{@data.publishOptions}}
@recipientType={{this.recipientType}}
@confirm={{this.toggleConfirm}}
@close={{@close}}
/>
{{/if}}
</div>
</div>