-
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
Show recently created entities in Experimental Settings #5294
Conversation
78089db
to
c212917
Compare
<meta> | ||
<instanceID/> | ||
<instanceName/> | ||
<entities:entity entities:dataset="people"> |
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.
After reading https://www.w3.org/TR/2006/REC-xml-names11-20060816/#defaulting: "Default namespace declarations do not apply directly to attribute names; the interpretation of unprefixed attributes is determined by the element on which they appear." and https://stackoverflow.com/a/46865/137744, we've decided not to namespace the attributes on the entity
block. I think I checked for that in the JR pull request and made sure they're not enforced but would be worth a double check and to change this here.
saveto
and entities-version
get namespaced because they are on nodes that are not "ours".
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 think I see what you're getting at, but just to confirm, you mean that dataset
shouldn't need a prefix? I'm guessing the inner nodes (create
and label
) still do however?
This is something we should change in tests in JavaRosa also if so.
Couple of very small changes to consider. I think this is ready for a mini regression pass around form entry! |
I’d like to double-check the expected results -when new entities should appear in "experimental".
The entity is not created if the form is saved but not finalized. |
Yup that looks correct to me! Entities are only created once the form is initialized. |
@seadowg Entities that were saved and visible in experimental settings disappear after killing the app. If I just close the app by tapping device back button, the saved entities are still in experimental settings. By restarting the app you mean e.g. removing/downloading the app? |
No I mean killing the app and starting it up again. I'd usually refer to "removing/downloading the app" as "reinstalling". |
Problem descriptionWhen a user finalizes and saves an empty one question enity form, the app crashes. Steps to reproduce the problem
|
@dbemke good catch. I'll look at fixing that. |
From another conversation:
The update behavior may not matter now but wanted to include it for completeness! |
I have forms that feed into two datasets, |
I had a look at the shovel form @lognaturel mentioned and there are different results for the first entity created after downloading a project and following entities.
|
I'll make changes to fix this in JavaRosa so blocking this PR on that.
I'm guessing it's two forms rather than one form right? Yeah, it looks I missed actually filtering entities by dataset! I knew this had felt too easy. Definitely a peril of switching back and forth between the two projects...
We're only showing the "first" property right now for each entity. It could be that "first" ends up a bit random though in this case. In hindsight, this feels too confusing for multiple property entities (as it really looks like something is going wrong here). I'll have a look at doing the easiest thing for this PR to make it nicer - either making sure always show the same property, or showing all properties. I want to make sure I'm not spending too much time perfecting all this seeing as it's very much a debug tool. We can still do another pass on it before release.
That's very strange. You should be able to see the value Central is using in the actual submission XML (in Collect's |
Very strange. I'll see if I can reproduce this. |
Ok it looks like both the different ordering of properties and the missing label are to do with form def caching. @dbemke @srujner an interesting thing I always forget is that Collect will cache the parsed form definition after loading it the first time. This means that we sometimes see bugs that happen only on the first or not on the first time you load the form. I've fixed the properties (and we're now showing all of them to make it easier to see what's going on) and will look into what's happening with the label next. |
I haven't been able to immediately find a reason that |
@dbemke @srujner yeah the missing label is an existing problem (getodk/javarosa#695). That shouldn't block this PR. It is something we'll want to fix before release however, as it really messed up entities. |
I checked different Android versions and in Android 8.1, 10, 11, 12, 13 the missing part in entities:label for following submissions in xml is present in all Android versions. |
At the moment, everything has been checked by us, but we're waiting for the fix for the issue with scrolling. |
603ab2f
to
b5abf45
Compare
Tested with Success! Verified on Android 10 Verified Cases:
|
Tested with Success! Verified on Android 13 |
Closes #5231
Blocked by getodk/javarosa#691Blocked by getodk/javarosa#694This goes a bit further than the issue describes and adds an "entitiy browser" UI that can be accessed from Experimental settings. This will show entities created by forms. Entities are not "persisted" and you'll get a clean slate every time you restart the app.
One thing to note is that I decided to use the AndroidX Navigation library to implement the browser UI (you can see the switch in 73a15c8). This was an experiment to see how it felt, and I ended up really liking it! Interested to know what others think.
What has been done to verify that this works as intended?
New tests and verified manually.
Why is this the best possible solution? Were any other approaches considered?
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?
Should just add the ability to view created entities. I think doing a quick check on form entry (filling, saving, editing forms etc) in general would be good, but we don't need to check entity forms themselves as this is still experimental and something we'll be playing with later.
Before submitting this PR, please make sure you have:
./gradlew checkAll
and confirmed all checks still pass OR confirm CircleCI build passes and run./gradlew connectedDebugAndroidTest
locally.