@paris-ias/list 1.0.162 → 1.0.164

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.162",
4
+ "version": "1.0.164",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -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>
@@ -45,7 +45,9 @@
45
45
  </v-responsive>
46
46
  </v-expand-transition>
47
47
  <br />
48
+ <!-- TODO: cabler par la bonne url iea et l'injecter dynamiquement -->
48
49
  <v-btn
50
+ v-if="item.url && !item.url.startsWith('https://www.paris-iea.fr/fr')"
49
51
  variant="text"
50
52
  class="ml-n4"
51
53
  size="small"
@@ -75,6 +77,7 @@ const startDay = ref(
75
77
  const startTime = ref(detailedStart.hours)
76
78
  const detailedStop = getDetailedFormatedDate(props.item.stop, locale.value)
77
79
  const stopTime = ref(detailedStop.hours)
80
+ console.log("locale", props.item)
78
81
  </script>
79
82
 
80
83
  <style lang="scss" scoped></style>
@@ -66,7 +66,6 @@ const getItems = (name) => {
66
66
  }))
67
67
  }
68
68
  if (
69
- !messages.value[locale.value].list.filters[props.type] ||
70
69
  messages.value[locale.value].list.filters[props.type][name] === undefined
71
70
  ) {
72
71
  console.log("name not found, no item for this filter: ", name)
@@ -12,11 +12,12 @@
12
12
  :key="type"
13
13
  :feminine="type === 'people'"
14
14
  :type
15
- :open="$rootStore.results[type]?.total > 0 || open[type]"
15
+ :open="$rootStore.results[type]?.total > 0 ?? open[type]"
16
16
  @toggle="open[$event] = !open[$event]"
17
17
  >
18
+ {{ $rootStore.results[type]?.total }}
18
19
  <v-expand-transition class="results-container">
19
- <div v-show="open[type]">
20
+ <div v-show="$rootStore.results[type]?.total > 0 || open[type]">
20
21
  <ListAtomsResultsList :type />
21
22
  </div>
22
23
  </v-expand-transition>
@@ -67,7 +68,7 @@ const sortedModules = computed(() => {
67
68
  // Computed property to filter and sort modules based on selected categories
68
69
  const filteredSortedModules = computed(() => {
69
70
  return sortedModules.value.filter((type) =>
70
- selectedCategories.value.includes(type)
71
+ selectedCategories.value.includes(type),
71
72
  )
72
73
  })
73
74
 
@@ -78,7 +79,7 @@ const { data, pending, error, refresh } = await useAsyncQuery(
78
79
  {
79
80
  key: `search-${$rootStore.search}`, // Unique key for caching
80
81
  server: true, // Enable SSR
81
- }
82
+ },
82
83
  )
83
84
  if (error.value) {
84
85
  console.error("GraphQL query error: ", error.value)
@@ -90,7 +91,14 @@ if (error.value) {
90
91
  if (data.value) {
91
92
  console.log("Applying data to store directly [first load scenario]")
92
93
  $rootStore.applyListResult("all", data.value)
94
+ // Initialize open state for types with results
95
+ appConfig.list.modules.forEach((type) => {
96
+ if ($rootStore.results[type]?.total > 0) {
97
+ open.value[type] = true
98
+ }
99
+ })
93
100
  }
101
+
94
102
  const updateSearch = async (newSearch) => {
95
103
  console.log("update search")
96
104
  if (newSearch !== $rootStore.search) {
@@ -98,6 +106,12 @@ const updateSearch = async (newSearch) => {
98
106
  if (data.value) {
99
107
  console.log("Applying data to store directly [first load scenario]")
100
108
  $rootStore.applyListResult("all", data.value)
109
+ // Initialize open state for types with results
110
+ appConfig.list.modules.forEach((type) => {
111
+ if ($rootStore.results[type]?.total > 0) {
112
+ open.value[type] = true
113
+ }
114
+ })
101
115
  }
102
116
  }
103
117
  }
@@ -16,6 +16,21 @@
16
16
  :key="network"
17
17
  :value="network"
18
18
  >
19
+ <!-- TODO: Injecter dynamiquement l'url -->
20
+ <SocialShare
21
+ :key="network"
22
+ class="text-black"
23
+ :network="network"
24
+ :title="$t('share-this-on', { item: item.name })"
25
+ :aria-label="$t('share-on', { network: network })"
26
+ :image="item.image"
27
+ :url="'https://www.paris-iea.fr/fr' + route.fullPath"
28
+ >
29
+ <template #label>
30
+ {{ network }}
31
+ </template>
32
+ </SocialShare>
33
+
19
34
  <!-- <SocialShare
20
35
  :key="network"
21
36
  class="text-black"
@@ -36,11 +51,11 @@
36
51
  </template>
37
52
 
38
53
  <script setup>
39
- import { mergeProps } from "vue";
40
- import { useRoute } from "#imports";
54
+ import { mergeProps } from "vue"
55
+ import { useRoute } from "#imports"
41
56
  /* import config from "~/static.config"; */
42
57
 
43
- const route = useRoute();
58
+ const route = useRoute()
44
59
 
45
60
  const props = defineProps({
46
61
  networks: {
@@ -60,7 +75,7 @@ const props = defineProps({
60
75
  type: Object,
61
76
  required: true,
62
77
  },
63
- });
78
+ })
64
79
 
65
80
  /* console.log("PRPOS", props.item) */
66
81
  </script>
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.162",
4
+ "version": "1.0.164",
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.27"
11
+ "@paris-ias/trees": "^2.0.32"
12
12
  },
13
13
  "description": "Paris IAS List Module",
14
14
  "peerDependencies": {