Skip to content

Commit

Permalink
Merge pull request #1176 from JGreenlee/energy-dashboard-2024
Browse files Browse the repository at this point in the history
Reorganize In-App Dashboard & Use New Energy Footprint Calculations
  • Loading branch information
shankari authored Sep 22, 2024
2 parents 003c55d + 9c2186b commit 6d69e15
Show file tree
Hide file tree
Showing 76 changed files with 1,814 additions and 2,363 deletions.
9 changes: 6 additions & 3 deletions package.cordovabuild.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
},
"cordova-plugin-bluetooth-classic-serial-port": {},
"cordova-custom-config": {},
"com.unarin.cordova.beacon": {}
"com.unarin.cordova.beacon": {},
"cordova-plugin-statusbar": {}
}
},
"dependencies": {
Expand Down Expand Up @@ -136,8 +137,9 @@
"cordova-plugin-bluetooth-classic-serial-port": "git+https://github.com/e-mission/cordova-plugin-bluetooth-classic-serial-port.git",
"cordova-custom-config": "^5.1.1",
"com.unarin.cordova.beacon": "github:e-mission/cordova-plugin-ibeacon",
"cordova-plugin-statusbar": "^4.0.0",
"core-js": "^2.5.7",
"e-mission-common": "github:JGreenlee/e-mission-common#semver:0.5.4",
"e-mission-common": "github:JGreenlee/e-mission-common#semver:0.6.1",
"enketo-core": "^6.1.7",
"enketo-transformer": "^4.0.0",
"fast-xml-parser": "^4.2.2",
Expand All @@ -156,7 +158,8 @@
"react-dom": "~18.2.0",
"react-i18next": "^13.5.0",
"react-native-paper": "^5.11.0",
"react-native-paper-dates": "^0.18.12",
"react-native-paper-dates": "0.21.8",
"react-native-paper-tabs": "^0.10.4",
"react-native-safe-area-context": "^4.6.3",
"react-native-screens": "^3.22.0",
"react-native-vector-icons": "^9.2.0",
Expand Down
5 changes: 3 additions & 2 deletions package.serve.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"chartjs-adapter-luxon": "^1.3.1",
"chartjs-plugin-annotation": "^3.0.1",
"core-js": "^2.5.7",
"e-mission-common": "github:JGreenlee/e-mission-common#semver:0.5.4",
"e-mission-common": "github:JGreenlee/e-mission-common#semver:0.6.1",
"enketo-core": "^6.1.7",
"enketo-transformer": "^4.0.0",
"fast-xml-parser": "^4.2.2",
Expand All @@ -83,7 +83,8 @@
"react-dom": "~18.2.0",
"react-i18next": "^13.5.0",
"react-native-paper": "^5.11.0",
"react-native-paper-dates": "^0.18.12",
"react-native-paper-dates": "0.21.8",
"react-native-paper-tabs": "^0.10.4",
"react-native-safe-area-context": "^4.6.3",
"react-native-screens": "^3.22.0",
"react-native-vector-icons": "^9.2.0",
Expand Down
2 changes: 1 addition & 1 deletion setup/setup_native.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ sed -i -e "s|/usr/bin/env node|/usr/bin/env node --unhandled-rejections=strict|"

npx cordova prepare$PLATFORMS

EXPECTED_COUNT=25
EXPECTED_COUNT=26
INSTALLED_COUNT=`npx cordova plugin list | wc -l`
echo "Found $INSTALLED_COUNT plugins, expected $EXPECTED_COUNT"
if [ $INSTALLED_COUNT -lt $EXPECTED_COUNT ];
Expand Down
25 changes: 0 additions & 25 deletions www/__tests__/LoadMoreButton.test.tsx

This file was deleted.

17 changes: 6 additions & 11 deletions www/__tests__/confirmHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
inferFinalLabels,
labelInputDetailsForTrip,
labelKeyToReadable,
labelKeyToRichMode,
labelOptionByValue,
labelKeyToText,
readableLabelToKey,
verifiabilityForTrip,
} from '../js/survey/multilabel/confirmHelper';
Expand All @@ -16,11 +15,7 @@ import { CompositeTrip, UserInputEntry } from '../js/types/diaryTypes';
import { UserInputMap } from '../js/TimelineContext';
window['i18next'] = initializedI18next;

const fakeAppConfig = {
label_options: 'json/label-options.json.sample',
};
const fakeAppConfigWithModeOfStudy = {
...fakeAppConfig,
intro: {
mode_studied: 'walk',
},
Expand Down Expand Up @@ -61,10 +56,10 @@ jest.mock('../js/services/commHelper', () => ({
}));

describe('confirmHelper', () => {
it('returns labelOptions given an appConfig', async () => {
const labelOptions = await getLabelOptions(fakeAppConfig);
it('returns default labelOptions given a blank appConfig', async () => {
const labelOptions = await getLabelOptions({});
expect(labelOptions).toBeTruthy();
expect(labelOptions.MODE[0].text).toEqual('Walk'); // translation is filled in
expect(labelOptions.MODE[0].value).toEqual('walk');
});

it('returns base labelInputDetails for a labelUserInput which does not have mode of study', () => {
Expand Down Expand Up @@ -112,10 +107,10 @@ describe('confirmHelper', () => {

it('looks up a rich mode from a label key, or humanizes the label key if there is no rich mode', () => {
const key = 'walk';
const richMode = labelKeyToRichMode(key);
const richMode = labelKeyToText(key);
expect(richMode).toEqual('Walk');
const key2 = 'scooby_doo_mystery_machine';
const readableMode = labelKeyToRichMode(key2);
const readableMode = labelKeyToText(key2);
expect(readableMode).toEqual('Scooby Doo Mystery Machine');
});

Expand Down
62 changes: 0 additions & 62 deletions www/__tests__/customMetricsHelper.test.ts

This file was deleted.

Loading

0 comments on commit 6d69e15

Please sign in to comment.