Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize In-App Dashboard & Use New Energy Footprint Calculations #1176

Merged
merged 51 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
4b8264d
refactor MetricsTab into sections
JGreenlee Aug 29, 2024
7e99a32
split metrics tab into sections; add MetricsScreen component
JGreenlee Sep 3, 2024
11bef71
revise dashboard tab sections; 'Travel' tab
JGreenlee Sep 5, 2024
afe5973
refresh styles: palette, navbar, navigation tabs
JGreenlee Sep 5, 2024
2eab6c5
update react-native-paper-dates
JGreenlee Sep 11, 2024
6bad3dd
move formatForDisplay to js/util.ts
JGreenlee Sep 11, 2024
6e671b2
DateSelect + NavBarButton style tweak
JGreenlee Sep 11, 2024
66a854d
allow surveys to be skipped on DEV builds
JGreenlee Sep 11, 2024
462ed94
use <Portal> instead of <Modal> for Alerts
JGreenlee Sep 11, 2024
a3940ea
rename dash_key to uncertainty_prefix
JGreenlee Sep 18, 2024
eae8ab0
TimelineContext: only load the last week even if pipeline is behind
JGreenlee Sep 18, 2024
adf7b1e
unify date & time formatting functions, move to common place
JGreenlee Sep 18, 2024
db160bc
fix segmentDaysByWeeks with blank weeks
JGreenlee Sep 18, 2024
5f131ae
update "Movement" section
JGreenlee Sep 18, 2024
e000b15
MetricsTab: only force >= 14 days on initialization
JGreenlee Sep 18, 2024
612e674
adjust metrics cards styles
JGreenlee Sep 18, 2024
de524ca
change SummaryCard, 'guidelines' -> 'goals'
JGreenlee Sep 18, 2024
c9831b3
use e-mission-common 0.6.1, update types
JGreenlee Sep 18, 2024
7e109e2
extract getColorForModeLabel to metricsHelper
JGreenlee Sep 18, 2024
42eefd9
add WeeklyFootprintCard
JGreenlee Sep 18, 2024
24c0eb4
use SummaryCard and WeeklyFootprintCard; remove old cards
JGreenlee Sep 18, 2024
b3c132e
add ChartRecord type
JGreenlee Sep 18, 2024
f481608
add missing import in MetricsScreen
JGreenlee Sep 18, 2024
19881d8
TimelineContext: set initial value for dateRange
JGreenlee Sep 18, 2024
acd40b1
consolidate "metrics" translations
JGreenlee Sep 18, 2024
7fc842c
fix LabelOption type
JGreenlee Sep 18, 2024
aa01f1f
update styles of metrics cards, navbar
JGreenlee Sep 19, 2024
54f73d1
add more metrics translations
JGreenlee Sep 19, 2024
616b6b0
use the new label options and rich modes pattern throughout the UI
JGreenlee Sep 19, 2024
bacc745
use all days for DailyActiveMinutesCard
JGreenlee Sep 19, 2024
5cfad8d
fix display of week date ranges on WeeklyActiveMinutesCard
JGreenlee Sep 19, 2024
8d1965c
fix missing return of getColorForModeLabel
JGreenlee Sep 19, 2024
e49bf0c
fix types in metrics
JGreenlee Sep 19, 2024
b46a255
export colors from appTheme
JGreenlee Sep 19, 2024
6e1d719
adjust formatForDisplay
JGreenlee Sep 19, 2024
6743b8c
add FootprintComparisonCard
JGreenlee Sep 19, 2024
fd5010a
fix lineAnnotations on WeeklyFootprintCard
JGreenlee Sep 19, 2024
6e7153f
keep total of nUsers when aggregating MetricEntries
JGreenlee Sep 19, 2024
a7fcd0d
remove old footprint metrics files
JGreenlee Sep 19, 2024
a623405
update translations
JGreenlee Sep 19, 2024
b13524f
update tests to reflect changes
JGreenlee Sep 19, 2024
59dbd72
make the StatusBar color match the appbar background color
JGreenlee Sep 19, 2024
95dc523
Merge branch 'master' of https://github.com/e-mission/e-mission-phone…
JGreenlee Sep 19, 2024
314af14
fix error with adding nUsers
JGreenlee Sep 19, 2024
61f873e
remove LoadMoreButton test
JGreenlee Sep 19, 2024
8740062
updated EXPECTED_COUNT of plugins
JGreenlee Sep 19, 2024
f671e04
fix prettier
JGreenlee Sep 19, 2024
33a38c9
handle statusbar style on welcome page vs rest of app
JGreenlee Sep 20, 2024
dabeb7c
remove more unused functions from metricsHelper
JGreenlee Sep 20, 2024
cd0b488
add more tests to metricsHelper
JGreenlee Sep 20, 2024
9c2186b
fix typo DailyActiveMinutesCard
JGreenlee Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I should really review the e-mission-common changes at some point too. Maybe I can do that while generating the results for the paper.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the easiest way to do that would be looking at the releases on e-mission-common and the "Full changelog"s that are generated there
https://github.com/JGreenlee/e-mission-common/releases

"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
Loading