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.
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
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