When a space contains a list with entities of a space that is not published, the entities still show up, but as ‘emtpy’. This is unexpected behavior and confusing.
An option would be to publish the space with the related entities also, but then that complete space with all entities is published next to the first space, which is the ‘all or nothing’ publishing behavior that is often not wanted.
A workaround would be for the same entity type (database) to split it up in two different databases and place one in a published space. The drawback of that is that the content is separate, which is not desireable for ongoing development in the team or organization. For each publication the content would need to be converted to the other space database.
Apart from that, in the case of departments and teams, structurally everything needs to be duplicated to be able to be published.
What would make sense, is to automatically publish related entities if the space with the relations is published, or to publish content of a database based on rules (e.g. of entity part of a shared space, allow publishing).
Furthermore, its useful to allow the publishing to be configurable, what spaces are included and which not (Publishing workspace views that have their own URL with a selection of spaces or entity views)