strapi-plugin-preview-content
strapi-plugin-preview-content copied to clipboard
Admin URL assumed to be /admin which breaks clone button when using a custom admin URL
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.