openeuropa / bootstrap-component-library

Openeuropa Bootstrap Component Library
https://oelibrary.netlify.app/
MIT License
15 stars 9 forks source link

BCL - User compact : Empty info output empty markup #431

Closed msnassar closed 2 years ago

msnassar commented 2 years ago

In user-compact.html.twig, when info is empty, we get empty markup: <span class="text-muted text-nowrap me-4-5"></span>

We have locally patched it with:

        {% if info is not empty %}
          <span class="text-muted text-nowrap{{ loop.last ? '' :' me-4-5'}}">{{ info }}</span>
        {% endif %}
planctus commented 2 years ago

Thanks for reporting this, @msnassar, we will apply a condition, but on the infos parameter so that we don't even create the wrapper if it's empty.. ;)

msnassar commented 2 years ago

@planctus Thanks for quick reply, you are right. However I think it should be applied to both, the infos and each info. Our use case, infos has items but some of the items should not be accessible by some user (null/empty)... When an item is not accessible by a user, the item is exists but empty.

planctus commented 2 years ago

interesting information, so you can have empty items in an array..too bad :) Ok, will add the check also for the single item, then..