strapi-plugin-preview-button
strapi-plugin-preview-button copied to clipboard
"Open live view" button not visible if field have "%" char.
I noticed following issue - tested with current version 2.2.1
.
Minimum steps to reproduce:
- Defined minimum content type:
{
"kind": "collectionType",
"collectionName": "tests",
"info": {
"singularName": "test",
"pluralName": "tests",
"displayName": "Test",
"description": ""
},
"attributes": {
"Test": {
"type": "string"
}
}
}
- Added plugin config:
'preview-button': {
config: {
contentTypes: [
{
uid: 'api::test.test',
published: {
url: `http://localhost:3000/test/{id}`,
openTarget: '_blank',
},
}
],
},
},
- Content:
- If there's no
%
char in field -Open live view
exists: - If there's
%
char in field -Open live view
do not exists:
There is also additional error in browser console:
main.c2325b99.js:2185 Uncaught (in promise) URIError: URI malformed
at decodeURIComponent (<anonymous>)
at main.c2325b99.js:2185:1707
at Array.reduce (<anonymous>)
at P (main.c2325b99.js:2185:1636)
at z (main.c2325b99.js:2185:1952)
at main.c2325b99.js:2185:3391
thrown in main.c2325b99.js:2185
Hi @Miro0 This was actually fixed in 2.2.1 🤔 Have you tried removing yarn.lock
or node_modules
and reinstalling with yarn
? That encodeURIcomponent(decodeURIComponent(value))
code was definitely replaced in the latest version.