Commit Graph

153 Commits

Author SHA1 Message Date
Carlos R. L. Rodrigues
de36e2b36e chore: rename return flow (#8050) 2024-07-10 08:09:10 -03:00
Kasper Fabricius Kristensen
046a34bdfc feat(dashboard,types,js-sdk,ui): Tax Regions UI (#7935) 2024-07-10 09:26:43 +00:00
Kasper Fabricius Kristensen
6e613f4f50 feat: Update toast design (#8018)
**What**
- Updates the Toast component and `toast` util to match the latest design. 
- Updates every usage of `toast` as `dismissableLabel` is no longer a valid prop, as we now render a X mark instead of a text button.
2024-07-09 16:14:19 +00:00
Kasper Fabricius Kristensen
4736d9e2dd fix(dashboard): JSON view (#8038)
* updated json view

* cleanup

* cleanup
2024-07-09 16:45:22 +02: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
Shahed Nasser
9ded63cc62 chore: OAS and TSDoc fixes (#7864) 2024-07-01 10:21:34 +03: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
Kasper Fabricius Kristensen
2f76fbc6ed feat(dashboard,types,sdk,medusa,ui): ProductCategory domain (#7675)
**What**
- Add missing features to ProductCategory domain in admin
- Add types
- Add SDK

**UI**
- Moves the TooltipProvider from the component to an export. Users should now wrap their entire application in a TooltipProvider. This change was made to take advantage of the built-in features of Radix Tooltip, and allows us to skip the delayDuration when moving the cursor from one tooltip to another within 500ms.
- Fixes the layout of the Hint component, as the create form revealed that it was off.
- Fixes an issue where focus styles were missing from the dropdown menu.

**Note**
- ~~We currently don't have an endpoint for deleting categories, so I have disabled the button in the admin. See CORE--2286~~ PR has been opened to add delete endpoint, so I have re-enabled the delete button.
- The update category workflow seems to be broken, it's possible for the `mpath` of a category to reach an invalid state, that breaks `include_descendants_tree` from working. See CORE-2287.
- The ProductCategory model is incorrect. All fields are optional and it's not possible to set the description to null, which means the only way of unsetting it is to set it to `""`. See CORE-2276.
- The design for the Organize drag-n-drop form is not final. Ludvig will create a final design, and we can then update the form.
- Currently, all things related to Metadata is left out, as we need to update the flow for metadata according to the latest designs.

RESOLVES CORE-1960, CORE-2230
*except for the above mentioned issues.
2024-06-12 11:15:12 +00:00
Frane Polić
987141ab2d fix(dashboard) editor columns (#7534)
* fix: reorg variant editor columns, auto select default sales channel when creating products

* fix: remove return

* fix: add placeholders on options create inputs, add placeholder for chip input

* fix: gaps on details pages

* fix: address feedback
2024-06-07 10:59:19 +02:00
Kasper Fabricius Kristensen
e73b6ce691 fix(ui,ui-preset,icons): Fix styling of Select, DropdownMenu, and Checkbox (#7525)
* progress

* progress

* fix: checkbox styling

* fix(ui,ui-preset): Fix the styling of Select, DropdownMenu, and Checkbox

* update ellipse-solid-mini icon

* cleanup
2024-05-29 21:16:54 +02:00
Harminder Virk
51ea166df2 chore: use yarn@3.2.1 in all the packages (#7514) 2024-05-29 09:00:40 +02:00
Kasper Fabricius Kristensen
75791f2cbd chore(icons,toolbox): Update icons (#7505) 2024-05-28 19:54:31 +02:00
Kasper Fabricius Kristensen
ee0b93078f chore(ui-preset): Update styles (#7507) 2024-05-28 18:49:35 +02:00
Kasper Fabricius Kristensen
2f20dbd50d fix(ui): Add checked style to RadioGroup.ChoiceBox (#7479)
<img width="362" alt="image" src="https://github.com/medusajs/medusa/assets/45367945/441ffdb3-557e-4eea-9fc0-b09a7a9e9d4a">

**What**
- Adds checked active shadow to component
- Cleans up usage of component in promotion domain

CLOSES CORE-2101, CORE-2075
2024-05-27 21:00:24 +00:00
Kasper Fabricius Kristensen
ab2e8fcd45 feat(dashboard,ui,types,admin-shared): Add more extension zones + pass data to widgets (#7465) 2024-05-27 12:47:12 +02:00
Frane Polić
ce75755ac6 feat(dashboard): manage groups from customer details (#7346) 2024-05-19 11:10:13 +02:00
Adrien de Peretti
71f4f46cb9 chore(medusa): cleanup medusa package (#7206) 2024-05-07 12:48:49 +02:00
github-actions[bot]
2c807df99d chore: Version Packages (#6839)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-01 09:48:24 +02:00
Shahed Nasser
cfd765bece chore(ui): added API reference comments for Toast component (#7129) 2024-04-23 13:25:06 +02:00
Kasper Fabricius Kristensen
c3260a2c5a feat(ui, dashboard): Toast rework (#7076)
**What**
- Re-works how toasts work in Medusa UI. API is now built on top of `sonner` instead of `@radix-ui/react-toast`. This is a breaking change, and we will need to update the documentation once this has been merged and released (cc: @shahednasser).
- Adds an example of usage in the products list table in the new admin dashboard. As part of the coming weeks cleanup we will add toasts everywhere that they are currently missing.

CLOSES CORE-1977
2024-04-16 13:14:58 +00:00
github-actions[bot]
74e17ee6f9 chore: Version Packages (#6757)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-26 18:04:04 +01:00
Kasper Fabricius Kristensen
26531c5a38 feat(dashboard): Draft orders create (#6680)
**What**
- Adds Create draft order form
- Updates draft order details page to also display "custom" items.

**Note**
- Currently, the form is missing a way to input a discount code. Need to rethink this a bit, as the we can't implement the design in Figma.
- The current design is missing a way to select from a customers existing shipping addresses, we should add that to keep the features we have today.
- This PR uses `useInfiniteQuery` which does not work on our staging (due to duplicate dependencies as a result of building straight from the monorepo), so you will need to test locally.
2024-03-25 17:18:24 +00:00
Kasper Fabricius Kristensen
247ca3c3fa feat(dashboard, ui): Product image modals (#6779)
**What**
- Adds Media modals gallery and edit mode
- Fixes an issue with Hint from medusajs/ui.
2024-03-25 11:22:30 +00:00
github-actions[bot]
26c9bada0a chore: Version Packages (#6360)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-20 10:21:30 +01:00
Frane Polić
a1b4aff127 feat(dashboard): manage discounts conditions (#6620)
**What**
- forms for managing discount conditions

---

https://github.com/medusajs/medusa/assets/16856471/bb0b3fe8-fa60-479b-bc42-6db9d422bcdf





Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2024-03-15 11:56:23 +00:00
Kasper Fabricius Kristensen
ee4ea796f6 chore: align version of dotenv (#6657) 2024-03-11 12:34:17 +01:00
Kasper Fabricius Kristensen
2d00625729 feat(dashboard): Workflow executions (#6564)
**What**
- v1 of executions domain

**TODO in follow up PR**
I think it might be a good idea for Carlos or Adrien to go over the design with Ludvig, and make sure we are displaying what is relevant to developers, and how things should be displayed. So this PR is just the initial implementation, and does not handle displaying things like compensation steps (not part of the current design), step input (not supported by the API but part of the design), etc.

Closes CORE-1751, CORE-1755
2024-03-09 18:46:10 +00:00
Kasper Fabricius Kristensen
44a5567d0d feat(dashboard): Regions domain (#6534)
**What**
- Implements new Region domain design
- Adds new SplitView component for managing adding nested relations in FocusModals, eg. adding countries to a region.
- Adds new Combobox component for multi select fields in forms

**medusajs/ui**
- Fix styling of RadioGroup.Choicebox component

CLOSES CORE-1650, CORE-1671
2024-02-29 13:16:14 +00:00
Kasper Fabricius Kristensen
44d43e8155 feat(dashboard, medusa, medusa-js, medusa-react, icons): DataGrid, partial Product domain, and ProductVariant hook (#6428)
The PR for the Products section is growing quite large, so I would like to merge this PR that contains a lot of the ground work before moving onto finalizing the rest of the domain.

**Note**
Since the PR contains changes to the core, that the dashboard depends on, the staging env will not work. To preview this PR, you will need to run it locally. 

## `@medusajs/medusa`

**What**
- Adds missing query params to `GET /admin/products/:id/variants`
- `options.values` has been added to the default relations of admin product endpoints.

## `medusa-react`

**What**
- Adds missing hook for `GET /admin/products/:id/variants`

## `@medusajs/dashboard`
- Adds base implementation for `DataGrid` component (formerly `BulkEditor`) (WIP)
- Adds `/products` overview page
- Adds partial `/products/create` page for creating new products (WIP - need to go over design w/ Ludvig before continuing)
- Adds `/products/:id` details page
- Adds `/products/:id/gallery` page for inspecting a products images in fullscreen.
- Adds `/products/:id/edit` page for editing the general information of a product
- Adds `/products/:id/attributes` page for editing the attributes information of a product
- Adds `/products/:id/sales-channels` page for editing which sales channels a product is available in
- Fixes a bug in `DataTable` where a table with two fixed columns would not display correctly

For the review its not important to test the DataGrid, as it is still WIP, and I need to go through some minor changes to the behaviour with Ludvig, as virtualizing it adds some constraints.

## `@medusajs/icons`

**What**
- Pulls latest icons from Figma

## TODO in next PR
- [ ] Fix the typing of POST /admin/products/:id as it is currently not possible to delete any of the nullable fields once they have been added. Be aware of this when reviewing this PR.
- [ ] Wrap up `/products/create` page
- [ ] Add `/products/:id/media` page for managing media associated with the product.
- [ ] Add `/products/id/options` for managing product options (need Ludvig to rethink this as the current API is very limited and we can implement the current design as is.)
- [ ] Add `/products/:id/variants/:id` page for editing a variant. (Possibly concat all of these into one BulkEditor page?)
2024-02-21 11:29:35 +00:00
github-actions[bot]
869dc751a0 chore(docs): Updated UI Reference (#6347)
* chore(docs): Generated UI Reference

* fixed props typing + added new alert page

* updated ui dependencies

---------

Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
2024-02-12 19:46:51 +01:00
Kasper Fabricius Kristensen
d37ff8024d feat(dashboard,medusa,ui): Manual gift cards + cleanup (#6380)
**Dashboard**
- Adds different views for managing manual/custom gift cards (not associated with a product gift card).
- Cleans up several table implementations to use new DataTable component.
- Minor cleanup of translation file.

**Medusa**
- Adds missing query params for list endpoints in the following admin domains: /customers, /customer-groups, /collections, and /gift-cards.

**UI**
- Adds new sizes for Badge component.

**Note for review**
Since this PR contains updates to the translation keys, it touches a lot of files. For the review the parts that are relevant are: the /gift-cards domain of admin, the table overview of collections, customers, and customer groups. And the changes to the list endpoints in the core.
2024-02-12 13:47:37 +00:00
github-actions[bot]
580143cd53 chore: Version Packages (#6348)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-09 10:25:33 +01:00
Kasper Fabricius Kristensen
85a44dfd01 fix(ui,ui-preset): Code component styles (#6357) 2024-02-09 10:11:22 +01:00
github-actions[bot]
16851c557d chore: Version Packages (#6241)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-02-08 16:23:19 +01:00
Kasper Fabricius Kristensen
73fd92a1af feat(dashboard): Log in, reset password, and accept invite pages (#6310) 2024-02-05 11:16:10 +01:00
Kasper Fabricius Kristensen
8cbf6c60fe feat(dashboard): DataTable component (#6297) 2024-02-02 21:56:55 +01:00
github-actions[bot]
dfd9e7c772 chore(docs): Updated UI Reference (#6221)
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-01-29 08:20:51 +00:00
github-actions[bot]
3d0ae72887 chore: Version Packages (#6039)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-01-25 16:23:53 +01:00
Kasper Fabricius Kristensen
c37c82c5b5 feat(dashboard): Pub Api Key domain (#6162)
**What**
- Adds Pub. Api Key domain

**Note**
- Pagination for sales channels associated with the pubkey is not implemented correctly as it is not supported by the API. Will open a separate issue on this, and revisit the impl. once fixed.

CLOSES CORE-1656
2024-01-23 20:15:16 +00:00
Kasper Fabricius Kristensen
e49b6944e3 feat(dashboard): 3.0 product collection (#6120) 2024-01-18 15:01:34 +01:00
Kasper Fabricius Kristensen
a2c149e7e5 feat(dashboard,ui): Streamline spacing and sizing (#6061) 2024-01-15 11:43:16 +01:00
Shahed Nasser
18de90e603 docs: fix tsdocs following typedoc update + 1.20 release (#6033)
* docs: fix tsdocs following typedoc update + 1.20 release

* Fix OAS validation errors

* fixes to react-docs-generator

* fix content linting
2024-01-09 17:15:29 +02:00
Kasper Fabricius Kristensen
f868775861 chore: move next admin packages to core repo (#5983)
**What**
- Move packages for `next` version of admin to core repo

**Other**
- Since this PR introduces packages that depend on Vite 5, it also introduces @types/node@^20. We have never had a direct dependency on the types package for Node, and as far as I can see that has resulted in us using the types from Node.js@8, as those are a dependency of one of our dependencies. With the introduction of @types/node@^20, two of our packages had TS errors because they were using the NodeJS.Timer type, which was deprecated in Node.js@14. We should add specific @types/node packages to all our packages, but I haven't done so in this PR to keep it as clean as possible.
- Q: @olivermrbl I've added the new packages to the ignore list for changeset, is this enough to prevent them from being published?
2024-01-08 09:26:46 +00:00
github-actions[bot]
7f5e638f61 chore: Version Packages (#5754)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-14 15:27:39 +01:00
Shahed Nasser
245e5c9a69 docs: generate documentation for UI components (#5849)
* added tool to generate spec files for React components

* use typedoc for missing descriptions and types

* improvements and fixes

* improvements

* added doc comments for half of the components

* add custom resolver + more doc comments

* added all tsdocs

* general improvements

* add specs to UI docs

* added github action

* remove unnecessary api route

* Added readme for react-docs-generator

* remove comment

* Update packages/design-system/ui/src/components/currency-input/currency-input.tsx

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

* remove description of aria fields + add generate script

---------

Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2023-12-13 16:02:41 +02:00
Kasper Fabricius Kristensen
591ba2388d fix(ui): Bump cva and minor type fixes (#5818)
**What**
- Bumps `class-variance-authority` to new beta version - `cva@beta`.
- Updates all usages of `cva` to new API.
- Clear up the naming of types in `usePrompt`

**Why**
- A bug in how `class-variance-authority` exported its types mean that we were relying on patching the package to ensure that the correct types made it into the build of our UI package. This was important to ensure intellisense for component variants, such as `<Button size="large" />`. Previously in the UI monorepo, having the patch was enough to ensure that the correct types made it into the build, but that was not the case after we moved the design system to the core repo. The issue with types is fixed in the `@1` version of `cva` which is currently in beta. I have pinpointed the version to the current beta version to ensure stability despite the package currently being in beta.
2023-12-07 20:13:44 +00:00
github-actions[bot]
935e9f0561 chore: Version Packages (#5673)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-27 16:43:51 +00:00
Kasper Fabricius Kristensen
b25b29fe7b fix(ui): code block styles (#5692)
**What**
- Improves the styling of CodeBlock prism theme
2023-11-23 11:59:17 +00:00
github-actions[bot]
f4085dbede chore: Version Packages (#5622)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-21 08:46:09 +00:00
Kasper Fabricius Kristensen
a67a8e7e90 fix(ui): Fixed CodeBlock line number width (#5640)
**What**
- Fixes the width of lineNumbers in the CodeBlock component according to the widest number.
- Introduces a new prop on snippets that allows users to hide the copy button. Also updated docs to reflect this.

Before:
![image](https://github.com/medusajs/medusa/assets/45367945/07852c2e-434c-44df-93b7-4078148cb74f)

After:
<img width="742" alt="image" src="https://github.com/medusajs/medusa/assets/45367945/5ce845f7-b8c7-411c-abfb-fa03448aeb1a">

Closes #5639
2023-11-16 10:50:04 +00:00