usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
11 stars 10 forks source link

LPS: Fix blank link to "described in" article at top #216

Closed RayPlante closed 2 years ago

RayPlante commented 2 years ago

This PR fixes a bug in rendering at the top of the landing page a reference to a key article that describes the data. When a references is marked with the either refType of DocumentedBy or IsSupplementTo, the reference will appear as a link at the top of landing page underneath the identifier. With this bug, the link text is often blank. This is because, the code looks for a label property for the reference to use as the text, and this value is not getting set by default in the publishing workflow. This PR fixes this by setting a backup label for the reference: the values of (in order of preference) title, citation, or location.

This has been deployed to oardev. Compare https://data.nist.gov/od/id/mds2-2409 with https://oardev.nist.gov/od/id/mds2-2409.

chuanlin2018 commented 2 years ago

Where was class "describedin" defined? I couldn't find it...

RayPlante commented 2 years ago

Nowhere; I just added it so that it would be easier to access that div element in the unit test.

chuanlin2018 commented 2 years ago

I see :)

chuanlin2018 commented 2 years ago

Test failed. Should I go ahead merge?

RayPlante commented 2 years ago

there's something funny going on with the tests. Let me see if I can get it fixed. If I do, I'll go ahead and merge it.

chuanlin2018 commented 2 years ago

Ok.