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

Pull from master to get the new onboarding android flow #1080

Closed
wants to merge 1,069 commits into from
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Jan 25, 2024

  1. fix DiaryCard showing current time if blank

    dt might be undefined here (like in the case of the most recent / current place in the timeline)
    In that case we should return nothing instead of letting Luxon create a new date (it would fallback to the current date&time which we don't want)
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    9dc0d48 View commit details
    Browse the repository at this point in the history
  2. add TimestampRange type

    this is used in a few places - it's tidier to have a common type definition
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    da0a311 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1e906c0 View commit details
    Browse the repository at this point in the history
  4. new LabelTab functions for user inputs

    i) instead of providing timelineLabelMap and timelineNotesMap to the entire component tree under LabelTab, we can pass accessor functions (userInputFor, labelFor, notesFor) to get user inputs in a cleaner way
    
    ii) Unify the structure of how multilabel vs enketo user inputs are kept on the phone. Now both will be the 'raw' format (an object with 'data', 'metadata' etc).
    Note that there is still a discrepancy on the server - for multilabel inputs we get a plain string and for enketo inputs we get the whole userinput entry.
    The plan is to unify this on the server at some point, so I am doing it here on the phone in advance.
    
    iii) instead of using a 'justRepopulated' flag to signify that an entry should not be filtered within 30 seconds of having a user input recorded on it, we can just look at the write_ts in the metadata of that entry's inputs and see if it was within 30 seconds ago. If so, it's immune to filtering.
    After a label is recorded and added to the timelineLabelMap, we'll trigger a refilter after 30 seconds by calling setLastFilteredTs.
    This approach negates the need for an extra property on the timelineEntry object - which is good because we want it to match the server type.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    63c14d6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    9ac6e00 View commit details
    Browse the repository at this point in the history
  6. fix UserInputButton not filling in after response

    This useEffect was watching timelineEntry for updates, but we changed the mechanism so timelineMap is no longer updated -- only the timelineLabelMap gets updated when a new response is recorded. By watching the result of userInputFor(...), this component will recieve the update.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    d339de7 View commit details
    Browse the repository at this point in the history
  7. add duration to ConfirmedPlace type def

    This has always been a property on the server for trips as well as places. For some reason I must have missed it on the first pass of making the ConfirmedPlace type definition.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    6deab9f View commit details
    Browse the repository at this point in the history
  8. refactor enketo user input types

    It keeps the codebase more logical (and more modular) to keep Enketo survey-related type definitions encapsulated away in enketoHelper.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    e37fa01 View commit details
    Browse the repository at this point in the history
  9. ignore /dist directory

    When we have Typescript compiler in 'watch' mode (useful for linting/ finding type errors in VSCode), it outputs to the root level directory 'dist'. Adding this directory to gitignore so we don't end up needlessly committing these output files.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    098ba21 View commit details
    Browse the repository at this point in the history
  10. fix reload on every tab switch

    Each tab gets wrapped by an error boundary. We were doing this in the body of the App component which means every time the App component was updated/rerendered, the tabs were recomputed too.
    Doing the error boundary wrapping outside of the App component ensures that it only happens once and we use the same tab components each time
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    36bbf08 View commit details
    Browse the repository at this point in the history
  11. UI touchups

    -Fix size of Leaflet markers
    -- this changed when we removed all the extra CSS bloat and easy one line restores the previous size
    
    -Unify app bar styles
    -- removed elevation: 3 to soften the shadow (default is 1 and matches the rest of the app better - we were only using elevation 3 to match the style of the Ionic header)
    -- use 'colors.surface' instead of hardcoded 'white'
    
    - unify 'notesButton' style of diary cards
    - add paddingHorizontal to ModesIndicator
    -- this way, if there are a lot of modes, they have room to breathe
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    412b3b8 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c9b2683 View commit details
    Browse the repository at this point in the history
  13. add "/dist/" to jest ignore

    As in fa1dfbf, TypeScript puts output files here. We don't need git NOR Jest to pick up on these 'dist' files.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    e1d03a6 View commit details
    Browse the repository at this point in the history
  14. fix getFormattedTimeRange

    With invalid inputs, this function should return early rather than continuing and resulting in a zero-length duration.
    Fixes the diaryHelper test that was failing.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    07befbc View commit details
    Browse the repository at this point in the history
  15. rework resolveTimestamps validation to fix test

    We need a safe way to mark that validation fails in this function, without actually throwing an error. Let's use a third parameter for this purpose which is a callback function 'onFail' to handle the invalid case.
    - Updated tests accordingly - now passing
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    fec6a4b View commit details
    Browse the repository at this point in the history
  16. update to Prettier 3.1

    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    3c65612 View commit details
    Browse the repository at this point in the history
  17. fix type warnings in timelineHelper

    Typescript wants us to be more explicit about what could be null/undefined and what couldn't be.
    
    transitionTrip2TripObj should return a Promise that could resolve as an UnprocessedTrip or undefined.
    (If undefined, it gets filtered later in readUnprocessedTrips)
    
    We also need to address that Luxon's DateTime.toISO has string or null as the return type – null is for if the input was invalid. It never should be, but if it was for some reason we can have an error dialog and assert type with an empty string.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    59a080f View commit details
    Browse the repository at this point in the history
  18. fix type warnings on timelineHelperMocks

    mockUnprocessedTrip was unnecessary and not used anywhere
    mockFilterLocation didn't need all these fake properties and instead could just include the few that are needed and then declare it 'as FilteredLocation'
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    3563698 View commit details
    Browse the repository at this point in the history
  19. fix Enketo type warnings

    enketoHelper.test.ts had a lot of the wrong types in the fake responses. They were all strings but I've since updated them so there some strings, some numbers, objects.
    EnketoResponseData in enketoHelper is correct.
    
    - some other type casting (with 'any') in both of these tests to ensure fake inputs satisfy parameters types
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    699d90f View commit details
    Browse the repository at this point in the history
  20. fix type warnings in confirmHelper.test.ts

    this test still had LabelOptions type for the userInput values instead of the UserInputEntry type.
    It didn't cause the tests to fail because inferFinalLabels and verifiabilityForTrip only check that the values exist - they don't care what properties they have.
    Anyhow, the types line up now.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    ff840ff View commit details
    Browse the repository at this point in the history
  21. use prettier 3.1.0 in workflow

    In 4f173ba I bumped the prettier version to 3.1. Whatever version we are using for the project should be the same as the workflow runs with (as we established in #1117)
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    88c72f8 View commit details
    Browse the repository at this point in the history
  22. update unprocessed inputs after recording user input

    -- Part of the fix for e-mission/e-mission-docs#1034
    
    When a user input is recorded, we put it in storage. For snappy performance we also cache it in the timelineLabelMap / timelineNotesMap state.
    However, if we switch filters or load more trips, this state gets overridden. So, we need to call updateLocalUnprocessedInputs at some point.
    It is an async function but we can call it without 'await' and just allow it to execute in the background.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    a6e7a79 View commit details
    Browse the repository at this point in the history
  23. allow labels to be stored as a batch

    -- Part of the fix for e-mission/e-mission-docs#1034
    
    When the yellow checkmark is used to verify a pair of inferred mode+purpose labels, both labels should be verified by a single click.
    The labels get stored fine; however, the way we update state after doing so prevents both labels from being updated simultaneously and only one of them gets filled in. The resulting UX is that it takes 2 clicks and this is not desired.
    We could: update state in succession, one after the other (await label A, then proceed label B),
    OR we could rework these functions to support adding labels for a particular trip as a batch (so the same function call could store mode+purpose at the same time). This was decided as a better and more performant option.
    
    It uses Promise.all to store all labels from the batch, then it updates the state with all changes from that batch.
    When a single label is recorded, it is a batch of 1 - when verifying inferences, it may be a batch of multiple labels.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    8161d58 View commit details
    Browse the repository at this point in the history
  24. Fixed WSOD on single-date pick

    the-bay-kay authored and JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    b6a9155 View commit details
    Browse the repository at this point in the history
  25. Clean up a line of test code

    the-bay-kay authored and JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    ce760b6 View commit details
    Browse the repository at this point in the history
  26. Added to WSOD fix on metrics tab

    When selecting date, the following behavior occurs:
    - If 2+ days, behave as normal (Range of Day1 -> Day2)
    - If  "open Ended" (i.e., only start is picked), fetch
      a range of days between that day and present (Day1 -> Today)
    - If 1 day, fetch range for 48 hours from that day
    
    TODO: The 1 day range going to 48 hours is meant as a patch, so that
    this WSOD fix can go to staging.  To make a single day only fetch
    24 hrs, some changes to the server may be needed.
    the-bay-kay authored and JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    7483fe5 View commit details
    Browse the repository at this point in the history
  27. use memoization pattern for added notes' displayDt

    Instead of mutating an extra property 'displayDt' onto the entries, let's use a get function that returns the displayDt. This should fix issue (4) in e-mission/e-mission-docs#1034.
    And let's also memoize that function so performance is not impacted
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    b3785fd View commit details
    Browse the repository at this point in the history
  28. display error properly if thrown in EnketoModal

    If something was thrown, it could display 'undefined' if 'err' was an error message and not the error object.
    Using the displayError function is a more proper way to guarantee we see any error messages
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    3e44ebc View commit details
    Browse the repository at this point in the history
  29. revise type defs for additions / EnketoUserInputEntry

    - 'key' could be kept in 'data' or 'metadata' depending on if it is a processed or unprocessed entry (this is an inconsistency we may want to revisit later)
    - handle possible null/ undefined parameters in functions: check for truthy inputs before executing
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    316d4e9 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    d5fe4b4 View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    b0d6e7b View commit details
    Browse the repository at this point in the history
  32. fix notifScheduler test

    This test failed due to a bad merge conflict resolution.
    This commit reverts notifScheduler.test.ts to the state of 3cbb5f0 after sebastianbarry's fix.
    The test now passes.
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    6631890 View commit details
    Browse the repository at this point in the history
  33. fix type defs for notifScheduler

    - ReminderSchemeConfig should be ReminderSchemesConfig - a problem that resulted from resolving merge conflicts
    - Defining types in notifScheduler.ts so that the functions have return types and Typescript type warnings go away
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    a086892 View commit details
    Browse the repository at this point in the history
  34. fix type defs for timelineHelper

    -- With 'strictNullChecks' enabled in Typescript, we get type errors when declaring objects of a type with some of its properties missing.
    But for the purpose of testing (ie fake data, potentially invalid inputs) we want to do just that. We can get around this by hard casting with `as unknown as <T>`.
    In tests, for blank/invalid inputs being used (such as a blank CompositeTrip object) we can use `{} as any`
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    0aec763 View commit details
    Browse the repository at this point in the history
  35. fix type warnings

    This fixes a bunch of type warnings that show up with strictNullChecks being true.
    Fixes include adding types, disambiguating null and undefined types and handling them more carefully, and disambiguating trip vs place with type guards
    JGreenlee committed Jan 25, 2024
    Configuration menu
    Copy the full SHA
    79d18a1 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2024

  1. replace remaining uses of moment & remove it from dependencies

    With this change, any remaining uses of the `moment` library from datetime operations have been fully replaced by Luxon.
    All references to moment are removed.
    JGreenlee committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    004b9ea View commit details
    Browse the repository at this point in the history
  2. remove jQuery from dependencies + webpack

    When using AngularJS, jQuery needed to be provided as a global by Webpack. Now, we do not need it at all (except Enketo which still uses jQuery internally, but provides it to itself and is not needed globally.)
    JGreenlee committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    48633c3 View commit details
    Browse the repository at this point in the history
  3. unify function declarations: const vs function

    (initiative previously described in 0527569)
    >To be more consistent with the rest of the codebase, as a rule of thumb we're having top-level functions use 'function' synax while one-liners or nested functions are arrow functions.
    
    Named functions that are at the top-level of a file, React component, or custom hook, should be declared as `function foo() { ... }`.
    Anonymous / inline functions, and one-liner functions, will be declared as `const bar = () = { ... };`
    
    These general rules should help to keep some consistency throughout the codebase.
    JGreenlee committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    31d472e View commit details
    Browse the repository at this point in the history
  4. use 'const' and 'let' instead of 'var'

    in ES6, 'const' and 'let' are preferred over 'var', which is sort of outdated now.
    In a few places 'var' was still used. For best practice we replace these.
    JGreenlee committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    adc6620 View commit details
    Browse the repository at this point in the history
  5. cleanup all console/log statements

    -- Replace all uses of console.log or console.debug with the functions from logger.ts (logDebug, logWarn, displayError). This ensures that all log statements are recorded by both the Javascript console AND the Cordova Logger plugin
    -- Format all these log statements concisely and in a unified way (longer statements make use of `template strings` with interpolation, and the statements are put on as few lines as possible to mimimize clutter)
    -- Remove log statements that are deemed redundant or excessive (we want to be thorough but not spammy - avoid log statements that run on every single re-render)
    JGreenlee committed Jan 26, 2024
    Configuration menu
    Copy the full SHA
    0a8ed76 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2024

  1. Merge pull request #1106 from JGreenlee/migration-wrapup

    🎀 UI Migration Wrap-up
    shankari authored Feb 1, 2024
    Configuration menu
    Copy the full SHA
    d8379c2 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2024

  1. fix processed trip survey responses not matching

    Processed responses for user input surveys were not being matched because they were being looked up under "manual/trip_user_input", while it should have just been "trip_user_input".
    This is because we were only invoking a function to trim off "manual/" for MULTILABEL user input matching, and it was neglected for ENKETO.
    
    Revise the functions in confirmHelper (keeping 2 versions, `removeManualPrefix` which just trims the key, and `inputType2retKey` which looks up the key and then trims), and use `removeManualPrefix` in inputMatcher appropriately
    
    Some day we can unify the data model (e-mission/e-mission-docs#1045) and not keep 2 versions of so many things
    JGreenlee committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    539924c View commit details
    Browse the repository at this point in the history
  2. inputMatcher prettier

    JGreenlee committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    cf28dba View commit details
    Browse the repository at this point in the history
  3. add tests for mapInputsToTimelineEntries

    Adds basic unit tests for mapInputsToTimelineEntries under both MULTILABEL and ENKETO configurations.
    It considers fake user inputs that are processed, and those that are unprocessed, and ensures that the returned map includes both.
    JGreenlee committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    e5ef8da View commit details
    Browse the repository at this point in the history
  4. Merge pull request #1125 from JGreenlee/fix-processed-surveys-matching

    🚑 Fix Processed Trip Survey Responses Not Matching
    shankari authored Feb 2, 2024
    Configuration menu
    Copy the full SHA
    9ddcf31 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2024

  1. Configuration menu
    Copy the full SHA
    11e8636 View commit details
    Browse the repository at this point in the history
  2. update testing to resolve aftermath of merge conflict

    Abby Wheelis committed Feb 5, 2024
    Configuration menu
    Copy the full SHA
    315dabe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    44ac249 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Merge pull request #1126 from e-mission/service_rewrite_2023

    🎀 Final change of the service rewrite
    shankari authored Feb 6, 2024
    Configuration menu
    Copy the full SHA
    c7e9244 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c4798c6 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. draft of conditional surveys logic

    We plan to support a conditional approach to surveys: depending on characteristics of the trip / timelineEntry, it may prompt for one survey or another.
    This involves rearranging UserInputButton so that the survey name is not hardcoded as "TripConfirmSurvey". Instead, survey names and button labels will be pulled from the config.
    Each survey that could show conditionally has a `showsIf` field, which is evaluated at runtime in conditionalSurveys.ts. The first survey whose condition matches is the one that is used for that timelineEntry.
    JGreenlee committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    11ef42a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    79a1bc5 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1127 from louisg1337/data_collection_bump

    Bumped data collection version
    shankari authored Feb 9, 2024
    Configuration menu
    Copy the full SHA
    edde87f View commit details
    Browse the repository at this point in the history
  4. Added button for Bluetooth Scan Page

    See Issue [#1046](e-mission/e-mission-docs#1046 (comment))
    for more details.  This commit adds the Dev-Zone settings option, which
    will eventually link to the Bluetooth Scanner page.
    
    TODO:
    - Add i18next translation for control.bluetooth
    the-bay-kay committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    04df66f View commit details
    Browse the repository at this point in the history
  5. Added barebones BluetoothScanPage

    The button added in settings now will open a Modal "Page" that
    will (eventually) contain the bluetooth devices within scanning
    distance!
    the-bay-kay committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    9ee0cc0 View commit details
    Browse the repository at this point in the history
  6. adding quotes for consistency

    Abby Wheelis committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    eb33a98 View commit details
    Browse the repository at this point in the history
  7. prettier changes

    Abby Wheelis committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    46ab913 View commit details
    Browse the repository at this point in the history
  8. fixing formatting

    Abby Wheelis committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    2c8ffbb View commit details
    Browse the repository at this point in the history
  9. Undoing desc and descriptionText changes in www/js/control/SettingRow…

    ….tsx
    
    
    These are old changes from before I took over the PR, I can go ahead undo them
    sebastianbarry authored Feb 9, 2024
    Configuration menu
    Copy the full SHA
    3090f33 View commit details
    Browse the repository at this point in the history
  10. Undoing desc and descriptionText changes in www/js/control/SettingRow…

    ….tsx
    
    
    These are old changes from before I took over the PR, I can go ahead undo them
    sebastianbarry authored Feb 9, 2024
    Configuration menu
    Copy the full SHA
    b0596e0 View commit details
    Browse the repository at this point in the history
  11. Ran Prettier

    It seems I accidentally turned off my local VSCode Prettier... Fixing
    that now
    the-bay-kay committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    b15148c View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    cf7c860 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2024

  1. restore catch for "IN_VEHICLE"

    Abby Wheelis committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    6bfef79 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1111 from Abby-Wheelis/metrics_cleanup

    🧹 📊  Metrics cleanup
    shankari authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    3d06350 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1118 from sebastianbarry/screen-reader

    👤🔊 OP Accessibility: Screen Reader Improvements
    shankari authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    dcb6957 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    602a3b4 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4dc111f View commit details
    Browse the repository at this point in the history
  6. Roughly implemented the bluetooth scanner into the bluetooth page. Cr…

    …eated bluetoothScanner.ts which houses the plugin scan request. I then added in functionality to the BluetoothScanPage to output the data that we get from the scan function.
    louisg1337 committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    2cf7882 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2024

  1. Merge branch 'master' of https://github.com/e-mission/e-mission-phone

    …into code-cleanup-jan2024
    JGreenlee committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    03fc69a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a26d039 View commit details
    Browse the repository at this point in the history
  3. use LocalDt in MetricsTypes

    JGreenlee committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    069a72e View commit details
    Browse the repository at this point in the history
  4. use 'i18n.resolvedLanguage', not 'language'

    This was added in a relatively recent version of i18next; some online resources haven't updated to reflect it
    https://www.i18next.com/overview/api#resolvedlanguage
    
    `language` is what i18next detected or we have set it to. It could be either a locale code like 'en-US' or a plain language like 'en'.
    
    `resolvedLanguage` is what language is actually being used for translation, after considering what is detected, what langauges we provided, and what fallbacks we specified.
    
    In our case this should always be either 'en', 'es', or 'lo' - the 3 languages we support at this time.
    
    So `resolvedLanguage` is the safe property to use and we should avoid `language`.
    JGreenlee committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    633db15 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    125d009 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2453e9a View commit details
    Browse the repository at this point in the history
  7. for conditional survey eval, spread trip props

    GIven that the configs are JSON and we can only give the "showsIf" conditions as strings, it will be annoying if they get too lengthy.
    This will allow us to reference trip properties directly (e.g. "end_loc" instead of "tlEntry.end_loc") which is a bit more concise and readable.
    JGreenlee committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    5c9b307 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c483322 View commit details
    Browse the repository at this point in the history
  9. remove 'ch' unit from MetricsDateSelect

    Although the 'ch' unit works here, is not officially a valid type for React Native Web
    Changing to `25` to match the Label screen DateSelect
    JGreenlee committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    a4eb833 View commit details
    Browse the repository at this point in the history
  10. bump 'react-native-paper' to ^5.11.0

    The `Icon` component was added in 5.11.0 and is referenced in CustomLabelSettingRow.
    So we must use 5.11.0 at minimum
    JGreenlee committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    260f213 View commit details
    Browse the repository at this point in the history
  11. Updated Scanner UI

    - Formatted buttons
    - Added `BluetoothCard.tsx`
    - Centered buttons & Device Info
    - Fixed "Dismiss" Button, updated to arrow
    the-bay-kay committed Feb 12, 2024
    Configuration menu
    Copy the full SHA
    7fe3958 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2024

  1. Added translation support to Bluetooth Scanner

    Added english translations for scanner components
    the-bay-kay committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    07e4e17 View commit details
    Browse the repository at this point in the history
  2. use the new Icon component from RN Paper 5.11

    Reach Native Paper didn't have a standalone <Icon> component until recently. Now that it does, we can get rid of the component we had made and just use theirs.
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    1ed9e57 View commit details
    Browse the repository at this point in the history
  3. in useAppConfig, check config contents safely

    If `getConfig` resolves to null (meaning there is no stored config & we are on the Welcome page), then we should not call Object.keys on it. (Object.keys expects a non-null input)
    
    (There was causing an error in the console, but not a crash)
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    a717560 View commit details
    Browse the repository at this point in the history
  4. AddedNotesList: adjust UI

    the textStyle of the datatable cell was not getting applied to the underlying Text element. With style applied on the Text component directly, the label is 12pt and bold
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    ed49146 View commit details
    Browse the repository at this point in the history
  5. EnketoModal: allow appConfig to be initially null

    It is actually expected for appConfig to be initially null here, and we don't need to show an error message for it.
    EnketoModal is not rendered until it is needed; it hasn't called useAppConfig() in advance. So until useAppConfig() resolves, appConfig is null.
    Once it does resolve and appConfig is set, this useEffect runs again and initSurvey() gets called.
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    b076910 View commit details
    Browse the repository at this point in the history
  6. use theme colors for logout button

    We avoid hardcoding colors to make dynamic theming easier
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    8101388 View commit details
    Browse the repository at this point in the history
  7. fix OverallTripDescriptives not showing for multimodal unlabeled trips

    The initial state of modesShown should be 'labeled' only if the trip has a label; otherwise it should be 'detected' (since there will be no toggling)
    With the initial state being 'detected', if there are multiple modes then the OverallTripDescriptives will show
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    8047221 View commit details
    Browse the repository at this point in the history
  8. make <NavBar> a reusable component

    The declaration of the Appbar.Header is repeated across every screen in the UI.
    Let's unify all these declarations into one component called <NavBar>.
    
    We already had a component called <NavBarButton>. It makes sense to put both in the same file since they will always be used together. So the new filename will be NavBar.tsx and it will export both <NavBar> and <NavBarButton>.
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    72608de View commit details
    Browse the repository at this point in the history
  9. aria: make NavBar + NavBarButton taller

    We had the NavBar height set at 46px to match the old AngularJS + Ionic UI. It was a bit cramped. The migration is done and we no longer have to worry about that, so what's the optimal height?
    Well for accessibility reasons, click zones of the action items in the navbar should ideally be at least 44x44. If the NavBarButtons are going to be 44px tall, the NavBar should be a bit taller than that. 56px looks comfortable.
    JGreenlee committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    09a0408 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    86957d9 View commit details
    Browse the repository at this point in the history
  11. Refactored the permissions for the bluetooth scanner so that there is…

    … now proper error handling.
    louisg1337 committed Feb 13, 2024
    Configuration menu
    Copy the full SHA
    6023c7f View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b2f4281 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    4a5d853 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2024

  1. Removed erroneous i18n files

    i18n Files were accidentally added in commit b2f4281 .  Rollling back the
    repository to the same state as commit 6023c7f,  before the files were
    added.
    the-bay-kay committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    9215f69 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b4cafd4 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2024

  1. add AlertManager for global alerts

    There's a bunch of places in the app where we need to show a SnackBar or "toast"-style message.
    But to do this, we've been having to keep each SnackBar's visibility as state so it can show/hide depeding on its "visible" value.
    
    It would be simpler to be able to do this from anywhere in the codebase, though, not just by setting local state.
    So I refactored AlertBar to behave as a global stack of alert messages. AlertBar is instantiated once at the top level in App.tsx. A static class called AlertManager can be used to add messages to this stack from anywhere in the codebase.
    As a result, components no longer need to have their own instance of AlertBar and they don't have to control the visibility themselves.
    They just call AlertManager.addMessage when they want to show a message.
    JGreenlee committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    d647f33 View commit details
    Browse the repository at this point in the history
  2. remove weird comma

    This comma didn't seem to have any adverse effects, but it doesn't belong here
    JGreenlee committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    76f4d5d View commit details
    Browse the repository at this point in the history
  3. move AlertBar to /components

    Since AlertBar / AlertManager can now be used from anywhere in the codebase, they are not specific to the Profile screen and can be moved to a more general location
    JGreenlee committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    c6a9777 View commit details
    Browse the repository at this point in the history
  4. revert "remove weird comma"

    Apparently, Prettier actually does want a comma here because this is an argument to a function, and we have trailing commas enabled.
    It just looks strange because it's following a JSX element
    JGreenlee committed Feb 15, 2024
    Configuration menu
    Copy the full SHA
    9592107 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2024

  1. make push notifications warning an AlertBar

    'remote notifications are not supported in the simulator' - we expect this error in the Simulator, but don't want to completely silence it so that people don't expect it to work.
    An Alert works for this
    JGreenlee committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    b573e06 View commit details
    Browse the repository at this point in the history
  2. make Log Out button a NavBarButton; tweak NavBarButton

    On the other screens of the UI, we use a NavBarButton for clickable buttons with text. I realized the Log Out button is inconsistent with this, so I changed it to a NavBarButton.
    I tested this with a screen reader and it is still accessible (since it uses the Button component it is grouped as and recognized as 1 element with role 'button')
    
    Using a NavBarButton made the log out icon smaller than before, so while making this change I revised the NavBarButton props. I added an optional "iconSize" that can be used to override the default 20.
    I removed "onPressAction" because the Button component already has "onPress" which we can just use.
    I organized the styles for both NavBar and NavBarButton, and made them able to be extended on by props.
    JGreenlee committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    524eb71 View commit details
    Browse the repository at this point in the history

Commits on Feb 19, 2024

  1. Configuration menu
    Copy the full SHA
    5f8bb77 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2b366eb View commit details
    Browse the repository at this point in the history
  3. Updated bluetooth plugin, ran prettier

    - Updated plugin to a fork of the original: ideally, this fork
    should support Bluetooth Classic for both iOS & Android
    the-bay-kay committed Feb 19, 2024
    Configuration menu
    Copy the full SHA
    157cfde View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2024

  1. Configuration menu
    Copy the full SHA
    43bfb4e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f9c3c57 View commit details
    Browse the repository at this point in the history
  3. aria: use 'touch' style for Enketo forms

    As it turns out, Enketo supports a more mobile-friendly forms interface than we've been using. I noticed the mobile-friendly interface whle using Kobotoolbox, and I wondered why it didn't show up the same in e-mission-phone.
    I dug into Enketo source code and found that it automatically detects mobile devices by inspecting the user agent and platform info. (e.g. if it contains "iPhone", then mobile=true).
    
    It applies "touch" class to the <html> element to flag this. This is indeed observed in e-mission-phone, but because we only inject Enketo styles into the views they open in (i.e. we scope those styles under .enketo-plugin in styles), the <html> element's "touch" class has no effect.
    
    An easy solution is to just add the "touch" class at the root of our enketo content (for our purposes, we can assume e-mission-phone will always be on a phone / tablet a since it's a mobile app. We don't really need the 'mobile detection' that Enketo does)
    
    The result of this is that the enketo forms have larger click areas on multiple-choice / multi-select questions, which is better for accessibility.
    JGreenlee committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    9178685 View commit details
    Browse the repository at this point in the history
  4. fix crash on updatePrefReminderTime

    `newTime` here is not an ISO string; it is a JavaScript Date object.
    Attempting to parse it as an ISO string results in "Invalid DateTime" being stored to the user prefs and a crash on the Profile screen
    JGreenlee committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    e84e816 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #1130 from JGreenlee/fix-reminder-time

    🩹 fix crash on updatePrefReminderTime
    shankari authored Feb 20, 2024
    Configuration menu
    Copy the full SHA
    034bee2 View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2024

  1. fix inputMatcher logging test

    the log statement in getNotDeletedCandidates was changed from a console.log to a logDebug in 0a8ed76
    
    The associated test checks the log statements; it was still watching for console.log and needed to be updated to logDebug
    JGreenlee committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    9174545 View commit details
    Browse the repository at this point in the history
  2. fix uploadService arrow functions 'this'

    in 31d472e, the reader.onprogress, reader.onerror, and reader.onload functions here were changed from regular `function` declarations to arrow functions.
    
    Usually this makes no difference in the operation of the code, but there is one exception.
    Arrow functions don't get their own `this`, they just inherit it from the scope. When I swapped this out and made it an arrow function, I didn't notice it used `this`.
    
    In this instance, `this` was the same thing as `reader`, which we already have a reference to. So it's an easy swap.
    JGreenlee committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    2bf2e3e View commit details
    Browse the repository at this point in the history
  3. add "inverse" colors to appTheme for AlertBars

    Instead of being purple (which is the default RN Paper theme color), AlertBars will now match the rest of the UI and use blue / blue undertones
    JGreenlee committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    0ce1e7d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    658f00f View commit details
    Browse the repository at this point in the history
  5. simplify alert creation in ProfileSettings

    'msgKey' is for translation keys, which 'success -> ' is not. We can just use 'text'. This is not user facing and does not necessarily need to be translated anyway
    JGreenlee committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    0e50c8b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2796702 View commit details
    Browse the repository at this point in the history
  7. Fixed rendering issues with BluetoothScanPage

    - Cards were not splitting logs correctly, fixed to split via index
      - We should be fine with this rudimentary string parsing technique;
      from my testing, IDs have not gone past the length given.
    the-bay-kay committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    4b5a7e7 View commit details
    Browse the repository at this point in the history
  8. Merge branch 'master' into bluetooth_scanner

    Merge to keep branch up to date with master
    the-bay-kay committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    4788641 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0a71d52 View commit details
    Browse the repository at this point in the history
  10. update "short" demo survey so people born in 2006 can take it

    The short version of the demographics survey asks for year of birth and we restrict the valid range of responses so as to not allow participants younger than 18.
    Last year when I uploaded this, I wrote in 2005 as the upper limit. But theoretically, people born in 2006 can now participate in those studies.
    
    I found a more generic solution using the ODK forms constraint syntax and some built-in functions they have:
    `. > 1900 and . + 18 <= format-date(today(), '%Y')`
    
    So now we won't have to update this every year; it actually takes into account the current year when validating the form.
    JGreenlee committed Feb 21, 2024
    Configuration menu
    Copy the full SHA
    9be27b1 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. Configuration menu
    Copy the full SHA
    6f101d1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5fcab70 View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2024

  1. Configuration menu
    Copy the full SHA
    f690d84 View commit details
    Browse the repository at this point in the history

Commits on Feb 26, 2024

  1. Configuration menu
    Copy the full SHA
    f9115ab View commit details
    Browse the repository at this point in the history

Commits on Feb 27, 2024

  1. Forked our own version of the bluetooth plugin so that we can change …

    …the plugin.xml to prevent Android Manifest merger errors
    louisg1337 committed Feb 27, 2024
    Configuration menu
    Copy the full SHA
    bb16e6d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    00b8fdc View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2024

  1. use blue instead of orange for enketo surveys

    Since Enketo's themes use SCSS it isn't that hard to override the orange color. This makes it a bit more cohesive with the rest of the app.
    JGreenlee committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    b62861e View commit details
    Browse the repository at this point in the history
  2. UI touch up on the EnketoModal footer

    These buttons aren't part of Enketo; they are provided by EnketoModal. That means we can customize them.
    I made the "next" and "save" buttons at the bottom of Enketo surveys into RN Paper <Button> components, matching the rest of the UI and making the survey view more cohesive within the context of app.
    
    Also, these buttons (as well as the "Return to beginning" and "Go to end" buttons) now have icons alongside the text.
    JGreenlee committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    9062055 View commit details
    Browse the repository at this point in the history
  3. downscale tiles on TripCard LeafletView

    Using lower res images for the tiles has a small performance benefit with scrolling.
    Since these are small maps, they do not need to be high-res.
    In fact, the text on the maps is larger and more readable with the lower res tiles, so this works out anyway.
    
    Note: The maps on LabelDetailsScreen still use high-res tiles because downscaleTiles is not set true there.
    JGreenlee committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    6f1f28c View commit details
    Browse the repository at this point in the history
  4. LeafletView: add Props type definition

    this component was made before we used TS in the project so the props weren't typed
    JGreenlee committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    187dfb3 View commit details
    Browse the repository at this point in the history
  5. only show Leaflet + OSM attribution on the first trip

    Every trip on the Label screen has a map, and we've been showing the Leaflet and OSM attribution on every single one.
    This makes the DOM a little bit cluttered. Trimming it down could help performance marginally.
    Also, it's distracting and unnecessary to have it on every map.
    
    Leaflet does not care if you disable the attribution. But we will still attribute Leaflet because it's nice to do so :)
    
    The tiles from OSM are copyrighted; they DO care about attribution and have specific guidelines.
    In the guidelines they say "...if multiple static images appear on the same document, one instance of attribution is sufficient."
    https://osmfoundation.org/wiki/Licence/Attribution_Guidelines#Static_images
    
    These are static maps so it's good enough to show it on just one map. I think it's fair to put it on the most recent trip since that one will appear first in the list. This way, attribution will show on the first render but will not be distracting when scrolling up to other trips.
    
    Note that the full attribution always appears on the map on the LabelDetailsScreen, since that one is interactive and it's the only one on the page. So even on static maps where the attribution has been hidden, the attribution is 1 click away.
    JGreenlee committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    b81175a View commit details
    Browse the repository at this point in the history
  6. set innerHTML directly instead of using html-react-parser

    We don't need this library because we can set innerHTML directly using dangerouslySetInnerHTML.
    
    This would be dangerous if we did not have control over where the html string came from. But we do have control; it is just a cached copy of something that was already rendered.
    So it is fine to use in this context.
    
    Also, the actual instance of the Leaflet map can be removed once its HTML is cached.
    JGreenlee committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    915c63c View commit details
    Browse the repository at this point in the history
  7. Updated Bluetooth Scan Coverage

    - Updated calls to Bluetooth Plugin, to ensure paired
    devices are included in the scan list
    the-bay-kay committed Feb 28, 2024
    Configuration menu
    Copy the full SHA
    72f499f View commit details
    Browse the repository at this point in the history

Commits on Feb 29, 2024

  1. LeafletView: make the attribution hyperlinks functional

    To comply with OSM's attribution guidelines we need to link to the copyright page on their website.
    
    We do include links, but they haven't been working because <a> elements don't work in our Cordova app like they would on the web.
    To open a URL we have to use cordova inappbrowser like this.
    
    I did the same for the Leaflet attribution as well.
    JGreenlee committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    cd67709 View commit details
    Browse the repository at this point in the history
  2. LeafletView: only cache for TripCard maps

    The TripCard maps are being cached because we want to imporve performance on the trips list.
    
    But the maps on the label details screen should still be fully interactive; they should not be cached.
    
    Also, we can append '-downscaled' to the IDs of maps that use downscaled tiles; making them distinct from non-downscaled maps. this way Leaflet doesn't try to mix high-res and low-res tiles on the same map
    JGreenlee committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    a58b742 View commit details
    Browse the repository at this point in the history
  3. use reversed FlatList without CSS transforms

    #1132
    We are trying to improve performance of the timeline scroll.
    The way that FlashList / FlatList 'inverted' property works has shown to be a bottleneck. It "uses CSS transforms to flip the entire list and then flip each list item back, which is a performance hit and causes scrolling to be choppy, especially on old iPhones."
    
    An alternative I found is setting the 'flex-direction' to 'column-reverse'. But this only works for FlatList.
    'column-reverse' is applied to the content so the items in the list display bottom-to-top, and also applied to the wrapper so the scroll position initializes from the bottom.
    This yields better performance!
    
    But there is another issue: on iOS the list flashes for a second while loaded and then goes blank. Only once the user interacts is the list visible.
    
    I think this is an issue with iOS Safari. I came up with a workaround to add a temporary 1px margin to trigger a layout update. It's not ideal, but it's minimally intrusive and won't cause further problems.
    
    Eventually if we fully migrate to React Native, we will not have to worry about Safari at all; we should be able to just use FlatList or FlashList as-is.
    JGreenlee committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    10ca741 View commit details
    Browse the repository at this point in the history
  4. Moved raw_data_use backwards compat hack

    Moved backwards compat hack to fill in the raw_data_use for programs that don't have it to PrivacyPolicy.tsx, from ProfileSettings.tsx so that the privacy policy is updated for the login screen, and it carries over to the Profile settings screen.
    sebastianbarry committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    0848131 View commit details
    Browse the repository at this point in the history
  5. move leaflet cache to a stateful hook

    There was an issue where map elements were sometimes showing blank when they should have been cached. This is because they were stored in a Map object, in LeafletView.tsx but outside of the component.
    It was not kept as state so React didn't know to re-render if it changed.
    
    We can keep this Map object as state in a custom hook that all LeafletViews can use.
    JGreenlee committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    16b114b View commit details
    Browse the repository at this point in the history
  6. Updated second API call

    the-bay-kay committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    e35aaff View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2024

  1. update scopedEval to return the result

    We want to use scopedEval to evaluate boolean expressions. It executes the code but doesn't return back the result unless we include 'return ...' in the body.
    With this quick change it returns the result of the evaluation and works on our inline conditionals.
    JGreenlee committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    82df443 View commit details
    Browse the repository at this point in the history
  2. use [lon, lat] for pointIsWithinBounds

    I thought coordinates would be given with latitude first. But the geojson spec is to have longitude first https://www.rfc-editor.org/rfc/rfc7946#section-3.1.1
    
    Flipped the logic for this function and added a bit of JSDoc just so it's clear
    JGreenlee committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    e0e2d75 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1b772e2 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2024

  1. delete unnecessary print

    jiji14 committed Mar 4, 2024
    Configuration menu
    Copy the full SHA
    8b5c6f6 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1132 from jiji14/flashlist-scroll-bug

    Fix blank screen issue when scrolling on trip list
    shankari authored Mar 4, 2024
    Configuration menu
    Copy the full SHA
    7b5212a View commit details
    Browse the repository at this point in the history
  3. Merge pull request #1131 from JGreenlee/demo-survey-2006

    🔞 Update "short" demo survey so people born in 2006 can take it
    shankari authored Mar 4, 2024
    Configuration menu
    Copy the full SHA
    a89247b View commit details
    Browse the repository at this point in the history
  4. Merge pull request #1133 from sebastianbarry/raw_data_use_bugfix

    Moved raw_data_use backwards compat hack
    shankari authored Mar 4, 2024
    Configuration menu
    Copy the full SHA
    3fbc6b5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    14f72de View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2024

  1. Configuration menu
    Copy the full SHA
    1b3e946 View commit details
    Browse the repository at this point in the history
  2. Ran prettier

    louisg1337 committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    f8a6a8e View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2024

  1. Configuration menu
    Copy the full SHA
    1e47df3 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2024

  1. Added toggle between Scanning Modes

    - Setup for adding BLE Scanning
    - TODO: Change permissions for iOS dev menu selection
    the-bay-kay committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    f541448 View commit details
    Browse the repository at this point in the history
  2. Added ibeacon plugin

    - Built successfully on iOS
    the-bay-kay committed Mar 8, 2024
    Configuration menu
    Copy the full SHA
    8a1eb3b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cf3e5e4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    cf6510b View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2024

  1. Changed scanner permissions

    - Added template for BLE Scanning function
    - Changed iOS compatibility check to only run for
    bluetooth classic scanner
    the-bay-kay committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    5cce571 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. Started testing/experimenting with the ble plugin on Android. Does no…

    …t work yet, but it is a starting point.
    louisg1337 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    3878644 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. Configuration menu
    Copy the full SHA
    a73fd32 View commit details
    Browse the repository at this point in the history

Commits on Mar 16, 2024

  1. Addressed review changes, updated permissions

    - Moved permissions check to BLE Screen, fixed error
    with permission appearing upon install
    - Updated OS checks, fixed config export
    the-bay-kay committed Mar 16, 2024
    Configuration menu
    Copy the full SHA
    def2b24 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1124 from JGreenlee/code-cleanup-jan2024

    🧹 Post-Migration Code Cleanup
    shankari authored Mar 16, 2024
    Configuration menu
    Copy the full SHA
    5812eee View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3939488 View commit details
    Browse the repository at this point in the history
  4. Refractored Scanner Promises

    - Changed to avoid race conditions in logs
    the-bay-kay committed Mar 16, 2024
    Configuration menu
    Copy the full SHA
    1c1c2ba View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2024

  1. Updated how logs are handled, added Pairing Status

    - Display status is indicated through the icon:
     "bluetooth-off"
    the-bay-kay committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    b76ce00 View commit details
    Browse the repository at this point in the history
  2. Fixed iOS Check

    the-bay-kay committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    c990c93 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9729a39 View commit details
    Browse the repository at this point in the history
  4. Fixed errors caused in merge, ran Prettier

    - Merge to keep up with changes in bluetooth_scanner
    branch this PR is based off of
    the-bay-kay committed Mar 17, 2024
    Configuration menu
    Copy the full SHA
    6bd3977 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. Configuration menu
    Copy the full SHA
    b270036 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

  1. Removed patcher

    - Goal is to fix osx-install-android-sdk-automated
    the-bay-kay committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    41ff1a7 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1136 from the-bay-kay/android_ci_fix

    Fix Build Android Build Issues, Android Build CI
    shankari authored Mar 19, 2024
    Configuration menu
    Copy the full SHA
    ab3c891 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'master' into bluetooth_scanner

    - Merge needed to fix Android build issue
    the-bay-kay committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    23e8de1 View commit details
    Browse the repository at this point in the history
  4. delete reseting leafletMapRef code after adding cache

    It triggers an error with re-rendering after the trip information gets changed (ex) changing label
    jiji14 committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    a6c0f81 View commit details
    Browse the repository at this point in the history
  5. apply prettier

    jiji14 committed Mar 19, 2024
    Configuration menu
    Copy the full SHA
    a5a8367 View commit details
    Browse the repository at this point in the history

Commits on Mar 20, 2024

  1. Refactored Bluetooth logs, fixed race conditions

    - Changed logs to only pass devices, now parsed in BluetoothCard
    - Updated promise handling in blueoothScanner
    - Reverted iOS permissions check
    the-bay-kay committed Mar 20, 2024
    Configuration menu
    Copy the full SHA
    295b96f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0387633 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2024

  1. iOS beacon scanning confirmed working

    - Successfully detected beacon on iOS
    - Minor changes to JSX to properly render `logToDom()`
    - Renamed Bluetooth Classic Scan to reflect purpose
    the-bay-kay committed Mar 21, 2024
    Configuration menu
    Copy the full SHA
    3ed6974 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    989ee5f View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2024

  1. Merge pull request #1137 from jiji14/leaflet-bug-fix

    [Bug Fix] Leaflet gets broken after updating labels
    shankari authored Mar 22, 2024
    Configuration menu
    Copy the full SHA
    2736da7 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #1128 from the-bay-kay/bluetooth_scanner

    ☰♭  Adding a Bluetooth Scanner to dev options
    shankari authored Mar 22, 2024
    Configuration menu
    Copy the full SHA
    78b5da1 View commit details
    Browse the repository at this point in the history
  3. revert Enketo buttons from <Button>s back to plain HTML

    Enketo requires there to be `<a>` elements with specific IDs for the "next" and "save" buttons.
    We had nested `<Button>`s inside these to make them match the `<Button>`s we use elsewhere in the UI.
    But in some webviews, the touch events would not bubble up from the `<Button>` to the `<a>` elements, causing the buttons to be unclickable except around the margins.
    
    Reverting this back to just use plain `<a>` elements to resolve the bug.
    Maybe revisit `<Button>` later because it was nicer looking.
    JGreenlee committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    79250f7 View commit details
    Browse the repository at this point in the history
  4. Merge pull request #1139 from JGreenlee/fix-enketo-buttons

    🚑 revert Enketo buttons from `<Button>`s back to plain HTML
    shankari authored Mar 22, 2024
    Configuration menu
    Copy the full SHA
    de0ed4c View commit details
    Browse the repository at this point in the history
  5. Refactored BLE scanner, updated UI

    - Scanner now displays all potential beacons
    - When scanning, beacon icons will change to show when they are in / out of range
    - Expanded typing for BLE Devices
    the-bay-kay committed Mar 22, 2024
    Configuration menu
    Copy the full SHA
    2e9e948 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    678d1c3 View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2024

  1. Added scan stop, color to indicate beacon status

    - The color of beacon cards will now change depending
    on whether or not they are within range
    - Refactored scan button
    - Added ability to stop scanning for BLE Beacons
    the-bay-kay committed Mar 23, 2024
    Configuration menu
    Copy the full SHA
    a11b6c1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    71abee3 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2024

  1. Merge pull request #1135 from the-bay-kay/ble_scanner

    🛜 ᛒ  Adding BLE Beacon Scanner
    shankari authored Mar 25, 2024
    Configuration menu
    Copy the full SHA
    c61ed71 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2024

  1. Merge pull request #1129 from jiji14/conditional-surveys-gpg

    📝 Conditional Surveys depending on trip characteristics
    shankari authored Mar 27, 2024
    Configuration menu
    Copy the full SHA
    d0ed16b View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. 🚨 Add a new key to each element in the beacon/device list

    Without this change, we get an error
    
    ```
    Warning: Each child in a list should have a unique "key" prop.
    
    Check the render method of `BluetoothCardList`. See https://reactjs.org/link/warning-keys for more information.
    BluetoothCard@ionic://localhost/dist/bundle.js:21253:18
    BluetoothCardList@ionic://localhost/dist/bundle.js:21666:21
    ```
    
    With this change, the error does not occur
    shankari committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    48f4847 View commit details
    Browse the repository at this point in the history
  2. 🔧 Add the ability to add new beacons to the list

    We currently have two hardcoded beacons in the list. But everybody is going to
    have their own beacon for testing. Let's make it possible to add new UUIDs
    
    Changes:
    - New field to enter the UUID
    - Add button
    - When add button is clicked, add new entry with the specified UUID and dummy
      values
    
    Testing done:
    Entered two separate UUIDs and clicked "Add"
    Two new entries were created in the list
    shankari committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    05b2664 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2024

  1. 🔧 Allow users to add new beacons to be scanned through the UI

    - Creates a new set of fields at the botton of the page for the UUID,
      identifier, major and minor fields
    - Adds a new "Add" button
    - When the "Add" button is pressed, we add a new UUID entry to the default list
    - After the new entry is added, we clear out the old values to prepare for a
      new entry
    
    Testing done:
    Added three new entries. They were displayed in the list
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    8bc0457 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8f9b130 View commit details
    Browse the repository at this point in the history
  3. ♻️ Display the values that will change (UUID, major, minor)

    Instead of the statically coded name/identifier
    This involved changing the text size so that we could see the UUID
    I wonder if we should make the UUID the subtitle and the major:minor the title
    
    Testing done:
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    58b2b0a View commit details
    Browse the repository at this point in the history
  4. ✅ Display the result of the callback in the list + test button

    We don't know what the result will look like when there are multiple beacons with the same UUID, so we just stringify and display the result.
    We cannot test this without having an actual BLE beacon, so I have added a "fake callback button to simulate a callback"
    
    Changes:
    - stringify the result in `didDetermineStateForRegion` and pass it in to
      `setRangeStatus`
    - Change the BluetoothCard to display the `device.result` as Card.Content
    - Add a new button to fake a callback for a device by getting the delegate and
      invoking the `didDetermineStateForRegion` method on it with the device
    - Remove the existing result in the device before invoking the callback to
      avoid nested results
    
    Testing done:
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    29e434c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    022ccec View commit details
    Browse the repository at this point in the history
  6. ✨ Implement the two stage range after monitor process suggested by iOS

    Changes:
    - in the monitor callback, launch the range call with the UUID that was found
    - change the fake callback to call the range callback 500ms after the merge
      callback
    - store the two results separately
    - display the two results separately using different background colors
    shankari committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    7c70840 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #1140 from shankari/simulate_ble_scans

    Simulate BLE scans from the phone UI
    shankari authored Mar 29, 2024
    Configuration menu
    Copy the full SHA
    76839de View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2024

  1. 📋 Prep for saving new BLE Bluetooth objects

    - Move the major and minor boxes to the same row to take up less space
    - Split the fake callbacks into enter, exit and range
    - generalize `fakeMonitorCallback` to work for both enter and exit
    - do not call rangeCallback directly from monitor callback since there
      are now separate buttons
    - for the range callback, use the device major and minor values if they
      exist
    - for the range callback, reset monitor and range results to avoid
      duplicates
    
    This is the first step for testing the data models defined in:
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Apr 1, 2024
    Configuration menu
    Copy the full SHA
    26c388d View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2024

  1. include 'sections' in UnprocessedTrips

    To be consistent with processed trips, and so we can use them in the same way, unprocessed trips should have the 'sections' property.
    
    Unprocessed trips / 'draft' trips are assumed to be unimodal, so we can fairly easily reconstruct a section spanning the entirety of the trip and include that as the only section.
    
    In doing so, I modified points2TripProps. I realized that many of the props will actually be the same between the trip and the section. So I did a bit of refactoring; to construct the unprocessed trip I first construct baseProps (which are used in both the section and the trip); then I construct the section; then finally I construct the trip in the return statement.
    
    Something else I noticed is that all the trip props are computed in points2TripProps except the start_loc and end_loc which were computed in the outer function transitionTrip2TripObj. Since we already have variables for the start and end coordinates in the points2TripProps function, it seems more logical to handle start_loc and end_loc there with the rest of the trip props.
    
    Then we can declare the return type of points2TripProps as UnprocessedTrip; it has all the required properties now.
    JGreenlee committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    5f53e53 View commit details
    Browse the repository at this point in the history
  2. update types relating to UnprocessedTrips

    The main thing I was doing in this commit was adding 'sections' to the type signature of `UnprocessedTrip`. But I also noticed some other things amiss.
    
    `UnprocessedTrip` was missing some other properties; end_ts and start_fmt_time
    
    "LocationCoord" is not needed as it's the same as `Point` from 'geojson'.
    
    `SectionData` was missing a bunch of properties. Once those are filled in, the 'sections' property in `CompositeTrip` and `UnprocessedTrip` can be typed as `SectionData[]`
    JGreenlee committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    76d1131 View commit details
    Browse the repository at this point in the history
  3. rename functions related to unprocessed trips

    After a bunch of refactoring, I think these functions could use a naming update.
    I always found this part of the codebase fairly opaque anyway and I think it can now be made more easily comprehensible.
    
    'points2TripProps' now returns a full UnprocessedTrip object so it is renamed 'points2UnprocessedTrip'
    
    And 'transitions2Trips' is renamed 'transitions2TripTransitions' because it doesn't really return trip objects; it returns pairs of transitions that represent trips.
    
    To follow suit, 'transitionTrip2TripObj' is renamed 'tripTransitions2UnprocessedTrip'.
    
    Added a bit of JSDoc to help clarify what these functions do.
    JGreenlee committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    12db91a View commit details
    Browse the repository at this point in the history
  4. flesh out more types

    Filled in more trip object types, and specifically some literal types that define unprocessed trips. (like "source" will always be 'unprocessed').
    
    CompTripLocations changed from `number[]` for coordinates to geojson's `Position`, since that is more descriptive. Renamed CompTripLocations to CompositeTripLocation (this type represents only 1 location).
    
    Used the CompositeTripLocation type in timelineHelper.
    in locations2GeojsonTrajectory, the return type needed `properties` for it to be considered a Geojson `Feature`.
    
    formattedSectionProperties types as the return type of the function
    JGreenlee committed Apr 3, 2024
    Configuration menu
    Copy the full SHA
    826190a View commit details
    Browse the repository at this point in the history

Commits on Apr 8, 2024

  1. Configuration menu
    Copy the full SHA
    24304f3 View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Fill in a "beacons" array for the range callback

    The array has randomly generated accuracy and RSSI values
    Further, when we exit the region, all the results are undefined
    
    This is part of the change to test the data model defined in
    e-mission/e-mission-docs#1062 (comment)
    shankari committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    ba3ef43 View commit details
    Browse the repository at this point in the history
  2. Prettier fixes + highlight that the buttons simulate behavior

    The simulation buttons are white text on a red background
    shankari committed Apr 11, 2024
    Configuration menu
    Copy the full SHA
    6ca810d View commit details
    Browse the repository at this point in the history

Commits on Apr 12, 2024

  1. ✨ Simulate BLE entries and transitions through the UI

    Consistent with the plans in:
    e-mission/e-mission-docs#1062 (comment)
    
    add support for storing simulated BLE responses and transitions in the
    usercache
    
    Concretely:
    - when there is a monitor entry event, we store a `bluetooth_ble` entry with
      `REGION_ENTER`
    - when there is a range event, we store a `bluetooth_ble` entry with
      `RANGE_UPDATE`. if we receive three consecutive range updates within 5 minutes, we generate a `BLE_BEACON_FOUND` transition
    - when there is a monitor exit event, we store a `bluetooth_ble` entry with `REGION_EXIT` and generate a `BLE_BEACON_LOST` transition
    
    Note that this has some fixes found while testing android:
    e-mission/e-mission-docs#1062 (comment)
    
    In addition, the callbacks exposed that the format of the range callback
    that we were using earlier was incorrect. The `beacons` array is at the
    same level as the `region`
    
    Testing done on both iOS and android:
    - Scan for BLE beacons
    - Region enter
    - Range (3-4 times); see `ble_found` transition
    - Region exit; see `ble_lost` transition
    shankari committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    7cb3882 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2cc07a0 View commit details
    Browse the repository at this point in the history
  3. retrieve + match BLE scans to timelineEntries

    We nearly have the Bluetooth integration done. Now we just need the phone to retrieve BLE scans and implement some matching logic to figure out which beacons go to which trips.
    
    in timelineHelper there is a new function to retrieve BLE scans using the unified data loader.
    
    in inputMatcher we have new functions that go through each timelineEntry and match it to a beacon. Then it looks up that beacon (by its major:minor pair) in the app config to get the vehicle identity.
    
    In LabelTab, we have a new map, timelineBleMap, which holds the mapping of timeline entry IDs to vehicle identities.
    JGreenlee committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    a586bb7 View commit details
    Browse the repository at this point in the history
  4. use labels OR bluetooth vehicle identity to determine "confirmed mode"

    With the ability to detect vehicles by Bluetooth, we now have 2 ways to determine the mode of a trip: user labels or Bluetooth.
    This makes it necessary to refactor and make the code flexible to handle both.
    
    "Confirmed mode" is the new term for a mode that has been determined; either by the user-provided MODE label, or by the vehicle identity determined by Bluetooth.
    
    "Confirmed mode" is given by the "confirmedModeFor" function. Throughout the codebase, we now use `confirmedModeFor(trip)` instead of `labelFor(trip, 'MODE')`.
    For existing configurations that use user MODE labels, this does not change the behavior.
    
    -- While doing this I refactored useGeojsonForTrip to directly accept the base mode, since that is what it really needs, instead of the labeledMode. As a result, it also doesn't need labelOptions as an argument anymore.
    JGreenlee committed Apr 12, 2024
    Configuration menu
    Copy the full SHA
    bff97ae View commit details
    Browse the repository at this point in the history

Commits on Apr 13, 2024

  1. 🤡 Switch the simulation code in the UI to use the mock objects

    In e-mission/e-mission-data-collection#221
    we have added a new method to the data collection interface that allows
    us to create mock BLE objects and save them using the native methods.
    This allows us to simulate the real world scenario more closely, by
    saving from the native code. while still avoiding hacks to real code.
    
    ----------------------------------
    
    Android:
    
    ```
    04-13 13:34:28.204 13563 13563 I chromium:   "state": "CLRegionStateInside"
    04-13 13:34:28.204 13563 13563 I chromium: }", source: https://localhost/plugins/cordova-plugin-em-unifiedlogger/www/unifiedlogger.js (49)
    04-13 13:34:28.222 13563 13763 I System.out: About to execute query SELECT data FROM userCache WHERE key = 'background/bluetooth_ble' AND type = 'sensor-data' AND write_ts >= 1.713040168E9 AND write_ts <= 1.713040468E9 ORDER BY write_ts DESC
    04-13 13:34:28.241 13563 13763 W PluginManager: THREAD WARNING: exec() call to UserCache.getSensorDataForInterval blocked the main thread for 20ms. Plugin should use CordovaInterface.getThreadPool().
    04-13 13:34:28.253 13563 31932 D BuiltinUserCache: Added value for key background/bluetooth_ble at time 1.713040468221E9
    04-13 13:34:28.273 13563 31932 D BuiltinUserCache: Added value for key background/bluetooth_ble at time 1.713040468254E9
    04-13 13:34:28.319 13563 31932 D BuiltinUserCache: Added value for key background/bluetooth_ble at time 1.713040468276E9
    04-13 13:34:28.351 13563 31932 D BuiltinUserCache: Added value for key background/bluetooth_ble at time 1.71304046832E9
    04-13 13:34:28.371 13563 13563 I TripDiaryStateMachineRcvr: noarg constructor called
    04-13 13:34:28.373 13563 31932 D BuiltinUserCache: Added value for key background/bluetooth_ble at time 1.713040468352E9
    ```
    
    iOS
    
    ```
    2024-04-13 13:38:22.029076-0700 emission[77938:10285250] DEBUG:[BLE] didRangeBeaconsInRegion
    2024-04-13 13:38:22.029320-0700 emission[77938:10285250] DEBUG: [BLE] didRangeBeaconsInRegion
    2024-04-13 13:38:22.031065-0700 emission[77938:10285250] DEBUG:{
    }
    2024-04-13 13:38:25.060123-0700 emission[77938:10285250] data has 174 bytes, str has size 174
    2024-04-13 13:38:25.062087-0700 emission[77938:10285250] data has 174 bytes, str has size 174
    2024-04-13 13:38:25.063593-0700 emission[77938:10285250] data has 173 bytes, str has size 173
    2024-04-13 13:38:25.065085-0700 emission[77938:10285250] data has 175 bytes, str has size 175
    2024-04-13 13:38:25.066255-0700 emission[77938:10285250] data has 175 bytes, str has size 175
    2024-04-13 13:38:26.343114-0700 emission[77938:10285250] THREAD WARNING: ['DataCollection'] took '4307.931885' ms. Plugin should use a background thread.
    2024-04-13 13:38:26.350811-0700 emission[77938:10285250] In TripDiaryStateMachine, received transition T_BLE_BEACON_FOUND in state STATE_ONGOING_TRIP
    2024-04-13 13:38:26.350982-0700 emission[77938:10285250] DEBUG: In TripDiaryStateMachine, received transition T_BLE_BEACON_FOUND in state STATE_ONGOING_TRIP
    2024-04-13 13:38:26.352531-0700 emission[77938:10285250] data has 92 bytes, str has size 92
    2024-04-13 13:38:26.354445-0700 emission[77938:10285250] data has 69 bytes, str has size 69
    2024-04-13 13:38:26.355964-0700 emission[77938:10285250] Got unexpected transition T_BLE_BEACON_FOUND in state STATE_ONGOING_TRIP, ignoring
    2024-04-13 13:38:26.356106-0700 emission[77938:10285250] Ignoring silent push notification
    ```
    shankari committed Apr 13, 2024
    Configuration menu
    Copy the full SHA
    463c2a5 View commit details
    Browse the repository at this point in the history

Commits on Apr 14, 2024

  1. during bluetooth_ble matching, convert major and minor to hexadecimal

    The background/bluetooth_ble data type has "major" and "minor" as decimal integers. (e-mission/e-mission-docs#1062 (comment))
    But in the vehicle_identities spec, we have major:minor pairs as hexadecimal strings. So we will need to convert.
    
    decimalToHex handles this and allows us to add padding, ensuring the converted major and minor are always 4 hex characters.
    (so 1 becomes "0001", 255 becomes "00ff", etc.)
    JGreenlee committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    fbedee4 View commit details
    Browse the repository at this point in the history
  2. add "Refresh App Configuration" row to Profile tab

    This feature allows the user to refresh the app configuration without having to log out and back in.
    (This will be handy for our alpha "run-through" of the fermata project, e-mission/nrel-openpath-deploy-configs#89.
    we will likely need to update beacon + vehicle info periodically.
    
    dynamicConfig.ts
    -- in fetchConfig, pass an option to the fetch API so it does not use a cached copy of the config. We want to make sure it's actually checking for the latest config.
    -- export function loadNewConfig so it can be used in ProfileSettings.tsx
    
    ProfileSettings.tsx
    --add function refreshConfig, which calls loadNewConfig and triggers a hard refresh if the config has changed. Toast messages to guide the user through the process.
    --add the new row itself: "Refresh App Configuration" (which also shows the current version of the app config)
    
    appConfigTypes.ts
    --add prop 'version' to config type. Every config has this property.
    
    Testing done:
    On a local dev environment with locally hosted configs, I was signed into an nrel-commute opcode. I updated the local config file, changing "version" from 1 to 2 and changing "use_imperial" from true to false.
    In the UI Profile tab, the new row showed "Current version: 1". After clicking the row, the app reloads and UI now shows 'km' instead of 'miles'. I went back to the Profile tab and the new row now shows "Current version: 2". Clicking the row a second time triggers a toast message saying "Already up to date!"
    JGreenlee committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    3fd2863 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d61a4af View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8de3ca0 View commit details
    Browse the repository at this point in the history
  5. allow android emulator to download locally hosted configs by using 10…

    ….0.2.2 instead of localhost
    JGreenlee committed Apr 14, 2024
    Configuration menu
    Copy the full SHA
    6cd4e6b View commit details
    Browse the repository at this point in the history

Commits on Apr 15, 2024

  1. 🔥 Remove code to build JSON objects

    In an earlier version of this PR, before I added mocking to the plugin,
    we saved JSON objects directly. We created the objects to save by
    removing results from the in-memory objects using a destructuring
    assignment.
    
    However, after the mocking was added, we create objects in native code.
    So we don't need to create them here and can remove these unused
    variables.
    #1144 (comment)
    shankari committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    87370b6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    933f9a4 View commit details
    Browse the repository at this point in the history
  3. fix typo: "background_ble" -> "bluetooth_ble"

    This would explain why I was never getting any entries returned from the unified loader
    JGreenlee committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    fcaec5c View commit details
    Browse the repository at this point in the history
  4. 👷🔧 🪠 Plumb through support for requesting bluetooth scan permissions

    Complementary to
    e-mission/e-mission-data-collection#224
    
    Very similar to the fitness checks, just calls through to the underlying
    native javascript
    
    Note that the bluetooth scan will currently only be used for fleet
    configs since we don't use bluetooth in the general case, and forcing
    people to enable it unnecessarily is bad.
    
    Testing done:
    e-mission/e-mission-data-collection#224 (comment)
    shankari committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    1fca7c5 View commit details
    Browse the repository at this point in the history
  5. Prettier formatting fix

    shankari committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    9d6e529 View commit details
    Browse the repository at this point in the history
  6. Bump up the versions for the usercache and data collection plugins

    The data collection plugin may have other changes coming in, so we are
    installing it off a branch
    shankari committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    7054136 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b2d22b7 View commit details
    Browse the repository at this point in the history
  8. add "confirmedMode" to derived properties & use for conditional surveys

    For the fermata project, the survey shown for a trip should depend on what vehicle was detected from bluetooth.
    For unprocessed trips, this information is not going to be in the raw trip object. That's why we have "timelineBleMap", which is kept separate from the raw trip objects.
    But to access this while evaluating the conditional survey "showsIf" expressions, we'll need to include more things in the eval's scope.
    
    I decided that it would be appropriate to use our "derived properties" hook for this. we can add a new property to derived properties, then we can include all the derived properties in the scope in which the "showsIf" expressions are evaluated.
    
    This will probably be adjusted later.
    
    Note: I also simplified the type definition of DerivedProperties. It now just uses the return type of the useDerivedProperties hook.
    JGreenlee committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    0b6b844 View commit details
    Browse the repository at this point in the history
  9. only use "ranging" scans for BLE matching

    When matching we basically are trying to find the major:minor pair that was sensed the most frequently during the trip.
    But should only consider RANGE_UPDATE events for this. The REGION_ENTER and REGION_EXIT events do not have major and minor defined, so we should exclude them for the purpose of matching.
    
    Add a filter condition for this. Also updated function + variable names to make it clearer that we are only considering 'ranging' scans.
    
    Note that before processing, the value of eventType is a string ('RANGE_UPDATE'). But the server changes this to an enum value where 'RANGE_UPDATE' -> 2. So we have to check for both.
    JGreenlee committed Apr 15, 2024
    Configuration menu
    Copy the full SHA
    37fbb85 View commit details
    Browse the repository at this point in the history
  10. Merge pull request #1145 from JGreenlee/ble-ui-changes

    🔵🦷 UI changes for BLE integration
    shankari authored Apr 15, 2024
    Configuration menu
    Copy the full SHA
    9cfff85 View commit details
    Browse the repository at this point in the history

Commits on Apr 17, 2024

  1. Configuration menu
    Copy the full SHA
    8cc6a7e View commit details
    Browse the repository at this point in the history
  2. in updateUnprocessedBleScans, await call to getUnifiedDataForInterval

    Without the 'await' keyword here, execution would continue without the request being completed.
    This would cause the BLE scans to sometimes not be considered while rendering and evaluating conditional surveys.
    If the BLE scans took longer to load than the trips took to render, there would be no surveys prompted.
    Thus, we must 'await' to make sure the BLE scans are loaded first.
    JGreenlee committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    03673a4 View commit details
    Browse the repository at this point in the history
  3. cacheResourcesFromConfig: reload the cache when config is downloaded

    We recently added the ability to refresh the config from inside the app.
    But whenever the config is downloaded for the first time, we cache the resources referenced in it by URL. Subsequent config downloads would still use the resources from the first time.
    
    fetchUrlCached now accepts options to pass through to the fetch API; if cache is 'reload', we will skip checking our localStorage cache for a previously stored value. This option will also cause the fetch API will also skip its own internal cache
    
    The result of this is that when we refresh the config, URL-referenced resources inside it will also be refreshed.
    JGreenlee committed Apr 17, 2024
    Configuration menu
    Copy the full SHA
    d83f4d4 View commit details
    Browse the repository at this point in the history

Commits on Apr 20, 2024

  1. Merge pull request #1146 from JGreenlee/fermata-fixes-apr17

    Fermata fixes apr17
    shankari authored Apr 20, 2024
    Configuration menu
    Copy the full SHA
    b9dd3ba View commit details
    Browse the repository at this point in the history

Commits on Apr 22, 2024

  1. Configuration menu
    Copy the full SHA
    f0c85f2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    22cbf2f View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. Merge pull request #1143 from jiji14/code-coverage

    Add 'collectCoverageForm' configuration to track all files for Jest coverage
    shankari authored Apr 26, 2024
    Configuration menu
    Copy the full SHA
    1589f74 View commit details
    Browse the repository at this point in the history
  2. Switch the data collection plugin version to the latest

    e-mission/e-mission-data-collection#226
    is now merged and a new release
    https://github.com/e-mission/e-mission-data-collection/releases/tag/v1.8.5
    has been created
    
    So we can now use the version number instead of a branch while adding the
    plugin
    
    With this commit, the initial implementation in
    #1144
    is done, and we can merge it
    shankari committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    0eebe4b View commit details
    Browse the repository at this point in the history

Commits on Apr 28, 2024

  1. Lock React version to ~18.2.0 (#1148)

    * lock React version to ~18.2.0
    
    React 19 and React 18.3 are out (https://react.dev/blog/2024/04/25/react-19-upgrade-guide#react-18-3), but the React Native ecosystem is still on React 18.2.
    We need to lock the versions down until the React Native packages update.
    
    * 💩 Temporarily pin the version to 14.1 so that the CI is successful
    
    Consisent with
    #1148 (comment)
    
    * 💩 Revert back even further to xcode 14
    
    Consistent with
    #1148 (comment)
    
    * 📌 Ensure that we are using the correct version of java
    
    Before this, we set only the `JAVA_HOME` to pin the java version
    This was working until a couple of days ago, when, even after setting the
    version, the java version was not changed.
    
    This may be due to the location for the java executable changing, so let's try
    to set the PATH as well
    
    Also print out several environment variables to help debug further
    
    Related info:
    #1148 (comment)
    #1148 (comment)
    
    * 🔧 Change the environment variable to the one used in the new github actions runner
    
    Related context:
    #1148 (comment)
    
    * 📌 Pin the mac version to 13
    
    To be consistent with
    #1148 (comment)
    
    Before we fix
    e-mission/e-mission-docs#1060
    
    * 📌 Pin the mac version to 13
    
    Consistent with
    #1148 (comment)
    and
    b5072f3 (for iOS)
    
    * ⏪️ Revert previous attempts to fix the issue
    
    since pinning to OSX-13 fixed it
    #1148 (comment)
    
    * 📌 Pin the xcode version again
    
    Because apparently the default version, even on the OSX 13 runner, is now xcode 15
    #1148 (comment)
    
    * Ensure that the switch command is run as root
    
    ---------
    
    Co-authored-by: K. Shankari <shankari@eecs.berkeley.edu>
    JGreenlee and shankari authored Apr 28, 2024
    Configuration menu
    Copy the full SHA
    0f6aabc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5df032c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ccab0ca View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    57819e1 View commit details
    Browse the repository at this point in the history
  5. Change all badges to only work on master and push

    So we don't get false negatives based on currently active pull requests
    shankari authored Apr 28, 2024
    Configuration menu
    Copy the full SHA
    5093541 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #1144 from shankari/simulate_ble_scans

    Expand the profile screen to simulate bluetooth actions separately and handle them properly in the native code
    shankari authored Apr 28, 2024
    Configuration menu
    Copy the full SHA
    8a9d9b3 View commit details
    Browse the repository at this point in the history

Commits on May 3, 2024

  1. Configuration menu
    Copy the full SHA
    ec20573 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8aa0010 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    75c0c06 View commit details
    Browse the repository at this point in the history

Commits on May 5, 2024

  1. 🚑️ 🐛 Ensure that we do show the replaced mode when the `mode_of_inter…

    …est` matches
    
    At some point, we changed the mode and purpose user inputs as objects that were
    stored to be full objects, with start and end timestamps, instead of just the
    labels. We changed all uses of the MODE and PURPOSE to match it, but apparently
    forgot to change this location, where the replaced mode button is conditionally
    displayed.
    
    This is a quick change to make the usage here consistent with the rest of the
    code so that we can push this out ASAP.
    
    @JGreenlee, please let me know if there is a more principled fix, it is late
    and I don't want to experiment any further.
    
    Testing done:
    Please see PR
    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    79656d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed61b8d View commit details
    Browse the repository at this point in the history
  3. 💩 Turn off the background checks for fleet deployments

    Since the fleet deployments are installed on work phones, and the background restriction is apparently grayed out on android work phones.
    e-mission/e-mission-docs#1070
    
    This is a hack (hence the 💩 emoji) but it will allow us to make progress
    through the onboarding, get the logs and then resolve the issue the right way.
    Or if we can't figure out how to access it the right way, this can become a
    config option for deployments that plan to use work phones.
    
    This should unblock
    e-mission/e-mission-docs#1070 (comment)
    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    00a4d95 View commit details
    Browse the repository at this point in the history
  4. ✅ 🐛 Improve user input matching mocks and use them

    The previous unit tests for the input matching assumed that the user input
    would be of the form of the label options, so reused the label options as mock
    options. However, they actually are of the form of user input objects with data
    and metadata and the input as a label.
    
    We create new mock objects with the correct format, and use them in the tests.
    
    This is the reason why #1150
    was not caught for so long.
    
    And when we fixed the code, the test broke.
    #1150 (comment)
    #1150 (comment)
    
    Testing done:
    
    ```
    npx jest www/__tests__/confirmHelper.test.ts
    
    Test Suites: 1 passed, 1 total
    Tests:       11 passed, 11 total
    ```
    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    8b26d2d View commit details
    Browse the repository at this point in the history
  5. Fix formatting

    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    20b9e1a View commit details
    Browse the repository at this point in the history
  6. Merge branch 'fix_replaced_mode_regression' into hack_to_disable_unus…

    …ed_app_check_for_android_fermata
    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    1efda2e View commit details
    Browse the repository at this point in the history
  7. Merge pull request #1150 from shankari/fix_replaced_mode_regression

    🚑️ 🐛 Ensure that we do show the replaced mode when the `mode_of_inter…
    shankari authored May 5, 2024
    Configuration menu
    Copy the full SHA
    958918d View commit details
    Browse the repository at this point in the history
  8. 💩 🔧 Disable only the unused apps check

    In the previous commit, we had disabled all android background checks.
    This means that the optimization check would also be disabled, and we would not
    be able to start the foreground service from the background.
    
    Let's change this to only disable to unused apps check
    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    9921c52 View commit details
    Browse the repository at this point in the history
  9. 📌 ⬆️ Upgrade the pinned version of the OS

    - We want to upgrade the pinned version of the OS to the next one
    - We don't want to run on `latest` because then changes to the underlying
      runner will break all tests, including for pull requests, and block
    development.
    
    Instead, we should schedule a periodic (~ once a week) check against `latest`
    so we know when the latest has changed, and can fix it before again bumping up
    the pinned version @louisg1337
    
    Also, there was a typo in `latest` :smile
    shankari committed May 5, 2024
    Configuration menu
    Copy the full SHA
    bc4c4ce View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ab2ff6e View commit details
    Browse the repository at this point in the history
  11. Merge pull request #1151 from shankari/hack_to_disable_unused_app_che…

    …ck_for_android_fermata
    
    💩 Turn off the background checks for fleet deployments
    shankari authored May 5, 2024
    Configuration menu
    Copy the full SHA
    9f3fc59 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d890502 View commit details
    Browse the repository at this point in the history
  13. Merge pull request #1149 from louisg1337/ios_build_fix

    iOS build fix for Xcode 15
    shankari authored May 5, 2024
    Configuration menu
    Copy the full SHA
    0a43a4d View commit details
    Browse the repository at this point in the history