@icvdeveloper/common-module 0.0.28 → 0.0.31

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.
Files changed (27) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/affiliates/AffiliatePage.vue +1 -0
  3. package/dist/runtime/components/agenda/AgendaTabbed.vue +2 -1
  4. package/dist/runtime/components/agenda/components/InfoLink.vue +1 -0
  5. package/dist/runtime/components/agenda/components/PlayIcon.vue +1 -0
  6. package/dist/runtime/components/agenda/components/PresentationLink.vue +67 -77
  7. package/dist/runtime/components/agenda/components/Sponsor.vue +1 -0
  8. package/dist/runtime/components/core/CountdownTimer.vue +37 -5
  9. package/dist/runtime/components/core/Modal.vue +2 -0
  10. package/dist/runtime/components/core/SvgIcon.vue +1 -1
  11. package/dist/runtime/components/events/EventHeader.vue +1 -1
  12. package/dist/runtime/components/events/PastEvents.vue +1 -1
  13. package/dist/runtime/components/events/UpcomingEvents.vue +2 -2
  14. package/dist/runtime/components/layouts/Accordion.vue +2 -0
  15. package/dist/runtime/components/presenters/PresenterListing.vue +1 -0
  16. package/dist/runtime/components/presenters/PresenterModal.vue +1 -0
  17. package/dist/runtime/composables/useAgenda.mjs +3 -0
  18. package/dist/runtime/composables/useConferenceHelpers.d.ts +16 -16
  19. package/dist/runtime/composables/useConferenceHelpers.mjs +77 -118
  20. package/dist/runtime/composables/useDateFormat.mjs +3 -3
  21. package/dist/runtime/composables/usePresentation.mjs +9 -3
  22. package/dist/runtime/composables/usePresenter.mjs +2 -0
  23. package/dist/runtime/composables/usePresenters.mjs +1 -0
  24. package/dist/runtime/store/conferences.d.ts +1 -1
  25. package/dist/runtime/store/conferences.mjs +13 -8
  26. package/dist/runtime/store/templateConfigs.mjs +20 -1
  27. package/package.json +1 -1
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.28"
4
+ "version": "0.0.31"
5
5
  }
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { toRefs } from "vue";
2
3
  import { Affiliate } from "../../models/affiliate";
3
4
  import { Sponsor } from "../../models/conference";
4
5
 
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { toRefs, computed } from "vue";
2
3
  import { storeToRefs } from "pinia";
3
4
  import { useAgenda } from "../../composables/useAgenda";
4
5
  import { Conference, Sponsor as SponsorType } from "../../models/conference";
@@ -215,7 +216,7 @@ const presentersContainer = computed(() => {
215
216
  {{
216
217
  formatTimezoneToLocal(
217
218
  presentation.date,
218
- "h:m a",
219
+ "h:mm a",
219
220
  conference.timezone
220
221
  )
221
222
  }}
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { ref, toRefs, computed } from "vue";
2
3
  import { Presentation } from "../../../models/conference";
3
4
 
4
5
  type Props = {
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { toRefs } from "vue";
2
3
  import { usePresentation } from "../../../composables/usePresentation";
3
4
  import { Conference, Presentation } from "../../../models/conference";
4
5
  import { Icons } from "../../../models/icons";
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { toRefs, computed } from "vue";
2
3
  import { useAgenda } from "../../../composables/useAgenda";
3
4
  import { useConferenceHelpers } from "../../../composables/useConferenceHelpers";
4
5
  import { usePresentation } from "../../../composables/usePresentation";
@@ -16,16 +17,18 @@ type Props = {
16
17
  presentation: Presentation;
17
18
  track: Track | TrackGroup;
18
19
  showInfoLink?: boolean;
20
+ simpleLayout?: boolean;
19
21
  };
20
22
 
21
23
  const props = withDefaults(defineProps<Props>(), {
22
24
  showInfoLink: true,
25
+ simpleLayout: false,
23
26
  });
24
27
 
25
28
  const { conference, track, presentation } = toRefs(props);
26
29
 
27
30
  // Methods
28
- const { conferenceIsLive, conferenceIsArchived } =
31
+ const { conferenceIsLiveOrMixed, conferenceIsArchived } =
29
32
  useConferenceHelpers(conference);
30
33
  const { isSmallGroupedTrack } = useAgenda(conference);
31
34
  const {
@@ -45,103 +48,90 @@ const presentationNameClass = computed(() => {
45
48
 
46
49
  <template>
47
50
  <div>
48
- <!-- LIVE AGENDA GO TO WEBCAST PAGE -->
49
- <div v-if="conferenceIsLive()">
50
- <div class="flex flex-col flex-wrap py-1">
51
- <h2 class="flex-initial" :class="presentationNameClass">
52
- <!-- zoom text link -->
51
+ <div v-if="!simpleLayout">
52
+ <!-- LIVE AGENDA GO TO WEBCAST PAGE -->
53
+ <div>
54
+ <h2 class="flex flex-initial flex-row" :class="presentationNameClass">
55
+ <!-- zoom text & icon link -->
53
56
  <CommonZoomModal
54
- v-if="presentation.type == 'zoom'"
57
+ v-if="
58
+ isAgenda &&
59
+ conferenceIsLiveOrMixed(conference) &&
60
+ presentation.type == 'zoom'
61
+ "
55
62
  :presentation-id="presentation.id"
56
63
  modal-size="full"
57
64
  >
58
65
  <template #modal-link>
59
- <span class="font-semibold no-underline heading-link">{{
60
- presentation.name
61
- }}</span>
66
+ <span class="font-semibold no-underline heading-link"
67
+ >{{ presentation.name }}
68
+ <PlayIcon
69
+ :presentation="presentation"
70
+ :conference="conference"
71
+ :class="'justify-center md:justify-start'"
72
+ icon="zoom"
73
+ ></PlayIcon>
74
+ </span>
62
75
  </template>
63
76
  </CommonZoomModal>
64
77
 
65
- <!-- stream text link -->
78
+ <!-- live/archive stream text & icon link -->
66
79
  <a
67
- v-else
80
+ v-else-if="
81
+ (isAgenda && conferenceIsLiveOrMixed(conference)) ||
82
+ (conferenceIsArchived(conference) && presentation.type != 'zoom')
83
+ "
68
84
  class="font-semibold no-underline heading-link"
69
- :target="getPresentationLinkTarget(presentation)"
70
85
  :href="getLivePresentationLinkDestination(presentation, track)"
71
- >{{ presentation.name }}</a
86
+ :target="getPresentationLinkTarget(presentation)"
87
+ @click="playPresentation(track, presentation, conference)"
88
+ >
89
+ {{ presentation.name
90
+ }}<transition name="fade">
91
+ <PlayIcon
92
+ v-if="presentationIsLiveOrMixed(presentation)"
93
+ :presentation="presentation"
94
+ :conference="conference"
95
+ :class="'justify-center md:justify-start'"
96
+ icon="playarrow"
97
+ ></PlayIcon>
98
+ </transition>
99
+ </a>
100
+
101
+ <!-- text only catchall -->
102
+ <span v-else class="font-semibold" :class="presentationNameClass"
103
+ >{{ presentation.name }}!!</span
72
104
  >
73
105
 
74
106
  <!-- session details -->
75
107
  <InfoLink
76
108
  v-if="showInfoLink && presentation.description"
77
109
  :presentation="presentation"
78
- :use-icon="showPresentationLinkIcon()"
79
- :link-text="getPresentationLinkText()"
80
- :new-line="isSmallGroupedTrack(track)"
81
- class="ml-1"
82
- ></InfoLink>
83
- </h2>
110
+ :use-icon="useIcon"
111
+ :link-text="infoLinkText"
112
+ :new-line="isSmallGroupedTrack"
113
+ class="ml-2"
114
+ />
84
115
 
85
- <!-- zoom icon link -->
86
- <CommonZoomModal
87
- v-if="presentation.type == 'zoom'"
88
- :presentation-id="presentation.id"
89
- modal-size="full"
90
- >
91
- <template #modal-link>
92
- <PlayIcon
93
- :presentation="presentation"
94
- :conference="conference"
95
- :class="'justify-center md:justify-start'"
96
- icon="zoom"
97
- ></PlayIcon>
98
- </template>
99
- </CommonZoomModal>
100
- <!-- stream icon link -->
101
- <a
102
- v-else
103
- class="no-underline"
104
- :target="getPresentationLinkTarget(presentation)"
105
- :href="getLivePresentationLinkDestination(presentation, track)"
106
- >
107
- <PlayIcon
108
- v-if="presentationIsLiveOrMixed(presentation)"
116
+ <!-- favorites -->
117
+ <favorite
118
+ v-if="allowFavorites && currentUser.token"
119
+ class="ml-1"
109
120
  :presentation="presentation"
110
- :conference="conference"
111
- :class="'justify-center md:justify-start'"
112
- icon="playarrow"
113
- ></PlayIcon>
114
- </a>
121
+ @click="handleFavoriteClick"
122
+ />
123
+ </h2>
115
124
  </div>
116
125
  </div>
117
- <!-- ARCHIVE AGENDA GO TO MEDIA PAGE -->
118
- <div v-if="conferenceIsArchived()">
119
- <h2 class="font-semibold" :class="presentationNameClass">
120
- <a
121
- class="no-underline heading-link"
122
- :target="getPresentationLinkTarget(presentation)"
123
- :href="getArchivePresentationLinkDestination(presentation)"
124
- >{{ presentation.name }}</a
125
- >
126
- <a
127
- :target="getPresentationLinkTarget(presentation)"
128
- :href="getArchivePresentationLinkDestination(presentation)"
129
- ><CommonSvgIcon
130
- icon="playarrow"
131
- class="ml-1 align-middle"
132
- style="display: inline-block; margin-bottom: 2px"
133
- :icon-width="'20px'"
134
- ></CommonSvgIcon
135
- ></a>
136
- <InfoLink
137
- v-if="showInfoLink && presentation.description"
138
- :presentation="presentation"
139
- :use-icon="showPresentationLinkIcon()"
140
- :link-text="getPresentationLinkText()"
141
- :new-line="isSmallGroupedTrack(track)"
142
- class="ml-1"
143
- ></InfoLink>
144
- </h2>
126
+
127
+ <!-- SIMPLE LAYOUT -->
128
+ <div v-else>
129
+ <a
130
+ class="underline cursor-pointer"
131
+ @click="playPresentation(track, presentation, conference)"
132
+ >
133
+ {{ presentation.name }}
134
+ </a>
145
135
  </div>
146
136
  </div>
147
137
  </template>
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { find } from "lodash-es";
3
+ import { ref, toRefs } from "vue";
3
4
  import { Sponsor as SponsorModel } from "../../../models/conference";
4
5
 
5
6
  type Props = {
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { ref, computed, onMounted } from "vue";
2
3
  import { storeToRefs } from "pinia";
3
4
  import {
4
5
  isBefore,
@@ -10,6 +11,7 @@ import {
10
11
  addHours,
11
12
  addMinutes,
12
13
  } from "date-fns";
14
+ import { useTemplateConfigsStore } from "../../store";
13
15
 
14
16
  interface Props {
15
17
  date: string;
@@ -53,7 +55,7 @@ const clockStyle = computed(() => {
53
55
  });
54
56
 
55
57
  const fontClass = computed(() => {
56
- const fontBase = "text-countdown-int font-bold";
58
+ const fontBase = "font-bold";
57
59
  return props.isCompact === true
58
60
  ? fontBase + " text-xl lg:text-2xl"
59
61
  : fontBase + " text-2xl lg:text-4xl";
@@ -135,6 +137,40 @@ onMounted(() => {
135
137
  </transition>
136
138
  </div>
137
139
  </div>
140
+
141
+ <!-- Minutes -->
142
+ <div
143
+ v-if="showMinutes"
144
+ class="item-container"
145
+ :class="{ dropshade: clockStyle == 'dials' }"
146
+ >
147
+ <div class="unit-label-container" :class="clockStyle">min</div>
148
+ <div class="unit-container contrast-border" :class="clockStyle">
149
+ <div v-if="clockStyle == 'windows'" :class="fontClass">
150
+ {{ minutes }}
151
+ </div>
152
+ <transition v-if="clockStyle == 'dials'" name="slide" mode="out-in">
153
+ <div :key="minutes" :class="fontClass">{{ minutes }}</div>
154
+ </transition>
155
+ </div>
156
+ </div>
157
+
158
+ <!-- Seconds -->
159
+ <div
160
+ v-if="showSeconds"
161
+ class="item-container last"
162
+ :class="{ dropshade: clockStyle == 'dials' }"
163
+ >
164
+ <div class="unit-label-container last" :class="clockStyle">sec</div>
165
+ <div class="unit-container contrast-border" :class="clockStyle">
166
+ <div v-if="clockStyle == 'windows'" :class="fontClass">
167
+ {{ seconds }}
168
+ </div>
169
+ <transition v-if="clockStyle == 'dials'" name="slide" mode="out-in">
170
+ <div :key="seconds" :class="fontClass">{{ seconds }}</div>
171
+ </transition>
172
+ </div>
173
+ </div>
138
174
  </div>
139
175
  </div>
140
176
  </div>
@@ -195,10 +231,6 @@ onMounted(() => {
195
231
  height: 36px;
196
232
  }
197
233
 
198
- /* numbers */
199
- .text-countdown-int {
200
- //color: $heading-color-6;
201
- }
202
234
  .countdown-timer.compact .text-countdown-unit {
203
235
  @apply pb-1;
204
236
  }
@@ -1,4 +1,6 @@
1
1
  <script setup lang="ts">
2
+ import { toRefs, computed } from "vue";
3
+
2
4
  interface Props {
3
5
  visible?: boolean;
4
6
  modalSize?: string;
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { find, get } from "lodash-es";
3
- import { defineAsyncComponent } from "vue";
3
+ import { toRefs, computed, defineAsyncComponent } from "vue";
4
4
  import { Icon, Icons } from "../../models/icons";
5
5
 
6
6
  /**
@@ -6,7 +6,7 @@ import { useConferencesStore } from "../../store/conferences";
6
6
  import { useConferenceHelpers } from "../../composables/useConferenceHelpers";
7
7
 
8
8
  interface Props {
9
- conference?: Conference;
9
+ conference?: Conference | null;
10
10
  useEventText?: boolean;
11
11
  }
12
12
 
@@ -26,7 +26,7 @@ const {
26
26
  getConferenceRegUrl,
27
27
  getConferenceRegText,
28
28
  showConferenceRegButton,
29
- } = useConferenceHelpers(pastEvents);
29
+ } = useConferenceHelpers();
30
30
 
31
31
  const goEventPage = (conference: Conference) => {
32
32
  router.push(`/upcoming-events/${conference.id}`);
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { ref } from "vue";
2
+ import { ref, computed } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
4
  import { useRouter } from "vue-router";
5
5
  import { useDateFormat } from "../../composables/useDateFormat";
@@ -32,7 +32,7 @@ const {
32
32
  getConferenceRegUrl,
33
33
  getConferenceRegText,
34
34
  showConferenceRegButton,
35
- } = useConferenceHelpers(upcomingEvents);
35
+ } = useConferenceHelpers();
36
36
  const goEventPage = (conference: Conference) => {
37
37
  router.push(`/upcoming-events/${conference.id}`);
38
38
  };
@@ -1,4 +1,6 @@
1
1
  <script lang="ts" setup>
2
+ import { ref, toRefs, computed } from "vue";
3
+
2
4
  type Props = {
3
5
  title?: string;
4
6
  tabContent?: {
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { toRefs } from "vue";
2
3
  import { Presenter } from "../../models/conference";
3
4
  import { usePresenter } from "../../composables/usePresenter";
4
5
 
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" setup>
2
+ import { ref, toRefs } from "vue";
2
3
  import { Presenter } from "../../models/conference";
3
4
  import { usePresenter } from "../../composables/usePresenter";
4
5
 
@@ -1,6 +1,9 @@
1
1
  import { get, remove, cloneDeep, intersectionBy, pullAllBy } from "lodash-es";
2
+ import { ref, computed, onBeforeMount } from "vue";
2
3
  import { storeToRefs } from "pinia";
3
4
  import { differenceInSeconds } from "date-fns";
5
+ import { useTemplateConfigsStore } from "../store/index.mjs";
6
+ import { useAuthStore } from "../store/auth.mjs";
4
7
  import { useAffiliatesStore } from "../store/affiliates.mjs";
5
8
  export const useAgenda = (conference) => {
6
9
  const { setConferenceConfig, pagesConfigValue } = useTemplateConfigsStore();
@@ -4,62 +4,62 @@ export declare type UseConferenceHelpersMethods = {
4
4
  /**
5
5
  * Determine if conference is a single day event
6
6
  */
7
- isSingleDayEvent: (conference?: Conference) => boolean;
7
+ isSingleDayEvent: (_conference?: Conference) => boolean;
8
8
  /**
9
9
  * Determine if the webcast button should be shown
10
10
  */
11
- showConferenceWebcastButton: (conference?: Conference) => boolean;
11
+ showConferenceWebcastButton: (_conference?: Conference) => boolean;
12
12
  /**
13
13
  * get webcast button text
14
14
  */
15
- getConferenceWebcastButtonText: (conference?: Conference) => string;
15
+ getConferenceWebcastButtonText: (_conference?: Conference) => string;
16
16
  /**
17
17
  * Get conference webcast url
18
18
  */
19
- getConferenceWebcastUrl: (conference?: Conference) => string;
19
+ getConferenceWebcastUrl: (_conference?: Conference) => string;
20
20
  /**
21
21
  * Get conference display date.
22
22
  */
23
- getConferenceDisplayDate: (conference?: Conference) => string;
23
+ getConferenceDisplayDate: (_conference?: Conference) => string;
24
24
  /**
25
25
  * Determine if show view archive button should be shown
26
26
  */
27
- showViewArchiveButton: (conference?: Conference) => boolean;
27
+ showViewArchiveButton: (_conference?: Conference) => boolean;
28
28
  /**
29
29
  * get view archive button text
30
30
  */
31
- getViewArchiveUrl: (conference?: Conference) => string;
31
+ getViewArchiveUrl: (_conference?: Conference) => string;
32
32
  /**
33
33
  * get view archive button text
34
34
  */
35
- getViewArchiveButtonText: (conference?: Conference) => string;
35
+ getViewArchiveButtonText: (_conference?: Conference) => string;
36
36
  /**
37
37
  * determine if reg button should be shown
38
38
  */
39
- showConferenceRegButton: (conference?: Conference) => boolean;
39
+ showConferenceRegButton: (_conference?: Conference) => boolean;
40
40
  /**
41
41
  * Get conference registration url
42
42
  */
43
- getConferenceRegUrl: (conference?: Conference) => string;
43
+ getConferenceRegUrl: (_conference?: Conference) => string;
44
44
  /**
45
45
  * get conference registration text
46
46
  */
47
- getConferenceRegText: (conference?: Conference) => string;
47
+ getConferenceRegText: (_conference?: Conference) => string;
48
48
  /**
49
49
  * Show conference View button
50
50
  */
51
- showConferenceViewButton: (conference?: Conference) => boolean;
51
+ showConferenceViewButton: (_conference?: Conference) => boolean;
52
52
  /**
53
53
  * conference is live
54
54
  */
55
- conferenceIsLive: (conference?: Conference) => boolean;
55
+ conferenceIsLiveOrMixed: (_conference?: Conference) => boolean;
56
56
  /**
57
57
  * conference is mixed
58
58
  */
59
- conferenceIsMixed: (conference?: Conference) => boolean;
59
+ conferenceIsMixed: (_conference?: Conference) => boolean;
60
60
  /**
61
61
  * conference is Archived
62
62
  */
63
- conferenceIsArchived: (conference?: Conference) => boolean;
63
+ conferenceIsArchived: (_conference?: Conference) => boolean;
64
64
  };
65
- export declare const useConferenceHelpers: (conferences: Ref<Conference> | Ref<Conference[]>) => UseConferenceHelpersMethods;
65
+ export declare const useConferenceHelpers: (conference: Ref<Conference | null>) => UseConferenceHelpersMethods;
@@ -1,5 +1,5 @@
1
- import { toRefs, ref } from "vue";
2
- import { format } from "date-fns";
1
+ import { toRefs } from "vue";
2
+ import { format, parseISO } from "date-fns";
3
3
  import { get, find } from "lodash-es";
4
4
  import { storeToRefs } from "pinia";
5
5
  import { useRoute } from "vue-router";
@@ -20,7 +20,7 @@ const getConferenceConfigMainValue = (_conference, _name) => {
20
20
  const configObj = find(mainPageContent, { name: _name });
21
21
  return configObj ? configObj.value : null;
22
22
  };
23
- export const useConferenceHelpers = (conferences) => {
23
+ export const useConferenceHelpers = (conference) => {
24
24
  const { pagesConfigValue, globalConfigValue } = toRefs(
25
25
  useTemplateConfigsStore()
26
26
  );
@@ -28,131 +28,104 @@ export const useConferenceHelpers = (conferences) => {
28
28
  const route = useRoute();
29
29
  const { isLoggedIn } = storeToRefs(useAuthStore());
30
30
  const { currentConference } = storeToRefs(useConferencesStore());
31
- const _selectedConference = ref(null);
32
- if (!Array.isArray(conferences.value)) {
33
- _selectedConference.value = conferences.value;
34
- }
35
- const _setSelectedConference = (conference) => {
36
- if (!Array.isArray(conferences.value)) {
37
- throw new TypeError(
38
- "parameter conferences supplied useConferenceHelpers should be of type Array"
39
- );
31
+ const _getSelectedConference = (_conference) => {
32
+ if (_conference) {
33
+ return _conference;
40
34
  }
41
- if (_selectedConference.value && _selectedConference.value.id !== conference.id) {
42
- _selectedConference.value = find(conferences.value, {
43
- id: conference.id
44
- });
35
+ if (conference) {
36
+ return conference.value;
45
37
  }
46
- if (_selectedConference.value === void 0) {
47
- throw new Error("could not find conference in arrray");
38
+ if (currentConference) {
39
+ return currentConference.value;
48
40
  }
41
+ throw new TypeError("No conference specified.");
49
42
  };
50
- const isSingleDayEvent = (conference) => {
51
- if (conference) {
52
- _setSelectedConference(conference);
53
- }
54
- const firstDay = new Date(_selectedConference.value.start_date).getMonth() + "/" + new Date(_selectedConference.value.start_date).getDate();
55
- const lastDay = new Date(_selectedConference.value.end_date).getMonth() + "/" + 3;
56
- new Date(_selectedConference.value.end_date).getDate();
43
+ const isSingleDayEvent = (_conference) => {
44
+ const _selectedConference = _getSelectedConference(_conference);
45
+ const firstDay = new Date(_selectedConference.start_date).getMonth() + "/" + new Date(_selectedConference.start_date).getDate();
46
+ const lastDay = new Date(_selectedConference.end_date).getMonth() + "/" + 3;
47
+ new Date(_selectedConference.end_date).getDate();
57
48
  return firstDay === lastDay;
58
49
  };
59
- const showConferenceWebcastButton = (conference) => {
60
- if (conference) {
61
- _setSelectedConference(conference);
62
- }
63
- return _selectedConference.value.access && _selectedConference.value.state !== "archive" && _selectedConference.value.state !== "hidden";
50
+ const showConferenceWebcastButton = (_conference) => {
51
+ const _selectedConference = _getSelectedConference(_conference);
52
+ return _selectedConference.access && _selectedConference.state !== "archive" && _selectedConference.state !== "hidden";
64
53
  };
65
- const getConferenceWebcastUrl = (conference) => {
66
- if (conference) {
67
- _setSelectedConference(conference);
68
- }
69
- if (_selectedConference.value.state === "upcoming") {
54
+ const getConferenceWebcastUrl = (_conference) => {
55
+ const _selectedConference = _getSelectedConference(_conference);
56
+ if (_selectedConference.state === "upcoming") {
70
57
  return "/stream-test";
71
58
  }
72
- const channel = get(
73
- _selectedConference.value,
74
- "days[0].tracks[0].channel",
75
- 1
76
- );
77
- return _selectedConference.value.agenda_enabled ? `/agenda/${_selectedConference.value.id}` : `/upcoming-events/${_selectedConference.value.id}/webcast/${channel}`;
59
+ const channel = get(_selectedConference, "days[0].tracks[0].channel", 1);
60
+ return _selectedConference.agenda_enabled ? `/agenda/${_selectedConference.id}` : `/upcoming-events/${_selectedConference.id}/webcast/${channel}`;
78
61
  };
79
- const getConferenceWebcastButtonText = (conference) => {
80
- if (conference) {
81
- _setSelectedConference(conference);
82
- }
83
- if (_selectedConference.value.state === "upcoming") {
62
+ const getConferenceWebcastButtonText = (_conference) => {
63
+ const _selectedConference = _getSelectedConference(_conference);
64
+ if (_selectedConference.state === "upcoming") {
84
65
  return "View Test Stream";
85
66
  }
86
67
  const viewNowAliasText = globalConfigValue.value("view_now_button_alias");
87
68
  return viewNowAliasText || "View Now";
88
69
  };
89
- const getConferenceDisplayDate = (conference) => {
90
- if (conference) {
91
- _setSelectedConference(conference);
92
- }
93
- const startDate = new Date(_selectedConference.value.start_date);
94
- const endDate = new Date(_selectedConference.value.end_date);
70
+ const getConferenceDisplayDate = (_conference) => {
71
+ const _selectedConference = _getSelectedConference(_conference);
72
+ const startDate = _selectedConference.start_date;
73
+ const endDate = _selectedConference.end_date;
95
74
  const tzFormat = pagesConfigValue.value("main.use_event_text_tz") ? " zzz" : "";
96
75
  if (isSingleDayEvent()) {
97
76
  const startFormat2 = "MMMM do, yyyy h:mm" + tzFormat;
98
77
  return formatTimezoneToLocal(
99
78
  startDate,
100
79
  startFormat2,
101
- _selectedConference.value.timezone
80
+ _selectedConference.timezone
102
81
  );
103
82
  }
104
83
  let startFormat = "MMMM d";
105
- if (format(startDate, "yyyy") !== format(endDate, "yyyy")) {
84
+ if (format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
106
85
  startFormat += ", yyyy";
107
86
  }
108
87
  let returnDate = formatTimezoneToLocal(
109
88
  startDate,
110
89
  startFormat,
111
- _selectedConference.value.timezone
90
+ _selectedConference.timezone
112
91
  );
113
92
  returnDate += " - ";
114
93
  let endFormat = "d, yyyy" + tzFormat;
115
- if (format(startDate, "MMMM") !== format(endDate, "MMMM") || format(startDate, "yyyy") !== format(endDate, "yyyy")) {
94
+ if (format(parseISO(startDate), "MMMM") !== format(parseISO(endDate), "MMMM") || format(parseISO(startDate), "yyyy") !== format(parseISO(endDate), "yyyy")) {
116
95
  endFormat = "MMMM " + endFormat;
117
96
  }
118
97
  returnDate += formatTimezoneToLocal(
119
98
  endDate,
120
99
  endFormat,
121
- _selectedConference.value.timezone
100
+ _selectedConference.timezone
122
101
  );
123
102
  return returnDate;
124
103
  };
125
- const showViewArchiveButton = (conference) => {
126
- if (conference) {
127
- _setSelectedConference(conference);
128
- }
129
- if (_selectedConference.value.state !== "archive")
104
+ const showViewArchiveButton = (_conference) => {
105
+ const _selectedConference = _getSelectedConference(_conference);
106
+ if (_selectedConference.state !== "archive")
130
107
  return false;
131
108
  if (route.name === "index") {
132
- return isLoggedIn && _selectedConference.value.access;
109
+ return isLoggedIn && _selectedConference.access;
133
110
  } else {
134
- return _selectedConference.value.access || _selectedConference.value.agenda_enabled || pagesConfigValue.value("archive_player.preview_enabled", false);
111
+ return _selectedConference.access || _selectedConference.agenda_enabled || pagesConfigValue.value("archive_player.preview_enabled", false);
135
112
  }
136
113
  };
137
- const getViewArchiveUrl = (conference) => {
138
- if (conference) {
139
- _setSelectedConference(conference);
140
- }
141
- if (_selectedConference.value.agenda_enabled) {
142
- return `/agenda/${_selectedConference.value.id}`;
114
+ const getViewArchiveUrl = (_conference) => {
115
+ const _selectedConference = _getSelectedConference(_conference);
116
+ if (_selectedConference.agenda_enabled) {
117
+ return `/agenda/${_selectedConference.id}`;
143
118
  } else {
144
119
  const presentationId = get(
145
- _selectedConference.value,
120
+ _selectedConference,
146
121
  "days[0].tracks[0].presentations[0].id",
147
122
  null
148
123
  );
149
124
  return `/archive/${presentationId}`;
150
125
  }
151
126
  };
152
- const getViewArchiveButtonText = (conference) => {
153
- if (conference) {
154
- _setSelectedConference(conference);
155
- }
127
+ const getViewArchiveButtonText = (_conference) => {
128
+ const _selectedConference = _getSelectedConference(_conference);
156
129
  const viewArchiveAliasText = globalConfigValue.value(
157
130
  "view_archive_button_alias",
158
131
  ""
@@ -161,7 +134,7 @@ export const useConferenceHelpers = (conferences) => {
161
134
  "view_preview_button_alias",
162
135
  ""
163
136
  );
164
- if (!_selectedConference.value.access && pagesConfigValue.value("archive_player.preview_enabled", false)) {
137
+ if (!_selectedConference.access && pagesConfigValue.value("archive_player.preview_enabled", false)) {
165
138
  if (viewPreviewAliasText.length) {
166
139
  return viewPreviewAliasText;
167
140
  } else {
@@ -173,15 +146,13 @@ export const useConferenceHelpers = (conferences) => {
173
146
  return "View Archive";
174
147
  }
175
148
  };
176
- const showConferenceRegButton = (conference) => {
177
- if (conference) {
178
- _setSelectedConference(conference);
179
- }
180
- if (_selectedConference.value.access || globalConfigValue.value("townhall_registration_enabled", false)) {
149
+ const showConferenceRegButton = (_conference) => {
150
+ const _selectedConference = _getSelectedConference(_conference);
151
+ if (_selectedConference.access || globalConfigValue.value("townhall_registration_enabled", false)) {
181
152
  return false;
182
153
  } else {
183
154
  const confSetting = getConferenceConfigMainValue(
184
- _selectedConference.value,
155
+ _selectedConference,
185
156
  "conference_reg_button_enabled"
186
157
  );
187
158
  if (confSetting != null) {
@@ -191,21 +162,19 @@ export const useConferenceHelpers = (conferences) => {
191
162
  }
192
163
  }
193
164
  };
194
- const getConferenceRegUrl = (conference) => {
195
- if (conference) {
196
- _setSelectedConference(conference);
197
- }
165
+ const getConferenceRegUrl = (_conference) => {
166
+ const _selectedConference = _getSelectedConference(_conference);
198
167
  if (globalConfigValue.value("townhall_registration_enabled", false)) {
199
- if (_selectedConference.value.id === currentConference.value.id) {
168
+ if (_selectedConference.id === currentConference.id) {
200
169
  return "/";
201
- } else if (_selectedConference.value.state === "live" || _selectedConference.value.state === "mixed") {
202
- return `/upcoming-events/${_selectedConference.value.id}`;
170
+ } else if (_selectedConference.state === "live" || _selectedConference.state === "mixed") {
171
+ return `/upcoming-events/${_selectedConference.id}`;
203
172
  } else {
204
- return `/past-events/${_selectedConference.value.id}`;
173
+ return `/past-events/${_selectedConference.id}`;
205
174
  }
206
175
  }
207
176
  const confExternalUrl = getConferenceConfigMainValue(
208
- _selectedConference.value,
177
+ _selectedConference,
209
178
  "conference_external_reg_url"
210
179
  );
211
180
  if (confExternalUrl)
@@ -213,14 +182,12 @@ export const useConferenceHelpers = (conferences) => {
213
182
  const portalExternalUrl = globalConfigValue.value("external_reg_url");
214
183
  if (portalExternalUrl)
215
184
  return portalExternalUrl;
216
- return `/registration/options/${_selectedConference.value.id}`;
185
+ return `/registration/options/${_selectedConference.id}`;
217
186
  };
218
- const getConferenceRegText = (conference) => {
219
- if (conference) {
220
- _setSelectedConference(conference);
221
- }
187
+ const getConferenceRegText = (_conference) => {
188
+ const _selectedConference = _getSelectedConference(_conference);
222
189
  const confSetting = getConferenceConfigMainValue(
223
- _selectedConference.value,
190
+ _selectedConference,
224
191
  "conference_reg_button_alias"
225
192
  );
226
193
  if (confSetting != null && confSetting !== "") {
@@ -233,29 +200,21 @@ export const useConferenceHelpers = (conferences) => {
233
200
  }
234
201
  return "Register";
235
202
  };
236
- const showConferenceViewButton = (conference) => {
237
- if (conference) {
238
- _setSelectedConference(conference);
239
- }
240
- return isLoggedIn && conference.access;
203
+ const showConferenceViewButton = (_conference) => {
204
+ const _selectedConference = _getSelectedConference(_conference);
205
+ return isLoggedIn && _selectedConference.access;
241
206
  };
242
- const conferenceIsLive = (conference) => {
243
- if (conference) {
244
- _setSelectedConference(conference);
245
- }
246
- return _selectedConference.value.state === ConferenceState.LIVE || _selectedConference.value.state === ConferenceState.MIXED;
207
+ const conferenceIsLiveOrMixed = (_conference) => {
208
+ const _selectedConference = _getSelectedConference(_conference);
209
+ return _selectedConference.state === ConferenceState.LIVE || _selectedConference.state === ConferenceState.MIXED;
247
210
  };
248
- const conferenceIsMixed = (conference) => {
249
- if (conference) {
250
- _setSelectedConference(conference);
251
- }
252
- return _selectedConference.value.state === ConferenceState.MIXED;
211
+ const conferenceIsMixed = (_conference) => {
212
+ const _selectedConference = _getSelectedConference(_conference);
213
+ return _selectedConference.state === ConferenceState.MIXED;
253
214
  };
254
- const conferenceIsArchived = (conference) => {
255
- if (conference) {
256
- _setSelectedConference(conference);
257
- }
258
- return _selectedConference.value.state === ConferenceState.ARCHIVED;
215
+ const conferenceIsArchived = (_conference) => {
216
+ const _selectedConference = _getSelectedConference(_conference);
217
+ return _selectedConference.state === ConferenceState.ARCHIVED;
259
218
  };
260
219
  return {
261
220
  isSingleDayEvent,
@@ -270,7 +229,7 @@ export const useConferenceHelpers = (conferences) => {
270
229
  getConferenceRegUrl,
271
230
  getConferenceRegText,
272
231
  showConferenceViewButton,
273
- conferenceIsLive,
232
+ conferenceIsLiveOrMixed,
274
233
  conferenceIsMixed,
275
234
  conferenceIsArchived
276
235
  };
@@ -1,13 +1,13 @@
1
1
  import { format as formatTz } from "date-fns-tz";
2
- import { format } from "date-fns";
2
+ import { format, parseISO } from "date-fns";
3
3
  export const useDateFormat = () => {
4
4
  const formatDate = (date) => {
5
- return format(new Date(date), "MMMM do, Y");
5
+ return format(new Date(parseISO(date)), "MMMM do, Y");
6
6
  };
7
7
  const formatTimezoneToLocal = (date, format2, timezone) => {
8
8
  return formatTz(
9
9
  new Date(
10
- formatTz(date, "yyyy-MM-dd HH:mm z", {
10
+ formatTz(parseISO(date), "yyyy-MM-dd HH:mm z", {
11
11
  timeZone: timezone
12
12
  })
13
13
  ),
@@ -1,4 +1,5 @@
1
- import { addSeconds } from "date-fns";
1
+ import { addSeconds, format, parseISO } from "date-fns";
2
+ import { useTemplateConfigsStore } from "../store/index.mjs";
2
3
  import {
3
4
  ConferenceState
4
5
  } from "../models/conference";
@@ -15,9 +16,14 @@ export const usePresentation = (conference) => {
15
16
  return pagesConfigValue("agenda.session_end_times", false);
16
17
  };
17
18
  const getPresentationEndTime = (presentation) => {
19
+ const presentationDuration = presentation.duration ? presentation.duration : 0;
20
+ const presentationEndTime = format(
21
+ addSeconds(parseISO(presentation.date), presentationDuration),
22
+ "yyyy-MM-dd HH:mm"
23
+ );
18
24
  return formatTimezoneToLocal(
19
- addSeconds(new Date(presentation.date), presentation.duration),
20
- "h:m a",
25
+ presentationEndTime,
26
+ "h:mm a",
21
27
  conference.value.timezone
22
28
  );
23
29
  };
@@ -1,3 +1,5 @@
1
+ import { ref, computed } from "vue";
2
+ import { useTemplateConfigsStore } from "../store/index.mjs";
1
3
  export const usePresenter = (presenter) => {
2
4
  const { pagesConfigValue, globalConfigValue } = useTemplateConfigsStore();
3
5
  const imageStyle = ref(
@@ -1,4 +1,5 @@
1
1
  import { sortBy } from "lodash-es";
2
+ import { useTemplateConfigsStore } from "../store/index.mjs";
2
3
  export const usePresenters = (conference) => {
3
4
  const { pagesConfigValue } = useTemplateConfigsStore();
4
5
  const getPresentersLabel = (numberOfPresenters) => {
@@ -6,8 +6,8 @@ export interface ConferencesState {
6
6
  export declare const useConferencesStore: import("pinia").StoreDefinition<"conferences", ConferencesState, {
7
7
  upcomingEvents: (state: ConferencesState) => Conference[];
8
8
  pastEvents: (state: ConferencesState) => Conference[];
9
- getConferenceById: (state: ConferencesState) => (id: number) => any;
10
9
  }, {
11
10
  getConferences(): Promise<Conference[]>;
11
+ getConferenceById(id: number): Promise<Conference>;
12
12
  getCurrentConference(): Promise<Conference>;
13
13
  }>;
@@ -1,9 +1,9 @@
1
1
  import { defineStore } from "pinia";
2
- import { findLast, find } from "lodash-es";
2
+ import { findLast } from "lodash-es";
3
3
  import { useApi } from "../composables/useApi.mjs";
4
4
  import { ConferenceState } from "../models/conference.mjs";
5
5
  import { useTemplateConfigsStore } from "./templateConfigs.mjs";
6
- const currentConferenceQueryString = () => {
6
+ const conferenceDetailsQueryString = () => {
7
7
  return "affiliates.documents,presenters,days.sponsors,days.tracks.sponsors,days.tracks.presentations.presenters,days.tracks.presentations.sponsors,days.tracks.presentations.documents,days.track_groups.tracks.sponsors,days.track_groups.tracks.presentations.presenters,days.track_groups.tracks.presentations.sponsors,days.track_groups.tracks.presentations.documents,days.groups,days.tracks.groups,groups,template_config";
8
8
  };
9
9
  export const useConferencesStore = defineStore("conferences", {
@@ -21,11 +21,6 @@ export const useConferencesStore = defineStore("conferences", {
21
21
  return state.conferenceList.filter((conference) => {
22
22
  return conference?.state === ConferenceState.ARCHIVED;
23
23
  });
24
- },
25
- getConferenceById: (state) => {
26
- return (id) => {
27
- return find(state.conferenceList, { id });
28
- };
29
24
  }
30
25
  },
31
26
  actions: {
@@ -42,6 +37,16 @@ export const useConferencesStore = defineStore("conferences", {
42
37
  });
43
38
  });
44
39
  },
40
+ getConferenceById(id) {
41
+ return new Promise((resolve, reject) => {
42
+ const request = useApi();
43
+ request(`conferences/${id}?with=${conferenceDetailsQueryString()}`).then((response) => {
44
+ resolve(response.data);
45
+ }).catch((error) => {
46
+ reject(error);
47
+ });
48
+ });
49
+ },
45
50
  getCurrentConference() {
46
51
  return new Promise((resolve, reject) => {
47
52
  const request = useApi();
@@ -66,7 +71,7 @@ export const useConferencesStore = defineStore("conferences", {
66
71
  reject(new Error("could not determine current conference."));
67
72
  }
68
73
  request(
69
- `conferences/${conference.id}?with=${currentConferenceQueryString()}`
74
+ `conferences/${conference.id}?with=${conferenceDetailsQueryString()}`
70
75
  ).then((response) => {
71
76
  const {
72
77
  data: { template_config, ...data }
@@ -28,7 +28,7 @@ export const useTemplateConfigsStore = defineStore("templateConfigs", {
28
28
  if (conferenceId && conferenceId !== currentConference.id) {
29
29
  const conference = find(state.conferences, { id: conferenceId });
30
30
  return get(conference, `pages.${path}.value`, defaultValue);
31
- } else if (state.currentConferenceConfig || conferenceId && state.currentConferenceConfig && conferenceId === currentConference.id) {
31
+ } else if (state.currentConferenceConfig && (!conferenceId || conferenceId && conferenceId === currentConference.id)) {
32
32
  return get(
33
33
  state.currentConferenceConfig,
34
34
  `pages.${path}.value`,
@@ -80,6 +80,25 @@ export const useTemplateConfigsStore = defineStore("templateConfigs", {
80
80
  };
81
81
  },
82
82
  setConferenceConfig(conference) {
83
+ console.log("setConferenceConfig conference", conference);
84
+ console.log("setConferenceConfig conferences", this.conferences);
85
+ const newPagesConfig = this.portalConfig.pages;
86
+ const confPagesConfig = {};
87
+ const conferenceTemplateConfig = conference.template_config ?? {};
88
+ forEach(conferenceTemplateConfig, (page) => {
89
+ const pageContent = {};
90
+ forEach(page.content, function(value) {
91
+ pageContent[value.name] = value;
92
+ });
93
+ confPagesConfig[page.name] = pageContent;
94
+ });
95
+ forIn(newPagesConfig, function(value, key) {
96
+ if (get(confPagesConfig, key)) {
97
+ newPagesConfig[key] = confPagesConfig[key];
98
+ }
99
+ });
100
+ this.conferences[conference.id] = newPagesConfig;
101
+ console.log("setConferenceConfig conference", conference);
83
102
  }
84
103
  }
85
104
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "0.0.28",
3
+ "version": "0.0.31",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {