@icvdeveloper/common-module 0.0.29 → 0.0.32

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 (35) 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/Navbar.vue +154 -0
  11. package/dist/runtime/components/core/SvgIcon.vue +1 -1
  12. package/dist/runtime/components/events/EventHeader.vue +1 -1
  13. package/dist/runtime/components/events/PastEvents.vue +1 -1
  14. package/dist/runtime/components/events/UpcomingEvents.vue +1 -1
  15. package/dist/runtime/components/forms/ErrorField.vue +1 -3
  16. package/dist/runtime/components/forms/Message.vue +8 -2
  17. package/dist/runtime/components/forms/SearchInput.vue +12 -4
  18. package/dist/runtime/components/forms/SupportForm.vue +8 -5
  19. package/dist/runtime/components/forms/SwitchInput.vue +1 -0
  20. package/dist/runtime/components/forms/TextInput.vue +1 -0
  21. package/dist/runtime/components/layouts/Accordion.vue +2 -0
  22. package/dist/runtime/components/presenters/PresenterListing.vue +1 -0
  23. package/dist/runtime/components/presenters/PresenterModal.vue +1 -0
  24. package/dist/runtime/composables/useAgenda.mjs +3 -0
  25. package/dist/runtime/composables/useConferenceHelpers.d.ts +16 -16
  26. package/dist/runtime/composables/useConferenceHelpers.mjs +77 -118
  27. package/dist/runtime/composables/useDateFormat.mjs +3 -3
  28. package/dist/runtime/composables/useNavigation.mjs +3 -0
  29. package/dist/runtime/composables/usePresentation.mjs +9 -3
  30. package/dist/runtime/composables/usePresenter.mjs +2 -0
  31. package/dist/runtime/composables/usePresenters.mjs +1 -0
  32. package/dist/runtime/store/conferences.d.ts +1 -1
  33. package/dist/runtime/store/conferences.mjs +13 -8
  34. package/dist/runtime/store/templateConfigs.mjs +20 -1
  35. package/package.json +2 -1
@@ -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
  ),
@@ -9,6 +9,9 @@ export const useNavigation = () => {
9
9
  return url.startsWith("http") === true;
10
10
  };
11
11
  const formatLink = (navItem) => {
12
+ if (navItem.url && navItem.url.startsWith("#")) {
13
+ return navItem.url;
14
+ }
12
15
  let link = "/" + navItem.name;
13
16
  if (navItem.name === "home") {
14
17
  link = "/";
@@ -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.29",
3
+ "version": "0.0.32",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,6 +18,7 @@
18
18
  "prepack": "nuxt-module-build",
19
19
  "dev": "nuxi dev playground",
20
20
  "dev:build": "nuxi build playground",
21
+ "dev:docker": "rm -rf /tmp/nitro && nuxi dev --host 0.0.0.0 --port 3005 playground",
21
22
  "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground"
22
23
  },
23
24
  "dependencies": {