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:
1 parent
4b80ba8a35
commit
bb534e0453
3 files changed
+16
-11
No files matched your search
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/admin-ui": patch
|
||||||
|
"@medusajs/admin": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix(admin-ui): Customer Groups in Pricing + TIP
|
||||||
@@ -41,7 +41,7 @@ const FormHeader = (props: PriceListFormProps & { onClose?: () => void }) => {
|
|||||||
const onPublish = (values: CreatePriceListFormValues) => {
|
const onPublish = (values: CreatePriceListFormValues) => {
|
||||||
const data = mapFormValuesToCreatePriceList(values, PriceListStatus.ACTIVE)
|
const data = mapFormValuesToCreatePriceList(values, PriceListStatus.ACTIVE)
|
||||||
if (isFeatureEnabled("tax_inclusive_pricing")) {
|
if (isFeatureEnabled("tax_inclusive_pricing")) {
|
||||||
data.includes_tax = values.includes_tax
|
data.includes_tax = !!values.includes_tax
|
||||||
}
|
}
|
||||||
createPriceList.mutate(data, {
|
createPriceList.mutate(data, {
|
||||||
onSuccess: ({ price_list }) => {
|
onSuccess: ({ price_list }) => {
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import { Controller } from "react-hook-form"
|
|||||||
import DatePicker from "../../../../components/atoms/date-picker/date-picker"
|
import DatePicker from "../../../../components/atoms/date-picker/date-picker"
|
||||||
import TimePicker from "../../../../components/atoms/date-picker/time-picker"
|
import TimePicker from "../../../../components/atoms/date-picker/time-picker"
|
||||||
import Switch from "../../../../components/atoms/switch"
|
import Switch from "../../../../components/atoms/switch"
|
||||||
import Select from "../../../../components/molecules/select"
|
|
||||||
import Accordion from "../../../../components/organisms/accordion"
|
import Accordion from "../../../../components/organisms/accordion"
|
||||||
import { weekFromNow } from "../../../../utils/date-utils"
|
import { weekFromNow } from "../../../../utils/date-utils"
|
||||||
import { usePriceListForm } from "../form/pricing-form-context"
|
import { usePriceListForm } from "../form/pricing-form-context"
|
||||||
import { ConfigurationFields } from "../types"
|
import { ConfigurationFields } from "../types"
|
||||||
|
import { NextSelect } from "../../../../components/molecules/select/next-select"
|
||||||
|
|
||||||
type ConfigurationProps = {
|
type ConfigurationProps = {
|
||||||
priceList?: PriceList
|
priceList?: PriceList
|
||||||
@@ -165,22 +165,21 @@ const Configuration: React.FC<ConfigurationProps> = () => {
|
|||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Select
|
<NextSelect
|
||||||
value={value}
|
|
||||||
label="Customer Groups"
|
|
||||||
onChange={onChange}
|
|
||||||
isMultiSelect
|
|
||||||
fullWidth
|
|
||||||
enableSearch
|
|
||||||
hasSelectAll
|
|
||||||
isLoading={isLoading}
|
|
||||||
options={
|
options={
|
||||||
customer_groups?.map((cg) => ({
|
customer_groups?.map((cg) => ({
|
||||||
label: cg.name,
|
label: cg.name,
|
||||||
value: cg.id,
|
value: cg.id,
|
||||||
})) || []
|
})) || []
|
||||||
}
|
}
|
||||||
|
label="Customer Groups"
|
||||||
|
onChange={onChange}
|
||||||
|
isMulti={true}
|
||||||
|
selectAll={true}
|
||||||
|
isSearchable={true}
|
||||||
|
value={value}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
|
isLoading={isLoading}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user