pimcore / studio-ui-bundle

Studio UI bundle
Other
14 stars 6 forks source link

Custom Metadata (Community) #152

Closed fashxp closed 2 months ago

fashxp commented 6 months ago

see https://github.com/pimcore/product-management/issues/377

https://www.figma.com/design/M5yXJeMQXI3HTdJldJWqCb/-Light-Theme--Complete-Templates?node-id=91-134928&m=dev

image

Allow detaching

markus-moser commented 6 months ago

API requirements

Metadata Listing

We need a API which is able to deliver the asset metadata for a single asset. This could be either done in the asset detail API or with a separate (sub-) endpoint.

For this case we need to load the metadata attributes directly from the database (asset model) and not from the generic data index.

In the result metadata list we need the following attributes:

The JSON could look similar to the classic UI bundle representation: image

https://demo.pimcore.com/admin/asset/get-data-by-id?_dc=1712331531822&id=68&type=image

In the classic UI this method is used for generating the JSON content:

https://github.com/pimcore/pimcore/blob/4c3fae05f3f6d692ab493872388c2030f3ffb997/models/Asset/Service.php#L411

We should not use this directly in my opinion, but we could take a look at it how it's implemented there.

Updating Metadata

Another aspect is that we need to provide the possiblity to save the custom metadata list after save. This should be integrated in the regular asset (patch) update call. The full updated list ist sent there. Therefore there are no separate endpoints for updating or deleting a single asset metadata entry of an asset needed.