-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Places survey #917
Places survey #917
Conversation
I manually picked out the files which were important to the time-use/places button and time-use enketo survey to this branch
Removed the time-use-survey-form-v9 file from the json, as this will be read in from the nrel-openpath-deploy-configs repo dynamic-config.js - Changed the download URL to be my version of the deploy configs so it can read in the new config data for survey data path and survey info service.js - Reads in the formpath, if formpath already exists locally (i.e. demo-survey-v2.json) use that; otherwise, read in the survey path from my nrel-openpath-deploy-configs
…y path exists Using the deploy-configs that contain info about the survey data, we can perform javascript on them to make them behave properly. For example, enketo-time-use.js - Added DynamicConfig - Read from DynamicConfig to get the config details as an object - Use the config details to see whether time_use_survey_path is empty or not, and skip if it is empty
service.js - Added DynamicConfig library - Removed the ENKETO_SURVEY_CONFIG_PATH since we are getting the path from the dynamic config now - Added the DynamicConfig get text which gets the config.surveys data to be used - Removed the _lazyLoadConfig http request now that we are getting the survey json path from the dynamic config data answer.js - Added DynamicConfig library - Removed the ENKETO_SURVEY_CONFIG_PATH since we are getting the path from the dynamic config now - Added the DynamicConfig get text which gets the config.surveys data to be used - Removed the _lazyLoadConfig http request now that we are getting the survey json path from the dynamic config data enketo-time-use.js - Fixed the location of the formPath file since it was changed in nrel_openpath_deploy_configs Removed enketoSurveyConfig.json.sample because we no longer need it due to the data being in nrel_openpath_deploy_configs
service.js - Added DynamicConfig library - Removed the ENKETO_SURVEY_CONFIG_PATH since we are getting the path from the dynamic config now - Added the DynamicConfig get text which gets the config.surveys data to be used - Removed the _lazyLoadConfig http request now that we are getting the survey json path from the dynamic config data answer.js - Added DynamicConfig library - Removed the ENKETO_SURVEY_CONFIG_PATH since we are getting the path from the dynamic config now - Added the DynamicConfig get text which gets the config.surveys data to be used - Removed the _lazyLoadConfig http request now that we are getting the survey json path from the dynamic config data enketo-time-use.js - Fixed the location of the formPath file since it was changed in nrel_openpath_deploy_configs Removed enketoSurveyConfig.json.sample because we no longer need it due to the data being in nrel_openpath_deploy_configs
…rveys-data dynamic_config.js - changed the URL to reflect the new branch location enketo-time-use.js - removed the check that checks to make sure that the timeusesurvey is activated (this is the old way that we were doing it) service.js - Fixed the filepaths to reflect the new filePath field in surveys in the dynamic config
Prepare label screen directives for dynamic surveys + notes
Touch ups for dynamic surveys implementation
- Added a try/catch around the entire init function because there was a single "undefined" error causing the profile screen to not load
service.js - Because when using trip confirm survey, _state.opts.trip.data.properties does not automatically have start_ts and end_ts. Added start_ts and end_ts entering into the data
I found the point where BeforeAfterAs you can see, now the trips get removed from the to-label filter when you've labeled them, and they don't come back after hitting the refresh 🔄 button! |
I'm glad you were able to fix that - it will unblock me as well.
If you try to label the trip from the diary, for example, it will have That's why I have the line
From your screenshots, it looks like the trip has
|
My previous screenshots were from the Label screen. When labeling from the Diary screen, I will no do the following:
|
fix 'add details' btn not appearing. -'surveyOpt' needs to recompute after dynamic config is loaded fix text overlapping over 'add details' btn -changed the bottom 'diary-infos' to be vertically centered
The code works in this way: Old Label Screen:
Old Diary Screen:
That being said, the solution appears to be:
@shankari you had mentioned:
|
Given this:
This is clearly a regression caused by the changes to unify the diary and label screens. Not sure why this is your proposed solution:
instead of my proposal to change Can you indicate why your proposed solution is better? |
-if the config has "autoRefresh": true, then it will be checked for updates on every app launch -the same source URL is checked every time -the newly retrieved config will be applied only if the "version" is different
We can now have the dynamic config checked for updates on launch!
{
"version": 1,
"autoRefresh": true,
...
} If the above config is loaded into the app (from github) and then it is incremented to version 2, the app will load the new version on its next launch. If We should now update the docs to explain this |
- additions will now immediately show up on whatever trip was happening at the time, according to the addition's start timestamp
since entries are being sorted we can no longer use the $index that angularjs provides - we need to lookup the index for the entry being deleted
this seems more logical, clear, and versatile for other use cases
hack for enketo to preserve prefilled timezone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking pretty good to me so far. The two issue that I see are:
- the matching code is not correct
- the HTML file still has a lot of style-based function calls that should be replaced with variables instead.
The "undefined" error that this solved temporarily as a band-aid fix was fixed in commit e-mission@e474945
answer.js - Removed the case when the labelVars type is not supported to return an empty string - Replaced it with a throw new Error that identifies the label type is not supported and it says specifically which one it is
milliseconds were used at one point of testing, but .unix() is now used which returns seconds
- to more closely parallel the server code, the user input filter function has been moved to a separate function called validUserInputForTrip() - both getUserInputForTrip() and getTripAdditionsForTrip() will now use validUserInputForTrip()
- the survey is only precise to the minute, while trips are precise to milliseconds - if the start/end timestamps resolved from the survey response are within the same minute as the trip start/end, we will use the exact trip start/end - this is to avoid addition timestamps being slightly off because of truncation issues
- if the label takes up >2 lines, it should show "..." and not overflow to next entry
- this is for the "enketo.noteAddition" emit coming from enketo-add-note-button.js. when we locate the trip on which to display a brand new addition, we should use the now-standardized validUserInputForTrip function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only high level issue that is left is to avoid using functions for classes/conditionals etc in the HTML
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any pending issues for the trip code.
No description provided.