fix(dashboard): promotions disable conditions (#8104)

This commit is contained in:
Frane Polić
2024-07-12 16:10:05 +02:00
committed by GitHub
parent f6e86f1b99
commit 82b620c488
3 changed files with 12 additions and 2 deletions
@@ -78,7 +78,9 @@ export const useVariantPriceGridColumns = ({
return (
<ReadonlyCell>
<div className="flex h-full w-full items-center gap-x-2 overflow-hidden">
<span className="truncate">{entity.title}</span>
<span title={entity.title} className="truncate">
{entity.title}
</span>
</div>
</ReadonlyCell>
)
@@ -84,6 +84,7 @@ export const RuleValueFormField = ({
className="bg-ui-bg-base"
ref={valuesRef}
min={1}
disabled={!fieldRule.attribute}
/>
</Form.Control>
<Form.ErrorMessage />
@@ -97,6 +98,7 @@ export const RuleValueFormField = ({
{...field}
onChange={onChange}
className="bg-ui-bg-base"
disabled={!fieldRule.attribute}
/>
</Form.Control>
<Form.ErrorMessage />
@@ -112,6 +114,7 @@ export const RuleValueFormField = ({
Array.isArray(field.value) ? field.value[0] : field.value
}
onValueChange={onChange}
disabled={!fieldRule.attribute}
>
<Select.Trigger ref={ref} className="bg-ui-bg-base">
<Select.Value placeholder="Select Value" />
@@ -144,6 +147,7 @@ export const RuleValueFormField = ({
options={options}
onChange={onChange}
className="bg-ui-bg-base"
disabled={!fieldRule.attribute}
/>
</Form.Control>
@@ -213,7 +213,11 @@ export const RulesFormField = ({
return (
<Form.Item className="basis-1/2">
<Form.Control>
<Select {...field} onValueChange={onChange}>
<Select
{...field}
disabled={!fieldRule.attribute}
onValueChange={onChange}
>
<Select.Trigger
ref={operatorRef}
className="bg-ui-bg-base"