Commit Graph

4950 Commits

Author SHA1 Message Date
Kasper Fabricius Kristensen
6c6e5307cf feat(dashboard): Setup V2 collections (#6935) 2024-04-04 14:06:44 +02:00
Stevche Radevski
06b2f0a8dc feat: Add some of the missing pieces in the create product form (#6918)
The changes are still partial, there is more work to be done to have everything function properly.
Also, refactored the file upload from the product media form to a separate component
2024-04-04 10:27:33 +00:00
Riqwan Thamir
483bf98a49 feat(medusa): added endpoints for rule attribute/operator/values options (#6911)
what:

adds endpoints that returns attribute options, operator options and value options for a particular rule.
2024-04-04 09:56:17 +00:00
Omar Hawwash
9ca38eba04 docs: Update fulfillment.AbstractFulfillmentService.mdx (#6936) 2024-04-04 09:36:16 +00:00
Kasper Fabricius Kristensen
7385a67dc7 feat(dashboard): Update v2 store domain to follow conventions, and abstract some logic (#6927)
**What**
- Updates the V2 store domain.
- Abstracts some of the API requests logic into re-usable hooks

**Note**
- Partial PR as we need to add support for setting a default currency, region and location. Currently the `q` param is missing on all V2 endpoints, so we can't use our combobox component to list these options. Will be added later when that has been fixed in core.
- The PR includes a generic hook for fetching combobox data, that I added before realising that `q` is not currently supported. But keeping it as it will be useful once support is added.
2024-04-04 07:15:17 +00:00
Kasper Fabricius Kristensen
3044ecaf61 fix promotions loader (#6928) 2024-04-04 07:34:43 +02:00
Adrien de Peretti
49f16ab08d fix(medusa): Fix get-query-config backward compatiblity (#6913) 2024-04-03 17:14:29 +02:00
Carlos R. L. Rodrigues
56c04f452c Fix(medusa-test-utils): config loader (#6919) 2024-04-03 09:28:40 -03:00
Adrien de Peretti
b3a3993423 fix(medusa-test-utils): recompute driver options (#6917)
* fix(medusa-test-utils): recompute driver options

* Create seven-bears-reply.md

* Update seven-bears-reply.md
2024-04-03 11:59:29 +02:00
Carlos R. L. Rodrigues
a164c0d512 feat(workflows-sdk,orchestration): async step as background task (#6886) 2024-04-03 11:17:00 +02:00
Shahed Nasser
3dcf5224a1 chore: updated TSDocs of the Currency Module (#6908)
Updated TSDocs of the Currency Module
2024-04-03 07:32:08 +00:00
github-actions[bot]
62752c70c8 chore(docs): Removed Docs Announcement Bar (automated) (#6915)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-03 07:12:17 +00:00
Philip Korsholm
edafe7db47 Feat(link-module, core-flows, medusa): Add sales channel location management (#6905)
* add locations with sales channels

* init, not working location based management

* working adding sales channel stock locations

* remote sales channels from location

* remove console log

* rm allowedFields

* redo errorhandler

* make validation take an array

* add changeset

* fix build

* Update packages/core-flows/src/sales-channel/workflows/remove-locations-from-sales-channel.ts

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* add default cases to return early

* cleanup

* add sc test and remove associations

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-04-03 08:38:53 +02:00
Adrien de Peretti
27f4f0d724 fix(fulfillment): Wrong type usage (#6914)
**What**
Fix the types used in the fulfillment module service interface
2024-04-02 16:22:57 +00:00
Kasper Fabricius Kristensen
982fb44cde fix(dashboard): Combobox should not disable body after being closed (#6909)
**What**
- Fixes an issue where opening a Combobox inside a modal, and then closing the modal would result in the body preserving the `pointer-events: none;` style.
2024-04-02 14:31:27 +00:00
Adrien de Peretti
82a176e30e chore(medusa-test-utils):Handle errors gracefully (#6901)
**What**
- Better error handling and error message
- update deps management and dynamic import/require
- Pass a new flag to the modules loaders for the module loaders to be able to act depending on it. In that case, the module can determine what should be run or not. e.g in the workflow engine redis, when we are only partially loading the module, we do not want to set the Distributed transaction storage
2024-04-02 14:10:17 +00:00
Oli Juhl
7895ff3849 feat: add sales channel management (#6761)
Add V2 sales channel management to admin

`@medusajs/medusa`
- Add `POST /admin/sales-channels/:id/products/batch/remove`
- Refactor cross-module filter middleware to comply with the latest convention

`@medusajs/admin-next`
- Add all sales channel routes
- Moves the following sales channel UI to shared components in `modules/sales-channel`:
  - sales-channel-list
  - sales-channel-edit
  - sales-channel-details
    - sales-channel-general-section
  - sales-channel-create

The sales-channel-product-section is not shared because the API in V2 will change.
The sales-channel-add-products component is not shared because the API in V2 will change.

`@medusajs/core-flows`
- Add `detachProductsFromSalesChannelsStep`
- Add `removeProductsFromSalesChannelsWorkflow`
2024-04-02 13:38:33 +00:00
Stevche Radevski
3dee91426e feat: Correctly define all product module models and SQL migration script (#6906)
The only thing remaining is modifying `upsertWithReplace` to handle many-to-many constraints correctly and not cascade updates to them. This is something that we should do separately though.
2024-04-02 12:27:12 +00:00
github-actions[bot]
7fe164bc1d chore(docs): Generated References (#6904)
Generated the following references:
- `inventory`
- `js_client`
- `medusa`
- `medusa_config`
- `medusa_react`
- `modules`
- `payment`
- `pricing`
- `product`
- `services`
- `stock_location`
- `tax_calculation`
- `types`
- `workflows`

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-02 10:06:06 +00:00
github-actions[bot]
85e5478873 chore(docs): Updated API Reference (#6831)
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>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-02 09:47:04 +00:00
Raiyan Sarker
9d466717f4 docs(plugin): paypal integration missing createOrder callback (#6401)
This PR adds missing information in paypal plugin docs which is crucial to its use. Previously, docs didn't mention about createOrder callback that is required by PayPal sdk to connect with backend for details like currency and amount to be charged. Medusa backend responds with required id for the PayPal sdk to use. Related to https://github.com/medusajs/nextjs-starter-medusa/issues/260#issuecomment-1944157985

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-02 08:10:35 +00:00
Stevche Radevski
b3ce13d61e fix: Fixes to product module and improving tests (#6898) 2024-04-02 07:13:46 +00:00
Kasper Fabricius Kristensen
b2763647f7 feat(dashboard): Variant edit form (#6870)
**What**
- Adds form to edit variant details.
- If stock and inventory modules are installed we omit inputs for stock and inventory as they should be managed in a separate form in that case. (Still a bit unsure about this, but its what we have in the current admin)
2024-04-01 16:38:49 +00:00
Shahed Nasser
8363dbec4f chore: update TSDocs of the Product Module (#6897)
Updated TSDocs of the Product Module.
2024-04-01 15:46:40 +00:00
Shahed Nasser
1ea0778264 chore: added TSDocs to auth_cors configuration (#6895)
Added description of `auth_cors` configuration as TSDoc comment
2024-04-01 15:21:23 +00:00
Sebastian Rindom
2e914a5fc5 fix: ensure that shutdown works in loaderOnly mode (#6893) 2024-04-01 13:56:42 +00:00
github-actions[bot]
68aa0971a2 chore(docs): Generated References (#6896)
Generated the following references:
- `inventory`
- `js_client`
- `medusa`
- `medusa_config`
- `medusa_react`
- `modules`
- `payment`
- `pricing`
- `product`
- `services`
- `stock_location`
- `tax_calculation`
- `types`
- `workflows`

Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2024-04-01 13:35:12 +00:00
Oli Juhl
9fdced2c27 feat: Admin V2 users domain (#6844) 2024-04-01 15:03:48 +02:00
Stevche Radevski
585818eaf8 feat: Pricing update and refactor product API tests to not rely on internals (#6892)
This PR achieves the following
- Remove dependency on internals for seeding the tests (more work left, but major work done)
- Adds the workflow for updating variant's price

I will do a follow-up PR to further clean up the tests and remove all internal dependencies
2024-04-01 09:33:52 +00:00
Shahed Nasser
fe1d3a4a78 feat(create-medusa-app): Add a --verbose option. (#6027)
## What

Adds a `--verbose` option that shows the output of all underlying processes in real-time.

## Why

This is helpful for testing and debugging issues, especially issues that the community runs into. We can ask community members to pass the `--verbose` option and provide us with the outputted logs if they face problems.

## Caveats

When installing the Next.js starter then terminating the process, the main and child processes don't receive the abort signal as it seems to occur in the child process. This leads to the command continuing but then running into an error in the next step.

As this option is only used for debugging, I don't think it's a big issue.

## Testing

Run the `create-medusa-app` snapshot below with `--verbose` option. Or, change to the `packages/create-medusa-app` directory and run:

```bash
yarn dev --directory-path ~/some-dir --verbose
```

> The `--directory-path` option in this case is necessary as installing the medusa backend in the current `packages/create-medusa-app` directory leads to errors related to yarn workspaces.
2024-04-01 09:13:44 +00:00
Frane Polić
e58e81fd25 feat(dashboard): admin 3.0 order refund form (#6850) 2024-04-01 10:55:42 +02:00
Stevche Radevski
1a48fe0282 feat: Add v2 product types endpoints (#6880)
Also adjusts the product type module APIs to follow the conventions
2024-03-29 19:27:10 +00:00
Oli Juhl
1bcb13f892 feat: Remove sales channels from pub keys (#6876)
**What**
- Add workflow + step for detaching sales channels from pub API keys
- Tweak linking error message to be more helpful
- Add `removeRemoteLink` step to delete API key workflow
2024-03-29 15:01:10 +00:00
Adrien de Peretti
8fd1488938 chore: medusa shutdown (#6865)
* chore: medusa shutdown

* continue

* use shutdown

* on application shutdown

* consume shutdown

* more connection close

* more cleanup

* more cleanup

* update lock

* revert package

* graceful shutdown

* Create yellow-apples-attack.md

* graceful shutdown

* graceful shutdown

---------

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-29 09:22:29 -03:00
Riqwan Thamir
0c0b425de7 feat(medusa-react,medusa,types,dashboard): added empty state + table for promotions list page (#6827)
what:

- adds empty state for promotions list page
- lists all promotions with pagination

<img width="1663" alt="Screenshot 2024-03-26 at 14 19 27" src="https://github.com/medusajs/medusa/assets/5105988/ed0d5c65-d003-40f5-b899-540970d892f5">


<img width="1664" alt="Screenshot 2024-03-27 at 20 46 17" src="https://github.com/medusajs/medusa/assets/5105988/4aa40f09-fe3f-4f34-af7a-f5c183254c76">
2024-03-29 11:22:42 +00:00
pepijn-vanvlaanderen
6113af0a66 fix(medusa): Deleted discount missing on order (#6837)
* Fix deleted discount missing on order

* Added integration test

* Added changeset
2024-03-29 11:51:27 +01:00
Stevche Radevski
86f499de2f feat: Implemented price set update with prices and aligned pricing API (#6872) 2024-03-29 10:23:24 +00:00
Geoffroy Empain
85a27c3572 fix(inventory): cannot migrate existing products (#6877) (#6878)
* fix(inventory): cannot migrate existing products (#6877)

* chore: add changeset (#6821)

---------

Co-authored-by: Geoffroy Empain <geoffroy@charlie-bravo.be>
Co-authored-by: Stevche Radevski <sradevski@live.com>
2024-03-29 11:05:12 +01:00
Carlos R. L. Rodrigues
1c6ba4468e feat(modules-sdk): remote query retrieve (#6849)
What:

Remote Joiner options to check if keys exist on entry points or relations
2024-03-29 09:26:24 +00:00
Stevche Radevski
cbb5e6bd99 feat: Refactor the product module definitions and implementation (#6866)
There are several things done in this PR, namely:

Unify the service endpoints API to always work with a model rather than allowing to pass both ID and model (eg. both type_id and type being available in the request to create).
Start using upsertWithReplace to simplify the code and fix some deassociation bugs
Apply some changes to tests to deal with the pricing breaking changes
Correctly define the model relationships (with both ID and entity fields available)
All tests for the product are passing, which should bring us back to a great baseline.
2024-03-29 09:03:41 +00:00
Carlos R. L. Rodrigues
e603726985 fix(workflow-engine-*): subscribe response and error (#6869) 2024-03-29 08:23:41 +00:00
Oli Juhl
d97af91a8d feat(admin-next): Email password invite flow in admin 2.0 (#6821) 2024-03-29 08:05:11 +01:00
Carlos R. L. Rodrigues
45c49e89f2 chore(workflows-sdk): add idempotencyKey to shared context (#6860) 2024-03-28 17:51:29 +00:00
Shahed Nasser
412111e1ea chore: fix doc announcement actions (#6856)
- Fix error in doc announcement actions due to missing build step.
- Update the announcement in the docs to the latest version
2024-03-28 17:23:25 +00:00
Philip Korsholm
18438a695a feat(medusa, stock-location-next): add list-stock-locations endpoint to api-v2 (#6788)
* initial create

* add list for stock locations

* add changeset

* redo changes for stock locatino module'

* add changeset

* naming

* prep for pr

* move integration tests

* fix pr feedback

* add changeset

* update changeset

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-28 17:33:26 +01:00
Stevche Radevski
a6562d2a41 feat: Modify the abstract repository upsert to handle subresources as per convention (#6813)
* feat: Modify the abstract repository upsert method to handle subresources correctly

* fix: Preserve the upsertWithResponse order in the response, and return all the data

* fix: Create integration tests folder for mikro orm utils that run against the DB

* fix: Remove many-to-one creation and additional changes based on PR review
2024-03-28 15:28:57 +01:00
Shahed Nasser
21156f945d docs-util: added AI generator (#6770)
## What

Adds an AI generator to the docblock tool that uses OpenAI.

The generator at the moment only generates examples for functions when the `--generate-examples` option is provided.

## Note

I've included the generated examples of the `IOrderModuleService` as a reference of the type of result provided by the AI generator, with minor tweeks I've made. I haven't made any changes to descriptions in that file.
2024-03-28 11:32:30 +00:00
Sebastian Rindom
6bf4d40856 chore(medusa-test-utils): create declaration file (#6858)
**What**
- Fixes tsconfig to ensure a declaration file is included in the build.

**Why**
- Ensure tsserver can understand things from medusa-test-utils
- Get rid of "Could not find a declaration file for module" warning in editors.
2024-03-28 10:43:25 +00:00
Oli Juhl
ea8d9d4d42 feat: API key sales channel link (#6851)
What
- Add link between API key and sales channels
- Add API route for batch adding sales channels to a publishable API key
- Clean up API key API routes responses
- Move API key test suite from `integration-tests/modules` to `integration-tests/api`
2024-03-28 10:15:11 +00:00
Adrien de Peretti
6ee2ee845c fix(): medusa test runner (#6857) 2024-03-28 10:33:40 +01:00