fix(admin-ui): Customer Groups in Pricing + TIP (#4670)

* Use NextSelect

* Ensure boolean value of includes taxa

* Create thin-kings-grab.md
This commit is contained in:
Oli Juhl
2023-08-02 13:45:27 +02:00
committed by GitHub
parent 4b80ba8a35
commit bb534e0453
3 changed files with 16 additions and 11 deletions

View File

@@ -0,0 +1,6 @@
---
"@medusajs/admin-ui": patch
"@medusajs/admin": patch
---
fix(admin-ui): Customer Groups in Pricing + TIP

View File

@@ -41,7 +41,7 @@ const FormHeader = (props: PriceListFormProps & { onClose?: () => void }) => {
const onPublish = (values: CreatePriceListFormValues) => {
const data = mapFormValuesToCreatePriceList(values, PriceListStatus.ACTIVE)
if (isFeatureEnabled("tax_inclusive_pricing")) {
data.includes_tax = values.includes_tax
data.includes_tax = !!values.includes_tax
}
createPriceList.mutate(data, {
onSuccess: ({ price_list }) => {

View File

@@ -6,11 +6,11 @@ import { Controller } from "react-hook-form"
import DatePicker from "../../../../components/atoms/date-picker/date-picker"
import TimePicker from "../../../../components/atoms/date-picker/time-picker"
import Switch from "../../../../components/atoms/switch"
import Select from "../../../../components/molecules/select"
import Accordion from "../../../../components/organisms/accordion"
import { weekFromNow } from "../../../../utils/date-utils"
import { usePriceListForm } from "../form/pricing-form-context"
import { ConfigurationFields } from "../types"
import { NextSelect } from "../../../../components/molecules/select/next-select"
type ConfigurationProps = {
priceList?: PriceList
@@ -165,22 +165,21 @@ const Configuration: React.FC<ConfigurationProps> = () => {
}
)}
>
<Select
value={value}
label="Customer Groups"
onChange={onChange}
isMultiSelect
fullWidth
enableSearch
hasSelectAll
isLoading={isLoading}
<NextSelect
options={
customer_groups?.map((cg) => ({
label: cg.name,
value: cg.id,
})) || []
}
label="Customer Groups"
onChange={onChange}
isMulti={true}
selectAll={true}
isSearchable={true}
value={value}
ref={ref}
isLoading={isLoading}
/>
</div>
)