Commit Graph

517 Commits

Author SHA1 Message Date
Riqwan Thamir
5ab15a2988 feat(dashboard,js-sdk,admin-shared): add customer addresses + layout change (#11871)
what:

- changes customer layout from 1 layout to 2
- adds ability to create and delete customer addresses
- adds 2 customer widget locations
- adds is_giftcard=false by default to products list

<img width="1663" alt="Screenshot 2025-03-08 at 21 34 02" src="https://github.com/user-attachments/assets/e66f05da-718c-4c25-81ce-67ba0a814ca3" />
2025-03-17 16:16:27 +00:00
Kasper Fabricius Kristensen
cc4c5c86e2 chore(ui-preset,icons,dashboard) (#11734)
* update icons

* update ui-preset

* chore(ui-preset,icons): Sync with Figma 5/3/2025

* chore(ui-preset,icons): Sync with Figma
2025-03-17 16:51:57 +01:00
Frane Polić
3db146c56e fix(dashboard): display inventory item sku (#11856)
CLOSES SUP-1171
2025-03-17 11:48:44 +00:00
Kasper Fabricius Kristensen
3063d6e601 fix(dashboard): Include thumbnail in default product query (#11825)
RESOLVES CMRC-984
2025-03-13 16:26:39 +00:00
Radek Napora
c97eaa0e0d Polish translations improvements (#11808)
* Polish translations improvements

* Improve Polish pluralization rules

---------

Co-authored-by: Stevche Radevski <sradevski@live.com>
2025-03-12 11:58:48 +01:00
Kasper Fabricius Kristensen
ec56a8bc85 fix(medusa,utils,test-utils,types,framework,dashboard,admin-vite-plugin,admin-bundler): Fix broken plugin dependencies in development server (#11720)
**What**
- Reworks how admin extensions are loaded from plugins.
- Reworks how extensions are managed internally in the dashboard project.

**Why**
- Previously we loaded extensions from plugins the same way we do for extension found in a users application. This being scanning the source code for possible extensions in `.medusa/server/src/admin`, and including any extensions that were discovered in the final virtual modules.
- This was causing issues with how Vite optimizes dependencies, and would lead to CJS/ESM issues. Not sure of the exact cause of this, but the issue was pinpointed to Vite not being able to register correctly which dependencies to optimize when they were loaded through the virtual module from a plugin in `node_modules`.

**What changed**
- To circumvent the above issue we have changed to a different strategy for loading extensions from plugins. The changes are the following:
  - We now build plugins slightly different, if a plugin has admin extensions we now build those to `.medusa/server/src/admin/index.mjs` and `.medusa/server/src/admin/index.js` for a ESM and CJS build.
  - When determining how to load extensions from a source we follow these rules:
    - If the source has a `medusa-plugin-options.json` or is the root application we determine that it is a `local` extension source, and load extensions as previously through a virtual module.
    - If it has neither of the above, but has a `./admin` export in its package.json then we determine that it is a `package` extension, and we update the entry point for the dashboard to import the package and pass its extensions a long to the dashboard manager.

**Changes required by plugin authors**
- The change has no breaking changes, but requires plugin authors to update the `package.json` of their plugins to also include a `./admin` export. It should look like this:

```json
{
  "name": "@medusajs/plugin",
  "version": "0.0.1",
  "description": "A starter for Medusa plugins.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "files": [
    ".medusa/server"
  ],
  "exports": {
    "./package.json": "./package.json",
    "./workflows": "./.medusa/server/src/workflows/index.js",
    "./.medusa/server/src/modules/*": "./.medusa/server/src/modules/*/index.js",
    "./modules/*": "./.medusa/server/src/modules/*/index.js",
    "./providers/*": "./.medusa/server/src/providers/*/index.js",
    "./*": "./.medusa/server/src/*.js",
    "./admin": {
      "import": "./.medusa/server/src/admin/index.mjs",
      "require": "./.medusa/server/src/admin/index.js",
      "default": "./.medusa/server/src/admin/index.js"
    }
  },
}
```
2025-03-11 11:28:33 +00:00
olivermrbl
f1cac99316 chore: Version packages 2025-03-10 15:44:09 +01:00
Frane Polić
4c28efaadc fix(dashboard): display minute instead of month (#11731)
**What**
- display minutes instead of months
- remove manual offsetting since the server returns ISO format and JS date converts it to local time

---

CLOSES SUP-1069
2025-03-10 11:07:52 +00:00
Frane Polić
bd4428c40e fix(dashboard): allow creating fulfillment for items without shipping profile (#11733)
* fix: allow creating fulfillment of items without shipping profile

* fix: move quantity filtering
2025-03-09 13:48:41 +01:00
Oli Juhl
3b470f4142 chore: remove ranges on medusa packages (#11738) 2025-03-06 14:17:05 +01:00
olivermrbl
5d74ac3cc3 chore: Version packages 2025-03-04 14:11:37 +01:00
Frane Polić
e23f204b7c fix(dashboard, core-flows, medusa): prevent creation of empty fulfillments (#11664) 2025-03-03 16:54:20 +00:00
Kasper Fabricius Kristensen
c28ae573e5 fix(dashboard): Use derived state in DataTable (#11487)
**What**
- Uses derived state in DataTable, to prevent the state in the URL and component from going out of sync.
- Introduces a way for RouteModals to restore URL params on close.

Resolves CMRC-936
2025-03-03 14:18:19 +00:00
Riqwan Thamir
954136f13a fix(dashboard): bust variant inventory cache on inventory update (#11690) 2025-03-03 12:53:34 +01:00
Frane Polić
7465604ae5 fix(dashboard): variant inventory section (#11669)
**What**
- fix fetching data need to display the info properly
- display condition

---

CLOES SUP-996
2025-03-03 10:46:10 +00:00
Furman
39597b6b52 Add missing translations & change some badly translated (#11670) 2025-03-03 09:08:44 +01:00
Frane Polić
bdf9723239 fix(dashboard): filter outbound shipping options in RMA (#11629)
**What**
- filter out return shipping options for Claims/Exchanges
- fix the incorrect display of "missing inventory" warning

---

CLOSES CMRC-946
CLOSES CMRC-947
2025-02-28 14:55:35 +00:00
Frane Polić
4b7c6d7dd9 fix(dashboard): few admin bug fixes (#11655)
**What**
- OE id bug
- prevent canceling shipped/delivered fulfillment

---

CLOSES CMRC-935
CLOSES CMRC-938
2025-02-28 09:13:47 +00:00
Frane Polić
de0798dbed fix(dashboard): display CG in PL configuration details (#11653)
CLOSES CMRC-966
2025-02-28 09:12:45 +00:00
Oli Juhl
54a6ef91ac chore: Move token from params to headers (#11281)
* chore: Move token from params to body

* chore: Add type

* wip

* chore: clean up

* clean ip
2025-02-26 17:41:16 +01:00
olivermrbl
3f7470022c chore: Version packages 2025-02-24 11:36:46 +01:00
Georgi Bachev
92bffadbf9 Adding Bulgarian translations to the admin dashboard. (#11565) 2025-02-24 09:29:53 +01:00
Adrien de Peretti
0307304dc6 fix(dashboard): Prevent overfetching data (#11532)
**What**
Currently, the dashboard is fetching way more data than needed to display the products. This can lead to issues for complex catalog. this pr aim to reduce the data to be fetched to exactly what is needed.
<img width="2553" alt="Screenshot 2025-02-19 at 15 08 16" src="https://github.com/user-attachments/assets/b00e856c-e040-4f05-9f15-41fb8d299387" />
2025-02-19 14:26:22 +00:00
Frane Polić
0c530e90c5 feat(core-flows, types): add has missing inventory flag when listing shipping options (#11493)
**What**
- add `insufficient_inventory` flag when listing shipping options for a cart
- add `enabled_in_store` flag when creating/editing pickup options
2025-02-19 08:08:25 +00:00
Kasper Fabricius Kristensen
3b69f5a105 fix(dashboard): Properly delete metadata keys, and fix number parsing (#11466)
**What**
- Fixes an issue where we would parse a string like `"52 tests"` into `52` in the Metadata form
- If a row is deleted we now send off key with an empty string as its value to signify that it should be deleted. This is needed to introduce the API we had for updating metadata in V1. Adrien is implementing the BE support for this.

RESOLVES SUP-895
2025-02-18 10:28:24 +00:00
Kasper Fabricius Kristensen
06cc658246 fix(dashboard): Allow using the Enter key in product create Textarea (#11488)
Resolves SUP-911
2025-02-18 10:21:26 +00:00
Frane Polić
ee848bf0f4 feat(core-flows, dashboard, medusa, types): optional shipping profile (#11434)
* feat: create product flow changes

* feat: allow unsetting SP on product update

* feat: update prepare line item helper

* test: add testcase

* wip: fix tests

* fix: update module tests

* fix: cart module test
2025-02-17 19:08:59 +01:00
Kasper Fabricius Kristensen
b53ea77658 feat(ui,dashboard): Move InlineTip to UI package (#11462) 2025-02-17 09:16:29 +00:00
Kasper Fabricius Kristensen
03b8bda1ba fix(dashboard): Fix size of buttons and use Link to navigate (#11366)
**What**
- Fixes the wrong `size` being used for the allocate items button.
- Updates the buttons that link to somewhere to use a Link and asChild instead of an onClick.
2025-02-14 15:19:31 +00:00
Frane Polić
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
Kasper Fabricius Kristensen
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
Kasper Fabricius Kristensen
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 Kristensen
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
Frane Polić
ca486aa7ed fix(dashboard): secret key display (#11365)
CLOSES CMRC-917
2025-02-11 15:08:46 +00:00
olivermrbl
682dcf6507 chore: Version packages 2025-02-11 12:00:43 +01:00
Oli Juhl
db03738b5f chore: Revert version range to ^ (#11390) 2025-02-11 11:35:25 +01:00
Kasper Fabricius Kristensen
3dbef519d9 fix(admin-vite-plugin,icons,ui,dashboard): Upgrade vitest in all packages and align Vite version (#11361) 2025-02-09 11:46:50 +01:00
Kasper Fabricius Kristensen
d00825485f feat(ui,dashboard): Move Divider component to UI package (#11357) 2025-02-09 11:46:30 +01:00
Frane Polić
d58c056c53 fix:(dashboard) pending difference rounding on order details page (#11336)
**Why**
- if pending difference is lass then the rounding threshold for currency the page would show for example "Refund -0.00$"

**What**
- example: hide the refund button if the pending difference in USD is -0.004
- example: show refund button if pending difference on USD is -0.007

---

CLOSES SUP-811
CLOSES https://github.com/medusajs/medusa/issues/11331
2025-02-07 15:24:43 +00:00
Kasper Fabricius Kristensen
fcd3e2226e feat(ui,dashboard): Migrate SC tables to DataTable (#11106) 2025-02-07 14:26:49 +00:00
Kasper Fabricius Kristensen
211997b137 fix(dashboard): Remove wrongful import of utils function (#11338)
Resolves SUP-819
2025-02-06 17:14:50 +00:00
Kasper Fabricius Kristensen
7d208afb07 fix(dashboard): Ensure conditional prices are assigned to region (#11335) 2025-02-06 16:55:11 +01:00
Frane Polić
742babfe3f fix(core-flows): shipping profile update (#11322)
**What**
- prevent unsetting shipping profile on product update
2025-02-05 14:37:43 +00:00
Kasper Fabricius Kristensen
6db96c80d0 fix(ui,types): Add Metadata form for collection (#11300)
**What**
- Adds missing Metadata form for collections
- Fixes type of metadata in update payload
- Fixes an issue where deleting the last row of a metadata form would prevent adding new ones.

Resolves SUP-784
2025-02-05 12:53:30 +00:00
Stevche Radevski
87db3f0c45 fix: Use the correct currency for edit promotions form (#11307)
FIXES #11297
2025-02-04 17:15:15 +00:00
Kasper Fabricius Kristensen
f07af7b93c fix(dashboard,core-flows,types,medusa): Allow editing Order metadata (#11285)
Resolves SUP-780
2025-02-04 10:08:20 +00:00
Ertaç Paprat
1185878ecd fix(admin-ui): update Turkish translations (#11250)
- Add missing translations for inventory stock management
- Fix customer groups list structure
- Add missing order fulfillment error messages
- Update promotion status structure
- Add missing shipping options translations
- Fix various translation inconsistencies

Co-authored-by: epaprat <you@example.com>
2025-02-04 10:30:20 +01:00
Harminder Virk
f4c2cd112e fix: issues with peer dependencies (#11272) 2025-02-03 18:46:03 +05:30
Kasper Fabricius Kristensen
9822bd930b chore(ui,dashboard): Use radix-ui package (#11195)
* update deps for ui

* chore(ui,dashboard): Use radix-ui package

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-02-02 14:20:34 +01:00
Kasper Fabricius Kristensen
51d2960a57 fix(dashboard): Allow admins to update default Sales Channel and Stock Location (#11196)
**Note** The huge diff is because the i18n schema wasn't formatted properly again. Not sure how that happened with the update to the script but perhaps someone didn't update their branch to include the change to format the schema on creation.
2025-01-29 16:14:47 +00:00