feat(dashboard): Add more injection zones (customer, customer groups) (#7448)
This commit is contained in:
+18
@@ -1,10 +1,14 @@
|
|||||||
import { Outlet, useLoaderData, useParams } from "react-router-dom"
|
import { Outlet, useLoaderData, useParams } from "react-router-dom"
|
||||||
|
|
||||||
import { JsonViewSection } from "../../../components/common/json-view-section"
|
import { JsonViewSection } from "../../../components/common/json-view-section"
|
||||||
import { useCustomerGroup } from "../../../hooks/api/customer-groups"
|
import { useCustomerGroup } from "../../../hooks/api/customer-groups"
|
||||||
import { CustomerGroupCustomerSection } from "./components/customer-group-customer-section"
|
import { CustomerGroupCustomerSection } from "./components/customer-group-customer-section"
|
||||||
import { CustomerGroupGeneralSection } from "./components/customer-group-general-section"
|
import { CustomerGroupGeneralSection } from "./components/customer-group-general-section"
|
||||||
import { customerGroupLoader } from "./loader"
|
import { customerGroupLoader } from "./loader"
|
||||||
|
|
||||||
|
import after from "virtual:medusa/widgets/customer_group/details/after"
|
||||||
|
import before from "virtual:medusa/widgets/customer_group/details/before"
|
||||||
|
|
||||||
export const CustomerGroupDetail = () => {
|
export const CustomerGroupDetail = () => {
|
||||||
const initialData = useLoaderData() as Awaited<
|
const initialData = useLoaderData() as Awaited<
|
||||||
ReturnType<typeof customerGroupLoader>
|
ReturnType<typeof customerGroupLoader>
|
||||||
@@ -29,8 +33,22 @@ export const CustomerGroupDetail = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-y-2">
|
<div className="flex flex-col gap-y-2">
|
||||||
|
{before.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<CustomerGroupGeneralSection group={customer_group} />
|
<CustomerGroupGeneralSection group={customer_group} />
|
||||||
<CustomerGroupCustomerSection group={customer_group} />
|
<CustomerGroupCustomerSection group={customer_group} />
|
||||||
|
{after.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<JsonViewSection data={customer_group} />
|
<JsonViewSection data={customer_group} />
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+18
@@ -1,10 +1,28 @@
|
|||||||
import { Outlet } from "react-router-dom"
|
import { Outlet } from "react-router-dom"
|
||||||
|
|
||||||
import { CustomerGroupListTable } from "./components/customer-group-list-table"
|
import { CustomerGroupListTable } from "./components/customer-group-list-table"
|
||||||
|
|
||||||
|
import after from "virtual:medusa/widgets/customer_group/list/after"
|
||||||
|
import before from "virtual:medusa/widgets/customer_group/list/before"
|
||||||
|
|
||||||
export const CustomerGroupsList = () => {
|
export const CustomerGroupsList = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-y-2">
|
<div className="flex flex-col gap-y-2">
|
||||||
|
{before.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<CustomerGroupListTable />
|
<CustomerGroupListTable />
|
||||||
|
{after.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
+18
@@ -1,10 +1,14 @@
|
|||||||
import { Outlet, useLoaderData, useParams } from "react-router-dom"
|
import { Outlet, useLoaderData, useParams } from "react-router-dom"
|
||||||
|
|
||||||
import { JsonViewSection } from "../../../components/common/json-view-section"
|
import { JsonViewSection } from "../../../components/common/json-view-section"
|
||||||
import { useCustomer } from "../../../hooks/api/customers"
|
import { useCustomer } from "../../../hooks/api/customers"
|
||||||
import { CustomerGeneralSection } from "./components/customer-general-section"
|
import { CustomerGeneralSection } from "./components/customer-general-section"
|
||||||
import { CustomerGroupSection } from "./components/customer-group-section"
|
import { CustomerGroupSection } from "./components/customer-group-section"
|
||||||
import { customerLoader } from "./loader"
|
import { customerLoader } from "./loader"
|
||||||
|
|
||||||
|
import after from "virtual:medusa/widgets/customer/details/after"
|
||||||
|
import before from "virtual:medusa/widgets/customer/details/before"
|
||||||
|
|
||||||
export const CustomerDetail = () => {
|
export const CustomerDetail = () => {
|
||||||
const { id } = useParams()
|
const { id } = useParams()
|
||||||
|
|
||||||
@@ -25,11 +29,25 @@ export const CustomerDetail = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-y-2">
|
<div className="flex flex-col gap-y-2">
|
||||||
|
{before.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<CustomerGeneralSection customer={customer} />
|
<CustomerGeneralSection customer={customer} />
|
||||||
{/* <CustomerOrderSection customer={customer} />
|
{/* <CustomerOrderSection customer={customer} />
|
||||||
// TODO: re-add when order endpoints are added to api-v2
|
// TODO: re-add when order endpoints are added to api-v2
|
||||||
*/}
|
*/}
|
||||||
<CustomerGroupSection customer={customer} />
|
<CustomerGroupSection customer={customer} />
|
||||||
|
{after.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<JsonViewSection data={customer} />
|
<JsonViewSection data={customer} />
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
import { Outlet } from "react-router-dom"
|
import { Outlet } from "react-router-dom"
|
||||||
|
|
||||||
import { CustomerListTable } from "./components/customer-list-table"
|
import { CustomerListTable } from "./components/customer-list-table"
|
||||||
|
|
||||||
|
import after from "virtual:medusa/widgets/customer/list/after"
|
||||||
|
import before from "virtual:medusa/widgets/customer/list/before"
|
||||||
|
|
||||||
export const CustomersList = () => {
|
export const CustomersList = () => {
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col gap-y-2">
|
<div className="flex flex-col gap-y-2">
|
||||||
|
{before.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<CustomerListTable />
|
<CustomerListTable />
|
||||||
|
{after.widgets.map((w, i) => {
|
||||||
|
return (
|
||||||
|
<div key={i}>
|
||||||
|
<w.Component />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user