[bug]: Bad initial link for admin plugin

Open
#80 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 6 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
cli

Research direction

Start with the generated [plugin-name]/admin/src/index.js produced by npx @strapi/sdk-plugin init plugin-name, and inspect the app.addMenuLink configuration. Reproduce the issue in the admin panel by clicking the created plugin's icon, then verify that the generated link points to the intended plugin route.

Written by the indexing model from the issue text.

Description

issue: bug
What version of @strapi/sdk-plugin are you using?
  • Npm version
    10.8.2
  • Node.js version
    20.17.0
  • React version:
    18.3.1
  • @strapi/sdk-plugin version
    5.3.0
What's Wrong?

When initializing a plugin with the command
npx @strapi/sdk-plugin init plugin-name,
the link on the icon in the admin menu is incorrect.

To Reproduce

npx @strapi/sdk-plugin init plugin-name
In the admin panel, click on the icon of the created plugin.

Expected Behaviour

In [plugin-name]/admin/src/index.js, modify the link (to:) so that it references the icon (${PluginIcon}) instead of the plugin ID (${PLUGIN_ID}).

 app.addMenuLink({
      to: `plugins/${PluginIcon}`,
      icon: PluginIcon,
      intlLabel: {
        id: `${PLUGIN_ID}.plugin.name`,
        defaultMessage: PLUGIN_ID,
      },
      ...
 app.addMenuLink({
      to: `plugins/${PLUGIN_ID}`,
      icon: PluginIcon,
      intlLabel: {
        id: `${PLUGIN_ID}.plugin.name`,
        defaultMessage: PLUGIN_ID,
      },
      ...
Dominant language
TypeScript
Stars
24
Forks
13
Avg merge
5d 3h
Merged PRs (30d)
5

Getting set up

  • No Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from strapi/sdk-plugin

All issues in strapi/sdk-plugin

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.