Commit Graph

5165 Commits

Author SHA1 Message Date
Shahed Nasser
d345496dbc chore: added tsdocs for the Auth Module (#6863) 2024-04-05 12:01:08 +02:00
Shahed Nasser
f65e1dedbc chore: added tsdocs for Stock Location Next Module (#6817) 2024-04-05 12:00:46 +02:00
Shahed Nasser
f25d55bd4f chore: added tsdocs to the Inventory Next Module (#6814) 2024-04-05 12:00:23 +02:00
Shahed Nasser
72564c917f chore: add tsdocs for the Customer Module (#6784) 2024-04-05 11:59:08 +02:00
Shahed Nasser
8901e32dba chore: add tsdocs for the Store Module resources (#6795)
* chore: add tsdocs to Store Module resources

* added examples
2024-04-05 11:58:53 +02:00
Oli Juhl
eadc5e8a79 feat: Admin V2 API keys (#6883)
Add API key management UI for V2

This PR only adds publishable API key UI. Secret API key management will come in a follow-up PR.
2024-04-05 09:55:59 +00:00
Kasper Fabricius Kristensen
e915169e11 feat(dashboard): Edit variant options + create option callback for combobox (#6920) 2024-04-05 11:40:33 +02:00
Shahed Nasser
0bf0bf819b fix(admin-ui): Resolve node-gyp error during installation with npm (#6952)
Fix `node-gyp` error that occurs during installation when using NPM and 20+ versions of Node.js. The error results from the package `@stdlib/number-float64-base-normalize` which is a dependency of `@segment/analytics-next`. Installing v0.0.8 resolves the error.

More details in PR #6485

## Testing

To test out the fix:

1. In a Medusa backend, remove the installation of `@stdlib/number-float64-base-normalize` (if available) and add instead the following override:

```json
  "overrides": {
    "@medusajs/admin": {
      "@medusajs/admin-ui": "2.1.14-snapshot-20240405070935"
    }
  }
```

2. Remove node_modules + any previous package-lock.json
3. Change to node v20+ and use npm to install dependencies -> no error occurs during installation.
2024-04-05 07:56:39 +00:00
Adrien de Peretti
71aeda7347 fix(workflows-sdk): Handle result from a trasnformer after a step fail (#6951)
* fix(workflows-sdk): Handle result from a trasnformer after a step fail

* Create plenty-ravens-lay.md

* fix
2024-04-05 08:59:28 +02:00
Kasper Fabricius Kristensen
849010d875 feat(dashboard): Setup workflows in V2 routes (#6939) 2024-04-04 21:27:48 +02:00
Stevche Radevski
20e8df914e feat: Normalize known DB errors to a MedusaError when possible (#6922)
Before we would swallow the error and return a generic error to the user. This will provide more information to the caller if it is one of the known errors.
2024-04-04 19:12:59 +00:00
Adrien de Peretti
e944a627f0 feat: region payment providers management workflows/api (#6864) 2024-04-04 20:41:34 +02:00
Adrien de Peretti
12fcb655cd chore: Ensure Redis connection is ready with callback (#6924)
* chore(workflow-engine-redis): await for the connection callback

* cleanup

* cleanup

* Create early-rice-marry.md

* cleanup
2024-04-04 20:40:41 +02:00
Kasper Fabricius Kristensen
880bbbd4af feat(dashboard): Add forms for edit and create product options (#6907) 2024-04-04 18:14:05 +02:00
Philip Korsholm
fd3fc1384b Feat(dashboard): admin locations v2 (#6868)
* 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

* init

* undo versioning updates

* rm whitespace

* move common files to modules

* Update packages/admin-next/dashboard/src/v2-routes/locations/location-edit/location-edit.tsx

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

* rm logs

* fields instead of expands

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-04-04 14:45:05 +02:00
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