[bug]: Bad initial link for admin plugin

Đang mở
#80 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
cli

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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,
      },
      ...
Ngôn ngữ chính
TypeScript
Star
24
Fork
13
Merge trung bình
5 ngày 3 giờ
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của strapi/sdk-plugin

Tất cả issue của strapi/sdk-plugin

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.