Enhance MediaWiki import functionality with category normalization and skill attributes
Deploy Development / deploy (push) Successful in 38s
Test Suite / pytest-backend (push) Successful in 40s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 12s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m17s
Test Suite / pytest-backend (pull_request) Successful in 35s
Test Suite / lint-backend (pull_request) Successful in 0s
Test Suite / build-frontend (pull_request) Successful in 12s
Test Suite / k6 /health Baseline (pull_request) Successful in 33s
Test Suite / playwright-tests (pull_request) Successful in 1m8s

- Introduced `_normalize_mw_category` function to clean category names for API calls, ensuring consistent handling of category prefixes.
- Updated `SmwClient` methods to utilize normalized category names, improving data retrieval accuracy.
- Added `_wiki_category_or_default` function to provide default categories based on import type, enhancing user experience during imports.
- Integrated new fields `karate_relevance` and `relevance_level` into various admin components, allowing for better skill management.
- Incremented app version to 0.8.145 and updated changelog to reflect these changes.
This commit is contained in:
Lars committed 2026-05-16 11:05:15 +02:00
1 parent 949a77fe38
commit 623af621b4
11 files changed
+407 -34

No files matched your search

+17 -2
View File
@@ -10,6 +10,13 @@ const WIKI_IMPORT_TABS = [
{ id: 'history', label: 'Historie', icon: History },
]
/** MediaWiki-Kategorienamen ohne Präfix „Kategorie:“ — karatetrainer.net aktueller Stand */
function defaultWikiCategory(importType) {
if (importType === 'skill') return 'Fähigkeitsbeschreibung'
if (importType === 'method') return 'Methodenbeschreibung'
return 'Übungen'
}
export default function MediaWikiImportPage() {
const [activeTab, setActiveTab] = useState('preview')
const [loading, setLoading] = useState(false)
@@ -169,7 +176,11 @@ export default function MediaWikiImportPage() {
</label>
<select
value={previewType}
onChange={(e) => setPreviewType(e.target.value)}
onChange={(e) => {
const t = e.target.value
setPreviewType(t)
setPreviewCategory(defaultWikiCategory(t))
}}
style={{
width: '100%',
padding: '12px',
@@ -315,7 +326,11 @@ export default function MediaWikiImportPage() {
</label>
<select
value={executeType}
onChange={(e) => setExecuteType(e.target.value)}
onChange={(e) => {
const t = e.target.value
setExecuteType(t)
setExecuteCategory(defaultWikiCategory(t))
}}
style={{
width: '100%',
padding: '12px',