Elements and Configuration

Declaration of Elements and Configuration (sections, subsections, custom fields, etc) is adopted by Packages.

This document deliberately generalises and assumes that Elements and Configuration are objects of a similar nature and are therefore handled similarly.

How configuration is defined?

It is similar to how app spec defines custom fields at the moment.

A package defines a nested structure of:

  • Sections

    • Fields 

    • Subsections

      • Fields

Note that "orphan" Fields are not allowed, i.e. when declaring configuration, package always declares a Section and places Field there or into a nested Subsection. Package might declare multiple Sections.

Each object above (Section, Subsection, Field) includes an integer order parameter, which informs UI ordering in Studio when merging configuration defined by different packages.

Each Section object includes placement and scope parameters (see details below) to declare where the configuration will be used.

How Elements are defined?

A package defines an array of Element objects with a structure following the current app spec structure.

Each Element object includes an integer order parameter, which informs UI ordering in Studio when merging Elements defined by different packages.

Each Element object includes scope parameter (see details below).

Placement

When defining a configuration Section, a package specifies where it should be placed in the Studio UI. List of allowed placements is:

  • Space -- configuration will be added to Space Settings
  • Integration / Feature -- configuration will be added to Integration or Feature Settings
  • Project -- configuration will be added to Project Settings (aka App Settings, aka App Setup)
  • Event -- configuration will be added to Event Settings
  • Element -- configuration will be added to Element Settings
{
   "placement": "project"
}

For Element placements, an additional parameter may be added, specifying media types of Elements the configuration Section will be added to.

{
  "placement": "element",
  "placement_element_types": ["trivia"]
}

Elements can only be placed in a Project, so placement parameter is not required for them.

Scope

Declaration of a configuration Section placed in a Integration, Feature, Project, Event or Element, as well as declaration of an Element need to declare its scope as:

  • All -- will become available to all placements in the Space.
  • [предок] -- will become available only to placements declared by a [предок] package
  • Parent -- will become available only to placements declared by an immediate parent package.
  • This -- will become available only to placements declared by the same package.

 

This article was updated on