feat: update version to 0.7.6 and add matrix stack bundle functionality
- Incremented application version to 0.7.6 and updated maturity models version to 1.4.0. - Introduced new API endpoints for exporting and importing matrix stack bundles, enhancing the capabilities for managing maturity models and context bindings. - Updated frontend components to support the new matrix stack export and import features, including UI elements for stack management. - Documented changes in the changelog for version 0.7.6, detailing the new matrix stack functionality and its usage.
This commit is contained in:
1 parent
863535aa26
commit
2452b5e2e8
7 files changed
+998
-359
No files matched your search
@@ -52,6 +52,9 @@ export default function MaturityMatrixToolsAdmin() {
|
||||
const [replaceModelId, setReplaceModelId] = useState('')
|
||||
const [exportModelId, setExportModelId] = useState('')
|
||||
const [importBindings, setImportBindings] = useState(true)
|
||||
const [stackWipe, setStackWipe] = useState(false)
|
||||
const [stackConfirmText, setStackConfirmText] = useState('')
|
||||
const [stackLoading, setStackLoading] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
@@ -140,6 +143,22 @@ export default function MaturityMatrixToolsAdmin() {
|
||||
}
|
||||
}
|
||||
|
||||
async function handleExportStack() {
|
||||
setError('')
|
||||
setMessage('')
|
||||
setStackLoading(true)
|
||||
try {
|
||||
const bundle = await api.exportMatrixStackBundle()
|
||||
const name = `matrix-stack-${(bundle.bundle_export_id || 'export').slice(0, 8)}.json`
|
||||
downloadJson(bundle, name)
|
||||
setMessage('Komplett-Stack exportiert (Download).')
|
||||
} catch (err) {
|
||||
setError(err.message || String(err))
|
||||
} finally {
|
||||
setStackLoading(false)
|
||||
}
|
||||
}
|
||||
|
||||
async function handleImportFile(e) {
|
||||
const file = e.target.files?.[0]
|
||||
if (!file) return
|
||||
@@ -147,18 +166,39 @@ export default function MaturityMatrixToolsAdmin() {
|
||||
setMessage('')
|
||||
try {
|
||||
const data = JSON.parse(await file.text())
|
||||
const payload = { ...data, mode: importMode, import_bindings: importBindings }
|
||||
if (importMode === 'replace') {
|
||||
if (!replaceModelId) {
|
||||
setError('Bei „Ersetzen“ die Ziel-Modell-ID angeben.')
|
||||
if (data.kind === 'shinkan.matrix_stack.v1') {
|
||||
if (stackWipe && stackConfirmText !== 'DELETE_MATURITY_STACK') {
|
||||
setError('Vollständiges Ersetzen: Bestätigung exakt „DELETE_MATURITY_STACK“ eintragen (Superadmin).')
|
||||
e.target.value = ''
|
||||
return
|
||||
}
|
||||
payload.replace_model_id = parseInt(replaceModelId, 10)
|
||||
const payload = {
|
||||
...data,
|
||||
replace_all_maturity_models: stackWipe,
|
||||
confirm_replace_all: stackWipe ? stackConfirmText : undefined
|
||||
}
|
||||
const res = await api.importMatrixStackBundle(payload)
|
||||
const w = res.warnings || []
|
||||
setMessage(
|
||||
`Stack-Import OK. Modell-Zuordnung: ${Object.keys(res.model_id_map || {}).length} Modell(e).` +
|
||||
(w.length ? ` ${w.length} Hinweis(e).` : '')
|
||||
)
|
||||
if (w.length) console.warn('matrix_stack import warnings', w)
|
||||
setModels(await api.listMaturityModels({}))
|
||||
} else {
|
||||
const payload = { ...data, mode: importMode, import_bindings: importBindings }
|
||||
if (importMode === 'replace') {
|
||||
if (!replaceModelId) {
|
||||
setError('Bei „Ersetzen“ die Ziel-Modell-ID angeben.')
|
||||
e.target.value = ''
|
||||
return
|
||||
}
|
||||
payload.replace_model_id = parseInt(replaceModelId, 10)
|
||||
}
|
||||
const res = await api.importMaturityModelBundle(payload)
|
||||
setMessage(`Import erfolgreich. Modell-ID: ${res.id}`)
|
||||
setModels(await api.listMaturityModels({}))
|
||||
}
|
||||
const res = await api.importMaturityModelBundle(payload)
|
||||
setMessage(`Import erfolgreich. Modell-ID: ${res.id}`)
|
||||
setModels(await api.listMaturityModels({}))
|
||||
} catch (err) {
|
||||
setError(err.message || String(err))
|
||||
} finally {
|
||||
@@ -170,7 +210,8 @@ export default function MaturityMatrixToolsAdmin() {
|
||||
<div className="admin-matrix-tools">
|
||||
<p className="admin-matrix-tools__intro muted">
|
||||
Matrix nach Kontext auflösen, hierarchisch nach Hauptkategorie und Kategorie darstellen, sowie JSON
|
||||
exportieren oder importieren (gespeichertes Modell inkl. optional Kontext-Bindings, oder aufgelöste Matrix).
|
||||
exportieren oder importieren (gespeichertes Modell inkl. optional Kontext-Bindings, aufgelöste Matrix, oder{' '}
|
||||
<strong>Komplett-Stack</strong> mit Fähigkeitskatalog und allen Reifegradmodellen für Test → Prod).
|
||||
</p>
|
||||
|
||||
{error ? (
|
||||
@@ -307,6 +348,57 @@ export default function MaturityMatrixToolsAdmin() {
|
||||
</section>
|
||||
) : null}
|
||||
|
||||
<section className="card admin-matrix-tools__section">
|
||||
<h2 className="admin-matrix-tools__h2">Komplett-Stack (Katalog + Modelle + Bindings)</h2>
|
||||
<p className="muted admin-matrix-tools__hint">
|
||||
Export enthält <code className="admin-bindings__code">skill_main_categories</code>,{' '}
|
||||
<code className="admin-bindings__code">skill_categories</code>, <code className="admin-bindings__code">skills</code>,{' '}
|
||||
<code className="admin-bindings__code">skill_level_definitions</code>, alle Reifegradmodelle (Stufen, Matrix-Zellen,
|
||||
Legacy-Kontext M:N) sowie <code className="admin-bindings__code">context_bindings</code> mit{' '}
|
||||
<strong>Fokus-/Stil-/Trainingsstil-Namen</strong> für die Ziel-DB. Auf Prod müssen dieselben
|
||||
Katalognamen für Fokusbereiche, Stilrichtungen und Trainingsstile existieren.
|
||||
</p>
|
||||
<div className="admin-matrix-tools__actions">
|
||||
<button
|
||||
type="button"
|
||||
className="btn btn-primary"
|
||||
disabled={stackLoading}
|
||||
onClick={handleExportStack}
|
||||
>
|
||||
{stackLoading ? 'Export…' : 'Komplett-Stack exportieren'}
|
||||
</button>
|
||||
</div>
|
||||
<h3 className="admin-matrix-tools__h3">Stack-Import (JSON-Datei unten)</h3>
|
||||
<p className="muted admin-matrix-tools__hint">
|
||||
Datei mit <code className="admin-bindings__code">kind: shinkan.matrix_stack.v1</code>. Katalog wird per Slug
|
||||
zusammengeführt; Skills per Kategorie + Name. Optional alle Reifegradmodelle auf der Ziel-DB vorher löschen
|
||||
(nur Superadmin, Vorsicht).
|
||||
</p>
|
||||
<label className="form-label admin-matrix-tools__check">
|
||||
<input
|
||||
type="checkbox"
|
||||
checked={stackWipe}
|
||||
onChange={(e) => {
|
||||
setStackWipe(e.target.checked)
|
||||
if (!e.target.checked) setStackConfirmText('')
|
||||
}}
|
||||
/>{' '}
|
||||
Zuerst alle Reifegradmodelle auf dieser Datenbank löschen (nur Superadmin)
|
||||
</label>
|
||||
{stackWipe ? (
|
||||
<>
|
||||
<label className="form-label">Bestätigung (exakt)</label>
|
||||
<input
|
||||
className="form-input"
|
||||
value={stackConfirmText}
|
||||
onChange={(e) => setStackConfirmText(e.target.value)}
|
||||
placeholder="DELETE_MATURITY_STACK"
|
||||
autoComplete="off"
|
||||
/>
|
||||
</>
|
||||
) : null}
|
||||
</section>
|
||||
|
||||
<section className="card admin-matrix-tools__section">
|
||||
<h2 className="admin-matrix-tools__h2">Export / Import (JSON)</h2>
|
||||
<div className="admin-matrix-tools__io-grid">
|
||||
@@ -339,9 +431,10 @@ export default function MaturityMatrixToolsAdmin() {
|
||||
<div>
|
||||
<h3 className="admin-matrix-tools__h3">Import</h3>
|
||||
<p className="muted admin-matrix-tools__hint">
|
||||
Datei <code className="admin-bindings__code">shinkan.maturity_model.v1</code> oder{' '}
|
||||
<code className="admin-bindings__code">shinkan.maturity_matrix_resolved.v1</code>. Aufgelöste
|
||||
Matrizen legen ein neues Modell an bzw. ersetzen den Inhalt des Zielmodells (ohne Bindings).
|
||||
<code className="admin-bindings__code">shinkan.matrix_stack.v1</code> (Komplett-Stack),{' '}
|
||||
<code className="admin-bindings__code">shinkan.maturity_model.v1</code> oder{' '}
|
||||
<code className="admin-bindings__code">shinkan.maturity_matrix_resolved.v1</code>. Aufgelöste Matrizen
|
||||
legen ein neues Modell an bzw. ersetzen den Inhalt des Zielmodells (ohne Bindings).
|
||||
</p>
|
||||
<label className="form-label">Modus</label>
|
||||
<select
|
||||
|
||||
Reference in new issue
Block a user