From c3f4cc4a638f369f472f780010c48c2c08f217d5 Mon Sep 17 00:00:00 2001
From: Jan-Hendrik Willms <tleilax+github@gmail.com>
Date: Mon, 8 Jul 2024 08:45:39 +0200
Subject: [PATCH] resurrect system notifications (got lost in a6c10e36), re
 #4294, re #660

---
 .../javascripts/bootstrap/system-notifications.js     | 11 -----------
 templates/layouts/base.php                            | 10 ++++++----
 2 files changed, 6 insertions(+), 15 deletions(-)
 delete mode 100644 resources/assets/javascripts/bootstrap/system-notifications.js

diff --git a/resources/assets/javascripts/bootstrap/system-notifications.js b/resources/assets/javascripts/bootstrap/system-notifications.js
deleted file mode 100644
index 7a85fcdbfbc..00000000000
--- a/resources/assets/javascripts/bootstrap/system-notifications.js
+++ /dev/null
@@ -1,11 +0,0 @@
-import SystemNotificationManager from '../../../vue/components/SystemNotificationManager.vue';
-
-STUDIP.domReady(() => {
-    document.getElementById('system-notifications')?.classList.add('vueified');
-    STUDIP.Vue.load().then(({ createApp }) => {
-        createApp({
-            el: '#system-notifications',
-            components: { SystemNotificationManager }
-        });
-    });
-});
diff --git a/templates/layouts/base.php b/templates/layouts/base.php
index 077cdf4a2e2..b2b665094cc 100644
--- a/templates/layouts/base.php
+++ b/templates/layouts/base.php
@@ -95,10 +95,12 @@ $lang_attr = str_replace('_', '-', $_SESSION['_language']);
             <?= implode(PageLayout::getMessages(QuestionBox::class)) ?>
             <?= $content_for_layout ?>
         </div>
-        <system-notification-manager
-            id="system-notifications"
-            :notifications='<?= htmlReady(json_encode(PageLayout::getMessages(MessageBox::class))) ?>'
-            placement="<?= User::findCurrent()?->getConfiguration()->SYSTEM_NOTIFICATIONS_PLACEMENT ?? 'topcenter' ?>"></system-notification-manager>
+        <?= Studip\VueApp::create('SystemNotificationManager')
+            ->withProps([
+                'id'            => 'system-notifications',
+                'notifications' => PageLayout::getMessages(MessageBox::class),
+                'placement'     => User::findCurrent()?->getConfiguration()->SYSTEM_NOTIFICATIONS_PLACEMENT ?? 'topcenter',
+            ]) ?>
     </main>
     <!-- End main content -->
 
-- 
GitLab