-
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
Rk unsw #615
Open
atton16
wants to merge
22
commits into
e-mission:rk-unsw
Choose a base branch
from
atton16:rk-unsw
base: rk-unsw
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rk unsw #615
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
5363d83
fix: Invalid date for processed trips
atton16 fd66aff
patch: limit datepicker to the date the user signed up
atton16 84422ee
patch: disable summary slide on intro page
atton16 4cb6f3d
feat: add repo branch to user data
atton16 fa189e7
patch: rename repo branch name
atton16 8814ec5
Merge pull request #619 from atton16/rk-unsw-branchId
shankari 31fe33a
Merge pull request #620 from atton16/rciti1
shankari ea2327d
Update index.html
atton16 2ddfbb7
Merge pull request #625 from atton16/rciti1
shankari 6877432
patch(Settings): remove medium accuracy button
atton16 c902571
patch(Settings): remove tracking button
atton16 e140fc5
patch(Settings): rename My Profile button
atton16 78e9661
feat: add end-survey
atton16 bac9d5c
patch(Settings): remove logout button
atton16 f1945f0
patch(UI): minor UI changes
atton16 286ffaf
patch(EndSurvey): refactor
atton16 f5ccdf2
Merge pull request #629 from atton16/rk-unsw-end-survey-inapp-browser
shankari 3c064f2
Merge branch 'rk-unsw-end-survey-inapp-browser' into rciti1
atton16 5f1965c
Merge pull request #630 from atton16/rciti1
shankari 5667c3e
patch: update survey version
atton16 d335c82
Merge branch 'rciti1' into rk-unsw
atton16 f5ec2d2
Merge branch 'rk-unsw' of github.com:atton16/e-mission-phone into rk-…
atton16 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,15 @@ angular.module('emission.enketo-survey.service', [ | |
null; | ||
} | ||
|
||
function getFirstUserProfile(user_properties, answers) { | ||
const potentialCandidates = answers.filter(function(answer) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do you need to do this? you should not be able to retrieve profiles for other users anyway. You can argue that it doesn't hurt anything, but extra code = extra computation = slower response time. |
||
return answer.data.user_uuid = user_properties.uuid; | ||
}); | ||
return potentialCandidates.length ? | ||
potentialCandidates[potentialCandidates.length - 1] : | ||
null; | ||
} | ||
|
||
function _restoreAnswer(answers) { | ||
let answer = null; | ||
if (__trip) { | ||
|
@@ -170,6 +179,7 @@ angular.module('emission.enketo-survey.service', [ | |
getAllSurveyAnswers: getAllSurveyAnswers, | ||
getState: getState, | ||
getUserProfile: getUserProfile, | ||
getFirstUserProfile: getFirstUserProfile, | ||
populateLabels: populateLabels, | ||
makeAnswerFromAnswerData: makeAnswerFromAnswerData, | ||
}; | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Are you sure this is the problem? Because if this were the case, then the month would always be off by one (e.g. January would be 1 in the
local_dt
, converted to February by moment and displayed as such in the UI), and somebody would have noticed before this. Note thatgetLocalTimeString
is used in the master branch as well.Based on the screenshots, I believe that this fixes the immediate issue that you found, but I am concerned that if it is not based on a well-formed understanding of the underlying bug, it may lead to other regressions.
I would like to see screenshots showing that:
before I approve the change.