From d63cb61dd3d4c1032a48aeb65053ed56ae308e09 Mon Sep 17 00:00:00 2001 From: Ashley Robinson Date: Thu, 28 Sep 2023 17:55:35 -0400 Subject: [PATCH] Updated computed property to return proper values. --- lib/registries/addon/overview/index/controller.ts | 15 ++++++++++++--- lib/registries/addon/overview/index/template.hbs | 8 ++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/lib/registries/addon/overview/index/controller.ts b/lib/registries/addon/overview/index/controller.ts index 38a2a39d479..2e495c31ea2 100644 --- a/lib/registries/addon/overview/index/controller.ts +++ b/lib/registries/addon/overview/index/controller.ts @@ -13,11 +13,20 @@ export default class Overview extends Controller { registration?: Registration; @computed('registration.{root,isRoot}') - get root() { - if (!this.registration || !this.registration.isRoot) { + get rootTitle() { + if (!this.registration || this.registration.isRoot) { return undefined; } + const rootTitle = this.registration.root.get('title'); + return rootTitle; + } - return this.registration.belongsTo('root').value() as Registration; + @computed('registration.{root,isRoot}') + get rootId() { + if (!this.registration || this.registration.isRoot) { + return undefined; + } + const rootId = this.registration.root.get('id'); + return rootId; } } diff --git a/lib/registries/addon/overview/index/template.hbs b/lib/registries/addon/overview/index/template.hbs index 26d1c709c8f..4dfae537cc3 100644 --- a/lib/registries/addon/overview/index/template.hbs +++ b/lib/registries/addon/overview/index/template.hbs @@ -1,14 +1,14 @@ -{{#if this.registration.isRoot}} +{{#unless this.registration.isRoot}}
{{t 'registries.overview.component_of'}} - {{this.root.title}} + {{this.rootTitle}}
-{{/if}} +{{/unless}} {{#if this.registration}}