From 81eddbbf726c83b1377f9dd58513da6fb8bd824c Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 26 Feb 2019 13:37:23 +0700 Subject: [PATCH] Updated post list preview to use `excerpt` instead of `plaintext` --- ghost/admin/app/components/gh-posts-list-item.js | 4 ++-- ghost/admin/app/models/post.js | 1 + ghost/admin/app/serializers/post.js | 4 ---- ghost/admin/mirage/factories/post.js | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ghost/admin/app/components/gh-posts-list-item.js b/ghost/admin/app/components/gh-posts-list-item.js index d8a3390e82..47d0bb5fc3 100644 --- a/ghost/admin/app/components/gh-posts-list-item.js +++ b/ghost/admin/app/components/gh-posts-list-item.js @@ -31,8 +31,8 @@ export default Component.extend({ return authors.map(author => author.get('name') || author.get('email')).join(', '); }), - subText: computed('post.{plaintext,customExcerpt,metaDescription}', function () { - let text = this.get('post.plaintext') || ''; + subText: computed('post.{excerpt,customExcerpt,metaDescription}', function () { + let text = this.get('post.excerpt') || ''; let customExcerpt = this.get('post.customExcerpt'); let metaDescription = this.get('post.metaDescription'); diff --git a/ghost/admin/app/models/post.js b/ghost/admin/app/models/post.js index f117938fd2..c74c063f8c 100644 --- a/ghost/admin/app/models/post.js +++ b/ghost/admin/app/models/post.js @@ -76,6 +76,7 @@ export default Model.extend(Comparable, ValidationEngine, { validationType: 'post', createdAtUTC: attr('moment-utc'), + excerpt: attr('string'), customExcerpt: attr('string'), featured: attr('boolean', {defaultValue: false}), featureImage: attr('string'), diff --git a/ghost/admin/app/serializers/post.js b/ghost/admin/app/serializers/post.js index e8ea767bd8..c4555645ae 100644 --- a/ghost/admin/app/serializers/post.js +++ b/ghost/admin/app/serializers/post.js @@ -34,10 +34,6 @@ export default ApplicationSerializer.extend(EmbeddedRecordsMixin, { // Properties that exist on the model but we don't want sent in the payload delete json.uuid; - // Server-side-generated fields - // TODO: remove once the API has protection against overriding auto generation - delete json.html; - delete json.plaintext; // Inserted locally as a convenience. delete json.author_id; // Read-only virtual property. diff --git a/ghost/admin/mirage/factories/post.js b/ghost/admin/mirage/factories/post.js index a73e906ff0..1641a65a11 100644 --- a/ghost/admin/mirage/factories/post.js +++ b/ghost/admin/mirage/factories/post.js @@ -18,6 +18,7 @@ export default Factory.extend({ ogDescription: null, ogImage: null, ogTitle: null, + excerpt(i) { return `Excerpt for post ${i}.`; }, plaintext(i) { return `Plaintext for post ${i}.`; }, publishedAt: '2015-12-19T16:25:07.000Z', publishedBy: 1,