Closed akramsarkis closed 1 year ago
When declaring a static section type, the body should contain information about the fields that will be used inside this section type (https://api.sections-saas.k8s-dev.geeks.solutions/docs/frontend/index.html#creates-a-static-section-type) the image type is important as this is what the backend relies to correctly bind
Currently on a sections project we have a simple field that holds the section type name. So I didn't get this point and regarding this part the body should contain information about the fields that will be used inside this section type
, there is no way for a user to know exactly what fields He is going to use in inside a section because most of the time these fields change
When adding a section into a page, the options field can't be a json string but it should be a list of json objects and the image field should be at the root of one of the object in the list. I made an update on the backend for the image field to be a list (so multiple images in one field), but now with the version that is on the test env. only a single image is supported (so the image field should contain only one image).
Isn't it already the case for the options field ? Because adding a section into a page is still working
The image field only need to carry a media_id key with the media id value, any other value will be replaced by the file url of the media coming from the DB.
What image field are we talking about exactly ? In the example there is images
field and it is carrying the filename, url and media_id. The only thing that a section on a page cares about is actually the url and nothing else (previously the media_id was also saved in order to delete a current media from AWS when editing the image with a new one). But now the delete management will be on the Media Meta components. So removing an image used in a section should only send an empty url: "" field in order to unlink the media used or update the url: "" field with the media selected from the Media Meta component.
@jfayad We really need to groom this issue to elaborate more on it and to perform the only updates needed
@akramsarkis For this issue you will have to test:
Creating a new static section type with fields Check the network console when creating, it should match the payload you use when you tested it through postman
Media linked to a content when creating it
Media unlinked from content when removing it and not deleted from medias You will have to monitor these changes on sections BO medias page
Media updated with the new media id and url
Note: For this test I have prepared a new section type that you can add on sections website Home page. It is called TitleTextMediaLinkContent
and it has media
as a field name.
Below are the threads related to the problems I have found while working on this issue:
https://mattermost.gl.eweev.com/eweev/pl/idficn1bgtbqfxepz6h1nz869c
https://mattermost.gl.eweev.com/eweev/pl/n7nn7xp5o3bybg74fkce87gico
options
field can't be a json string but it should be a list of json objects and the image field should be at the root of one of the object in the list. I made an update on the backend for the image field to be a list (so multiple images in one field), but now with the version that is on the test env. only a single image is supported (so the image field should contain only one image).media_id
key with the media id value, any other value will be replaced by the file url of the media coming from the DB.Example
here is an example with the field
images
declared as an image field in the static section type and containing a list of images: Request bodywill return the following reponse: