From 6969e9da7e980659b0b6569129ce32fad61fd058 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 30 Nov 2022 12:55:12 +0000 Subject: [PATCH] FIX: Allow reviewable-item components to be template-only (#19257) The akismet plugin defines the `reviewable-akismet-post` component using a template under `discourse/templates/components/reviewable-akismet-post.hbs` without an associated `.js` file. The change to our resolution logic in c1397670 wasn't considering this. --- .../discourse/app/components/reviewable-item.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/reviewable-item.js b/app/assets/javascripts/discourse/app/components/reviewable-item.js index 10cae579f68..4a3ab6b9d7f 100644 --- a/app/assets/javascripts/discourse/app/components/reviewable-item.js +++ b/app/assets/javascripts/discourse/app/components/reviewable-item.js @@ -107,9 +107,10 @@ export default Component.extend({ } const dasherized = dasherize(type); - const componentExists = getOwner(this).hasRegistration( - `component:${dasherized}` - ); + const owner = getOwner(this); + const componentExists = + owner.hasRegistration(`component:${dasherized}`) || + owner.hasRegistration(`template:components/${dasherized}`); _components[type] = componentExists ? dasherized : null; return _components[type]; },