mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
remove settings email
closes #5299 - removes settings/general email field from both client and server side - fixes tests to reflect removal of email
This commit is contained in:
parent
7190e1d2a3
commit
e69c8c89ac
7 changed files with 3 additions and 33 deletions
|
@ -7,7 +7,6 @@ var Setting = DS.Model.extend(NProgressSaveMixin, ValidationEngine, {
|
||||||
|
|
||||||
title: DS.attr('string'),
|
title: DS.attr('string'),
|
||||||
description: DS.attr('string'),
|
description: DS.attr('string'),
|
||||||
email: DS.attr('string'),
|
|
||||||
logo: DS.attr('string'),
|
logo: DS.attr('string'),
|
||||||
cover: DS.attr('string'),
|
cover: DS.attr('string'),
|
||||||
defaultLang: DS.attr('string'),
|
defaultLang: DS.attr('string'),
|
||||||
|
|
|
@ -47,11 +47,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="form-group">
|
|
||||||
<label for="email-address">Email Address</label>
|
|
||||||
{{input id="email-address" class="gh-input" name="general[email-address]" type="email" value=model.email autocapitalize="off" autocorrect="off"}}
|
|
||||||
<p>Address to use for admin notifications</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="postsPerPage">Posts per page</label>
|
<label for="postsPerPage">Posts per page</label>
|
||||||
|
|
|
@ -4,7 +4,6 @@ var SettingValidator = Ember.Object.create({
|
||||||
var validationErrors = [],
|
var validationErrors = [],
|
||||||
title = model.get('title'),
|
title = model.get('title'),
|
||||||
description = model.get('description'),
|
description = model.get('description'),
|
||||||
email = model.get('email'),
|
|
||||||
postsPerPage = model.get('postsPerPage'),
|
postsPerPage = model.get('postsPerPage'),
|
||||||
isPrivate = model.get('isPrivate'),
|
isPrivate = model.get('isPrivate'),
|
||||||
password = model.get('password');
|
password = model.get('password');
|
||||||
|
@ -17,10 +16,6 @@ var SettingValidator = Ember.Object.create({
|
||||||
validationErrors.push({message: 'Description is too long'});
|
validationErrors.push({message: 'Description is too long'});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validator.isEmail(email) || !validator.isLength(email, 0, 254)) {
|
|
||||||
validationErrors.push({message: 'Supply a valid email address'});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isPrivate && password === '') {
|
if (isPrivate && password === '') {
|
||||||
validationErrors.push({message: 'Password must be supplied'});
|
validationErrors.push({message: 'Password must be supplied'});
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,8 +221,6 @@ authentication = {
|
||||||
}).then(function (user) {
|
}).then(function (user) {
|
||||||
var userSettings = [];
|
var userSettings = [];
|
||||||
|
|
||||||
userSettings.push({key: 'email', value: setupUser.email});
|
|
||||||
|
|
||||||
// Handles the additional values set by the setup screen.
|
// Handles the additional values set by the setup screen.
|
||||||
if (!_.isEmpty(setupUser.blogTitle)) {
|
if (!_.isEmpty(setupUser.blogTitle)) {
|
||||||
userSettings.push({key: 'title', value: setupUser.blogTitle});
|
userSettings.push({key: 'title', value: setupUser.blogTitle});
|
||||||
|
|
|
@ -20,13 +20,6 @@
|
||||||
"description": {
|
"description": {
|
||||||
"defaultValue": "Just a blogging platform."
|
"defaultValue": "Just a blogging platform."
|
||||||
},
|
},
|
||||||
"email": {
|
|
||||||
"defaultValue": "ghost@example.com",
|
|
||||||
"validations": {
|
|
||||||
"isNull": false,
|
|
||||||
"isEmail": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"logo": {
|
"logo": {
|
||||||
"defaultValue": ""
|
"defaultValue": ""
|
||||||
},
|
},
|
||||||
|
|
|
@ -35,7 +35,7 @@ describe('Authentication API', function () {
|
||||||
name: 'test user',
|
name: 'test user',
|
||||||
email: 'test@example.com',
|
email: 'test@example.com',
|
||||||
password: 'areallygoodpassword',
|
password: 'areallygoodpassword',
|
||||||
title: 'a test blog'
|
blogTitle: 'a test blog'
|
||||||
},
|
},
|
||||||
|
|
||||||
send = mail.__get__('mail.send');
|
send = mail.__get__('mail.send');
|
||||||
|
|
|
@ -199,8 +199,7 @@ describe('Import', function () {
|
||||||
var users = importedData[0],
|
var users = importedData[0],
|
||||||
posts = importedData[1],
|
posts = importedData[1],
|
||||||
settings = importedData[2],
|
settings = importedData[2],
|
||||||
tags = importedData[3],
|
tags = importedData[3];
|
||||||
exportEmail;
|
|
||||||
|
|
||||||
// we always have 1 user, the default user we added
|
// we always have 1 user, the default user we added
|
||||||
users.length.should.equal(1, 'There should only be one user');
|
users.length.should.equal(1, 'There should only be one user');
|
||||||
|
@ -223,10 +222,6 @@ describe('Import', function () {
|
||||||
// activeTheme should NOT have been overridden
|
// activeTheme should NOT have been overridden
|
||||||
_.findWhere(settings, {key: 'activeTheme'}).value.should.equal('casper', 'Wrong theme');
|
_.findWhere(settings, {key: 'activeTheme'}).value.should.equal('casper', 'Wrong theme');
|
||||||
|
|
||||||
// email address should have been overridden
|
|
||||||
exportEmail = _.findWhere(exportData.data.settings, {key: 'email'}).value;
|
|
||||||
_.findWhere(settings, {key: 'email'}).value.should.equal(exportEmail, 'Wrong email in settings');
|
|
||||||
|
|
||||||
// test tags
|
// test tags
|
||||||
tags.length.should.equal(exportData.data.tags.length, 'no new tags');
|
tags.length.should.equal(exportData.data.tags.length, 'no new tags');
|
||||||
|
|
||||||
|
@ -371,8 +366,7 @@ describe('Import', function () {
|
||||||
var users = importedData[0],
|
var users = importedData[0],
|
||||||
posts = importedData[1],
|
posts = importedData[1],
|
||||||
settings = importedData[2],
|
settings = importedData[2],
|
||||||
tags = importedData[3],
|
tags = importedData[3];
|
||||||
exportEmail;
|
|
||||||
|
|
||||||
// we always have 1 user, the owner user we added
|
// we always have 1 user, the owner user we added
|
||||||
users.length.should.equal(1, 'There should only be one user');
|
users.length.should.equal(1, 'There should only be one user');
|
||||||
|
@ -395,10 +389,6 @@ describe('Import', function () {
|
||||||
// activeTheme should NOT have been overridden
|
// activeTheme should NOT have been overridden
|
||||||
_.findWhere(settings, {key: 'activeTheme'}).value.should.equal('casper', 'Wrong theme');
|
_.findWhere(settings, {key: 'activeTheme'}).value.should.equal('casper', 'Wrong theme');
|
||||||
|
|
||||||
// email address should have been overridden
|
|
||||||
exportEmail = _.findWhere(exportData.data.settings, {key: 'email'}).value;
|
|
||||||
_.findWhere(settings, {key: 'email'}).value.should.equal(exportEmail, 'Wrong email in settings');
|
|
||||||
|
|
||||||
// test tags
|
// test tags
|
||||||
tags.length.should.equal(exportData.data.tags.length, 'no new tags');
|
tags.length.should.equal(exportData.data.tags.length, 'no new tags');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue