Hardware: Filter out associations
Don't display associations on the "Hardware status" page.
All and only associations have the "endpoints" property,
use this is to filter.
An example of an association is from the BMC inventory item
to BMC software images.
Tested: Loaded on a Witherspoon and no longer see the "Activation"
item on the page. This "Activation" item was an
association. All other items appear as normal.
Change-Id: I6e6e24737b0a19e91dbd7eb691dd3d78f1b4c12c
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/common/services/api-utils.js b/app/common/services/api-utils.js
index 840db8e..503fcd1 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -1605,6 +1605,13 @@
data = camelcaseToLabel(content.data[key]);
searchText = getSearchText(data);
title = key.split('/').pop();
+ // All and only associations have the property "endpoints".
+ // We don't want to show associations on the hardware page.
+ // Example: An association from the BMC inventory item to the
+ // BMC firmware images.
+ if (content.data[key].hasOwnProperty('endpoints')) {
+ continue;
+ }
title = titlelize(title);
// e.g. /xyz/openbmc_project/inventory/system and