pimcore / studio-backend-bundle

Studio Backend bundle
Other
10 stars 1 forks source link

[Asset update] Adapt frontend to use correct payload and endpoints #260

Open vin0401 opened 2 months ago

vin0401 commented 2 months ago

Description:

When an update is sent to the asset update endpoint, not all values are updated correctly.

Reproduction:

Example request payload:

{"data":{"properties":[{"key":"My predefined property","type":"text","data":"test test","inherited":false,"inheritable":false,"additionalAttributes":[],"config":"","description":"tes test","predefinedName":"My predefined property"}]}}

Current behavior:

The predefined property is automatically converted to a custom property. Also it seems like that the description is not saved. When I look at the schema definition, there are also the properties for description and predefinedName missing:

image

Expected behavior:

All values are updated correctly. The schema documentation is showing all required fields for the update.

mattamon commented 1 month ago

Current behavior is like the following:

Update asset properties works different than updating the list of properties or a predefined property itself.

For the asset -> the key that is sent in the data is matched with the predefined properties in the background. If the key is found in the predefined properties, the name will be set accordingly. If the key is not found it will get the name "Custom".

The main difference lies in the schemas:

The example request payload does not work with the Asset Update endpoint since it resembles more the UpdatePredefineProperty Schema instead of the UpdateDataProperty.

Currently though it is not possible to update the description of Custom Properties. Maybe we should think about it and then add it to the UpdateDataProperty Schema and asset update endpoint.