@paris-ias/list 1.0.165 → 1.0.166
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 +1 -1
- package/dist/runtime/components/events/Badges.vue +1 -1
- package/dist/runtime/components/events/DenseItem.vue +29 -3
- package/dist/runtime/components/events/RowsItem.vue +1 -5
- package/dist/runtime/components/fellowships/DenseItem.vue +12 -2
- package/dist/runtime/components/fellowships/RowsItem.vue +46 -33
- package/dist/runtime/components/list/organisms/List.vue +1 -1
- package/dist/runtime/components/news/DenseItem.vue +2 -2
- package/dist/runtime/components/projects/DenseItem.vue +12 -13
- package/dist/runtime/components/projects/RowsItem.vue +1 -1
- package/dist/runtime/components/projects/View.vue +9 -7
- package/dist/runtime/components/publications/DenseItem.vue +7 -11
- package/dist/runtime/components/publications/RowsItem.vue +71 -69
- package/dist/runtime/composables/useFetchItem.d.ts +9 -0
- package/dist/runtime/composables/useFetchItem.js +38 -0
- package/package.json +2 -2
package/dist/module.json
CHANGED
|
@@ -22,7 +22,14 @@
|
|
|
22
22
|
</v-col>
|
|
23
23
|
|
|
24
24
|
<v-col align-self="start" class="pl-2">
|
|
25
|
+
<v-skeleton-loader
|
|
26
|
+
v-if="isLoading"
|
|
27
|
+
type="chip"
|
|
28
|
+
class="mr-3"
|
|
29
|
+
width="120"
|
|
30
|
+
/>
|
|
25
31
|
<v-chip
|
|
32
|
+
v-else
|
|
26
33
|
class="mr-3"
|
|
27
34
|
color="black"
|
|
28
35
|
size="small"
|
|
@@ -32,7 +39,13 @@
|
|
|
32
39
|
>
|
|
33
40
|
{{ $t("list.filters.events.category." + item.category) }}
|
|
34
41
|
</v-chip>
|
|
35
|
-
<
|
|
42
|
+
<v-skeleton-loader
|
|
43
|
+
v-if="isLoading && smAndDown"
|
|
44
|
+
type="text"
|
|
45
|
+
width="90"
|
|
46
|
+
class="d-inline-block"
|
|
47
|
+
/>
|
|
48
|
+
<span v-else-if="smAndDown" class="text-overline">
|
|
36
49
|
{{
|
|
37
50
|
new Date(item.start).toLocaleDateString(locale, {
|
|
38
51
|
year: "numeric",
|
|
@@ -42,7 +55,15 @@
|
|
|
42
55
|
}}
|
|
43
56
|
</span>
|
|
44
57
|
|
|
58
|
+
<v-skeleton-loader
|
|
59
|
+
v-if="isLoading"
|
|
60
|
+
type="heading"
|
|
61
|
+
width="80%"
|
|
62
|
+
class="mt-2"
|
|
63
|
+
/>
|
|
64
|
+
|
|
45
65
|
<div
|
|
66
|
+
v-else
|
|
46
67
|
class="text-h5 dense paragraph mt-2"
|
|
47
68
|
v-html="
|
|
48
69
|
$rootStore.search.length
|
|
@@ -50,7 +71,9 @@
|
|
|
50
71
|
: item.name
|
|
51
72
|
"
|
|
52
73
|
/>
|
|
74
|
+
<v-skeleton-loader v-if="isLoading" type="text@3" class="mt-2" />
|
|
53
75
|
<MDC
|
|
76
|
+
v-else
|
|
54
77
|
class="text-body-1 font-weight-light paragraph"
|
|
55
78
|
:value="`${highlightAndTruncate(
|
|
56
79
|
85,
|
|
@@ -61,7 +84,10 @@
|
|
|
61
84
|
</v-col>
|
|
62
85
|
|
|
63
86
|
<v-col align-self="center" cols="auto">
|
|
64
|
-
<
|
|
87
|
+
<v-skeleton-loader v-if="isLoading" type="button" />
|
|
88
|
+
<div v-else>
|
|
89
|
+
<EventsBadges :item />
|
|
90
|
+
</div>
|
|
65
91
|
</v-col>
|
|
66
92
|
</v-row>
|
|
67
93
|
</template>
|
|
@@ -92,5 +118,5 @@ const props = defineProps({
|
|
|
92
118
|
},
|
|
93
119
|
})
|
|
94
120
|
|
|
95
|
-
const isLoading = computed(() => props.loading)
|
|
121
|
+
const isLoading = computed(() => rootStore.loading || props.loading)
|
|
96
122
|
</script>
|
|
@@ -62,11 +62,7 @@
|
|
|
62
62
|
<v-col cols="12">
|
|
63
63
|
<v-skeleton-loader
|
|
64
64
|
v-if="isLoading"
|
|
65
|
-
:type="
|
|
66
|
-
['article, heading, text, heading, text, button, button'][
|
|
67
|
-
['md'].indexOf(name || 'md')
|
|
68
|
-
]
|
|
69
|
-
"
|
|
65
|
+
:type="['button'][['md'].indexOf(name || 'md')]"
|
|
70
66
|
/>
|
|
71
67
|
|
|
72
68
|
<div v-else>
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-row v-ripple no-gutters class="cursor-pointer highlight-on-hover">
|
|
3
3
|
<v-col align-self="center" cols="8" class="text-h5 dense">
|
|
4
|
-
<v-skeleton-loader
|
|
4
|
+
<v-skeleton-loader
|
|
5
|
+
v-if="isLoading"
|
|
6
|
+
type="heading"
|
|
7
|
+
width="75%"
|
|
8
|
+
class="mb-2"
|
|
9
|
+
/>
|
|
5
10
|
<div
|
|
6
11
|
v-else
|
|
7
12
|
v-html="
|
|
@@ -13,7 +18,12 @@
|
|
|
13
18
|
<FellowshipsBadges :item="item" />
|
|
14
19
|
</v-col>
|
|
15
20
|
<v-col align-self="center" cols="4">
|
|
16
|
-
<v-skeleton-loader
|
|
21
|
+
<v-skeleton-loader
|
|
22
|
+
v-if="isLoading"
|
|
23
|
+
type="chip"
|
|
24
|
+
width="260"
|
|
25
|
+
class="mt-2"
|
|
26
|
+
/>
|
|
17
27
|
<MiscMoleculesChipContainer
|
|
18
28
|
v-else
|
|
19
29
|
:items="[
|
|
@@ -1,38 +1,51 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
2
|
+
<v-row v-ripple no-gutters class="cursor-pointer highlight-on-hover my-2">
|
|
3
|
+
<v-col cols="12" class="w-100">
|
|
4
|
+
<div v-ripple class="border-thin pa-6">
|
|
5
|
+
<template v-if="isLoading">
|
|
6
|
+
<v-skeleton-loader type="chip@2" class="mb-2" />
|
|
7
|
+
<v-skeleton-loader type="heading" width="70%" class="mt-4" />
|
|
8
|
+
<v-skeleton-loader type="text@4" class="mt-2 w-100" />
|
|
9
|
+
|
|
10
|
+
<v-skeleton-loader type="chip" class="mt-4" width="260" />
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<template v-else>
|
|
14
|
+
<FellowshipsBadges :item />
|
|
15
|
+
|
|
16
|
+
<div class="text-h4 text-black text-wrap mt-4 pb-4">
|
|
17
|
+
{{ item.name }}
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div
|
|
21
|
+
v-if="item.summary"
|
|
22
|
+
class="text-wrap clamped-text d-flex"
|
|
23
|
+
:style="
|
|
24
|
+
'-webkit-line-clamp:' +
|
|
25
|
+
[5, 5, 4, 8, 10, 11][
|
|
26
|
+
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
|
|
27
|
+
]
|
|
28
|
+
"
|
|
29
|
+
>
|
|
30
|
+
<MDC :value="item.summary" />
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<MiscMoleculesChipContainer
|
|
34
|
+
:items="[
|
|
35
|
+
$t(
|
|
36
|
+
'list.filters.fellowships.fellowshipType.' +
|
|
37
|
+
item.fellowshipType,
|
|
38
|
+
),
|
|
39
|
+
...(item?.disciplines?.length
|
|
40
|
+
? item.disciplines.map((d) => d.name)
|
|
41
|
+
: []),
|
|
42
|
+
]"
|
|
43
|
+
class="mt-4"
|
|
44
|
+
/>
|
|
45
|
+
</template>
|
|
22
46
|
</div>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
v-else
|
|
26
|
-
:items="[
|
|
27
|
-
$t('list.filters.fellowships.fellowshipType.' + item.fellowshipType),
|
|
28
|
-
...(props.item && props.item.disciplines
|
|
29
|
-
? props.item.disciplines.map((discipline) => discipline.name)
|
|
30
|
-
: []),
|
|
31
|
-
]"
|
|
32
|
-
class="mt-2"
|
|
33
|
-
/>
|
|
34
|
-
</div>
|
|
35
|
-
</v-col>
|
|
47
|
+
</v-col>
|
|
48
|
+
</v-row>
|
|
36
49
|
</template>
|
|
37
50
|
|
|
38
51
|
<script setup>
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
? highlightAndTruncate(
|
|
41
41
|
300,
|
|
42
42
|
item.name,
|
|
43
|
-
$rootStore.search.split(' ')
|
|
43
|
+
$rootStore.search.split(' '),
|
|
44
44
|
)
|
|
45
45
|
: item.name
|
|
46
46
|
"
|
|
@@ -84,5 +84,5 @@ const eventCategory = computed(() => {
|
|
|
84
84
|
}
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
-
const isLoading = computed(() => props.loading)
|
|
87
|
+
const isLoading = computed(() => rootStore.loading || props.loading)
|
|
88
88
|
</script>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/>
|
|
13
13
|
</v-col>
|
|
14
14
|
<v-col align-self="center" class="text-h5 dense pl-2">
|
|
15
|
-
<v-skeleton-loader v-if="isLoading" type="heading" />
|
|
15
|
+
<v-skeleton-loader v-if="isLoading" type="heading" width="50%" />
|
|
16
16
|
<span
|
|
17
17
|
v-else
|
|
18
18
|
v-html="
|
|
@@ -21,23 +21,29 @@
|
|
|
21
21
|
: item.name
|
|
22
22
|
"
|
|
23
23
|
/>
|
|
24
|
-
<v-skeleton-loader
|
|
24
|
+
<!-- <v-skeleton-loader
|
|
25
25
|
v-if="isLoading"
|
|
26
26
|
:type="
|
|
27
27
|
['chip', 'chip@2', 'chip@3', 'chip@4', 'chip@4', 'chip@4'][
|
|
28
28
|
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
|
|
29
29
|
]
|
|
30
30
|
"
|
|
31
|
+
/> -->
|
|
32
|
+
<MiscMoleculesChipContainer
|
|
33
|
+
v-if="item.tags"
|
|
34
|
+
:items="item.tags || []"
|
|
35
|
+
size="small"
|
|
31
36
|
/>
|
|
32
|
-
|
|
37
|
+
|
|
38
|
+
<v-skeleton-loader v-if="isLoading" type="text@2" class="mt-3" />
|
|
33
39
|
|
|
34
40
|
<MDC
|
|
35
|
-
v-if="item.summary"
|
|
41
|
+
v-else-if="item.summary"
|
|
36
42
|
class="text-caption font-weight-light paragraph"
|
|
37
43
|
:value="`${highlightAndTruncate(
|
|
38
44
|
150,
|
|
39
45
|
item.summary,
|
|
40
|
-
rootStore.search.split(' ')
|
|
46
|
+
rootStore.search.split(' '),
|
|
41
47
|
)}`"
|
|
42
48
|
/>
|
|
43
49
|
</v-col>
|
|
@@ -70,13 +76,6 @@ const props = defineProps({
|
|
|
70
76
|
default: false,
|
|
71
77
|
},
|
|
72
78
|
})
|
|
73
|
-
const eventCategory = computed(() => {
|
|
74
|
-
if (props.item.category) {
|
|
75
|
-
return "list.filters.news.category." + props.item.category
|
|
76
|
-
} else {
|
|
77
|
-
return "list.filters.news.category.others"
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
79
|
|
|
81
|
-
const isLoading = computed(() => props.loading)
|
|
80
|
+
const isLoading = computed(() => rootStore.loading || props.loading)
|
|
82
81
|
</script>
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
v-else
|
|
12
12
|
contain
|
|
13
13
|
:loading="loading"
|
|
14
|
-
:src="item.image
|
|
14
|
+
:src="item && item.image ? item.image.url : '/default.png'"
|
|
15
15
|
:ratio="1 / 1"
|
|
16
16
|
/>
|
|
17
17
|
</v-col>
|
|
@@ -31,7 +31,10 @@
|
|
|
31
31
|
/>
|
|
32
32
|
|
|
33
33
|
<div v-else class="d-flex align-center flex-column mt-12">
|
|
34
|
-
<div
|
|
34
|
+
<div
|
|
35
|
+
v-if="item && item.name"
|
|
36
|
+
class="d-flex text-center text-wrap text-h3 text-black"
|
|
37
|
+
>
|
|
35
38
|
{{ item.name }}
|
|
36
39
|
</div>
|
|
37
40
|
<v-divider width="154px" class="mb-1 mt-6" />
|
|
@@ -40,7 +43,7 @@
|
|
|
40
43
|
v-if="!loading"
|
|
41
44
|
class="d-flex text-center text-wrap text-h5 text-black mt-6"
|
|
42
45
|
>
|
|
43
|
-
<MDC v-if="item.subtitle" :value="item.subtitle" />
|
|
46
|
+
<MDC v-if="item && item.subtitle" :value="item.subtitle" />
|
|
44
47
|
</div>
|
|
45
48
|
<MiscMoleculesChipContainer
|
|
46
49
|
v-if="item && item.tags"
|
|
@@ -51,7 +54,7 @@
|
|
|
51
54
|
<MiscAtomsShareMenu :item class="mt-6" />
|
|
52
55
|
</v-btn-toggle>
|
|
53
56
|
<v-btn
|
|
54
|
-
v-if="item.url"
|
|
57
|
+
v-if="item && item.url"
|
|
55
58
|
class="my-6 d-flex"
|
|
56
59
|
variant="outlined"
|
|
57
60
|
:href="item.url"
|
|
@@ -77,7 +80,7 @@
|
|
|
77
80
|
]
|
|
78
81
|
"
|
|
79
82
|
/>
|
|
80
|
-
<div v-if="item.description" class="mt-md-n2 mx-10 mx-md-0">
|
|
83
|
+
<div v-if="item && item.description" class="mt-md-n2 mx-10 mx-md-0">
|
|
81
84
|
<MDC :value="item.description" />
|
|
82
85
|
</div>
|
|
83
86
|
</v-col>
|
|
@@ -124,8 +127,7 @@ const props = defineProps({
|
|
|
124
127
|
loading: {
|
|
125
128
|
type: Boolean,
|
|
126
129
|
required: false,
|
|
127
|
-
default: false,
|
|
128
130
|
},
|
|
129
131
|
})
|
|
130
|
-
|
|
132
|
+
console.log("project view props", props.loading)
|
|
131
133
|
</script>
|
|
@@ -13,14 +13,7 @@
|
|
|
13
13
|
</v-col>
|
|
14
14
|
<v-col class="pl-2">
|
|
15
15
|
<div class="inline-flex flex-row flex-wrap">
|
|
16
|
-
<v-skeleton-loader
|
|
17
|
-
v-if="isLoading"
|
|
18
|
-
:type="
|
|
19
|
-
['chip', 'chip@2', 'chip@3', 'chip@4', 'chip@4', 'chip@4'][
|
|
20
|
-
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
|
|
21
|
-
]
|
|
22
|
-
"
|
|
23
|
-
/>
|
|
16
|
+
<v-skeleton-loader v-if="isLoading" :type="heading" />
|
|
24
17
|
|
|
25
18
|
<template v-else>
|
|
26
19
|
<v-chip
|
|
@@ -55,17 +48,20 @@
|
|
|
55
48
|
? highlightAndTruncate(
|
|
56
49
|
300,
|
|
57
50
|
item.name,
|
|
58
|
-
$rootStore.search.split(' ')
|
|
51
|
+
$rootStore.search.split(' '),
|
|
59
52
|
)
|
|
60
53
|
: item.name
|
|
61
54
|
"
|
|
62
55
|
/>
|
|
56
|
+
|
|
57
|
+
<v-skeleton-loader v-if="isLoading" type="text@3" class="mt-2" />
|
|
63
58
|
<MDC
|
|
59
|
+
v-else
|
|
64
60
|
class="text-body-1 font-weight-light paragraph"
|
|
65
61
|
:value="`${highlightAndTruncate(
|
|
66
62
|
150,
|
|
67
63
|
item.summary,
|
|
68
|
-
rootStore.search.split(' ')
|
|
64
|
+
rootStore.search.split(' '),
|
|
69
65
|
)}`"
|
|
70
66
|
/>
|
|
71
67
|
</div> </v-col
|
|
@@ -112,5 +108,5 @@ const eventType = computed(() => {
|
|
|
112
108
|
}
|
|
113
109
|
})
|
|
114
110
|
|
|
115
|
-
const isLoading = computed(() => props.loading)
|
|
111
|
+
const isLoading = computed(() => rootStore.loading || props.loading)
|
|
116
112
|
</script>
|
|
@@ -1,75 +1,77 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<v-
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
</v-col>
|
|
10
|
-
<v-col
|
|
11
|
-
v-ripple
|
|
12
|
-
cols="12"
|
|
13
|
-
sm="6"
|
|
14
|
-
md="8"
|
|
15
|
-
lg="9"
|
|
16
|
-
xl="10"
|
|
17
|
-
class="px-6 cursor-pointer"
|
|
18
|
-
>
|
|
19
|
-
<div>
|
|
20
|
-
<v-skeleton-loader
|
|
21
|
-
v-if="isLoading"
|
|
22
|
-
type="heading,ossein,text@8,ossein,button,button"
|
|
2
|
+
<v-row v-ripple no-gutters class="cursor-pointer highlight-on-hover my-2">
|
|
3
|
+
<v-col v-ripple cols="12" sm="6" md="4" lg="3" xl="2">
|
|
4
|
+
<MiscAtomsImageContainer
|
|
5
|
+
contain
|
|
6
|
+
:src="item.image.url ? item.image : '/default.png'"
|
|
7
|
+
:loading="isLoading"
|
|
8
|
+
:ratio="1 / 1"
|
|
23
9
|
/>
|
|
10
|
+
</v-col>
|
|
11
|
+
<v-col
|
|
12
|
+
v-ripple
|
|
13
|
+
cols="12"
|
|
14
|
+
sm="6"
|
|
15
|
+
md="8"
|
|
16
|
+
lg="9"
|
|
17
|
+
xl="10"
|
|
18
|
+
class="px-6 cursor-pointer"
|
|
19
|
+
>
|
|
20
|
+
<div>
|
|
21
|
+
<v-skeleton-loader
|
|
22
|
+
v-if="isLoading"
|
|
23
|
+
type="heading,ossein,text@8,ossein,button,button"
|
|
24
|
+
/>
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
26
|
+
<template v-else>
|
|
27
|
+
<div v-if="item.type" class="text-overline">{{ $t(item.type) }}</div>
|
|
28
|
+
<div class="text-h5 text-sm-h3 text-md-h4 text-md-h4 my-6">
|
|
29
|
+
{{ item.name }}
|
|
30
|
+
</div>
|
|
31
|
+
<div
|
|
32
|
+
v-if="item.summary"
|
|
33
|
+
class="text-wrap clamped-text"
|
|
34
|
+
:style="
|
|
35
|
+
'-webkit-line-clamp:' +
|
|
36
|
+
[5, 5, 5, 10, 12, 14][
|
|
37
|
+
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
|
|
38
|
+
]
|
|
39
|
+
"
|
|
40
|
+
>
|
|
41
|
+
<MDC :value="item.summary" />
|
|
42
|
+
</div>
|
|
43
|
+
<v-btn
|
|
44
|
+
class="mt-4"
|
|
45
|
+
variant="outlined"
|
|
46
|
+
tile
|
|
47
|
+
:size="
|
|
48
|
+
['small', 'small', 'small', 'default', 'default', 'large'][
|
|
49
|
+
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
|
|
50
|
+
]
|
|
51
|
+
"
|
|
52
|
+
>
|
|
53
|
+
{{ $t("read-more") }}
|
|
54
|
+
</v-btn>
|
|
55
|
+
<v-btn
|
|
56
|
+
v-if="item.url"
|
|
57
|
+
variant="outlined"
|
|
58
|
+
tile
|
|
59
|
+
target="_blank"
|
|
60
|
+
:href="item.url"
|
|
61
|
+
class="mt-4 ml-4"
|
|
62
|
+
prepend-icon="mdi-web"
|
|
63
|
+
:size="
|
|
64
|
+
['small', 'small', 'small', 'default', 'default', 'large'][
|
|
65
|
+
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].indexOf(name || 'md')
|
|
66
|
+
]
|
|
67
|
+
"
|
|
68
|
+
>
|
|
69
|
+
{{ $t("visit-the-publications-website") }}
|
|
70
|
+
</v-btn>
|
|
71
|
+
</template>
|
|
72
|
+
</div>
|
|
73
|
+
</v-col></v-row
|
|
74
|
+
>
|
|
73
75
|
<v-divider />
|
|
74
76
|
</template>
|
|
75
77
|
|
|
@@ -4,3 +4,12 @@ export declare const useFetchItem: () => {
|
|
|
4
4
|
key: string;
|
|
5
5
|
}) => Promise<T>;
|
|
6
6
|
};
|
|
7
|
+
type FetchItemPayload = {
|
|
8
|
+
query: any;
|
|
9
|
+
key: string;
|
|
10
|
+
variables?: Record<string, any>;
|
|
11
|
+
};
|
|
12
|
+
export declare const useFetchItem2: () => {
|
|
13
|
+
fetchItem: <T>({ query, key, variables, }: FetchItemPayload) => Promise<T>;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -50,3 +50,41 @@ export const useFetchItem = () => {
|
|
|
50
50
|
fetchItem
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
+
export const useFetchItem2 = () => {
|
|
54
|
+
const fetchItem = async ({
|
|
55
|
+
query,
|
|
56
|
+
key,
|
|
57
|
+
variables
|
|
58
|
+
}) => {
|
|
59
|
+
try {
|
|
60
|
+
const { $apollo } = useNuxtApp();
|
|
61
|
+
const route = useRoute();
|
|
62
|
+
const apolloClient = $apollo?.clients?.default;
|
|
63
|
+
if (!apolloClient) throw new Error("Apollo client is not available");
|
|
64
|
+
const { data } = await apolloClient.query({
|
|
65
|
+
query,
|
|
66
|
+
variables,
|
|
67
|
+
fetchPolicy: "network-only"
|
|
68
|
+
});
|
|
69
|
+
const item = data?.[key];
|
|
70
|
+
if (!item) throw new Error("Item not found in response");
|
|
71
|
+
const setI18nParams = useSetI18nParams();
|
|
72
|
+
if (!String(route.name ?? "").includes("people")) {
|
|
73
|
+
setI18nParams({
|
|
74
|
+
en: { slug: item.slug.en },
|
|
75
|
+
fr: { slug: item.slug.fr }
|
|
76
|
+
});
|
|
77
|
+
} else {
|
|
78
|
+
setI18nParams({
|
|
79
|
+
en: { slug: item.slug },
|
|
80
|
+
fr: { slug: item.slug }
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return item;
|
|
84
|
+
} catch (error) {
|
|
85
|
+
console.error("Error fetching item:", error);
|
|
86
|
+
throw error instanceof Error ? error : new Error(String(error));
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return { fetchItem };
|
|
90
|
+
};
|
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.
|
|
4
|
+
"version": "1.0.166",
|
|
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.
|
|
11
|
+
"@paris-ias/trees": "^2.0.34"
|
|
12
12
|
},
|
|
13
13
|
"description": "Paris IAS List Module",
|
|
14
14
|
"peerDependencies": {
|