Skip to content

Commit eec5ce5

Browse files
Fix REQ/UNIQ column alignment and add aria-labels to checkboxes
Agent-Logs-Url: https://github.com/yash-pouranik/urBackend/sessions/45ff42a9-22a8-472e-af6c-e9ece3b747a0 Co-authored-by: yash-pouranik <172860064+yash-pouranik@users.noreply.github.com>
1 parent 205a9eb commit eec5ce5

1 file changed

Lines changed: 26 additions & 20 deletions

File tree

apps/web-dashboard/src/pages/CreateCollection.jsx

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -157,34 +157,40 @@ function FieldRow({ field, index, depth, collections, onChange, onRemove }) {
157157
</select>
158158

159159
{/* Required checkbox */}
160-
<input
161-
type="checkbox"
162-
checked={field.required}
163-
disabled={field.locked}
164-
onChange={(e) => handleChange('required', e.target.checked)}
165-
style={{
166-
accentColor: 'var(--color-primary)',
167-
transform: 'scale(1.1)', cursor: field.locked ? 'not-allowed' : 'pointer', flexShrink: 0,
168-
opacity: field.locked ? 0.6 : 1
169-
}}
170-
/>
171-
172-
{/* Unique checkbox */}
173-
{depth === 1 && PRIMITIVE_TYPES.includes(field.type) ? (
160+
<div style={{ width: '24px', flexShrink: 0, display: 'flex', justifyContent: 'center' }}>
174161
<input
175162
type="checkbox"
176-
checked={!!field.unique}
163+
aria-label="required"
164+
checked={field.required}
177165
disabled={field.locked}
178-
onChange={(e) => handleChange('unique', e.target.checked)}
166+
onChange={(e) => handleChange('required', e.target.checked)}
179167
style={{
180168
accentColor: 'var(--color-primary)',
181-
transform: 'scale(1.1)', cursor: field.locked ? 'not-allowed' : 'pointer', flexShrink: 0,
169+
transform: 'scale(1.1)', cursor: field.locked ? 'not-allowed' : 'pointer',
182170
opacity: field.locked ? 0.6 : 1
183171
}}
184172
/>
185-
) : (
186-
<div style={{ width: '13px', flexShrink: 0 }} />
187-
)}
173+
</div>
174+
175+
{/* Unique checkbox */}
176+
<div style={{ width: '24px', flexShrink: 0, display: 'flex', justifyContent: 'center' }}>
177+
{depth === 1 && PRIMITIVE_TYPES.includes(field.type) ? (
178+
<input
179+
type="checkbox"
180+
aria-label="unique"
181+
checked={!!field.unique}
182+
disabled={field.locked}
183+
onChange={(e) => handleChange('unique', e.target.checked)}
184+
style={{
185+
accentColor: 'var(--color-primary)',
186+
transform: 'scale(1.1)', cursor: field.locked ? 'not-allowed' : 'pointer',
187+
opacity: field.locked ? 0.6 : 1
188+
}}
189+
/>
190+
) : (
191+
<div />
192+
)}
193+
</div>
188194

189195
{/* Delete button */}
190196
<button

0 commit comments

Comments
 (0)