@icvdeveloper/common-module 2.3.0 → 2.3.2
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
package/dist/module.json
CHANGED
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -35,6 +35,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
35
35
|
return text;
|
|
36
36
|
};
|
|
37
37
|
let docTitle = "";
|
|
38
|
+
let isNEJM = false;
|
|
38
39
|
const routeName = to.name;
|
|
39
40
|
const routeArray = routeName.toLowerCase().split("-");
|
|
40
41
|
const isRedirectPage = routeName.includes("events-id") && to.params.id == "redirect";
|
|
@@ -44,7 +45,8 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
44
45
|
Promise.all([
|
|
45
46
|
// fetch portal config then increment loading indicator
|
|
46
47
|
await portalStore.getPortal().then(() => {
|
|
47
|
-
|
|
48
|
+
isNEJM = portal.value.template_id == 7;
|
|
49
|
+
skipCurrentConf = isNEJM && !isRedirectPage && !isStreamTest;
|
|
48
50
|
docTitle = portal.value.name;
|
|
49
51
|
NProgress.inc();
|
|
50
52
|
})
|
|
@@ -60,7 +62,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
60
62
|
if (isRedirectPage) {
|
|
61
63
|
let matchedConfs = conferencesStore.conferenceList;
|
|
62
64
|
if (to.query.custom1) {
|
|
63
|
-
matchedConfs = conferencesStore.searchConferenceAffiliatesCustom1(
|
|
65
|
+
matchedConfs = conferencesStore.searchConferenceAffiliatesCustom1(
|
|
66
|
+
to.query.custom1
|
|
67
|
+
);
|
|
64
68
|
}
|
|
65
69
|
if (matchedConfs.length > 0 && to.query.state) {
|
|
66
70
|
if (to.query.state == "upcoming") {
|
|
@@ -91,7 +95,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
91
95
|
}
|
|
92
96
|
const routeParamId = parseInt(to.params.id);
|
|
93
97
|
if (routeName.includes("events-id") && routeParamId) {
|
|
94
|
-
await conferencesStore.getSelectedConference(routeParamId, false).then(() => {
|
|
98
|
+
await conferencesStore.getSelectedConference(routeParamId, false, isNEJM ? false : true).then(() => {
|
|
95
99
|
if (conferencesStore.selectedConference) {
|
|
96
100
|
docTitle = `${conferencesStore.selectedConference.name}`;
|
|
97
101
|
if (routeName.includes("webcast-channelid")) {
|
|
@@ -136,12 +140,18 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
136
140
|
let metaDesc = portal.value.description;
|
|
137
141
|
let socialImage = "";
|
|
138
142
|
if (get(conferencesStore, "selectedConference.description.length", 0) > 0) {
|
|
139
|
-
metaDesc = stripHtml(
|
|
143
|
+
metaDesc = stripHtml(
|
|
144
|
+
conferencesStore.selectedConference?.description
|
|
145
|
+
);
|
|
140
146
|
} else if (get(portal.value, "social_description.length", 0) > 0) {
|
|
141
147
|
metaDesc = get(portal.value, "social_description");
|
|
142
148
|
}
|
|
143
149
|
if (get(conferencesStore, "selectedConference.photo.length", 0) > 0) {
|
|
144
|
-
socialImage = get(
|
|
150
|
+
socialImage = get(
|
|
151
|
+
conferencesStore,
|
|
152
|
+
"selectedConference.photo",
|
|
153
|
+
""
|
|
154
|
+
);
|
|
145
155
|
} else if (get(portal.value, "social_photo.length", 0) > 0) {
|
|
146
156
|
socialImage = get(portal.value, "social_photo");
|
|
147
157
|
}
|
|
@@ -12,9 +12,9 @@ export declare const useConferencesStore: import("pinia").StoreDefinition<"confe
|
|
|
12
12
|
}, {
|
|
13
13
|
getConferences(): Promise<Conference[]>;
|
|
14
14
|
searchConferenceAffiliatesCustom1(code: string): Conference[];
|
|
15
|
-
getSelectedConference(id: number, skipDetails?: boolean): Promise<Conference>;
|
|
15
|
+
getSelectedConference(id: number, skipDetails?: boolean, allDetails?: boolean): Promise<Conference>;
|
|
16
16
|
getLiveConference(): Promise<Conference>;
|
|
17
|
-
getCurrentConference(skipDetails?: boolean): Promise<Conference>;
|
|
17
|
+
getCurrentConference(skipDetails?: boolean, allDetails?: boolean): Promise<Conference>;
|
|
18
18
|
getRegisteredConferences(): Conference[];
|
|
19
19
|
updateConferencesAccess(userConferences: Conference[]): void;
|
|
20
20
|
}>;
|
|
@@ -3,9 +3,12 @@ import { findLast, find, get } 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
|
|
6
|
+
const conferenceAllDetailsQueryString = () => {
|
|
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,groups,days.groups,days.tracks.groups,template_config,ce_credit_config,custom1";
|
|
8
8
|
};
|
|
9
|
+
const conferenceBasicDetailsQueryString = () => {
|
|
10
|
+
return "days.tracks.presentations.presenters,presenters,affiliates,custom1";
|
|
11
|
+
};
|
|
9
12
|
export const useConferencesStore = defineStore("conferences", {
|
|
10
13
|
state: () => ({
|
|
11
14
|
conferenceList: [],
|
|
@@ -49,7 +52,7 @@ export const useConferencesStore = defineStore("conferences", {
|
|
|
49
52
|
});
|
|
50
53
|
return matchedConfs;
|
|
51
54
|
},
|
|
52
|
-
getSelectedConference(id, skipDetails) {
|
|
55
|
+
getSelectedConference(id, skipDetails, allDetails = true) {
|
|
53
56
|
return new Promise((resolve, reject) => {
|
|
54
57
|
if (skipDetails === true) {
|
|
55
58
|
const selConference = find(this.conferenceList, { id });
|
|
@@ -60,7 +63,9 @@ export const useConferencesStore = defineStore("conferences", {
|
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
const request = useApi();
|
|
63
|
-
request(
|
|
66
|
+
request(
|
|
67
|
+
`conferences/${id}?with=${allDetails ? conferenceAllDetailsQueryString() : conferenceBasicDetailsQueryString()}`
|
|
68
|
+
).then((response) => {
|
|
64
69
|
this.selectedConference = response.data;
|
|
65
70
|
resolve(this.selectedConference);
|
|
66
71
|
}).catch((error) => {
|
|
@@ -76,7 +81,7 @@ export const useConferencesStore = defineStore("conferences", {
|
|
|
76
81
|
resolve(this.liveConference);
|
|
77
82
|
}
|
|
78
83
|
} else {
|
|
79
|
-
|
|
84
|
+
const url = `conferences?filters[state]=live&page=1&pageSize=1&orderBy=start_date&orderDir=asc`;
|
|
80
85
|
const request = useApi();
|
|
81
86
|
request(url).then((response) => {
|
|
82
87
|
if (get(response, "data.length", 0) > 0) {
|
|
@@ -89,7 +94,7 @@ export const useConferencesStore = defineStore("conferences", {
|
|
|
89
94
|
}
|
|
90
95
|
});
|
|
91
96
|
},
|
|
92
|
-
getCurrentConference(skipDetails) {
|
|
97
|
+
getCurrentConference(skipDetails, allDetails = true) {
|
|
93
98
|
return new Promise((resolve, reject) => {
|
|
94
99
|
let conference;
|
|
95
100
|
const liveConference = this.conferenceList.find(
|
|
@@ -119,7 +124,7 @@ export const useConferencesStore = defineStore("conferences", {
|
|
|
119
124
|
} else {
|
|
120
125
|
const request = useApi();
|
|
121
126
|
request(
|
|
122
|
-
`conferences/${conference.id}?with=${
|
|
127
|
+
`conferences/${conference.id}?with=${allDetails ? conferenceAllDetailsQueryString() : conferenceBasicDetailsQueryString}`
|
|
123
128
|
).then((response) => {
|
|
124
129
|
const {
|
|
125
130
|
data: { template_config, ...data }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icvdeveloper/common-module",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@analytics/google-analytics": "^1.0.3",
|
|
27
27
|
"@nuxt/kit": "^3.8.0",
|
|
28
|
-
"@nuxtjs/tailwindcss": "
|
|
28
|
+
"@nuxtjs/tailwindcss": "6.12.0",
|
|
29
29
|
"@pinia/nuxt": "^0.3.1",
|
|
30
30
|
"@stripe/stripe-js": "^3.5.0",
|
|
31
31
|
"@ts-pro/vue-eternal-loading": "^1.3.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"eslint-config-prettier": "^8.5.0",
|
|
60
60
|
"nuxt": "^3.10.3",
|
|
61
61
|
"postcss-import": "^16.1.0",
|
|
62
|
-
"vitest": "^0.
|
|
62
|
+
"vitest": "^0.34.6"
|
|
63
63
|
},
|
|
64
64
|
"description": "## Development",
|
|
65
65
|
"repository": {
|