Remove Purpose property from inventory item
The Purpose property is not useful in the inventory item.
The field overflows to another line.
The Purpose property under a power supply inventory item:
PURPOSE
xyz.openbmc_project.Software.Version.VersionPurpose.Other
When we move to Redfish, this can be removed.
An alternatives considered was only using the last part of the
purpose property (e.g. Other). Still didn not find this userful
to customers so just removed.
https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Software/Version.interface.yaml#L14
Tested: Built and loaded on a Witherspoon. Don't see the property.
Change-Id: Ie004c90f6a5e625cfa65ba39ab2be97e5e256705
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 ebc2956..51da8bb 100644
--- a/app/common/services/api-utils.js
+++ b/app/common/services/api-utils.js
@@ -1531,6 +1531,16 @@
delete content.data[key].associations;
}
+ // Remove the Purpose property from any inventory item.
+ // The purpose property isn't useful to a user.
+ // E.g. in a Power Supply:
+ // Purpose
+ // xyz.openbmc_project.Software.Version.VersionPurpose.Other
+ // Remove when we move inventory to Redfish
+ if (content.data[key].hasOwnProperty('Purpose')) {
+ delete content.data[key].Purpose;
+ }
+
data = camelcaseToLabel(content.data[key]);
searchText = getSearchText(data);
title = key.split('/').pop();