@icvdeveloper/common-module 0.0.119 → 0.0.121
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/components/auth/Ucc.vue +1 -4
- package/dist/runtime/components/events/ListEvents.vue +9 -4
- package/dist/runtime/composables/useConferenceHelpers.d.ts +1 -1
- package/dist/runtime/composables/useConferenceHelpers.mjs +4 -1
- package/dist/runtime/composables/useEvents.d.ts +9 -9
- package/dist/runtime/composables/useEvents.mjs +16 -13
- package/dist/runtime/composables/useUcc.d.ts +1 -1
- package/dist/runtime/composables/useUcc.mjs +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -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
|
|
71
|
+
loadUccScript(props.conference);
|
|
75
72
|
});
|
|
76
73
|
|
|
77
74
|
</script>
|
|
@@ -1,6 +1,8 @@
|
|
|
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";
|
|
5
|
+
import { useRuntimeConfig } from "#app";
|
|
4
6
|
import { useConferencesStore } from "../../store/conferences";
|
|
5
7
|
import { useTemplateConfigsStore } from "../../store/templateConfigs";
|
|
6
8
|
import { useDateFormat } from "../../composables/useDateFormat";
|
|
@@ -27,7 +29,6 @@ interface Props {
|
|
|
27
29
|
loginButton?: boolean;
|
|
28
30
|
viewInfoButton?: boolean;
|
|
29
31
|
registerPathPrefix?: string;
|
|
30
|
-
eventPathPrefix?: string;
|
|
31
32
|
liveButtonOpensStream?: boolean;
|
|
32
33
|
isUpcoming?: boolean;
|
|
33
34
|
showEventImage?: boolean;
|
|
@@ -47,7 +48,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
47
48
|
loginButton: true,
|
|
48
49
|
viewInfoButton: true,
|
|
49
50
|
registerPathPrefix: "",
|
|
50
|
-
eventPathPrefix: "",
|
|
51
51
|
liveButtonOpensStream: true,
|
|
52
52
|
isUpcoming: true,
|
|
53
53
|
showEventImage: true,
|
|
@@ -83,6 +83,7 @@ const {
|
|
|
83
83
|
} = toRefs(props);
|
|
84
84
|
|
|
85
85
|
// data
|
|
86
|
+
const config = useRuntimeConfig();
|
|
86
87
|
const { pastEvents, upcomingEvents } = storeToRefs(useConferencesStore());
|
|
87
88
|
|
|
88
89
|
// methods
|
|
@@ -136,6 +137,10 @@ const getVideoButtonText = (_conference: Conference): string => {
|
|
|
136
137
|
};
|
|
137
138
|
|
|
138
139
|
// computed
|
|
140
|
+
const eventPathPrefix = computed(() => {
|
|
141
|
+
return (get(config.public, "eventPathPrefix.length", 0) > 0) ? config.public.eventPathPrefix : null;
|
|
142
|
+
});
|
|
143
|
+
|
|
139
144
|
const eventType = computed((): Conference[] => {
|
|
140
145
|
return isUpcoming.value ? upcomingEvents.value : pastEvents.value;
|
|
141
146
|
});
|
|
@@ -363,7 +368,7 @@ const showLoginButton = computed((): boolean => {
|
|
|
363
368
|
:class="
|
|
364
369
|
classBinding(classObject, 'liveButtonItem', buttonClass)
|
|
365
370
|
"
|
|
366
|
-
@click="goEventPage(conference
|
|
371
|
+
@click="goEventPage(conference)"
|
|
367
372
|
>
|
|
368
373
|
{{ getVideoButtonText(conference) }}
|
|
369
374
|
</button>
|
|
@@ -376,7 +381,7 @@ const showLoginButton = computed((): boolean => {
|
|
|
376
381
|
:class="
|
|
377
382
|
classBinding(classObject, 'buttonItem', buttonClass)
|
|
378
383
|
"
|
|
379
|
-
@click="goEventPage(conference
|
|
384
|
+
@click="goEventPage(conference)"
|
|
380
385
|
>
|
|
381
386
|
More Info
|
|
382
387
|
</button>
|
|
@@ -20,7 +20,7 @@ export type UseConferenceHelpersMethods = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Get conference webcast url
|
|
22
22
|
*/
|
|
23
|
-
getConferenceWebcastUrl: (_conference?: Conference
|
|
23
|
+
getConferenceWebcastUrl: (_conference?: Conference) => string;
|
|
24
24
|
/**
|
|
25
25
|
* Get timezone display
|
|
26
26
|
*/
|
|
@@ -3,6 +3,7 @@ import { DateTime } from "luxon";
|
|
|
3
3
|
import { get, find } from "lodash-es";
|
|
4
4
|
import { storeToRefs } from "pinia";
|
|
5
5
|
import { useRoute } from "vue-router";
|
|
6
|
+
import { useRuntimeConfig } from "#app";
|
|
6
7
|
import { ConferenceState } from "../models/conference.mjs";
|
|
7
8
|
import {
|
|
8
9
|
useTemplateConfigsStore,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
useAuthStore
|
|
11
12
|
} from "../store";
|
|
12
13
|
import { useDateFormat } from "./useDateFormat.mjs";
|
|
14
|
+
const config = useRuntimeConfig();
|
|
13
15
|
const getConferenceConfigMainValue = (_conference, _name) => {
|
|
14
16
|
const configPages = get(_conference, "template_config.config.pages", []);
|
|
15
17
|
const mainPageContent = get(
|
|
@@ -58,12 +60,13 @@ export const useConferenceHelpers = (conference) => {
|
|
|
58
60
|
const _selectedConference = _getSelectedConference(_conference);
|
|
59
61
|
return _selectedConference.access && _selectedConference.state !== "archive" && _selectedConference.state !== "hidden";
|
|
60
62
|
};
|
|
61
|
-
const getConferenceWebcastUrl = (_conference
|
|
63
|
+
const getConferenceWebcastUrl = (_conference) => {
|
|
62
64
|
const _selectedConference = _getSelectedConference(_conference);
|
|
63
65
|
if (_selectedConference.state === "upcoming") {
|
|
64
66
|
return "/stream-test";
|
|
65
67
|
}
|
|
66
68
|
const channel = get(_selectedConference, "days[0].tracks[0].channel", 1);
|
|
69
|
+
const eventPathPrefix = config.public.eventPathPrefix;
|
|
67
70
|
return _selectedConference.agenda_enabled ? `/agenda/${_selectedConference.id}` : eventPathPrefix ? `${eventPathPrefix}${_selectedConference.id}/webcast/${channel}` : `/upcoming-events/${_selectedConference.id}/webcast/${channel}`;
|
|
68
71
|
};
|
|
69
72
|
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
|
|
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;
|
|
@@ -2,17 +2,26 @@ import { ref, computed } from "vue";
|
|
|
2
2
|
import { storeToRefs } from "pinia";
|
|
3
3
|
import { useRouter, useRoute } from "vue-router";
|
|
4
4
|
import { get, sortBy, filter } from "lodash-es";
|
|
5
|
+
import { useRuntimeConfig } from "#app";
|
|
5
6
|
import { useAuthStore, useTemplateConfigsStore } from "../store/index.mjs";
|
|
6
7
|
export const useEvents = () => {
|
|
7
8
|
const route = useRoute();
|
|
8
9
|
const router = useRouter();
|
|
10
|
+
const config = useRuntimeConfig();
|
|
9
11
|
const { isLoggedIn } = storeToRefs(useAuthStore());
|
|
12
|
+
const { pagesConfigValue } = storeToRefs(useTemplateConfigsStore());
|
|
10
13
|
const loginModalVisible = ref(false);
|
|
11
14
|
const conferenceToLoginTo = ref(null);
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
const buttonClass = computed(() => {
|
|
16
|
+
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";
|
|
17
|
+
});
|
|
18
|
+
const isHomePage = computed(() => {
|
|
19
|
+
return route.name === "index";
|
|
20
|
+
});
|
|
21
|
+
const goEventPage = (conference) => {
|
|
22
|
+
const eventPathPrefix = config.public.eventPathPrefix;
|
|
23
|
+
if (eventPathPrefix) {
|
|
24
|
+
router.push(eventPathPrefix + conference.id);
|
|
16
25
|
} else {
|
|
17
26
|
router.push(`/upcoming-events/${conference.id}`);
|
|
18
27
|
}
|
|
@@ -44,22 +53,16 @@ export const useEvents = () => {
|
|
|
44
53
|
}
|
|
45
54
|
return null;
|
|
46
55
|
};
|
|
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
56
|
return {
|
|
54
57
|
isLoggedIn,
|
|
55
58
|
loginModalVisible,
|
|
56
59
|
conferenceToLoginTo,
|
|
60
|
+
buttonClass,
|
|
61
|
+
isHomePage,
|
|
57
62
|
goEventPage,
|
|
58
63
|
setConferenceToLoginTo,
|
|
59
64
|
orderAffiliates,
|
|
60
65
|
getSponsors,
|
|
61
|
-
getBrand
|
|
62
|
-
buttonClass,
|
|
63
|
-
isHomePage
|
|
66
|
+
getBrand
|
|
64
67
|
};
|
|
65
68
|
};
|
|
@@ -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
|
|
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
|
|
27
|
+
window.uccMixin.webcastUrl = getConferenceWebcastUrl(conference);
|
|
28
28
|
window.uccMixin.loginV3 = loginV3;
|
|
29
29
|
window.uccMixin.postAuthRedirect = postAuthRedirect;
|
|
30
30
|
window.uccMixin.uccShowEventSignUp = uccShowEventSignUp;
|