feat: enhance admin UI for maturity models and skills catalog
- Added new styles and layout for the maturity models admin panel, improving user experience. - Removed unused multi-selection component for focus areas, style directions, and target groups. - Updated skills catalog functionality to support editing and sorting of main categories and skills. - Introduced a modal for editing main categories, categories, and skills with improved accessibility. - Enhanced responsiveness and visual consistency across admin components.
This commit is contained in:
1 parent
e8b7e62832
commit
469ec93074
3 files changed
+1008
-546
No files matched your search
@@ -2,31 +2,6 @@ import React, { useEffect, useState } from 'react'
|
||||
import { useAuth } from '../../context/AuthContext'
|
||||
import api from '../../utils/api'
|
||||
|
||||
function MultiIdSelect({ label, options, valueIds, onChange, hint }) {
|
||||
return (
|
||||
<div>
|
||||
<label className="form-label">{label}</label>
|
||||
<select
|
||||
multiple
|
||||
className="form-input"
|
||||
style={{ minHeight: 100, width: '100%' }}
|
||||
value={(valueIds || []).map(String)}
|
||||
onChange={(e) => {
|
||||
const v = Array.from(e.target.selectedOptions, (o) => parseInt(o.value, 10))
|
||||
onChange(v)
|
||||
}}
|
||||
>
|
||||
{options.map((o) => (
|
||||
<option key={o.id} value={o.id}>{o.name}</option>
|
||||
))}
|
||||
</select>
|
||||
{hint ? (
|
||||
<div style={{ fontSize: 12, color: 'var(--text3)', marginTop: 4 }}>{hint}</div>
|
||||
) : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default function MaturityModelsAdminPanel() {
|
||||
const { user } = useAuth()
|
||||
const isSuperadmin = user?.role === 'superadmin'
|
||||
@@ -37,17 +12,11 @@ export default function MaturityModelsAdminPanel() {
|
||||
const [loading, setLoading] = useState(false)
|
||||
const [saving, setSaving] = useState(false)
|
||||
const [error, setError] = useState('')
|
||||
const [focusAreas, setFocusAreas] = useState([])
|
||||
const [styles, setStyles] = useState([])
|
||||
const [targetGroups, setTargetGroups] = useState([])
|
||||
const [allSkills, setAllSkills] = useState([])
|
||||
|
||||
const [newModel, setNewModel] = useState({
|
||||
name: '',
|
||||
level_count: 5,
|
||||
focus_area_ids: [],
|
||||
style_direction_ids: [],
|
||||
target_group_ids: [],
|
||||
status: 'draft'
|
||||
})
|
||||
|
||||
@@ -61,18 +30,12 @@ export default function MaturityModelsAdminPanel() {
|
||||
let cancelled = false
|
||||
;(async () => {
|
||||
try {
|
||||
const [m, fa, sd, tg, sk] = await Promise.all([
|
||||
const [m, sk] = await Promise.all([
|
||||
api.listMaturityModels({}),
|
||||
api.listFocusAreas({}),
|
||||
api.listStyleDirections({}),
|
||||
api.listTargetGroups({}),
|
||||
api.listSkills({ status: 'active' })
|
||||
])
|
||||
if (!cancelled) {
|
||||
setModels(m)
|
||||
setFocusAreas(fa)
|
||||
setStyles(sd)
|
||||
setTargetGroups(tg)
|
||||
setAllSkills(sk)
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -97,9 +60,6 @@ export default function MaturityModelsAdminPanel() {
|
||||
setMeta({
|
||||
name: d.name,
|
||||
description: d.description || '',
|
||||
focus_area_ids: (d.focus_areas || []).map((x) => x.id),
|
||||
style_direction_ids: (d.style_directions || []).map((x) => x.id),
|
||||
target_group_ids: (d.target_groups || []).map((x) => x.id),
|
||||
status: d.status,
|
||||
version: d.version || '1.0'
|
||||
})
|
||||
@@ -138,10 +98,7 @@ export default function MaturityModelsAdminPanel() {
|
||||
const payload = {
|
||||
name: newModel.name.trim(),
|
||||
level_count: parseInt(String(newModel.level_count), 10),
|
||||
status: newModel.status,
|
||||
focus_area_ids: newModel.focus_area_ids,
|
||||
style_direction_ids: newModel.style_direction_ids,
|
||||
target_group_ids: newModel.target_group_ids
|
||||
status: newModel.status
|
||||
}
|
||||
const created = await api.createMaturityModel(payload)
|
||||
await refreshModels()
|
||||
@@ -149,9 +106,6 @@ export default function MaturityModelsAdminPanel() {
|
||||
setNewModel({
|
||||
name: '',
|
||||
level_count: 5,
|
||||
focus_area_ids: [],
|
||||
style_direction_ids: [],
|
||||
target_group_ids: [],
|
||||
status: 'draft'
|
||||
})
|
||||
} catch (e) {
|
||||
@@ -169,9 +123,6 @@ export default function MaturityModelsAdminPanel() {
|
||||
await api.updateMaturityModel(selectedId, {
|
||||
name: meta.name,
|
||||
description: meta.description || null,
|
||||
focus_area_ids: meta.focus_area_ids,
|
||||
style_direction_ids: meta.style_direction_ids,
|
||||
target_group_ids: meta.target_group_ids,
|
||||
status: meta.status,
|
||||
version: meta.version
|
||||
})
|
||||
@@ -321,58 +272,45 @@ export default function MaturityModelsAdminPanel() {
|
||||
return (
|
||||
<div className="admin-matrix-panel">
|
||||
<p className="admin-matrix-panel__intro muted">
|
||||
Reifegradmodelle: Kontext (Fokus / Stil / Zielgruppe), Stufen, Matrix-Zelltexte. Die Fähigkeiten selbst pflegen Sie im Tab „Katalog und Hierarchie“.
|
||||
Ablauf: Modell wählen → Stammdaten → Stufen definieren → Fähigkeiten zuordnen → Matrix-Zelltexte pflegen.
|
||||
Fähigkeiten legen Sie im Tab „Katalog und Hierarchie“ an.{' '}
|
||||
<strong>Zuordnung zu Fokusbereich / Stil / Zielgruppe</strong> ist hier vorerst deaktiviert; bestehende
|
||||
Einträge in der Datenbank bleiben unverändert, bis wir das Konzept (Überschneidungen) geklärt haben.
|
||||
</p>
|
||||
|
||||
{error ? (
|
||||
<div className="card" style={{ borderColor: 'var(--danger)', marginBottom: 16 }}>
|
||||
<div className="card admin-matrix-alert" role="alert">
|
||||
{error}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<div
|
||||
style={{
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'minmax(240px, 320px) 1fr',
|
||||
gap: 20,
|
||||
alignItems: 'start'
|
||||
}}
|
||||
>
|
||||
<div className="card" style={{ padding: 16 }}>
|
||||
<h2 style={{ marginTop: 0, fontSize: '1.1rem' }}>Modelle</h2>
|
||||
<ul style={{ listStyle: 'none', padding: 0, margin: 0 }}>
|
||||
<div className="admin-matrix-layout">
|
||||
<aside className="admin-matrix-sidebar card">
|
||||
<h2 className="admin-matrix-sidebar__title">Reifegradmodelle</h2>
|
||||
<ul className="admin-matrix-model-list">
|
||||
{models.map((m) => (
|
||||
<li key={m.id} style={{ marginBottom: 8 }}>
|
||||
<li key={m.id}>
|
||||
<button
|
||||
type="button"
|
||||
className={selectedId === m.id ? 'btn btn-primary' : 'btn btn-secondary'}
|
||||
style={{ width: '100%', textAlign: 'left' }}
|
||||
className={
|
||||
'admin-matrix-model-btn' +
|
||||
(selectedId === m.id ? ' admin-matrix-model-btn--active' : '')
|
||||
}
|
||||
onClick={() => selectModel(m.id)}
|
||||
>
|
||||
<div style={{ fontWeight: 600 }}>{m.name}</div>
|
||||
<div style={{ fontSize: 12, opacity: 0.85, lineHeight: 1.35 }}>
|
||||
{(m.focus_areas || []).length
|
||||
? `Fokus: ${m.focus_areas.map((f) => f.name).join(', ')}`
|
||||
: 'Fokus: alle'}
|
||||
<br />
|
||||
{(m.style_directions || []).length
|
||||
? `Stil: ${m.style_directions.map((s) => s.name).join(', ')}`
|
||||
: 'Stil: alle'}
|
||||
<br />
|
||||
{(m.target_groups || []).length
|
||||
? `Zielgr.: ${m.target_groups.map((t) => t.name).join(', ')}`
|
||||
: 'Zielgr.: alle'}
|
||||
</div>
|
||||
<div style={{ fontSize: 11, opacity: 0.75 }}>{m.status} · {m.level_count} Stufen</div>
|
||||
<span className="admin-matrix-model-btn__name">{m.name}</span>
|
||||
<span className="admin-matrix-model-btn__meta muted">
|
||||
{m.status} · {m.level_count} Stufen
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
||||
<hr style={{ border: 'none', borderTop: '1px solid var(--border)', margin: '16px 0' }} />
|
||||
<hr className="admin-matrix-divider" />
|
||||
|
||||
<h3 style={{ fontSize: '1rem' }}>Neues Modell</h3>
|
||||
<form onSubmit={handleCreate} style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
||||
<h3 className="admin-matrix-sidebar__subtitle">Neues Modell</h3>
|
||||
<form className="admin-matrix-new-form" onSubmit={handleCreate}>
|
||||
<label className="form-label">Name</label>
|
||||
<input
|
||||
className="form-input"
|
||||
@@ -386,6 +324,7 @@ export default function MaturityModelsAdminPanel() {
|
||||
type="number"
|
||||
min={3}
|
||||
max={10}
|
||||
inputMode="numeric"
|
||||
value={newModel.level_count}
|
||||
onChange={(e) => setNewModel((s) => ({ ...s, level_count: e.target.value }))}
|
||||
/>
|
||||
@@ -399,47 +338,34 @@ export default function MaturityModelsAdminPanel() {
|
||||
<option value="active">Aktiv</option>
|
||||
<option value="archived">Archiviert</option>
|
||||
</select>
|
||||
<MultiIdSelect
|
||||
label="Fokusbereiche (leer = alle)"
|
||||
options={focusAreas}
|
||||
valueIds={newModel.focus_area_ids}
|
||||
onChange={(ids) => setNewModel((s) => ({ ...s, focus_area_ids: ids }))}
|
||||
hint="Strg/Cmd gedrückt halten für Mehrfachauswahl."
|
||||
/>
|
||||
<MultiIdSelect
|
||||
label="Stilrichtungen (leer = alle)"
|
||||
options={styles}
|
||||
valueIds={newModel.style_direction_ids}
|
||||
onChange={(ids) => setNewModel((s) => ({ ...s, style_direction_ids: ids }))}
|
||||
hint="Strg/Cmd gedrückt halten für Mehrfachauswahl."
|
||||
/>
|
||||
<MultiIdSelect
|
||||
label="Zielgruppen (leer = alle)"
|
||||
options={targetGroups}
|
||||
valueIds={newModel.target_group_ids}
|
||||
onChange={(ids) => setNewModel((s) => ({ ...s, target_group_ids: ids }))}
|
||||
hint="Strg/Cmd gedrückt halten für Mehrfachauswahl."
|
||||
/>
|
||||
<button type="submit" className="btn btn-primary btn-full" disabled={saving}>
|
||||
Anlegen
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
<div>
|
||||
{loading ? <div className="spinner" /> : null}
|
||||
<div className="admin-matrix-main">
|
||||
{loading ? (
|
||||
<div className="admin-matrix-loading" aria-busy="true">
|
||||
<div className="spinner" />
|
||||
<span className="muted">Lade Modell…</span>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{!loading && !detail && (
|
||||
<div className="card" style={{ padding: 24, color: 'var(--text2)' }}>
|
||||
Modell links wählen oder neu anlegen.
|
||||
<div className="card admin-matrix-empty">
|
||||
Modell in der linken Spalte wählen oder neu anlegen.
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!loading && detail && meta && (
|
||||
<>
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16 }}>
|
||||
<h2 style={{ marginTop: 0, fontSize: '1.1rem' }}>Kontext & Metadaten</h2>
|
||||
<div className="form-row" style={{ display: 'grid', gap: 12 }}>
|
||||
<section className="card admin-matrix-section">
|
||||
<div className="admin-matrix-section__head">
|
||||
<span className="admin-matrix-step">1</span>
|
||||
<h2 className="admin-matrix-section__title">Stammdaten</h2>
|
||||
</div>
|
||||
<div className="admin-matrix-meta-grid">
|
||||
<div>
|
||||
<label className="form-label">Name</label>
|
||||
<input
|
||||
@@ -457,28 +383,7 @@ export default function MaturityModelsAdminPanel() {
|
||||
onChange={(e) => setMeta((m) => ({ ...m, description: e.target.value }))}
|
||||
/>
|
||||
</div>
|
||||
<MultiIdSelect
|
||||
label="Fokusbereiche (keine Auswahl = alle)"
|
||||
options={focusAreas}
|
||||
valueIds={meta.focus_area_ids}
|
||||
onChange={(ids) => setMeta((m) => ({ ...m, focus_area_ids: ids }))}
|
||||
hint="Strg/Cmd + Klick für mehrere. Alle abwählen = gilt in jedem Fokusbereich."
|
||||
/>
|
||||
<MultiIdSelect
|
||||
label="Stilrichtungen (keine Auswahl = alle)"
|
||||
options={styles}
|
||||
valueIds={meta.style_direction_ids}
|
||||
onChange={(ids) => setMeta((m) => ({ ...m, style_direction_ids: ids }))}
|
||||
hint="Strg/Cmd + Klick für mehrere."
|
||||
/>
|
||||
<MultiIdSelect
|
||||
label="Zielgruppen (keine Auswahl = alle)"
|
||||
options={targetGroups}
|
||||
valueIds={meta.target_group_ids}
|
||||
onChange={(ids) => setMeta((m) => ({ ...m, target_group_ids: ids }))}
|
||||
hint="Strg/Cmd + Klick für mehrere."
|
||||
/>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 12 }}>
|
||||
<div className="admin-matrix-meta-grid__row2">
|
||||
<div>
|
||||
<label className="form-label">Status</label>
|
||||
<select
|
||||
@@ -501,9 +406,26 @@ export default function MaturityModelsAdminPanel() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 8, marginTop: 12, flexWrap: 'wrap' }}>
|
||||
{((detail.focus_areas || []).length > 0 ||
|
||||
(detail.style_directions || []).length > 0 ||
|
||||
(detail.target_groups || []).length > 0) && (
|
||||
<div className="admin-matrix-context-readonly muted">
|
||||
<strong>Hinweis (nur Anzeige):</strong> In der Datenbank sind noch Kontext-Zuordnungen
|
||||
hinterlegt (Fokus / Stil / Zielgruppe). Diese können Sie hier derzeit nicht ändern.
|
||||
{(detail.focus_areas || []).length ? (
|
||||
<div>Fokusbereiche: {(detail.focus_areas || []).map((f) => f.name).join(', ')}</div>
|
||||
) : null}
|
||||
{(detail.style_directions || []).length ? (
|
||||
<div>Stilrichtungen: {(detail.style_directions || []).map((s) => s.name).join(', ')}</div>
|
||||
) : null}
|
||||
{(detail.target_groups || []).length ? (
|
||||
<div>Zielgruppen: {(detail.target_groups || []).map((t) => t.name).join(', ')}</div>
|
||||
) : null}
|
||||
</div>
|
||||
)}
|
||||
<div className="admin-matrix-actions">
|
||||
<button type="button" className="btn btn-primary" onClick={handleSaveMeta} disabled={saving}>
|
||||
Metadaten speichern
|
||||
Stammdaten speichern
|
||||
</button>
|
||||
{isSuperadmin ? (
|
||||
<button type="button" className="btn btn-secondary" onClick={handleDeleteModel} disabled={saving}>
|
||||
@@ -511,39 +433,43 @@ export default function MaturityModelsAdminPanel() {
|
||||
</button>
|
||||
) : null}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16 }}>
|
||||
<h2 style={{ marginTop: 0, fontSize: '1.1rem' }}>Stufen (Bezeichnungen)</h2>
|
||||
<p style={{ fontSize: 14, color: 'var(--text2)', marginTop: 0 }}>
|
||||
Reihenfolge muss lückenlos 1…N sein. Stufenanzahl ändern passt die Tabelle an; danach speichern.
|
||||
<section className="card admin-matrix-section">
|
||||
<div className="admin-matrix-section__head">
|
||||
<span className="admin-matrix-step">2</span>
|
||||
<h2 className="admin-matrix-section__title">Stufen (Bezeichnungen)</h2>
|
||||
</div>
|
||||
<p className="admin-matrix-hint muted">
|
||||
Nummern 1…N lückenlos. Stufenanzahl ändert die Matrix; danach „Stufen speichern“.
|
||||
</p>
|
||||
<div style={{ marginBottom: 12, maxWidth: 200 }}>
|
||||
<div className="admin-matrix-level-count">
|
||||
<label className="form-label">Stufenanzahl (3–10)</label>
|
||||
<input
|
||||
className="form-input"
|
||||
type="number"
|
||||
min={3}
|
||||
max={10}
|
||||
inputMode="numeric"
|
||||
value={levelCount}
|
||||
onChange={(e) => onLevelCountChange(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: 14 }}>
|
||||
<div className="admin-matrix-table-wrap">
|
||||
<table className="admin-matrix-table admin-matrix-table--levels">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style={{ textAlign: 'left', padding: 8 }}>Nr.</th>
|
||||
<th style={{ textAlign: 'left', padding: 8 }}>Name</th>
|
||||
<th style={{ textAlign: 'left', padding: 8 }}>Beschreibung</th>
|
||||
<th style={{ textAlign: 'left', padding: 8 }}>Sort</th>
|
||||
<th>Nr.</th>
|
||||
<th>Name</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Sort</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{levelsForm.map((row, idx) => (
|
||||
<tr key={row.level_number} style={{ borderTop: '1px solid var(--border)' }}>
|
||||
<td style={{ padding: 8 }}>{row.level_number}</td>
|
||||
<td style={{ padding: 8 }}>
|
||||
<tr key={row.level_number}>
|
||||
<td>{row.level_number}</td>
|
||||
<td>
|
||||
<input
|
||||
className="form-input"
|
||||
value={row.name}
|
||||
@@ -554,7 +480,7 @@ export default function MaturityModelsAdminPanel() {
|
||||
}}
|
||||
/>
|
||||
</td>
|
||||
<td style={{ padding: 8 }}>
|
||||
<td>
|
||||
<input
|
||||
className="form-input"
|
||||
value={row.description}
|
||||
@@ -565,10 +491,11 @@ export default function MaturityModelsAdminPanel() {
|
||||
}}
|
||||
/>
|
||||
</td>
|
||||
<td style={{ padding: 8, width: 72 }}>
|
||||
<td className="admin-matrix-table__narrow">
|
||||
<input
|
||||
className="form-input"
|
||||
type="number"
|
||||
inputMode="numeric"
|
||||
value={row.sort_order}
|
||||
onChange={(e) => {
|
||||
const next = [...levelsForm]
|
||||
@@ -584,19 +511,21 @@ export default function MaturityModelsAdminPanel() {
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ marginTop: 12 }}
|
||||
className="btn btn-secondary admin-matrix-actions--mt"
|
||||
onClick={handleSaveLevels}
|
||||
disabled={saving}
|
||||
>
|
||||
Stufen speichern
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16 }}>
|
||||
<h2 style={{ marginTop: 0, fontSize: '1.1rem' }}>Fähigkeiten im Modell</h2>
|
||||
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', alignItems: 'flex-end' }}>
|
||||
<div style={{ flex: '1 1 220px' }}>
|
||||
<section className="card admin-matrix-section">
|
||||
<div className="admin-matrix-section__head">
|
||||
<span className="admin-matrix-step">3</span>
|
||||
<h2 className="admin-matrix-section__title">Fähigkeiten im Modell</h2>
|
||||
</div>
|
||||
<div className="admin-matrix-skill-add">
|
||||
<div className="admin-matrix-skill-add__select">
|
||||
<label className="form-label">Fähigkeit hinzufügen</label>
|
||||
<select
|
||||
className="form-input"
|
||||
@@ -609,27 +538,30 @@ export default function MaturityModelsAdminPanel() {
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
<button type="button" className="btn btn-primary" onClick={handleAddSkill} disabled={saving || !skillToAdd}>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary admin-matrix-skill-add__btn"
|
||||
onClick={handleAddSkill}
|
||||
disabled={saving || !skillToAdd}
|
||||
>
|
||||
Hinzufügen
|
||||
</button>
|
||||
</div>
|
||||
<ul style={{ marginTop: 12, paddingLeft: 18 }}>
|
||||
<ul className="admin-matrix-skill-list">
|
||||
{(detail.model_skills || []).map((ms) => (
|
||||
<li key={ms.skill_id} style={{ marginBottom: 10 }}>
|
||||
<div>
|
||||
<strong>{ms.skill_name}</strong>
|
||||
{' '}
|
||||
<li key={ms.skill_id} className="admin-matrix-skill-list__item">
|
||||
<div className="admin-matrix-skill-list__row">
|
||||
<strong className="admin-matrix-skill-list__name">{ms.skill_name}</strong>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-secondary"
|
||||
style={{ padding: '2px 8px', fontSize: 12 }}
|
||||
className="btn btn-secondary btn-small"
|
||||
onClick={() => handleRemoveSkill(ms.skill_id)}
|
||||
>
|
||||
entfernen
|
||||
Entfernen
|
||||
</button>
|
||||
</div>
|
||||
{(ms.skill_main_category_name || ms.skill_subcategory_name) ? (
|
||||
<div style={{ fontSize: 12, color: 'var(--text2)', marginTop: 2 }}>
|
||||
<div className="admin-matrix-skill-list__path muted">
|
||||
{ms.skill_main_category_name}
|
||||
{ms.skill_subcategory_name ? ` › ${ms.skill_subcategory_name}` : ''}
|
||||
</div>
|
||||
@@ -637,26 +569,23 @@ export default function MaturityModelsAdminPanel() {
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div className="card" style={{ padding: 16 }}>
|
||||
<h2 style={{ marginTop: 0, fontSize: '1.1rem' }}>Matrix (Zielbild je Stufe)</h2>
|
||||
<p style={{ fontSize: 14, color: 'var(--text2)', marginTop: 0 }}>
|
||||
Leere Zellen werden beim Speichern aus der Datenbank entfernt. Beobachtungskriterien optional in
|
||||
zweiter Zeile (nach Speichern mit Beschreibung).
|
||||
<section className="card admin-matrix-section">
|
||||
<div className="admin-matrix-section__head">
|
||||
<span className="admin-matrix-step">4</span>
|
||||
<h2 className="admin-matrix-section__title">Matrix (Zielbild je Stufe)</h2>
|
||||
</div>
|
||||
<p className="admin-matrix-hint muted">
|
||||
Leere Zellen werden beim Speichern entfernt. Unten: Beobachtungskriterien (optional).
|
||||
</p>
|
||||
<div style={{ overflow: 'auto', maxHeight: '70vh' }}>
|
||||
<table style={{ borderCollapse: 'collapse', fontSize: 13, minWidth: 600 }}>
|
||||
<div className="admin-matrix-matrix-scroll">
|
||||
<table className="admin-matrix-table admin-matrix-table--matrix">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style={{ padding: 8, border: '1px solid var(--border)', position: 'sticky', left: 0, background: 'var(--surface)' }}>
|
||||
Fähigkeit
|
||||
</th>
|
||||
<th className="admin-matrix-matrix__corner">Fähigkeit</th>
|
||||
{(detail.levels || []).map((l) => (
|
||||
<th
|
||||
key={l.level_number}
|
||||
style={{ padding: 8, border: '1px solid var(--border)', minWidth: 160, background: 'var(--surface2)' }}
|
||||
>
|
||||
<th key={l.level_number} className="admin-matrix-matrix__level-head">
|
||||
{l.level_number}. {l.name}
|
||||
</th>
|
||||
))}
|
||||
@@ -665,21 +594,10 @@ export default function MaturityModelsAdminPanel() {
|
||||
<tbody>
|
||||
{(detail.model_skills || []).map((ms) => (
|
||||
<tr key={ms.skill_id}>
|
||||
<td
|
||||
style={{
|
||||
padding: 8,
|
||||
border: '1px solid var(--border)',
|
||||
position: 'sticky',
|
||||
left: 0,
|
||||
background: 'var(--surface)',
|
||||
fontWeight: 600,
|
||||
maxWidth: 220,
|
||||
verticalAlign: 'top'
|
||||
}}
|
||||
>
|
||||
<td className="admin-matrix-matrix__skill-cell">
|
||||
<div>{ms.skill_name}</div>
|
||||
{(ms.skill_main_category_name || ms.skill_subcategory_name) ? (
|
||||
<div style={{ fontSize: 11, fontWeight: 400, color: 'var(--text2)', marginTop: 4, lineHeight: 1.3 }}>
|
||||
<div className="admin-matrix-matrix__skill-path muted">
|
||||
{ms.skill_main_category_name || '—'}
|
||||
{ms.skill_subcategory_name ? ` › ${ms.skill_subcategory_name}` : ''}
|
||||
</div>
|
||||
@@ -689,22 +607,20 @@ export default function MaturityModelsAdminPanel() {
|
||||
const key = `${ms.skill_id}-${l.level_number}`
|
||||
const d = cellDraft[key] || { description: '', observable_criteria: '' }
|
||||
return (
|
||||
<td key={l.level_number} style={{ padding: 6, border: '1px solid var(--border)', verticalAlign: 'top' }}>
|
||||
<td key={l.level_number} className="admin-matrix-matrix__cell">
|
||||
<textarea
|
||||
className="form-input"
|
||||
className="form-input admin-matrix-matrix__ta"
|
||||
rows={3}
|
||||
placeholder="Zielbild / Erwartung"
|
||||
value={d.description}
|
||||
onChange={(e) => setCell(ms.skill_id, l.level_number, 'description', e.target.value)}
|
||||
style={{ fontSize: 12, width: '100%', minWidth: 140 }}
|
||||
/>
|
||||
<textarea
|
||||
className="form-input"
|
||||
className="form-input admin-matrix-matrix__ta admin-matrix-matrix__ta--criteria"
|
||||
rows={2}
|
||||
placeholder="Beobachtungskriterien (optional)"
|
||||
value={d.observable_criteria}
|
||||
onChange={(e) => setCell(ms.skill_id, l.level_number, 'observable_criteria', e.target.value)}
|
||||
style={{ fontSize: 11, width: '100%', minWidth: 140, marginTop: 4 }}
|
||||
/>
|
||||
</td>
|
||||
)
|
||||
@@ -716,14 +632,13 @@ export default function MaturityModelsAdminPanel() {
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
style={{ marginTop: 12 }}
|
||||
className="btn btn-primary admin-matrix-actions--mt"
|
||||
onClick={handleSaveMatrix}
|
||||
disabled={saving || !(detail.model_skills || []).length}
|
||||
>
|
||||
Matrix speichern
|
||||
</button>
|
||||
</div>
|
||||
</section>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user