Skip to content

Commit 44650b8

Browse files
committed
f
1 parent ed99428 commit 44650b8

File tree

5 files changed

+34
-42
lines changed

5 files changed

+34
-42
lines changed

web/src/components/common/Checkbox.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ const Checkbox: React.FC<CheckboxProps> = ({
2525
labelClassName = '',
2626
id,
2727
label,
28-
dataTestId,
2928
helpText,
3029
}) => {
3130
const { settings } = useSettings();
@@ -41,7 +40,7 @@ const Checkbox: React.FC<CheckboxProps> = ({
4140
onChange={onChange}
4241
disabled={disabled}
4342
className={`h-4 w-4 focus:ring-offset-2 border-gray-300 rounded ${className}`}
44-
data-testid={dataTestId}
43+
data-testid={`bool-input-${id}`}
4544
style={{
4645
color: themeColor,
4746
'--tw-ring-color': themeColor,

web/src/components/common/Input.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ const Input: React.FC<InputProps> = ({
3535
labelClassName = '',
3636
id,
3737
label,
38-
dataTestId,
3938
helpText,
4039
}) => {
4140
const { settings } = useSettings();
@@ -71,7 +70,7 @@ const Input: React.FC<InputProps> = ({
7170
'--tw-ring-color': themeColor,
7271
'--tw-ring-offset-color': themeColor,
7372
} as React.CSSProperties}
74-
data-testid={dataTestId}
73+
data-testid={`text-input-${id}`}
7574
/>
7675
</div>
7776
{error && <p className="mt-1 text-sm text-red-500">{error}</p>}

web/src/components/common/Radio.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const Radio: React.FC<RadioProps> = ({
2828
labelClassName = '',
2929
id,
3030
label,
31-
dataTestId,
3231
helpText,
3332
}) => {
3433
const { settings } = useSettings();
@@ -51,7 +50,7 @@ const Radio: React.FC<RadioProps> = ({
5150
onChange={onChange}
5251
disabled={disabled}
5352
className={`h-4 w-4 focus:ring-offset-2 border-gray-300 ${className}`}
54-
data-testid={dataTestId ? `${dataTestId}-${option.name}` : undefined}
53+
data-testid={`radio-input-${option.name}`}
5554
style={{
5655
color: themeColor,
5756
'--tw-ring-color': themeColor,

web/src/components/common/Textarea.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const Textarea = ({
3131
labelClassName = '',
3232
id,
3333
label,
34-
dataTestId,
3534
helpText,
3635
}: TextareaProps) => {
3736
const { settings } = useSettings();
@@ -60,7 +59,7 @@ const Textarea = ({
6059
'--tw-ring-color': themeColor,
6160
'--tw-ring-offset-color': themeColor,
6261
} as CSSProperties}
63-
data-testid={dataTestId}
62+
data-testid={`textarea-input-${id}`}
6463
/>
6564
{error && <p className="mt-1 text-sm text-red-500">{error}</p>}
6665
{helpText && !error && <p className="mt-1 text-sm text-gray-500">{helpText}</p>}

web/src/components/wizard/config/ConfigurationStep.tsx

Lines changed: 30 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -167,41 +167,37 @@ const ConfigurationStep: React.FC<ConfigurationStepProps> = ({ onNext }) => {
167167
switch (item.type) {
168168
case 'text':
169169
return (
170-
<Input
171-
value={getDisplayValue(item)}
172-
onChange={handleInputChange}
173-
dataTestId={`text-input-${item.name}`}
174-
/>
170+
<Input
171+
value={getDisplayValue(item)}
172+
onChange={handleInputChange}
173+
/>
175174
);
176175

177176
case 'textarea':
178177
return (
179-
<Textarea
180-
value={getDisplayValue(item)}
181-
onChange={handleInputChange}
182-
dataTestId={`textarea-input-${item.name}`}
183-
/>
178+
<Textarea
179+
value={getDisplayValue(item)}
180+
onChange={handleInputChange}
181+
/>
184182

185183
);
186184

187185
case 'bool':
188186
return (
189-
<Checkbox
190-
checked={getEffectiveValue(item) === '1'}
191-
onChange={handleCheckboxChange}
192-
dataTestId={`bool-input-${item.name}`}
193-
/>
187+
<Checkbox
188+
checked={getEffectiveValue(item) === '1'}
189+
onChange={handleCheckboxChange}
190+
/>
194191
);
195192

196193
case 'radio':
197194
if (item.items) {
198195
return (
199-
<Radio
200-
value={getEffectiveValue(item)}
201-
options={item.items}
202-
onChange={e => handleRadioChange(item.name, e)}
203-
dataTestId={`radio-input-${item.name}`}
204-
/>
196+
<Radio
197+
value={getEffectiveValue(item)}
198+
options={item.items}
199+
onChange={e => handleRadioChange(item.name, e)}
200+
/>
205201
);
206202
}
207203
return null;
@@ -219,19 +215,19 @@ const ConfigurationStep: React.FC<ConfigurationStepProps> = ({ onNext }) => {
219215
{group.description && (
220216
<p className="text-gray-600 mb-4">{group.description}</p>
221217
)}
222-
{group.items.map(item => {
223-
const renderedItem = renderConfigItem(item);
224-
if (!renderedItem) return null;
225-
return (
226-
<ConfigItem
227-
id={item.name}
228-
label={item.title}
229-
helpText={item.help_text}
230-
>
231-
{renderedItem}
232-
</ConfigItem>
233-
);
234-
})}
218+
{group.items.map(item => {
219+
const renderedItem = renderConfigItem(item);
220+
if (!renderedItem) return null;
221+
return (
222+
<ConfigItem
223+
id={item.name}
224+
label={item.title}
225+
helpText={item.help_text}
226+
>
227+
{renderedItem}
228+
</ConfigItem>
229+
);
230+
})}
235231
</div>
236232
);
237233
};

0 commit comments

Comments
 (0)