Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button not display for single-types #40

Closed
WebMamba opened this issue Aug 16, 2022 · 5 comments
Closed

Button not display for single-types #40

WebMamba opened this issue Aug 16, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@WebMamba
Copy link

WebMamba commented Aug 16, 2022

Hey folks! I have the plugin installed here is my package.json :

"dependencies": {
"@strapi/plugin-i18n": "4.3.2",
"@strapi/plugin-users-permissions": "4.3.2",
"@strapi/strapi": "4.3.2",
"better-sqlite3": "7.4.6",
"dotenv": "^16.0.1",
"find-config": "^1.0.0",
"mysql": "^2.18.1",
"strapi-plugin-preview-button": "^0.3.5"
},

and I added the following configuration in ./config/plugins.js

module.exports = { 'preview-button': { config: { contentTypes: [ { uid: 'api::home-page.home-page' } ] } } }

But the button in never display. Do i miss something in the de docs ?

@mattmilburn
Copy link
Owner

Hi @WebMamba I think you may still need to configure env vars for the plugin. You can read about it in the docs here.

In a future release, these env vars will become optional 👍🏻

Let me know how this works out for you.

@WebMamba
Copy link
Author

WebMamba commented Aug 17, 2022

No I already configure my envs. Here is my .env file :

STRAPI_PREVIEW_DRAFT_URL=http://localhost:1337/api/preview
STRAPI_PREVIEW_PUBLISHED_URL=http://localhost:8000
STRAPI_PREVIEW_SECRET=12345

I am using strapi 4.3.2

It's actually working great with my collection content-type but still not working with my single type.

I dig in to your code and I find that, when you are in the single-type page :

const data = useSelector( state => state[ pluginId ].data );

here the data is empty.

Here is empty also :

But I can't figure out why is empty juste in single-type;

@WebMamba WebMamba changed the title Button not display Button not display for single-types Aug 17, 2022
@mattmilburn
Copy link
Owner

@WebMamba Okay I see the issue now. I actually thought this issue had been resolved before 🤔 Anyway, I will be working on a bug fix for this today 👍🏻 Thank you for raising this issue!

@mattmilburn mattmilburn added the bug Something isn't working label Aug 17, 2022
@mattmilburn
Copy link
Owner

@WebMamba This should be resolved now in the latest version v0.3.6

Please let me know how this works out for you 🙂

@WebMamba
Copy link
Author

@mattmilburn thanks for your work! It's working great now! But I looked at your correction, that was a silly bug! Maybe you can do an issue to the strapi repo, it doesn't look like the expected behaviour. 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants