Merge branch 'develop'
commit
c716290547
|
@ -0,0 +1,4 @@
|
||||||
|
v1.0.6:
|
||||||
|
1. fixed energy category names and units issue in EnergyItem reports.
|
||||||
|
|
||||||
|
|
|
@ -330,6 +330,7 @@ const CombinedEquipmentEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
setCardSummaryList(cardSummaryArray);
|
setCardSummaryList(cardSummaryArray);
|
||||||
|
|
||||||
let sharePieDict = {}
|
let sharePieDict = {}
|
||||||
|
let energyCategoryDict = {};
|
||||||
json['reporting_period']['names'].forEach((currentValue, index) => {
|
json['reporting_period']['names'].forEach((currentValue, index) => {
|
||||||
let sharePieSubItem = {}
|
let sharePieSubItem = {}
|
||||||
sharePieSubItem['id'] = index;
|
sharePieSubItem['id'] = index;
|
||||||
|
@ -344,13 +345,20 @@ const CombinedEquipmentEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
sharePieDict[current_energy_category_id] = [];
|
sharePieDict[current_energy_category_id] = [];
|
||||||
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(current_energy_category_id in energyCategoryDict)) {
|
||||||
|
energyCategoryDict[current_energy_category_id] =
|
||||||
|
{'name': json['reporting_period']['energy_category_names'][index],
|
||||||
|
'unit': json['reporting_period']['units'][index],
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let sharePieArray = [];
|
let sharePieArray = [];
|
||||||
for (let current_energy_category_id in sharePieDict) {
|
for (let current_energy_category_id in sharePieDict) {
|
||||||
let sharePieItem = {}
|
let sharePieItem = {}
|
||||||
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
||||||
sharePieItem['energy_category_name'] = json['reporting_period']['energy_category_names'][current_energy_category_id];
|
sharePieItem['energy_category_name'] = energyCategoryDict[current_energy_category_id]['name'];
|
||||||
sharePieItem['unit'] = json['reporting_period']['units'][current_energy_category_id];
|
sharePieItem['unit'] = energyCategoryDict[current_energy_category_id]['unit'];
|
||||||
sharePieArray.push(sharePieItem);
|
sharePieArray.push(sharePieItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -332,6 +332,7 @@ const EquipmentEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
setCardSummaryList(cardSummaryArray);
|
setCardSummaryList(cardSummaryArray);
|
||||||
|
|
||||||
let sharePieDict = {}
|
let sharePieDict = {}
|
||||||
|
let energyCategoryDict = {};
|
||||||
json['reporting_period']['names'].forEach((currentValue, index) => {
|
json['reporting_period']['names'].forEach((currentValue, index) => {
|
||||||
let sharePieSubItem = {}
|
let sharePieSubItem = {}
|
||||||
sharePieSubItem['id'] = index;
|
sharePieSubItem['id'] = index;
|
||||||
|
@ -346,13 +347,20 @@ const EquipmentEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
sharePieDict[current_energy_category_id] = [];
|
sharePieDict[current_energy_category_id] = [];
|
||||||
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(current_energy_category_id in energyCategoryDict)) {
|
||||||
|
energyCategoryDict[current_energy_category_id] =
|
||||||
|
{'name': json['reporting_period']['energy_category_names'][index],
|
||||||
|
'unit': json['reporting_period']['units'][index],
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let sharePieArray = [];
|
let sharePieArray = [];
|
||||||
for (let current_energy_category_id in sharePieDict) {
|
for (let current_energy_category_id in sharePieDict) {
|
||||||
let sharePieItem = {}
|
let sharePieItem = {}
|
||||||
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
||||||
sharePieItem['energy_category_name'] = json['reporting_period']['energy_category_names'][current_energy_category_id];
|
sharePieItem['energy_category_name'] = energyCategoryDict[current_energy_category_id]['name'];
|
||||||
sharePieItem['unit'] = json['reporting_period']['units'][current_energy_category_id];
|
sharePieItem['unit'] = energyCategoryDict[current_energy_category_id]['unit'];
|
||||||
sharePieArray.push(sharePieItem);
|
sharePieArray.push(sharePieItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,6 +334,7 @@ const ShopfloorEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
setCardSummaryList(cardSummaryArray);
|
setCardSummaryList(cardSummaryArray);
|
||||||
|
|
||||||
let sharePieDict = {}
|
let sharePieDict = {}
|
||||||
|
let energyCategoryDict = {};
|
||||||
json['reporting_period']['names'].forEach((currentValue, index) => {
|
json['reporting_period']['names'].forEach((currentValue, index) => {
|
||||||
let sharePieSubItem = {}
|
let sharePieSubItem = {}
|
||||||
sharePieSubItem['id'] = index;
|
sharePieSubItem['id'] = index;
|
||||||
|
@ -348,13 +349,20 @@ const ShopfloorEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
sharePieDict[current_energy_category_id] = [];
|
sharePieDict[current_energy_category_id] = [];
|
||||||
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(current_energy_category_id in energyCategoryDict)) {
|
||||||
|
energyCategoryDict[current_energy_category_id] =
|
||||||
|
{'name': json['reporting_period']['energy_category_names'][index],
|
||||||
|
'unit': json['reporting_period']['units'][index],
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let sharePieArray = [];
|
let sharePieArray = [];
|
||||||
for (let current_energy_category_id in sharePieDict) {
|
for (let current_energy_category_id in sharePieDict) {
|
||||||
let sharePieItem = {}
|
let sharePieItem = {}
|
||||||
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
||||||
sharePieItem['energy_category_name'] = json['reporting_period']['energy_category_names'][current_energy_category_id];
|
sharePieItem['energy_category_name'] = energyCategoryDict[current_energy_category_id]['name'];
|
||||||
sharePieItem['unit'] = json['reporting_period']['units'][current_energy_category_id];
|
sharePieItem['unit'] = energyCategoryDict[current_energy_category_id]['unit'];
|
||||||
sharePieArray.push(sharePieItem);
|
sharePieArray.push(sharePieItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -263,7 +263,8 @@ const SpaceEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
});
|
});
|
||||||
setCardSummaryList(cardSummaryArray);
|
setCardSummaryList(cardSummaryArray);
|
||||||
|
|
||||||
let sharePieDict = {}
|
let sharePieDict = {};
|
||||||
|
let energyCategoryDict = {};
|
||||||
json['reporting_period']['names'].forEach((currentValue, index) => {
|
json['reporting_period']['names'].forEach((currentValue, index) => {
|
||||||
let sharePieSubItem = {}
|
let sharePieSubItem = {}
|
||||||
sharePieSubItem['id'] = index;
|
sharePieSubItem['id'] = index;
|
||||||
|
@ -278,13 +279,20 @@ const SpaceEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
sharePieDict[current_energy_category_id] = [];
|
sharePieDict[current_energy_category_id] = [];
|
||||||
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(current_energy_category_id in energyCategoryDict)) {
|
||||||
|
energyCategoryDict[current_energy_category_id] =
|
||||||
|
{'name': json['reporting_period']['energy_category_names'][index],
|
||||||
|
'unit': json['reporting_period']['units'][index],
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let sharePieArray = [];
|
let sharePieArray = [];
|
||||||
for (let current_energy_category_id in sharePieDict) {
|
for (let current_energy_category_id in sharePieDict) {
|
||||||
let sharePieItem = {}
|
let sharePieItem = {}
|
||||||
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
||||||
sharePieItem['energy_category_name'] = json['reporting_period']['energy_category_names'][current_energy_category_id];
|
sharePieItem['energy_category_name'] = energyCategoryDict[current_energy_category_id]['name'];
|
||||||
sharePieItem['unit'] = json['reporting_period']['units'][current_energy_category_id];
|
sharePieItem['unit'] = energyCategoryDict[current_energy_category_id]['unit'];
|
||||||
sharePieArray.push(sharePieItem);
|
sharePieArray.push(sharePieItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,6 +334,7 @@ const StoreEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
setCardSummaryList(cardSummaryArray);
|
setCardSummaryList(cardSummaryArray);
|
||||||
|
|
||||||
let sharePieDict = {}
|
let sharePieDict = {}
|
||||||
|
let energyCategoryDict = {};
|
||||||
json['reporting_period']['names'].forEach((currentValue, index) => {
|
json['reporting_period']['names'].forEach((currentValue, index) => {
|
||||||
let sharePieSubItem = {}
|
let sharePieSubItem = {}
|
||||||
sharePieSubItem['id'] = index;
|
sharePieSubItem['id'] = index;
|
||||||
|
@ -348,13 +349,20 @@ const StoreEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
sharePieDict[current_energy_category_id] = [];
|
sharePieDict[current_energy_category_id] = [];
|
||||||
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(current_energy_category_id in energyCategoryDict)) {
|
||||||
|
energyCategoryDict[current_energy_category_id] =
|
||||||
|
{'name': json['reporting_period']['energy_category_names'][index],
|
||||||
|
'unit': json['reporting_period']['units'][index],
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let sharePieArray = [];
|
let sharePieArray = [];
|
||||||
for (let current_energy_category_id in sharePieDict) {
|
for (let current_energy_category_id in sharePieDict) {
|
||||||
let sharePieItem = {}
|
let sharePieItem = {}
|
||||||
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
||||||
sharePieItem['energy_category_name'] = json['reporting_period']['energy_category_names'][current_energy_category_id];
|
sharePieItem['energy_category_name'] = energyCategoryDict[current_energy_category_id]['name'];
|
||||||
sharePieItem['unit'] = json['reporting_period']['units'][current_energy_category_id];
|
sharePieItem['unit'] = energyCategoryDict[current_energy_category_id]['unit'];
|
||||||
sharePieArray.push(sharePieItem);
|
sharePieArray.push(sharePieItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -334,6 +334,7 @@ const TenantEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
setCardSummaryList(cardSummaryArray);
|
setCardSummaryList(cardSummaryArray);
|
||||||
|
|
||||||
let sharePieDict = {}
|
let sharePieDict = {}
|
||||||
|
let energyCategoryDict = {};
|
||||||
json['reporting_period']['names'].forEach((currentValue, index) => {
|
json['reporting_period']['names'].forEach((currentValue, index) => {
|
||||||
let sharePieSubItem = {}
|
let sharePieSubItem = {}
|
||||||
sharePieSubItem['id'] = index;
|
sharePieSubItem['id'] = index;
|
||||||
|
@ -348,13 +349,20 @@ const TenantEnergyItem = ({ setRedirect, setRedirectUrl, t }) => {
|
||||||
sharePieDict[current_energy_category_id] = [];
|
sharePieDict[current_energy_category_id] = [];
|
||||||
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
sharePieDict[current_energy_category_id].push(sharePieSubItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(current_energy_category_id in energyCategoryDict)) {
|
||||||
|
energyCategoryDict[current_energy_category_id] =
|
||||||
|
{'name': json['reporting_period']['energy_category_names'][index],
|
||||||
|
'unit': json['reporting_period']['units'][index],
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let sharePieArray = [];
|
let sharePieArray = [];
|
||||||
for (let current_energy_category_id in sharePieDict) {
|
for (let current_energy_category_id in sharePieDict) {
|
||||||
let sharePieItem = {}
|
let sharePieItem = {}
|
||||||
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
sharePieItem['data'] = sharePieDict[current_energy_category_id];
|
||||||
sharePieItem['energy_category_name'] = json['reporting_period']['energy_category_names'][current_energy_category_id];
|
sharePieItem['energy_category_name'] = energyCategoryDict[current_energy_category_id]['name'];
|
||||||
sharePieItem['unit'] = json['reporting_period']['units'][current_energy_category_id];
|
sharePieItem['unit'] = energyCategoryDict[current_energy_category_id]['unit'];
|
||||||
sharePieArray.push(sharePieItem);
|
sharePieArray.push(sharePieItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue