diff --git a/app/resolve-guid/guid-route.ts b/app/resolve-guid/guid-route.ts index 9ddbd37f091..227d99b5cbc 100644 --- a/app/resolve-guid/guid-route.ts +++ b/app/resolve-guid/guid-route.ts @@ -20,29 +20,25 @@ export default abstract class GuidRoute extends Route { @service ready!: Ready; @service store!: Store; + abstract modelName(): keyof ModelRegistry; + @task @waitFor async getModel(guid: string) { - const blocker = this.ready.getBlocker(); - - let model; try { - model = await this.store.findRecord(this.modelName(), guid, { + const blocker = this.ready.getBlocker(); + const model = await this.store.findRecord(this.modelName(), guid, { include: this.include(), adapterOptions: this.adapterOptions(), }); + blocker.done(); + return model; } catch (e) { // To do custom error handling, add an error() action to the route that subclasses GuidRoute. this.send('error', e); } - - blocker.done(); - - return model; } - abstract modelName(): keyof ModelRegistry; - adapterOptions(): {} { return {}; } @@ -52,8 +48,9 @@ export default abstract class GuidRoute extends Route { } model(params: { guid: string }) { + const paramsGuid = params.guid; return { - guid: params.guid, + guid: paramsGuid, taskInstance: taskFor(this.getModel).perform(params.guid), task: this.getModel, }; diff --git a/lib/registries/addon/overview/index/controller.ts b/lib/registries/addon/overview/index/controller.ts index 0d407579bff..38a2a39d479 100644 --- a/lib/registries/addon/overview/index/controller.ts +++ b/lib/registries/addon/overview/index/controller.ts @@ -14,7 +14,7 @@ export default class Overview extends Controller { @computed('registration.{root,isRoot}') get root() { - if (!this.registration || this.registration.isRoot) { + if (!this.registration || !this.registration.isRoot) { return undefined; } diff --git a/lib/registries/addon/overview/index/template.hbs b/lib/registries/addon/overview/index/template.hbs index 487e926b9b6..26d1c709c8f 100644 --- a/lib/registries/addon/overview/index/template.hbs +++ b/lib/registries/addon/overview/index/template.hbs @@ -1,4 +1,4 @@ -{{#unless this.registration.isRoot}} +{{#if this.registration.isRoot}}
{{t 'registries.overview.component_of'}}
-{{/unless}} +{{/if}} {{#if this.registration}}