Uploaded image for project: 'Addon Channel Manager'
  1. Addon Channel Manager
  2. CHANNELMGR-1705

[SPA++] Public JS API Support for SPA to parse page and render components

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3.0
    • Labels:
      None
    • Similar issues:
    • Processed by team:
      R2D2

      Description

      Goal: get the SPA demos to work as-is, but without cms-js-overrides.js.

      Idea:

      • the SPA defines window.SPA:
      window.SPA = {
        init: (cms) => {
           ...
        }
        renderComponent: () => {
           ...
        }
      } 
      • SPA waits until Channel Manager calls window.SPA.init()
      • Channel Manager calls window.SPA.init() with a single argument: a JavaScript object with the JavaScript CMS API:
      {
        createOverlay();
        syncOverlay()
      }
      • SPA adds HTML comments from the backend model to the DOM
      • SPA calls cms.createOverlay()
      • the SPA can optionally call cms.syncOverlay() to sync the overlay positions, if needed.
      • Channel Manager calls window.SPA.renderComponent whenever the SPA needs to re-render a component
      • When a user adds a component to a container, the Channel Manager reloads the whole page automatically when window.SPA is present so the whole SPA reinitializes and eventually calls cms.createOverlay() again with the updated containers. Same for deleting and moving a component.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              wko Woonsan Ko
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: