@icvdeveloper/common-module 0.0.101 → 0.0.103
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
|
@@ -5,6 +5,10 @@ export type UseConferenceHelpersMethods = {
|
|
|
5
5
|
* Determine if conference is a single day event
|
|
6
6
|
*/
|
|
7
7
|
isSingleDayEvent: (_conference?: Conference) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Determine if logged in user has access to event
|
|
10
|
+
*/
|
|
11
|
+
hasAccessToEvent: (_conference?: Conference) => boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Determine if the webcast button should be shown
|
|
10
14
|
*/
|
|
@@ -26,7 +30,7 @@ export type UseConferenceHelpersMethods = {
|
|
|
26
30
|
*/
|
|
27
31
|
showViewArchiveButton: (_conference?: Conference) => boolean;
|
|
28
32
|
/**
|
|
29
|
-
* get view archive
|
|
33
|
+
* get view archive url
|
|
30
34
|
*/
|
|
31
35
|
getViewArchiveUrl: (_conference?: Conference) => string;
|
|
32
36
|
/**
|
|
@@ -26,7 +26,7 @@ export const useConferenceHelpers = (conference) => {
|
|
|
26
26
|
);
|
|
27
27
|
const { formatTimezoneToLocal } = useDateFormat();
|
|
28
28
|
const route = useRoute();
|
|
29
|
-
const { isLoggedIn } = storeToRefs(useAuthStore());
|
|
29
|
+
const { user, isLoggedIn } = storeToRefs(useAuthStore());
|
|
30
30
|
const { currentConference } = storeToRefs(useConferencesStore());
|
|
31
31
|
const _getSelectedConference = (_conference) => {
|
|
32
32
|
if (_conference) {
|
|
@@ -46,6 +46,13 @@ export const useConferenceHelpers = (conference) => {
|
|
|
46
46
|
const lastDay = new Date(_selectedConference.end_date).getMonth() + "/" + new Date(_selectedConference.end_date).getDate();
|
|
47
47
|
return firstDay === lastDay;
|
|
48
48
|
};
|
|
49
|
+
const hasAccessToEvent = (_conference) => {
|
|
50
|
+
let hasAccess = find(
|
|
51
|
+
get(user, "value.conferences", []),
|
|
52
|
+
{ id: _conference.id }
|
|
53
|
+
);
|
|
54
|
+
return isLoggedIn && (_conference.access || hasAccess);
|
|
55
|
+
};
|
|
49
56
|
const showConferenceWebcastButton = (_conference) => {
|
|
50
57
|
const _selectedConference = _getSelectedConference(_conference);
|
|
51
58
|
return _selectedConference.access && _selectedConference.state !== "archive" && _selectedConference.state !== "hidden";
|
|
@@ -242,6 +249,7 @@ export const useConferenceHelpers = (conference) => {
|
|
|
242
249
|
};
|
|
243
250
|
return {
|
|
244
251
|
isSingleDayEvent,
|
|
252
|
+
hasAccessToEvent,
|
|
245
253
|
showConferenceWebcastButton,
|
|
246
254
|
getConferenceWebcastButtonText,
|
|
247
255
|
getConferenceWebcastUrl,
|
|
@@ -34,14 +34,18 @@ export const useUcc = () => {
|
|
|
34
34
|
ucc.onload = () => {
|
|
35
35
|
console.log("UCC onload");
|
|
36
36
|
console.log("isLoggedIn", isLoggedIn.value);
|
|
37
|
-
if (
|
|
38
|
-
console.log("onload auth user.value", user.value);
|
|
39
|
-
let hasAccess = find(get(user, "value.conferences", []), { id: window.uccMixin.conference.id });
|
|
40
|
-
if (window.uccMixin.conference.state == "archive")
|
|
41
|
-
toggleEmailFormDisplay(!hasAccess);
|
|
42
|
-
} else if (window.uccMixin.conference) {
|
|
37
|
+
if (window.uccMixin.conference) {
|
|
43
38
|
if (window.uccMixin.conference.state == "upcoming") {
|
|
44
39
|
window.uccMixin.uccShowEventSignUp();
|
|
40
|
+
} else if (window.uccMixin.conference.state == "archive") {
|
|
41
|
+
if (isLoggedIn.value) {
|
|
42
|
+
console.log("onload auth user.value", user.value);
|
|
43
|
+
let hasAccess = find(
|
|
44
|
+
get(user, "value.conferences", []),
|
|
45
|
+
{ id: window.uccMixin.conference.id }
|
|
46
|
+
);
|
|
47
|
+
toggleEmailFormDisplay(!hasAccess);
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
mmsWidgets.init({
|