fix(dashboard): tax override reference (#9796)
* fix: tax override reference * fix: create rest * fix: comment out unsupported references for now * fix: edit form
This commit is contained in:
1 parent
1889180319
commit
dd93d8de6e
3 files changed
+178
-175
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
export enum TaxRateRuleReferenceType {
|
export enum TaxRateRuleReferenceType {
|
||||||
PRODUCT = "products",
|
PRODUCT = "product",
|
||||||
PRODUCT_COLLECTION = "product_collections",
|
PRODUCT_TYPE = "product_type",
|
||||||
PRODUCT_TAG = "product_tags",
|
// PRODUCT_COLLECTION = "product_collection",
|
||||||
PRODUCT_TYPE = "product_types",
|
// PRODUCT_TAG = "product_tag",
|
||||||
CUSTOMER_GROUP = "customer_groups",
|
// CUSTOMER_GROUP = "customer_group",
|
||||||
}
|
}
|
||||||
+86
-85
@@ -48,17 +48,17 @@ const TaxRegionCreateTaxOverrideSchema = z.object({
|
|||||||
.optional(),
|
.optional(),
|
||||||
is_combinable: z.boolean().optional(),
|
is_combinable: z.boolean().optional(),
|
||||||
enabled_rules: z.object({
|
enabled_rules: z.object({
|
||||||
products: z.boolean(),
|
product: z.boolean(),
|
||||||
product_collections: z.boolean(),
|
product_type: z.boolean(),
|
||||||
product_tags: z.boolean(),
|
// product_collection: z.boolean(),
|
||||||
product_types: z.boolean(),
|
// product_tag: z.boolean(),
|
||||||
customer_groups: z.boolean(),
|
// customer_group: z.boolean(),
|
||||||
}),
|
}),
|
||||||
products: z.array(TaxRateRuleReferenceSchema).optional(),
|
product: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
product_collections: z.array(TaxRateRuleReferenceSchema).optional(),
|
product_type: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
product_tags: z.array(TaxRateRuleReferenceSchema).optional(),
|
// product_collection: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
product_types: z.array(TaxRateRuleReferenceSchema).optional(),
|
// product_tag: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
customer_groups: z.array(TaxRateRuleReferenceSchema).optional(),
|
// customer_group: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
type TaxRegionCreateTaxOverrideFormProps = {
|
type TaxRegionCreateTaxOverrideFormProps = {
|
||||||
@@ -85,17 +85,17 @@ export const TaxRegionCreateTaxOverrideForm = ({
|
|||||||
value: "",
|
value: "",
|
||||||
},
|
},
|
||||||
enabled_rules: {
|
enabled_rules: {
|
||||||
products: true,
|
product: true,
|
||||||
product_collections: false,
|
product_type: false,
|
||||||
product_tags: false,
|
// product_collection: false,
|
||||||
product_types: false,
|
// product_tag: false,
|
||||||
customer_groups: false,
|
// customer_group: false,
|
||||||
},
|
},
|
||||||
products: [],
|
product: [],
|
||||||
product_collections: [],
|
product_type: [],
|
||||||
product_tags: [],
|
// product_collection: [],
|
||||||
product_types: [],
|
// product_tag: [],
|
||||||
customer_groups: [],
|
// customer_group: [],
|
||||||
},
|
},
|
||||||
resolver: zodResolver(TaxRegionCreateTaxOverrideSchema),
|
resolver: zodResolver(TaxRegionCreateTaxOverrideSchema),
|
||||||
})
|
})
|
||||||
@@ -104,40 +104,40 @@ export const TaxRegionCreateTaxOverrideForm = ({
|
|||||||
|
|
||||||
const handleSubmit = form.handleSubmit(async (values) => {
|
const handleSubmit = form.handleSubmit(async (values) => {
|
||||||
const {
|
const {
|
||||||
products,
|
product,
|
||||||
customer_groups,
|
product_type,
|
||||||
product_collections,
|
// customer_group,
|
||||||
product_tags,
|
// product_collection,
|
||||||
product_types,
|
// product_tag,
|
||||||
} = values
|
} = values
|
||||||
|
|
||||||
const productRules = createTaxRulePayload({
|
const productRules = createTaxRulePayload({
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT,
|
reference_type: TaxRateRuleReferenceType.PRODUCT,
|
||||||
references: products || [],
|
references: product || [],
|
||||||
})
|
|
||||||
const customerGroupRules = createTaxRulePayload({
|
|
||||||
reference_type: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
|
||||||
references: customer_groups || [],
|
|
||||||
})
|
|
||||||
const productCollectionRules = createTaxRulePayload({
|
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
|
||||||
references: product_collections || [],
|
|
||||||
})
|
|
||||||
const productTagRules = createTaxRulePayload({
|
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT_TAG,
|
|
||||||
references: product_tags || [],
|
|
||||||
})
|
})
|
||||||
const productTypeRules = createTaxRulePayload({
|
const productTypeRules = createTaxRulePayload({
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
reference_type: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
||||||
references: product_types || [],
|
references: product_type || [],
|
||||||
})
|
})
|
||||||
|
// const customerGroupRules = createTaxRulePayload({
|
||||||
|
// reference_type: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
||||||
|
// references: customer_group || [],
|
||||||
|
// })
|
||||||
|
// const productCollectionRules = createTaxRulePayload({
|
||||||
|
// reference_type: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
||||||
|
// references: product_collection || [],
|
||||||
|
// })
|
||||||
|
// const productTagRules = createTaxRulePayload({
|
||||||
|
// reference_type: TaxRateRuleReferenceType.PRODUCT_TAG,
|
||||||
|
// references: product_tag || [],
|
||||||
|
// })
|
||||||
|
|
||||||
const rules = [
|
const rules = [
|
||||||
productRules,
|
productRules,
|
||||||
customerGroupRules,
|
|
||||||
productCollectionRules,
|
|
||||||
productTagRules,
|
|
||||||
productTypeRules,
|
productTypeRules,
|
||||||
|
// customerGroupRules,
|
||||||
|
// productCollectionRules,
|
||||||
|
// productTagRules,
|
||||||
]
|
]
|
||||||
.filter((rule) => Boolean(rule))
|
.filter((rule) => Boolean(rule))
|
||||||
.flatMap((r) => r) as HttpTypes.AdminCreateTaxRate["rules"]
|
.flatMap((r) => r) as HttpTypes.AdminCreateTaxRate["rules"]
|
||||||
@@ -165,41 +165,42 @@ export const TaxRegionCreateTaxOverrideForm = ({
|
|||||||
|
|
||||||
const products = useFieldArray({
|
const products = useFieldArray({
|
||||||
control: form.control,
|
control: form.control,
|
||||||
name: "products",
|
name: TaxRateRuleReferenceType.PRODUCT,
|
||||||
})
|
|
||||||
|
|
||||||
const productCollections = useFieldArray({
|
|
||||||
control: form.control,
|
|
||||||
name: "product_collections",
|
|
||||||
})
|
|
||||||
|
|
||||||
const productTags = useFieldArray({
|
|
||||||
control: form.control,
|
|
||||||
name: "product_tags",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const productTypes = useFieldArray({
|
const productTypes = useFieldArray({
|
||||||
control: form.control,
|
control: form.control,
|
||||||
name: "product_types",
|
name: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
||||||
})
|
})
|
||||||
|
|
||||||
const customerGroups = useFieldArray({
|
// const productCollections = useFieldArray({
|
||||||
control: form.control,
|
// control: form.control,
|
||||||
name: "customer_groups",
|
// name: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
||||||
})
|
// })
|
||||||
|
//
|
||||||
|
// const productTags = useFieldArray({
|
||||||
|
// control: form.control,
|
||||||
|
// name: TaxRateRuleReferenceType.PRODUCT_TAG,
|
||||||
|
// })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// const customerGroups = useFieldArray({
|
||||||
|
// control: form.control,
|
||||||
|
// name: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
||||||
|
// })
|
||||||
|
|
||||||
const getControls = (type: TaxRateRuleReferenceType) => {
|
const getControls = (type: TaxRateRuleReferenceType) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TaxRateRuleReferenceType.PRODUCT:
|
case TaxRateRuleReferenceType.PRODUCT:
|
||||||
return products
|
return products
|
||||||
case TaxRateRuleReferenceType.PRODUCT_COLLECTION:
|
|
||||||
return productCollections
|
|
||||||
case TaxRateRuleReferenceType.PRODUCT_TAG:
|
|
||||||
return productTags
|
|
||||||
case TaxRateRuleReferenceType.PRODUCT_TYPE:
|
case TaxRateRuleReferenceType.PRODUCT_TYPE:
|
||||||
return productTypes
|
return productTypes
|
||||||
case TaxRateRuleReferenceType.CUSTOMER_GROUP:
|
// case TaxRateRuleReferenceType.PRODUCT_COLLECTION:
|
||||||
return customerGroups
|
// return productCollections
|
||||||
|
// case TaxRateRuleReferenceType.PRODUCT_TAG:
|
||||||
|
// return productTags
|
||||||
|
// case TaxRateRuleReferenceType.CUSTOMER_GROUP:
|
||||||
|
// return customerGroups
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,40 +209,40 @@ export const TaxRegionCreateTaxOverrideForm = ({
|
|||||||
value: TaxRateRuleReferenceType.PRODUCT,
|
value: TaxRateRuleReferenceType.PRODUCT,
|
||||||
label: t("taxRegions.fields.targets.options.product"),
|
label: t("taxRegions.fields.targets.options.product"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
|
||||||
label: t("taxRegions.fields.targets.options.productCollection"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: TaxRateRuleReferenceType.PRODUCT_TAG,
|
|
||||||
label: t("taxRegions.fields.targets.options.productTag"),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
value: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
||||||
label: t("taxRegions.fields.targets.options.productType"),
|
label: t("taxRegions.fields.targets.options.productType"),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
value: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
// value: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
||||||
label: t("taxRegions.fields.targets.options.customerGroup"),
|
// label: t("taxRegions.fields.targets.options.productCollection"),
|
||||||
},
|
// },
|
||||||
|
// {
|
||||||
|
// value: TaxRateRuleReferenceType.PRODUCT_TAG,
|
||||||
|
// label: t("taxRegions.fields.targets.options.productTag"),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
||||||
|
// label: t("taxRegions.fields.targets.options.customerGroup"),
|
||||||
|
// },
|
||||||
]
|
]
|
||||||
|
|
||||||
const searchPlaceholders = {
|
const searchPlaceholders = {
|
||||||
[TaxRateRuleReferenceType.PRODUCT]: t(
|
[TaxRateRuleReferenceType.PRODUCT]: t(
|
||||||
"taxRegions.fields.targets.placeholders.product"
|
"taxRegions.fields.targets.placeholders.product"
|
||||||
),
|
),
|
||||||
[TaxRateRuleReferenceType.PRODUCT_COLLECTION]: t(
|
|
||||||
"taxRegions.fields.targets.placeholders.productCollection"
|
|
||||||
),
|
|
||||||
[TaxRateRuleReferenceType.PRODUCT_TAG]: t(
|
|
||||||
"taxRegions.fields.targets.placeholders.productTag"
|
|
||||||
),
|
|
||||||
[TaxRateRuleReferenceType.PRODUCT_TYPE]: t(
|
[TaxRateRuleReferenceType.PRODUCT_TYPE]: t(
|
||||||
"taxRegions.fields.targets.placeholders.productType"
|
"taxRegions.fields.targets.placeholders.productType"
|
||||||
),
|
),
|
||||||
[TaxRateRuleReferenceType.CUSTOMER_GROUP]: t(
|
// [TaxRateRuleReferenceType.PRODUCT_COLLECTION]: t(
|
||||||
"taxRegions.fields.targets.placeholders.customerGroup"
|
// "taxRegions.fields.targets.placeholders.productCollection"
|
||||||
),
|
// ),
|
||||||
|
// [TaxRateRuleReferenceType.PRODUCT_TAG]: t(
|
||||||
|
// "taxRegions.fields.targets.placeholders.productTag"
|
||||||
|
// ),
|
||||||
|
// [TaxRateRuleReferenceType.CUSTOMER_GROUP]: t(
|
||||||
|
// "taxRegions.fields.targets.placeholders.customerGroup"
|
||||||
|
// ),
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFieldHandler = (type: TaxRateRuleReferenceType) => {
|
const getFieldHandler = (type: TaxRateRuleReferenceType) => {
|
||||||
|
|||||||
+87
-85
@@ -56,17 +56,17 @@ const TaxRegionTaxRateEditSchema = z.object({
|
|||||||
}),
|
}),
|
||||||
is_combinable: z.boolean().optional(),
|
is_combinable: z.boolean().optional(),
|
||||||
enabled_rules: z.object({
|
enabled_rules: z.object({
|
||||||
products: z.boolean(),
|
product: z.boolean(),
|
||||||
product_collections: z.boolean(),
|
product_type: z.boolean(),
|
||||||
product_tags: z.boolean(),
|
// product_collection: z.boolean(),
|
||||||
product_types: z.boolean(),
|
// product_tag: z.boolean(),
|
||||||
customer_groups: z.boolean(),
|
// customer_group: z.boolean(),
|
||||||
}),
|
}),
|
||||||
products: z.array(TaxRateRuleReferenceSchema).optional(),
|
product: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
product_collections: z.array(TaxRateRuleReferenceSchema).optional(),
|
product_type: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
product_tags: z.array(TaxRateRuleReferenceSchema).optional(),
|
// product_collection: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
product_types: z.array(TaxRateRuleReferenceSchema).optional(),
|
// product_tag: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
customer_groups: z.array(TaxRateRuleReferenceSchema).optional(),
|
// customer_group: z.array(TaxRateRuleReferenceSchema).optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
export const TaxRegionTaxOverrideEditForm = ({
|
export const TaxRegionTaxOverrideEditForm = ({
|
||||||
@@ -87,17 +87,18 @@ export const TaxRegionTaxOverrideEditForm = ({
|
|||||||
},
|
},
|
||||||
is_combinable: taxRate.is_combinable,
|
is_combinable: taxRate.is_combinable,
|
||||||
enabled_rules: {
|
enabled_rules: {
|
||||||
products: initialValues.products.length > 0,
|
product: initialValues.product.length > 0,
|
||||||
product_collections: initialValues.product_collections.length > 0,
|
product_type: initialValues.product_type.length > 0,
|
||||||
product_tags: initialValues.product_tags.length > 0,
|
// customer_groups: initialValues.customer_group.length > 0,
|
||||||
product_types: initialValues.product_types.length > 0,
|
// product_collections:
|
||||||
customer_groups: initialValues.customer_groups.length > 0,
|
// initialValues.product_collections.length > 0,
|
||||||
|
// product_tags: initialValues.product_tag.length > 0,
|
||||||
},
|
},
|
||||||
products: initialValues.products,
|
product: initialValues.product,
|
||||||
product_collections: initialValues.product_collections,
|
product_type: initialValues.product_type,
|
||||||
product_tags: initialValues.product_tags,
|
// product_collections: initialValues.product_collection,
|
||||||
product_types: initialValues.product_types,
|
// product_tags: initialValues.product_tag,
|
||||||
customer_groups: initialValues.customer_groups,
|
// customer_groups: initialValues.customer_group,
|
||||||
},
|
},
|
||||||
resolver: zodResolver(TaxRegionTaxRateEditSchema),
|
resolver: zodResolver(TaxRegionTaxRateEditSchema),
|
||||||
})
|
})
|
||||||
@@ -106,40 +107,40 @@ export const TaxRegionTaxOverrideEditForm = ({
|
|||||||
|
|
||||||
const handleSubmit = form.handleSubmit(async (values) => {
|
const handleSubmit = form.handleSubmit(async (values) => {
|
||||||
const {
|
const {
|
||||||
products,
|
product,
|
||||||
customer_groups,
|
product_type,
|
||||||
product_collections,
|
// customer_groups,
|
||||||
product_tags,
|
// product_collections,
|
||||||
product_types,
|
// product_tags,
|
||||||
} = values
|
} = values
|
||||||
|
|
||||||
const productRules = createTaxRulePayload({
|
const productRules = createTaxRulePayload({
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT,
|
reference_type: TaxRateRuleReferenceType.PRODUCT,
|
||||||
references: products || [],
|
references: product || [],
|
||||||
})
|
|
||||||
const customerGroupRules = createTaxRulePayload({
|
|
||||||
reference_type: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
|
||||||
references: customer_groups || [],
|
|
||||||
})
|
|
||||||
const productCollectionRules = createTaxRulePayload({
|
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
|
||||||
references: product_collections || [],
|
|
||||||
})
|
|
||||||
const productTagRules = createTaxRulePayload({
|
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT_TAG,
|
|
||||||
references: product_tags || [],
|
|
||||||
})
|
})
|
||||||
const productTypeRules = createTaxRulePayload({
|
const productTypeRules = createTaxRulePayload({
|
||||||
reference_type: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
reference_type: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
||||||
references: product_types || [],
|
references: product_type || [],
|
||||||
})
|
})
|
||||||
|
// const customerGroupRules = createTaxRulePayload({
|
||||||
|
// reference_type: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
||||||
|
// references: customer_groups || [],
|
||||||
|
// })
|
||||||
|
// const productCollectionRules = createTaxRulePayload({
|
||||||
|
// reference_type: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
||||||
|
// references: product_collections || [],
|
||||||
|
// })
|
||||||
|
// const productTagRules = createTaxRulePayload({
|
||||||
|
// reference_type: TaxRateRuleReferenceType.PRODUCT_TAG,
|
||||||
|
// references: product_tags || [],
|
||||||
|
// })
|
||||||
|
|
||||||
const rules = [
|
const rules = [
|
||||||
productRules,
|
productRules,
|
||||||
customerGroupRules,
|
|
||||||
productCollectionRules,
|
|
||||||
productTagRules,
|
|
||||||
productTypeRules,
|
productTypeRules,
|
||||||
|
// customerGroupRules,
|
||||||
|
// productCollectionRules,
|
||||||
|
// productTagRules,
|
||||||
]
|
]
|
||||||
.filter((rule) => Boolean(rule))
|
.filter((rule) => Boolean(rule))
|
||||||
.flatMap((r) => r) as HttpTypes.AdminCreateTaxRate["rules"]
|
.flatMap((r) => r) as HttpTypes.AdminCreateTaxRate["rules"]
|
||||||
@@ -166,41 +167,42 @@ export const TaxRegionTaxOverrideEditForm = ({
|
|||||||
|
|
||||||
const products = useFieldArray({
|
const products = useFieldArray({
|
||||||
control: form.control,
|
control: form.control,
|
||||||
name: "products",
|
name: "product",
|
||||||
})
|
|
||||||
|
|
||||||
const productCollections = useFieldArray({
|
|
||||||
control: form.control,
|
|
||||||
name: "product_collections",
|
|
||||||
})
|
|
||||||
|
|
||||||
const productTags = useFieldArray({
|
|
||||||
control: form.control,
|
|
||||||
name: "product_tags",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const productTypes = useFieldArray({
|
const productTypes = useFieldArray({
|
||||||
control: form.control,
|
control: form.control,
|
||||||
name: "product_types",
|
name: "product_type",
|
||||||
})
|
})
|
||||||
|
|
||||||
const customerGroups = useFieldArray({
|
// const productCollections = useFieldArray({
|
||||||
control: form.control,
|
// control: form.control,
|
||||||
name: "customer_groups",
|
// name: "product_collection",
|
||||||
})
|
// })
|
||||||
|
//
|
||||||
|
// const productTags = useFieldArray({
|
||||||
|
// control: form.control,
|
||||||
|
// name: "product_tag",
|
||||||
|
// })
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// const customerGroups = useFieldArray({
|
||||||
|
// control: form.control,
|
||||||
|
// name: "customer_group",
|
||||||
|
// })
|
||||||
|
|
||||||
const getControls = (type: TaxRateRuleReferenceType) => {
|
const getControls = (type: TaxRateRuleReferenceType) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case TaxRateRuleReferenceType.PRODUCT:
|
case TaxRateRuleReferenceType.PRODUCT:
|
||||||
return products
|
return products
|
||||||
case TaxRateRuleReferenceType.PRODUCT_COLLECTION:
|
|
||||||
return productCollections
|
|
||||||
case TaxRateRuleReferenceType.PRODUCT_TAG:
|
|
||||||
return productTags
|
|
||||||
case TaxRateRuleReferenceType.PRODUCT_TYPE:
|
case TaxRateRuleReferenceType.PRODUCT_TYPE:
|
||||||
return productTypes
|
return productTypes
|
||||||
case TaxRateRuleReferenceType.CUSTOMER_GROUP:
|
// case TaxRateRuleReferenceType.PRODUCT_COLLECTION:
|
||||||
return customerGroups
|
// return productCollections
|
||||||
|
// case TaxRateRuleReferenceType.PRODUCT_TAG:
|
||||||
|
// return productTags
|
||||||
|
// case TaxRateRuleReferenceType.CUSTOMER_GROUP:
|
||||||
|
// return customerGroups
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,40 +211,40 @@ export const TaxRegionTaxOverrideEditForm = ({
|
|||||||
value: TaxRateRuleReferenceType.PRODUCT,
|
value: TaxRateRuleReferenceType.PRODUCT,
|
||||||
label: t("taxRegions.fields.targets.options.product"),
|
label: t("taxRegions.fields.targets.options.product"),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
|
||||||
label: t("taxRegions.fields.targets.options.productCollection"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: TaxRateRuleReferenceType.PRODUCT_TAG,
|
|
||||||
label: t("taxRegions.fields.targets.options.productTag"),
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
value: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
value: TaxRateRuleReferenceType.PRODUCT_TYPE,
|
||||||
label: t("taxRegions.fields.targets.options.productType"),
|
label: t("taxRegions.fields.targets.options.productType"),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
value: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
// value: TaxRateRuleReferenceType.PRODUCT_COLLECTION,
|
||||||
label: t("taxRegions.fields.targets.options.customerGroup"),
|
// label: t("taxRegions.fields.targets.options.productCollection"),
|
||||||
},
|
// },
|
||||||
|
// {
|
||||||
|
// value: TaxRateRuleReferenceType.PRODUCT_TAG,
|
||||||
|
// label: t("taxRegions.fields.targets.options.productTag"),
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// value: TaxRateRuleReferenceType.CUSTOMER_GROUP,
|
||||||
|
// label: t("taxRegions.fields.targets.options.customerGroup"),
|
||||||
|
// },
|
||||||
]
|
]
|
||||||
|
|
||||||
const searchPlaceholders = {
|
const searchPlaceholders = {
|
||||||
[TaxRateRuleReferenceType.PRODUCT]: t(
|
[TaxRateRuleReferenceType.PRODUCT]: t(
|
||||||
"taxRegions.fields.targets.placeholders.product"
|
"taxRegions.fields.targets.placeholders.product"
|
||||||
),
|
),
|
||||||
[TaxRateRuleReferenceType.PRODUCT_COLLECTION]: t(
|
|
||||||
"taxRegions.fields.targets.placeholders.productCollection"
|
|
||||||
),
|
|
||||||
[TaxRateRuleReferenceType.PRODUCT_TAG]: t(
|
|
||||||
"taxRegions.fields.targets.placeholders.productTag"
|
|
||||||
),
|
|
||||||
[TaxRateRuleReferenceType.PRODUCT_TYPE]: t(
|
[TaxRateRuleReferenceType.PRODUCT_TYPE]: t(
|
||||||
"taxRegions.fields.targets.placeholders.productType"
|
"taxRegions.fields.targets.placeholders.productType"
|
||||||
),
|
),
|
||||||
[TaxRateRuleReferenceType.CUSTOMER_GROUP]: t(
|
// [TaxRateRuleReferenceType.PRODUCT_COLLECTION]: t(
|
||||||
"taxRegions.fields.targets.placeholders.customerGroup"
|
// "taxRegions.fields.targets.placeholders.productCollection"
|
||||||
),
|
// ),
|
||||||
|
// [TaxRateRuleReferenceType.PRODUCT_TAG]: t(
|
||||||
|
// "taxRegions.fields.targets.placeholders.productTag"
|
||||||
|
// ),
|
||||||
|
// [TaxRateRuleReferenceType.CUSTOMER_GROUP]: t(
|
||||||
|
// "taxRegions.fields.targets.placeholders.customerGroup"
|
||||||
|
// ),
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFieldHandler = (type: TaxRateRuleReferenceType) => {
|
const getFieldHandler = (type: TaxRateRuleReferenceType) => {
|
||||||
|
|||||||
Reference in new issue
Block a user