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

Migrate to Strapi 5 (pre-release) #146

Merged
merged 22 commits into from
Dec 14, 2024
Merged

Migrate to Strapi 5 (pre-release) #146

merged 22 commits into from
Dec 14, 2024

Conversation

mattmilburn
Copy link
Owner

@mattmilburn mattmilburn commented Dec 3, 2024

With support for Strapi v5 now available in the plugin, much of this PR is just cleaning up and sorting out infrastructure and testing.

Plugin version 3 with Strapi 5 support on it's way very soon 👍🏻

@mattmilburn mattmilburn force-pushed the strapi5-prerelease branch 2 times, most recently from bd727e1 to dac8515 Compare December 3, 2024 21:49
@sofianegargouri
Copy link

Hi mate,
Just tried to test your plugin on Strapi 5, but I can't get any button on my pages.

Here is my config file:

// config/plugins.ts
export default ({ env }) => ({
  'preview-button': {
    config: {
      contentTypes: [
        {
          uid: 'api::post.post',
          draft: {
            url: 'http://localhost:3000/api/blog/draft',
            query: {
              lang: '{locale}',
              slug: '{slug}',
              secret: env('CLIENT_PREVIEW_SECRET'),
            },
          },
          published: {
            url: 'http://localhost:3000/{slug}',
          },
        },
      ],
    }
  },
});

The URL of the document I'm trying to preview (to check uid for typo):
http://localhost:1337/admin/content-manager/collection-types/api::post.post/vgyhfh780rm6l4t9hrcyrv0j?plugins%5Bi18n%5D%5Blocale%5D=en

The sidebar I'm getting:
image
image

The plugin seems to be registered in Strapi as well:
image

@mattmilburn
Copy link
Owner Author

Hi @sofianegargouri How are you installing the plugin in your project? I ask because this next version is not officially released yet and I'm still needing to clean up a few things. Your config looks correct btw.

@mattmilburn mattmilburn merged commit 42284d0 into staging Dec 14, 2024
@mattmilburn mattmilburn deleted the strapi5-prerelease branch December 14, 2024 02:19
@sofianegargouri
Copy link

Sorry I answered that late. I installed it using yarn and specifying your branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants