Layout Api

API exposed that can be used to help parse and manipulate a given layoutData. These functions are available under the `convenienceApi.layout` namespace.

Methods

removeFieldFromLayout(layoutData, id)Object | null
Removes a given field by id from the layout
getFields(layoutData)Array.<Object>
Extracts all fields from a layout, returning them in a flattened list.
getItemLists(layoutData)Array.<Object>
Extracts all item lists from a layout, returning them in a flattened list.
getCustomTexts(layoutData)Array.<Object>
Extracts all static texts from a layout, returning them in a flattened list.
getCategories(layoutData)Array.<Object>
Extracts all categories from a layout, returning them in a flattened list.

Properties Details

removeFieldFromLayout(layoutData, id) ⇒ Object | null

Removes a given field by id from the layout

Returns: Object | null - Field that was removed or null if nothing was removed

Param Type Description
layoutData Object The layout data
id String The field id

getFields(layoutData) ⇒ Array.<Object>

Extracts all fields from a layout, returning them in a flattened list.

Returns: Array.<Object> - Flat list of fields from a layout.

Param Type Description
layoutData Array.<Object> List with layout data.

getItemLists(layoutData) ⇒ Array.<Object>

Extracts all item lists from a layout, returning them in a flattened list.

Returns: Array.<Object> - Flat list of item lists from a layout.

Param Type Description
layoutData Array.<Object> List with layout data.

getCustomTexts(layoutData) ⇒ Array.<Object>

Extracts all static texts from a layout, returning them in a flattened list.

Returns: Array.<Object> - Flat list of static texts from a layout.

Param Type Description
layoutData Array.<Object> List with layout data.

getCategories(layoutData) ⇒ Array.<Object>

Extracts all categories from a layout, returning them in a flattened list.

Returns: Array.<Object> - Flat list of categories from a layout.

Param Type Description
layoutData Array.<Object> List with layout data.