-
Notifications
You must be signed in to change notification settings - Fork 0
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
Reorganize GeoData full record based on usability test results #185
Conversation
Pull Request Test Coverage Report for Build 8939903883Details
💛 - Coveralls |
350348d
to
2f971f0
Compare
2f971f0
to
b34ba62
Compare
app/helpers/record_helper.rb
Outdated
@@ -118,6 +118,13 @@ def source_metadata_link(links) | |||
links.select { |link| link['kind'] == 'Download' && link['text'] == 'Source Metadata' }.first['url'] | |||
end | |||
|
|||
# Geopoint is deprecated in the API, but that seems to be where all geospatial data is mapped. Including both for now. |
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.
This doesn't seem good. Are we sure this isn't just because TIMDEX UI is requesting the wrong field? TIMDEX API maps the data to both places but maybe we are requesting it from the wrong one in our query?
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.
{
search(searchterm: "rail", index: "geo") {
hits
records {
title
locations {
geoshape
geopoint
}
}
}
}
Returns data in both fields (with geopoints being deprecated). I suspect what you are seeing is a TIMDEX UI oddity unless you have examples where it is working differently than I am seeing/understanding.
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.
Gah! You're right. 🤦 I thought I'd cross-checked this in the API, but it's duplicated in both fields as expected.
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.
Yeah I think it's this that needs updating:
https://github.com/MITLibraries/timdex-ui/blob/main/app/models/timdex_record.rb#L63
I suspect we missed the "recordID" method updating when we added geo searches as we likely were focused only on searching and not full record views with that work.
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.
Do you want to roll that into this PR or do a separate one for that and land it before this? I'm good with either.
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'd like to roll it into this PR, but I'm having trouble getting the tests to not error with the regenerated cassettes. Stay tuned...
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 must have just hit a run of bad luck. The test suite started passing after I ran it a handful of times. I'm glad that erratic behavior seems to mostly be limited to our locals...
@@ -0,0 +1,5 @@ | |||
require 'test_helper' |
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.
Did you intend to add some tests here?
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.
Ha. Relic of trying to get the suite to pass, which I'm not surprised made it into a late-afternoon push. (Hypothesis was that isolating the geo record tests in their own file would help; it didn't.)
Why these changes are being introduced: Now that we've done usability testing, we have a better sense of what fields in the 'More information' section of the full record may be useful. Relevant ticket(s): * [GDT-283](https://mitlibraries.atlassian.net/browse/GDT-283) How this addresses that need: This moves each relevant field out of the 'more_info_geo' partial and into the 'record_geo' partial. The display of each field has been cleaned up a bit (e.g., removing subfield keys), and the fields are now in `p` tags or `ul` tags with their own headings. Since place names are duplicated as subjects, the locations field has been repurposed to show only geoshapes. This also required replacing the deprecated `geopoint` with `geoshape` in the TimdexRecord query string, and regenerating the record controller cassettes accordingly. Some record helper logic (and corresponding tests) that are no longer needed have also been removed. Side effects of this change: I'm not sure it's useful to display this metadata, particularly when we provide an affordance to download the source metadata and/or link to the source record. At some point, I'd like to have a broader conversation about whether we should include full records at all in TIMDEX UI. For now, I'm comfortable implementing this as requested.
2731740
to
cfddc2d
Compare
Why these changes are being introduced:
Now that we've done usability testing, we have a better sense of what fields in the 'More information' section of the full record may be useful.
Relevant ticket(s):
How this addresses that need:
This moves each relevant field out of the 'more_info_geo' partial and into the 'record_geo' partial. The display of each field has been cleaned up a bit (e.g., removing subfield keys), and the fields are now in
p
tags orul
tags with their own headings.Since place names are duplicated as subjects, the locations field has been repurposed to show only geoshapes.
Some record helper logic (and corresponding tests) that are no longer needed have also been removed.
Side effects of this change:
I'm not sure it's useful to display this metadata, particularly when we provide an affordance to download the source metadata and/or link to the source record. At some point, I'd like to have a broader conversation about whether we should include full records at all in TIMDEX UI. For now, I'm comfortable implementing this as requested.
Developer
Accessibility
New ENV
Approval beyond code review
Additional context needed to review
I haven't been able to find a record that includes all possible fields, but here's one that includes nearly all of them (missing 'alternate titles', which can be found in this record).
Code Reviewer
Code
added technical debt.
Documentation
(not just this pull request message).
Testing