Ghost/ghost/admin/app/components/posts/debug.hbs
Peter Zimon f562d19f3c Updated error display styles for error debug
refs. https://github.com/TryGhost/Team/issues/2327

- Some minor CSS style changes were needed for errors on the email debug screen. Also we weren't showing any message i - for whatever reason - there was no data for batches.
2022-12-02 15:13:07 +01:00

534 lines
29 KiB
Handlebars

<section class="gh-canvas gh-email-debug" {{did-insert this.loadData}}>
<GhCanvasHeader class="gh-canvas-header gh-post-analytics-header">
<div class="flex flex-column flex-grow-1">
<div class="gh-canvas-breadcrumb">
<LinkTo @route="posts">
Posts
</LinkTo>
{{svg-jar "arrow-right-small"}}
<LinkTo @route="posts.analytics" @model={{this.post.id}}>
Analytics
</LinkTo>
{{svg-jar "arrow-right-small"}}
Debug
</div>
<h2 class="gh-canvas-title gh-post-title">
Post title
</h2>
<div class="gh-post-analytics-meta">
<div class="gh-post-analytics-meta-text">
{{#if this.post.hasBeenEmailed }}
{{#if this.post.emailOnly}}
Sent
{{else}}
Published and sent
{{/if}}
{{else}}
Published
{{#if @post.didEmailFail}}
but failed to send
{{else}}
on your site
{{/if}}
{{/if}}
{{#let (moment-site-tz this.post.publishedAtUTC) as |publishedAt|}}
on
{{moment-format publishedAt "D MMM YYYY"}}
at
{{moment-format publishedAt "HH:mm"}}
{{/let}}
</div>
</div>
{{#if (eq this.post.email.status 'failed') }}
<div class="gh-box gh-box-error gh-box-tip gh-email-debug-error">
{{svg-jar "warning"}}
<div class="gh-email-debug-errortext">
<h4>Something went wrong!</h4>
<p class="mb0">{{this.emailError.message}}</p>
</div>
<LinkTo @route="editor.edit" @models={{array this.post.displayName this.post.id}} class="gh-btn gh-btn-primary gh-btn-icon gh-btn-red ember-view self-center">
<span>Retry</span>
</LinkTo>
</div>
{{/if}}
</div>
</GhCanvasHeader>
<Tabs::Tabs class="gh-tabs-analytics" @forceRender={{true}} as |tabs|>
<tabs.tab>
<h3>{{svg-jar "analytics-tab-sent-large"}} {{this.tabTotals.permanentFailures}}</h3>
<p><span class="analytics-tab-label">Permanent failures</span></p>
</tabs.tab>
<tabs.tabPanel>
<table class="gh-list gh-email-debug-permanent-failures">
<tbody>
{{#each this.permanentFailureData as |failure|}}
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
<figure class="gh-member-gravatar w9 h9 mr3 flex-shrink-0 bg-red">
<div class="gh-member-initials flex w9 h9 items-center justify-center br-100">
<span class="gh-member-avatar-label gh-member-list-avatar">{{failure.recipient.initials}}</span>
</div>
{{!-- {{#if this.avatarImage}}
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or failure.member.name failure.member.email}}" />
{{/if}} --}}
</figure>
<div>
<h3 class="ma0 pa0 gh-members-list-name">{{failure.recipient.name}}</h3>
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">{{failure.recipient.email}}</p>
</div>
</div>
</div>
<div class="gh-list-data gh-email-debug-col-failure">
<div class="gh-email-debug-failure">
<div class="gh-email-debug-failure-details">
<div class="gh-email-debug-failure-codes">
<span class="gh-email-debug-failure-code">Failure code: <span>{{failure.code}}</span></span>
<span class="gh-email-debug-failure-code">Enhanced code: <span>{{failure.enhancedCode}}</span></span>
</div>
<span class="gh-email-debug-failure-description"><code>{{failure.message}}</code></span>
</div>
</div>
</div>
</tr>
{{/each}}
{{#unless this.permanentFailureData}}
<tr>
<td>
<div class="gh-email-debug-empty-list">No permanent failures.</div>
</td>
</tr>
{{/unless}}
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
<figure class="gh-member-gravatar w9 h9 mr3 flex-shrink-0 bg-red">
<div class="gh-member-initials flex w9 h9 items-center justify-center br-100">
<span class="gh-member-avatar-label gh-member-list-avatar">PD</span>
</div>
{{#if this.avatarImage}}
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or @member.name @member.email}}" />
{{/if}}
</figure>
<div>
<h3 class="ma0 pa0 gh-members-list-name">Permanent Dude</h3>
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">dude@whofails.com</p>
</div>
</div>
</div>
<div class="gh-list-data gh-email-debug-col-failure">
<div class="gh-email-debug-failure">
<div class="gh-email-debug-failure-details">
<div class="gh-email-debug-failure-codes">
<span class="gh-email-debug-failure-code">Failure code: <span>402</span></span>
<span class="gh-email-debug-failure-code">Enhanced code: <span>4.2.2</span></span>
</div>
<div class="gh-email-debug-readmore-error">
<input type="checkbox" id="error-1-checkbox" class="toggle-checkbox">
<label for="error-1-checkbox">{{svg-jar "dotdotdot"}}</label>
<span>4.2.2 The email account that you tried to reach is over quota. Please direct\n4.2.2 the recipient to\n4.2.2 https://support.google.com/mail/?p=OverQuotaTemp bb1-20020a05622a1b0100b0039ce87e3d49si1009300qtb.292 - gsmtp</span>
</div>
</div>
</div>
</div>
</tr>
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
<figure class="gh-member-gravatar w9 h9 mr3 flex-shrink-0 bg-red">
<div class="gh-member-initials flex w9 h9 items-center justify-center br-100">
<span class="gh-member-avatar-label gh-member-list-avatar">PD</span>
</div>
{{#if this.avatarImage}}
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or @member.name @member.email}}" />
{{/if}}
</figure>
<div>
<h3 class="ma0 pa0 gh-members-list-name">Permanent Dude</h3>
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">dude@whofails.com</p>
</div>
</div>
</div>
<div class="gh-list-data gh-email-debug-col-failure">
<div class="gh-email-debug-failure">
<div class="gh-email-debug-failure-details">
<div class="gh-email-debug-failure-codes">
<span class="gh-email-debug-failure-code">Failure code: <span>402</span></span>
<span class="gh-email-debug-failure-code">Enhanced code: <span>4.2.2</span></span>
</div>
<div class="gh-email-debug-readmore-error">
<input type="checkbox" id="error-2-checkbox" class="toggle-checkbox">
<label for="error-2-checkbox">{{svg-jar "dotdotdot"}}</label>
<span>4.2.2 The email account that you tried to reach is over quota. Please direct\n4.2.2 the recipient to\n4.2.2 https://support.google.com/mail/?p=OverQuotaTemp bb1-20020a05622a1b0100b0039ce87e3d49si1009300qtb.292 - gsmtp</span>
</div>
</div>
</div>
</div>
</tr>
</tbody>
</table>
</tabs.tabPanel>
<tabs.tab>
<h3>{{svg-jar "analytics-tab-opened-large"}}{{this.tabTotals.temporaryFailures}}</h3>
<p><span class="analytics-tab-label">Temporary failures</span></p>
</tabs.tab>
<tabs.tabPanel>
<table class="gh-list gh-email-debug-permanent-failures">
<tbody>
{{#each this.temporaryFailureData as |failure|}}
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
<figure class="gh-member-gravatar w9 h9 mr3 flex-shrink-0 bg-purple">
<div class="gh-member-initials flex w9 h9 items-center justify-center br-100">
<span class="gh-member-avatar-label gh-member-list-avatar">{{failure.recipient.initials}}</span>
</div>
{{!-- {{#if this.avatarImage}}
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or failure.recipient.name failure.recipient.email}}" />
{{/if}} --}}
</figure>
<div>
<h3 class="ma0 pa0 gh-members-list-name">{{failure.recipient.name}}</h3>
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">{{failure.recipient.email}}</p>
</div>
</div>
</div>
<div class="gh-list-data gh-email-debug-col-failure">
<div class="gh-email-debug-failure">
<div class="gh-email-debug-failure-details">
<div class="gh-email-debug-failure-codes">
<span class="gh-email-debug-failure-code">Failure code: <span>{{failure.code}}</span></span>
<span class="gh-email-debug-failure-code">Enhanced code: <span>{{failure.enhancedCode}}</span></span>
</div>
<span class="gh-email-debug-failure-description">
<code>{{failure.message}}</code>
</span>
</div>
</div>
</div>
</tr>
{{/each}}
{{#unless this.temporaryFailureData}}
<tr>
<td>
<div class="gh-email-debug-empty-list">No temporary failures.</div>
</td>
</tr>
{{/unless}}
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
<figure class="gh-member-gravatar w9 h9 mr3 flex-shrink-0 bg-purple">
<div class="gh-member-initials flex w9 h9 items-center justify-center br-100">
<span class="gh-member-avatar-label gh-member-list-avatar">TD</span>
</div>
{{#if this.avatarImage}}
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or @member.name @member.email}}" />
{{/if}}
</figure>
<div>
<h3 class="ma0 pa0 gh-members-list-name">Temporary Dude</h3>
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">dude@whofails.com</p>
</div>
</div>
</div>
<div class="gh-list-data gh-email-debug-col-failure">
<div class="gh-email-debug-failure">
<div class="gh-email-debug-failure-details">
<div class="gh-email-debug-failure-codes">
<span class="gh-email-debug-failure-code">Failure code: <span>402</span></span>
<span class="gh-email-debug-failure-code">Enhanced code: <span>4.2.2</span></span>
</div>
<div class="gh-email-debug-readmore-error">
<input type="checkbox" id="error-3-checkbox" class="toggle-checkbox">
<label for="error-3-checkbox">{{svg-jar "dotdotdot"}}</label>
<span>4.2.2 The email account that you tried to reach is over quota. Please direct\n4.2.2 the recipient to\n4.2.2 https://support.google.com/mail/?p=OverQuotaTemp bb1-20020a05622a1b0100b0039ce87e3d49si1009300qtb.292 - gsmtp</span>
</div>
</div>
</div>
</div>
</tr>
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
<figure class="gh-member-gravatar w9 h9 mr3 flex-shrink-0 bg-purple">
<div class="gh-member-initials flex w9 h9 items-center justify-center br-100">
<span class="gh-member-avatar-label gh-member-list-avatar">TD</span>
</div>
{{#if this.avatarImage}}
<img class="gh-member-avatar-image" src="{{this.avatarImage}}" alt="{{or @member.name @member.email}}" />
{{/if}}
</figure>
<div>
<h3 class="ma0 pa0 gh-members-list-name">Teporary Dude</h3>
<p class="ma0 pa0 middarkgrey f8 gh-members-list-email">dude@whofails.com</p>
</div>
</div>
</div>
<div class="gh-list-data gh-email-debug-col-failure">
<div class="gh-email-debug-failure">
<div class="gh-email-debug-failure-details">
<div class="gh-email-debug-failure-codes">
<span class="gh-email-debug-failure-code">Failure code: <span>402</span></span>
<span class="gh-email-debug-failure-code">Enhanced code: <span>4.2.2</span></span>
</div>
<div class="gh-email-debug-readmore-error">
<input type="checkbox" id="error-4-checkbox" class="toggle-checkbox">
<label for="error-4-checkbox">{{svg-jar "dotdotdot"}}</label>
<span>4.2.2 The email account that you tried to reach is over quota. Please direct\n4.2.2 the recipient to\n4.2.2 https://support.google.com/mail/?p=OverQuotaTemp bb1-20020a05622a1b0100b0039ce87e3d49si1009300qtb.292 - gsmtp</span>
</div>
</div>
</div>
</div>
</tr>
</tbody>
</table>
</tabs.tabPanel>
<tabs.tab>
<h3>{{svg-jar "analytics-tab-clicked-large"}}{{this.tabTotals.erroredBatches}}</h3>
<p><span class="analytics-tab-label">Batches errored</span></p>
</tabs.tab>
<tabs.tabPanel>
<table class="gh-list gh-email-debug-batches">
<thead>
<tr class="gh-list-row header">
<th class="gh-list-header">Status</th>
<th class="gh-list-header">Created</th>
<th class="gh-list-header">Segment</th>
<th class="gh-list-header">Recipients</th>
<th class="gh-list-header">Details</th>
</tr>
</thead>
<tbody>
{{#each this.emailBatchesData as |batch|}}
<tr>
<div class="gh-list-data gh-email-debug-batch-col-status">
<span class="{{batch.statusClass}}">{{batch.status}}</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-created">
<span>{{batch.createdAt}}</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-segment">
{{#if batch.segment}}
<span>{{batch.segment}}</span>
{{else}}
<div class="dib lightgrey">N/A</div>
{{/if}}
</div>
<div class="gh-list-data gh-email-debug-batch-col-recipients">
<span>{{batch.recipientCount}}</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-details">
<div class="flex flex-col items-center space-between w100">
{{#if (or batch.providerId batch.errorStatusCode batch.errorMessage)}}
<div class="detailtext">
{{#if batch.providerId}}
<div>Provider id:
<span>
{{batch.providerId}}
</span>
</div>
{{/if}}
{{#if batch.errorStatusCode}}
<div>
Failure status code: <span>{{batch.errorStatusCode}}</span>
</div>
{{/if}}
{{#if batch.errorMessage}}
<span class="error">{{batch.errorMessage}}</span>
{{/if}}
</div>
{{#if batch.errorMessage}}
<div class="download-icon">{{svg-jar "download" title="Download full failure message"}}</div>
{{/if}}
{{else}}
<div class="dib lightgrey">N/A</div>
{{/if}}
</div>
</div>
</tr>
{{/each}}
{{#unless this.emailBatchesData}}
<tr>
<td>
<div class="gh-email-debug-empty-list">No batch data.</div>
</td>
</tr>
{{/unless}}
{{!-- <tr>
<div class="gh-list-data gh-email-debug-batch-col-status">
<span class="failed">Failed</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-created">
<span>22 June, 2022 19:34:29</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-segment">
<span>-status:free</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-recipients">
<span>1,000</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-details">
<div class="flex flex-col items-center space-between w100">
<div class="detailtext">
<div>Provider id: <span>20220824043031.b31949925525913d@m.ghost.io</span></div>
<div>Failure status code: <span>500</span></div>
<span class="error">Mailgun Error 500: Internal server error</span>
</div>
<div class="download-icon">{{svg-jar "download" title="Download full failure message"}}</div>
</div>
</div>
</tr>
<tr>
<div class="gh-list-data gh-email-debug-batch-col-status">
<span class="pending">Pending</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-created">
<span>22 June, 2022 19:34:29</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-segment">
<span>-status:free</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-recipients">
<span>1,000</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-details">
<div class="flex flex-col items-center space-between w100">
<div class="detailtext">
<div>Provider id: <span>20220824043031.b31949925525913d@m.ghost.io</span></div>
</div>
</div>
</div>
</tr>
<tr>
<div class="gh-list-data gh-email-debug-batch-col-status">
<span class="submitting">Submitting</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-created">
<span>22 June, 2022 19:34:29</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-segment">
<span>-status:free</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-recipients">
<span>1,000</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-details">
<div class="flex flex-col items-center space-between w100">
<div class="detailtext">
<div>Provider id: <span>20220824043031.b31949925525913d@m.ghost.io</span></div>
</div>
</div>
</div>
</tr>
<tr>
<div class="gh-list-data gh-email-debug-batch-col-status">
<span class="submitted">Submitted</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-created">
<span>22 June, 2022 19:34:29</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-segment">
<span>-status:free</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-recipients">
<span>1,000</span>
</div>
<div class="gh-list-data gh-email-debug-batch-col-details">
<div class="flex flex-col items-center space-between w100">
<div class="detailtext">
<div>Provider id: <span>20220824043031.b31949925525913d@m.ghost.io</span></div>
</div>
</div>
</div>
</tr> --}}
</tbody>
</table>
</tabs.tabPanel>
<tabs.tab>
<div class="gh-email-debug-settingstab-icon">{{svg-jar "settings"}}</div>
<p><span class="analytics-tab-label">Settings</span></p>
</tabs.tab>
<tabs.tabPanel>
<table class="gh-email-debug-settings">
<tbody>
<tr>
<td>Status:</td>
<td class="gh-email-debug-batch-col-status"><span class="{{this.emailSettings.statusClass}}">{{this.emailSettings.status}}</span></td>
</tr>
<tr>
<td>Recipient filter:</td>
<td class="gh-email-debug-batch-col-segment"><span>{{this.emailSettings.recipientFilter}}</span></td>
</tr>
<tr>
<td>Created at:</td>
<td>{{this.emailSettings.createdAt}}</td>
</tr>
<tr>
<td>Submitted at:</td>
<td>{{this.emailSettings.submittedAt}}</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td>Emails sent:</td>
<td>{{this.emailSettings.emailsSent}}</td>
</tr>
<tr>
<td>Delivered:</td>
<td>{{this.emailSettings.emailsDelivered}}</td>
</tr>
<tr>
<td>Failed:</td>
<td>{{this.emailSettings.emailsFailed}}</td>
</tr>
<tr>
<td colspan="2"><hr></td>
</tr>
<tr>
<td>Track opens:</td>
<td class="gh-email-debug-settings-icon">
{{#if this.emailSettings.trackOpens}}
<span class="check">{{svg-jar "check-2"}}</span>
{{else}}
<span class="x">{{svg-jar "close"}}</span>
{{/if}}
</td>
</tr>
<tr>
<td>Track clicks:</td>
<td class="gh-email-debug-settings-icon">
{{#if this.emailSettings.trackClicks}}
<span class="check">{{svg-jar "check-2"}}</span>
{{else}}
<span class="x">{{svg-jar "close"}}</span>
{{/if}}
</td>
</tr>
<tr>
<td>Member feedback:</td>
<td class="gh-email-debug-settings-icon">
{{#if this.emailSettings.feedbackEnabled}}
<span class="check">{{svg-jar "check-2"}}</span>
{{else}}
<span class="x">{{svg-jar "close"}}</span>
{{/if}}
</td>
</tr>
</tbody>
</table>
</tabs.tabPanel>
</Tabs::Tabs>
</section>