0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛 Updated gscan error handling for page errors (#17575)

refs https://github.com/TryGhost/Product/issues/3676

- add filter for sidebar display of theme errors (angry red box)
- filter specific to each page feature, will need to add each one by this approach
This commit is contained in:
Steve Larson 2023-08-02 09:56:40 -05:00 committed by GitHub
parent 2cd50d47af
commit 6936007052
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 114 additions and 10 deletions

View file

@ -53,7 +53,7 @@
"autoprefixer": "10.4.7", "autoprefixer": "10.4.7",
"beeper": "2.1.0", "beeper": "2.1.0",
"cssnano": "5.1.12", "cssnano": "5.1.12",
"gscan": "4.37.4", "gscan": "4.37.5",
"gulp": "4.0.2", "gulp": "4.0.2",
"gulp-concat": "2.6.1", "gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2", "gulp-livereload": "4.0.2",
@ -315,7 +315,7 @@
"autoprefixer": "10.4.14", "autoprefixer": "10.4.14",
"beeper": "2.1.0", "beeper": "2.1.0",
"cssnano": "6.0.1", "cssnano": "6.0.1",
"gscan": "4.37.4", "gscan": "4.37.5",
"gulp": "4.0.2", "gulp": "4.0.2",
"gulp-concat": "2.6.1", "gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2", "gulp-livereload": "4.0.2",

View file

@ -36,7 +36,18 @@ export default class Footer extends Component {
} }
get hasThemeErrors() { 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" // equivalent to "left: auto; right: -20px"

View file

@ -187,7 +187,7 @@
"ghost-storage-base": "1.0.0", "ghost-storage-base": "1.0.0",
"glob": "8.1.0", "glob": "8.1.0",
"got": "11.8.6", "got": "11.8.6",
"gscan": "4.37.4", "gscan": "4.37.5",
"human-number": "2.0.1", "human-number": "2.0.1",
"image-size": "1.0.2", "image-size": "1.0.2",
"intl": "1.2.5", "intl": "1.2.5",

View file

@ -49,7 +49,7 @@
"autoprefixer": "10.2.5", "autoprefixer": "10.2.5",
"beeper": "2.1.0", "beeper": "2.1.0",
"cssnano": "4.1.10", "cssnano": "4.1.10",
"gscan": "4.37.4", "gscan": "4.37.5",
"gulp": "4.0.2", "gulp": "4.0.2",
"gulp-concat": "2.6.1", "gulp-concat": "2.6.1",
"gulp-livereload": "4.0.2", "gulp-livereload": "4.0.2",

View file

@ -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}}

View file

@ -3772,6 +3772,16 @@
"@sentry/utils" "7.60.1" "@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3" tslib "^2.4.1 || ^1.9.3"
"@sentry-internal/tracing@7.61.0":
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/browser@7.60.1": "@sentry/browser@7.60.1":
version "7.60.1" version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.60.1.tgz#d11e86f127f3f1b48a7156a4df63ab2b76e534ee" resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.60.1.tgz#d11e86f127f3f1b48a7156a4df63ab2b76e534ee"
@ -3793,6 +3803,15 @@
"@sentry/utils" "7.60.1" "@sentry/utils" "7.60.1"
tslib "^2.4.1 || ^1.9.3" tslib "^2.4.1 || ^1.9.3"
"@sentry/core@7.61.0":
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/ember@7.60.1": "@sentry/ember@7.60.1":
version "7.60.1" version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/ember/-/ember-7.60.1.tgz#e2264df67ebfa5cb26d6cf615605258e630e2dff" resolved "https://registry.yarnpkg.com/@sentry/ember/-/ember-7.60.1.tgz#e2264df67ebfa5cb26d6cf615605258e630e2dff"
@ -3821,6 +3840,20 @@
lru_map "^0.3.3" lru_map "^0.3.3"
tslib "^2.4.1 || ^1.9.3" tslib "^2.4.1 || ^1.9.3"
"@sentry/node@7.61.0":
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/react@7.60.1": "@sentry/react@7.60.1":
version "7.60.1" version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.60.1.tgz#ceeb35dadebb41454f488c17d0b9c2e5d59e5ff4" resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.60.1.tgz#ceeb35dadebb41454f488c17d0b9c2e5d59e5ff4"
@ -3853,6 +3886,11 @@
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.60.1.tgz#2f8740db56ae4cae87523ae7a0daf753308496f0" resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.60.1.tgz#2f8740db56ae4cae87523ae7a0daf753308496f0"
integrity sha512-8lKKSCOhZ953cWxwnfZwoR3ZFFlZG4P3PQFTaFt/u4LxLh/0zYbdtgvtUqXRURjMCi5P6ddeE9Uw9FGnTJCsTw== integrity sha512-8lKKSCOhZ953cWxwnfZwoR3ZFFlZG4P3PQFTaFt/u4LxLh/0zYbdtgvtUqXRURjMCi5P6ddeE9Uw9FGnTJCsTw==
"@sentry/types@7.61.0":
version "7.61.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.61.0.tgz#4243b5ef4658f6b0673bc4372c90e6ec920f78d8"
integrity sha512-/GLlIBNR35NKPE/SfWi9W10dK9hE8qTShzsuPVn5wAJxpT3Lb4+dkwmKCTLUYxdkmvRDEudkfOxgalsfQGTAWA==
"@sentry/utils@7.60.1": "@sentry/utils@7.60.1":
version "7.60.1" version "7.60.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.60.1.tgz#27b20bd2926c877011eb39fcb4b2db95dc72243f" resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.60.1.tgz#27b20bd2926c877011eb39fcb4b2db95dc72243f"
@ -3861,6 +3899,14 @@
"@sentry/types" "7.60.1" "@sentry/types" "7.60.1"
tslib "^2.4.1 || ^1.9.3" tslib "^2.4.1 || ^1.9.3"
"@sentry/utils@7.61.0":
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": "@sidvind/better-ajv-errors@^2.0.0":
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/@sidvind/better-ajv-errors/-/better-ajv-errors-2.1.0.tgz#54f4216d2200d60e90ec25c6a27c1ea3afdc6cdf" resolved "https://registry.yarnpkg.com/@sidvind/better-ajv-errors/-/better-ajv-errors-2.1.0.tgz#54f4216d2200d60e90ec25c6a27c1ea3afdc6cdf"
@ -17179,12 +17225,12 @@ growly@^1.3.0:
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw== integrity sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==
gscan@4.37.4: gscan@4.37.5:
version "4.37.4" version "4.37.5"
resolved "https://registry.yarnpkg.com/gscan/-/gscan-4.37.4.tgz#d9a05d22f3ad774c947abe8ea2a5af9a69bb3847" resolved "https://registry.yarnpkg.com/gscan/-/gscan-4.37.5.tgz#23a640eee2070c1921e32fe70968f727081f4116"
integrity sha512-XI6QazyN9roUJ9kjlwU+qG73XYi8L0mSM0KLm9oLUdhoTFBSHOWUsVVCSu1TJ6z/v0QLmop/dOQYfGinr6bWxg== integrity sha512-v0JKMZVZ6AEot39JURnlKyk4VdsHNeQFXz9mnzirV53One1oODfzBCnloj4yiYzreBNlmDL1ve6VRaZ6YX7UtQ==
dependencies: dependencies:
"@sentry/node" "7.60.1" "@sentry/node" "7.61.0"
"@tryghost/config" "0.2.17" "@tryghost/config" "0.2.17"
"@tryghost/debug" "0.1.25" "@tryghost/debug" "0.1.25"
"@tryghost/errors" "1.2.25" "@tryghost/errors" "1.2.25"