CDLUC3 / dmsp_aws_prototype

Sceptre CloudFormation templates for DMPHub v2
MIT License
1 stars 0 forks source link

Hide "License for reuse:" info from Landing Page when there is no valid data #154

Closed jupiter007 closed 3 days ago

jupiter007 commented 6 days ago

Fixed: #579

As explained in ticket #579, the "License for reuse:" field label shows under the "Planned outputs" section of the landing page even when there is no available data for it. As requested, an update was made to hide this field if there is no data.

The problem was that the existing code that defines the "licenses" array was looping through a "distributions" array to map each object in the array to its "license" property. But if there was no "license" property, it would add "undefined" to the array. So the "License for reuse:" field was being displayed when we had an array like this[undefined].

I updated the code that defines "licenses" by filtering out the "undefined" values.

When I ran locally, I used this url to check that the "License for reuse:" field no longer displayed: http://localhost:3000/dmps/10.48321/D136BA4701

This comes from the https://dmphub.uc3dev.cdlib.net/dmps/10.48321/D136BA4701 dev environment

I also did a check locally to make sure that the "License for reuse:" field still displays when there is a valid "license" property using this url: http://localhost:3000/dmps/10.48321/D12K5B