Improve Check Type and Applicable Stages button handlers in QualitySetupStep
This commit is contained in:
@@ -265,7 +265,8 @@ export const QualitySetupStep: React.FC<SetupStepProps> = ({ onUpdate }) => {
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
setFormData({ ...formData, check_type: option.value });
|
||||
console.log('Check type clicked:', option.value, 'current:', formData.check_type);
|
||||
setFormData(prev => ({ ...prev, check_type: option.value }));
|
||||
}}
|
||||
className={`p-3 text-left border rounded-lg transition-colors cursor-pointer ${
|
||||
formData.check_type === option.value
|
||||
@@ -309,7 +310,14 @@ export const QualitySetupStep: React.FC<SetupStepProps> = ({ onUpdate }) => {
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
toggleStage(option.value);
|
||||
console.log('Stage clicked:', option.value);
|
||||
const isSelected = formData.applicable_stages.includes(option.value);
|
||||
setFormData(prev => ({
|
||||
...prev,
|
||||
applicable_stages: isSelected
|
||||
? prev.applicable_stages.filter(s => s !== option.value)
|
||||
: [...prev.applicable_stages, option.value]
|
||||
}));
|
||||
}}
|
||||
className={`p-2 text-sm text-left border rounded-lg transition-colors cursor-pointer ${
|
||||
formData.applicable_stages.includes(option.value)
|
||||
|
||||
Reference in New Issue
Block a user