diff options
| author | Thomas Hackl <hackl@data-quest.de> | 2024-06-24 07:52:27 +0000 |
|---|---|---|
| committer | Thomas Hackl <hackl@data-quest.de> | 2024-06-24 07:52:27 +0000 |
| commit | 64e35ff574d272d9bf22e2dcd45d37498159db4a (patch) | |
| tree | fdd2164859f8b069aa9285e491abec96a96f3a14 | |
| parent | 414bf61ac4688870e9f9df5c98662c3185900cd9 (diff) | |
Resolve "Courseware: Intergration des Companions in das neue Benachrichtigungssystem ist noch unausgegoren"
Closes #4338
Merge request studip/studip!3141
| -rw-r--r-- | resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue b/resources/vue/components/courseware/layouts/CoursewareCompanionBox.vue index f26c8d7..c4a31e2 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> |
