@icvdeveloper/common-module 0.0.119 → 0.0.120

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.119"
4
+ "version": "0.0.120"
5
5
  }
@@ -10,12 +10,10 @@ const { loadUccScript, loginV3 } = useUcc();
10
10
 
11
11
  interface Props {
12
12
  conference: Conference;
13
- eventPathPrefix?: string;
14
13
  classObject?: uccClassObj;
15
14
  }
16
15
 
17
16
  const props = withDefaults(defineProps<Props>(), {
18
- eventPathPrefix: "",
19
17
  classObject: () => {
20
18
  return {
21
19
  container: ""
@@ -24,7 +22,6 @@ const props = withDefaults(defineProps<Props>(), {
24
22
  });
25
23
 
26
24
  const {
27
- eventPathPrefix,
28
25
  classObject,
29
26
  } = toRefs(props);
30
27
 
@@ -71,7 +68,7 @@ const buttonColorClass = computed(() => {
71
68
 
72
69
  // on mount
73
70
  onMounted(() => {
74
- loadUccScript(props.conference, props.eventPathPrefix);
71
+ loadUccScript(props.conference);
75
72
  });
76
73
 
77
74
  </script>
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { ref, toRefs, computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
+ import { get } from "lodash-es";
4
5
  import { useConferencesStore } from "../../store/conferences";
5
6
  import { useTemplateConfigsStore } from "../../store/templateConfigs";
6
7
  import { useDateFormat } from "../../composables/useDateFormat";
@@ -27,7 +28,6 @@ interface Props {
27
28
  loginButton?: boolean;
28
29
  viewInfoButton?: boolean;
29
30
  registerPathPrefix?: string;
30
- eventPathPrefix?: string;
31
31
  liveButtonOpensStream?: boolean;
32
32
  isUpcoming?: boolean;
33
33
  showEventImage?: boolean;
@@ -47,7 +47,6 @@ const props = withDefaults(defineProps<Props>(), {
47
47
  loginButton: true,
48
48
  viewInfoButton: true,
49
49
  registerPathPrefix: "",
50
- eventPathPrefix: "",
51
50
  liveButtonOpensStream: true,
52
51
  isUpcoming: true,
53
52
  showEventImage: true,
@@ -83,6 +82,7 @@ const {
83
82
  } = toRefs(props);
84
83
 
85
84
  // data
85
+ const config = useRuntimeConfig();
86
86
  const { pastEvents, upcomingEvents } = storeToRefs(useConferencesStore());
87
87
 
88
88
  // methods
@@ -136,6 +136,10 @@ const getVideoButtonText = (_conference: Conference): string => {
136
136
  };
137
137
 
138
138
  // computed
139
+ const eventPathPrefix = computed(() => {
140
+ return (get(config.public, "eventPathPrefix.length", 0) > 0) ? config.public.eventPathPrefix : null;
141
+ });
142
+
139
143
  const eventType = computed((): Conference[] => {
140
144
  return isUpcoming.value ? upcomingEvents.value : pastEvents.value;
141
145
  });
@@ -363,7 +367,7 @@ const showLoginButton = computed((): boolean => {
363
367
  :class="
364
368
  classBinding(classObject, 'liveButtonItem', buttonClass)
365
369
  "
366
- @click="goEventPage(conference, eventPathPrefix)"
370
+ @click="goEventPage(conference)"
367
371
  >
368
372
  {{ getVideoButtonText(conference) }}
369
373
  </button>
@@ -376,7 +380,7 @@ const showLoginButton = computed((): boolean => {
376
380
  :class="
377
381
  classBinding(classObject, 'buttonItem', buttonClass)
378
382
  "
379
- @click="goEventPage(conference, eventPathPrefix)"
383
+ @click="goEventPage(conference)"
380
384
  >
381
385
  More Info
382
386
  </button>
@@ -20,7 +20,7 @@ export type UseConferenceHelpersMethods = {
20
20
  /**
21
21
  * Get conference webcast url
22
22
  */
23
- getConferenceWebcastUrl: (_conference?: Conference, _eventPath?: string) => string;
23
+ getConferenceWebcastUrl: (_conference?: Conference) => string;
24
24
  /**
25
25
  * Get timezone display
26
26
  */
@@ -10,6 +10,7 @@ import {
10
10
  useAuthStore
11
11
  } from "../store";
12
12
  import { useDateFormat } from "./useDateFormat.mjs";
13
+ const config = useRuntimeConfig();
13
14
  const getConferenceConfigMainValue = (_conference, _name) => {
14
15
  const configPages = get(_conference, "template_config.config.pages", []);
15
16
  const mainPageContent = get(
@@ -58,12 +59,13 @@ export const useConferenceHelpers = (conference) => {
58
59
  const _selectedConference = _getSelectedConference(_conference);
59
60
  return _selectedConference.access && _selectedConference.state !== "archive" && _selectedConference.state !== "hidden";
60
61
  };
61
- const getConferenceWebcastUrl = (_conference, eventPathPrefix) => {
62
+ const getConferenceWebcastUrl = (_conference) => {
62
63
  const _selectedConference = _getSelectedConference(_conference);
63
64
  if (_selectedConference.state === "upcoming") {
64
65
  return "/stream-test";
65
66
  }
66
67
  const channel = get(_selectedConference, "days[0].tracks[0].channel", 1);
68
+ const eventPathPrefix = config.public.eventPathPrefix;
67
69
  return _selectedConference.agenda_enabled ? `/agenda/${_selectedConference.id}` : eventPathPrefix ? `${eventPathPrefix}${_selectedConference.id}/webcast/${channel}` : `/upcoming-events/${_selectedConference.id}/webcast/${channel}`;
68
70
  };
69
71
  const getConferenceWebcastButtonText = (_conference) => {
@@ -13,10 +13,18 @@ export type UseEventsMethods = {
13
13
  * the conference passed the login modal
14
14
  */
15
15
  conferenceToLoginTo: Ref<Conference | null>;
16
+ /**
17
+ * return different classes if countdown timer is/is not active
18
+ */
19
+ buttonClass: ComputedRef<string>;
20
+ /**
21
+ * checks if component is on the homepage
22
+ */
23
+ isHomePage: Ref<boolean>;
16
24
  /**
17
25
  * redirects to event landing page
18
26
  */
19
- goEventPage: (conference: Conference, _eventPath?: string) => void;
27
+ goEventPage: (conference: Conference) => void;
20
28
  /**
21
29
  * display modal login modal and set its conference prop
22
30
  */
@@ -33,13 +41,5 @@ export type UseEventsMethods = {
33
41
  * returns the first affiliate set to role 'custom1'
34
42
  */
35
43
  getBrand: (_affiliates: Array<Sponsor>) => Sponsor | null;
36
- /**
37
- * return different classes if countdown timer is/is not active
38
- */
39
- buttonClass: ComputedRef<string>;
40
- /**
41
- * checks if component is on the homepage
42
- */
43
- isHomePage: Ref<boolean>;
44
44
  };
45
45
  export declare const useEvents: () => UseEventsMethods;
@@ -6,13 +6,21 @@ import { useAuthStore, useTemplateConfigsStore } from "../store/index.mjs";
6
6
  export const useEvents = () => {
7
7
  const route = useRoute();
8
8
  const router = useRouter();
9
+ const config = useRuntimeConfig();
9
10
  const { isLoggedIn } = storeToRefs(useAuthStore());
11
+ const { pagesConfigValue } = storeToRefs(useTemplateConfigsStore());
10
12
  const loginModalVisible = ref(false);
11
13
  const conferenceToLoginTo = ref(null);
12
- const { pagesConfigValue } = storeToRefs(useTemplateConfigsStore());
13
- const goEventPage = (conference, _eventPath) => {
14
- if (_eventPath) {
15
- router.push(_eventPath + conference.id);
14
+ const buttonClass = computed(() => {
15
+ return pagesConfigValue.value("main.countdown_timer") ? "mx-2 mb-2 w-5/6 sm:w-auto sm:mx-0 sm:mr-4 md:w-full xl:mr-1 xl:w-auto btn btn-secondary" : "mx-2 mb-2 w-5/6 sm:w-auto sm:mx-0 sm:mr-4 btn btn-secondary";
16
+ });
17
+ const isHomePage = computed(() => {
18
+ return route.name === "index";
19
+ });
20
+ const goEventPage = (conference) => {
21
+ const eventPathPrefix = config.public.eventPathPrefix;
22
+ if (eventPathPrefix) {
23
+ router.push(eventPathPrefix + conference.id);
16
24
  } else {
17
25
  router.push(`/upcoming-events/${conference.id}`);
18
26
  }
@@ -44,22 +52,16 @@ export const useEvents = () => {
44
52
  }
45
53
  return null;
46
54
  };
47
- const buttonClass = computed(() => {
48
- return pagesConfigValue.value("main.countdown_timer") ? "mx-2 mb-2 w-5/6 sm:w-auto sm:mx-0 sm:mr-4 md:w-full xl:mr-1 xl:w-auto btn btn-secondary" : "mx-2 mb-2 w-5/6 sm:w-auto sm:mx-0 sm:mr-4 btn btn-secondary";
49
- });
50
- const isHomePage = computed(() => {
51
- return route.name === "index";
52
- });
53
55
  return {
54
56
  isLoggedIn,
55
57
  loginModalVisible,
56
58
  conferenceToLoginTo,
59
+ buttonClass,
60
+ isHomePage,
57
61
  goEventPage,
58
62
  setConferenceToLoginTo,
59
63
  orderAffiliates,
60
64
  getSponsors,
61
- getBrand,
62
- buttonClass,
63
- isHomePage
65
+ getBrand
64
66
  };
65
67
  };
@@ -3,7 +3,7 @@ export type UccFunctions = {
3
3
  /**
4
4
  * load UCC script
5
5
  */
6
- loadUccScript: (conference: Conference, eventPathPrefix: string) => void;
6
+ loadUccScript: (conference: Conference) => void;
7
7
  /**
8
8
  * redirect after successful login or registration
9
9
  */
@@ -12,7 +12,7 @@ export const useUcc = () => {
12
12
  const { loginEmailOnly } = useAuthStore();
13
13
  const { selectedConference } = storeToRefs(useConferencesStore());
14
14
  const router = useRouter();
15
- const loadUccScript = (conference, eventPathPrefix) => {
15
+ const loadUccScript = (conference) => {
16
16
  console.log("conference", conference);
17
17
  let brandCode = get(conference, "custom1[0].code");
18
18
  const { getConferenceWebcastUrl } = useConferenceHelpers(conference);
@@ -24,7 +24,7 @@ export const useUcc = () => {
24
24
  state: conference.state,
25
25
  brandCode
26
26
  };
27
- window.uccMixin.webcastUrl = getConferenceWebcastUrl(conference, eventPathPrefix);
27
+ window.uccMixin.webcastUrl = getConferenceWebcastUrl(conference);
28
28
  window.uccMixin.loginV3 = loginV3;
29
29
  window.uccMixin.postAuthRedirect = postAuthRedirect;
30
30
  window.uccMixin.uccShowEventSignUp = uccShowEventSignUp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.119",
3
+ "version": "0.0.120",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {