fix(admin-shared,dashboard): Add missing injection zones (#10098)
**What** - Adds missing InjectionZones for ProductVariant details page. - Removes v1 related zones, such as GiftCard and DraftOrder.
This commit is contained in:
committed by
GitHub
parent
79a3dc1e82
commit
a153bc477c
6
.changeset/mean-rice-cough.md
Normal file
6
.changeset/mean-rice-cough.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/admin-shared": patch
|
||||
"@medusajs/dashboard": patch
|
||||
---
|
||||
|
||||
fix(admin-shared,dashboard): Add missing Injection Zones and remove unused zones"
|
||||
@@ -7,15 +7,6 @@ const ORDER_INJECTION_ZONES = [
|
||||
"order.list.after",
|
||||
] as const
|
||||
|
||||
const DRAFT_ORDER_INJECTION_ZONES = [
|
||||
"draft_order.list.before",
|
||||
"draft_order.list.after",
|
||||
"draft_order.details.side.before",
|
||||
"draft_order.details.side.after",
|
||||
"draft_order.details.before",
|
||||
"draft_order.details.after",
|
||||
] as const
|
||||
|
||||
const CUSTOMER_INJECTION_ZONES = [
|
||||
"customer.details.before",
|
||||
"customer.details.after",
|
||||
@@ -39,6 +30,13 @@ const PRODUCT_INJECTION_ZONES = [
|
||||
"product.details.side.after",
|
||||
] as const
|
||||
|
||||
const PRODUCT_VARIANT_INJECTION_ZONES = [
|
||||
"product_variant.details.before",
|
||||
"product_variant.details.after",
|
||||
"product_variant.details.side.before",
|
||||
"product_variant.details.side.after",
|
||||
] as const
|
||||
|
||||
const PRODUCT_COLLECTION_INJECTION_ZONES = [
|
||||
"product_collection.details.before",
|
||||
"product_collection.details.after",
|
||||
@@ -96,15 +94,6 @@ const CAMPAIGN_INJECTION_ZONES = [
|
||||
"campaign.list.after",
|
||||
] as const
|
||||
|
||||
const GIFT_CARD_INJECTION_ZONES = [
|
||||
"gift_card.details.before",
|
||||
"gift_card.details.after",
|
||||
"gift_card.list.before",
|
||||
"gift_card.list.after",
|
||||
"custom_gift_card.before",
|
||||
"custom_gift_card.after",
|
||||
] as const
|
||||
|
||||
const USER_INJECTION_ZONES = [
|
||||
"user.details.before",
|
||||
"user.details.after",
|
||||
@@ -204,15 +193,16 @@ const INVENTORY_ITEM_INJECTION_ZONES = [
|
||||
*/
|
||||
export const INJECTION_ZONES = [
|
||||
...ORDER_INJECTION_ZONES,
|
||||
...DRAFT_ORDER_INJECTION_ZONES,
|
||||
...CUSTOMER_INJECTION_ZONES,
|
||||
...CUSTOMER_GROUP_INJECTION_ZONES,
|
||||
...PRODUCT_INJECTION_ZONES,
|
||||
...PRODUCT_VARIANT_INJECTION_ZONES,
|
||||
...PRODUCT_COLLECTION_INJECTION_ZONES,
|
||||
...PRODUCT_CATEGORY_INJECTION_ZONES,
|
||||
...PRODUCT_TYPE_INJECTION_ZONES,
|
||||
...PRODUCT_TAG_INJECTION_ZONES,
|
||||
...PRICE_LIST_INJECTION_ZONES,
|
||||
...PROMOTION_INJECTION_ZONES,
|
||||
...GIFT_CARD_INJECTION_ZONES,
|
||||
...USER_INJECTION_ZONES,
|
||||
...STORE_INJECTION_ZONES,
|
||||
...PROFILE_INJECTION_ZONES,
|
||||
@@ -226,8 +216,6 @@ export const INJECTION_ZONES = [
|
||||
...WORKFLOW_INJECTION_ZONES,
|
||||
...CAMPAIGN_INJECTION_ZONES,
|
||||
...TAX_INJECTION_ZONES,
|
||||
...PRODUCT_TYPE_INJECTION_ZONES,
|
||||
...PRODUCT_TAG_INJECTION_ZONES,
|
||||
...RETURN_REASON_INJECTION_ZONES,
|
||||
...INVENTORY_ITEM_INJECTION_ZONES,
|
||||
] as const
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useProductVariant } from "../../../hooks/api/products"
|
||||
|
||||
import { TwoColumnPageSkeleton } from "../../../components/common/skeleton"
|
||||
import { TwoColumnPage } from "../../../components/layout/pages"
|
||||
import { useDashboardExtension } from "../../../extensions"
|
||||
import { VariantGeneralSection } from "./components/variant-general-section"
|
||||
import {
|
||||
InventorySectionPlaceholder,
|
||||
@@ -28,6 +29,8 @@ export const ProductVariantDetail = () => {
|
||||
}
|
||||
)
|
||||
|
||||
const { getWidgets } = useDashboardExtension()
|
||||
|
||||
if (isLoading || !variant) {
|
||||
return (
|
||||
<TwoColumnPageSkeleton
|
||||
@@ -49,12 +52,11 @@ export const ProductVariantDetail = () => {
|
||||
hasOutlet
|
||||
showJSON
|
||||
showMetadata
|
||||
// TODO: Add widgets zones for variant detail page
|
||||
widgets={{
|
||||
after: [],
|
||||
before: [],
|
||||
sideAfter: [],
|
||||
sideBefore: [],
|
||||
after: getWidgets("product_variant.details.after"),
|
||||
before: getWidgets("product_variant.details.before"),
|
||||
sideAfter: getWidgets("product_variant.details.side.after"),
|
||||
sideBefore: getWidgets("product_variant.details.side.before"),
|
||||
}}
|
||||
>
|
||||
<TwoColumnPage.Main>
|
||||
|
||||
Reference in New Issue
Block a user