Details

      Description

      Create app/processors/LinkProcessor.js to process editables of type Link, a module that exports the following functions:

      createEditor(
        element: HTMLElement,
        onChange: (value: string) => void,
        onDestroy: () => void,
        config: Object (portletNamespace, urls, etc…)
      ):
        - initializes the processor editor for the given element
        - calls onChange when the value has changed
        - Calls onDestroy when the editor is internally destroyed for any reason (example: ImageSelector is closed)

      destroyEditor(element: HTMLElement):
        - destroys existing editable processor if any

      render(element: HTMLElement, value: string|object) => void
        - Receives the editable HTMLElement and the value that should be rendered (already translated, segmented, etc) and mutates the editable element to show this value.
        - Value may be a string (example: text editables) or an object (example: images with url and alt text). This value depends on the editable type.

      Taking into account that:

      • There is always only one enabled Editable processor editor, so it is safe to use variables to save instances and other stuff (example)
      • We must copy/reuse everything we can from existing processors
      • Processor methods (at least "render" method) should be tested

      Then, reexport it from app/processors/index.js and check if it works:

      `export { default as link } from './LinkProcessor';`

        Attachments

          Activity

            People

            Assignee:
            brian.chan Brian Chan
            Reporter:
            julien.castelain Julien Castelain
            Engineering Assignee:
            SE Support
            Recent user:
            Marta Elicegui
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.3.0 CE GA1
                Master