@icvdeveloper/common-module 0.0.109 → 0.0.110

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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "0.0.109"
4
+ "version": "0.0.110"
5
5
  }
@@ -24,7 +24,7 @@ export type UseConferenceHelpersMethods = {
24
24
  /**
25
25
  * Get conference display date.
26
26
  */
27
- getConferenceDisplayDate: (_conference?: Conference, showDate: boolean, showTime: boolean, showEndTime: boolean) => string;
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: _conference.id }
53
+ { id: _selectedConference.id }
53
54
  );
54
- return isLoggedIn && (_conference.access || hasAccess);
55
+ return isLoggedIn && (_selectedConference.access || hasAccess);
55
56
  };
56
57
  const showConferenceWebcastButton = (_conference) => {
57
58
  const _selectedConference = _getSelectedConference(_conference);
@@ -7,6 +7,7 @@ import { createV3plusCommonPlugin } from "./v3plusCommonPlugin.mjs";
7
7
  import { usePortalStore } from "./store/portal.mjs";
8
8
  import { useTemplateConfigsStore } from "./store/templateConfigs.mjs";
9
9
  import { useConferencesStore } from "./store/conferences.mjs";
10
+ import { usePresentationsStore } from "./store/presentations.mjs";
10
11
  export default defineNuxtPlugin((nuxtApp) => {
11
12
  const { version, portalHash, apiUrl } = nuxtApp.payload.config.public.v3plusCommonModule;
12
13
  const v3plusCommonModule = createV3plusCommonPlugin({
@@ -19,24 +20,64 @@ export default defineNuxtPlugin((nuxtApp) => {
19
20
  NProgress.start();
20
21
  const portalStore = usePortalStore();
21
22
  const conferencesStore = useConferencesStore();
23
+ const presentationsStore = usePresentationsStore();
22
24
  const { data: portal, errors: portalErrors } = storeToRefs(
23
25
  usePortalStore()
24
26
  );
27
+ const { selectedConference } = storeToRefs(
28
+ useConferencesStore()
29
+ );
30
+ let docTitle = "Rubicon";
31
+ let docSubtitle = "";
32
+ let routeArray = to.name.toLowerCase().split("-");
25
33
  if (portal.value === null) {
26
34
  Promise.all([
27
35
  // fetch portal config then increment loading indicator
28
- await portalStore.getPortal().then(() => NProgress.inc()),
36
+ await portalStore.getPortal().then(() => {
37
+ docTitle = portal.value.name;
38
+ NProgress.inc();
39
+ }),
29
40
  // wait for portal config request to complete, then fetch conferences
30
41
  await conferencesStore.getConferences().then(() => NProgress.inc()),
31
42
  // wait for get conferences to complete, then get current conference data.
32
43
  await conferencesStore.getCurrentConference().then(() => NProgress.inc())
33
44
  ]);
45
+ } else {
46
+ docTitle = portal.value.name;
34
47
  }
35
- if (to.name == "events-id") {
36
- await conferencesStore.getSelectedConference(to.params.id).then(() => NProgress.inc());
48
+ if (to.name.includes("events-id") && to.params.id) {
49
+ await conferencesStore.getSelectedConference(to.params.id).then(() => {
50
+ if (conferencesStore.selectedConference) {
51
+ docSubtitle = `${conferencesStore.selectedConference.name}`;
52
+ if (to.name.includes("webcast-channelid")) {
53
+ docSubtitle += ` - Live Webcast`;
54
+ }
55
+ }
56
+ NProgress.inc();
57
+ });
37
58
  } else {
38
59
  conferencesStore.selectedConference = null;
39
60
  }
61
+ if (to.params.presid) {
62
+ await presentationsStore.getSelectedPresentation(to.params.presid).then(() => {
63
+ if (conferencesStore.selectedConference) {
64
+ docSubtitle = `${presentationsStore.selectedPresentation.name}`;
65
+ }
66
+ });
67
+ } else {
68
+ presentationsStore.selectedPresentation = null;
69
+ }
70
+ if (!docSubtitle && to.name != "index") {
71
+ let routeName = routeArray.map(
72
+ function(word) {
73
+ return word.charAt(0).toUpperCase() + word.slice(1);
74
+ }
75
+ ).join(" ");
76
+ docSubtitle += `${routeName}`;
77
+ }
78
+ if (docSubtitle)
79
+ docTitle += ` - ${docSubtitle}`;
80
+ document.title = docTitle;
40
81
  });
41
82
  nuxtApp.$router.afterEach(() => {
42
83
  NProgress.done();
@@ -50,7 +91,6 @@ export default defineNuxtPlugin((nuxtApp) => {
50
91
  app.config.globalProperties.$head.addHeadObjs(
51
92
  computed(() => {
52
93
  return {
53
- title: data.value.name,
54
94
  link: [
55
95
  {
56
96
  rel: "icon",
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.109",
3
+ "version": "0.0.110",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {