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

Valkyrie: Blank metadata properties should not display on the show page #771

Open
3 of 5 tasks
KatharineV opened this issue Aug 21, 2024 · 6 comments
Open
3 of 5 tasks

Comments

@KatharineV
Copy link
Collaborator

KatharineV commented Aug 21, 2024

Summary

I imported 3 books from OAI set adl:book, and when I opened the edit page on one and resaved it, the work page now shows a bunch of blank metadata fields that I didn't modify. These fields were and remain blank. Yet after edit/save, they now display on the public facing work page.

https://adl.s2.adventistdigitallibrary.org/concern/published_works/20121738_the_vatican_and_the_war_a_retrospect_and_forecast_being_a_review?locale=en

The fields are:

  • Date issued
  • Publication date
  • Publication status
  • Issue
  • Date submitted
  • Date accepted
  • Date available

The author field displays on work pages even when it is blank in the metadata. See and compare example work: On Staging https://adl.s2.adventistdigitallibrary.org/concern/published_works/20000076_mizpah?locale=en and On Production https://adl.b2.adventistdigitallibrary.org/concern/published_works/20000076_mizpah (note this was an existing work, not a new work)

Acceptance Criteria

  • If fields are blank they do not display
    • work show page
    • collection show page

Testing Instructions

Testing note: the staging site was partially reindexed resulting in most existing records being updated but not all. Our assumption is that the cut over will handle the update of all works in production. Creating new works (or collections) should pass QA.

PLEASE NOTE, if you still see blank fields the work needs to be reindexed. Until we perform a full reindex on the entire system, you can trigger it manually. Edit and save the work or collection without making changes.

  • Create a work with only the required metadata. Visit its show page. Blank metadata properties should not be displayed.
  • Create a collection with only the required metadata. Visit its show page. Blank metadata properties should not be displayed.

Notes

  • If a record does not have a author (creator) the field will have ["0~"] due to an older version of the order_already gem.
  • The newest version of the gem handles this issue. The gem version was updated in Hyku and in the submodule of this application.
  • However, existing records in ADL with ["0~"] will not register the author (creator) field as blank and therefore do not display or sort properly.
  • To fix this problem, all records with ["0~"] in the creator field need to be updated. This can be done with the following script:
concerns = Hyrax.config.curation_concerns.map{ |c| "#{c}Resource".safe_constantize } << CollectionResource

concerns.each do |concern|
  works = Hyrax.query_service.find_all_of_model(model: concern)
  works.each do |work|
    next unless work['creator'] == ["0~"]
    work.creator = []
    work.save
  end
end
@KatharineV KatharineV converted this from a draft issue Aug 21, 2024
@KatharineV
Copy link
Collaborator Author

Today I created one of every work type through the UI. I uploaded PDFs to every type. One one work, I uploaded a folder (compound work). I only entered the required metadata of title and rights. Here is what I'm seeing that I don't expect:

@ShanaLMoore ShanaLMoore added the M1 Milestone 1 label Sep 3, 2024
@ShanaLMoore ShanaLMoore changed the title Valkyrie: Issues with new works Valkyrie: Blank metadata properties should not display on the show page Sep 4, 2024
@sjproctor sjproctor self-assigned this Sep 9, 2024
@sjproctor sjproctor moved this from Ready for Development to In Development in Adventist Knapsack Sep 10, 2024
sjproctor added a commit that referenced this issue Sep 12, 2024
This commit is a temporary solution to prevent blank metadata fields
from rendering. There is a bigger issue of why some fields are being
assigned values of `[""]` but this commit solves the current issue.

Ref:
- #771
@sjproctor
Copy link
Contributor

We created a solution for this problem but there is more to be done in the future: #807

@sjproctor sjproctor moved this from In Development to Code Review in Adventist Knapsack Sep 12, 2024
ShanaLMoore pushed a commit that referenced this issue Sep 13, 2024
# Story

This commit is a temporary solution to prevent blank metadata fields
from rendering. There is a bigger issue of why some fields are being
assigned values of `[""]` but this commit solves the current issue.

Ref:
- #771

# Expected Behavior Before Changes

Some metadata fields that did not have content were rending on the
works.

# Expected Behavior After Changes

Only metadata fields that have content will render.

# Screenshots / Video

Before:  

![image](https://github.com/user-attachments/assets/fd544dc2-9a0c-4dd6-b4f5-0b40f8d6aa5d)

After:  
<img width="1220" alt="Screenshot 2024-09-12 at 3 55 31 PM"
src="https://github.com/user-attachments/assets/703b9082-fe6a-44e9-85c8-b4db8f96c74e">

# Notes

This is a temporary solution to solve the current needs of the client.
@sjproctor sjproctor moved this from Code Review to Deploy to Staging in Adventist Knapsack Sep 13, 2024
@jillpe jillpe moved this from Deploy to Staging to SoftServ QA in Adventist Knapsack Sep 16, 2024
@ShanaLMoore
Copy link

ShanaLMoore commented Sep 17, 2024

QA RESULTS: ❌ NEEDS REWORK

tested on STAGING

I created a conference item and filled in only the required fields.

image

I created a collection and filled in only the required fields.

image

@ShanaLMoore ShanaLMoore added the needs rework issue needs additional work label Sep 17, 2024
@ShanaLMoore ShanaLMoore moved this from SoftServ QA to Ready for Development in Adventist Knapsack Sep 17, 2024
sjproctor added a commit that referenced this issue Sep 19, 2024
This commit modifies the metadata yaml files for collections and all
work types removing the 'm' from solr index keys for values that
contain `multiple: false`.

This fixes the issue of rendering blank metadata fields for all items
except author (creator). It does not fix the underlying issue of fields
being assigned `[""]` when they should be `[]`.

Ref:
- #771
@sjproctor sjproctor moved this from Ready for Development to In Development in Adventist Knapsack Sep 19, 2024
sjproctor added a commit to samvera/hyku that referenced this issue Sep 19, 2024
This commit updates the version of the order-already gem to 0.3.2. This
version of the gem handles blank values preventing blank fields from
being assigned `[""]` instead of `[]`.

Ref:
- notch8/adventist_knapsack#771
@ShanaLMoore ShanaLMoore moved this from In Development to Code Review in Adventist Knapsack Sep 19, 2024
sjproctor added a commit to samvera/hyku that referenced this issue Sep 19, 2024
This commit updates the version of the order-already gem to 0.3.2. This
version of the gem handles blank values preventing blank fields from
being assigned `[""]` instead of `[]`.

Ref:
- notch8/adventist_knapsack#771
@ShanaLMoore ShanaLMoore removed the needs rework issue needs additional work label Sep 19, 2024
sjproctor added a commit that referenced this issue Sep 19, 2024
This commit reverts the temporary fix of managing blank fields that
persist as an emptry string in an array `[""]` due to a better
solution being found.

Ref:
- #771
sjproctor added a commit that referenced this issue Sep 19, 2024
Updates Hyku main to include the most recent version of the
order_already gem.

Ref:
- samvera/hyku#2334
- #771
sjproctor added a commit that referenced this issue Sep 20, 2024
# Story

Blank metadata properties should not display on the show page for
collections or works.

Refs
- #771

# Expected Behavior Before Changes

Some metadata fields that did not have content were rending on the
catalog page, the works show page, and the collection show page.

# Expected Behavior After Changes

Only metadata fields that have content will render.

# Screenshots / Video
- Catalog page
<img width="1557" alt="Screenshot 2024-09-19 at 3 48 12 PM"
src="https://github.com/user-attachments/assets/9311be82-a08b-4b95-9b4e-0ae5674e317d">
- Works show page

![image](https://github.com/user-attachments/assets/061445ba-aced-4da7-8ff0-71b5c93a6da3)
- Collection show page

![image](https://github.com/user-attachments/assets/100b9c65-7f16-4c8b-84bd-c93b5a76b49f)
@sjproctor sjproctor moved this from Code Review to Deploy to Staging in Adventist Knapsack Sep 20, 2024
@ShanaLMoore ShanaLMoore moved this from Deploy to Staging to SoftServ QA in Adventist Knapsack Sep 20, 2024
@ShanaLMoore ShanaLMoore added the blocked other work must be completed first label Sep 20, 2024
@sjproctor sjproctor moved this from SoftServ QA to In Development in Adventist Knapsack Sep 20, 2024
@ShanaLMoore ShanaLMoore removed the blocked other work must be completed first label Sep 20, 2024
@sjproctor sjproctor moved this from In Development to Deploy to Staging in Adventist Knapsack Sep 24, 2024
@sjproctor sjproctor moved this from Deploy to Staging to SoftServ QA in Adventist Knapsack Sep 25, 2024
@ShanaLMoore
Copy link

ShanaLMoore commented Sep 25, 2024

QA Results: ✅ PASS

PLEASE NOTE, if you still see blank fields on pre-existing works, it needs to be reindexed. Until we perform a full reindex on the entire system, you can trigger it manually. Edit and save the work or collection without making changes.

WORK ✅ PASS

Test on STAGING

I filled in only the required fields (title and rights statement):

Image

Image

  • Create a work with only the required metadata. Visit its show page. Blank metadata properties should not be displayed.

COLLECTION ✅ PASS

Tested on STAGING

I filled in only the required field (title):

Image

Image

public view

Image

  • Create a collection with only the required metadata. Visit its show page. Blank metadata properties should not be displayed.

@ShanaLMoore ShanaLMoore moved this from SoftServ QA to Client QA in Adventist Knapsack Sep 25, 2024
@sjproctor
Copy link
Contributor

concerns = Hyrax.config.curation_concerns.map{ |c| "#{c}Resource".safe_constantize } << CollectionResource

concerns.each do |concern|
  works = Hyrax.query_service.find_all_of_model(model: concern)
  works.each do |work|
    next unless work.singleton_class.name.nil?
    next unless work.creator.last.blank?
    next if work.id == 'c7019db2-067c-403c-95b0-11c06715d5ca'
    array = work.creator
    array.pop
    work.creator = array
    work.save
  end
end

@KatharineV
Copy link
Collaborator Author

Tested a new work on staging, and only added metadata to three fields. No blank fields are showing. https://adl.s2.adventistdigitallibrary.org/concern/generic_works/600641e8-8cc7-453c-a12d-c0ad34a027cf

Tested a new collection as well, and it also works as expected. Two fields have metadata, and two fields show. https://adl.s2.adventistdigitallibrary.org/collections/ed64bf09-7142-4251-9abe-698cc6568a10?locale=en

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Deploy to Production
Development

No branches or pull requests

4 participants