- Updated the AdminReferenceValueTypesPage to enhance text alignment and styling for form fields.
All checks were successful
Deploy Development / deploy (push) Successful in 56s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 15s

- Refactored ProfileReferenceValuesPage to apply consistent styling for form elements and improve layout.
- Adjusted button styles for better visual consistency across the forms.
This commit is contained in:
Lars 2026-04-06 20:01:23 +02:00
parent ab616ba044
commit f04318f76a
2 changed files with 137 additions and 125 deletions

View File

@ -149,7 +149,7 @@ export default function AdminReferenceValueTypesPage() {
} }
return ( return (
<div className="page"> <div className="page" style={{ textAlign: 'left' }}>
<div className="page-header" style={{ marginBottom: 16 }}> <div className="page-header" style={{ marginBottom: 16 }}>
<h1 style={{ display: 'flex', alignItems: 'center', gap: 10, fontSize: 22, margin: 0 }}> <h1 style={{ display: 'flex', alignItems: 'center', gap: 10, fontSize: 22, margin: 0 }}>
<Gauge size={26} color="var(--accent)" /> <Gauge size={26} color="var(--accent)" />
@ -199,9 +199,9 @@ export default function AdminReferenceValueTypesPage() {
<X size={16} /> <X size={16} />
</button> </button>
</div> </div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}> <div>
<div> <div className="settings-page__field">
<label className="form-label" htmlFor="ref-admin-key"> <label className="settings-page__field-label" htmlFor="ref-admin-key">
Technischer Schlüssel (key) Technischer Schlüssel (key)
</label> </label>
<input <input
@ -213,12 +213,12 @@ export default function AdminReferenceValueTypesPage() {
placeholder="z. B. max_heart_rate" placeholder="z. B. max_heart_rate"
autoComplete="off" autoComplete="off"
/> />
<p style={{ fontSize: 12, color: 'var(--text3)', margin: '6px 0 0' }}> <p style={{ fontSize: 12, color: 'var(--text3)', margin: '4px 0 0', textAlign: 'left' }}>
Kleinbuchstaben, Ziffern, Unterstriche; nach Anlage nicht änderbar. Kleinbuchstaben, Ziffern, Unterstriche; nach Anlage nicht änderbar.
</p> </p>
</div> </div>
<div> <div className="settings-page__field">
<label className="form-label" htmlFor="ref-admin-label"> <label className="settings-page__field-label" htmlFor="ref-admin-label">
Anzeigename Anzeigename
</label> </label>
<input <input
@ -229,8 +229,8 @@ export default function AdminReferenceValueTypesPage() {
placeholder="z. B. Maximale Herzfrequenz" placeholder="z. B. Maximale Herzfrequenz"
/> />
</div> </div>
<div> <div className="settings-page__field">
<label className="form-label" htmlFor="ref-admin-desc"> <label className="settings-page__field-label" htmlFor="ref-admin-desc">
Beschreibung Beschreibung
</label> </label>
<textarea <textarea
@ -242,44 +242,56 @@ export default function AdminReferenceValueTypesPage() {
placeholder="Kurze Erklärung für Nutzer und Admins" placeholder="Kurze Erklärung für Nutzer und Admins"
/> />
</div> </div>
<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}> <div className="settings-page__field">
<div style={{ flex: '1 1 160px' }}> <label className="settings-page__field-label" htmlFor="ref-admin-unit">
<label className="form-label" htmlFor="ref-admin-unit"> Standard-Einheit
Standard-Einheit </label>
</label> <input
<input id="ref-admin-unit"
id="ref-admin-unit" className="form-input"
className="form-input" value={form.default_unit}
value={form.default_unit} onChange={(e) => setForm((f) => ({ ...f, default_unit: e.target.value }))}
onChange={(e) => setForm((f) => ({ ...f, default_unit: e.target.value }))} placeholder="bpm, Stufe, …"
placeholder="bpm, Stufe, …" />
/>
</div>
<div style={{ flex: '0 0 120px' }}>
<label className="form-label" htmlFor="ref-admin-sort">
Sortierung
</label>
<input
id="ref-admin-sort"
type="number"
className="form-input"
value={form.sort_order}
onChange={(e) => setForm((f) => ({ ...f, sort_order: e.target.value }))}
/>
</div>
<div style={{ flex: '0 0 140px', alignSelf: 'flex-end', paddingBottom: 4 }}>
<label style={{ display: 'flex', alignItems: 'center', gap: 8, cursor: 'pointer', fontSize: 14 }}>
<input
type="checkbox"
checked={form.active}
onChange={(e) => setForm((f) => ({ ...f, active: e.target.checked }))}
/>
Aktiv (nutzer sichtbar)
</label>
</div>
</div> </div>
<div> <div className="settings-page__field">
<label className="form-label" htmlFor="ref-admin-meta"> <label className="settings-page__field-label" htmlFor="ref-admin-sort">
Sortierung
</label>
<input
id="ref-admin-sort"
type="number"
className="form-input"
value={form.sort_order}
onChange={(e) => setForm((f) => ({ ...f, sort_order: e.target.value }))}
/>
</div>
<div className="settings-page__field">
<span className="settings-page__field-label">Sichtbarkeit</span>
<label
htmlFor="ref-admin-active"
style={{
display: 'flex',
alignItems: 'center',
gap: 10,
justifyContent: 'flex-start',
cursor: 'pointer',
fontSize: 14,
color: 'var(--text1)',
textAlign: 'left',
}}
>
<input
id="ref-admin-active"
type="checkbox"
checked={form.active}
onChange={(e) => setForm((f) => ({ ...f, active: e.target.checked }))}
/>
Aktiv (für Nutzer sichtbar)
</label>
</div>
<div className="settings-page__field" style={{ borderBottom: 'none' }}>
<label className="settings-page__field-label" htmlFor="ref-admin-meta">
Metadaten (JSON-Objekt) Metadaten (JSON-Objekt)
</label> </label>
<textarea <textarea
@ -288,16 +300,16 @@ export default function AdminReferenceValueTypesPage() {
rows={5} rows={5}
value={form.metadata_json} value={form.metadata_json}
onChange={(e) => setForm((f) => ({ ...f, metadata_json: e.target.value }))} onChange={(e) => setForm((f) => ({ ...f, metadata_json: e.target.value }))}
placeholder='{}' placeholder="{}"
spellCheck={false} spellCheck={false}
/> />
</div> </div>
<div style={{ display: 'flex', gap: 8 }}> <div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 8 }}>
<button type="button" className="btn btn-primary" onClick={handleSave}> <button type="button" className="btn btn-primary btn-full" onClick={handleSave}>
<Save size={16} style={{ marginRight: 6 }} /> <Save size={16} style={{ marginRight: 6 }} />
Speichern Speichern
</button> </button>
<button type="button" className="btn btn-secondary" onClick={closeForm}> <button type="button" className="btn btn-secondary btn-full" onClick={closeForm}>
Abbrechen Abbrechen
</button> </button>
</div> </div>

View File

@ -174,7 +174,7 @@ export default function ProfileReferenceValuesPage() {
} }
return ( return (
<div style={{ paddingBottom: 88 }}> <div style={{ paddingBottom: 88, textAlign: 'left' }}>
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
<Link <Link
to="/settings" to="/settings"
@ -216,24 +216,26 @@ export default function ProfileReferenceValuesPage() {
<> <>
<div className="card section-gap"> <div className="card section-gap">
<div className="card-title">Referenztyp</div> <div className="card-title">Referenztyp</div>
<label className="form-label" htmlFor="ref-type-select"> <div className="settings-page__field" style={{ borderBottom: 'none', paddingTop: 0 }}>
Wähle einen Kennwert <label className="settings-page__field-label" htmlFor="ref-type-select">
</label> Wähle einen Kennwert
<select </label>
id="ref-type-select" <select
className="form-input" id="ref-type-select"
value={selectedKey} className="form-input"
onChange={(e) => { value={selectedKey}
setSelectedKey(e.target.value) onChange={(e) => {
setEditingId(null) setSelectedKey(e.target.value)
}} setEditingId(null)
> }}
{types.map((t) => ( >
<option key={t.key} value={t.key}> {types.map((t) => (
{t.label} <option key={t.key} value={t.key}>
</option> {t.label}
))} </option>
</select> ))}
</select>
</div>
{selectedType?.description && ( {selectedType?.description && (
<p style={{ fontSize: 13, color: 'var(--text2)', marginTop: 10, lineHeight: 1.5 }}> <p style={{ fontSize: 13, color: 'var(--text2)', marginTop: 10, lineHeight: 1.5 }}>
{selectedType.description} {selectedType.description}
@ -247,66 +249,64 @@ export default function ProfileReferenceValuesPage() {
{editingId ? 'Eintrag bearbeiten' : 'Neuer Eintrag'} {editingId ? 'Eintrag bearbeiten' : 'Neuer Eintrag'}
</div> </div>
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<div className="form-row" style={{ flexDirection: 'column', gap: 12 }}> <div className="settings-page__field">
<div> <label className="settings-page__field-label" htmlFor="ref-date">
<label className="form-label" htmlFor="ref-date"> Datum
Datum </label>
</label> <input
<input id="ref-date"
id="ref-date" type="date"
type="date" className="form-input"
className="form-input" required
required value={form.effective_date}
value={form.effective_date} onChange={(e) => setForm((f) => ({ ...f, effective_date: e.target.value }))}
onChange={(e) => setForm((f) => ({ ...f, effective_date: e.target.value }))} />
/>
</div>
<div>
<label className="form-label" htmlFor="ref-value">
Wert
</label>
<input
id="ref-value"
type="text"
className="form-input"
placeholder="Zahl oder Text (z. B. 178 oder mittel)"
value={form.value}
onChange={(e) => setForm((f) => ({ ...f, value: e.target.value }))}
/>
</div>
<div>
<label className="form-label" htmlFor="ref-unit">
Einheit
</label>
<input
id="ref-unit"
type="text"
className="form-input"
placeholder={selectedType?.default_unit || 'z. B. bpm'}
value={form.unit}
onChange={(e) => setForm((f) => ({ ...f, unit: e.target.value }))}
/>
</div>
<div>
<label className="form-label" htmlFor="ref-notes">
Notiz (optional)
</label>
<textarea
id="ref-notes"
className="form-input"
rows={2}
value={form.notes}
onChange={(e) => setForm((f) => ({ ...f, notes: e.target.value }))}
placeholder="Kontext, Messmethode …"
/>
</div>
</div> </div>
<div style={{ display: 'flex', gap: 8, marginTop: 14, flexWrap: 'wrap' }}> <div className="settings-page__field">
<button type="submit" className="btn btn-primary" style={{ flex: 1, minWidth: 120 }}> <label className="settings-page__field-label" htmlFor="ref-value">
Wert
</label>
<input
id="ref-value"
type="text"
className="form-input"
placeholder="Zahl oder Text (z. B. 178 oder mittel)"
value={form.value}
onChange={(e) => setForm((f) => ({ ...f, value: e.target.value }))}
/>
</div>
<div className="settings-page__field">
<label className="settings-page__field-label" htmlFor="ref-unit">
Einheit
</label>
<input
id="ref-unit"
type="text"
className="form-input"
placeholder={selectedType?.default_unit || 'z. B. bpm'}
value={form.unit}
onChange={(e) => setForm((f) => ({ ...f, unit: e.target.value }))}
/>
</div>
<div className="settings-page__field" style={{ borderBottom: 'none' }}>
<label className="settings-page__field-label" htmlFor="ref-notes">
Notiz (optional)
</label>
<textarea
id="ref-notes"
className="form-input"
rows={3}
value={form.notes}
onChange={(e) => setForm((f) => ({ ...f, notes: e.target.value }))}
placeholder="Kontext, Messmethode …"
/>
</div>
<div style={{ display: 'flex', flexDirection: 'column', gap: 8, marginTop: 8 }}>
<button type="submit" className="btn btn-primary btn-full">
{editingId ? 'Speichern' : 'Hinzufügen'} {editingId ? 'Speichern' : 'Hinzufügen'}
</button> </button>
{editingId && ( {editingId && (
<button type="button" className="btn btn-secondary" onClick={resetForm}> <button type="button" className="btn btn-secondary btn-full" onClick={resetForm}>
Abbrechen Abbrechen
</button> </button>
)} )}