Skip to content

Commit f4a95cd

Browse files
authored
Merge pull request #5858 from AlexVelezLl/add-guards-for-channel-version
Add guards for channel version computed values
2 parents 353d1bd + f42b0be commit f4a95cd

12 files changed

Lines changed: 9 additions & 14 deletions

File tree

contentcuration/contentcuration/frontend/administration/components/sidePanels/ReviewSubmissionSidePanel.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
// state more accurately to the developer in case of debugging.
352352
// UI code should rely on XXXIsLoading and XXXIsFinished instead.
353353
if (!languageCodes) return undefined;
354-
if (languageCodes.length === 0) return null;
354+
if (!languageCodes?.length) return null;
355355
356356
return languageCodes.map(code => LanguagesMap.get(code).readable_name).join(', ');
357357
});
@@ -362,7 +362,7 @@
362362
363363
const categoriesString = computed(() => {
364364
if (!channelVersionIsFinished.value) return undefined;
365-
if (channelVersionData.value.included_categories.length === 0) return null;
365+
if (!channelVersionData.value.included_categories?.length) return null;
366366
367367
return channelVersionData.value.included_categories
368368
.map(categoryId => categoryIdToName(categoryId))
@@ -371,7 +371,7 @@
371371
372372
const licensesString = computed(() => {
373373
if (!channelVersionIsFinished.value) return undefined;
374-
if (channelVersionData.value.included_licenses.length === 0) return null;
374+
if (!channelVersionData.value.included_licenses?.length) return null;
375375
376376
return channelVersionData.value.included_licenses
377377
.map(licenseId => LicensesMap.get(licenseId).license_name)

contentcuration/locale/ar/LC_MESSAGES/contentcuration-messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,4 +2176,4 @@
21762176
"sharedVue.masteryModelRequired": "الإتقان مطلوب",
21772177
"sharedVue.shortActivityLteThirty": "يجب أن تكون القيمة مساوية أو أقل من 30",
21782178
"sharedVue.titleRequired": "العنوان إلزامي"
2179-
}
2179+
}

contentcuration/locale/ar/LC_MESSAGES/django.po

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,4 +739,3 @@ msgstr "إصدار الـ API غير متوفر"
739739
#: kolibri_public/views_v1.py:170
740740
msgid "No channel matching {} found"
741741
msgstr "لم يتم العثور على قناة مطابقة {}"
742-

contentcuration/locale/en/LC_MESSAGES/contentcuration-messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,4 +2176,4 @@
21762176
"sharedVue.masteryModelRequired": "Mastery is required",
21772177
"sharedVue.shortActivityLteThirty": "Value must be equal or less than 30",
21782178
"sharedVue.titleRequired": "Title is required"
2179-
}
2179+
}

contentcuration/locale/es_ES/LC_MESSAGES/contentcuration-messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,4 +2176,4 @@
21762176
"sharedVue.masteryModelRequired": "Tiene que seleccionar el criterio de dominio",
21772177
"sharedVue.shortActivityLteThirty": "El valor debe ser igual o menor que 30",
21782178
"sharedVue.titleRequired": "Este campo es obligatorio"
2179-
}
2179+
}

contentcuration/locale/es_ES/LC_MESSAGES/django.po

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,4 +742,3 @@ msgstr "La versión API no está disponible"
742742
#: kolibri_public/views_v1.py:170
743743
msgid "No channel matching {} found"
744744
msgstr "Ningún canal con {} encontrado"
745-

contentcuration/locale/fr_FR/LC_MESSAGES/contentcuration-messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,4 +2176,4 @@
21762176
"sharedVue.masteryModelRequired": "Le critère de maîtrise est obligatoire",
21772177
"sharedVue.shortActivityLteThirty": "La valeur doit être égale ou inférieure à 30",
21782178
"sharedVue.titleRequired": "Le titre est obligatoire"
2179-
}
2179+
}

contentcuration/locale/fr_FR/LC_MESSAGES/django.po

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,4 +740,3 @@ msgstr "La version de l’API est indisponible"
740740
#: kolibri_public/views_v1.py:170
741741
msgid "No channel matching {} found"
742742
msgstr "Aucune chaîne correspondant à {} trouvée"
743-

contentcuration/locale/hi_IN/LC_MESSAGES/contentcuration-messages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,4 +2176,4 @@
21762176
"sharedVue.masteryModelRequired": "Mastery is required",
21772177
"sharedVue.shortActivityLteThirty": "Value must be equal or less than 30",
21782178
"sharedVue.titleRequired": "Title is required"
2179-
}
2179+
}

contentcuration/locale/hi_IN/LC_MESSAGES/django.po

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -723,4 +723,3 @@ msgstr ""
723723
#: kolibri_public/views_v1.py:170
724724
msgid "No channel matching {} found"
725725
msgstr ""
726-

0 commit comments

Comments
 (0)