Skip to content

Commit

Permalink
Merged v5.57.2 into main
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 2, 2023
2 parents e5f36b6 + afce648 commit e2a6d8b
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 13 deletions.
4 changes: 2 additions & 2 deletions apps/admin-x-settings/test/utils/responses/themes.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"autoprefixer": "10.4.7",
"beeper": "2.1.0",
"cssnano": "5.1.12",
"gscan": "4.37.4",
"gscan": "4.37.5",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2",
Expand Down Expand Up @@ -315,7 +315,7 @@
"autoprefixer": "10.4.14",
"beeper": "2.1.0",
"cssnano": "6.0.1",
"gscan": "4.37.4",
"gscan": "4.37.5",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2",
Expand Down
13 changes: 12 additions & 1 deletion ghost/admin/app/components/gh-nav-menu/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ export default class Footer extends Component {
}

get hasThemeErrors() {
return this.themeManagement.activeTheme && this.themeManagement.activeTheme.gscanErrors.length;
const errors = this.themeManagement.activeTheme && this.themeManagement.activeTheme.gscanErrors;
if (!errors) {
return false;
}
// filter errors that have other UI to display to users that the functionality is not working
const filteredErrors = errors?.filter((error) => {
if (error.code === 'GS110-NO-MISSING-PAGE-BUILDER-USAGE' && error?.failures?.[0].message.includes(`show_title_and_feature_image`)) {
return false;
}
return true;
});
return filteredErrors && filteredErrors.length;
}

// equivalent to "left: auto; right: -20px"
Expand Down
2 changes: 1 addition & 1 deletion ghost/admin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghost-admin",
"version": "5.57.1",
"version": "5.57.2",
"description": "Ember.js admin client for Ghost",
"author": "Ghost Foundation",
"homepage": "http://ghost.org",
Expand Down
2 changes: 1 addition & 1 deletion ghost/core/core/server/models/base/bookshelf.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ghostBookshelf.plugin('bookshelf-relations', {
};

// CASE: disable after hook for specific relations
if (['permissions_roles', 'members_newsletters'].indexOf(existing.relatedData.joinTableName) !== -1) {
if (['permissions_roles', 'members_newsletters', 'collections_posts'].indexOf(existing.relatedData.joinTableName) !== -1) {
return Promise.resolve();
}

Expand Down
4 changes: 2 additions & 2 deletions ghost/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ghost",
"version": "5.57.1",
"version": "5.57.2",
"description": "The professional publishing platform",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",
Expand Down Expand Up @@ -187,7 +187,7 @@
"ghost-storage-base": "1.0.0",
"glob": "8.1.0",
"got": "11.8.6",
"gscan": "4.37.4",
"gscan": "4.37.5",
"human-number": "2.0.1",
"image-size": "1.0.2",
"intl": "1.2.5",
Expand Down
53 changes: 53 additions & 0 deletions ghost/core/test/regression/models/model_collections.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const assert = require('assert/strict');
const testUtils = require('../../utils');
const models = require('../../../core/server/models');
const db = require('../../../core/server/data/db');

describe('Collection Model', function () {
before(testUtils.teardownDb);
before(testUtils.stopGhost);
after(testUtils.teardownDb);

// This is required for the models to be initialised ???
// @TODO remove this once we have a better way of initialising models
before(testUtils.setup('users:roles', 'posts'));

describe('add', function () {
it('does not update the sort_order of the collections_posts table', async function () {
if (db?.knex?.client?.config?.client !== 'sqlite3') {
return this.skip();
}
/** @type {import('sqlite3').Database} */
const database = db.knex.client;

let didUpdateCollectionPosts = false;

function handler(/** @type {{sql: string}} */ query) {
if (query.sql.toLowerCase().includes('update `collections_posts` set `sort_order`')) {
didUpdateCollectionPosts = true;
}
}

const posts = await models.Post.findAll();

database.on('query', handler);

await models.Collection.add({
title: 'Test Collection',
slug: 'test-collection',
description: 'Test description',
type: 'manual',
filter: null,
posts: posts.toJSON().map(post => ({id: post.id})),
feature_image: null
});

database.off('query', handler);

const actual = didUpdateCollectionPosts;
const expected = false;

assert.equal(actual, expected, 'collections_posts should not have been updated');
});
});
});
2 changes: 1 addition & 1 deletion ghost/core/test/utils/fixtures/themes/casper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"autoprefixer": "10.2.5",
"beeper": "2.1.0",
"cssnano": "4.1.10",
"gscan": "4.37.4",
"gscan": "4.37.5",
"gulp": "4.0.2",
"gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2",
Expand Down
47 changes: 47 additions & 0 deletions ghost/core/test/utils/fixtures/themes/test-theme/page.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{!< default}}

{{!-- The tag above means: insert everything in this file
into the {body} tag of the default.hbs template --}}


{{#post}}
{{!-- Everything inside the #post block pulls data from the page --}}

<main id="site-main" class="site-main">
<article class="article {{post_class}}">

{{#match @page.show_title_and_feature_image}}
<header class="article-header gh-canvas">

<h1 class="article-title">{{title}}</h1>

{{#if feature_image}}
<figure class="article-image">
{{!-- This is a responsive image, it loads different sizes depending on device
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
<img
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(min-width: 1400px) 1400px, 92vw"
src="{{img_url feature_image size="xl"}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
/>
{{#if feature_image_caption}}
<figcaption>{{feature_image_caption}}</figcaption>
{{/if}}
</figure>
{{/if}}

</header>
{{/match}}

<section class="gh-content gh-canvas">
{{content}}
</section>

</article>
</main>

{{/post}}
Binary file modified ghost/core/test/utils/fixtures/themes/warnings.zip
Binary file not shown.
56 changes: 51 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3773,6 +3773,16 @@
"@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry-internal/[email protected]":
version "7.61.0"
resolved "https://registry.yarnpkg.com/@sentry-internal/tracing/-/tracing-7.61.0.tgz#5a0dd4a9a0b41f2e22904430f3fe0216f36ee086"
integrity sha512-zTr+MXEG4SxNxif42LIgm2RQn+JRXL2NuGhRaKSD2i4lXKFqHVGlVdoWqY5UfqnnJPokiTWIj9ejR8I5HV8Ogw==
dependencies:
"@sentry/core" "7.61.0"
"@sentry/types" "7.61.0"
"@sentry/utils" "7.61.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.60.1.tgz#d11e86f127f3f1b48a7156a4df63ab2b76e534ee"
Expand All @@ -3794,6 +3804,15 @@
"@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.61.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.61.0.tgz#0de4f73055bd156c5c0cbac50bb814b272567188"
integrity sha512-zl0ZKRjIoYJQWYTd3K/U6zZfS4GDY9yGd2EH4vuYO4kfYtEp/nJ8A+tfAeDo0c9FGxZ0Q+5t5F4/SfwbgyyQzg==
dependencies:
"@sentry/types" "7.61.0"
"@sentry/utils" "7.61.0"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/ember/-/ember-7.60.1.tgz#e2264df67ebfa5cb26d6cf615605258e630e2dff"
Expand Down Expand Up @@ -3822,6 +3841,20 @@
lru_map "^0.3.3"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.61.0"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-7.61.0.tgz#1309330f2ad136af532ad2a03b2a312e885705de"
integrity sha512-oTCqD/h92uvbRCrtCdiAqN6Mfe3vF7ywVHZ8Nq3hHmJp6XadUT+fCBwNQ7rjMyqJAOYAnx/vp6iN9n8C5qcYZQ==
dependencies:
"@sentry-internal/tracing" "7.61.0"
"@sentry/core" "7.61.0"
"@sentry/types" "7.61.0"
"@sentry/utils" "7.61.0"
cookie "^0.4.1"
https-proxy-agent "^5.0.0"
lru_map "^0.3.3"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.60.1.tgz#ceeb35dadebb41454f488c17d0b9c2e5d59e5ff4"
Expand Down Expand Up @@ -3854,6 +3887,11 @@
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.60.1.tgz#2f8740db56ae4cae87523ae7a0daf753308496f0"
integrity sha512-8lKKSCOhZ953cWxwnfZwoR3ZFFlZG4P3PQFTaFt/u4LxLh/0zYbdtgvtUqXRURjMCi5P6ddeE9Uw9FGnTJCsTw==

"@sentry/[email protected]":
version "7.61.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.61.0.tgz#4243b5ef4658f6b0673bc4372c90e6ec920f78d8"
integrity sha512-/GLlIBNR35NKPE/SfWi9W10dK9hE8qTShzsuPVn5wAJxpT3Lb4+dkwmKCTLUYxdkmvRDEudkfOxgalsfQGTAWA==

"@sentry/[email protected]":
version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.60.1.tgz#27b20bd2926c877011eb39fcb4b2db95dc72243f"
Expand All @@ -3862,6 +3900,14 @@
"@sentry/types" "7.60.1"
tslib "^2.4.1 || ^1.9.3"

"@sentry/[email protected]":
version "7.61.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.61.0.tgz#16944afb2b851af045fb528c0c35b7dea3e1cd3b"
integrity sha512-jfj14d0XBFiCU0G6dZZ12SizATiF5Mt4stBGzkM5iS9nXFj8rh1oTT7/p+aZoYzP2JTF+sDzkNjWxyKZkcTo0Q==
dependencies:
"@sentry/types" "7.61.0"
tslib "^2.4.1 || ^1.9.3"

"@sidvind/better-ajv-errors@^2.0.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@sidvind/better-ajv-errors/-/better-ajv-errors-2.1.0.tgz#54f4216d2200d60e90ec25c6a27c1ea3afdc6cdf"
Expand Down Expand Up @@ -17180,12 +17226,12 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==

[email protected].4:
version "4.37.4"
resolved "https://registry.yarnpkg.com/gscan/-/gscan-4.37.4.tgz#d9a05d22f3ad774c947abe8ea2a5af9a69bb3847"
integrity sha512-XI6QazyN9roUJ9kjlwU+qG73XYi8L0mSM0KLm9oLUdhoTFBSHOWUsVVCSu1TJ6z/v0QLmop/dOQYfGinr6bWxg==
[email protected].5:
version "4.37.5"
resolved "https://registry.yarnpkg.com/gscan/-/gscan-4.37.5.tgz#23a640eee2070c1921e32fe70968f727081f4116"
integrity sha512-v0JKMZVZ6AEot39JURnlKyk4VdsHNeQFXz9mnzirV53One1oODfzBCnloj4yiYzreBNlmDL1ve6VRaZ6YX7UtQ==
dependencies:
"@sentry/node" "7.60.1"
"@sentry/node" "7.61.0"
"@tryghost/config" "0.2.17"
"@tryghost/debug" "0.1.25"
"@tryghost/errors" "1.2.25"
Expand Down

0 comments on commit e2a6d8b

Please sign in to comment.