Skip to content

Commit

Permalink
Changed comments and deprecation notes
Browse files Browse the repository at this point in the history
refs #9742
  • Loading branch information
kirrg001 committed Aug 14, 2018
1 parent 4ada301 commit 5558741
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion core/server/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ http = function http(apiMethod) {
var object = req.body,
options = _.extend({}, req.file, {ip: req.ip}, req.query, req.params, {
context: {
// @TODO: forward the client and user obj in 1.0 (options.context.user.id)
// @TODO: forward the client and user obj (options.context.user.id)
user: ((req.user && req.user.id) || (req.user && models.User.isExternalUser(req.user.id))) ? req.user.id : null,
client: (req.client && req.client.slug) ? req.client.slug : null,
client_id: (req.client && req.client.id) ? req.client.id : null
Expand Down
2 changes: 1 addition & 1 deletion core/server/api/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const Promise = require('bluebird'),
common = require('../lib/common'),
docName = 'posts',
/**
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
allowedIncludes = [
'created_by', 'updated_by', 'published_by', 'author', 'tags', 'fields', 'authors', 'authors.roles'
Expand Down
6 changes: 3 additions & 3 deletions core/server/api/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ utils = {
/**
* Convert author property to author_id to match the name in the database.
*
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
if (object.posts[0].hasOwnProperty('author')) {
object.posts[0].author_id = object.posts[0].author;
Expand All @@ -345,7 +345,7 @@ utils = {
* Ensure correct incoming `post.authors` structure.
*
* NOTE:
* The `post.authors[*].id` attribute is required till we release Ghost 2.0.
* The `post.authors[*].id` attribute is required till we release Ghost 3.0.
* Ghost 1.x keeps the deprecated support for `post.author_id`, which is the primary author id and needs to be
* updated if the order of the `post.authors` array changes.
* If we allow adding authors via the post endpoint e.g. `authors=[{name: 'newuser']` (no id property), it's hard
Expand All @@ -357,7 +357,7 @@ utils = {
*
* TLDR; You can only attach existing authors to a post.
*
* @TODO: remove `id` restriction in Ghost 2.0
* @TODO: remove `id` restriction in Ghost 3.0
*/
if (object.posts[0].hasOwnProperty('authors')) {
if (!_.isArray(object.posts[0].authors) ||
Expand Down
2 changes: 1 addition & 1 deletion core/server/data/importer/importers/data/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ DataImporter = {
});
}

// CASE: We deny LTS imports (from 1.0 we use the Ghost version you are on)
// CASE: We deny LTS imports. We can determine that because since Ghost 1.0 we export the Ghost version your blog is on.
// @TODO: add migration guide link
if (!semver.valid(importData.meta.version)) {
return Promise.reject(new common.errors.InternalServerError({
Expand Down
2 changes: 1 addition & 1 deletion core/server/data/schema/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
meta_title: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 300}}},
meta_description: {type: 'string', maxlength: 2000, nullable: true, validations: {isLength: {max: 500}}},
/**
* @deprecated: `author_id`, will be (maybe) removed in Ghost 2.0
* @deprecated: `author_id`, might be removed in Ghost 3.0
* If we keep it, then only, because you can easier query post.author_id than posts_authors[*].sort_order.
*/
author_id: {type: 'string', maxlength: 24, nullable: false},
Expand Down
2 changes: 1 addition & 1 deletion core/server/helpers/author.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const proxy = require('./proxy'),
templates = proxy.templates;

/**
* @deprecated: will be removed in Ghost 2.0
* @deprecated: will be removed in Ghost 3.0
*/
module.exports = function author(options) {
if (options.fn) {
Expand Down
2 changes: 1 addition & 1 deletion core/server/helpers/prev_next.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ buildApiOptions = function buildApiOptions(options, post) {
order = options.name === 'prev_post' ? 'desc' : 'asc',
apiOptions = {
/**
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
include: 'author,authors,tags',
order: 'published_at ' + order,
Expand Down
2 changes: 1 addition & 1 deletion core/server/lib/mobiledoc/cards/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
let html = converters.markdownConverter.render(payload.markdown || '');

/**
* @deprecated Ghost 1.0's markdown-only renderer wrapped cards
* @deprecated Ghost 1.0's markdown-only renderer wrapped cards. Remove in Ghost 3.0
*/
if (version === 1) {
html = `<div class="kg-card-markdown">${html}</div>`;
Expand Down
2 changes: 1 addition & 1 deletion core/server/models/plugins/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ filter = function filter(Bookshelf) {
}

/**
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
if (joinTables && joinTables.indexOf('author') > -1) {
this
Expand Down
4 changes: 2 additions & 2 deletions core/server/models/relations/authors.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) {
// NOTE: `post.author` was always ignored [unsupported]
onSaving: function (model, attrs, options) {
/**
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
model.unset('author');

Expand Down Expand Up @@ -164,7 +164,7 @@ module.exports.extendModel = function extendModel(Post, Posts, ghostBookshelf) {

/**
* CASE: `author` was requested, `posts.authors` must exist
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
if (this._originalOptions.withRelated && this._originalOptions.withRelated && this._originalOptions.withRelated.indexOf('author') !== -1) {
if (!authors.models.length) {
Expand Down
4 changes: 2 additions & 2 deletions core/server/services/routing/CollectionRouter.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CollectionRouter extends ParentRouter {
this.limit = object.limit;

/**
* @deprecated Remove in Ghost 2.0
* @deprecated Remove in Ghost 3.0 (in discussion)
*/
if (this.permalinks.originalValue.match(/globals\.permalinks/)) {
this.permalinks.originalValue = this.permalinks.originalValue.replace('{globals.permalinks}', '{settings.permalinks}');
Expand Down Expand Up @@ -122,7 +122,7 @@ class CollectionRouter extends ParentRouter {

_listeners() {
/**
* @deprecated Remove in Ghost 2.0
* @deprecated Remove in Ghost 3.0
*/
if (this.getPermalinks() && this.getPermalinks().originalValue.match(/settings\.permalinks/)) {
this._onPermalinksEditedListener = this._onPermalinksEdited.bind(this);
Expand Down
2 changes: 1 addition & 1 deletion core/server/services/routing/helpers/fetch-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const queryDefaults = {
/**
* Default post query needs to always include author, authors & tags
*
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
_.extend(defaultPostQuery, queryDefaults, {
options: {
Expand Down
2 changes: 1 addition & 1 deletion core/server/services/routing/helpers/post-lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function postLookup(postUrl, routerOptions) {
/**
* Query database to find post.
*
* @deprecated: `author`, will be removed in Ghost 2.0
* @deprecated: `author`, will be removed in Ghost 3.0
*/
return api.posts.read(_.extend(_.pick(params, 'slug', 'id'), {include: 'author,authors,tags'}))
.then(function then(result) {
Expand Down
2 changes: 1 addition & 1 deletion core/server/web/middleware/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ _private.ThemeErrorRenderer = function ThemeErrorRenderer(err, req, res, next) {
// Format Data
var data = {
message: err.message,
// @deprecated
// @deprecated Remove in Ghost 3.0
code: err.statusCode,
statusCode: err.statusCode,
errorDetails: err.errorDetails || []
Expand Down
6 changes: 3 additions & 3 deletions core/test/unit/data/exporter/index_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Exporter', function () {
describe('doExport', function () {
beforeEach(function () {
exporter.__set__('ghostVersion', {
full: '1.0.0'
full: '2.0.0'
});

tablesStub = sandbox.stub(schema.commands, 'getTables').returns(schemaTables);
Expand All @@ -52,7 +52,7 @@ describe('Exporter', function () {

should.exist(exportData);

exportData.meta.version.should.eql('1.0.0');
exportData.meta.version.should.eql('2.0.0');

tablesStub.calledOnce.should.be.true();
db.knex.called.should.be.true();
Expand Down Expand Up @@ -97,7 +97,7 @@ describe('Exporter', function () {

should.exist(exportData);

exportData.meta.version.should.eql('1.0.0');
exportData.meta.version.should.eql('2.0.0');

tablesStub.calledOnce.should.be.true();
db.knex.called.should.be.true();
Expand Down

0 comments on commit 5558741

Please sign in to comment.