Ghost/ghost/admin/app/templates/components/modal-theme-warnings.hbs
Kevin Ansfield 67afe653cd 🐛 Fixed missing error details when activating a theme with fatal errors
no issue
- the API response for theme activation when a fatal validation error occurred has changed but the client wasn't updated resulting in a modal containing an "Activation failed" header but no details
- updates the error details extraction path and adjusts the tests to match the real API response
2019-04-11 11:00:40 +01:00

65 lines
2.2 KiB
Handlebars

<div class="theme-validation-container">
<header class="modal-header">
<h1 data-test-theme-warnings-title>
{{#unless this.canActivate}}
{{this.title}}
{{else}}
{{this.title}} with {{#if this.errors}}errors{{else}}warnings{{/if}}
{{/unless}}
</h1>
</header>
<a class="close" href="#" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a>
<div class="modal-body">
{{#if this.fatalErrors}}
<div>
<h2 class="mb0 mt4 f5 fw6 red">Fatal Errors</h2>
<p class="mb2 red">Must-fix to activate theme</p>
</div>
<ul class="pa0" data-test-theme-fatal-errors>
{{#each this.fatalErrors as |error|}}
<li class="theme-validation-item theme-fatal-error">
{{gh-theme-error-li error=error}}
</li>
{{/each}}
</ul>
{{/if}}
{{#if this.errors}}
<div>
<h2 class="mb0 mt4 f5 fw6">Errors</h2>
<p class="mb2">Highly recommended to fix, functionality <span>could</span> be restricted</p>
</div>
<ul class="pa0" data-test-theme-errors>
{{#each this.errors as |error|}}
<li class="theme-validation-item theme-error">
{{gh-theme-error-li error=error}}
</li>
{{/each}}
</ul>
{{/if}}
{{#if (and this.warnings (or this.fatalErrors this.errors))}}
<div>
<h2 class="mb0 mt4 f5 fw6">Warnings</h2>
</div>
{{/if}}
{{#if this.warnings}}
<ul class="pa0" data-test-theme-warnings>
{{#each this.warnings as |error|}}
<li class="theme-validation-item theme-warning">
{{gh-theme-error-li error=error}}
</li>
{{/each}}
</ul>
{{/if}}
</div>
</div>
<div class="modal-footer">
<button {{action "closeModal"}} class="gh-btn" data-test-modal-close-button>
<span>Ok</span>
</button>
</div>