From bb454a296ff980332832ac71a0bda312b1611e67 Mon Sep 17 00:00:00 2001 From: Samson Akol Date: Tue, 3 Dec 2024 15:40:34 +0300 Subject: [PATCH 1/2] Adds check to the 'Imported from' link to verify source nodes exist before attempting a navigation --- .../channelEdit/components/ResourcePanel.vue | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue b/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue index 3e4a6caecc..88259df73e 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue @@ -354,7 +354,7 @@ {{ $tr('resources') }} @@ -395,7 +395,7 @@ {{ $tr('source') }} { + if (nodes.length > 0) { + window.open(this.importedChannelLink, '_blank'); + } else { + this.$store.dispatch('showSnackbar', { + text: this.$tr('sourceContentDoesntExist'), + }); + } + }); + } + }, }, $trs: { questions: 'Questions', @@ -892,6 +912,8 @@ noQuestionsError: 'Exercise is empty', incompleteQuestionError: '{count, plural, one {# incomplete question} other {# incomplete questions}}', + sourceContentDoesntExist: + 'Source content no longer exists. Please contact your administrator.', }, }; From f210078bc50d1bb3ad7dc4281dc8e19d8a03fb27 Mon Sep 17 00:00:00 2001 From: Samson Akol Date: Thu, 12 Dec 2024 12:05:27 +0300 Subject: [PATCH 2/2] Removes href links --- .../frontend/channelEdit/components/ResourcePanel.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue b/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue index 88259df73e..333faab32c 100644 --- a/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue +++ b/contentcuration/contentcuration/frontend/channelEdit/components/ResourcePanel.vue @@ -359,7 +359,6 @@ >