strapi-plugin-preview-content icon indicating copy to clipboard operation
strapi-plugin-preview-content copied to clipboard

Admin URL assumed to be /admin which breaks clone button when using a custom admin URL

Open julesrenaud opened this issue 3 years ago • 0 comments

I'm using custom admin URLs in production to make it harder to find the admin panel without knowing the URL. Doing so breaks the clone button on an entity's admin page (it's not an issue when clicking the icon on the collection type listing page.

I found the issue to be an hardcoded path in src/admin/main/preview-context/index.js

https://github.com/danestves/strapi-plugin-preview-content/blob/c0d5d2416452bd74a6837d097c85ee4492b89720/src/admin/main/preview-context/index.js#L290

The correct admin URL should be used instead. It could be retrieved via window.location.

julesrenaud avatar Mar 01 '22 19:03 julesrenaud