Skip to content

[Container] Create a Container v2 with the correct JSON output #1407

Open
@stefanseifert

Description

@stefanseifert

The JSON output of the Container v1 looks as follows (as it inherits from the Responsive Grid component JSON):

{
	"columnClassNames": {
		"responsiveimage_933266850": "aem-GridColumn aem-GridColumn--default--12",
		"text_1649938976": "aem-GridColumn aem-GridColumn--default--12",
		"text": "aem-GridColumn aem-GridColumn--default--12",
		"title": "aem-GridColumn aem-GridColumn--default--12"
	},
	"columnCount": 12,
	"gridClassNames": "aem-Grid aem-Grid--12 aem-Grid--default--12",
	"allowedComponents": {
		"applicable": false,
		"components": < ... ]
	},
	":items": { ... },
	":itemsOrder": [ ... ],
	":type": "myapp/components/container"
}
{code}

As some applications might rely on this JSON, we decided to:
* keep the JSON output as it is now for container v1 
* create a new version of the Container component (v2) and adapt the JSON output as follows:

**Simple Container:**
{code}
{
	"id": "container-09eae90b3e",
	"layout": "SIMPLE",
	":items": { ... },
	":itemsOrder": [ ... ],
	":type": "myapp/components/container"
}
{code}

**Responsive Container:**
{code}
{
	"id": "container-09eae90b3e",
	"layout": "RESPONSIVE_GRID",
	"columnClassNames": {
		"responsiveimage_933266850": "aem-GridColumn aem-GridColumn--default--12",
		"text_1649938976": "aem-GridColumn aem-GridColumn--default--12",
		"text": "aem-GridColumn aem-GridColumn--default--12",
		"title": "aem-GridColumn aem-GridColumn--default--12"
	},
	"columnCount": 12,
	"gridClassNames": "aem-Grid aem-Grid--12 aem-Grid--default--12",
	":items": { ... },
	":itemsOrder": [ ... >,
	":type": "myapp/components/container"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    in progressWork is underway on implementing this fix or enhancement.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions