@icvdeveloper/common-module 0.0.102 → 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
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "0.0.102"
4
+ "version": "0.0.103"
5
5
  }
@@ -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 button text
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.102",
3
+ "version": "0.0.103",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {