Commit Graph

6908 Commits

Author SHA1 Message Date
Christian
a0b747e117 feat: allow html content for notifications (#9613)
* feat: allow passing provider specific metadata to notification module

* changed providerContext to snake cased

* rename provider_context to content
2024-10-18 11:36:22 +02:00
Carlos R. L. Rodrigues
2a98be6b65 feat(medusa): ordem items endpoint (#9646) 2024-10-18 05:59:24 -03:00
Shahed Nasser
0a37675f0e docs: add routing page (#9550)
- Add a new homepage to `book` project for the routing page
- Move all main doc pages to be under `/v2/learn` (and added redirects + fixed links across docs)
- Other: add admin components to resources dropdown + fixes to search on mobile.

Closes DX-955

Preview: https://docs-v2-git-docs-router-page-medusajs.vercel.app/v2
2024-10-18 08:24:34 +00:00
Kasper Fabricius Kristensen
7a47f5211d fix(dashboard): Hide usage insights (#9651)
**What**
- Hides everything related to usage insights from the profile page.

**Why**
- We haven't set up usage insights tracking in V2, so hiding the UI for disabling/enabling it. We can re-add it again later if we decide we want to continue tracking how the dashboard is used.
2024-10-18 08:20:05 +00:00
Adrien de Peretti
876d8072e7 chore: Update modules providers configuration with 'identifier' and 'PROVIDER' (#9636)
* chore: Update modules providers configuration with 'identifier' and 'PROVIDER'

* update check

* fix tests

* type

* normalize auth provider

* emailpass

* providers

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-10-18 09:24:15 +02:00
Carlos R. L. Rodrigues
902ac12f73 chore: remove internal module resources option (#9582)
What:
* removes resouces type "shared" or "isolated" from internal modules.
* modules can have an isolated database connection by providing a database config as part of their options on `medusa-config`

CLOSES: FRMW-2593
2024-10-17 21:31:46 +00:00
Shahed Nasser
b07dd33a57 docs-util: add configuration to generate js-sdk reference (#9630) 2024-10-17 19:32:21 +03:00
Shahed Nasser
ab113cdc38 chore(js-sdk): add ignore tsdoc tag to client and constructor of inner classes (#9635) 2024-10-17 19:31:51 +03:00
Shahed Nasser
8fddabce04 docs: update curl request to /admin/products (#9641)
Closes DX-1026
2024-10-17 16:21:31 +00:00
Shahed Nasser
4ca5510da9 fix(types): change options to be required in http type (#9642)
`options` is now required when creating a product. This PR updates the http type
2024-10-17 16:13:17 +00:00
Shahed Nasser
31900239b7 fix(core-flows, types): general fixes to types and tsdocs (#9633)
- Export input type of `useQueryGraphStep` step
- Remove duplicate `OrderTransactionDTO`
- Fix some tsdoc errors
2024-10-17 15:50:19 +00:00
Kasper Fabricius Kristensen
10ae60e155 fix(ui): Fix Avatar styling (#9645)
Resolves CC-138
2024-10-17 15:26:00 +00:00
Kasper Fabricius Kristensen
902087e569 fix(dashboard): Ensure all progress tabs are 200px wide (#9644)
**What**
- Fixes onE FocusModal where the ProgressTabs weren't 200px wide. All others already have the correct width.

Resolves CC-110
2024-10-17 15:17:10 +00:00
Adrien de Peretti
3474d54a50 feat(medusa): Display admin url on start (#9643)
**What**
Display the admin url on server start in the console
<img width="452" alt="Screenshot 2024-10-17 at 16 07 10" src="https://github.com/user-attachments/assets/bc618371-2022-40fe-a573-4dff13f8a2ff">
2024-10-17 15:06:03 +00:00
Vraj Patel
7dbef9bedd fix(docs): update workflow API example to include query parameter (#9640)
### Fix Missing Query Parameter in Documentation Example

#### Summary
This pull request addresses a missing query parameter in the Medusa documentation's example for making a request to the workflow endpoint.

#### Issue
The example in the documentation incorrectly shows:
```
curl http://localhost:9000/workflow
```
This causes an issue when running the workflow in code, specifically in `step-2`, where the `name` parameter is `undefined`. 

#### Expected Behavior
The correct curl command should include the `name` query parameter, like so:
```
curl http://localhost:9000/workflow?name=john
```

#### Code Example
Here is the code that demonstrates the issue:

```ts
const step2 = createStep("step-2", async ({ name }: WorkflowInput) => {
  return new StepResponse(`Hello ${name} from step two!`)
})
```

When running the incorrect curl command, the output for `step-2` returns:
```
"Hello undefined from step two!"
```

#### Fix
The pull request proposes updating the example curl command in the documentation to:
```
curl http://localhost:9000/workflow?name=john
```

This ensures that the `name` parameter is correctly passed and resolves the issue of `undefined` values in `step-2`.

#### Steps to Reproduce
1. Implement the workflow and API code as described in the [documentation](https://docs.medusajs.com/v2/basics/workflows#4-test-workflow).
2. Run the curl command:
   ```
   curl http://localhost:9000/workflow
   ```
3. The console will output `Hello undefined from step two!` due to the missing `name` parameter.

#### Suggested Resolution
Update the curl command in the [documentation](https://docs.medusajs.com/v2/basics/workflows#4-test-workflow) to:
```
curl http://localhost:9000/workflow?name=john
```

### Related Issue
Link to the issue: [Medusa Issue #9628](https://github.com/medusajs/medusa/issues/9628)

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-10-17 14:51:43 +00:00
Kasper Fabricius Kristensen
b50ac9730e fix(dashboard): Fix styling of nested NavLinks (#9637)
**What**
Adds the `end` prop to NavLinks, so they only use their active style when the current path is a perfect match.
This was added to prevent MenuItems from extensions both showing the parent and child items as active, when the child route was active.

Also added a check to prevent users from adding nested settings NavLinks.


<img width="218" alt="Skærmbillede 2024-10-17 kl  14 25 12" src="https://github.com/user-attachments/assets/9e4d530a-c7b4-410e-aaaf-5a21ac86eb03">
<img width="221" alt="Skærmbillede 2024-10-17 kl  14 24 03" src="https://github.com/user-attachments/assets/6769b951-8e48-4725-a373-dc64ed6936ce">
2024-10-17 14:16:31 +00:00
Carlos R. L. Rodrigues
e9a06f4b4d fea(providers): locking postgres (#9545)
Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-10-17 13:11:39 +00:00
Riqwan Thamir
3b50c6d019 feat(core-flows,types,medusa): Add tax region update API (#9634)
* feat(core-flows,types,medusa): Add tax region update API

* chore: added specs
2024-10-17 14:19:29 +02:00
Frane Polić
2cba362537 fix(dashboard): cleanup Payments section (#9520)
**What**
- fix content breaking
- use a shorter payment ID in the UI

---

FIXES CC-572
2024-10-17 11:36:02 +00:00
Kasper Fabricius Kristensen
1d540af783 feat(dashboard): Submit forms on Cmd + Enter (#9623)
**What**
- Changes all forms to only submit on Cmd/Ctrl + Enter instead of just Enter.
- Cleans up the position of submit/cancel buttons in many FocusModals that still had them in the header.
- Fixes responsiveness of multiple forms
- Removes the SplitView component, and replaces its usages with StackedDrawer/Modal to align the UX across the project.

Resolves CC-103, CC-535
2024-10-17 09:38:12 +00:00
Oli Juhl
0be50059f2 fix: Add free text search on reservations (#9621) 2024-10-17 10:21:24 +02:00
Oli Juhl
df78f6e871 chore: Prepare changeset for 2.0 release (#9631) 2024-10-17 09:37:37 +02:00
Kasper Fabricius Kristensen
6a6fd6ee4c fix(dashboard,ui): Fix outline flash on FocusModal (#9624)
**What**
- Fixes an issue where the `outline` would flash on FocusModals when the focus was transferred to the modal.
- Fixes an issue where the selected value of the combobox component was misaligned for single value comboboxes.

Resolves CC-604
2024-10-17 06:56:08 +00:00
Frane Polić
06536e7655 fix(product): options validation if ids are same (#9622)
**What**
- fix validation of existing variant with options on update if the ids are same

---

FIXES CC-60
CLOSES https://github.com/medusajs/medusa/issues/9620
2024-10-17 06:55:16 +00:00
erickirt
89b9fd24b2 Switch the headings to match the content (#9619)
HEading and content was switched for payment and file modules
2024-10-17 06:49:17 +00:00
Carlos R. L. Rodrigues
f7fbc2f97c feat(core-flows): cart events (#9585) 2024-10-16 14:27:24 -03:00
Carlos R. L. Rodrigues
6a6c193042 chore(medusa): default endpoints size limit (#9616) 2024-10-16 14:27:01 -03:00
Adrien de Peretti
e911c6aebf fix(modules-sdk): Add missing paths to require.resolve in load resources (#9608)
FIXES FRMW-2747

**What**

Add missing `paths` options
2024-10-16 17:20:56 +00:00
Harminder Virk
68560787e5 breaking: rename package names to be consistent and under @medusajs scope (#9580) 2024-10-16 22:28:09 +05:30
Adrien de Peretti
cc1a25abb2 fix(utils): Mikro orm joined selection issue when select-in strategy (#9615)
* fix(utils): Mikro orm joined selection issue when select-in strategy

* fix types

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-10-16 17:43:18 +02:00
Frane Polić
c2a39c78f5 fix(dashboard): FF return reason table (#9614)
**What**
- fix an issue with text display in the table
- fix label

---

FIXES CC-603
2024-10-16 14:24:35 +00:00
Riqwan Thamir
449168578d fix(dashboard): Set correct method value on promotion (#9610)
<img width="1441" alt="Screenshot 2024-10-16 at 14 17 05" src="https://github.com/user-attachments/assets/7a2e2196-5ca6-4532-9bf0-a4b693c6babc">

RESOLVES CC-601
2024-10-16 12:31:39 +00:00
Shahed Nasser
ea5bff9034 docs: update providers to use ModuleProvider (#9579)
Document change introduced by #9544

> Note: fine to merge now as it requires generating references, which will only happen after the next release.
2024-10-16 11:37:14 +00:00
Shahed Nasser
3610d58f49 docs: fix heroku typo (#9382)
Closes #9356
2024-10-16 10:44:50 +00:00
Shahed Nasser
eed88c95ec docs: improved commerce modules [5/5] (#9592)
- Improve remaining commerce modules
- Other: add a note about using methods of the modules' main services.
2024-10-16 10:25:21 +00:00
Shahed Nasser
6e856d3156 docs: added examples page (#9587)
- Added an examples page with examples of all different concepts in Medusa. We'll probably add more examples with time as we see the need for them.
- Small fixes in different pages.

Preview: https://resources-docs-ocb5uyp0o-medusajs.vercel.app/v2/resources/examples
2024-10-16 10:07:39 +00:00
Shahed Nasser
ddcb749bc4 docs: added documentation for build command (#9604)
- Added documentation for `medusa build` command
- Update deployment documentation for admin to use `--admin-only` option
2024-10-16 09:37:40 +00:00
Shahed Nasser
f6d3453e6d docs: improved commerce modules [4/n] (#9517)
Improve pricing, product, and promotion modules docs

[4/n]
2024-10-16 09:34:36 +00:00
Carlos R. L. Rodrigues
eb364834de fix(types): logger (#9581) 2024-10-16 06:29:49 -03:00
Shahed Nasser
2b77bd85a6 docs-util: fixes for OAS docs generator + framework typedoc config (#9603)
* fix order replaced in OAS response + framework tsdoc config

* fix for some types
2024-10-16 12:17:28 +03:00
Shahed Nasser
714b9e6c98 docs: update resolve path to use src (#9605)
Update path used in `resolve` of modules to start with `src`
2024-10-16 09:10:30 +00:00
Harminder Virk
20428dac71 fix: resolve provider path before requiring it (#9601) 2024-10-16 14:17:55 +05:30
Kasper Fabricius Kristensen
3388764af4 fix(admin-vite-plugin): Replace slashes for Windows (#9602) 2024-10-16 08:39:07 +00:00
Shahed Nasser
6efb5897dc docs: fix package names in module registration (#9590)
* docs: fix package names in module registration

* update references
2024-10-16 09:05:07 +02:00
Kasper Fabricius Kristensen
813efeae51 fix(admin-vite-plugin): Normalize file paths and add tests (#9595)
**What**
- #9338 had a regression which caused the import path in some virtual modules to be invalid on Windows.
- This PR fixes the issue so we now again create the correct import paths, and adds tests to prevent this from slipping in again.
2024-10-15 16:48:56 +00:00
Adrien de Peretti
84fa6ccde5 chore: Update admin build/serve configuration (#9584)
**Breaking changes**

The `outDir` has been deprecated and wont be used anymore, instead all the path are computed internally following these rules
- if admin is not `disabled` and the `build` command is run without the `--admin-only` flag, then the admin output dir will be `.medusa/server/public/admin` and it will be served from that same location from the medusa instance.
- if admin is not `disabled` and the `build` command is run with the `--admin-only` flag, then the admin output dir will be `.medusa/admin` with the purpose of deploying the admin separately. ⚠️ (expect to receive a warning log)
- if the admin is `disabled` and the `build` command is run with the `--admin-only` flag, then fallback to rule number 2

| admin enabled  | medusa build --admin-only  | output dir |
|---|---|---|
| true  | true  | `.medusa/admin` ⚠️ (expect to receive a warning log) |
| true  | false  | `.medusa/server/public/admin`  |
| false  | true  | `.medusa/admin`  |
| false  | false  | none |

```diff
// medusa-config.ts

{
  // ...
  admin: {
-    outDir: 'some/path'
  }
}
```


cc @kasperkristensen @sradevski @olivermrbl
2024-10-15 15:59:47 +00:00
Carlos R. L. Rodrigues
4a03bdbb86 feat(providers): locking redis (#9544) 2024-10-15 12:40:24 -03:00
Adrien de Peretti
e77a2ff032 fix(utils): Reversed module package missing references (#9589)
**What**
When resolving the modules through an array, if the module does not have a joiner config to rely on (not `queryable`, not using the `Module` util), then the key should be provided to register the module in the container. Eventually, the module author should provide that key to be used.

The only exception is for the medusa modules where we have a map that allows us to resolve that key automatically from the path of the resolve value
2024-10-15 15:28:45 +00:00
Adrien de Peretti
e9383f25e0 fix(utils): update medusa config resolution for consistency (#9591) 2024-10-15 11:52:06 -03:00
Riqwan Thamir
537567b679 chore: add compare_at_unit_price when price list price is retrieved (#9564)
* chore: add compare_at_unit_price when price list price is retrieved

* chore: add test for update item + more fixes along the way

* chore: fix tests

* chore: add refresh spec

* Apply suggestions from code review

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: use undefined checker

* chore: switch to map

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-10-15 13:05:14 +02:00