@paris-ias/list 1.0.163 → 1.0.165

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@paris-ias/list",
3
3
  "configKey": "list",
4
- "version": "1.0.163",
4
+ "version": "1.0.165",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -1,10 +1,13 @@
1
1
  <template>
2
2
  <v-row no-gutters>
3
- <slot />
3
+ {{ item }}
4
4
  </v-row>
5
5
  <v-divider />
6
6
  </template>
7
7
 
8
8
  <script setup>
9
- defineProps({ loading: { type: Boolean, default: false } })
9
+ defineProps({
10
+ loading: { type: Boolean, default: false },
11
+ item: { type: Object, required: true },
12
+ })
10
13
  </script>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <v-row class="my-2 highlight-on-hover" no-gutters>
3
+ <v-col cols="12" class="px-4">
4
+ <v-skeleton-loader v-if="isLoading" type="heading, text@6" />
5
+ <template v-else>
6
+ <div class="text-h5">{{ item.name }}</div>
7
+ <div v-if="item.summary" class="text-body-1 mt-1">
8
+ <MDC :value="item.summary" />
9
+ </div>
10
+ </template>
11
+ </v-col>
12
+ </v-row>
13
+ <v-divider />
14
+ </template>
15
+
16
+ <script setup>
17
+ import { computed } from "#imports"
18
+ import { useRootStore } from "../../stores/root"
19
+
20
+ const rootStore = useRootStore()
21
+ const props = defineProps({
22
+ item: { type: Object, required: true },
23
+ loading: { type: Boolean, default: false },
24
+ })
25
+
26
+ const isLoading = computed(() => rootStore.loading || props.loading)
27
+ </script>
28
+
29
+ <style></style>
@@ -0,0 +1,16 @@
1
+ <template>
2
+ <div>
3
+ {{ item.name }}
4
+ </div>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ const props = defineProps({
9
+ item: {
10
+ type: Object,
11
+ required: true,
12
+ },
13
+ })
14
+ </script>
15
+
16
+ <style></style>
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <v-row class="highlight-on-hover pa-3" no-gutters>
3
+ <v-col cols="12" class="px-6">
4
+ <v-skeleton-loader v-if="isLoading" type="heading, text@8, button" />
5
+ <template v-else>
6
+ <div class="text-h5">{{ item.name }}</div>
7
+ <div v-if="item.summary" class="mt-2">
8
+ <MDC :value="item.summary" />
9
+ </div>
10
+ </template>
11
+ </v-col>
12
+ </v-row>
13
+ <v-divider />
14
+ </template>
15
+
16
+ <script setup>
17
+ import { computed } from "#imports"
18
+ import { useRootStore } from "../../stores/root"
19
+
20
+ const rootStore = useRootStore()
21
+ const props = defineProps({
22
+ item: { type: Object, required: true },
23
+ loading: { type: Boolean, default: false },
24
+ })
25
+
26
+ const isLoading = computed(() => rootStore.loading || props.loading)
27
+ </script>
28
+
29
+ <style></style>
@@ -0,0 +1,22 @@
1
+ <template>
2
+ {{ item }}
3
+ </template>
4
+
5
+ <script setup>
6
+ import { useNuxtApp } from "#imports"
7
+
8
+ const { $stores } = useNuxtApp()
9
+ defineProps({
10
+ item: {
11
+ type: Object,
12
+ required: true,
13
+ },
14
+ loading: {
15
+ type: Boolean,
16
+ required: false,
17
+ default: false,
18
+ },
19
+ })
20
+
21
+ $stores.affiliations.loading = false
22
+ </script>
@@ -65,10 +65,11 @@ const getItems = (name) => {
65
65
  value: item,
66
66
  }))
67
67
  }
68
- if (
69
- messages.value[locale.value].list.filters[props.type][name] === undefined
70
- ) {
71
- console.log("name not found, no item for this filter: ", name)
68
+
69
+ if (!messages.value[locale.value].list.filters[props.type]?.[name]) {
70
+ console.log(
71
+ `translations missing for the filter ${name} of the type ${props.type}`
72
+ )
72
73
  return []
73
74
  }
74
75
  // TODO replace with package based values
@@ -1,25 +1,30 @@
1
- import { useRoute, useAsyncQuery, useI18n, useSetI18nParams } from "#imports";
1
+ import { useRoute, useI18n, useSetI18nParams, useNuxtApp } from "#imports";
2
2
  export const useFetchItem = () => {
3
3
  const fetchItem = async (payload) => {
4
4
  try {
5
5
  const { locale } = useI18n();
6
6
  const route = useRoute();
7
+ const { $apollo } = useNuxtApp();
8
+ console.log("query: ", payload.query);
9
+ console.log("key: ", payload.key);
7
10
  const variables = {
8
11
  itemId: route.params.slug?.toString().trim(),
9
12
  appId: "iea",
10
13
  lang: locale.value
11
14
  };
12
- const { data, error } = await useAsyncQuery(payload.query, variables);
13
- if (error.value) {
14
- console.error("GraphQL error:", error.value);
15
- throw error.value;
15
+ const apolloClient = $apollo?.clients?.default;
16
+ if (!apolloClient) {
17
+ throw new Error("Apollo client is not available");
16
18
  }
17
- const item = data?.value[payload.key];
19
+ console.log("variables: ", variables);
20
+ const { data } = await apolloClient.query({
21
+ query: payload.query,
22
+ variables
23
+ });
24
+ console.log("data: ", data);
25
+ const item = data?.[payload.key];
18
26
  if (!item) {
19
- throw createError({
20
- statusCode: 404,
21
- message: "Item not found in response"
22
- });
27
+ throw new Error("Item not found in response");
23
28
  }
24
29
  const setI18nParams = useSetI18nParams();
25
30
  if (!route.name.includes("people")) {
@@ -36,11 +41,9 @@ export const useFetchItem = () => {
36
41
  return item;
37
42
  } catch (error) {
38
43
  console.error("Error fetching item:", error);
39
- throw createError({
40
- statusCode: 404,
41
- message: "Item not found",
42
- cause: error
43
- });
44
+ throw new Error(
45
+ `Item not found: ${error instanceof Error ? error.message : String(error)}`
46
+ );
44
47
  }
45
48
  };
46
49
  return {
@@ -6,7 +6,7 @@ export declare const createDynamicStore: (storeName: string, moduleState: object
6
6
  numberOfPages: import("vue").Ref<number, number>;
7
7
  search: import("vue").Ref<string, string>;
8
8
  error: import("vue").Ref<string | null, string | null>;
9
- }, "error" | "search" | "loading" | "total" | "skip" | "page" | "numberOfPages">, Pick<{
9
+ }, "search" | "loading" | "total" | "skip" | "page" | "numberOfPages" | "error">, Pick<{
10
10
  loading: import("vue").Ref<boolean, boolean>;
11
11
  total: import("vue").Ref<number, number>;
12
12
  skip: import("vue").Ref<number, number>;
@@ -7,7 +7,6 @@
7
7
  "details-0": "Details",
8
8
  "document": "Documents",
9
9
  "events": {
10
- "key": "Events",
11
10
  "register": "Register to this event",
12
11
  "register-me": "Register",
13
12
  "see-more": "See more events"
@@ -19,16 +18,23 @@
19
18
  "inscription-gratuite-et-obligatoire": " Free and mandatory registration",
20
19
  "inscription-ouverte": "Registration Open",
21
20
  "items": {
22
- "all": "all | all | all",
23
- "activities": "activity | activity | activities",
24
21
  "about": "about | about | about",
22
+ "activities": "activity | activity | activities",
23
+ "affiliations": "affiliation | affiliation | affiliations",
24
+ "all": "all | all | all",
25
+ "app": "application | application | applications",
26
+ "disciplines": "discipline | discipline | disciplines",
25
27
  "events": "event | event | events",
26
28
  "fellow": "fellow | fellow | fellows",
27
29
  "fellowships": "fellowship | fellowship | fellowships",
30
+ "file": "document | document | documents",
31
+ "mailing": "mailing | mailing | mailings",
28
32
  "news": "news | news | news",
29
33
  "people": "one | person | people",
30
34
  "projects": "project | project | projects",
31
- "publications": "publication | publication | publications"
35
+ "publications": "publication | publication | publications",
36
+ "tags": "tag | tag | tags",
37
+ "user": "user | user | users"
32
38
  },
33
39
  "learn-more": "read more",
34
40
  "list": {
@@ -252,8 +258,14 @@
252
258
  "OTHERS": "Others"
253
259
  }
254
260
  },
255
- "affiliation": {
256
- "label": "Affiliations"
261
+ "affiliations": {
262
+ "label": "Affiliations",
263
+ "category": {
264
+ "MEMBER": "Members",
265
+ "SPONSOR": "Sponsors",
266
+ "PARTNER": "Partners",
267
+ "OTHER": "Others"
268
+ }
257
269
  },
258
270
  "disciplines": {
259
271
  "label": "Discipline"
@@ -26,7 +26,15 @@
26
26
  "news": "actualité | actualités | actualités",
27
27
  "people": "personne | personne | personnes",
28
28
  "projects": "projet | projet | projets",
29
- "publications": "publication | publications | publications"
29
+ "publications": "publication | publications | publications",
30
+ "activities": "activité | activité | activités",
31
+ "affiliations": "affiliation | affiliation | affiliations",
32
+ "app": "application | application | applications",
33
+ "disciplines": "discipline | discipline | disciplines",
34
+ "file": "document | document | documents",
35
+ "mailing": "mailing | mailing | mailings",
36
+ "tags": "tag | tag | tags",
37
+ "user": "utilisateur | utilisateur | utilisateurs"
30
38
  },
31
39
  "learn-more": "En savoir plus",
32
40
  "list": {
@@ -251,8 +259,14 @@
251
259
  "OTHERS": "Autres"
252
260
  }
253
261
  },
254
- "affiliation": {
255
- "label": "Affiliations"
262
+ "affiliations": {
263
+ "label": "Affiliations",
264
+ "category": {
265
+ "MEMBER": "Members",
266
+ "SPONSOR": "Sponsors",
267
+ "PARTNER": "Partners",
268
+ "OTHER": "Others"
269
+ }
256
270
  },
257
271
  "disciplines": {
258
272
  "label": "Discipline"
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "license": "AGPL-3.0-only",
3
3
  "main": "./dist/module.mjs",
4
- "version": "1.0.163",
4
+ "version": "1.0.165",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/IEA-Paris/list.git",
8
8
  "type": "git"
9
9
  },
10
10
  "dependencies": {
11
- "@paris-ias/trees": "^2.0.31"
11
+ "@paris-ias/trees": "^2.0.32"
12
12
  },
13
13
  "description": "Paris IAS List Module",
14
14
  "peerDependencies": {