@icvdeveloper/common-module 2.2.4 → 2.3.0

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/CHANGELOG.md CHANGED
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## 2.3.0 - 2024-11-27
11
+
10
12
  ## 2.2.4 - 2024-10-11
11
13
 
12
14
  ## 2.2.3 - 2024-10-05
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "2.2.4"
4
+ "version": "2.3.0"
5
5
  }
@@ -37,20 +37,27 @@ export default defineNuxtPlugin((nuxtApp) => {
37
37
  let docTitle = "";
38
38
  const routeName = to.name;
39
39
  const routeArray = routeName.toLowerCase().split("-");
40
+ const isRedirectPage = routeName.includes("events-id") && to.params.id == "redirect";
41
+ const isStreamTest = routeName == "stream-test";
42
+ let skipCurrentConf = false;
40
43
  if (portal.value === null) {
41
44
  Promise.all([
42
45
  // fetch portal config then increment loading indicator
43
46
  await portalStore.getPortal().then(() => {
47
+ skipCurrentConf = portal.value.template_id == 7 && !isRedirectPage && !isStreamTest;
44
48
  docTitle = portal.value.name;
45
49
  NProgress.inc();
46
- }),
47
- // wait for portal config request to complete, then fetch conferences
48
- await conferencesStore.getConferences().then(() => NProgress.inc()),
49
- // wait for get conferences to complete, then get current conference data.
50
- await conferencesStore.getCurrentConference(true).then(() => NProgress.inc())
50
+ })
51
51
  ]);
52
+ if (!skipCurrentConf) {
53
+ Promise.all([
54
+ await conferencesStore.getConferences().then(() => NProgress.inc()),
55
+ // wait for get conferences to complete, then get current conference data.
56
+ await conferencesStore.getCurrentConference(true).then(() => NProgress.inc())
57
+ ]);
58
+ }
52
59
  }
53
- if (routeName.includes("events-id") && to.params.id == "redirect") {
60
+ if (isRedirectPage) {
54
61
  let matchedConfs = conferencesStore.conferenceList;
55
62
  if (to.query.custom1) {
56
63
  matchedConfs = conferencesStore.searchConferenceAffiliatesCustom1(to.query.custom1);
@@ -134,7 +141,7 @@ export default defineNuxtPlugin((nuxtApp) => {
134
141
  metaDesc = get(portal.value, "social_description");
135
142
  }
136
143
  if (get(conferencesStore, "selectedConference.photo.length", 0) > 0) {
137
- socialImage = get(conferencesStore, "selectedConference.photo");
144
+ socialImage = get(conferencesStore, "selectedConference.photo", "");
138
145
  } else if (get(portal.value, "social_photo.length", 0) > 0) {
139
146
  socialImage = get(portal.value, "social_photo");
140
147
  }
@@ -4,6 +4,7 @@ export interface ConferencesState {
4
4
  currentConference: null | Conference;
5
5
  selectedConference: null | Conference;
6
6
  featuredConference: null | Conference;
7
+ liveConference: null | Conference;
7
8
  }
8
9
  export declare const useConferencesStore: import("pinia").StoreDefinition<"conferences", ConferencesState, {
9
10
  upcomingEvents: (state: ConferencesState) => Conference[];
@@ -12,6 +13,7 @@ export declare const useConferencesStore: import("pinia").StoreDefinition<"confe
12
13
  getConferences(): Promise<Conference[]>;
13
14
  searchConferenceAffiliatesCustom1(code: string): Conference[];
14
15
  getSelectedConference(id: number, skipDetails?: boolean): Promise<Conference>;
16
+ getLiveConference(): Promise<Conference>;
15
17
  getCurrentConference(skipDetails?: boolean): Promise<Conference>;
16
18
  getRegisteredConferences(): Conference[];
17
19
  updateConferencesAccess(userConferences: Conference[]): void;
@@ -11,7 +11,8 @@ export const useConferencesStore = defineStore("conferences", {
11
11
  conferenceList: [],
12
12
  currentConference: null,
13
13
  selectedConference: null,
14
- featuredConference: null
14
+ featuredConference: null,
15
+ liveConference: null
15
16
  }),
16
17
  getters: {
17
18
  upcomingEvents: (state) => {
@@ -67,9 +68,29 @@ export const useConferencesStore = defineStore("conferences", {
67
68
  });
68
69
  });
69
70
  },
71
+ getLiveConference() {
72
+ return new Promise((resolve, reject) => {
73
+ if (this.currentConference !== null) {
74
+ if (this.currentConference.state.toLowerCase() == "live") {
75
+ this.liveConference = this.currentConference;
76
+ resolve(this.liveConference);
77
+ }
78
+ } else {
79
+ let url = `conferences?filters[state]=live&page=1&pageSize=1&orderBy=start_date&orderDir=asc`;
80
+ const request = useApi();
81
+ request(url).then((response) => {
82
+ if (get(response, "data.length", 0) > 0) {
83
+ this.liveConference = response.data[0];
84
+ resolve(this.liveConference);
85
+ }
86
+ }).catch((error) => {
87
+ reject(error);
88
+ });
89
+ }
90
+ });
91
+ },
70
92
  getCurrentConference(skipDetails) {
71
93
  return new Promise((resolve, reject) => {
72
- const request = useApi();
73
94
  let conference;
74
95
  const liveConference = this.conferenceList.find(
75
96
  (conf) => conf.state === ConferenceState.LIVE || conf.state === ConferenceState.MIXED
@@ -96,6 +117,7 @@ export const useConferencesStore = defineStore("conferences", {
96
117
  this.currentConference = conference;
97
118
  resolve(this.currentConference);
98
119
  } else {
120
+ const request = useApi();
99
121
  request(
100
122
  `conferences/${conference.id}?with=${conferenceDetailsQueryString()}`
101
123
  ).then((response) => {
@@ -14,7 +14,7 @@ export const usePortalStore = defineStore("portal", {
14
14
  return new Promise((resolve, reject) => {
15
15
  this.loading = true;
16
16
  request(
17
- "portals/1?fields=id,name,description,domain,favicon,ga_id,gtm_id,adobe_launch_url,social_title,social_description,social_photo&with=template_config,navigation_config"
17
+ "portals/1?fields=template_id,id,name,description,domain,favicon,ga_id,gtm_id,adobe_launch_url,social_title,social_description,social_photo&with=template_config,navigation_config,brand_codes_active"
18
18
  ).then((response) => {
19
19
  const {
20
20
  data: { navigation_config, template_config, ...data }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "2.2.4",
3
+ "version": "2.3.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {