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

Support mode_studied being an array of multiple modes #1201

Merged
merged 1 commit into from
Mar 13, 2025

Conversation

JGreenlee
Copy link
Collaborator

mode_studied is currently a string, but we want to support multiple modes of interest. We can allow it to be string | string[] and handle both cases at runtime

Updated app config typing accordingly

mode_studied is currently a string, but we want to support multiple modes of interest.
We can allow it to be `string | string[]` and handle both cases at runtime

Updated app config typing accordingly
@JGreenlee
Copy link
Collaborator Author

I tested this by locally hosting a modified stage-program config to have ["e-bike", "bike"]

image

Then I signed in on the Simulator with one of my real opcodes and added a few fake mode labels.
The walk trip does not prompt for replaced mode, but the bike and e-bike trips do

@JGreenlee JGreenlee marked this pull request as ready for review March 12, 2025 16:19
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

Attention: Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 29.78%. Comparing base (39b2e2e) to head (078037a).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
www/js/survey/multilabel/confirmHelper.ts 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1201      +/-   ##
==========================================
+ Coverage   29.76%   29.78%   +0.02%     
==========================================
  Files         123      123              
  Lines        4959     4962       +3     
  Branches     1096     1142      +46     
==========================================
+ Hits         1476     1478       +2     
+ Misses       3483     3482       -1     
- Partials        0        2       +2     
Flag Coverage Δ
unit 29.78% <80.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
www/js/survey/multilabel/confirmHelper.ts 87.25% <80.00%> (-0.63%) ⬇️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines +76 to +78
typeof appConfig.intro.mode_studied == 'string'
? [appConfig.intro.mode_studied]
: appConfig.intro.mode_studied;
Copy link
Contributor

Choose a reason for hiding this comment

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

we can remove this code once all the existing programs with a single mode of interest have been archived, right?

Can we add a TODO: here to flag that?

@shankari shankari merged commit f92a26a into e-mission:master Mar 13, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Tasks completed
Development

Successfully merging this pull request may close these issues.

2 participants