Skip to content

Commit 2067065

Browse files
committed
Merge branch 'develop'
2 parents 30e5ade + b0c6f31 commit 2067065

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
- added Persian translations in myems-admin and myems-web
1111
### Changed
1212
- added fixed dependency version numbers to myems-api/requirements.txt
13+
- changed units of value_per_unit_area and value_per_capita in myems-web
1314
### Fixed
1415
- fixed overwritten property in myems-web
1516
- fixed overwritten property in myems-admin

myems-web/src/components/MyEMS/Space/SpaceEnergyCategory.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,16 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
303303
totalInTCE['value'] = json['reporting_period']['total_in_kgce'] / 1000; // convert from kg to t
304304
totalInTCE['increment_rate'] =
305305
parseFloat(json['reporting_period']['increment_rate_in_kgce'] * 100).toFixed(2) + '%';
306-
totalInTCE['value_per_unit_area'] = json['reporting_period']['total_in_kgce_per_unit_area'] / 1000; // convert from kg to t
307-
totalInTCE['value_per_capita'] = json['reporting_period']['total_in_kgce_per_capita'] / 1000;
306+
totalInTCE['value_per_unit_area'] = json['reporting_period']['total_in_kgce_per_unit_area'];
307+
totalInTCE['value_per_capita'] = json['reporting_period']['total_in_kgce_per_capita'];
308308
setTotalInTCE(totalInTCE);
309309

310310
let totalInTCO2E = {};
311311
totalInTCO2E['value'] = json['reporting_period']['total_in_kgco2e'] / 1000; // convert from kg to t
312312
totalInTCO2E['increment_rate'] =
313313
parseFloat(json['reporting_period']['increment_rate_in_kgco2e'] * 100).toFixed(2) + '%';
314-
totalInTCO2E['value_per_unit_area'] = json['reporting_period']['total_in_kgco2e_per_unit_area'] / 1000; // convert from kg to t
315-
totalInTCO2E['value_per_capita'] = json['reporting_period']['total_in_kgce_per_capita'] / 1000;
314+
totalInTCO2E['value_per_unit_area'] = json['reporting_period']['total_in_kgco2e_per_unit_area'];
315+
totalInTCO2E['value_per_capita'] = json['reporting_period']['total_in_kgce_per_capita'];
316316
setTotalInTCO2E(totalInTCO2E);
317317

318318
let TCEDataArray = [];
@@ -1344,10 +1344,10 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
13441344
color="warning"
13451345
footnote={t('Per Unit Area')}
13461346
footvalue={totalInTCE['value_per_unit_area']}
1347-
footunit="(TCE/M²)"
1347+
footunit="(kgCE/M²)"
13481348
secondfootnote={t('Per Capita')}
13491349
secondfootvalue={totalInTCE['value_per_capita']}
1350-
secondfootunit="(TCE/M²)"
1350+
secondfootunit="(kgCE)"
13511351
>
13521352
{totalInTCE['value'] && (
13531353
<CountUp end={totalInTCE['value']} duration={2} prefix="" separator="," decimal="." decimals={2} />
@@ -1365,10 +1365,10 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
13651365
color="warning"
13661366
footnote={t('Per Unit Area')}
13671367
footvalue={totalInTCO2E['value_per_unit_area']}
1368-
footunit="(TCO2E/M²)"
1368+
footunit="(kgCO2E/M²)"
13691369
secondfootnote={t('Per Capita')}
13701370
secondfootvalue={totalInTCO2E['value_per_capita']}
1371-
secondfootunit="(TCO2E)"
1371+
secondfootunit="(kgCO2E)"
13721372
>
13731373
{totalInTCO2E['value'] && (
13741374
<CountUp end={totalInTCO2E['value']} duration={2} prefix="" separator="," decimal="." decimals={2} />
@@ -1391,14 +1391,14 @@ const SpaceEnergyCategory = ({ setRedirect, setRedirectUrl, t }) => {
13911391
? (totalInTCO2E['value_per_unit_area'] / totalInTCE['value_per_unit_area']).toFixed(3)
13921392
: '--'
13931393
}
1394-
footunit="(TCO2E/TCE/M²)"
1394+
footunit="(kgCO2E/kgCE/M²)"
13951395
secondfootnote={t('Per Capita')}
13961396
secondfootvalue={
13971397
totalInTCE['value_per_capita'] && totalInTCE['value_per_capita'] !== 0 && totalInTCO2E['value_per_capita']
13981398
? (totalInTCO2E['value_per_capita'] / totalInTCE['value_per_capita']).toFixed(3)
13991399
: '--'
14001400
}
1401-
secondfootunit="(TCO2E/TCE)"
1401+
secondfootunit="(kgCO2E/kgCE)"
14021402
>
14031403
{totalInTCE['value'] && totalInTCE['value'] !== 0 && totalInTCO2E['value'] ? (
14041404
<CountUp

myems-web/src/components/MyEMS/dashboard/Dashboard.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,10 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
276276
totalInTCE['increment_rate'] =
277277
parseFloat(json['reporting_period_input']['this_month_increment_rate_in_kgce'] * 100).toFixed(2) + '%';
278278
totalInTCE['value_per_unit_area'] =
279-
json['space']['area'] > 0 ? parseFloat(totalInTCE['value'] / json['space']['area']).toFixed(3) : 0.0;
279+
json['space']['area'] > 0 ? parseFloat(1000.0 * totalInTCE['value'] / json['space']['area']).toFixed(3) : 0.0;
280280
totalInTCE['value_per_capita'] =
281281
json['space']['number_of_occupants'] > 0
282-
? parseFloat(totalInTCE['value'] / json['space']['number_of_occupants']).toFixed(3)
282+
? parseFloat(1000.0 *totalInTCE['value'] / json['space']['number_of_occupants']).toFixed(3)
283283
: 0.0;
284284
setTotalInTCE(totalInTCE);
285285

@@ -299,10 +299,10 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
299299
totalInTCO2E['increment_rate'] =
300300
parseFloat(json['reporting_period_input']['this_month_increment_rate_in_kgco2e'] * 100).toFixed(2) + '%';
301301
totalInTCO2E['value_per_unit_area'] =
302-
json['space']['area'] > 0 ? parseFloat(totalInTCO2E['value'] / json['space']['area']).toFixed(3) : 0.0;
302+
json['space']['area'] > 0 ? parseFloat(1000.0 * totalInTCO2E['value'] / json['space']['area']).toFixed(3) : 0.0;
303303
totalInTCO2E['value_per_capita'] =
304304
json['space']['number_of_occupants'] > 0
305-
? parseFloat(totalInTCO2E['value'] / json['space']['number_of_occupants']).toFixed(3)
305+
? parseFloat(1000.0 * totalInTCO2E['value'] / json['space']['number_of_occupants']).toFixed(3)
306306
: 0.0;
307307
setTotalInTCO2E(totalInTCO2E);
308308

@@ -767,10 +767,10 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
767767
color="warning"
768768
footnote={t('Per Unit Area')}
769769
footvalue={totalInTCE['value_per_unit_area']}
770-
footunit="(TCE/m²)"
770+
footunit="(kgCE/m²)"
771771
secondfootnote={t('Per Capita')}
772772
secondfootvalue={totalInTCE['value_per_capita']}
773-
secondfootunit="(TCE)"
773+
secondfootunit="(kgCE)"
774774
>
775775
{totalInTCE['value'] && (
776776
<CountUp end={totalInTCE['value']} duration={2} prefix="" separator="," decimal="." decimals={2} />
@@ -788,10 +788,10 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
788788
color="warning"
789789
footnote={t('Per Unit Area')}
790790
footvalue={totalInTCO2E['value_per_unit_area']}
791-
footunit="(TCO2E/m²)"
791+
footunit="(kgCO2E/m²)"
792792
secondfootnote={t('Per Capita')}
793793
secondfootvalue={totalInTCO2E['value_per_capita']}
794-
secondfootunit="(TCO2E)"
794+
secondfootunit="(kgCO2E)"
795795
>
796796
{totalInTCO2E['value'] && (
797797
<CountUp end={totalInTCO2E['value']} duration={2} prefix="" separator="," decimal="." decimals={2} />
@@ -820,14 +820,14 @@ const Dashboard = ({ setRedirect, setRedirectUrl, t }) => {
820820
? (totalInTCO2E['value_per_unit_area'] / totalInTCE['value_per_unit_area']).toFixed(3)
821821
: '--'
822822
}
823-
footunit={t('(TCO2E/TCE/m²)')}
823+
footunit={t('(kgCO2E/kgCE/m²)')}
824824
secondfootnote={t('Per Capita')}
825825
secondfootvalue={
826826
totalInTCE['value_per_capita'] && totalInTCE['value_per_capita'] !== 0 && totalInTCO2E['value_per_capita']
827827
? (totalInTCO2E['value_per_capita'] / totalInTCE['value_per_capita']).toFixed(3)
828828
: '--'
829829
}
830-
secondfootunit={t('(TCO2E/TCE)')}
830+
secondfootunit={t('(kgCO2E/kgCE)')}
831831
>
832832
{totalInTCE['value'] && totalInTCE['value'] !== 0 && totalInTCO2E['value'] ? (
833833
<CountUp

0 commit comments

Comments
 (0)