Skip to content
Snippets Groups Projects
Commit 64e35ff5 authored by Thomas Hackl's avatar Thomas Hackl
Browse files

Resolve "Courseware: Intergration des Companions in das neue...

Resolve "Courseware: Intergration des Companions in das neue Benachrichtigungssystem ist noch unausgegoren"

Closes #4338

Merge request studip/studip!3141
parent 414bf61a
No related branches found
No related tags found
No related merge requests found
<template>
<div class="cw-companion-box" :class="[mood]">
<div>
<p v-html="msgCompanion"></p>
<slot name="companionActions"></slot>
</div>
</div>
</template>
<script> <script>
export default { export default {
name: 'courseware-companion-box', name: 'courseware-companion-box',
render(createElement) {
return null;
},
props: { props: {
msgCompanion: String, msgCompanion: String,
mood: { mood: {
...@@ -13,41 +19,6 @@ export default { ...@@ -13,41 +19,6 @@ export default {
return ['default','unsure', 'special', 'sad', 'pointing', 'curious'].includes(value); 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> </script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment