Commit Graph

4112 Commits

Author SHA1 Message Date
Shahed Nasser
18a05dee86 fix(create-medusa-app): fix inconsistency in checking errors in migrations (#5189) 2023-09-29 08:26:24 -04:00
Riqwan Thamir
1e7db5a5cb feat(pricing, types, utils): Exact match based on context + fallback on rule priority if not (#5214)
* initial

* initial service

* update pricing module service

* add integration test for rule-type

* update pricing-module integration tests

* update pricing service interface

* feat(pricing): PriceSets as entry point to pricing module

* chore: add price set money amount

* chore: add price set money amount

* chore: change name of test

* chore: added changeset

* chore: use filterable props from money amount in price sets

* chore: update migrations

* test update integration test

* fix weird behavior

* Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>

* Apply suggestions from code review

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>

* move rule-type to common

* chore: reset migration

* chore: remove incorrect conflicts

* chore: address review

* chore: remove ghost price list

* Apply suggestions from code review

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

* update id prefix

* use persist not persistAndflush

* rename key_value to rule_attribute

* more renaming

* feat(types,pricing): add price set money amount rules to pricing module

* chore: cleanup + add test cases for relationship update

* chore: revert package json

* chore: cleanup

* initial

* update pricing module service

* update pricing-module integration tests

* update pricing service interface

* chore: update migrations

* fix weird behavior

* Apply suggestions from code review

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>

* move rule-type to common

* chore: delete duplicate migration files

* fix(link-modules): Fix link module initialization (#4990)

**What**
Add a new configuration on the relationship to specify if the relation is consumed from an internal service (from medusa core). In that case do not check if the service is part of the loaded modules

* initial price rule

* rebase develop

* save here

* final changes to create

* update price rule integration test

* add module integraiton tests for price rules

* fix merge

* redo wierd order change

* pr cleanup

* pr cleanup

* pr cleanup

* update pr

* sort out migrations

* [wip]

* wip

* chore: temporarily emulate mikroorm internals

* currency code hard filtering

* before creating subqueries

* chore: wip

* chore: wip

* chore: add exact match multiple contexts

* chore: add one more test

* chore: add query that works with exact match

* chore: qb the thingy

* chore: add some comments

* chore: removed extra filter

* chore: added some more comments + prettify

* chore: test with carlos

* chore: add fallbacks and exact match tests

* chore: cleanup

* feat(types,pricing): add price set money amount rules to pricing module (#5065)

* initial

* initial service

* update pricing module service

* add integration test for rule-type

* update pricing-module integration tests

* update pricing service interface

* feat(pricing): PriceSets as entry point to pricing module

* chore: add price set money amount

* chore: add price set money amount

* chore: change name of test

* chore: added changeset

* chore: use filterable props from money amount in price sets

* chore: update migrations

* test update integration test

* fix weird behavior

* Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>

* Apply suggestions from code review

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>

* move rule-type to common

* chore: reset migration

* chore: remove incorrect conflicts

* chore: address review

* chore: remove ghost price list

* Apply suggestions from code review

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

* update id prefix

* use persist not persistAndflush

* rename key_value to rule_attribute

* more renaming

* feat(types,pricing): add price set money amount rules to pricing module

* chore: cleanup + add test cases for relationship update

* chore: revert package json

* chore: cleanup

---------

Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

* chore: minor cleanup

* chore: added money amount scoping

* chore: added review comments

* chore: update changset and undo test scoping

* chore: introduce group by util + no queries on empty context

* Feat/pricing module methods (#5218)

chore: add removePrices to pricing module

* Revert "Feat/pricing module methods (#5218)" (#5236)

This reverts commit 95c8aaa66423d290a35b6e736e5b187e12d44a36.

* chore: review changes

* chore: update schema

* chore: reset migration

---------

Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2023-09-29 13:23:41 +02:00
Tek Loon
dc298acefc docs(admin-ui): Fix incorrect Radix UI Select Reference Link (#5248)
* fix: add ProductCollectionDetailsWidgetProps

* fix(doc): fix incorrect Radix UI Select reference link

---------

Co-authored-by: Tek Loon <tekloon.1991@gmail.com>
2023-09-29 12:47:11 +03:00
Philip Korsholm
2b91049f58 fix(medusa): quantity prices for line item updates (#5137)
* initial code push

* update metadata and only merge if the existing line item allows merging

* update should_merge check

* undo changes to taxrate service

* update results with unit pricing corresponding to the db values after update

* add should_merge property to line_item creation

* add should_merge property to line_item creation

* fix unit tests

* undo adding "should_merge" to create-line-item

* undo change to "addOrUpdateLineItem"

* :wqh_merge from generate method

* undo changes to unit tests

* revert to adding pricing in updateLineItem method

* update cart service test

* Create funny-radios-juggle.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-09-28 14:26:58 +02:00
Peter Abdalla
f88e3865a0 feat(admin-ui): Add Arabic translations (#5140) 2023-09-27 16:46:21 -04:00
Shahed Nasser
70484b4cd4 docs: add Next.js steps to digital product recipe (#5231)
* docs: add Next.js steps to digital product recipe

* fix eslint errors
2023-09-27 20:32:10 +03:00
Shahed Nasser
aecf719871 docs(ui,docs): added upgrade guides link to UI docs (#5240)
* added medusa ui index page

* remove console
2023-09-27 20:06:03 +03:00
Shahed Nasser
11b2f1237b docs: fix irregular scrolling in code tabs (#5239)
* docs: fix blocking scroll util

* remove unnecessary util methods
2023-09-27 19:17:04 +03:00
Kasper Fabricius Kristensen
4e3f3b54cb docs(ui,docs): Add documentation for Medusa UI 2.0.0 (#5227)
* add docs for medusa ui 2.0.0

* fix: copy as child example

* fix: dropdown menu example

* add accordion examples

* fix lint issues

* fix apos in progress tabs demo

* resolve comments

* add icon

* bump z-index on modals to prevent clashing with navbar

* add sidebar item and card

* undo modal z index changes

* add links to updated and new components

* update version

* rm inline code formatting on links

---------

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-09-27 18:56:25 +03:00
Shahed Nasser
f5a698ad6f docs: fix code block's usage of z-index (#5238) 2023-09-27 18:48:18 +03:00
Shahed Nasser
6942a907a5 docs: fix z-index across projects (#5234)
* docs: fix z-index across projects

* remove usage of z-index in UI docs
2023-09-27 16:38:59 +03:00
Adrien de Peretti
c68ba63c1b fix(medusa): In product isolation, throw if product not found (#5224)
**What**
Throw not found error if product does not exists
2023-09-27 12:41:50 +00:00
Shahed Nasser
4c8836b488 docs: fix feedback fields not being passed to tracking (#5225) 2023-09-27 11:00:17 +03:00
github-actions[bot]
478277408c chore(docs): Removed Docs Announcement Bar (automated) (#5223)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
2023-09-27 09:45:51 +03:00
Oli Juhl
a9972d7d6f fix(medusa-react): @medusajs/medusa-js import (#5207)
* fix(medusa-react): @medusajs/medusa-js import

* Create short-wolves-breathe.md

---------

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2023-09-26 16:27:50 -04:00
olivermrbl
30233712cb chore(changesets): Bump @medusajs/orchestration 2023-09-26 15:58:26 -04:00
Shahed Nasser
987dd8f568 docs: expanded rating form + UI docs improvement (#5211)
* docs: expanded rating form + UI docs improvement

* added props table + changed example
2023-09-26 20:26:09 +03:00
Shahed Nasser
dee3419fe8 docs: fix details component + other styling fixes (#5217)
* docs: fix details component

* general styling fixes
2023-09-26 19:03:07 +03:00
Philip Korsholm
bc42b201ea feat(pricing): add price rule entity (#5050)
**What**
- add price-rule entity to pricing module

blocked by #4977 

Fixes CORE-1497

Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2023-09-26 12:59:55 +00:00
Carlos R. L. Rodrigues
b3f1135fba chore(medusa): link modules as medusa dependency (#5208) 2023-09-26 08:20:29 -04:00
Shahed Nasser
63aea62d7a docs: improve tailwind configuration (#5215) 2023-09-26 15:08:30 +03:00
Adrien de Peretti
240c439beb fix(medusa): Product model before insert hook (#5200)
**What**
When the id is provided, the rest of the hook should still apply. At the moment, when the id is provided the hook is skipped
2023-09-26 09:48:26 +00:00
David Preininger
2caff2efc7 feat(medusa): Authentication overhaul (#4064)
* implemented bearer auth

* changed naming strat

* changed session auth to not use jwt

* typo

* changed auth header prefix for admin api token auth

* fixed supporting functions to work with new session type

* removed database calls for bearer auth improving performance

* removed unused deps

* changed auth in tests

* added integration tests

* Accepted suggested change

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>

* Typo

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

* more typos

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

* proper formatting

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

* removed endregion

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

* removed startregion

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

* fixed admin JWT integration test

* added more fixes to integration tests

* Update OAS

* Create fluffy-donkeys-hope.md

* created API reference for new auth

* implemented getToken in medusa-js

* Apply suggestions from code review

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>

* Apply suggestions from code review

Co-authored-by: Shahed Nasser <shahednasser@gmail.com>

* deleted files which should be autogenerated

* Update fluffy-donkeys-hope.md

* JSDoc update

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

* added missing route exports

* implemented runtime domain safety in jwt token manager

* fixed jwt manager

* lint get-token files

* Update fluffy-donkeys-hope.md

* Revert "deleted files which should be autogenerated"

This reverts commit cd5e86623b822e6a6ac37322b952143ccc493df9.

* Revert "Apply suggestions from code review"

This reverts commit f02f07ce58fd9fcc2dfc80cadbb9df2665108d65.

* Revert "created API reference for new auth"

This reverts commit c9eafbb36453f5cf8047c79e94f470cb2d023c7d.

* renamed header for sending api access tokens

* medusa-js - changed apiKey header

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2023-09-25 13:57:44 -04:00
Shahed Nasser
07e65f5aba docs: Improve Loaders documentation (#5205) 2023-09-25 19:03:00 +03:00
Shahed Nasser
797cd48bd3 docs(ui): dark mode fixes (#5204)
* docs(ui): dark mode fixes

* apply color on the body

* remove z-index
2023-09-25 18:36:42 +03:00
Adrien de Peretti
f285a67123 feat(medusa): Remove create product unnecessary input config workflow (#5196)
* feat(medusa): Remove create product unnecessary input config workflow

* Create sharp-pets-type.md
2023-09-25 10:21:21 -04:00
Shahed Nasser
0c9d5ea6d4 docs: update contribution guideline (#5188)
* fix ignore command

* fixed ignore script

* docs: update contribution guideline

* fix ignore script

* fix eslint errors

* remove exit option
2023-09-22 16:08:11 +03:00
Geoffroy Empain
a560e5da29 fix(admin-ui): typos in text (#5032)
Fixes some typos found while reviewing translations.

Potential improvements in the future: fragmented translations may need merging with `<Trans>`. For example:

```
"analytics-preferences-disclaimer": "Pour créer la meilleure expérience de commerce électronique possible, nous aimerions obtenir des informations sur la manière dont vous utilisez Medusa. Les informations sur les utilisateurs nous permettent de construire des produits meilleurs, plus attrayants et plus utilisables. Nous ne collectons des données que pour améliorer le produit. Lisez quelles données nous recueillons dans notre",
"analytics-preferences-documentation": "documentation",
```

```
"help-dialog-feel-free-to-join-our-community-of": "Feel free to join our community of",
"help-dialog-merchants-and-e-commerce-developers": "merchants and e-commerce developers",
```

```
"upload-modal-drop-your-file-here-or": "Drop your file here, or",
"upload-modal-click-to-browse": "click to browse.",
```

Example from my previous PR with `sales-channels-display-available-count`:

```
<Trans
  i18nKey="sales-channels-display-available-count"
  availableChannelsCount={availableChannelsCount}
  totalChannelsCount={totalChannelsCount}
>
  Available in{" "}
  <span className="inter-base-semibold text-grey-90">
    {{ availableChannelsCount }}
  </span>{" "}
  out of{" "}
  <span className="inter-base-semibold text-grey-90">
    {{ totalChannelsCount }}
  </span>{" "}
  Sales Channels
</Trans>
```
2023-09-22 11:56:14 +00:00
Adrien de Peretti
f1512605d2 feat(medusa): Admin list product with product isolated module (#5046)
**What**
First iteration:
Admin list products return everything but does not include proper filtering by discount id or price list id. Also, same as the previous pr, the fields/expand is not included

depends on https://github.com/medusajs/medusa/pull/5130
2023-09-22 11:14:23 +00:00
Adrien de Peretti
5f76b967d9 feat(medusa): Admin get product with isolated module (#5054)
* feat(medusa): Admin get product with isolated module

* Create pretty-dryers-prove.md

* use object instead of string

* fix merge

* fix

* fix
2023-09-22 12:43:23 +02:00
Oli Juhl
adb6fb3f7d fix(admin-ui): Allow nullish values in update variant (#5173)
* fix(admin-ui): Allow nullish values in update variant

* Create moody-poems-carry.md
2023-09-22 11:34:54 +02:00
Shahed Nasser
123b3787d5 docs: general fixes for docs workspace (#5184) 2023-09-22 12:25:48 +03:00
Sebastian Rindom
c1b8f089e3 fix(medusa-payment-stripe): adds missing undefined check (#5177)
* fix: adds undefined check

* Create twelve-lamps-search.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-09-22 11:02:28 +02:00
Adrien de Peretti
dfa5d041c9 feat(medusa): Add product isolation FF to update cart (#5168)
**What**
Update cart must use the remote query when being in product isolation mode.

This pr is a first iteration that aims to quickly make compatible the end point in isolation. In a future iteration, this end point will be migrated to a workflow

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-09-22 08:49:59 +00:00
Shahed Nasser
27d74cb399 docs: fix error related to Key type (#5178)
* docs: fix error related to Key type

* fix styling issue
2023-09-21 21:41:18 +03:00
Carlos R. L. Rodrigues
25dad081b7 fix(admin-ui): translation pt (#5176)
What:
Fix a couple of words in Portuguese
2023-09-21 18:16:22 +00:00
Shahed Nasser
fa7c94b4cc docs: create docs workspace (#5174)
* docs: migrate ui docs to docs universe

* created yarn workspace

* added eslint and tsconfig configurations

* fix eslint configurations

* fixed eslint configurations

* shared tailwind configurations

* added shared ui package

* added more shared components

* migrating more components

* made details components shared

* move InlineCode component

* moved InputText

* moved Loading component

* Moved Modal component

* moved Select components

* Moved Tooltip component

* moved Search components

* moved ColorMode provider

* Moved Notification components and providers

* used icons package

* use UI colors in api-reference

* moved Navbar component

* used Navbar and Search in UI docs

* added Feedback to UI docs

* general enhancements

* fix color mode

* added copy colors file from ui-preset

* added features and enhancements to UI docs

* move Sidebar component and provider

* general fixes and preparations for deployment

* update docusaurus version

* adjusted versions

* fix output directory

* remove rootDirectory property

* fix yarn.lock

* moved code component

* added vale for all docs MD and MDX

* fix tests

* fix vale error

* fix deployment errors

* change ignore commands

* add output directory

* fix docs test

* general fixes

* content fixes

* fix announcement script

* added changeset

* fix vale checks

* added nofilter option

* fix vale error
2023-09-21 20:57:15 +03:00
Adrien de Peretti
19c5d5ba36 feat(medusa): Migrate remote query usage in store product domain to use an object (#5131)
* feat(medusa): Migrate remote query usage in store product domain to use an object

* fix profile level
2023-09-21 17:29:49 +02:00
Adrien de Peretti
202049f8aa fix(medusa, workflows): Create product workflow with Isolated modules + module registration (#5081)
* fix(medusa, workflows): Isolated modules

* Create polite-kangaroos-rhyme.md

* finalise

* naming
2023-09-21 17:10:14 +02:00
Shahed Nasser
89735aa425 docs: fix code in digital product recipe (#5172)
* docs: fix code in digital product recipe

* eslint fixes
2023-09-21 15:20:02 +03:00
Adrien de Peretti
cc4169a94c feat(utils): Provide an utils that allows to convert an array of fields to a complete remote query object (#5161)
**What**
For simplicity and compatibility with the front, the fields are stored as an array of strings containing the list of fields that should be selected by a query. In order to reduce the delta between this object shape and what is expected by the remoteQuery when passing an object, we built util to make the translation from fields to config.

This will allow us to update the endpoint fields to specify what exactly needs to be selected and based on that we will be able to build the remote query object. Furthermore, it will allow us to drop back the functionality of custom fields and relations. we will still have to take into account the limit constraint of an url size including the parameters if a user want to select everything from a relation. In that case, we might maybe think about handling this case once the modules will export all available relations and fields so that the remote joiner would be able to pass them all automatically if the relation is present but a `*` is passed or no values in the fields during the translation with the util. But this is something we can come up in a separate iteration
2023-09-21 10:50:28 +00:00
github-actions[bot]
f5274c5b4f chore(docs): Generated Docs Announcement Bar (automated) (#5167)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
2023-09-21 09:41:41 +02:00
olivermrbl
a81a8835ca chore: Release 2023-09-21 09:23:05 +02:00
github-actions[bot]
ed2c31d8e2 chore: Version Packages (#5157)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-21 08:57:25 +02:00
Oli Juhl
78b50ac0c4 fix(admin-ui): Add hook to customer group table (#5163)
* fix(admin-ui): Add hook to customer group table

* Create many-trains-sort.md
2023-09-20 18:40:51 +02:00
Oli Juhl
ef2a12e451 fix(admin-ui): Undefined vars in admin (#5162)
* fix(admin-ui): Undefined vars in admin

* Create short-hairs-fold.md
2023-09-20 17:03:47 +02:00
Oli Juhl
54531e38bc fix(admin-ui): Patch admin path issue (#5154) 2023-09-20 16:31:15 +02:00
Adrien de Peretti
8b189d2b90 feat(admin-ui): Add missing attributes translations (#5155)
* feat(admin-ui): Add missing attributes translations

* Add attributes title

* Create weak-carpets-carry.md
2023-09-20 12:37:12 +02:00
chemicalkosek
15a1c55def feat(admin-ui): Add Polish translation (#5101)
* Add Polish translation

* Create real-carrots-hug.md

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-09-20 12:36:21 +02:00
Carlos R. L. Rodrigues
47603f4797 fix(modules-sdk): medusa app load legacy modules (#5115)
* fix: default module path

* fix: allow legacy modules to be loaded by MedusaApp

* changeset

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2023-09-20 10:20:46 +02:00