-
Notifications
You must be signed in to change notification settings - Fork 114
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
Commits on Aug 29, 2024
-
refactor MetricsTab into sections
Move the components used by a 'row' of cards to a subdirectory of 'metrics' Create new components for each section which groups the cards into a Carousel
Configuration menu - View commit details
-
Copy full SHA for 4b8264d - Browse repository at this point
Copy the full SHA 4b8264dView commit details
Commits on Sep 3, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7e99a32 - Browse repository at this point
Copy the full SHA 7e99a32View commit details
Commits on Sep 5, 2024
-
revise dashboard tab sections; 'Travel' tab
Renamed "Summary" section to "Travel" section; this will show 'distance', 'duration', and 'count' Update types to include 'footprint' as a metric, and revise the sections ('footprint', 'movement', 'surveys', 'travel')
Configuration menu - View commit details
-
Copy full SHA for 11bef71 - Browse repository at this point
Copy the full SHA 11bef71View commit details -
refresh styles: palette, navbar, navigation tabs
- update color palette to align with Material Design 3 (which is what React Native Paper is based on) - update NavBar component; pass props through to the underlying Appbar.Header, allowing flexibility of elevated = true or false
Configuration menu - View commit details
-
Copy full SHA for afe5973 - Browse repository at this point
Copy the full SHA afe5973View commit details
Commits on Sep 11, 2024
-
update react-native-paper-dates
includes a fix for 'validateDOMNesting' error message
Configuration menu - View commit details
-
Copy full SHA for 2eab6c5 - Browse repository at this point
Copy the full SHA 2eab6c5View commit details -
move formatForDisplay to js/util.ts
Moved to a more general location since this can be used in many parts of the UI
Configuration menu - View commit details
-
Copy full SHA for 6bad3dd - Browse repository at this point
Copy the full SHA 6bad3ddView commit details -
DateSelect + NavBarButton style tweak
height = 40 & adjust padding/margins to match standard Material UI button use lighter grey on DateSelect, show on one line and use month + day (e.g. "Sep 9") instead of MM/DD/YYYY
Configuration menu - View commit details
-
Copy full SHA for 6e671b2 - Browse repository at this point
Copy the full SHA 6e671b2View commit details -
allow surveys to be skipped on DEV builds
Speeds up development; does not affect production
Configuration menu - View commit details
-
Copy full SHA for 66a854d - Browse repository at this point
Copy the full SHA 66a854dView commit details -
use <Portal> instead of <Modal> for Alerts
We had used <Modal> here (while still in the process of migrating from Angular) to ensure the snackbar shows above the rest of the content. This prevented interacting with other content until the snackbar (and its modal) were dismissed. Per RN Paper docs, Snackbars are intended to work with Portals. https://callstack.github.io/react-native-paper/docs/components/Snackbar/ We can do this now that we have a PaperProvider at the App level (index.js)
Configuration menu - View commit details
-
Copy full SHA for 462ed94 - Browse repository at this point
Copy the full SHA 462ed94View commit details
Commits on Sep 18, 2024
-
rename dash_key to uncertainty_prefix
Bars on a chart get shown with transparency if they begin with this. In a previous version, it was dashed lines, but it's no longer apt to call it dash_key.
Configuration menu - View commit details
-
Copy full SHA for a3940ea - Browse repository at this point
Copy the full SHA a3940eaView commit details -
TimelineContext: only load the last week even if pipeline is behind
This mostly just matters for: 1) testing with historical data, or 2) people whose pipeline is stuck, which indicates a deeper problem. But it will prevent any scenarios where several weeks/months get loaded in all at once. To aid with scenario (1), we can add a button to the TimelineScrollList: if there is no travel in the past week and the pipeline end is not in the last week, this gives us a shortcut to the last processed week
Configuration menu - View commit details
-
Copy full SHA for eae8ab0 - Browse repository at this point
Copy the full SHA eae8ab0View commit details -
unify date & time formatting functions, move to common place
both Label and Dashboard tabs use date & time formatting functions using ISO strings, including with/without weekday, and with/without year, and "humanized" duration strings Makes generic versions of these and puts them in js/util.ts DateSelect will use this as well; as a result it will shift from using a numerical, with year (e.g. "9/17/2024") representation, to an abbreviated string form (e.g. "Sep 17") This is 1) more friendly / less initimidating, 2) allows the datepicker text to be one line, which reduces clutter
Configuration menu - View commit details
-
Copy full SHA for adf7b1e - Browse repository at this point
Copy the full SHA adf7b1eView commit details -
fix segmentDaysByWeeks with blank weeks
If there is an long stretch of time with no data, this implementation will not work; it should keep inserting empty weeks until there are no more days
Configuration menu - View commit details
-
Copy full SHA for db160bc - Browse repository at this point
Copy the full SHA db160bcView commit details -
Categorizing this as "Movement" instead of "Active Travel" Also updating to determine the list of "active modes" from the presence of "met" in the rich modes. Before, this was a config option or defaulted to only "walk" and "bike" (now it will include "ebike" if "ebike" has non-zero "mets", or any other modes with non-zero "mets") -update styles on the cards
Configuration menu - View commit details
-
Copy full SHA for 5f131ae - Browse repository at this point
Copy the full SHA 5f131aeView commit details -
MetricsTab: only force >= 14 days on initialization
When the user first goes to the Dashboard in an app session, we want to show them at least 2 weeks so they can compare the previous week to the past week. But after that we should allow them to select any range. So we can add an 'isInitialized' bool state to mark this, and only do this ">= 14 days" check on the initialization Also add a 'refresh' function which not only refreshes the timeline but also resets 'isInitialized' (along with 'aggMetricsIsLoading')
Configuration menu - View commit details
-
Copy full SHA for e000b15 - Browse repository at this point
Copy the full SHA e000b15View commit details -
Configuration menu - View commit details
-
Copy full SHA for 612e674 - Browse repository at this point
Copy the full SHA 612e674View commit details -
change SummaryCard, 'guidelines' -> 'goals'
and fix them since they were flipped ('low' should come first)
Configuration menu - View commit details
-
Copy full SHA for de524ca - Browse repository at this point
Copy the full SHA de524caView commit details -
use e-mission-common 0.6.1, update types
e-mission-common 0.6.1 comes with expanded metrics (support for 'footprint', which needs label_options passed from MetricsTab.tsx). Update types: new LabelOptions spec, explicit type for RichMode, add 'footprint' to metricsTypes, add "MetricEntry" type which is like DayOfMetricData but not necessarily for 1 day (it could be aggregated across an entire week, for example) Add "goals" to appconfig.metrics.phone_dashboard_ui.footprint_options
Configuration menu - View commit details
-
Copy full SHA for c9831b3 - Browse repository at this point
Copy the full SHA c9831b3View commit details -
extract getColorForModeLabel to metricsHelper
Also fixes translation issue: instead of checking for hardcoded value "Unlabeled" (which probably did not work in other languages) check if the label starts with whatever the "unlabeled" string is for the current language
Configuration menu - View commit details
-
Copy full SHA for 7e109e2 - Browse repository at this point
Copy the full SHA 7e109e2View commit details -
Shows barchart of average daily footprint for the user, grouped by weeks, colored based on goals ("meter" of green -> red) Includes checkboxes to break down by a grouping field (mode_confirm, purpose_confirm, etc) If mode_confirm, then base mode colors are used instead of the 'meter' Works for either 'carbon' (with kg_co2) or 'energy' (with kwh) new functions in metricsHelper - aggMetricEntries combines/ merges array of MetricEntry (used by WeeklyFootprintCard to aggregate multiple days into a week) - sumMetricEntry adds up all values within a day - sumMetricEntries does both The type definitions may look complex here, but all they really do is allow the return type to depend on the 'metricName'. For example, if metricName is 'duration', then the return type is just a number. But if metricName is 'footprint', it is an object containing 'kwh' and 'kg_co2' This way we don't have to write separate functions for every metric
Configuration menu - View commit details
-
Copy full SHA for 42eefd9 - Browse repository at this point
Copy the full SHA 42eefd9View commit details -
use SummaryCard and WeeklyFootprintCard; remove old cards
use the new components, SummaryCard and WeeklyFootprintCard, on the Footprint section. Each of these work for both carbon and energy, so we don't need the 'energy' components, nor the old CarbonFootprintCard and CarbonTextCard A few things of note in FootprintSection: cumulativeFootprintSum sums the footprint metric (which includes both carbon and energy) across all days. This gets fed into SummaryCard Goals are read from the appconfig. Because they are internationalized, though, the labels have to looked up by lang. If a footnote is configured, it is added and a reference to it is appended to the label. The goals are passed to SummaryCard and WeeklyFootprintCard A dynamic footnotes mechanism via `addFootnote`. Instead of including the footnote numbers, (e.g. ¹ ²) directly in the strings, we can round them up for the whole section, keeping track of their numbers, and show them all at the bottom. This allows footnotes to be dynamically shown. If one configuration doesn't use "goals", then that footnote won't show. The "unlabeled" footnote will then become ¹, avoiding any weird scenarios where ¹ is not present and it skips straight to ² We can expand on this later if we want to be more detailed about footnotes, references, data sources
Configuration menu - View commit details
-
Copy full SHA for 24c0eb4 - Browse repository at this point
Copy the full SHA 24c0eb4View commit details -
Configuration menu - View commit details
-
Copy full SHA for b3c132e - Browse repository at this point
Copy the full SHA b3c132eView commit details -
Configuration menu - View commit details
-
Copy full SHA for f481608 - Browse repository at this point
Copy the full SHA f481608View commit details -
TimelineContext: set initial value for dateRange
instead of setting dateRange only once pipelineRange is set, we can set dateRange upfront and just not do anything with it until pipelineRange has been set This saves us from constantly checking dateRange != null anywhere it is used downstream
Configuration menu - View commit details
-
Copy full SHA for 19881d8 - Browse repository at this point
Copy the full SHA 19881d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for acd40b1 - Browse repository at this point
Copy the full SHA acd40b1View commit details -
It needs to be MultilabelKey by default, otherwise we have to specify this everywhere
Configuration menu - View commit details
-
Copy full SHA for 7fc842c - Browse repository at this point
Copy the full SHA 7fc842cView commit details
Commits on Sep 19, 2024
-
update styles of metrics cards, navbar
Unifies the styling of all metrics cards Adjusts navbar and refresh button on label screen so the label screen and metrics screen navbars match each other
Configuration menu - View commit details
-
Copy full SHA for aa01f1f - Browse repository at this point
Copy the full SHA aa01f1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 54f73d1 - Browse repository at this point
Copy the full SHA 54f73d1View commit details -
use the new label options and rich modes pattern throughout the UI
Where base modes were previously a property of the label options, and had a separate set of properties, we now have rich modes that inherit from base modes and may include other properties. This means for the numerous places in the UI where we use mode colors, we should always check the rich mode via get_rich_mode / get_rich_mode_for_value. Also we can tighten down typings a bit more. "text" does not exist in label options or in rich modes. It had been added in while label options are being read and the translations are parsed Instead of that let's just have a function that does this (labelKeyToText). We need to check for translations in 1) the label options being used; and 2) the default label options. if nothing, then convert it to readable (convert underscores to spaces & capitalize) We'll also have a function that does the opposite. Updated some typings: LabelOptions type should not accept a parameter. Also should mark REPLACED_MODE as optional UserInputData should not have "name". This only exists on EnketoUserInputData; it represents the name of the survey
Configuration menu - View commit details
-
Copy full SHA for 616b6b0 - Browse repository at this point
Copy the full SHA 616b6b0View commit details -
Configuration menu - View commit details
-
Copy full SHA for bacc745 - Browse repository at this point
Copy the full SHA bacc745View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5cfad8d - Browse repository at this point
Copy the full SHA 5cfad8dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d1965c - Browse repository at this point
Copy the full SHA 8d1965cView commit details -
give default argument to MetricEntry and DayOfMetricData so we don't have to specify every time Only ['count', 'distance', 'duration'] are used on the TravelSection; add type TravelMetricName to reflect this I have not added unit utils for 'footprint' yet; but currently it is only used for ['count', 'distance', 'duration'] anyway
Configuration menu - View commit details
-
Copy full SHA for e49bf0c - Browse repository at this point
Copy the full SHA e49bf0cView commit details -
There are some places where we want an instance of colors accessible from outside a component, ie. not via useAppTheme
Configuration menu - View commit details
-
Copy full SHA for b46a255 - Browse repository at this point
Copy the full SHA b46a255View commit details -
Makes this implementation match what the existing tests are expecting Updates comment since it was out of date
Configuration menu - View commit details
-
Copy full SHA for 6e1d719 - Browse repository at this point
Copy the full SHA 6e1d719View commit details -
gives a "You vs. Group" comparison for average daily carbon and energy
Configuration menu - View commit details
-
Copy full SHA for 6743b8c - Browse repository at this point
Copy the full SHA 6743b8cView commit details -
fix lineAnnotations on WeeklyFootprintCard
we do not need to lookup the label by language beacuse getFootprintGoals already handles this
Configuration menu - View commit details
-
Copy full SHA for fd5010a - Browse repository at this point
Copy the full SHA fd5010aView commit details -
keep total of nUsers when aggregating MetricEntries
This is necessary to be able to appropriately divide aggregate metrics back to per-user scale for "You vs. Group" comparison
Configuration menu - View commit details
-
Copy full SHA for 6e7153f - Browse repository at this point
Copy the full SHA 6e7153fView commit details -
remove old footprint metrics files
customFootprint not needed anymore; replaced by emcommon footprint calculations aka CHEER 'mets' are not currently in use, but the data in 'metDataset.ts' is included in the base modes in emcommon, so we do have this available to add back in the future
Configuration menu - View commit details
-
Copy full SHA for a7fcd0d - Browse repository at this point
Copy the full SHA a7fcd0dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a623405 - Browse repository at this point
Copy the full SHA a623405View commit details -
update tests to reflect changes
confirmHelper 'json/label-options.json.sample' does not exist anymore so let's just test the default, if we passed a blank config diaryHelper Most of the functions that were tested here don't exist anymore and the tests can be removed. In fact, getDetectedModes is the only one left. However there are functions that didn't have tests, add those footprintHelper All of these functions were removed and there is only one new one, getFootprintGoals metricsHelper The date format changed from numerical month/day to abbreviated month/day imperialConfig Extract the imperialConfig generation to a separate function so it can be accessed outside the hook. Simpler and makes it easier to test. Also let's test both metric and imperial, not just metric
Configuration menu - View commit details
-
Copy full SHA for b13524f - Browse repository at this point
Copy the full SHA b13524fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 59dbd72 - Browse repository at this point
Copy the full SHA 59dbd72View commit details -
Merge branch 'master' of https://github.com/e-mission/e-mission-phone …
…into energy-dashboard-2024
Configuration menu - View commit details
-
Copy full SHA for 95dc523 - Browse repository at this point
Copy the full SHA 95dc523View commit details -
if acc is not defined or is a number (as with distance,duration,count), do not add nUsers
Configuration menu - View commit details
-
Copy full SHA for 314af14 - Browse repository at this point
Copy the full SHA 314af14View commit details -
We created this test a while ago intended as an example. We now have other component tests and don't need an example lying around
Configuration menu - View commit details
-
Copy full SHA for 61f873e - Browse repository at this point
Copy the full SHA 61f873eView commit details -
updated EXPECTED_COUNT of plugins
I added the StatusBar plugin so we can change the color to match the appbar color
Configuration menu - View commit details
-
Copy full SHA for 8740062 - Browse repository at this point
Copy the full SHA 8740062View commit details -
Configuration menu - View commit details
-
Copy full SHA for f671e04 - Browse repository at this point
Copy the full SHA f671e04View commit details
Commits on Sep 20, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 33a38c9 - Browse repository at this point
Copy the full SHA 33a38c9View commit details -
Configuration menu - View commit details
-
Copy full SHA for dabeb7c - Browse repository at this point
Copy the full SHA dabeb7cView commit details -
Configuration menu - View commit details
-
Copy full SHA for cd0b488 - Browse repository at this point
Copy the full SHA cd0b488View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9c2186b - Browse repository at this point
Copy the full SHA 9c2186bView commit details