Commit Graph

43 Commits

Author SHA1 Message Date
Rares Stefan
497c7c55c7 feat(admin-ui): Encode location id in URL on location table (#3533)
Encoded the `location_id` into the query params and ensured it gets parsed on mount, into defaults. This allows safer refreshes of the locations table or accurate deep-links to be shared.

Resolves CORE-1252
2023-03-21 08:12:58 +00:00
Rares Stefan
d525c27774 fix(admin-ui): Fix location address editing form state (#3525)
I believe that changing the requiredness of the `address_1` and `country_code` fields when any part of the address was filled was not being registered correctly with the form state representation of those fields. ~~Have added an effect that unregisters the fields when the requiredness state changes and allows them to be re-registered with the correct `required` value when the next re-render happens due to that state having changed.~~

Have updated the submit button to be available even if form is invalid.

Resolves CORE-1266
2023-03-21 08:01:41 +00:00
Philip Korsholm
55c5fba0d3 Feat(admin, medusa): add locations to claim and swap creation (#3522)
**What**
- Add location selection to claim and swap creation

Fixes CORE-1269
2023-03-20 14:05:37 +00:00
Rares Stefan
a8423b8acc fix(medusa, admin-ui): Fix edit order variant stock (#3512)
The stock column when adding variants in an order edit would just look at `inventory_quantity`, location-unaware. Updated this to now attempt to request location-aware stock information and updated the column to use this information and show total stock across how many locations, and a tooltip showing per-location stock.

![image](https://user-images.githubusercontent.com/948623/225901225-177a2ce4-7344-49d0-84d5-3f3b0ce9f62e.png)

Resolves CORE-1250

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2023-03-20 13:16:49 +00:00
Rares Stefan
2176ff5027 fix(admin-ui): Hide create fulfilment button when nothing left to fulfil (#3515)
Previously, if an order had two fulfilments that fully satisfied the order, then only one was shipped, the status would change to `partially_shipped` and show the "Create Fulfillment" button again, which would open a buggy modal with no items to fulfil. Added another check that looks at the items in the order and compares `quantity` and `fulfilled_quantity`, so that we can hide the button based on this as well, rather than just the order's `fulfillment_status`, which can be misleading.

Also added a status icon to the Fulfillment card's title bar for the `partially_shipped` status, as this area was blank before in that state.

Resolves CORE-1262
2023-03-20 13:01:17 +00:00
Philip Korsholm
026bdab05d Feat/fulfill swaps and claims with locations (#3518)
* re-add if statements

* initial implementation

* add changeset

* address feedback

* remove context param from create-fulfillment

* fix tests
2023-03-20 13:48:25 +01:00
Philip Korsholm
ea2633bccf Fix/minor mw fixes (#3521)
**What**
- Fix stock locations quantities being shown as `undefined` and `NaN`
- Throw if updates to location levels are made with negative quantities through the api
- Show "allocated" in order summary for partially fulfilled orders

Fixes CORE-1268, CORE-1267, CORE-1265
2023-03-19 20:28:59 +00:00
Frane Polić
a3a7ace0c0 fix(admin): draft order shipping details (#3500)
* wip: fix draft order shipping details screen

* fix: reset address, refactor and cleanup

* fix: use const

* Create .changeset/violet-sloths-train.md

* fix: required fields, reset province

---------

Co-authored-by: fPolic <frane@medusajs.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-19 14:31:03 +01:00
Kasper Fabricius Kristensen
8a7421db5b feat(admin): Improve DX for deploying admin externally (#3418)
* init deploy command

* add include flag

* add 'shortcut' flag

* add dev command, fix var replacement, change default behaviour

* cleanup params of build command

* fix defaults when using the plugin to serve admin

* add changeset

* fix globals

* update README

* throw error on no build found

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-17 13:18:51 +01:00
Kasper Fabricius Kristensen
9ad15d3a88 feat(admin-ui): Implements redesign of public pages (#3504)
* redesign public pages

* rm build files

* fix size of button
2023-03-17 10:17:47 +01:00
Philip Korsholm
2e12f13565 Feat/show order as allocated (#3497)
**What**
- Add check to see if any items is unfulfilled when validating reservations for allocation indicator
- Add reservations refresh to onSuccess when creating a fulfillment to automatically update indicators on fulfillment



Fixes CORE-1248

Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2023-03-16 15:49:00 +00:00
Rares Stefan
4213326fe8 feat(admin-ui): Add location names to fulfilment rows and timeline events (#3481)
Adds location information to fulfilment rows and timeline events

![image](https://user-images.githubusercontent.com/948623/225306827-ebd08517-41c5-426e-88f2-43192b337995.png)
![image](https://user-images.githubusercontent.com/948623/225306876-7f77cbb8-6583-4082-b141-21b84fc2c79e.png)

Resolves CORE-1234
2023-03-16 14:41:39 +00:00
Rares Stefan
8e78c533c4 fix(admin-ui): Fix inventory table pagination on location filter change (#3479)
Inventory table offset should now correctly reset when a new location is selected from the filtering dropdown.

Resolves CORE-1231.
2023-03-15 12:20:30 +00:00
Philip Korsholm
10bf05c147 Fix(inventory, stock-location): Remove orphaned location levels and reservations (#3460)
**What**
- Remove related inventory levels and reservation items when a stock location is removed

**How**
- Add bulk deletion methods for both inventory levels and reservation items to the inventory service api
- invoke both on location removal

Fixes CORE-1232
2023-03-15 09:12:46 +00:00
Philip Korsholm
fe9eea4c18 feat(medusa, admin-ui, medusa-react, medusa-js): Allow toggling of manage inventory (#3435)
**What**
- Toggle manage inventory in the inventory management modal

**How**
- Create/update/remove inventory item based on if `manage_inventory` is set and if an inventory item already exists
- Move all stock location updates to when the modal is submitted
- Add create-inventory-item endpoint in the core

Fixes CORE-1196

Co-authored-by: Sebastian Rindom <7554214+srindom@users.noreply.github.com>
2023-03-14 16:14:31 +00:00
Philip Korsholm
30a3203640 Fix(medusa): Missing location id on fulfillments (#3462)
**What**
- include location id when creating a fulfillment
- Allow location updates to reservations without passing along quantity

**Why**
- location_id on fulfillment was null after creation

Fixes CORE-1242, CORE-1243
2023-03-14 11:08:52 +00:00
Riqwan Thamir
d278ac25c8 fix(admin-ui): hide categories in products behind feature flag (#3467) 2023-03-14 11:20:39 +01:00
Rares Stefan
478903b55a fix(admin-ui): Inventory and order UI fixes and tweaks (#3461)
This PR aims to tackle a few different small fixes and tweaks related to inventory and order details UI, in connection to multiwarehousing features.

- Successfully deleting an allocation should now only present one toast
- Updated copy in allocation editing toasts
- Inventory table search should now be the same height as the location selection trigger
- Inventory table rows should now correctly visually indicate that they are clickable
- Removed Filters from Inventory table for the time being
- Added actions to Inventory table rows for adjusting availability (same action as clicking the row, which remains) and going to the product detail page for the inventory item

Resolves CORE-1229, CORE-1228, CORE-1227, CORE-1233, CORE-1230
2023-03-14 09:53:13 +00:00
Philip Korsholm
55a1f232a3 Feat(admin-ui, medusa): request return with location (#3451)
* add location_id to request_return endpoint to support "receive_now" returns

* changeset

* admin request return

* add locations to recieving returns

* cleanup test

* add check for inventory service
2023-03-14 10:35:59 +01:00
Riqwan Thamir
2f42ed35d6 feat(medusa, admin-ui): increase tree depth + scope categories on store + allow categories relation in products API (#3450)
What:
- increase tree depth in react nestable
- scope categories on store queries
- allow categories relation in products API

RESOLVES CORE-1238
RESOLVES CORE-1237
RESOLVES CORE-1236
2023-03-13 17:30:21 +00:00
Philip Korsholm
c16f387d1c fix(admin-ui): Edit allocation update (#3447)
**What**
- update the edit-allocation side-bar with the new table layout

Fixes CORE-1215
2023-03-13 14:08:05 +00:00
Kasper Fabricius Kristensen
ad7d7fcd51 fix(admin-ui): Lint all UI files (#3459) 2023-03-13 14:02:20 +01:00
Rares Stefan
d4af873113 fix(admin-ui): Show all locations in allocation creation modal (#3448)
* Remove SC constraint from allocation location options

* Create tricky-peas-clean.md

* Update company field placeholder in address form
2023-03-10 15:43:18 +01:00
Rares Stefan
f43f03badb fix(admin): Fix fulfilment creation (#3434)
* Remove error object nesting that stopped fulfilment creation

* Create stale-adults-tease.md

* Fix quantities object creation check

* Add some debug logs
2023-03-10 14:41:03 +01:00
Philip Korsholm
ef4a36794e Fix(admin-ui): border overflow (#3437)
**What**
- Fix border clipping out of component

Fixes CORE-1190
2023-03-09 17:28:00 +00:00
Rares Stefan
f027bc26fc fix(admin): Show correct reserved/available values when editing stock on variant (#3438)
Update displayed labels to use actual `reserved_quantity` and a calculation for available quantity, now that we have the correct fields on the level. 

![2023-03-09 17 04 16](https://user-images.githubusercontent.com/948623/224101557-1d0c28d9-4775-4ad4-a6ef-ebc7427c4119.gif)

Resolves CORE-1194
2023-03-09 17:17:37 +00:00
Philip Korsholm
80b95a2300 Fix(medusa, admin-ui): Order allocations (#3419)
**What**
- Fix `delete-reservation` endpoint to allow deletions of reservations 
- remove `inventory_item_id` from reservation update call to properly update reservation
- invalidate all list caches to properly update order overview after an allocation has been created
- Fix overlap for long product titles in edit-allocation-modal

Fixes CORE-1214
2023-03-09 17:07:49 +00:00
Riqwan Thamir
cdbc5ff3d8 feat(admin-ui): added breadcrumbs for categories on create/edit modal (#3420)
What:
- Adds breadcrumbs to create modal
- Adds breadcrumbs to edit modal

<img width="581" alt="2" src="https://user-images.githubusercontent.com/5105988/223782603-f168d554-65bd-4cfc-bdcd-eabdd9f06b20.png">
<img width="1115" alt="1" src="https://user-images.githubusercontent.com/5105988/223782607-1ae441c9-c9eb-4cb0-9015-2038db55dd64.png">


RESOLVES CORE-1210
2023-03-09 15:43:43 +00:00
Philip Korsholm
784723a039 Fix/disable allocate button (#3426)
* remove allocate option from order editing summary if no further allocations can be made

* add changeset

* add minor button styles to badge component
2023-03-09 13:05:56 +01:00
Riqwan Thamir
478d1af8d0 feat(medusa, admin-ui): Improvements to product categories (#3416) 2023-03-08 16:56:49 +01:00
Rares Stefan
57d7728dd9 feat(admin-ui, medusa-js, medusa-react, medusa): Multiwarehousing UI (#3403)
* add "get-variant" endpoint

* import from a different place

* fix unit test

* add changeset

* inventory management for orders

* add changeset

* initial create-fulfillment

* add changeset

* type oas and admin

* Move inv. creation and listing from admin repo

* Fix location editing bug (CORE-1216)

* Fix default warehouse on inventory table view

* remove actions from each table line

* Use feature flag hook instead of context directly

* remove manage inventory action if inventory management is not enabled

* Address review comments

* fix queries made when inventorymodules are disabled

* variant form changes for feature enabled

* move exclamation icon into warning icon

* ensure queries are not run unless feature is enabled for create-fulfillment

---------

Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2023-03-08 16:08:56 +01:00
Kasper Fabricius Kristensen
d0d11307d2 fix(admin-ui): Fix use of expand parameter on order page (#3383)
* Create cuddly-seahorses-thank.md

* add integration tests

* revert back from master to develop

* fix expand

* add new integration test

* add missing default relations

* add missing refunds relation

* re work

* fix tests

* init

* fix order page according to fixes to expand

* expand shipping on returns

* Create .changeset/cuddly-beers-tease.md

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-07 19:43:44 +01:00
Riqwan Thamir
47d3440766 feat(admin-ui, medusa-react): product page categories management + nested multiselect (#3401)
* chore: allow products to be categorized in product create/edit page

* refactor: cleanup

* feat: invalidate product details cache when categories change

* fix: update changesets

* fix: push ner changeset

* feat: limit popup height

---------

Co-authored-by: fPolic <frane@medusajs.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-07 19:42:01 +01:00
Kasper Fabricius Kristensen
cf51ad0d46 fix(admin-ui): move dependencies from devDependencies (#3405) 2023-03-07 14:43:08 +01:00
Riqwan Thamir
b5662d0c6a feat(admin-ui): adds category ui for tree/list, edit, create, delete (#3399)
* chore: adds category ui for tree/list, edit, create, delete

* fix: address feedback

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: fPolic <frane@medusajs.com>
2023-03-07 13:29:22 +01:00
Philip Korsholm
06f567f446 fix(admin-ui): table action gap (#3386)
* add gap in table actions

* add changeset

* Update .changeset/light-frogs-smoke.md

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>

---------

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-07 13:14:14 +01:00
Kasper Fabricius Kristensen
b4eba69911 fix(admin-ui): Resolve tailwindcss/nesting correctly (#3404)
* attempt resolving tailwind nesting

* fix import of tailwindcss/nesting plugin

* trigger pipeline

* trigger pipeline

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-03-07 13:12:13 +01:00
Philip Korsholm
15f47baf56 Fix(admin-ui, medusa): stock location fixes (#3395)
**What**
- A series of minor fixes for admin-ui relating to managing stock locations: 
  - make "create location" `primary`
  - add delete prompt when cancelling creation if information has been input
  - avoid clipping focus border on country select when creating a stock location
  - allow removals of sales channels from stock locations 

Fixes CORE-1191, CORE-1192, CORE-1190, CORE-1189
2023-03-07 10:54:09 +00:00
Riqwan Thamir
bca731a148 chore: Product page shows list of categories associated with it (#3400) 2023-03-07 10:04:25 +01:00
Oliver Windall Juhl
ed0f777431 fix(admin-ui): Discount in DraftOrder create flow (#3378)
Solves #3332
2023-03-06 16:06:28 +00:00
Kasper Fabricius Kristensen
67ba8be02b fix(admin): Add skus to claim menus (#3368)
**What**
- Adds SKU to all tables in claim flow, allowing admins to easily copy them to their clipboard.
2023-03-05 17:17:45 +00:00
Riqwan Thamir
d4e3e119de feat(admin-ui): ProductCategory list page (#3380) 2023-03-05 16:16:53 +01:00
Kasper Fabricius Kristensen
40de54b010 feat(admin,admin-ui,medusa): Add Medusa Admin plugin (#3334) 2023-03-03 10:09:16 +01:00