Commit Graph

5625 Commits

Author SHA1 Message Date
Carlos R. L. Rodrigues
a7844efd09 chore: move ModuleRegistrationName to utils (#7911) 2024-07-03 06:30:56 -03:00
Harminder Virk
46f15b4909 fix: inferring of relationship types (#7913)
FIXES: CORE-2448
2024-07-03 13:29:27 +05:30
Frane Polić
837ed093e3 fix(dashboard): few fixes (#7910)
* fix: fixes

* fix: inventory section row formatting with preline whitespace

* fix: manage zone areas
2024-07-03 09:34:03 +02:00
Kasper Fabricius Kristensen
492213cf03 fix(dashboard): add delete action to table (#7904) 2024-07-02 17:34:01 +02:00
Stevche Radevski
0dd927a26c fix: Select region and email by default for order (#7909) 2024-07-02 15:20:03 +00:00
Stevche Radevski
b4aa7fb9a7 fix: Disallow creating duplicate prices (#7866)
* fix: Disallow creating duplicate prices

* fix: Don't pass id to manager create in upsertWithReplace
2024-07-02 17:06:58 +02:00
Frane Polić
87375db9ef feat(dashboard): create shipment flow (#7898)
**What**
- add "Mark shipped" to Fulfillment section

---

CLOSES CORE-2427
2024-07-02 14:50:15 +00:00
Stevche Radevski
e3a0df3ba0 fix: Prefix the job workflow names with job (#7908) 2024-07-02 13:13:00 +00:00
Stevche Radevski
8244fe03b7 fix: Several fixes based on preview testing (#7906)
* fix: Add searchable properties on currency

* fix: Format product type dates in table

* fix: Preserve line whitespace in section row

* fix: Continue through tabs on Enter in create product form

* fix: Pagination in variant prices section

* fix: Add missing inventory edit item translation

* fix: Use the correct options URL for editing

* fix: Correctly get the variant title in inventory item details

* fix: Completely remove variant titles section in inventory item
2024-07-02 14:56:34 +02:00
Stevche Radevski
ef5f5363a1 fix: Delete before upsert in upsertWithReplace to handle relations with unique constraint (#7875) 2024-07-02 13:56:12 +02:00
Carlos R. L. Rodrigues
07715e6b50 chore(order): cancel return (#7881) 2024-07-02 06:52:58 -03:00
Harminder Virk
b3236ff31c Add support for native enums (#7903) 2024-07-02 15:22:09 +05:30
Shahed Nasser
0aeba83a66 docs: update scheduled jobs docs (#7905)
- Update scheduled jobs docs to support updated definition + remove coming soon notice
- Update scheduled jobs everywhere else they're used.
2024-07-02 09:41:15 +00:00
Shahed Nasser
6cb28eedf7 docs: document composite indices + primary key changes (#7902) 2024-07-02 12:34:44 +03:00
Kasper Fabricius Kristensen
a84e5a6ced fix(ui,dashboard): Revamp DatePicker component (#7891)
**What**
- Revamps the DatePicker component. 
- Addresses all issues with broken DatePickers across admin.

**Note**
- Part of this PR is adding a I18nProvider which is used to set the locale that is used for our DatePicker and Calendar components. Per default they use the browser locale. In the current implementation, we are grabbing the locale to use from the language that is picked in the "Profile" section. This means that currently the only possible locale is "en-US", meaning times uses AM/PM. This is likely not what we want, but we need to make a decision on how we want to handle this globally, will create a ticket for it and we can then clean it up later on.
- This PR does not include "presets" or a DateRange picker that were part of the old implementation. Will open tickets to re-add this later on, but since we aren't using it in admin any where it makes sense to address later.
- This PR also bumps and pin every `@radix-ui` dependency in `@medusajs/ui` and `@medusajs/dashboard`. Our different versions were pulling in multiple versions of internal radix dependencies which were breaking Popover and Dialog behaviour across admin. One thing to note is that Radix have started to print warnings for missing Descriptions and Titles in dialogs. We should add these as we go, for better accessibility. Its not an urgent task but something we can add as we clean up admin over the following weeks. 

CLOSES CORE-2382
2024-07-02 08:59:32 +00:00
Harminder Virk
074e4a888e Mark keys as primary with explicit method call (#7900) 2024-07-02 13:27:21 +05:30
Riqwan Thamir
b25c6ab54f chore(promotion): toast error messages on promotion errors (#7897) 2024-07-01 20:52:39 +02:00
Carlos R. L. Rodrigues
17e6a83b59 fix(utils): joiner config from medusa project (#7896) 2024-07-01 13:48:34 -03:00
Shahed Nasser
a8f2115157 docs: update pricing docs (#7895)
Update pricing docs following latest changes
2024-07-01 16:34:13 +00:00
Stevche Radevski
357621d5d6 fix: Correctly choose the existing price ID when editing variant prices (#7894) 2024-07-01 17:56:31 +02:00
Riqwan Thamir
d58a626d0a fix: fix tabs + required fields (#7892) 2024-07-01 17:23:45 +02:00
Stevche Radevski
5c7c28709f fix: Only list price set prices when calling the price set methods (#7889)
FIXES CORE-2417
2024-07-01 14:24:14 +00:00
Shahed Nasser
9b5f26adab chore: action to generate documentation references (#7888)
Added an action that triggers documentation actions generating references
2024-07-01 13:54:17 +00:00
Stevche Radevski
63e64e738a fix: Return null for calculated price if no prices are defined (#7886) 2024-07-01 15:09:21 +02:00
Shahed Nasser
dd864da4e0 generate references (#7882) 2024-07-01 16:02:36 +03:00
Shahed Nasser
b9036eca1a docs: generate OAS for v2 (#7883) 2024-07-01 15:35:45 +03:00
Shahed Nasser
8fde57263f fix(create-medusa-app): remove preview links (#7884)
Remove temporary doc links set in `STORE_CORS` and `ADMIN_CORS`
2024-07-01 12:16:12 +00:00
Stevche Radevski
9daec5d7ac chore: Migrate notification module to DML (#7835) 2024-07-01 09:17:32 +00:00
Stevche Radevski
c661180c44 feat: Completely revamp the pricing module (#7852)
* feat: Completely revamp the pricing module

* chore: Update all places to the new pricing interfaces

* fix: Remove unnecessary join to itself

* chore: Add data migration for existing users

* fix: Apply the correct index to price rule
2024-07-01 09:47:03 +02:00
Shahed Nasser
1f360a3245 docs-util: support models implemented with DML in typedoc custom plugins (#7847)
- Support generating reference for models implemented with DML
- Support resolving and generating mermaid diagram for relations

The Currency Module was used an example so its reference is generated to showcase the work of this PR.
2024-07-01 07:34:51 +00:00
Shahed Nasser
b62f23ea00 docs: additions and improvements to modules and DML documentation (#7854)
* docs: additions and improvements to modules and DML documentation

* small wording fix
2024-07-01 10:26:40 +03:00
Shahed Nasser
72f7500c84 chore(docs): DML API Reference (#7863)
* added dml options

* added tsdocs + configurations
2024-07-01 10:21:56 +03:00
Shahed Nasser
9ded63cc62 chore: OAS and TSDoc fixes (#7864) 2024-07-01 10:21:34 +03:00
Shahed Nasser
1842cd33cf docs: rename provider module to module provider (#7869)
* docs: rename provider module to module provider

* fix vale rule

* vale fixes
2024-07-01 10:21:19 +03:00
Shahed Nasser
2833e3c4d0 fix(order): set correct change type for exchanges (#7870) 2024-07-01 10:20:58 +03:00
Oli Juhl
fa6cd84049 chore: Migrate region module to use DML (#7837) 2024-06-29 13:14:52 +00:00
Stevche Radevski
7c3f5cc334 fix: Missed import breaks the variant price edit page (#7871) 2024-06-29 09:23:39 +02:00
Kasper Fabricius Kristensen
c1740218e9 feat(dashboard,types,js-sdk,ui): Add missing Price List features (#7856)
**What**
- Adds missing features to Price List domain
- Adds `StackedFocusModal` and `StackedDrawer` components that should replace SplitView across the project.
- Add Footer to FocusModal
- Adds missing js-sdk functions and types

**Note**
The DatePickers in the PriceLists forms do not work as intended atm. The component is broken, and needs to be fixed. I am working on a fix, but choose to move that work into a separate branch, to prevent this PR from getting bigger then it already is. Will update once the fixes have been merged.
2024-06-28 14:08:23 +00:00
Carlos R. L. Rodrigues
9f3998393b fix(totals): order item totals (#7867) 2024-06-28 09:34:25 -03:00
Sebastian Rindom
ef259b3386 fix: improve error message when config fails to load in build (#7810)
**What**

Throws the original error when failing to load medusa-config during build.

Before it only threw "Failed to load medusa-config". Now it does:
![CleanShot 2024-06-24 at 11  17 46@2x](https://github.com/medusajs/medusa/assets/7554214/11120038-bba8-4d94-a78a-e8556a4e7f75)
2024-06-28 08:10:27 +00:00
Riqwan Thamir
789d545b9e feat(utils,types): infer keys in query builder from schema (#7861) 2024-06-27 20:38:06 +02:00
Carlos R. L. Rodrigues
7602fe8b61 chore: totals refundable_total (#7857) 2024-06-27 13:56:55 -03:00
Riqwan Thamir
91098877c2 fix(utils): always apply default indexes (#7858)
what:

- fixes default indexes not being applied always
2024-06-27 16:05:28 +00:00
Riqwan Thamir
91faa5ffdb feat(utils): DML generates foreign key indexes by default (#7855)
**what:**

- adds default indexes on foreign keys when belongs to relationship is present

RESOLVES CORE-2404
2024-06-27 14:45:27 +00:00
Shahed Nasser
6e65158af3 docs-util: Upgrade typedoc to 0.26 (#7853)
Upgrade typedoc to v0.26 + make changes based on the update

Note: This update produces an error when generating model references when the models use the `createPsqlIndexStatementHelper` decorator. As this isn't a breaking error, and as we'll move to DML in the future, it's not necessary to spend time on a fix.
2024-06-27 10:52:44 +00:00
Riqwan Thamir
3f16b011fa feat(utils,types): DML Index can generate where SQL from a query builder (#7849)
what:

- introduces a simple query builder
- uses the query builder to tranform an object in where to SQL when applying indexes

```
Examples:
  { where: { column: null } } -> column IS NULL
  { where: { column: { $ne: null } } } -> column IS NOT NULL
  { where: { boolean_column: true } } -> boolean_column IS TRUE
  { where: { column: "value", another_column: { $ne: 30 } } } -> column = "value" AND another_column != 30
```

```
const user = model
  .define("user", {
    email: model.text(),
    account: model.text(),
    organization: model.text(),
  })
  .indexes([
    {
      on: ["organization", "account"],
      where: { email: { $ne: null } },
    },
    {
      name: "IDX-email-account-special",
      on: ["organization", "account"],
      where: {
        email: { $ne: null },
        account: null,
      },
    },
```

RESOLVES CORE-2392
2024-06-27 10:24:34 +00:00
Oli Juhl
b1df20b0dc fix(inventory): Entity Formulas + softDelete and restore (#7851) 2024-06-26 20:51:19 +02:00
Oli Juhl
b5f248f154 fix(region): Soft deleting region unsets region on countries (#7786)
**What**

Unset `region_id` on countries when soft deleting the associated region. Otherwise, countries cannot be added to new or other regions

Alternatively, we hard delete the region, which will trigger the DB level cascade

In both cases, we cannot easily restore the region countries.
2024-06-26 16:44:16 +00:00
Riqwan Thamir
5ee97d0e97 feat(utils,types): DML can apply composite indexes (#7842)
**what:**

- DML can apply composite indexes
- Where clause is currently a string, QB version will come as a follow up

```
model.define("user", {
  email: model.text(),
  account: model.text(),
}).indexes([
  {
    name: "IDX-unique-name",
    unique: true,
    on: ["email", "account"],
    where: "email is NOT NULL",
  },
])
```

RESOLVES CORE-2391
2024-06-26 15:39:04 +00:00
Adrien de Peretti
68dbcda84c fix: DML Enum property (#7846)
* fix: DML Enum property

* add more tests

* fix unit tests
2024-06-26 17:01:57 +02:00