From 705e346300f1d7861adfdb075efffc532f38f4d6 Mon Sep 17 00:00:00 2001 From: Chris Millar Date: Mon, 27 Jan 2025 23:15:00 -0700 Subject: [PATCH] Remove org and site from custom editor --- blocks/browse/da-browse/da-browse.js | 1 + blocks/browse/shared.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/blocks/browse/da-browse/da-browse.js b/blocks/browse/da-browse/da-browse.js index e197a13f..0055fd5a 100644 --- a/blocks/browse/da-browse/da-browse.js +++ b/blocks/browse/da-browse/da-browse.js @@ -77,6 +77,7 @@ export default class DaBrowse extends LitElement { // Sort by length in descending order (longest first) const matchedConf = matchedConfs.sort((a, b) => b.length - a.length)[0]; + console.log(matchedConf); return matchedConf.split('=')[1]; } diff --git a/blocks/browse/shared.js b/blocks/browse/shared.js index 8cc64d2b..da89611e 100644 --- a/blocks/browse/shared.js +++ b/blocks/browse/shared.js @@ -2,6 +2,12 @@ export default function getEditPath({ path, ext, editor }) { if (ext === 'html' || ext === 'json') { const route = ext === 'html' ? editor : '/sheet#'; const lastIndex = path.lastIndexOf(`.${ext}`); + + if (route.includes('experience.adobe.com')) { + console.log(`${route}/${path.substring(0, lastIndex).split('/').slice(3).join('/')}`); + return `${route}/${path.substring(0, lastIndex).split('/').slice(3).join('/')}`; + } + return `${route}${path.substring(0, lastIndex)}`; } return `/media#${path}`;