mattmilburn / strapi-plugin-preview-button

A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.
MIT License
98 stars 34 forks source link

No buttons in admin panel #137

Open BorisKamp opened 2 months ago

BorisKamp commented 2 months ago

Hi!

This is my package.json:

{
  "dependencies": {
......
    "strapi-plugin-populate-deep": "^3.0.1",
    "strapi-plugin-preview-button": "^2.2.2",
    "styled-components": "^5.3.11"
  },
.......
    "node": "18.x.x",
    "npm": "10.x.x"
  },
  "license": "MIT"
}

And here is my config/plugins.ts file:

export default ({ env }) => ({
  upload: {
    config: {
      provider: 'aws-s3',
      providerOptions: {
        accessKeyId: env('AWS_ACCESS_KEY_ID'),
        secretAccessKey: env('AWS_ACCESS_SECRET'),
        region: env('AWS_REGION'),
        params: {
          Bucket: env('AWS_BUCKET'),
        },
      },
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
      },
    },
  },
  email: {
    config: {
      provider: 'sendgrid',
      providerOptions: {
        apiKey: env('SENDGRID_API_KEY'),
      },
    },
  },
  'preview-button': {
    config: {
      contentTypes: [
        {
          uid: 'api::page.page',
          draft: {
            url: `${env('FRONTEND_URL')}/{slug}`,
            query: {
              preview: true,
            },
          },
          published: {
            url: `${env('FRONTEND_URL')}/{slug}`,
          },
        },
        {
          uid: 'api::news-item.news-item',
          draft: {
            url: `${env('FRONTEND_URL')}/news/{slug}`,
            query: {
              preview: true,
            },
          },
          published: {
            url: `${env('FRONTEND_URL')}/news/{slug}`,
          },
        },
      ],
    },
  }
});

And I specified FRONTEND_URL=http://localhost:3000 in my .env file.

However, nothing in my admin panel:

Screenshot 2024-06-24 at 21 41 20

What am I doing wrong @mattmilburn ?

BorisKamp commented 2 months ago

When I fetch the collection type entry in the admin panel I see this in my console:

Screenshot 2024-06-24 at 21 45 00

So something is working tho...

And I rebuild Strapi several times, even manually deleted the dist and .strapi folder and rebuild.