Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.
/ Admin Public archive

Commit 0146936

Browse files
aileenkirrg001
authored andcommitted
🎨 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)"
1 parent 7c1f6e1 commit 0146936

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

‎app/components/modals/theme-warnings.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export default ModalComponent.extend({
77
warnings: reads('model.warnings'),
88
errors: reads('model.errors'),
99
fatalErrors: reads('model.fatalErrors'),
10+
canActivate: reads('model.canActivate'),
1011

1112
'data-test-theme-warnings-modal': true
1213
});

‎app/templates/components/modals/theme-warnings.hbs‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
<header class="modal-header">
2-
<h1 data-test-theme-warnings-title>{{title}}</h1>
2+
<h1 data-test-theme-warnings-title>
3+
{{#unless canActivate}}
4+
{{title}}
5+
{{else}}
6+
{{title}} with {{#if errors}}errors{{else}}warnings{{/if}}
7+
{{/unless}}
8+
</h1>
39
</header>
410
<a class="close" href="#" title="Close" {{action "closeModal"}}>{{inline-svg "close"}}<span class="hidden">Close</span></a>
511

‎app/templates/components/modals/upload-theme.hbs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<h1>
33
{{#if theme}}
44
{{#if hasWarningsOrErrors}}
5-
Upload successful with warnings/errors!
5+
Upload successful with {{#if validationErrors}}errors{{else}}warnings{{/if}}
66
{{else}}
77
Upload successful!
88
{{/if}}
9-
{{else if validationErrors}}
9+
{{else if (or validationErrors fatalValidationErrors)}}
1010
Invalid theme
1111
{{else}}
1212
Upload a theme
@@ -21,8 +21,8 @@
2121
<ul class="theme-validation-errors">
2222
<li>
2323
<p>
24-
"{{themeName}}" uploaded successfully but some warnings/errors were detected.
25-
You are still able to use and activate the theme. Here is your report...
24+
"{{themeName}}" uploaded successfully but some {{#if validationErrors}}errors{{else}}warnings{{/if}} were detected.
25+
You are still able to use and activate the theme. Here's your report...
2626
</p>
2727
</li>
2828

‎app/templates/settings/design.hbs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@
4646
{{#if showThemeWarningsModal}}
4747
{{gh-fullscreen-modal "theme-warnings"
4848
model=(hash
49-
title="Activated successful with warnings/errors!"
49+
title="Activation successful"
5050
warnings=themeWarnings
5151
errors=themeErrors
5252
message=message
53+
canActivate=true
5354
)
5455
close=(action "hideThemeWarningsModal")
5556
modifier="action wide"}}
@@ -61,6 +62,7 @@
6162
title="Activation failed"
6263
errors=themeErrors
6364
fatalErrors=themeFatalErrors
65+
canActivate=false
6466
)
6567
close=(action "hideThemeWarningsModal")
6668
modifier="action wide"}}

‎tests/acceptance/settings/design-test.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ describe('Acceptance: Settings - Design', function () {
397397
expect(
398398
find('.fullscreen-modal h1').text().trim(),
399399
'modal title after uploading theme with warnings'
400-
).to.equal('Upload successful with warnings/errors!');
400+
).to.equal('Upload successful with warnings');
401401

402402
await click(testSelector('toggle-details'));
403403

@@ -576,7 +576,7 @@ describe('Acceptance: Settings - Design', function () {
576576
expect(
577577
find(testSelector('theme-warnings-title')).text().trim(),
578578
'modal title after activating theme with warnings'
579-
).to.equal('Activated successful with warnings/errors!');
579+
).to.equal('Activation successful with warnings');
580580

581581
await click(testSelector('toggle-details'));
582582

0 commit comments

Comments
 (0)