Skip to content

Commit 7b277f4

Browse files
committed
Refactor: Fix logic to display app layout - refs BT#22639
1 parent 3c20c73 commit 7b277f4

File tree

2 files changed

+3
-16
lines changed

2 files changed

+3
-16
lines changed

assets/vue/App.vue

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import { useI18n } from "vue-i18n"
5555
import { customVueTemplateEnabled } from "./config/env"
5656
import CustomDashboardLayout from "../../var/vue_templates/components/layout/DashboardLayout.vue"
5757
import EmptyLayout from "./components/layout/EmptyLayout.vue"
58+
import DashboardLayout from "./components/layout/DashboardLayout.vue"
5859
import { useMediaElementLoader } from "./composables/mediaElementLoader"
5960
6061
import apolloClient from "./config/apolloClient"
@@ -79,14 +80,14 @@ const layout = computed(() => {
7980
(queryParams.has("lp_id") && "view" === queryParams.get("action")) ||
8081
(queryParams.has("origin") && "learnpath" === queryParams.get("origin"))
8182
) {
82-
return "EmptyLayout"
83+
return EmptyLayout
8384
}
8485
8586
if (customVueTemplateEnabled) {
8687
return CustomDashboardLayout
8788
}
8889
89-
return `${router.currentRoute.value.meta.layout ?? "Dashboard"}Layout`
90+
return router.currentRoute.value.meta.layout ? `${router.currentRoute.value.meta.layout}Layout` : DashboardLayout
9091
})
9192
9293
const legacyContainer = ref(null)
@@ -117,15 +118,6 @@ watchEffect(() => {
117118
}
118119
})
119120
120-
watchEffect(async () => {
121-
try {
122-
const component = `${route.meta.layout}.vue`
123-
layout.value = component?.default || "Dashboard"
124-
} catch (e) {
125-
layout.value = "Dashboard"
126-
}
127-
})
128-
129121
const securityStore = useSecurityStore()
130122
const notification = useNotification()
131123

assets/vue/main.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ import VueFlatPickr from "vue-flatpickr-component"
3131
import "flatpickr/dist/flatpickr.css"
3232
import "@mdi/font/css/materialdesignicons.css"
3333

34-
import DashboardLayout from "./components/layout/DashboardLayout.vue"
35-
import EmptyLayout from "./components/layout/EmptyLayout.vue"
36-
3734
// Prime
3835
import PrimeVue from "primevue/config"
3936
import DataView from "primevue/dataview"
@@ -188,8 +185,6 @@ app.component("Button", Button)
188185
app.component("Column", Column)
189186
app.component("ColumnGroup", ColumnGroup)
190187
app.component("Toolbar", Toolbar)
191-
app.component("DashboardLayout", DashboardLayout)
192-
app.component("EmptyLayout", EmptyLayout)
193188
app.component("BaseAppLink", BaseAppLink)
194189

195190
app.config.globalProperties.axios = axios

0 commit comments

Comments
 (0)