-
Notifications
You must be signed in to change notification settings - Fork 109
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
Remembering previously entered values (auto-fill) #406
Conversation
Codecov Report
@@ Coverage Diff @@
## master #406 +/- ##
============================================
+ Coverage 48.67% 48.72% +0.04%
- Complexity 2897 2905 +8
============================================
Files 241 241
Lines 13591 13603 +12
Branches 2631 2635 +4
============================================
+ Hits 6616 6628 +12
- Misses 6132 6133 +1
+ Partials 843 842 -1
Continue to review full report at Codecov.
|
@cooperka This will likely require a PR to https://github.com/opendatakit/xforms-spec as well. Can you please file an issue there so we don't forget? |
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.
The changes are narrow and clean, which is super nice, thanks! I think that this PR not only solves the issue but also makes it easier to understand.
The only change I'd want to ask for is to add a new junit test that verifies the new parser method using an external file. I can give a hand if you're not sure how to go about it.
Thanks @ggalmazor, I added one basic test and I'd love help with the second one. It's probably a simple thing; I have a file I want to read from, but I get this error: XFormParseException: Unable to parse external secondary instance: org.javarosa.core.reference.InvalidReferenceException:
The reference "jr://file/resources/org/javarosa/xform/parse/last-saved-filled.xml" was invalid and couldn't be understood. The javarosa jr:// reference root "file" is not available on this system and may have been mis-typed. Any advice for how to specify the filename? See commit 9d8f637. |
Hi, @cooperka! Sorry for the delay :P You could try this: Path lastSavedSubmissionDirectory = r("last-saved-filled.xml").toAbsolutePath().getParent();
ReferenceManagerTestUtils.setUpSimpleReferenceManager("file", lastSavedSubmissionDirectory);
FormDef formDef = parse(formName, "jr://file/last-saved-filled.xml"); I've tried it in your branch and it passes the test. Here's how that works:
Please, feel free to tinker in |
This reverts commit b1f31c0.
All feedback addressed, thank you both! |
Companion to getodk/collect#2882. See that PR for a full description.
This change basically just maps an instance's
src
value of"jr://instance/last-saved"
to whatever is passed in aslastSavedSrc
.Note: A
null
value forlastSavedSrc
is fine and means no instancesrc
is provided, meaning the instance will be treated as internal instead of external. The internal<instance id="last-saved"/>
has no children and thus will provide empty values for anything referring to it.