0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Wired static expand error logic on email debug

refs https://github.com/TryGhost/Team/issues/2327

- wires the static handling of error message on debug screen with real error
This commit is contained in:
Rishabh 2022-12-02 20:40:25 +05:30
parent d9ed6bcdb8
commit ddb61c3b3c
2 changed files with 22 additions and 151 deletions

View file

@ -64,7 +64,7 @@
<tabs.tabPanel>
<table class="gh-list gh-email-debug-permanent-failures">
<tbody>
{{#each this.permanentFailureData as |failure|}}
{{#each this.permanentFailureData as |failure index|}}
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
@ -72,9 +72,6 @@
<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>
@ -83,13 +80,15 @@
</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 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>
<div class="gh-email-debug-readmore-error">
<input type="checkbox" id="error-{{index}}-checkbox" class="toggle-checkbox">
<label for="error-{{index}}-checkbox">{{svg-jar "dotdotdot"}}</label>
<span>{{failure.message}}</span>
</div>
</div>
</div>
@ -102,72 +101,6 @@
</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>
@ -180,7 +113,7 @@
<tabs.tabPanel>
<table class="gh-list gh-email-debug-permanent-failures">
<tbody>
{{#each this.temporaryFailureData as |failure|}}
{{#each this.temporaryFailureData as |failure index|}}
<tr>
<div class="gh-list-data gh-email-debug-col-member">
<div class="gh-email-debug-member">
@ -205,9 +138,11 @@
<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 class="gh-email-debug-readmore-error">
<input type="checkbox" id="error-{{index}}-checkbox-permanent" class="toggle-checkbox">
<label for="error-{{index}}-checkbox-permanent">{{svg-jar "dotdotdot"}}</label>
<span>{{failure.message}}</span>
</div>
</div>
</div>
</div>
@ -220,72 +155,6 @@
</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>

View file

@ -30,8 +30,8 @@ export default class Debug extends Component {
statusClass: this.post.email?.status,
status: this.getStatusLabel(this.post.email?.status),
recipientFilter: this.post.email?.recipientFilter,
createdAt: this.post.email.createdAtUTC ? moment(this.post.email.createdAtUTC).format('DD MMM, YYYY, HH:mm:ss') : '',
submittedAt: this.post.email.submittedAtUTC ? moment(this.post.email.submittedAtUTC).format('DD MMM, YYYY, HH:mm:ss') : '',
createdAt: this.post.email?.createdAtUTC ? moment(this.post.email.createdAtUTC).format('DD MMM, YYYY, HH:mm:ss') : '',
submittedAt: this.post.email?.submittedAtUTC ? moment(this.post.email.submittedAtUTC).format('DD MMM, YYYY, HH:mm:ss') : '',
emailsSent: this.post.email?.emailCount,
emailsDelivered: this.post.email?.deliveredCount,
emailsFailed: this.post.email?.failedCount,
@ -140,8 +140,10 @@ export default class Debug extends Component {
@action
loadData() {
this.fetchEmailBatches();
this.fetchRecipientFailures();
if (this.post.email) {
this.fetchEmailBatches();
this.fetchRecipientFailures();
}
}
async fetchEmailBatches() {