Skip to content

Conversation

jazairi
Copy link
Contributor

@jazairi jazairi commented Mar 15, 2024

Why these changes are being introduced:

The GeoData app has specific design requirements for the record view.

Relevant ticket(s):

How this addresses that need:

This adds a record_geo partial that includes metadata specific to GDT records, such as locations and a metadata download link. It also changes where the access_button partial is displayed depending on screen width, and it adds a 'back' button to the top of the record if url_for(:back) resembles a search results page.

Side effects of this change:

  • Some of the changes introduced in GDT-130 have been overwritten by this commit, as certain styles and markup are shared by both views. Specifically, the geo_data_info and _authors partials have been moved to the shared directory, and a new shared SCSS partial contains styles used in result and `record.
  • Several helper methods have been added to parse the metadata needed for the record view.

Developer

  • All new ENV is documented in README
  • All new ENV has been added to Heroku Pipeline, Staging and Prod
  • ANDI or Wave has been run in accordance to
    our guide and
    all issues introduced by these changes have been resolved or opened as new
    issues (link to those issues in the Pull Request details above)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer

  • The commit message is clear and follows our guidelines
    (not just this pull request message)
  • There are appropriate tests covering any new functionality
  • The documentation has been updated or is unnecessary
  • The changes have been verified
  • New dependencies are appropriate or there were no changes

Requires database migrations?

NO

Includes new or updated dependencies?

NO

@mitlib mitlib temporarily deployed to timdex-ui-pi-gdt-131-re-fa3jlb March 15, 2024 17:05 Inactive
@jazairi jazairi temporarily deployed to timdex-ui-pi-gdt-131-re-fa3jlb March 15, 2024 17:06 Inactive
@coveralls
Copy link

coveralls commented Mar 15, 2024

Pull Request Test Coverage Report for Build 8302069999

Details

  • 27 of 27 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.3%) to 98.872%

Files with Coverage Reduction New Missed Lines %
app/helpers/record_helper.rb 2 96.81%
Totals Coverage Status
Change from base Build 8299183936: -0.3%
Covered Lines: 526
Relevant Lines: 532

💛 - Coveralls

@JPrevost JPrevost self-assigned this Mar 15, 2024
def coverage_date(dates)
return if dates.blank? || dates&.none? { |date| date['kind'] == 'Coverage' }

# If there is more than one coverage date, take the first one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the behavior we want. I feel we should display multiple dates in this situation, either as comma separate or as a bulleted list.

Copy link
Contributor Author

@jazairi jazairi Mar 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if I told you this is common?

[{"kind"=>"Coverage", "note"=>nil, "range"=>nil, "value"=>"2020"}, {"kind"=>"Coverage", "note"=>nil, "range"=>{"gte"=>"2020", "lte"=>"2020"}, "value"=>nil}]

(Half)-kidding aside, I think it's a good idea to include all of them.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat. I think this is a good example we may need to bring to DataEng and/or UX to decide if we want to change the data mappings/better understand the data mappings/better understand what we want to do on the UI side.

For now, if you want to build in duplicate detection logic in the UI I could get behind it. I'm reluctant to just assume all dates are duplicate (without more insight from DataEng as to how these mappings are created at least).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I generally don't like putting that kind of logic in UI, but it seems like a reasonable solution in this case.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like it's still worth a convo between EngX/DataEng at some point to help us better understand all the assumptions about dates. But for now this looks good to me.

def issued_date(dates)
return if dates.blank? || dates&.none? { |date| date['kind'] == 'Issued' }

# If there is more than one date issued, take the first one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is the behavior we want. I feel we should display multiple dates in this situation, either as comma separate or as a bulleted list.

@@ -0,0 +1,3 @@
<% if url_for(:back)&.starts_with?([root_url, 'results'].join('')) %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice.

@@ -0,0 +1,14 @@
<ul class="list-inline">
<li><%= metadata['contentType']&.each { |type| type['value'] }&.join(' ; ') %></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noted this in slack, but I think the css rules need to be updated for these <li> tags to include something like:

vertical-align: top;

to address weird alignment issues.

Copy link
Member

@JPrevost JPrevost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we've heard otherwise that we want to silently drop multiple dates, I think we should update the logic to display the multiple values.

I have a suggestion on how to handle the weird alignment issues we can see in Safari we should either include in this or open as a ticket in the backlog so it doesn't keep popping up.

@jazairi jazairi temporarily deployed to timdex-ui-pi-gdt-131-re-fa3jlb March 15, 2024 19:55 Inactive
@jazairi jazairi temporarily deployed to timdex-ui-pi-gdt-131-re-fa3jlb March 15, 2024 19:58 Inactive
@jazairi jazairi requested a review from JPrevost March 15, 2024 20:00
Why these changes are being introduced:

The GeoData app has specific design requirements for the record
view.

Relevant ticket(s):

* [GDT-131](https://mitlibraries.atlassian.net/browse/GDT-131)
* [GDT-130](https://mitlibraries.atlassian.net/browse/GDT-130)

How this addresses that need:

This adds a `record_geo` partial that includes metadata specific to
GDT records, such as locations and a metadata download link. It
also changes where the `access_button` partial is displayed
depending on screen width, and it adds a 'back' button to the top
of the record if `url_for(:back)` resembles a search results page.

Side effects of this change:

* Some of the changes introduced in GDT-130  have been overwritten
by this commit, as certain styles and markup are shared by both views.
Specifically, the `geo_data_info` and `_authors` partials have been
moved to the shared directory, and a new `shared` SCSS partial
contains styles used in `result` and `record`.
* Several helper methods have been added to parse the metadata needed
for the record view.
@jazairi jazairi temporarily deployed to timdex-ui-pi-gdt-131-re-fa3jlb March 15, 2024 20:40 Inactive
@jazairi jazairi merged commit b0885ec into main Mar 15, 2024
@jazairi jazairi deleted the gdt-131-record branch March 15, 2024 20:44
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.

4 participants