Rename field `type` to `content_type` in REST response

In Wagtail Grapple/GraphQL the field is already called `content_type`
This commit is contained in:
Daniel Egger 2023-05-12 13:34:23 +02:00
parent a15af2bf86
commit b313bad031
16 changed files with 179 additions and 179 deletions

View File

@ -173,7 +173,7 @@ const learningSequenceBorderClass = computed(() => {
<div class="hidden sm:block"></div>
<div class="w-full sm:w-auto">
<LearningContentBadge
:learning-content-type="learningContent.type"
:learning-content-type="learningContent.content_type"
/>
</div>
</div>

View File

@ -38,7 +38,7 @@ const COMPONENTS: Record<LearningContentType, Component> = {
const DEFAULT_BLOCK = DescriptionBlock;
const component = computed(() => {
return COMPONENTS[props.learningContent.type] || DEFAULT_BLOCK;
return COMPONENTS[props.learningContent.content_type] || DEFAULT_BLOCK;
});
function handleFinishedLearningContent() {

View File

@ -145,7 +145,7 @@ const assignmentUser = computed(() => {
:current-step="stepIndex"
:subtitle="state.assignment?.title ?? ''"
:title="getTitle()"
:learning-content-type="props.learningContent.type"
:learning-content-type="props.learningContent.content_type"
:steps-count="numPages"
:show-next-button="showNextButton && stepIndex !== 0"
:show-exit-button="showExitButton"

View File

@ -19,7 +19,7 @@ const courseSessionAttendanceDay = computed(() => {
<template>
<LearningContentSimpleLayout
:title="content.title"
:learning-content-type="props.content.type"
:learning-content-type="props.content.content_type"
>
<div class="container-medium">
<div class="lg:mt-8">

View File

@ -8,7 +8,7 @@ const props = defineProps<{
</script>
<template>
<LearningContentSimpleLayout :learning-content-type="props.content.type">
<LearningContentSimpleLayout :learning-content-type="props.content.content_type">
<div class="h-screen">
<iframe
width="100%"

View File

@ -13,7 +13,7 @@ const props = defineProps<{
<template>
<LearningContentSimpleLayout
:title="props.content.title"
:learning-content-type="props.content.type"
:learning-content-type="props.content.content_type"
>
<div class="container-medium">
<p class="text-large my-4 lg:my-8">{{ props.content.description }}</p>

View File

@ -10,6 +10,6 @@ const props = defineProps<{
<template>
<LearningContentSimpleLayout
:title="props.content.title"
:learning-content-type="props.content.type"
:learning-content-type="props.content.content_type"
></LearningContentSimpleLayout>
</template>

View File

@ -1,7 +1,7 @@
<template>
<LearningContentSimpleLayout
:title="props.content.title"
:learning-content-type="props.content.type"
:learning-content-type="props.content.content_type"
>
<div class="container-medium">
<iframe

View File

@ -1,244 +1,244 @@
{
"id": 960,
"id": 10,
"title": "Test Lernpfad",
"slug": "test-lehrgang-lp",
"type": "learnpath.LearningPath",
"translation_key": "5818e5fb-5f8a-4f6f-b3a4-61651d0cd408",
"content_type": "learnpath.LearningPath",
"translation_key": "9cf4fea4-9d6f-4297-ab99-68a65bf07bb5",
"frontend_url": "/course/test-lehrgang/learn",
"children": [
{
"id": 961,
"id": 11,
"title": "Circle \u00dcK",
"slug": "test-lehrgang-lp-topic-circle-\u00fck",
"type": "learnpath.Topic",
"translation_key": "8b197f3d-8594-416c-9f9c-d3e929524220",
"content_type": "learnpath.Topic",
"translation_key": "983f97f7-fd68-4678-860f-7a19bab0b94d",
"frontend_url": "",
"is_visible": false
},
{
"id": 962,
"id": 12,
"title": "Fahrzeug",
"slug": "test-lehrgang-lp-circle-fahrzeug",
"type": "learnpath.Circle",
"translation_key": "f8e861f5-409e-4976-a301-540e6569dbb9",
"content_type": "learnpath.Circle",
"translation_key": "0286b096-2a55-4242-a277-ba15d478b79a",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug",
"children": [
{
"id": 963,
"id": 13,
"title": "Vorbereitung",
"slug": "test-lehrgang-lp-circle-fahrzeug-ls-vorbereitung",
"type": "learnpath.LearningSequence",
"translation_key": "a7aac91d-200f-4633-ab34-c75bda9274e6",
"content_type": "learnpath.LearningSequence",
"translation_key": "dbc0e05f-a899-4524-b021-39a97ac1c542",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#ls-vorbereitung",
"icon": "it-icon-ls-start"
},
{
"id": 964,
"id": 14,
"title": "Vorbereitung",
"slug": "test-lehrgang-lp-circle-fahrzeug-lu-vorbereitung",
"type": "learnpath.LearningUnit",
"translation_key": "cfcbdd21-93f0-4c4a-a9a8-e56c9e2f8232",
"content_type": "learnpath.LearningUnit",
"translation_key": "626d656a-15d6-49ce-8b20-c035482802cd",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#lu-vorbereitung",
"evaluate_url": "/course/test-lehrgang/learn/fahrzeug/evaluate/vorbereitung",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": [
{
"id": 968,
"id": 18,
"title": "Innerhalb des Handlungsfelds \u00abFahrzeug\u00bb bin ich f\u00e4hig, die Ziele und Pl\u00e4ne des Kunden zu ergr\u00fcnden (SOLL).",
"slug": "test-lehrgang-competence-crit-x11-allgemein",
"type": "competence.PerformanceCriteria",
"translation_key": "6079a11f-d5bd-45ba-88f9-3482dd79ad93",
"content_type": "competence.PerformanceCriteria",
"translation_key": "d49be54d-51e5-4bf4-9238-365006c3b95d",
"frontend_url": "",
"competence_id": "X1.1"
},
{
"id": 969,
"id": 19,
"title": "Innerhalb des Handlungsfelds \u00abFahrzeug\u00bb bin ich f\u00e4hig, die IST-Situation des Kunden mit der geeigneten Gespr\u00e4chs-/Fragetechnik zu erfassen.",
"slug": "test-lehrgang-competence-crit-x11-allgemein-1",
"type": "competence.PerformanceCriteria",
"translation_key": "e8766afa-dc45-4b29-8a74-a766e45aa8c2",
"content_type": "competence.PerformanceCriteria",
"translation_key": "2fb68d58-3ab7-4192-865c-1e67ab9bcd15",
"frontend_url": "",
"competence_id": "X1.1"
}
]
},
{
"id": 965,
"id": 15,
"title": "Verschaffe dir einen \u00dcberblick",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-verschaffe-dir-einen-\u00fcberblick",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "4c2ba4e8-ad1f-41d1-9394-7b75cd63cecb",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "47698ce1-0e4f-446d-a23d-8a9e9c906ff7",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/verschaffe-dir-einen-\u00fcberblick",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 966,
"id": 16,
"title": "Mediathek Fahrzeug",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-mediathek-fahrzeug",
"type": "learnpath.LearningContentMediaLibrary",
"translation_key": "ea0dd010-b436-48e1-a599-d9fd1543393e",
"content_type": "learnpath.LearningContentMediaLibrary",
"translation_key": "34e79a3b-c1f9-49ff-b779-0149d614f02c",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/mediathek-fahrzeug",
"minutes": 15,
"description": "",
"content_url": "/media/\u00fcberbetriebliche-kurse-media/category/fahrzeug"
},
{
"id": 967,
"id": 17,
"title": "Vorbereitungsauftrag",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-vorbereitungsauftrag",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "5bc830fe-812c-4778-b668-807e782d1ec1",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "8feca9cd-4937-4406-b44d-564f341e8bfe",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/vorbereitungsauftrag",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 970,
"id": 20,
"title": "Training",
"slug": "test-lehrgang-lp-circle-fahrzeug-ls-training",
"type": "learnpath.LearningSequence",
"translation_key": "83f1443a-d0fa-43fc-a737-8172e8ad53ce",
"content_type": "learnpath.LearningSequence",
"translation_key": "b09f87c7-01fb-4967-98c1-894ac3144595",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#ls-training",
"icon": "it-icon-ls-apply"
},
{
"id": 971,
"id": 21,
"title": "Unterlagen",
"slug": "test-lehrgang-lp-circle-fahrzeug-lu-unterlagen",
"type": "learnpath.LearningUnit",
"translation_key": "1573d0a7-3427-4beb-8c17-e60520bf9c4f",
"content_type": "learnpath.LearningUnit",
"translation_key": "772d5352-87fa-46a7-8470-368d59565d3a",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#lu-unterlagen",
"evaluate_url": "/course/test-lehrgang/learn/fahrzeug/evaluate/unterlagen",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": []
},
{
"id": 972,
"id": 22,
"title": "Unterlagen f\u00fcr den Unterricht",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-unterlagen-f\u00fcr-den-unterricht",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "c956b3d3-51d6-4e4d-a088-25dd48ea853c",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "ace9f1e8-5cb7-4b7c-b1c8-d43f2e4f7269",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/unterlagen-f\u00fcr-den-unterricht",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 973,
"id": 23,
"title": "Pr\u00e4senztag",
"slug": "test-lehrgang-lp-circle-fahrzeug-lu-pr\u00e4senztag",
"type": "learnpath.LearningUnit",
"translation_key": "e0db56fb-25f2-44e2-b46a-88802ca1f7d5",
"content_type": "learnpath.LearningUnit",
"translation_key": "18bc5d1d-ddcf-4e54-b58c-58f1e8833af2",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#lu-pr\u00e4senztag",
"evaluate_url": "/course/test-lehrgang/learn/fahrzeug/evaluate/pr\u00e4senztag",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": []
},
{
"id": 974,
"id": 24,
"title": "Pr\u00e4senztag Fahrzeug",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-pr\u00e4senztag-fahrzeug",
"type": "learnpath.LearningContentAttendanceDay",
"translation_key": "b72bab8f-52c2-41cf-b392-1072e1af74a5",
"content_type": "learnpath.LearningContentAttendanceDay",
"translation_key": "2441afae-83ea-4fb5-a938-8db4352ed6c5",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/pr\u00e4senztag-fahrzeug",
"minutes": 15,
"description": "Platzhalter Beschreibung",
"content_url": ""
},
{
"id": 975,
"id": 25,
"title": "Kompetenznachweis",
"slug": "test-lehrgang-lp-circle-fahrzeug-lu-kompetenznachweis",
"type": "learnpath.LearningUnit",
"translation_key": "92c3a43d-a7b8-46d5-9600-42a0e5bd4bb4",
"content_type": "learnpath.LearningUnit",
"translation_key": "b115d4e0-f487-4d03-a7cf-08d90bb4813d",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#lu-kompetenznachweis",
"evaluate_url": "/course/test-lehrgang/learn/fahrzeug/evaluate/kompetenznachweis",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": []
},
{
"id": 976,
"id": 26,
"title": "Wissens- und Verst\u00e4ndnisfragen",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-wissens-und-verst\u00e4ndnisfragen",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "69982715-8860-474d-babd-7c626bd15f1c",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "053c32bd-6174-444b-95fe-35ad2e15edf5",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/wissens-und-verst\u00e4ndnisfragen",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 977,
"id": 27,
"title": "Transfer",
"slug": "test-lehrgang-lp-circle-fahrzeug-ls-transfer",
"type": "learnpath.LearningSequence",
"translation_key": "0322717c-8f61-44fa-b5dd-d5e064733b3f",
"content_type": "learnpath.LearningSequence",
"translation_key": "58939dc7-dd19-4996-b4bf-aba348be092a",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#ls-transfer",
"icon": "it-icon-ls-end"
},
{
"id": 978,
"id": 28,
"title": "Transfer",
"slug": "test-lehrgang-lp-circle-fahrzeug-lu-transfer",
"type": "learnpath.LearningUnit",
"translation_key": "028f154d-8460-4509-839b-8bbb37460930",
"content_type": "learnpath.LearningUnit",
"translation_key": "185568d3-9ba3-433d-9480-4f492d9d3235",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug#lu-transfer",
"evaluate_url": "/course/test-lehrgang/learn/fahrzeug/evaluate/transfer",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": []
},
{
"id": 979,
"id": 29,
"title": "Reflexion",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-reflexion",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "b7a09b9b-ab08-4eec-ba16-3defb8fa965e",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "c62d4cf6-2505-40f7-8764-41fa1ea0057c",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/reflexion",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 980,
"id": 30,
"title": "\u00dcberpr\u00fcfen einer Motorfahrzeug-Versicherungspolice",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-\u00fcberpr\u00fcfen-einer-motorfahrzeug-versicherungspolice",
"type": "learnpath.LearningContentAssignment",
"translation_key": "19ffe6d9-60ac-4e08-8f18-25dc64f906ca",
"content_type": "learnpath.LearningContentAssignment",
"translation_key": "53cc2b76-ea59-47a2-a15a-ebf19897e9b1",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/\u00fcberpr\u00fcfen-einer-motorfahrzeug-versicherungspolice",
"minutes": 15,
"description": "",
"content_url": "",
"content_assignment_id": 959
"content_assignment_id": 9
},
{
"id": 981,
"id": 31,
"title": "Feedback",
"slug": "test-lehrgang-lp-circle-fahrzeug-lc-feedback",
"type": "learnpath.LearningContentFeedback",
"translation_key": "23b72e4c-aa68-4b47-9cdc-4b60b40a1e1f",
"content_type": "learnpath.LearningContentFeedback",
"translation_key": "d78bded2-a760-492c-9249-283230d98ce0",
"frontend_url": "/course/test-lehrgang/learn/fahrzeug/feedback",
"minutes": 15,
"description": "",
@ -249,185 +249,185 @@
"goals": "\n <p class=\"mt-4\">In diesem Circle erf\u00e4hrst du wie der Lehrgang aufgebaut ist. Zudem lernst du die wichtigsten Grundlagen,\n damit du erfolgreich mit deinem Lernpfad und in deinem Job (durch-)starten kannst.</p>\n <p class=\"mt-4\">Du baust das Grundlagenwissen f\u00fcr die folgenden Themenfelder auf:</p>\n <ul>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Aufbau von myVBV und wie du dich im Lernpfad zurechtfindest</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Worauf die Ausbildung und die Zulassungspr\u00fcfung zum/zur Versicherungsvermittler/-in VBV basieren</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Organisation deiner Lernreise und deiner Zusammenarbeit mit deiner Lernbegleitung und einem\n Lernpartner/einer Lernpartnerin</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Tipps und Tricks zur Organisation eines erfolgreichen Arbeitsalltags</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Umgang mit den sozialen Medien und Datenschutz</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Basiswissen Versicherungswirtschaft</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>Basiswissen Versicherungsrecht</li>\n </ul>\n <p class=\"mt-4\">Du arbeitest an folgenden Leistungskriterien aus dem Qualifikationsprofil:</p>\n <h3>Arbeitsalltag/Lerneinheit: \u00abLucas Auftritt in den sozialen Medien und der Umgang mit sensiblen Daten\u00bb</h3>\n <p class=\"mt-4\">Ich bin f\u00e4hig, \u2026</p>\n <ul>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>A3.1: \u2026 in Zusammenarbeit mit den IT-Spezialisten und der Marketingabteilung die Inhalte f\u00fcr den zu\n realisierenden Medienauftritt zielgruppengerecht festzulegen</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>A3.2: \u2026 f\u00fcr die verschiedenen Kundensegmente die passenden sozialen Medien zu definieren</li>\n <li class=\"flex items-center\"><it-icon-check class=\"hidden h-12 w-12 flex-none text-sky-500 lg:inline-block it-icon\"></it-icon-check>A3.3. \u2026 die Inhalte compliant zu halten</li>\n </ul>\n "
},
{
"id": 982,
"id": 32,
"title": "Circle VV",
"slug": "test-lehrgang-lp-topic-circle-vv",
"type": "learnpath.Topic",
"translation_key": "59e57288-91fd-45fa-9109-5a8c08f2e3f1",
"content_type": "learnpath.Topic",
"translation_key": "19611237-22e1-40e6-b5b1-a34ff470df14",
"frontend_url": "",
"is_visible": false
},
{
"id": 983,
"id": 33,
"title": "Reisen",
"slug": "test-lehrgang-lp-circle-reisen",
"type": "learnpath.Circle",
"translation_key": "4f549d95-e645-4114-a4e6-49d1a7d0a5ef",
"content_type": "learnpath.Circle",
"translation_key": "2aaf0215-693a-407c-9f1c-bdb80f982c92",
"frontend_url": "/course/test-lehrgang/learn/reisen",
"children": [
{
"id": 984,
"id": 34,
"title": "Starten",
"slug": "test-lehrgang-lp-circle-reisen-ls-starten",
"type": "learnpath.LearningSequence",
"translation_key": "a5519b42-00d8-4958-ac7e-078d016a0f11",
"content_type": "learnpath.LearningSequence",
"translation_key": "e4b0eac3-3a7c-435f-8151-f69c40b35fd6",
"frontend_url": "/course/test-lehrgang/learn/reisen#ls-starten",
"icon": "it-icon-ls-start"
},
{
"id": 985,
"id": 35,
"title": "Einf\u00fchrung",
"slug": "test-lehrgang-lp-circle-reisen-lu-einf\u00fchrung",
"type": "learnpath.LearningUnit",
"translation_key": "8c6d323c-abf8-4a7b-b0d0-d64d714d41b2",
"content_type": "learnpath.LearningUnit",
"translation_key": "9f0d6302-d058-4f93-b08e-9dbd4b8b8ed3",
"frontend_url": "/course/test-lehrgang/learn/reisen#lu-einf\u00fchrung",
"evaluate_url": "/course/test-lehrgang/learn/reisen/evaluate/einf\u00fchrung",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": []
},
{
"id": 986,
"id": 36,
"title": "Verschaff dir einen \u00dcberblick",
"slug": "test-lehrgang-lp-circle-reisen-lc-verschaff-dir-einen-\u00fcberblick",
"type": "learnpath.LearningContentVideo",
"translation_key": "5205f4a1-3786-4f32-9bab-cfdd762d1d6e",
"content_type": "learnpath.LearningContentVideo",
"translation_key": "e666b414-175f-439d-9dfd-e1c434a8cc0e",
"frontend_url": "/course/test-lehrgang/learn/reisen/verschaff-dir-einen-\u00fcberblick",
"minutes": 15,
"description": "Willkommen im Lehrgang Versicherungsvermitler VBV",
"content_url": "https://player.vimeo.com/video/772512710?h=30f912f15a"
},
{
"id": 987,
"id": 37,
"title": "Mediathek Reisen",
"slug": "test-lehrgang-lp-circle-reisen-lc-mediathek-reisen",
"type": "learnpath.LearningContentMediaLibrary",
"translation_key": "37bbd90f-d6d8-4541-86f1-10a8aa20a06d",
"content_type": "learnpath.LearningContentMediaLibrary",
"translation_key": "3b4cae41-185f-40f2-86c0-f96057214ada",
"frontend_url": "/course/test-lehrgang/learn/reisen/mediathek-reisen",
"minutes": 15,
"description": "",
"content_url": "/media/test-lehrgang-media/category/reisen"
},
{
"id": 988,
"id": 38,
"title": "Analyse",
"slug": "test-lehrgang-lp-circle-reisen-ls-analyse",
"type": "learnpath.LearningSequence",
"translation_key": "5b56ece3-ddb5-4853-8816-91e87802c5fd",
"content_type": "learnpath.LearningSequence",
"translation_key": "84be9e5b-6517-4a6d-85a3-1bdf90f78780",
"frontend_url": "/course/test-lehrgang/learn/reisen#ls-analyse",
"icon": "it-icon-ls-apply"
},
{
"id": 989,
"id": 39,
"title": "Bedarfsanalyse, Ist- und Soll-Situation",
"slug": "test-lehrgang-lp-circle-reisen-lu-reisen",
"type": "learnpath.LearningUnit",
"translation_key": "06bd7596-aa6d-45fc-bf02-b0c4d5fd5ef8",
"content_type": "learnpath.LearningUnit",
"translation_key": "7cc1e966-75db-4703-8de4-1a3171372299",
"frontend_url": "/course/test-lehrgang/learn/reisen#lu-reisen",
"evaluate_url": "/course/test-lehrgang/learn/reisen/evaluate/reisen",
"course_category": {
"id": 42,
"id": 3,
"title": "Reisen",
"general": false
},
"children": [
{
"id": 991,
"id": 41,
"title": "Ich bin f\u00e4hig zu Reisen eine Gespr\u00e4chsf\u00fchrung zu machen",
"slug": "test-lehrgang-competence-crit-y11-reisen",
"type": "competence.PerformanceCriteria",
"translation_key": "3eb8ad1c-e556-415c-a329-1dae3e100982",
"content_type": "competence.PerformanceCriteria",
"translation_key": "b82dfd37-649f-488c-a78e-c6a3257c3f43",
"frontend_url": "",
"competence_id": "Y1.1"
},
{
"id": 992,
"id": 42,
"title": "Ich bin f\u00e4hig zu Reisen eine Analyse zu machen",
"slug": "test-lehrgang-competence-crit-y21-reisen",
"type": "competence.PerformanceCriteria",
"translation_key": "37f58796-8586-44be-b702-6f27e2c93b10",
"content_type": "competence.PerformanceCriteria",
"translation_key": "9cf4e552-9dc1-46f8-b3e2-800e7bfd4afe",
"frontend_url": "",
"competence_id": "Y2.1"
}
]
},
{
"id": 990,
"id": 40,
"title": "Emma und Ayla campen durch Amerika - Analyse",
"slug": "test-lehrgang-lp-circle-reisen-lc-emma-und-ayla-campen-durch-amerika-analyse",
"type": "learnpath.LearningContentLearningModule",
"translation_key": "457075a2-4e89-4bd9-8e87-fbd2911355d5",
"content_type": "learnpath.LearningContentLearningModule",
"translation_key": "a2b7889c-1143-4cc1-b4f7-0e611de60ee1",
"frontend_url": "/course/test-lehrgang/learn/reisen/emma-und-ayla-campen-durch-amerika-analyse",
"minutes": 15,
"description": "",
"content_url": "https://s3.eu-central-1.amazonaws.com/myvbv-wbt.iterativ.ch/emma-und-ayla-campen-durch-amerika-analyse-xapi-FZoZOP9y/index.html"
},
{
"id": 993,
"id": 43,
"title": "Transfer",
"slug": "test-lehrgang-lp-circle-reisen-ls-transfer",
"type": "learnpath.LearningSequence",
"translation_key": "aa379cfc-149c-46d0-89ac-bff930432112",
"content_type": "learnpath.LearningSequence",
"translation_key": "655a349d-48e4-4831-b518-872d0714d9e3",
"frontend_url": "/course/test-lehrgang/learn/reisen#ls-transfer",
"icon": "it-icon-ls-end"
},
{
"id": 994,
"id": 44,
"title": "Transfer, Reflexion, Feedback",
"slug": "test-lehrgang-lp-circle-reisen-lu-transfer-reflexion-feedback",
"type": "learnpath.LearningUnit",
"translation_key": "f168b203-79ec-4b5f-81f4-88ac5e270434",
"content_type": "learnpath.LearningUnit",
"translation_key": "8d7cc58a-3a91-49ea-906f-c1de57fec0b2",
"frontend_url": "/course/test-lehrgang/learn/reisen#lu-transfer-reflexion-feedback",
"evaluate_url": "/course/test-lehrgang/learn/reisen/evaluate/transfer-reflexion-feedback",
"course_category": {
"id": 40,
"id": 1,
"title": "Allgemein",
"general": true
},
"children": []
},
{
"id": 995,
"id": 45,
"title": "Auswandern: Woran muss ich denken?",
"slug": "test-lehrgang-lp-circle-reisen-lc-auswandern-woran-muss-ich-denken",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "f68d9bc2-ec0f-4617-9dcc-5235a669e896",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "691d7659-8bd9-4baa-92fd-022e9d418c46",
"frontend_url": "/course/test-lehrgang/learn/reisen/auswandern-woran-muss-ich-denken",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 996,
"id": 46,
"title": "Fachcheck Reisen",
"slug": "test-lehrgang-lp-circle-reisen-lc-fachcheck-reisen",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "e4e2e747-d570-4af3-9846-2d91a9eee3b8",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "26294bc1-9dfe-4c17-a231-02a1387e8dcf",
"frontend_url": "/course/test-lehrgang/learn/reisen/fachcheck-reisen",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 997,
"id": 47,
"title": "Reflexion",
"slug": "test-lehrgang-lp-circle-reisen-lc-reflexion",
"type": "learnpath.LearningContentPlaceholder",
"translation_key": "a1de9b94-38e2-45a5-b913-fbd030fcbdc1",
"content_type": "learnpath.LearningContentPlaceholder",
"translation_key": "cd091a5d-63e8-4a4d-8178-d0224e869146",
"frontend_url": "/course/test-lehrgang/learn/reisen/reflexion",
"minutes": 15,
"description": "Platzhalter",
"content_url": ""
},
{
"id": 998,
"id": 48,
"title": "Feedback",
"slug": "test-lehrgang-lp-circle-reisen-lc-feedback",
"type": "learnpath.LearningContentFeedback",
"translation_key": "a21f740d-4270-42b3-b324-148188025749",
"content_type": "learnpath.LearningContentFeedback",
"translation_key": "ca35688c-f8ee-4aaf-b435-6e84163d9ea6",
"frontend_url": "/course/test-lehrgang/learn/reisen/feedback",
"minutes": 15,
"description": "",

View File

@ -24,7 +24,7 @@ export function calcAssignmentLearningContents(learningPath?: LearningPath) {
return learningPath.circles.flatMap((circle) => {
const learningContents = circle.flatLearningContents.filter(
(lc) => lc.type === "learnpath.LearningContentAssignment"
(lc) => lc.content_type === "learnpath.LearningContentAssignment"
) as LearningContentAssignment[];
return learningContents.map((lc) => {
return {

View File

@ -17,15 +17,15 @@ import values from "lodash/values";
function isLearningContentType(object: any): object is LearningContent {
return (
object?.type === "learnpath.LearningContentAssignment" ||
object?.type === "learnpath.LearningContentAttendanceDay" ||
object?.type === "learnpath.LearningContentFeedback" ||
object?.type === "learnpath.LearningContentLearningModule" ||
object?.type === "learnpath.LearningContentMediaLibrary" ||
object?.type === "learnpath.LearningContentPlaceholder" ||
object?.type === "learnpath.LearningContentRichText" ||
object?.type === "learnpath.LearningContentTest" ||
object?.type === "learnpath.LearningContentVideo"
object?.content_type === "learnpath.LearningContentAssignment" ||
object?.content_type === "learnpath.LearningContentAttendanceDay" ||
object?.content_type === "learnpath.LearningContentFeedback" ||
object?.content_type === "learnpath.LearningContentLearningModule" ||
object?.content_type === "learnpath.LearningContentMediaLibrary" ||
object?.content_type === "learnpath.LearningContentPlaceholder" ||
object?.content_type === "learnpath.LearningContentRichText" ||
object?.content_type === "learnpath.LearningContentTest" ||
object?.content_type === "learnpath.LearningContentVideo"
);
}
@ -40,7 +40,7 @@ export function parseLearningSequences(
const result: LearningSequence[] = [];
children.forEach((child) => {
if (child.type === "learnpath.LearningSequence") {
if (child.content_type === "learnpath.LearningSequence") {
if (learningSequence) {
if (learningUnit) {
learningUnit.last = true;
@ -48,7 +48,7 @@ export function parseLearningSequences(
}
learningSequence = Object.assign(child, { learningUnits: [] });
result.push(learningSequence);
} else if (child.type === "learnpath.LearningUnit") {
} else if (child.content_type === "learnpath.LearningUnit") {
if (!learningSequence) {
throw new Error("LearningUnit found before LearningSequence");
}
@ -111,7 +111,7 @@ export function parseLearningSequences(
}
export class Circle implements WagtailCircle {
readonly type = "learnpath.Circle";
readonly content_type = "learnpath.Circle";
readonly learningSequences: LearningSequence[];
nextCircle?: Circle;
@ -217,7 +217,7 @@ export class Circle implements WagtailCircle {
(lc) => lc.parentLearningSequence?.translation_key === translationKey
),
function (child) {
return child.type === "competence.PerformanceCriteria";
return child.content_type === "competence.PerformanceCriteria";
}
);

View File

@ -33,7 +33,7 @@ function getLastCompleted(courseSlug: string, completionData: CourseCompletion[]
}
export class LearningPath implements WagtailLearningPath {
readonly type = "learnpath.LearningPath";
readonly content_type = "learnpath.LearningPath";
public topics: Topic[];
public circles: Circle[];
public nextLearningContent?: LearningContentInterface;
@ -74,13 +74,13 @@ export class LearningPath implements WagtailLearningPath {
let topic: Topic | undefined;
this.children.forEach((page) => {
if (page.type === "learnpath.Topic") {
if (page.content_type === "learnpath.Topic") {
if (topic) {
this.topics.push(topic);
}
topic = Object.assign(page, { circles: [] });
}
if (page.type === "learnpath.Circle") {
if (page.content_type === "learnpath.Circle") {
const circle = Circle.fromJson(page, this);
if (completionData && completionData.length > 0) {
circle.parseCompletionData(completionData);

View File

@ -7,7 +7,7 @@ export interface BaseCourseWagtailPage {
readonly id: number;
readonly title: string;
readonly slug: string;
readonly type: string;
readonly content_type: string;
readonly translation_key: string;
readonly frontend_url: string;
completion_status?: CourseCompletionStatus;
@ -31,10 +31,10 @@ export type LearningContent =
| LearningContentTest
| LearningContentVideo;
export type LearningContentType = LearningContent["type"];
export type LearningContentType = LearningContent["content_type"];
export interface LearningContentInterface extends BaseCourseWagtailPage {
readonly type: LearningContentType;
readonly content_type: LearningContentType;
readonly minutes: number;
readonly description: string;
readonly content_url: string;
@ -46,51 +46,51 @@ export interface LearningContentInterface extends BaseCourseWagtailPage {
}
export interface LearningContentAssignment extends LearningContentInterface {
readonly type: "learnpath.LearningContentAssignment";
readonly content_type: "learnpath.LearningContentAssignment";
readonly content_assignment_id: number;
}
export interface LearningContentAttendanceDay extends LearningContentInterface {
readonly type: "learnpath.LearningContentAttendanceDay";
readonly content_type: "learnpath.LearningContentAttendanceDay";
}
export interface LearningContentFeedback extends LearningContentInterface {
readonly type: "learnpath.LearningContentFeedback";
readonly content_type: "learnpath.LearningContentFeedback";
}
export interface LearningContentLearningModule extends LearningContentInterface {
readonly type: "learnpath.LearningContentLearningModule";
readonly content_type: "learnpath.LearningContentLearningModule";
}
export interface LearningContentMediaLibrary extends LearningContentInterface {
readonly type: "learnpath.LearningContentMediaLibrary";
readonly content_type: "learnpath.LearningContentMediaLibrary";
}
export interface LearningContentPlaceholder extends LearningContentInterface {
readonly type: "learnpath.LearningContentPlaceholder";
readonly content_type: "learnpath.LearningContentPlaceholder";
}
export interface LearningContentRichText extends LearningContentInterface {
readonly type: "learnpath.LearningContentRichText";
readonly content_type: "learnpath.LearningContentRichText";
}
export interface LearningContentTest extends LearningContentInterface {
readonly type: "learnpath.LearningContentTest";
readonly content_type: "learnpath.LearningContentTest";
}
export interface LearningContentVideo extends LearningContentInterface {
readonly type: "learnpath.LearningContentVideo";
readonly content_type: "learnpath.LearningContentVideo";
}
export interface LearningUnitPerformanceCriteria extends BaseCourseWagtailPage {
readonly type: "competence.PerformanceCriteria";
readonly content_type: "competence.PerformanceCriteria";
readonly competence_id: string;
parentLearningSequence?: LearningSequence;
parentLearningUnit?: LearningUnit;
}
export interface LearningUnit extends BaseCourseWagtailPage {
readonly type: "learnpath.LearningUnit";
readonly content_type: "learnpath.LearningUnit";
readonly evaluate_url: string;
readonly course_category: CourseCategory;
children: LearningUnitPerformanceCriteria[];
@ -104,7 +104,7 @@ export interface LearningUnit extends BaseCourseWagtailPage {
}
export interface LearningSequence extends BaseCourseWagtailPage {
readonly type: "learnpath.LearningSequence";
readonly content_type: "learnpath.LearningSequence";
icon: string;
learningUnits: LearningUnit[];
minutes: number;
@ -113,7 +113,7 @@ export interface LearningSequence extends BaseCourseWagtailPage {
export type CircleChild = LearningContentInterface | LearningUnit | LearningSequence;
export interface WagtailLearningPath extends BaseCourseWagtailPage {
readonly type: "learnpath.LearningPath";
readonly content_type: "learnpath.LearningPath";
course: Course;
children: LearningPathChild[];
}
@ -131,7 +131,7 @@ export interface CircleJobSituation {
}
export interface WagtailCircle extends BaseCourseWagtailPage {
readonly type: "learnpath.Circle";
readonly content_type: "learnpath.Circle";
readonly description: string;
readonly goal_description: string;
readonly goals: CircleGoal[];
@ -141,7 +141,7 @@ export interface WagtailCircle extends BaseCourseWagtailPage {
}
export interface Topic extends BaseCourseWagtailPage {
readonly type: "learnpath.Topic";
readonly content_type: "learnpath.Topic";
readonly is_visible: boolean;
circles: Circle[];
}
@ -236,7 +236,7 @@ export interface MediaContentCollection {
}
export interface MediaCategoryPage extends BaseCourseWagtailPage {
type: "media_library.MediaCategoryPage";
content_type: "media_library.MediaCategoryPage";
overview_icon: string;
detail_image: string;
introduction_text: string;
@ -252,7 +252,7 @@ export interface MediaCategoryPage extends BaseCourseWagtailPage {
}
export interface MediaLibraryPage extends BaseCourseWagtailPage {
readonly type: "media_library.MediaLibraryPage";
readonly content_type: "media_library.MediaLibraryPage";
readonly course: Course;
readonly children: MediaCategoryPage[];
}
@ -322,7 +322,7 @@ export interface AssignmentEvaluationTask {
}
export interface Assignment extends BaseCourseWagtailPage {
readonly type: "assignment.Assignment";
readonly content_type: "assignment.Assignment";
readonly starting_position: string;
readonly effort_required: string;
readonly performance_objectives: AssignmentPerformanceObjective[];
@ -333,7 +333,7 @@ export interface Assignment extends BaseCourseWagtailPage {
}
export interface PerformanceCriteria extends BaseCourseWagtailPage {
readonly type: "competence.PerformanceCriteria";
readonly content_type: "competence.PerformanceCriteria";
readonly competence_id: string;
readonly circle: CircleLight;
readonly course_category: CourseCategory;
@ -341,13 +341,13 @@ export interface PerformanceCriteria extends BaseCourseWagtailPage {
}
export interface CompetencePage extends BaseCourseWagtailPage {
readonly type: "competence.CompetencePage";
readonly content_type: "competence.CompetencePage";
readonly competence_id: string;
readonly children: PerformanceCriteria[];
}
export interface CompetenceProfilePage extends BaseCourseWagtailPage {
readonly type: "competence.CompetenceProfilePage";
readonly content_type: "competence.CompetenceProfilePage";
readonly course: Course;
readonly circles: CircleLight[];
readonly children: CompetencePage[];

View File

@ -15,7 +15,7 @@ def get_it_serializer_class(
"id",
"title",
"slug",
"type",
"content_type",
"translation_key",
"frontend_url",
]
@ -38,7 +38,7 @@ class ItWagtailTypeField(wagtail_serializers.TypeField):
class ItWagtailBaseSerializer(wagtail_serializers.BaseSerializer):
type = ItWagtailTypeField(read_only=True)
content_type = ItWagtailTypeField(read_only=True)
children = SerializerMethodField()
frontend_url = SerializerMethodField()

View File

@ -73,7 +73,7 @@ class CourseBasePage(Page):
"id",
"title",
"slug",
"type",
"content_type",
"translation_key",
"frontend_url",
]

View File

@ -48,7 +48,7 @@ def course_page_api_view(request, slug_or_id):
except PermissionDenied as e:
raise e
except Exception as e:
logger.error(e)
logger.exception(e)
return Response({"error": str(e)}, status=404)