From 087898c15a6cf5137a146855d3e9e9c69fc3491b Mon Sep 17 00:00:00 2001
From: lisbet-alvarez <107949262+lisbet-alvarez@users.noreply.github.com>
Date: Tue, 28 Mar 2023 10:14:31 -0700
Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20add=20model=20hook=20to?=
=?UTF-8?q?=20host=20route=20for=20dynamic=20host=20catalogs=20(#1659)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: 🐛 add model hook to host route for dynamic host catalogs
✅ Closes: ICU-8594
* refactor: 💡 remove page formatting for host route
---
.../host-sets/host-set/hosts/host.js | 19 ++++++++++++++++++-
.../host-catalog/hosts/host/index.hbs | 2 +-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js
index a4c448d72..acfd23207 100644
--- a/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js
+++ b/ui/admin/app/routes/scopes/scope/host-catalogs/host-catalog/host-sets/host-set/hosts/host.js
@@ -4,5 +4,22 @@
*/
import Route from '@ember/routing/route';
+import { inject as service } from '@ember/service';
-export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostRoute extends Route {}
+export default class ScopesScopeHostCatalogsHostCatalogHostSetsHostSetHostsHostRoute extends Route {
+ // =services
+
+ @service store;
+
+ // =methods
+
+ /**
+ * Load a host in current scope.
+ * @param {object} params
+ * @param {string} params.host_id
+ * @return {HostModel}
+ */
+ async model({ host_id }) {
+ return this.store.findRecord('host', host_id, { reload: true });
+ }
+}
diff --git a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/host/index.hbs b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/host/index.hbs
index deca7e140..7ab0010c7 100644
--- a/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/host/index.hbs
+++ b/ui/admin/app/templates/scopes/scope/host-catalogs/host-catalog/hosts/host/index.hbs
@@ -17,7 +17,7 @@
-
+