-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use raw values, not display text, for Entity property values #6514
Conversation
b739b1a
to
7f9f508
Compare
.clickFinalize() | ||
|
||
.startBlankForm("Entities With Dates Follow Up") | ||
// .assertText("2024-11-15") |
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.
There is a problem with saving dates as labels. I fixed it here: https://github.com/getodk/collect/pull/6514/files#diff-dcf4e4fc03ff048616e3d821f4dc1ff53ea090480626d6516d0ac054b35c1446R35 but the problem is that such an element is identified as DateTime
data type not just Date
. It seems to be a bug in javarosa so I'm going to file an issue there.
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 issue is here: getodk/javarosa#807
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 solution looks good as far as I can tell, although I wasn't familiar with the uncast
method.
I think we could test this at the unit level for EntityFormFinalizationProcessor
and EntityFormParser
instead of needing a connected test though. @grzesiek2010 could you make that change in a follow-up? That way we're not blocking this for test changes.
Ok I will do that. |
Verified on device with Android 14 |
Verified on device with Android 10 |
Closes #6510
Why is this the best possible solution? Were any other approaches considered?
There is no other solution to discuss. If we want to use plain, unformatted strings, we need to uncast the value and read the string.
There is one issue that needs to be addressed in javarosa I belive: https://github.com/getodk/collect/pull/6514/files#r1844165858
How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Regardless of the data type used to store entities, the values saved to them should be plain, unformatted text, identical to what is stored in XML submissions. I think testing dates here is sufficient; we don't need to test other data types. Even if this issue affects other data types, the PR should address all cases.
Do we need any specific form for testing your changes? If so, please attach one.
I used:
entities_with_dates_registration.xlsx
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No.
Before submitting this PR, please make sure you have:
./gradlew connectedAndroidTest
(or./gradlew testLab
) and confirmed all checks still passDateFormatsTest