From 64e35ff574d272d9bf22e2dcd45d37498159db4a Mon Sep 17 00:00:00 2001 From: Thomas Hackl <hackl@data-quest.de> Date: Mon, 24 Jun 2024 07:52:27 +0000 Subject: [PATCH] Resolve "Courseware: Intergration des Companions in das neue Benachrichtigungssystem ist noch unausgegoren" Closes #4338 Merge request studip/studip!3141 --- .../layouts/CoursewareCompanionBox.vue | 47 ++++--------------- 1 file changed, 9 insertions(+), 38 deletions(-) diff --git a/resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue b/resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue index f26c8d7c30f..c4a31e22d55 100644 --- a/resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue +++ b/resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue @@ -1,9 +1,15 @@ +<template> + <div class="cw-companion-box" :class="[mood]"> + <div> + <p v-html="msgCompanion"></p> + <slot name="companionActions"></slot> + </div> + </div> +</template> + <script> export default { name: 'courseware-companion-box', - render(createElement) { - return null; - }, props: { msgCompanion: String, mood: { @@ -13,41 +19,6 @@ export default { return ['default','unsure', 'special', 'sad', 'pointing', 'curious'].includes(value); } } - }, - computed: { - msgType() { - let type = 'info'; - switch (this.mood) { - case 'special': - case 'unsure': - type = 'warning'; - break; - case 'sad': - type = 'error'; - break; - case 'happy': - type = 'success'; - break - case 'pointing': - case 'curious': - } - return type; - } - }, - watch: { - msgCompanion: { - handler(current) { - if (current.trim().length === 0) { - return; - } - const notification = { - type: this.msgType, - message: current - }; - this.globalEmit('push-system-notification', notification); - }, - immediate: true - } } }; </script> -- GitLab