mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Merged v5.52.1 into main
This commit is contained in:
commit
d4c5fe2f46
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ghost-admin",
|
||||
"version": "5.52.0",
|
||||
"version": "5.52.1",
|
||||
"description": "Ember.js admin client for Ghost",
|
||||
"author": "Ghost Foundation",
|
||||
"homepage": "http://ghost.org",
|
||||
|
@ -1,15 +0,0 @@
|
||||
module.exports = [{
|
||||
title: 'Index',
|
||||
slug: 'index',
|
||||
description: 'Collection with all posts',
|
||||
type: 'automatic',
|
||||
deletable: false,
|
||||
filter: 'status:published'
|
||||
}, {
|
||||
title: 'Featured Posts',
|
||||
slug: 'featured',
|
||||
description: 'Collection of featured posts',
|
||||
type: 'automatic',
|
||||
deletable: false,
|
||||
filter: 'featured:true'
|
||||
}];
|
@ -2,6 +2,7 @@ const {
|
||||
CollectionsService,
|
||||
CollectionsRepositoryInMemory
|
||||
} = require('@tryghost/collections');
|
||||
const labs = require('../../../shared/labs');
|
||||
|
||||
class CollectionsServiceWrapper {
|
||||
/** @type {CollectionsService} */
|
||||
@ -9,7 +10,6 @@ class CollectionsServiceWrapper {
|
||||
|
||||
constructor() {
|
||||
const postsRepository = require('./PostsRepository').getInstance();
|
||||
const events = require('../../lib/common/events');
|
||||
const collectionsRepositoryInMemory = new CollectionsRepositoryInMemory();
|
||||
|
||||
const collectionsService = new CollectionsService({
|
||||
@ -17,6 +17,36 @@ class CollectionsServiceWrapper {
|
||||
postsRepository: postsRepository
|
||||
});
|
||||
|
||||
this.api = collectionsService;
|
||||
}
|
||||
|
||||
async init() {
|
||||
if (!labs.isSet('collections')) {
|
||||
return;
|
||||
}
|
||||
const existingBuiltins = await this.api.getAll({filter: 'slug:featured'});
|
||||
|
||||
if (!existingBuiltins.data.length) {
|
||||
await this.api.createCollection({
|
||||
title: 'Index',
|
||||
slug: 'index',
|
||||
description: 'Collection with all posts',
|
||||
type: 'automatic',
|
||||
deletable: false,
|
||||
filter: 'status:published'
|
||||
});
|
||||
|
||||
await this.api.createCollection({
|
||||
title: 'Featured Posts',
|
||||
slug: 'featured',
|
||||
description: 'Collection of featured posts',
|
||||
type: 'automatic',
|
||||
deletable: false,
|
||||
filter: 'featured:true'
|
||||
});
|
||||
}
|
||||
|
||||
const events = require('../../lib/common/events');
|
||||
// @NOTE: these should be reworked to use the "Event" classes
|
||||
// instead of Bookshelf model events
|
||||
const updateEvents = require('./update-events');
|
||||
@ -24,23 +54,9 @@ class CollectionsServiceWrapper {
|
||||
// @NOTE: naive update implementation to keep things simple for the first version
|
||||
for (const event of updateEvents) {
|
||||
events.on(event, () => {
|
||||
collectionsService.updateAutomaticCollections();
|
||||
this.api.updateAutomaticCollections();
|
||||
});
|
||||
}
|
||||
|
||||
this.api = collectionsService;
|
||||
}
|
||||
|
||||
async init() {
|
||||
const existingBuiltins = await this.api.getAll({filter: 'slug:featured'});
|
||||
|
||||
if (!existingBuiltins.data.length) {
|
||||
const builtInCollections = require('./built-in-collections');
|
||||
|
||||
for (const collection of builtInCollections) {
|
||||
await this.api.createCollection(collection);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ghost",
|
||||
"version": "5.52.0",
|
||||
"version": "5.52.1",
|
||||
"description": "The professional publishing platform",
|
||||
"author": "Ghost Foundation",
|
||||
"homepage": "https://ghost.org",
|
||||
@ -104,8 +104,8 @@
|
||||
"@tryghost/kg-card-factory": "4.0.8",
|
||||
"@tryghost/kg-default-atoms": "4.0.1",
|
||||
"@tryghost/kg-default-cards": "9.1.0",
|
||||
"@tryghost/kg-default-nodes": "0.0.64",
|
||||
"@tryghost/kg-lexical-html-renderer": "0.1.64",
|
||||
"@tryghost/kg-default-nodes": "0.0.65",
|
||||
"@tryghost/kg-lexical-html-renderer": "0.1.65",
|
||||
"@tryghost/kg-mobiledoc-html-renderer": "6.0.8",
|
||||
"@tryghost/limit-service": "1.2.6",
|
||||
"@tryghost/link-redirects": "0.0.0",
|
||||
|
@ -52,6 +52,7 @@ describe('Collections API', function () {
|
||||
let agent;
|
||||
|
||||
before(async function () {
|
||||
mockManager.mockLabsEnabled('collections');
|
||||
agent = await agentProvider.getAdminAPIAgent();
|
||||
await fixtureManager.init('users', 'posts');
|
||||
await agent.loginAsOwner();
|
||||
|
18
yarn.lock
18
yarn.lock
@ -6985,10 +6985,10 @@
|
||||
lodash "^4.17.21"
|
||||
luxon "^3.0.0"
|
||||
|
||||
"@tryghost/kg-default-nodes@0.0.64", "@tryghost/kg-default-nodes@^0.0.64":
|
||||
version "0.0.64"
|
||||
resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.0.64.tgz#ea9adf63f3dc0889a9d7333d31b12d2906c0a641"
|
||||
integrity sha512-uqp1na1ET1NJtlpCbsWITfpByt39Z46OXRBthXHEjUkopeMs1vZciT+/V9xK9Quv/Oqm9Z0Jpio1gn8tYSqRNw==
|
||||
"@tryghost/kg-default-nodes@0.0.65", "@tryghost/kg-default-nodes@^0.0.65":
|
||||
version "0.0.65"
|
||||
resolved "https://registry.yarnpkg.com/@tryghost/kg-default-nodes/-/kg-default-nodes-0.0.65.tgz#3c02b95bb01bd6314b47a4631ad5db4edda6de8f"
|
||||
integrity sha512-8PSWQAXdW5Eydd8mq7e3kvXpojA8u/AhgnuqCtQ+5eHZNZce2M5pls2n6WUgVXpJPCpLYT6IbpaGfyPno2DtLA==
|
||||
dependencies:
|
||||
"@tryghost/kg-clean-basic-html" "^3.0.19"
|
||||
"@tryghost/kg-markdown-html-renderer" "^6.0.8"
|
||||
@ -6998,10 +6998,10 @@
|
||||
lodash "^4.17.21"
|
||||
luxon "^3.3.0"
|
||||
|
||||
"@tryghost/kg-lexical-html-renderer@0.1.64":
|
||||
version "0.1.64"
|
||||
resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.1.64.tgz#10489b0fe99b50076e2d24b5d40111d77945a28a"
|
||||
integrity sha512-SqvwrmiWPVXqvsHkpicO+36LlTaTV/YvBp9/y2HLgcHKZlPwF8PYXLva5216J4sVEEAoymb4s9x7FSLeg87Qpg==
|
||||
"@tryghost/kg-lexical-html-renderer@0.1.65":
|
||||
version "0.1.65"
|
||||
resolved "https://registry.yarnpkg.com/@tryghost/kg-lexical-html-renderer/-/kg-lexical-html-renderer-0.1.65.tgz#73faa1a5d417a26320be1da482de6d4ec2d42959"
|
||||
integrity sha512-NHndXvnq4uaYog2UPFzDT0cyDL2k6ouzGOu17yxXhhjSq5WhX+t5iJ7e90uOq3/dPhfJwGS/JQoJ/3nV2Jhhdw==
|
||||
dependencies:
|
||||
"@lexical/clipboard" "^0.11.0"
|
||||
"@lexical/code" "^0.11.0"
|
||||
@ -7009,7 +7009,7 @@
|
||||
"@lexical/link" "^0.11.0"
|
||||
"@lexical/list" "^0.11.0"
|
||||
"@lexical/rich-text" "^0.11.0"
|
||||
"@tryghost/kg-default-nodes" "^0.0.64"
|
||||
"@tryghost/kg-default-nodes" "^0.0.65"
|
||||
jsdom "^22.1.0"
|
||||
lexical "^0.11.0"
|
||||
prettier "^2.7.1"
|
||||
|
Loading…
Reference in New Issue
Block a user