@icvdeveloper/common-module 0.0.110 → 0.0.111
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/runtime/plugin.mjs +23 -10
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from "#app";
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { storeToRefs } from "pinia";
|
|
4
|
+
import { find } from "lodash-es";
|
|
4
5
|
import NProgress from "nprogress";
|
|
5
6
|
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
|
6
7
|
import { createV3plusCommonPlugin } from "./v3plusCommonPlugin.mjs";
|
|
7
8
|
import { usePortalStore } from "./store/portal.mjs";
|
|
8
9
|
import { useTemplateConfigsStore } from "./store/templateConfigs.mjs";
|
|
10
|
+
import { useNavigationConfigStore } from "./store/navigationConfig.mjs";
|
|
9
11
|
import { useConferencesStore } from "./store/conferences.mjs";
|
|
10
12
|
import { usePresentationsStore } from "./store/presentations.mjs";
|
|
11
13
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
@@ -27,6 +29,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
27
29
|
const { selectedConference } = storeToRefs(
|
|
28
30
|
useConferencesStore()
|
|
29
31
|
);
|
|
32
|
+
const { data: navigation } = storeToRefs(
|
|
33
|
+
useNavigationConfigStore()
|
|
34
|
+
);
|
|
30
35
|
let docTitle = "Rubicon";
|
|
31
36
|
let docSubtitle = "";
|
|
32
37
|
let routeArray = to.name.toLowerCase().split("-");
|
|
@@ -68,34 +73,42 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
68
73
|
presentationsStore.selectedPresentation = null;
|
|
69
74
|
}
|
|
70
75
|
if (!docSubtitle && to.name != "index") {
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
let navObj = find(navigation.value, { "url": to.path });
|
|
77
|
+
if (navObj) {
|
|
78
|
+
docSubtitle += `${navObj.label}`;
|
|
79
|
+
} else {
|
|
80
|
+
let routeName = routeArray.map(
|
|
81
|
+
function(word) {
|
|
82
|
+
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
83
|
+
}
|
|
84
|
+
).join(" ");
|
|
85
|
+
docSubtitle += `${routeName}`;
|
|
86
|
+
}
|
|
77
87
|
}
|
|
78
88
|
if (docSubtitle)
|
|
79
|
-
docTitle += `
|
|
89
|
+
docTitle += ` | ${docSubtitle}`;
|
|
80
90
|
document.title = docTitle;
|
|
81
91
|
});
|
|
82
92
|
nuxtApp.$router.afterEach(() => {
|
|
83
93
|
NProgress.done();
|
|
84
94
|
});
|
|
85
95
|
nuxtApp.hook("app:created", (app) => {
|
|
86
|
-
const { data } = storeToRefs(usePortalStore());
|
|
96
|
+
const { data: portal } = storeToRefs(usePortalStore());
|
|
87
97
|
const { globalConfigValue } = useTemplateConfigsStore();
|
|
88
98
|
let customCss = globalConfigValue("custom_css");
|
|
89
99
|
customCss = customCss.length > 0 ? customCss.replace(/\n/g, "") : "";
|
|
90
|
-
if (
|
|
100
|
+
if (portal.value) {
|
|
91
101
|
app.config.globalProperties.$head.addHeadObjs(
|
|
92
102
|
computed(() => {
|
|
93
103
|
return {
|
|
104
|
+
meta: [
|
|
105
|
+
{ name: "description", content: portal.value.description }
|
|
106
|
+
],
|
|
94
107
|
link: [
|
|
95
108
|
{
|
|
96
109
|
rel: "icon",
|
|
97
110
|
type: "image/x-icon",
|
|
98
|
-
href:
|
|
111
|
+
href: portal.value.favicon
|
|
99
112
|
}
|
|
100
113
|
],
|
|
101
114
|
style: [
|