Skip to content

Commit

Permalink
Merge branch 'develop' into MedusaNick-patch-3
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Oct 16, 2023
2 parents 58bce46 + 3b45fdf commit 2e4b46f
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 41 deletions.
6 changes: 6 additions & 0 deletions .changeset/chilly-pugs-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/medusa": patch
"@medusajs/types": patch
---

fix(medusa, types): Mark properties as nullable to reflect their correct types
5 changes: 5 additions & 0 deletions .changeset/rare-chefs-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/admin-ui": patch
---

fix(admin-ui): Alias design system packages
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
<a href="https://github.com/medusajs/medusa/blob/develop/CONTRIBUTING.md">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
</a>
<a href="https://www.producthunt.com/posts/medusa"><img src="https://img.shields.io/badge/Product%20Hunt-%231%20Product%20of%20the%20Day-%23DA552E" alt="Product Hunt"></a>
<a href="https://discord.gg/xpCwq3Kfn8">
<img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
</a>
<p align="center">
<a href="https://twitter.com/intent/follow?screen_name=medusajs">
<img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
<a href="https://discord.gg/medusajs">
<img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
</a>
</p>

Expand Down Expand Up @@ -69,6 +68,7 @@ Join our [Discord server](https://discord.com/invite/medusajs) to meet other com
## Other channels

- [GitHub Issues](https://github.com/medusajs/medusa/issues)
- [Community Discord](https://discord.gg/medusajs)
- [Twitter](https://twitter.com/medusajs)
- [LinkedIn](https://www.linkedin.com/company/medusajs)
- [Medusa Blog](https://medusajs.com/blog/)
Expand Down
3 changes: 3 additions & 0 deletions packages/admin-ui/src/node/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ export const ALIASED_PACKAGES = [
"@tanstack/react-table",
"@emotion/react",
"medusa-react",
"@medusajs/ui",
"@medusajs/icons",
"@medusajs/ui-preset",
] as const
7 changes: 6 additions & 1 deletion packages/admin-ui/ui/src/pages/invite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import AnalyticsConfigForm, {
AnalyticsConfigFormType,
} from "../components/organisms/analytics-config-form"
import { nestedForm } from "../utils/nested-form"
import { useFeatureFlag } from "../providers/feature-flag-provider"

type FormValues = {
password: string
Expand Down Expand Up @@ -69,6 +70,8 @@ const InvitePage = () => {
setError,
} = form

const { isFeatureEnabled } = useFeatureFlag()

const { mutateAsync: acceptInvite, isLoading: acceptInviteIsLoading } =
useAdminAcceptInvite()
const {
Expand Down Expand Up @@ -116,7 +119,9 @@ const InvitePage = () => {
!data.analytics.opt_out &&
token?.user_email

await createAnalyticsConfig(data.analytics)
if (isFeatureEnabled("analytics")) {
await createAnalyticsConfig(data.analytics)
}

if (shouldTrackEmail) {
trackUserEmail({
Expand Down
46 changes: 23 additions & 23 deletions packages/medusa/src/models/product-variant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,24 @@ export class ProductVariant extends SoftDeletableEntity {
})
prices: MoneyAmount[]

@Column({ nullable: true })
@Column({ nullable: true, type: "text" })
@Index({ unique: true, where: "deleted_at IS NULL" })
sku: string
sku: string | null

@Column({ nullable: true })
@Column({ nullable: true, type: "text" })
@Index({ unique: true, where: "deleted_at IS NULL" })
barcode: string
barcode: string | null

@Column({ nullable: true })
@Column({ nullable: true, type: "text" })
@Index({ unique: true, where: "deleted_at IS NULL" })
ean: string
ean: string | null

@Column({ nullable: true })
@Column({ nullable: true, type: "text" })
@Index({ unique: true, where: "deleted_at IS NULL" })
upc: string
upc: string | null

@Column({ nullable: true, default: 0 })
variant_rank: number
@Column({ nullable: true, type: "text", default: 0 })
variant_rank: number | null

@Column({ type: "int" })
inventory_quantity: number
Expand All @@ -74,29 +74,29 @@ export class ProductVariant extends SoftDeletableEntity {
@Column({ default: true })
manage_inventory: boolean

@Column({ nullable: true })
hs_code: string
@Column({ nullable: true, type: "text" })
hs_code: string | null

@Column({ nullable: true })
origin_country: string
@Column({ nullable: true, type: "text" })
origin_country: string | null

@Column({ nullable: true })
mid_code: string
@Column({ nullable: true, type: "text" })
mid_code: string | null

@Column({ nullable: true })
material: string
@Column({ nullable: true, type: "text" })
material: string | null

@Column({ type: "int", nullable: true })
weight: number
weight: number | null

@Column({ type: "int", nullable: true })
length: number
length: number | null

@Column({ type: "int", nullable: true })
height: number
height: number | null

@Column({ type: "int", nullable: true })
width: number
width: number | null

@OneToMany(() => ProductOptionValue, (optionValue) => optionValue.variant, {
cascade: true,
Expand All @@ -113,7 +113,7 @@ export class ProductVariant extends SoftDeletableEntity {
inventory_items: ProductVariantInventoryItem[]

@DbAwareColumn({ type: "jsonb", nullable: true })
metadata: Record<string, unknown>
metadata: Record<string, unknown> | null

purchasable?: boolean

Expand Down
26 changes: 13 additions & 13 deletions packages/types/src/inventory/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,19 +220,19 @@ export type FilterableInventoryItemProps = {
}

export type CreateInventoryItemInput = {
sku?: string
origin_country?: string
mid_code?: string
material?: string
weight?: number
length?: number
height?: number
width?: number
title?: string
description?: string
thumbnail?: string
sku?: string | null
origin_country?: string | null
mid_code?: string | null
material?: string | null
weight?: number | null
length?: number | null
height?: number | null
width?: number | null
title?: string | null
description?: string | null
thumbnail?: string | null
metadata?: Record<string, unknown> | null
hs_code?: string
hs_code?: string | null
requires_shipping?: boolean
}

Expand All @@ -242,7 +242,7 @@ export type CreateReservationItemInput = {
location_id: string
quantity: number
description?: string
created_by?: string
created_by?: string
external_id?: string
metadata?: Record<string, unknown> | null
}
Expand Down

0 comments on commit 2e4b46f

Please sign in to comment.