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
Mode/Purpose Confirm Survey #572
Conversation
Can one of the admins verify this patch? |
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.
Few small suggestions based on the current state of the draft.
This does look super promising otherwise...
Fixed over our recent Skype meetings. |
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.
@atton16 great job. I see that you can already read and extract parts of the stored survey results - now you just need to put them into the $scope
and display them in the UX. I have a couple of minor comments, all dealing with consistency with the rest of the framework.
Would be great if you could address them so that it is easier for it to take advantage of future improvements to the platform after you are done with this project...
<button id="validate-form" class="btn btn-primary" ng-click="validateForm()" style="width:200px; margin-left: calc(50% - 100px);">Validate</button> | ||
<a href="#" class="btn btn-primary next-page disabled" style="width: 200px; margin-left: calc(50% - 100px)">Next</a> | ||
<button id="validate-form" class="btn btn-primary" ng-click="validateForm()" style="width:200px; margin-left: calc(50% - 100px);">Save</button> | ||
<a href="#survey-paper" class="btn btn-primary next-page disabled" style="width: 200px; margin-left: calc(50% - 100px)">Next</a> |
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.
neat! I filed an issue with enekto-core for this (https://github.com/enketo/enketo-core/issues/626), and we've been going back and forth on a good solution. I proposed this as an alternative.
@shankari Can you please review this? |
@atton16 I hate to be pedantic about this, but would it be possible for you to be consistent with the coding conventions for the rest of the project? I use 4 spaces for indentation, no spaces between Your editor is apparently set with 2 spaces for indentation and spaces between It is fairly common for open source projects to enforce formatting standards (e.g. https://stackoverflow.com/questions/4714648/enforce-coding-standards-in-all-files-of-a-project-at-build, exercism/cpp#274) As you can see, reformatting messes up There's probably something clever we can do with jslint (or rather, prettifier https://stackoverflow.com/a/53636796) to check for this, and to incorporate it into continuous integration, but I don't have time to work on it right now :( |
I should really put the formatting guidelines into a |
I think best is to use linting tool, I normally use |
Actually, I set spaces to 2 on purpose. It makes everything tight especially large project. So it is easier to read complex function as most of the time they are all in the same screen. But I am happy with any. Leave it to you to decide. I can setup lint for you to get it started. |
@atton16 thank you so much for setting up eslint and fixing all the bugs, but this makes the code even harder to review since the linting changes are overwhelming the real changes. There are now 71 files that are changed, and I know that the changes related to mode/purpose confirm survey only affect 5-6 at the most. Is it possible for you to generate a PR that has only the changes required for the mode/purpose confirmation, with no additional whitespace changes? And then generate a second PR that is basically ONLY whitespace changes and bug fixes from the linting? Or is that too hard to do now that everything is mixed in here? |
For example, you could cherry-pick your initial changes and revert the whitespace changes until only semantic changes are left. |
I think it is too late at this stage. |
when I put in my comment about the spacing, I was really hoping for a clean PR to review. At this point, I have no idea what is a real change and what is not, and git blame is all messed up. |
did you try cherry picking only the first set of semantic changes and removing whitespace changes? How long did it take? |
The set of changes before |
that is the last commit, but you have a set, right? You can cherry-pick a set of commits https://git-scm.com/docs/git-cherry-pick |
so something like
should work |
superceded by enketo/enketo#302 enketo/enketo#297 |
In this PR we are trying to implement:
At this point, I am struggle at Point (2). It appears that somehow
$window.cordova.plugins.BEMUserCache.getAllMessages
complicate things up.If you look at the code in the file
js/survey/enketo-survey-services.js
line55-64
never get executes.Here is the output:
At first the problem was worse, when the code was combined in the
EnketoSurveyCtrl
controller (now resides in the filejs/survey/enketo-survey.js
) the button in the corresponding template cannot callvalidateForm
function. So my assumption is that$scope
get lost in the process of executing$window.cordova.plugins.BEMUserCache.getAllMessages
. Now that I have separate the controller and service, I am stuck with the same bizarre problem where some code gets lost and never fired up.