Display Power Supply Inventory from PowerSubsystem

Switch Power Supply information to use information from the new
PowerSubsystem since bmcweb enabled this by default, any other modern
Redfish implementation should have this schema enabled.

Tested: On Ampere MtJade platform
1. Login to WebUI; Hardware Status; Inventory
2. Inventory information for power supplies is displayed.

Change-Id: Iad59d0145b47bcd5eb3cb4ff852e50da976a6005
Signed-off-by: HuyLe <hule@amperecomputing.com>
diff --git a/src/store/modules/HardwareStatus/PowerSupplyStore.js b/src/store/modules/HardwareStatus/PowerSupplyStore.js
index 82b7174..2393ba0 100644
--- a/src/store/modules/HardwareStatus/PowerSupplyStore.js
+++ b/src/store/modules/HardwareStatus/PowerSupplyStore.js
@@ -12,10 +12,10 @@
     setPowerSupply: (state, data) => {
       state.powerSupplies = data.map((powerSupply) => {
         const {
-          EfficiencyPercent,
+          EfficiencyRatings = [],
           FirmwareVersion,
           LocationIndicatorActive,
-          MemberId,
+          Id,
           Manufacturer,
           Model,
           Name,
@@ -27,11 +27,11 @@
           Status = {},
         } = powerSupply;
         return {
-          id: MemberId,
+          id: Id,
           health: Status.Health,
           partNumber: PartNumber,
           serialNumber: SerialNumber,
-          efficiencyPercent: EfficiencyPercent,
+          efficiencyPercent: EfficiencyRatings[0].EfficiencyPercent,
           firmwareVersion: FirmwareVersion,
           identifyLed: LocationIndicatorActive,
           manufacturer: Manufacturer,
@@ -70,8 +70,20 @@
     },
     async getChassisPower(_, id) {
       return await api
-        .get(`${id}/Power`)
-        .then(({ data: { PowerSupplies } }) => PowerSupplies || [])
+        .get(`${id}/PowerSubsystem`)
+        .then((response) => {
+          return api.get(`${response.data.PowerSupplies['@odata.id']}`);
+        })
+        .then(({ data: { Members } }) => {
+          const promises = Members.map((member) =>
+            api.get(member['@odata.id']),
+          );
+          return api.all(promises);
+        })
+        .then((response) => {
+          const data = response.map(({ data }) => data);
+          return data;
+        })
         .catch((error) => console.log(error));
     },
   },