From c5c2ae99f6e9b91526ea5896b3029ab8a7480c6f Mon Sep 17 00:00:00 2001
From: Sukanya Pandey <sukapan1@in.ibm.com>
Date: Wed, 9 Dec 2020 16:14:19 +0530
Subject: Show asset name in the app header

Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: If5394604d6c91b3604eaadb33178376fe6da672c
---
 src/App.vue | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'src/App.vue')

diff --git a/src/App.vue b/src/App.vue
index f6991c46..fc04b70b 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -7,9 +7,22 @@
 <script>
 export default {
   name: 'App',
+  computed: {
+    assetTag() {
+      return this.$store.getters['global/assetTag'];
+    },
+  },
   watch: {
+    assetTag: function (tag) {
+      if (tag) {
+        document.title = `${tag} - ${this.$route.meta.title}`;
+      }
+    },
     $route: function (to) {
       document.title = to.meta.title || 'Page is missing title';
+      if (this.assetTag) {
+        document.title = `${this.assetTag} - ${to.meta.title}`;
+      }
     },
   },
   created() {
-- 
cgit v1.2.3

