neos / neos-development-collection

The unified repository containing the Neos core packages, used for Neos development.
https://www.neos.io/
GNU General Public License v3.0
260 stars 221 forks source link

Adjust `AssetUsageProjection` to use workspace instead of content stream id #5084

Open mhsdesign opened 4 months ago

mhsdesign commented 4 months ago

The AssetUsage needs to switch from contentStreamId to WorkspaceName from Projection until all depending DTOs.

With https://github.com/neos/neos-development-collection/pull/5002 we have access to the WorkspaceName in the projections instead of only the ContentStreamId.

That means we can adjust the write side + read side. And the chain down to the AssetUsageReference incl. AssetUsageFilter. To use workspace names.

final readonly class AssetUsageNodeAddress
{
    public function __construct(
-       public ContentStreamId $contentStreamId,
+       public WorkspaceName $workspaceName,
        public DimensionSpacePoint $dimensionSpacePoint,
        public NodeAggregateId $nodeAggregateId,
    ) {
    }
}

... as well as the AssetUsage class.

Should fix the following todos and problematic usages of the contentStreamId: