@icvdeveloper/common-module 0.0.109 → 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
CHANGED
|
@@ -24,7 +24,7 @@ export type UseConferenceHelpersMethods = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Get conference display date.
|
|
26
26
|
*/
|
|
27
|
-
getConferenceDisplayDate: (_conference
|
|
27
|
+
getConferenceDisplayDate: (_conference: Conference, showDate: boolean, showTime: boolean, showEndTime: boolean) => string;
|
|
28
28
|
/**
|
|
29
29
|
* Determine if show view archive button should be shown
|
|
30
30
|
*/
|
|
@@ -47,11 +47,12 @@ export const useConferenceHelpers = (conference) => {
|
|
|
47
47
|
return firstDay === lastDay;
|
|
48
48
|
};
|
|
49
49
|
const hasAccessToEvent = (_conference) => {
|
|
50
|
+
const _selectedConference = _getSelectedConference(_conference);
|
|
50
51
|
let hasAccess = find(
|
|
51
52
|
get(user, "value.conferences", []),
|
|
52
|
-
{ id:
|
|
53
|
+
{ id: _selectedConference.id }
|
|
53
54
|
);
|
|
54
|
-
return isLoggedIn && (
|
|
55
|
+
return isLoggedIn && (_selectedConference.access || hasAccess);
|
|
55
56
|
};
|
|
56
57
|
const showConferenceWebcastButton = (_conference) => {
|
|
57
58
|
const _selectedConference = _getSelectedConference(_conference);
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
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";
|
|
12
|
+
import { usePresentationsStore } from "./store/presentations.mjs";
|
|
10
13
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
11
14
|
const { version, portalHash, apiUrl } = nuxtApp.payload.config.public.v3plusCommonModule;
|
|
12
15
|
const v3plusCommonModule = createV3plusCommonPlugin({
|
|
@@ -19,43 +22,93 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
19
22
|
NProgress.start();
|
|
20
23
|
const portalStore = usePortalStore();
|
|
21
24
|
const conferencesStore = useConferencesStore();
|
|
25
|
+
const presentationsStore = usePresentationsStore();
|
|
22
26
|
const { data: portal, errors: portalErrors } = storeToRefs(
|
|
23
27
|
usePortalStore()
|
|
24
28
|
);
|
|
29
|
+
const { selectedConference } = storeToRefs(
|
|
30
|
+
useConferencesStore()
|
|
31
|
+
);
|
|
32
|
+
const { data: navigation } = storeToRefs(
|
|
33
|
+
useNavigationConfigStore()
|
|
34
|
+
);
|
|
35
|
+
let docTitle = "Rubicon";
|
|
36
|
+
let docSubtitle = "";
|
|
37
|
+
let routeArray = to.name.toLowerCase().split("-");
|
|
25
38
|
if (portal.value === null) {
|
|
26
39
|
Promise.all([
|
|
27
40
|
// fetch portal config then increment loading indicator
|
|
28
|
-
await portalStore.getPortal().then(() =>
|
|
41
|
+
await portalStore.getPortal().then(() => {
|
|
42
|
+
docTitle = portal.value.name;
|
|
43
|
+
NProgress.inc();
|
|
44
|
+
}),
|
|
29
45
|
// wait for portal config request to complete, then fetch conferences
|
|
30
46
|
await conferencesStore.getConferences().then(() => NProgress.inc()),
|
|
31
47
|
// wait for get conferences to complete, then get current conference data.
|
|
32
48
|
await conferencesStore.getCurrentConference().then(() => NProgress.inc())
|
|
33
49
|
]);
|
|
50
|
+
} else {
|
|
51
|
+
docTitle = portal.value.name;
|
|
34
52
|
}
|
|
35
|
-
if (to.name
|
|
36
|
-
await conferencesStore.getSelectedConference(to.params.id).then(() =>
|
|
53
|
+
if (to.name.includes("events-id") && to.params.id) {
|
|
54
|
+
await conferencesStore.getSelectedConference(to.params.id).then(() => {
|
|
55
|
+
if (conferencesStore.selectedConference) {
|
|
56
|
+
docSubtitle = `${conferencesStore.selectedConference.name}`;
|
|
57
|
+
if (to.name.includes("webcast-channelid")) {
|
|
58
|
+
docSubtitle += ` - Live Webcast`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
NProgress.inc();
|
|
62
|
+
});
|
|
37
63
|
} else {
|
|
38
64
|
conferencesStore.selectedConference = null;
|
|
39
65
|
}
|
|
66
|
+
if (to.params.presid) {
|
|
67
|
+
await presentationsStore.getSelectedPresentation(to.params.presid).then(() => {
|
|
68
|
+
if (conferencesStore.selectedConference) {
|
|
69
|
+
docSubtitle = `${presentationsStore.selectedPresentation.name}`;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
} else {
|
|
73
|
+
presentationsStore.selectedPresentation = null;
|
|
74
|
+
}
|
|
75
|
+
if (!docSubtitle && to.name != "index") {
|
|
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
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (docSubtitle)
|
|
89
|
+
docTitle += ` | ${docSubtitle}`;
|
|
90
|
+
document.title = docTitle;
|
|
40
91
|
});
|
|
41
92
|
nuxtApp.$router.afterEach(() => {
|
|
42
93
|
NProgress.done();
|
|
43
94
|
});
|
|
44
95
|
nuxtApp.hook("app:created", (app) => {
|
|
45
|
-
const { data } = storeToRefs(usePortalStore());
|
|
96
|
+
const { data: portal } = storeToRefs(usePortalStore());
|
|
46
97
|
const { globalConfigValue } = useTemplateConfigsStore();
|
|
47
98
|
let customCss = globalConfigValue("custom_css");
|
|
48
99
|
customCss = customCss.length > 0 ? customCss.replace(/\n/g, "") : "";
|
|
49
|
-
if (
|
|
100
|
+
if (portal.value) {
|
|
50
101
|
app.config.globalProperties.$head.addHeadObjs(
|
|
51
102
|
computed(() => {
|
|
52
103
|
return {
|
|
53
|
-
|
|
104
|
+
meta: [
|
|
105
|
+
{ name: "description", content: portal.value.description }
|
|
106
|
+
],
|
|
54
107
|
link: [
|
|
55
108
|
{
|
|
56
109
|
rel: "icon",
|
|
57
110
|
type: "image/x-icon",
|
|
58
|
-
href:
|
|
111
|
+
href: portal.value.favicon
|
|
59
112
|
}
|
|
60
113
|
],
|
|
61
114
|
style: [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Presentation } from "../models/conference";
|
|
2
2
|
import { SelectedContent } from "../enums/general";
|
|
3
3
|
export interface PresentationsState {
|
|
4
|
-
currentPresentation: Presentation;
|
|
5
|
-
selectedPresentation: Presentation;
|
|
4
|
+
currentPresentation: null | Presentation;
|
|
5
|
+
selectedPresentation: null | Presentation;
|
|
6
6
|
selectedContent: {
|
|
7
7
|
label: string;
|
|
8
8
|
type: SelectedContent;
|