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

🎨 Improved theme validation messages (#812)

closes TryGhost/Ghost#8530

- Changed the wording for activation and uploading a theme to separate between error and warnings in the title and the body text for the modal
- Changed the wording of "Activated successful with warnings/errors" to "Activation successful with (warnings || errors)"
This commit is contained in:
Aileen Nowak 2017-08-02 14:30:47 +04:00 committed by Katharina Irrgang
parent b89a0d0a5e
commit 6945c942d0
5 changed files with 17 additions and 8 deletions

View file

@ -7,6 +7,7 @@ export default ModalComponent.extend({
warnings: reads('model.warnings'), warnings: reads('model.warnings'),
errors: reads('model.errors'), errors: reads('model.errors'),
fatalErrors: reads('model.fatalErrors'), fatalErrors: reads('model.fatalErrors'),
canActivate: reads('model.canActivate'),
'data-test-theme-warnings-modal': true 'data-test-theme-warnings-modal': true
}); });

View file

@ -1,5 +1,11 @@
<header class="modal-header"> <header class="modal-header">
<h1 data-test-theme-warnings-title>{{title}}</h1> <h1 data-test-theme-warnings-title>
{{#unless canActivate}}
{{title}}
{{else}}
{{title}} with {{#if errors}}errors{{else}}warnings{{/if}}
{{/unless}}
</h1>
</header> </header>
<a class="close" href="#" title="Close" {{action "closeModal"}}>{{inline-svg "close"}}<span class="hidden">Close</span></a> <a class="close" href="#" title="Close" {{action "closeModal"}}>{{inline-svg "close"}}<span class="hidden">Close</span></a>

View file

@ -2,11 +2,11 @@
<h1> <h1>
{{#if theme}} {{#if theme}}
{{#if hasWarningsOrErrors}} {{#if hasWarningsOrErrors}}
Upload successful with warnings/errors! Upload successful with {{#if validationErrors}}errors{{else}}warnings{{/if}}
{{else}} {{else}}
Upload successful! Upload successful!
{{/if}} {{/if}}
{{else if validationErrors}} {{else if (or validationErrors fatalValidationErrors)}}
Invalid theme Invalid theme
{{else}} {{else}}
Upload a theme Upload a theme
@ -21,8 +21,8 @@
<ul class="theme-validation-errors"> <ul class="theme-validation-errors">
<li> <li>
<p> <p>
"{{themeName}}" uploaded successfully but some warnings/errors were detected. "{{themeName}}" uploaded successfully but some {{#if validationErrors}}errors{{else}}warnings{{/if}} were detected.
You are still able to use and activate the theme. Here is your report... You are still able to use and activate the theme. Here's your report...
</p> </p>
</li> </li>

View file

@ -46,10 +46,11 @@
{{#if showThemeWarningsModal}} {{#if showThemeWarningsModal}}
{{gh-fullscreen-modal "theme-warnings" {{gh-fullscreen-modal "theme-warnings"
model=(hash model=(hash
title="Activated successful with warnings/errors!" title="Activation successful"
warnings=themeWarnings warnings=themeWarnings
errors=themeErrors errors=themeErrors
message=message message=message
canActivate=true
) )
close=(action "hideThemeWarningsModal") close=(action "hideThemeWarningsModal")
modifier="action wide"}} modifier="action wide"}}
@ -61,6 +62,7 @@
title="Activation failed" title="Activation failed"
errors=themeErrors errors=themeErrors
fatalErrors=themeFatalErrors fatalErrors=themeFatalErrors
canActivate=false
) )
close=(action "hideThemeWarningsModal") close=(action "hideThemeWarningsModal")
modifier="action wide"}} modifier="action wide"}}

View file

@ -397,7 +397,7 @@ describe('Acceptance: Settings - Design', function () {
expect( expect(
find('.fullscreen-modal h1').text().trim(), find('.fullscreen-modal h1').text().trim(),
'modal title after uploading theme with warnings' 'modal title after uploading theme with warnings'
).to.equal('Upload successful with warnings/errors!'); ).to.equal('Upload successful with warnings');
await click(testSelector('toggle-details')); await click(testSelector('toggle-details'));
@ -576,7 +576,7 @@ describe('Acceptance: Settings - Design', function () {
expect( expect(
find(testSelector('theme-warnings-title')).text().trim(), find(testSelector('theme-warnings-title')).text().trim(),
'modal title after activating theme with warnings' 'modal title after activating theme with warnings'
).to.equal('Activated successful with warnings/errors!'); ).to.equal('Activation successful with warnings');
await click(testSelector('toggle-details')); await click(testSelector('toggle-details'));