Skip to content

imaginoCDP/external-display-conditions

Repository files navigation

External Display Conditions Extension to reproduce issues here

Setup and Install Dependencies

  1. Clone the repository.
  2. Copy .env.sample to .env and fill in your values:
  3. Install Dependencies
npm install
npm run dev

Issue 1: the editor can't load conditions 'extraData' from existing template

When loading the editor for the first time, the editor will be loaded with the default template.json. This template contains an existing condition with extraData. When opening the console, we can see that the extraData is empty.

Screenshot 2025-11-04 at 16 22 13

Issue 2: the editor is ignoring the initial template (maybe it is related to issue 1)

STR:

  1. Stop the app if it is running.

    a. Change the emailId passed to the editor in creds.js. Let's call it "emailIdToto"

    b. Change the port in vite.config.js (ex: 5002) and run npm run dev again.

Content loaded correctly

Screenshot 2025-11-04 at 16 44 21

 

  1. Update the editor content. Ex: We add a button "Will be Saved to Local Storage". Click save button (it will get the current editor template and save it to localStorage)
Screenshot 2025-11-04 at 16 45 18

 

  1. Reload the page. we pass the template loaded from localStorage (the one we save above) to the editor. But the editor keeps showing the initial template (maybe it retrieves it from stripo reference database).
Screenshot 2025-11-04 at 16 48 51

 

When we log the console, we notice that the template passed to the editor is the one from the localStorage (the one with button "Will be Saved to Local Storage"). Alright. But it is not the one loaded in the editor as you can see it above

Screenshot 2025-11-04 at 17 01 18 Screenshot 2025-11-04 at 17 02 46 Screenshot 2025-11-04 at 17 04 07

 

  1. Try to update manually the template in onTemplateLoaded options by using StripoEditorApi.actionsApi.updateHtmlAndCss
Screenshot 2025-11-04 at 17 10 31

 

  1. Reload the page. The editor first load the wrong template, then update it with the correct template, after onTemplateLoaded
Screenshot 2025-11-04 at 17 12 22

 

Expected behavior: the template we pass to the editor must be the one loaded, even if we use the same emailId to load different templates

About

Stripo external-display-conditions sample

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published