@icvdeveloper/common-module 2.3.8 → 2.4.1
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 +4 -0
- package/dist/module.d.mts +2 -0
- package/dist/module.d.ts +2 -0
- package/dist/module.json +1 -1
- package/dist/runtime/components/agenda/components/PresentationLink.vue +4 -1
- package/dist/runtime/components/auth/LoginFullWidth.vue +19 -6
- package/dist/runtime/components/auth/PasswordReset.vue +27 -4
- package/dist/runtime/components/core/Navigation.vue +5 -4
- package/dist/runtime/composables/useLogin.mjs +4 -2
- package/dist/runtime/models/portal.d.ts +2 -0
- package/dist/runtime/plugin.mjs +1 -1
- package/dist/runtime/store/portal.mjs +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/module.d.mts
CHANGED
package/dist/module.d.ts
CHANGED
package/dist/module.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { toRefs, computed, inject } from "vue";
|
|
3
|
+
import { storeToRefs } from "pinia";
|
|
3
4
|
import { useAgenda } from "../../../composables/useAgenda";
|
|
4
5
|
import { useConferenceHelpers } from "../../../composables/useConferenceHelpers";
|
|
5
6
|
import { usePresentation } from "../../../composables/usePresentation";
|
|
@@ -9,6 +10,7 @@ import type {
|
|
|
9
10
|
Track,
|
|
10
11
|
TrackGroup,
|
|
11
12
|
} from "../../../models/conference";
|
|
13
|
+
import { usePortalStore } from "../../../store";
|
|
12
14
|
import InfoLink from "./InfoLink.vue";
|
|
13
15
|
import PlayIcon from "./PlayIcon.vue";
|
|
14
16
|
import Favorite from "./Favorite.vue";
|
|
@@ -31,9 +33,10 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
31
33
|
});
|
|
32
34
|
|
|
33
35
|
const { conference, track, presentation } = toRefs(props);
|
|
36
|
+
const { data:portal } = storeToRefs(usePortalStore());
|
|
34
37
|
|
|
35
38
|
const isActiveAgenda: boolean = inject('isActiveAgenda', false);
|
|
36
|
-
const isVirtual
|
|
39
|
+
const isVirtual = portal.value?.is_virtual_template || false;
|
|
37
40
|
|
|
38
41
|
// Methods
|
|
39
42
|
const { conferenceIsLiveOrMixed, conferenceIsArchived } =
|
|
@@ -4,6 +4,7 @@ import { storeToRefs } from "pinia";
|
|
|
4
4
|
import type { Conference } from "../../models/conference";
|
|
5
5
|
import { useLogin } from "../../composables/useLogin";
|
|
6
6
|
import { useTemplateConfigsStore } from "../../store";
|
|
7
|
+
import { usePortalStore } from "../../store";
|
|
7
8
|
|
|
8
9
|
interface Props {
|
|
9
10
|
title?: string | null;
|
|
@@ -17,11 +18,23 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
17
18
|
|
|
18
19
|
const { title, conference } = toRefs<Props>(props);
|
|
19
20
|
|
|
21
|
+
const { data:portal } = storeToRefs(usePortalStore());
|
|
20
22
|
const { globalConfigValue } = storeToRefs(useTemplateConfigsStore());
|
|
21
23
|
|
|
24
|
+
// emits
|
|
25
|
+
const emit = defineEmits<{
|
|
26
|
+
(event: "showReset"): void;
|
|
27
|
+
|
|
28
|
+
}>();
|
|
29
|
+
|
|
22
30
|
// Methods
|
|
23
|
-
const { loginError, handleLogin, email, password, tooManySessions
|
|
31
|
+
const { loginError, handleLogin, email, password, tooManySessions } =
|
|
24
32
|
useLogin(conference);
|
|
33
|
+
|
|
34
|
+
const showReset = () => {
|
|
35
|
+
emit("showReset");
|
|
36
|
+
};
|
|
37
|
+
|
|
25
38
|
</script>
|
|
26
39
|
|
|
27
40
|
<template>
|
|
@@ -45,15 +58,15 @@ const { loginError, handleLogin, email, password, tooManySessions, showReset } =
|
|
|
45
58
|
Invalid email or password.
|
|
46
59
|
<br>
|
|
47
60
|
<a
|
|
48
|
-
v-if="
|
|
49
|
-
|
|
61
|
+
v-if="portal.is_virtual_template || globalConfigValue('secure_site_access_enabled', false)"
|
|
62
|
+
class="cursor-pointer"
|
|
63
|
+
@click="showReset"
|
|
50
64
|
>
|
|
51
65
|
Forgot Your Password?
|
|
52
66
|
</a>
|
|
53
67
|
<a
|
|
54
|
-
v-
|
|
55
|
-
|
|
56
|
-
@click="showReset"
|
|
68
|
+
v-else
|
|
69
|
+
href="/login/email"
|
|
57
70
|
>
|
|
58
71
|
Forgot Your Password?
|
|
59
72
|
</a>
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { ref, toRefs } from "vue";
|
|
3
3
|
import { useAuthStore } from "../../store/auth";
|
|
4
|
+
import type { TextInputClassObj } from "../../@types/components";
|
|
5
|
+
import { useClassBinding } from "../../composables/useClassBinding";
|
|
4
6
|
|
|
5
7
|
interface Props {
|
|
6
8
|
isCentered?: boolean;
|
|
9
|
+
classObject?: TextInputClassObj;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
const props = withDefaults(defineProps<Props>(), {
|
|
10
13
|
isCentered: false,
|
|
14
|
+
classObject: () => {
|
|
15
|
+
return {
|
|
16
|
+
classObject: ref<TextInputClassObj>({
|
|
17
|
+
container: "",
|
|
18
|
+
}),
|
|
19
|
+
};
|
|
20
|
+
},
|
|
11
21
|
});
|
|
12
22
|
|
|
13
23
|
// data
|
|
14
24
|
const { isCentered } = toRefs(props);
|
|
25
|
+
const { classBinding } = useClassBinding();
|
|
26
|
+
|
|
15
27
|
const loading = ref<boolean>(false);
|
|
16
28
|
const email = ref<string>("");
|
|
17
29
|
const message = ref<null | string>(null);
|
|
@@ -25,11 +37,12 @@ const submitPasswordReset = () => {
|
|
|
25
37
|
errors.value = [];
|
|
26
38
|
passwordReset(email.value)
|
|
27
39
|
.then((response) => {
|
|
28
|
-
message.value = response.
|
|
40
|
+
message.value = response.message;
|
|
29
41
|
})
|
|
30
42
|
.catch((error) => {
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
console.log("error.response._data.errors", typeof(error.response?._data?.errors));
|
|
44
|
+
if (error.response.status === 401 && error.response?._data?.errors?.email) {
|
|
45
|
+
errors.value = error.response?._data?.errors?.email;
|
|
33
46
|
} else {
|
|
34
47
|
errors.value = ["Error requesting password reset."];
|
|
35
48
|
}
|
|
@@ -41,7 +54,10 @@ const submitPasswordReset = () => {
|
|
|
41
54
|
</script>
|
|
42
55
|
|
|
43
56
|
<template>
|
|
44
|
-
<div
|
|
57
|
+
<div
|
|
58
|
+
:class="isCentered ? 'w-full max-w-xs mx-auto text-center' : ''"
|
|
59
|
+
class="pt-8"
|
|
60
|
+
>
|
|
45
61
|
<div class="mb-4">
|
|
46
62
|
Enter your email address to reset your password.
|
|
47
63
|
</div>
|
|
@@ -62,6 +78,13 @@ const submitPasswordReset = () => {
|
|
|
62
78
|
v-model="email"
|
|
63
79
|
placeholder="Email"
|
|
64
80
|
type="email"
|
|
81
|
+
:class="
|
|
82
|
+
classBinding(
|
|
83
|
+
classObject,
|
|
84
|
+
'container',
|
|
85
|
+
'form-input contrast-border mb-2'
|
|
86
|
+
)
|
|
87
|
+
"
|
|
65
88
|
/>
|
|
66
89
|
<button
|
|
67
90
|
class="btn my-2"
|
|
@@ -9,6 +9,7 @@ import { useClassBinding } from '../../composables/useClassBinding';
|
|
|
9
9
|
import {
|
|
10
10
|
useTemplateConfigsStore,
|
|
11
11
|
useNavigationConfigStore,
|
|
12
|
+
usePortalStore,
|
|
12
13
|
useConferencesStore,
|
|
13
14
|
useAuthStore
|
|
14
15
|
} from '../../store';
|
|
@@ -28,7 +29,6 @@ import type { ContentData } from '../../models/vButton';
|
|
|
28
29
|
|
|
29
30
|
type Props = {
|
|
30
31
|
classObject?: NavigationClassObj;
|
|
31
|
-
isVirtual?: boolean;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const props = withDefaults(defineProps<Props>(), {
|
|
@@ -55,17 +55,18 @@ const props = withDefaults(defineProps<Props>(), {
|
|
|
55
55
|
profileImg: '',
|
|
56
56
|
loginListItem: '',
|
|
57
57
|
}
|
|
58
|
-
}
|
|
59
|
-
isVirtual: false
|
|
58
|
+
}
|
|
60
59
|
});
|
|
61
60
|
|
|
62
|
-
const { classObject
|
|
61
|
+
const { classObject } = toRefs(props);
|
|
63
62
|
const { user, isLoggedIn } = storeToRefs(useAuthStore());
|
|
63
|
+
const { data:portal } = storeToRefs(usePortalStore());
|
|
64
64
|
const { currentConference } = storeToRefs(useConferencesStore());
|
|
65
65
|
|
|
66
66
|
// data
|
|
67
67
|
const showMenu = ref<boolean>(false);
|
|
68
68
|
const profileImg = 'https://v3plus-production.s3.us-west-2.amazonaws.com/users/profile.png';
|
|
69
|
+
const isVirtual = portal.value?.is_virtual_template || false;
|
|
69
70
|
|
|
70
71
|
// methods
|
|
71
72
|
const { formatLink, isExternalLink } = useNavigation();
|
|
@@ -2,6 +2,7 @@ import { storeToRefs } from "pinia";
|
|
|
2
2
|
import { useRouter } from "vue-router";
|
|
3
3
|
import { ref } from "vue";
|
|
4
4
|
import {
|
|
5
|
+
usePortalStore,
|
|
5
6
|
useConferencesStore,
|
|
6
7
|
useAuthStore,
|
|
7
8
|
useTemplateConfigsStore
|
|
@@ -9,15 +10,16 @@ import {
|
|
|
9
10
|
import { useConferenceHelpers } from "./useConferenceHelpers.mjs";
|
|
10
11
|
export const useLogin = (conference) => {
|
|
11
12
|
const { login } = useAuthStore();
|
|
13
|
+
const { data: portal } = storeToRefs(usePortalStore());
|
|
12
14
|
const { currentConference } = storeToRefs(useConferencesStore());
|
|
13
|
-
const {
|
|
15
|
+
const { globalConfigValue } = storeToRefs(useTemplateConfigsStore());
|
|
14
16
|
const email = ref("");
|
|
15
17
|
const password = ref("");
|
|
16
18
|
const tooManySessions = ref(false);
|
|
17
19
|
const loginError = ref(false);
|
|
18
20
|
const router = useRouter();
|
|
19
21
|
const handleRedirect = () => {
|
|
20
|
-
if (
|
|
22
|
+
if (portal.value?.is_virtual_template) {
|
|
21
23
|
console.log("virtual template detected on login");
|
|
22
24
|
return;
|
|
23
25
|
}
|
package/dist/runtime/plugin.mjs
CHANGED
|
@@ -44,7 +44,7 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
44
44
|
NProgress.inc();
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
let isNEJM = portal.value.
|
|
47
|
+
let isNEJM = portal.value.is_nejm_template == true;
|
|
48
48
|
let skipCurrentConf = isNEJM && !isRedirectPage && !isStreamTest;
|
|
49
49
|
docTitle = portal.value.name;
|
|
50
50
|
if (!skipCurrentConf) {
|
|
@@ -20,6 +20,8 @@ export const usePortalStore = defineStore("portal", {
|
|
|
20
20
|
data: { navigation_config, template_config, ...data }
|
|
21
21
|
} = response;
|
|
22
22
|
this.data = data;
|
|
23
|
+
this.data.is_nejm_template = data.template_id == 7;
|
|
24
|
+
this.data.is_virtual_template = data.template_id == 5 || data.template_id == 8;
|
|
23
25
|
useTemplateConfigsStore().setPortalTemplateConfig(
|
|
24
26
|
template_config.config
|
|
25
27
|
);
|