Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface UIExtension

Hierarchy

Index

Properties

extension

extension: { fieldTypes: FieldType[]; name: string; parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }; sidebar?: undefined | false | true; src?: undefined | string; srcdoc?: undefined | string }

Type declaration

  • fieldTypes: FieldType[]

    Field types where an extension can be used

  • name: string

    Extension name

  • Optional parameters?: undefined | { installation?: ParameterDefinition[]; instance?: ParameterDefinition[] }

    Parameter definitions

  • Optional sidebar?: undefined | false | true

    Controls the location of the extension. If true it will be rendered on the sidebar instead of replacing the field's editing control

  • Optional src?: undefined | string

    URL where the root HTML document of the extension can be found

  • Optional srcdoc?: undefined | string

    String representation of the extension (e.g. inline HTML code)

Optional parameters

parameters: DefinedParameters

Values for installation parameters

sys

Methods

delete

  • delete(): Promise<void>
  • Deletes this object on the server.

    example
    const contentful = require('contentful-management')
    
    const client = contentful.createClient({
      accessToken: '<content_management_api_key>'
    })
    
    client.getSpace('<space_id>')
    .then((space) => space.getEnvironment('<environment_id>'))
    .then((environment) => environment.getUiExtension('<ui_extension_id>'))
    .then((uiExtension) => uiExtension.delete())
    .then(() => console.log(`UI Extension deleted.`))
    .catch(console.error)

    Returns Promise<void>

    Promise for the deletion. It contains no data, but the Promise error case should be handled.

toPlainObject

update

  • Sends an update to the server with any changes made to the object's properties

    example
    const contentful = require('contentful-management')
    
    const client = contentful.createClient({
      accessToken: '<content_management_api_key>'
    })
    
    client.getSpace('<space_id>')
    .then((space) => space.getEnvironment('<environment_id>'))
    .then((environment) => environment.getUiExtension('<ui_extension_id>'))
    .then((uiExtension) => {
      uiExtension.extension.name = 'New UI Extension name'
      return uiExtension.update()
    })
    .then((uiExtension) => console.log(`UI Extension ${uiExtension.sys.id} updated.`))
    .catch(console.error)

    Returns Promise<UIExtension>

    Object returned from the server with updated changes.