Skip to content

Commit

Permalink
Merge branch 'develop' into fix/include-region-in-shipping-option-ret…
Browse files Browse the repository at this point in the history
…rieval
  • Loading branch information
olivermrbl authored Nov 6, 2024
2 parents 4cdbc49 + b3cbc16 commit a2dd910
Show file tree
Hide file tree
Showing 35 changed files with 697 additions and 121 deletions.
5 changes: 5 additions & 0 deletions .changeset/cool-buckets-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/js-sdk": patch
---

fix: Add support for relative base URL to js-sdk
5 changes: 5 additions & 0 deletions .changeset/early-queens-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/types": patch
---

fix(types): Prev limit wrong values
6 changes: 6 additions & 0 deletions .changeset/eleven-students-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/telemetry": patch
"@medusajs/medusa": patch
---

fix(telemetry): Pointing and resolving packages wrongly
5 changes: 5 additions & 0 deletions .changeset/shiny-spiders-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---

fix(utils): Mikro orm repository update many to many should detach all items by default
5 changes: 5 additions & 0 deletions .changeset/tall-starfishes-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/workflows-sdk": patch
---

fix(workflows-sdk): Paralellize steps rollback issue with config
5 changes: 5 additions & 0 deletions .changeset/tame-sloths-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---

fix(utils/dml): set-relationship graphql generator from DML wrong managed belongsTo
8 changes: 8 additions & 0 deletions .changeset/tough-spiders-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@medusajs/dashboard": patch
"@medusajs/framework": patch
"@medusajs/types": patch
"@medusajs/utils": patch
---

fix: Default to a relative path for backend URL in admin
53 changes: 0 additions & 53 deletions .github/ISSUE_TEMPLATE/bug_report_v2.md

This file was deleted.

77 changes: 77 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report_v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Bug report for v2.0
description: File a bug report.
title: "[Bug]: "
labels: ["status: needs triaging", "version: 2.0"]
body:
- type: markdown
attributes:
value: "## System information"
- type: markdown
attributes:
value: |
The system information will help us reproduce the issue in the same environment
- type: textarea
attributes:
label: Package.json file
description: Copy/paste the contents of the `package.json` file. No need to use backticks
placeholder: No need to use markdown backticks. Just copy/paste the contents of the file
render: JSON
validations:
required: true
- type: input
attributes:
label: Node.js version
description: Copy/paste the output of `node -v` command.
placeholder: v21.0.0
validations:
required: true
- type: input
attributes:
label: Database and its version
placeholder: PostgreSQL 16.2
validations:
required: true
- type: input
attributes:
label: Operating system name and version
validations:
required: true
- type: input
attributes:
label: Browser name
- type: markdown
attributes:
value: "## Describe the issue"
- type: markdown
attributes:
value: |
Please explain your issue in-depth along with the relevant screenshots and code snippets
- type: textarea
attributes:
label: What happended?
placeholder: A clear and concise description of what the bug is
validations:
required: true
- type: textarea
attributes:
label: Expected behavior
validations:
required: true
- type: textarea
attributes:
label: Actual behavior
validations:
required: true
- type: markdown
attributes:
value: "## Reproduction"
- type: markdown
attributes:
value: |
Providing a reproduction repo allows us to quickly validate the issue and get back to you.
- type: input
attributes:
label: Link to reproduction repo
description: Please reproduce the issue in isolation and share it as a Github repo with us
validations:
required: true
20 changes: 20 additions & 0 deletions .github/workflows/create-linear-issue-on-discussion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Create Linear Issue on Discussions

on:
discussion:
types: [created]

jobs:
create-linear-issue-on-discussion:
runs-on: ubuntu-latest
steps:
- name: Create the Linear Issue
id: createIssue
uses: ctriolo/action-create-linear-issue@v0.5
with:
linear-api-key: ${{secrets.LINEAR_API_KEY}}
linear-team-key: "TRI"
linear-issue-title: ${{github.event.discussion.title}}
linear-issue-description: ${{github.event.discussion.body}}
linear-attachment-url: ${{github.event.discussion.html_url}}
linear-attachment-title: ${{github.event.discussion.title}}
36 changes: 36 additions & 0 deletions .github/workflows/create-linear-issue-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Create Linear Issue on Pull Request

on:
pull_request:
branches:
- develop
types: [opened]

jobs:
create-linear-issue-on-pull-request:
runs-on: ubuntu-latest
steps:
- name: Check if PR Author is in Team
id: check_author
env:
GITHUB_TOKEN: ${{ secrets.READ_ORG_PAT }}
run: |
response=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/orgs/medusajs/teams/engineering/memberships/${{ github.event.pull_request.user.login }})
if [[ "$response" -eq 200 ]]; then
echo "author_is_team_member=true\n" >> $GITHUB_OUTPUT
else
echo "author_is_team_member=false\n" >> $GITHUB_OUTPUT
fi
- name: Create the Linear Issue
if: ${{ steps.check_author.outputs.author_is_team_member == 'false' }}
id: create_issue
uses: ctriolo/action-create-linear-issue@v0.5
with:
linear-api-key: ${{secrets.LINEAR_API_KEY}}
linear-team-key: "SUP"
linear-issue-title: ${{github.event.pull_request.title}}
linear-issue-description: ${{github.event.pull_request.body}}
linear-attachment-url: ${{github.event.pull_request.html_url}}
linear-attachment-title: ${{github.event.pull_request.title}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ export const KeyboundForm = React.forwardRef<

const handleKeyDown = (event: React.KeyboardEvent<HTMLFormElement>) => {
if (event.key === "Enter") {
if (
event.target instanceof HTMLTextAreaElement &&
!(event.metaKey || event.ctrlKey)
) {
return
}

event.preventDefault()

if (event.metaKey || event.ctrlKey) {
Expand Down
25 changes: 21 additions & 4 deletions packages/admin/dashboard/src/i18n/translations/$schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,26 @@
],
"additionalProperties": false
},
"edit": {
"type": "object",
"properties": {
"header": {
"type": "string"
},
"description": {
"type": "string"
},
"successToast": {
"type": "string"
}
},
"required": [
"header",
"description",
"successToast"
],
"additionalProperties": false
},
"create": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1894,9 +1914,6 @@
"attributes": {
"type": "string"
},
"editProduct": {
"type": "string"
},
"editAttributes": {
"type": "string"
},
Expand Down Expand Up @@ -2667,13 +2684,13 @@
"required": [
"domain",
"list",
"edit",
"create",
"export",
"import",
"deleteWarning",
"variants",
"attributes",
"editProduct",
"editAttributes",
"editOptions",
"editPrices",
Expand Down
6 changes: 5 additions & 1 deletion packages/admin/dashboard/src/i18n/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,11 @@
"list": {
"noRecordsMessage": "Create your first product to start selling."
},
"edit": {
"header": "Edit Product",
"description": "Edit the product details.",
"successToast": "Product {{title}} was successfully updated."
},
"create": {
"header": "General",
"tabs": {
Expand Down Expand Up @@ -462,7 +467,6 @@
"deleteWarning": "You are about to delete the product {{title}}. This action cannot be undone.",
"variants": "Variants",
"attributes": "Attributes",
"editProduct": "Edit Product",
"editAttributes": "Edit Attributes",
"editOptions": "Edit Options",
"editPrices": "Edit prices",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/dashboard/src/lib/client/client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Medusa from "@medusajs/js-sdk"

export const backendUrl = __BACKEND_URL__ ?? "http://localhost:9000"
export const backendUrl = __BACKEND_URL__ ?? "/"

export const sdk = new Medusa({
baseUrl: backendUrl,
Expand Down
2 changes: 1 addition & 1 deletion packages/admin/dashboard/src/lib/query-client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { QueryClient } from "@tanstack/react-query"

export const MEDUSA_BACKEND_URL = __BACKEND_URL__ ?? "http://localhost:9000"
export const MEDUSA_BACKEND_URL = __BACKEND_URL__ ?? "/"

export const queryClient = new QueryClient({
defaultOptions: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Input, Select, Text, Textarea } from "@medusajs/ui"
import { Button, Input, Select, Text, Textarea, toast } from "@medusajs/ui"
import { useTranslation } from "react-i18next"
import * as zod from "zod"

Expand Down Expand Up @@ -69,9 +69,15 @@ export const EditProductForm = ({ product }: EditProductFormProps) => {
...nullableData,
},
{
onSuccess: () => {
onSuccess: ({ product }) => {
toast.success(
t("products.edit.successToast", { title: product.title })
)
handleSuccess()
},
onError: (e) => {
toast.error(e.message)
},
}
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ export const ProductEdit = () => {
<RouteDrawer>
<RouteDrawer.Header>
<RouteDrawer.Title asChild>
<Heading>{t("products.editProduct")}</Heading>
<Heading>{t("products.edit.header")}</Heading>
</RouteDrawer.Title>
<RouteDrawer.Description className="sr-only">
{t("products.edit.description")}
</RouteDrawer.Description>
</RouteDrawer.Header>
{!isLoading && product && <EditProductForm product={product} />}
</RouteDrawer>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/framework/src/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export type AdminOptions = {
*/
outDir?: string
/**
* The URL of your Medusa application. This is useful to set when you deploy the Medusa application.
* The URL of your Medusa application. Defaults to the browser origin. This is useful to set when running the admin on a separate domain.
*
* @example
* ```ts title="medusa-config.ts"
Expand Down
Loading

0 comments on commit a2dd910

Please sign in to comment.