-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dashboard, medusa) add metadata to pages (#9433)
**WIP** - add metadata component and edit route to missing pages - fix API issues around metadata in certain domains --- FIXES CC-554
- Loading branch information
Showing
25 changed files
with
358 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
packages/admin/dashboard/src/routes/categories/categories-metadata/categories-metadata.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { useParams } from "react-router-dom" | ||
|
||
import { | ||
useProductCategory, | ||
useUpdateProductCategory, | ||
} from "../../../hooks/api" | ||
import { MetadataForm } from "../../../components/forms/metadata-form" | ||
import { RouteDrawer } from "../../../components/modals" | ||
|
||
export const CategoriesMetadata = () => { | ||
const { id } = useParams() | ||
|
||
const { product_category, isPending, isError, error } = useProductCategory(id) | ||
const { mutateAsync, isPending: isMutating } = useUpdateProductCategory(id) | ||
|
||
if (isError) { | ||
throw error | ||
} | ||
|
||
return ( | ||
<RouteDrawer> | ||
<MetadataForm | ||
isPending={isPending} | ||
isMutating={isMutating} | ||
hook={mutateAsync} | ||
metadata={product_category?.metadata} | ||
/> | ||
</RouteDrawer> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/admin/dashboard/src/routes/categories/categories-metadata/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { CategoriesMetadata as Component } from "./categories-metadata" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...board/src/routes/inventory/inventory-detail/components/inventory-item-general-section.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/admin/dashboard/src/routes/inventory/inventory-metadata/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { InventoryItemMetadata as Component } from "./inventory-metadata" |
27 changes: 27 additions & 0 deletions
27
packages/admin/dashboard/src/routes/inventory/inventory-metadata/inventory-metadata.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useParams } from "react-router-dom" | ||
|
||
import { useInventoryItem, useUpdateInventoryItem } from "../../../hooks/api" | ||
import { MetadataForm } from "../../../components/forms/metadata-form" | ||
import { RouteDrawer } from "../../../components/modals" | ||
|
||
export const InventoryItemMetadata = () => { | ||
const { id } = useParams() | ||
|
||
const { inventory_item, isPending, isError, error } = useInventoryItem(id) | ||
const { mutateAsync, isPending: isMutating } = useUpdateInventoryItem(id) | ||
|
||
if (isError) { | ||
throw error | ||
} | ||
|
||
return ( | ||
<RouteDrawer> | ||
<MetadataForm | ||
isPending={isPending} | ||
isMutating={isMutating} | ||
hook={mutateAsync} | ||
metadata={inventory_item?.metadata} | ||
/> | ||
</RouteDrawer> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/admin/dashboard/src/routes/regions/region-metadata/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { RegionMetadata as Component } from "./region-metadata.tsx" |
27 changes: 27 additions & 0 deletions
27
packages/admin/dashboard/src/routes/regions/region-metadata/region-metadata.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { useParams } from "react-router-dom" | ||
|
||
import { MetadataForm } from "../../../components/forms/metadata-form" | ||
import { RouteDrawer } from "../../../components/modals" | ||
import { useRegion, useUpdateRegion } from "../../../hooks/api" | ||
|
||
export const RegionMetadata = () => { | ||
const { id } = useParams() | ||
|
||
const { region, isPending, isError, error } = useRegion(id) | ||
const { mutateAsync, isPending: isMutating } = useUpdateRegion(id) | ||
|
||
if (isError) { | ||
throw error | ||
} | ||
|
||
return ( | ||
<RouteDrawer> | ||
<MetadataForm | ||
isPending={isPending} | ||
isMutating={isMutating} | ||
hook={mutateAsync} | ||
metadata={region?.metadata} | ||
/> | ||
</RouteDrawer> | ||
) | ||
} |
Oops, something went wrong.