docs: added new guides and troubleshooting related to admin development (#8739)

This commit is contained in:
Shahed Nasser
2024-08-27 10:35:09 +02:00
committed by GitHub
parent 2bacf86d3c
commit 5996089c9c
7 changed files with 134 additions and 2 deletions
@@ -0,0 +1,37 @@
export const metadata = {
title: `Admin Widget / UI Route Not Showing`,
}
# {metadata.title}
This guide provides some troubleshooting step as to why your admin widget / UI route isn't showing in the Medusa Admin dashboard.
## Incorrect Zone
If you're adding an admin widget, make sure you're using a correct zone.
Refer to the [Admin Widget Injection Zones list](../../../admin-widget-injection-zones/page.mdx) for reference.
---
## Incorrect Function Definition
Widget and UI routes must be defined as arrow functions. Any other type of declaration isn't accepted.
Refer to the [Admin Development Constraints](!docs!/advanced-development/admin/constraints) documentation for more details.
---
## Incorrect Type of Zone Value
A widget zone's value must be wrapped in double or single quotes:
```ts
export const config = defineWidgetConfig({
zone: "product.details.before",
})
```
Any other usage leads to the widget not being shown.
Refer to the [Admin Development Constraints](!docs!/advanced-development/admin/constraints) documentation for more details.