Commit Graph
7767 Commits
Author SHA1 Message Date
Frane PolićandGitHub 5dc8a403ef feat(dashboard): Pickup option changes (#11306)
**What**
- update the create and edit shipping option flows to support pickup (shipping) option
- modify "mark as delivered" for pickup case

---

CLOSES CMRC-906 CMRC-907
2025-02-14 14:14:58 +00:00
Shahed NasserandGitHub 271337eb23 fix(types): fix shipping profile type optional in create type / method (#11453)
* fix(types): fix shipping profile type optional in create type / method

* example fix
2025-02-14 15:11:25 +01:00
Kasper Fabricius KristensenandGitHub b37010857a fix(core-flows): Fix line item ids passed to deleteReservationsByLineItemsStep (#11465) 2025-02-14 15:10:52 +01:00
Kasper Fabricius KristensenandGitHub 825b8ad260 fix(medusa): Allow filtering by handle and title as arrays (#11472)
**What**
- Allows filtering products in the Store API with an array value for both `handle` and `title`.

RESOLVES SUP-893
2025-02-14 14:10:32 +00:00
Shahed NasserGitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
9f39cd19f8 docs: document configuring request body parsing (#11463)
* docs: document configuring request body parsing

* chore: run yarn prep automatically

* chore: run yarn prep automatically

* chore: run yarn prep automatically

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-02-14 15:58:34 +02:00
Adrien de PerettiandGitHub ceb99d073a fix(medusa): Re throw error in instrumentation after reporting it (#11464)
FIXES FRMW-2914

**What**
Currently, when the instrumentation is enabled, some instrument catches the errors in order to set the span status and info, unfortunately, these errors are not re throw leading to swallow them and return nothing in the end leading to potential breaks in flows
2025-02-14 12:50:52 +00:00
Shahed NasserandGitHub e769c5afe3 chore: remove action to generate prep files for docs (#11475) 2025-02-14 14:47:44 +02:00
Shahed NasserandGitHub 6b7c447b29 chore: fix the generate action by passing the token (#11473) 2025-02-14 14:07:25 +02:00
Harminder VirkandGitHub bc02fde236 feat: allow all NodeSDK options via registerOtel (#11460) 2025-02-14 15:37:32 +05:30
Saransh SharmaandGitHub cbfbae42f2 Update page.mdx (#11459)
Run does not make sense unless its a script provided
2025-02-14 09:56:40 +02:00
Shahed NasserandGitHub d52b5e2d1f chore: add an action that generates documentation files in PRs (#11423)
* chore: add an action that generates documentation files in PRs

* fix
2025-02-14 09:16:36 +02:00
Harminder VirkandGitHub d1cbe4c61e fix: relationships to accept ids (#11399) 2025-02-14 05:41:36 +00:00
Kasper Fabricius KristensenandGitHub a88f6576bd feat(dashboard,admin-vite-plugin): Add support for outlet routes, loader, and handle (#11305)
**What**
- Add support for defining outlet routes using `@`, e.g. `/src/admin/routes/brands/@create/page.tsx`
- Add support for exporting a `loader` from a route file.
- Add support for exporting a `handle` from a route file.

Example usage of a loader and handle:

```tsx
// src/admin/routes/articles/[id]/page.tsx
import { Button, Container, Heading } from "@medusajs/ui";
import {
  Link,
  LoaderFunctionArgs,
  Outlet,
  UIMatch,
  useLoaderData,
} from "react-router-dom";

export async function loader({ params }: LoaderFunctionArgs) {
  const { id } = params;

  return {
    id,
  };
}

export const handle = {
  breadcrumb: (match: UIMatch<{ id: string }>) => {
    const { id } = match.params;
    return `#${id}`;
  },
};

const ProfilePage = () => {
  const { id } = useLoaderData() as Awaited<ReturnType<typeof loader>>;

  return (
    <div>
      <Container className="flex justify-between items-center">
        <Heading>Article {id}</Heading>
        <Button size="small" variant="secondary" asChild>
          <Link to="edit">Edit</Link>
        </Button>
      </Container>
      {/* This will be used for the next example of an Outlet route */}
      <Outlet />
    </div>
  );
};

export default ProfilePage;
```

In the above example we are passing data to the route from a loader, and defining a breadcrumb using the handle.

Example of a outlet route:

```tsx
// src/admin/routes/articles/[id]/@edit/page.tsx
import { Button, Container, Heading } from "@medusajs/ui";

const ProfileEditPage = () => {
  return (
    <div>
      {/* Form goes here */}
    </div>
  );
};

export default ProfileEditPage;
```
This outlet route will be rendered in the <Outlet /> in the above example when the URL is /articles/1/edit

Resolves CMRC-913, CMRC-914, CMRC-915
2025-02-13 20:37:55 +00:00
Shahed NasserandGitHub c08e6ad5cf docs: add how to upload files in tests (#11455) 2025-02-13 19:19:52 +02:00
Shahed NasserandGitHub 1077993aaa chore: improvements to provider docs (#11451) 2025-02-13 18:11:39 +02:00
Shahed NasserandGitHub 710cdaf677 docs: fix digital products recipe by adding shipping profile to snippets (#11452) 2025-02-13 17:52:20 +02:00
Harminder VirkandGitHub 1a3843a92a fix: listVariantsList types (#11441) 2025-02-13 20:53:35 +05:30
Shahed NasserandGitHub cd2f2900e8 docs: fix link to troubleshooting (#11448) 2025-02-13 17:11:08 +02:00
Shahed NasserandGitHub e3b93c679f chore(core-flows): update TSDocs of createProductsWorkflow (#11439)
* chore(core-flows): update TSDocs of createProductsWorkflow

* update example in js sdk
2025-02-13 15:30:56 +02:00
Shahed NasserandGitHub b864cb4e28 docs: add missing shipping_profile_id in create product snippets (#11443)
* initial

* add link
2025-02-13 15:30:40 +02:00
4e6372bfdf fix(design-system): singleton prompt (#11352)
**What**
- add a flag to disable rendering multiple prompts on a page

**Why**
- pressing "r" when a prompt is already open would stack additional prompts

---

CLOSES SUP-802

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2025-02-13 09:39:52 +00:00
Kasper Fabricius KristensenandGitHub 681121bb19 fix(medusa): Fix draft order validator, and endpoint (#11398)
Resolves CMRC-925, CMRC-924
2025-02-13 08:06:11 +00:00
Frane PolićandGitHub 2726bb3759 fix(payment): update payment session data (#11410)
**What**
- pass `data` from provider on update payment session 

---

CLOSES SUP-866
2025-02-13 08:04:33 +00:00
Frane PolićandGitHub bbef0da5dd fix(core-flows, types): reservation of shared inventory item (#11403)
**What**
- if a cart contains variants that share inventory items, reservation of the item would fail also causing complete cart to fail
- include `completed_at` when compensating cart update
- account for multiple reservations of the same item when creating the locking key

---

CLOSES SUP-587
2025-02-13 08:03:53 +00:00
Bradley MwangangiandGitHub 90815793df docs: Include shipping_profile_id in product creation request (#11436)
- Fixed missing `shipping_profile_id` field in product creation request, which caused "Invalid request: Field 'shipping_profile_id' is required" errors.
- Updated the request payload to include `shipping_profile_id`.
- Edited documentation to reflect this change.
2025-02-13 09:49:39 +02:00
Shahed NasserandGitHub 73d921f511 docs: add section on pagination for query context (#11432)
* docs: add section on pagination for query context

* fix lint

* merge
2025-02-13 09:28:57 +02:00
Ishrath InaamandGitHub 63229d1897 docs: fix incorrect path (#11435) 2025-02-13 09:14:27 +02:00
Shahed NasserandGitHub b24af3ad9a docs: add section on middleware registration (#11433) 2025-02-12 19:25:29 +02:00
Shahed NasserandGitHub 49bf934da3 docs-util: fix inline code escape in generated references (#11428) 2025-02-12 19:08:37 +02:00
Martin ReptaandGitHub 1b6d8b9f7a docs: Fix typos in productsCreated hook (#11276) 2025-02-12 18:37:34 +02:00
Shahed NasserandGitHub d9946e679d docs: add section on validating module options (#11427) 2025-02-12 18:25:15 +02:00
Shahed NasserandGitHub 00fa475e77 docs: fix managing relationship for hasOne (#11422) 2025-02-12 17:42:27 +02:00
Shahed NasserandGitHub c5d49c66a0 docs: small fixes to workflow constraints chapter (#11421)
* docs: small fixes to workflow constraints chapter

* add links to plugins in nav
2025-02-12 16:27:55 +02:00
22276648ad feat: query.index (#11348)
What:
 - `query.index` helper. It queries the index module, and aggregate the rest of requested fields/relations if needed like `query.graph`.
 
Not covered in this PR:
 - Hydrate only sub entities returned by the query. Example: 1 out of 5 variants have returned, it should only hydrate the data of the single entity, currently it will merge all the variants of the product.
 - Generate types of indexed data
 
 example:
 ```ts
 const query = container.resolve(ContainerRegistrationKeys.QUERY)
        
 await query.index({
  entity: "product",
  fields: [
    "id",
    "description",
    "status",
    "variants.sku",
    "variants.barcode",
    "variants.material",
    "variants.options.value",
    "variants.prices.amount",
    "variants.prices.currency_code",
    "variants.inventory_items.inventory.sku",
    "variants.inventory_items.inventory.description",
  ],
  filters: {
    "variants.sku": { $like: "%-1" },
    "variants.prices.amount": { $gt: 30 },
  },
  pagination: {
    order: {
      "variants.prices.amount": "DESC",
    },
  },
})
```
This query return all products where at least one variant has the title ending in `-1` and at least one price bigger than `30`.
 
The Index Module only hold the data used to paginate and filter, and the returned object is:
```json
{
  "id": "prod_01JKEAM2GJZ14K64R0DHK0JE72",
  "title": null,
  "variants": [
    {
      "id": "variant_01JKEAM2HC89GWS95F6GF9C6YA",
      "sku": "extra-variant-1",
      "prices": [
        {
          "id": "price_01JKEAM2JADEWWX72F8QDP6QXT",
          "amount": 80,
          "currency_code": "USD"
        }
      ]
    }
  ]
}
```

All the rest of the fields will be hydrated from their respective modules, and the final result will be:

```json
{
  "id": "prod_01JKEAY2RJTF8TW9A23KTGY1GD",
  "description": "extra description",
  "status": "draft",
  "variants": [
    {
      "sku": "extra-variant-1",
      "barcode": null,
      "material": null,
      "id": "variant_01JKEAY2S945CRZ6X4QZJ7GVBJ",
      "options": [
        {
          "value": "Red"
        }
      ],
      "prices": [
        {
          "amount": 20,
          "currency_code": "CAD",
          "id": "price_01JKEAY2T2EEYSWZHPGG11B7W7"
        },
        {
          "amount": 80,
          "currency_code": "USD",
          "id": "price_01JKEAY2T2NJK2E5468RK84CAR"
        }
      ],
      "inventory_items": [
        {
          "variant_id": "variant_01JKEAY2S945CRZ6X4QZJ7GVBJ",
          "inventory_item_id": "iitem_01JKEAY2SNY2AWEHPZN0DDXVW6",
          "inventory": {
            "sku": "extra-variant-1",
            "description": "extra variant 1",
            "id": "iitem_01JKEAY2SNY2AWEHPZN0DDXVW6"
          }
        }
      ]
    }
  ]
}
```

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2025-02-12 12:55:09 +00:00
Stevche RadevskiandGitHub 8d10731343 fix: Remove swc/core as a production dependency (#11416) 2025-02-12 13:22:59 +01:00
Shahed NasserandGitHub b3604ef862 docs: added express checkout guide (#10810)
* initial draft

* docs: add express checkout guide

* fix lint errors

* small fixes

* add screenshot in summary

* add meta image
2025-02-12 14:10:37 +02:00
Kasper Fabricius KristensenandGitHub a039dd6932 chore(admin-sdk): Pin Zod version (#11413)
**What**
In order to prevent multiple version to exists and that might not be compatible with one another, we fix the zod package version in the admin-sdk in complement to the starter
2025-02-12 10:30:46 +00:00
Kasper Fabricius KristensenandGitHub 47edd01dee fix(admin-vite-plugin,admin-bundler,ui,icons,dashboard,framework,types): Update Vite dependencies (#11414)
**What**
- Bumps the versions of Vite across the entire stack, to prevent an issue similar to what is described here: https://github.com/vitejs/vite/discussions/18271

Not entirely sure what was happening as I couldn't reproduce the issue, but Adrien faced the issue yesterday when working with local versions of our packages. It does appear as if the range we had before could lead to a version of Vite to be installed with said bug.
2025-02-12 10:09:39 +00:00
Carlos R. L. RodriguesandGitHub d6c03ee542 fix(utils): custom linkable keys (#11400)
**What**
Fix linkable generation when there is no dml models and models are provided as virtual to the joiner config and therefore the linkable are inferred
2025-02-11 16:59:21 +00:00
Shahed NasserandGitHub 5cb44d364d docs: general updates after 2.5.0 update (#11402) 2025-02-11 18:26:21 +02:00
Frane PolićandGitHub ca486aa7ed fix(dashboard): secret key display (#11365)
CLOSES CMRC-917
2025-02-11 15:08:46 +00:00
Paul NodetandGitHub 69cce1a4e2 refactor(ui): rename folder for calendar components (#11369)
Folder was previously named calender (sic)
2025-02-11 13:18:39 +00:00
7897bead63 chore(docs): Updated API Reference (automated) (#11396)
* chore(docs): Generated API Reference (automated)

* fixes

---------

Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2025-02-11 14:46:38 +02:00
Shahed NasserandGitHub 7ba178e2d6 docs: add documentation for product <> shipping profile link (#11397) 2025-02-11 14:46:03 +02:00
IgorKhomenkoandGitHub 1bf8766826 feat: added hook for createApiKeysWorkflow (#10909)
* added hook for createApiKeysWorkflow

* fix types

* fixed typings for createApiKeysWorkflow
2025-02-11 13:02:57 +01:00
dc94e62a6a chore(docs): Generated References (automated) (#11395)
Generated the following references:
- `api_key`
- `auth`
- `cart`
- `core_flows`
- `currency`
- `customer`
- `fulfillment`
- `inventory_next`
- `js_sdk`
- `medusa`
- `medusa_config`
- `modules`
- `modules_sdk`
- `notification`
- `order`
- `payment`
- `payment_models`
- `payment_provider`
- `pricing`
- `product`
- `promotion`
- `region`
- `sales_channel`
- `stock_location_next`
- `store`
- `tax`
- `types`
- `user`
- `utils`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2025-02-11 12:02:30 +00:00
34cd5b3f81 chore(docs): Updated UI Reference (automated) (#11393)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-02-11 11:56:10 +00:00
f22c5fa6af chore(docs): Generated DML JSON files (automated) (#11394)
* chore(docs): Generated DML JSON files (automated)

* fixes

---------

Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2025-02-11 13:40:36 +02:00
43180c1116 chore(docs): Update version in documentation (automated) (#11392)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2025-02-11 13:36:46 +02:00
Shahed NasserandGitHub 615b6f107e docs: document payment changes + account holder (#11242)
* docs: document payment changes + account holder

* added version
2025-02-11 13:27:10 +02:00