Skip to content
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

Request entity versions in EntityShow, not diffs #880

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

matthew-white
Copy link
Member

@matthew-white matthew-white commented Oct 26, 2023

This change is a precursor to getodk/central#505 and getodk/central#507. On the entity detail page, we need additional information about entity versions (from the …/versions endpoint). Once we have that information, we will no longer need information from the …/diffs endpoint that the page currently requests. In other words, this PR replaces the request to …/diffs with a request to …/versions.

What has been done to verify that this works as intended?

Just making sure that tests continue to pass.

Why is this the best possible solution? Were any other approaches considered?

There's now a little more logic around the diff shown in EntityFeedEntry. For example, we can use serverDiff to determine the names of changed properties, but we also need to determine which version was the server version at the time in order to retrieve its value for each changed property. For that reason, I've moved the diff into its own component, EntityDiff. That component will get more complicated as we work on getodk/central#507.

Before submitting this PR, please make sure you have:

  • run npm run test and npm run lint and confirmed all checks still pass OR confirm CircleCI build passes
  • verified that any code or assets from external sources are properly credited in comments or that everything is internally sourced

@matthew-white matthew-white requested a review from ktuite October 26, 2023 21:57
@matthew-white matthew-white merged commit 1b1c0ce into master Oct 27, 2023
@matthew-white matthew-white deleted the versions-not-diffs branch October 27, 2023 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants