Skip to content

Commit

Permalink
docs: revise admin customization pages (medusajs#10466)
Browse files Browse the repository at this point in the history
* docs: revise admin customization pages

* fix prerequisites link

* apply lint
  • Loading branch information
shahednasser authored Dec 6, 2024
1 parent 0a077d4 commit 21b0e0c
Show file tree
Hide file tree
Showing 9 changed files with 538 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ export const checks1Highlights = [
```ts highlights={checks1Highlights}
import { model } from "@medusajs/framework/utils"

const CustomProduct = model.define('custom_product', {
const CustomProduct = model.define("custom_product", {
// ...
price: model.bigNumber(),
})
.checks([
(columns) => `${columns.price} >= 0`
(columns) => `${columns.price} >= 0`,
])
```

Expand All @@ -53,15 +53,15 @@ export const checks2Highlights = [
```ts highlights={checks2Highlights}
import { model } from "@medusajs/framework/utils"

const CustomProduct = model.define('custom_product', {
const CustomProduct = model.define("custom_product", {
// ...
price: model.bigNumber(),
})
.checks([
{
name: 'custom_product_price_check',
expression: (columns) => `${columns.price} >= 0`
}
name: "custom_product_price_check",
expression: (columns) => `${columns.price} >= 0`,
},
])
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ const Order = model.define("order", {
mappedBy: "orders",
pivotTable: "order_product",
joinColumn: "order_id",
inverseJoinColumn: "product_id"
inverseJoinColumn: "product_id",
}),
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ const step1 = createStep(
)

return new StepResponse(ids, prevData)
},
}
)
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ You create a validation schema in a TypeScript or JavaScript file under a sub-di
import { z } from "zod"

export const PostAdminCreateBrand = z.object({
name: z.string()
name: z.string(),
})
```

Expand Down
21 changes: 17 additions & 4 deletions www/apps/book/app/learn/customization/customize-admin/page.mdx
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
export const metadata = {
title: `${pageNumber} Customize Admin to Add Brands`,
title: `${pageNumber} Customize Medusa Admin Dashboard`,
}

# {metadata.title}

In the next chapters, you'll continue with the brands example to learn how to customize the Medusa Admin to:
In the previous chapters, you've customized your Medusa application to [add brands](../custom-features/module/page.mdx), [expose an API route to create brands](../custom-features/api-route/page.mdx), and [linked brands to products](../extend-features/define-link/page.mdx).

- Show a product's brand on its details page using a widget.
- Add a page showing the list of brands in your application using a UI route.
After customizing and extending your application with new features, you may need to provide an interface for admin users to utilize these features. The Medusa Admin dashboard is extendable, allowing you to:

- Insert components, called [widgets](../../advanced-development/admin/widgets/page.mdx), on existing pages.
- Add new pages, called [UI Routes](../../advanced-development/admin/ui-routes/page.mdx).

From these customizations, you can send requests to custom API routes, allowing admin users to manage custom resources on the dashboard

---

## Next Chapters: View Brands in Dashboard

In the next chapters, you'll continue with the brands example to:

- Add a new section to the product details page that shows the product's brand.
- Add a new page in the dashboard that shows all brands in the store.
Loading

0 comments on commit 21b0e0c

Please sign in to comment.