@icvdeveloper/common-module 2.1.4 → 2.2.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.2.0 - 2024-10-03
11
+
10
12
  ## 2.1.4 - 2024-09-17
11
13
 
12
14
  ## 2.1.3 - 2024-09-09
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "v3plus-common-module",
3
3
  "configKey": "v3plusCommonModule",
4
- "version": "2.1.4"
4
+ "version": "2.2.0"
5
5
  }
@@ -59,7 +59,7 @@ const { getPresentersLabel, getSortedPresenters } = usePresenters(conference);
59
59
 
60
60
  const { classBinding } = useClassBinding();
61
61
 
62
- const isExpanded: Ref<boolean> = inject('isExpanded', ref<boolean>(false));
62
+ const isExpanded: Ref<boolean> = inject('isExpanded', ref<boolean>(true));
63
63
 
64
64
  // data
65
65
  const expandedPres = ref<number>(0);
@@ -3,7 +3,7 @@ import { useTemplateConfigsStore } from "../store/templateConfigs.mjs";
3
3
  export const useAuth = () => {
4
4
  const { globalConfigValue } = useTemplateConfigsStore();
5
5
  const isLoginDisabled = computed(() => {
6
- return globalConfigValue("login_disabled") || globalConfigValue("login_process") === "disabled";
6
+ return globalConfigValue("login_process") === "disabled" || globalConfigValue("login_process") === "ucc";
7
7
  });
8
8
  return {
9
9
  isLoginDisabled
@@ -19,7 +19,7 @@ export default defineNuxtPlugin((nuxtApp) => {
19
19
  apiUrl
20
20
  });
21
21
  nuxtApp.$pinia.use(piniaPluginPersistedstate);
22
- router.beforeEach(async (to, from) => {
22
+ router.beforeEach(async (to, from, next) => {
23
23
  NProgress.start();
24
24
  const portalStore = usePortalStore();
25
25
  const conferencesStore = useConferencesStore();
@@ -50,6 +50,38 @@ export default defineNuxtPlugin((nuxtApp) => {
50
50
  await conferencesStore.getCurrentConference(true).then(() => NProgress.inc())
51
51
  ]);
52
52
  }
53
+ if (routeName.includes("events-id") && to.params.id == "redirect") {
54
+ let matchedConfs = conferencesStore.conferenceList;
55
+ if (to.query.custom1) {
56
+ matchedConfs = conferencesStore.searchConferenceAffiliatesCustom1(to.query.custom1);
57
+ }
58
+ if (matchedConfs.length > 0 && to.query.state) {
59
+ if (to.query.state == "upcoming") {
60
+ matchedConfs = matchedConfs.filter(function(conf) {
61
+ return conf.state == "upcoming" || conf.state == "live" || conf.state == "mixed";
62
+ });
63
+ } else {
64
+ matchedConfs = matchedConfs.filter(function(conf) {
65
+ return conf.state == to.query.state;
66
+ });
67
+ }
68
+ }
69
+ if (matchedConfs.length > 0) {
70
+ if (to.query.orderdir == "asc") {
71
+ matchedConfs.sort(function(a, b) {
72
+ return a.start_date < b.start_date ? -1 : b.start_date < a.start_date ? 1 : 0;
73
+ });
74
+ } else {
75
+ matchedConfs.sort(function(a, b) {
76
+ return a.start_date > b.start_date ? -1 : b.start_date > a.start_date ? 1 : 0;
77
+ });
78
+ }
79
+ const eventPathPrefix = to.path.split("/")[1];
80
+ next("/" + eventPathPrefix + "/" + matchedConfs[0].id);
81
+ } else {
82
+ next("/");
83
+ }
84
+ }
53
85
  const routeParamId = parseInt(to.params.id);
54
86
  if (routeName.includes("events-id") && routeParamId) {
55
87
  await conferencesStore.getSelectedConference(routeParamId, false).then(() => {
@@ -118,6 +150,7 @@ export default defineNuxtPlugin((nuxtApp) => {
118
150
  twitterDescription: metaDesc,
119
151
  twitterImage: socialImage
120
152
  });
153
+ next();
121
154
  });
122
155
  router.afterEach(() => {
123
156
  NProgress.done();
@@ -10,6 +10,7 @@ export declare const useConferencesStore: import("pinia").StoreDefinition<"confe
10
10
  pastEvents: (state: ConferencesState) => Conference[];
11
11
  }, {
12
12
  getConferences(): Promise<Conference[]>;
13
+ searchConferenceAffiliatesCustom1(code: string): Conference[];
13
14
  getSelectedConference(id: number, skipDetails?: boolean): Promise<Conference>;
14
15
  getCurrentConference(skipDetails?: boolean): Promise<Conference>;
15
16
  getRegisteredConferences(): Conference[];
@@ -1,5 +1,5 @@
1
1
  import { defineStore } from "pinia";
2
- import { findLast, find } from "lodash-es";
2
+ 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";
@@ -39,6 +39,15 @@ export const useConferencesStore = defineStore("conferences", {
39
39
  });
40
40
  });
41
41
  },
42
+ searchConferenceAffiliatesCustom1(code) {
43
+ const matchedConfs = this.conferenceList.filter(function(conf) {
44
+ const custom1Affiliates = get(conf, "affiliates", []).filter(function(aff) {
45
+ return aff.role == "custom1" && aff.code == code;
46
+ });
47
+ return custom1Affiliates.length > 0;
48
+ });
49
+ return matchedConfs;
50
+ },
42
51
  getSelectedConference(id, skipDetails) {
43
52
  return new Promise((resolve, reject) => {
44
53
  if (skipDetails === true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icvdeveloper/common-module",
3
- "version": "2.1.4",
3
+ "version": "2.2.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {