@paris-ias/list 1.0.107 → 1.0.108

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.107",
4
+ "version": "1.0.108",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "3.5.0"
@@ -75,6 +75,7 @@
75
75
  import { useDebounceFn } from "@vueuse/core";
76
76
  import { useRootStore } from "../../../stores/root";
77
77
  import { computed, useI18n, ref } from "#imports";
78
+ import { capitalize } from "../../../composables/useUtils";
78
79
  const { locale, t } = useI18n();
79
80
  const rootStore = useRootStore();
80
81
  const emit = defineEmits(["filter-change"]);
@@ -51,14 +51,14 @@
51
51
  <v-card min-width="200">
52
52
  <v-list density="compact">
53
53
  <v-list-item
54
- v-for="(option, index) in filterOptions"
54
+ v-for="option in filterOptions"
55
55
  :key="option.value"
56
56
  @click="toggleFilter(option)"
57
57
  >
58
58
  <template #prepend>
59
59
  <v-checkbox
60
60
  hide-details
61
- :model-value="categories.includes(index)"
61
+ :model-value="categories.includes(option.value)"
62
62
  @update:model-value="toggleFilter(option)"
63
63
  />
64
64
  </template>
@@ -77,6 +77,7 @@ import { useRootStore } from "../../../stores/root";
77
77
  import { computed, useI18n, ref } from "#imports";
78
78
  const { locale, t } = useI18n();
79
79
  const rootStore = useRootStore();
80
+ const capitalize = (str) => str.charAt(0).toUpperCase() + str.slice(1);
80
81
  const emit = defineEmits(["filter-change"]);
81
82
  const props = defineProps({
82
83
  type: {
@@ -102,15 +103,17 @@ const filterOptions = [
102
103
  { value: "projects", label: capitalize(t("items.projects", 2)) }
103
104
  ];
104
105
  const toggleFilter = (option) => {
105
- const index = props.categories.indexOf(option.value);
106
+ const currentCategories = [...props.categories];
107
+ const index = currentCategories.indexOf(option.value);
106
108
  if (index > -1) {
107
- props.categories.splice(index, 1);
109
+ currentCategories.splice(index, 1);
108
110
  } else {
109
- props.categories.push(option.value);
111
+ currentCategories.push(option.value);
110
112
  }
111
113
  emit("filter-change", {
112
114
  name: option.value,
113
- value: props.categories.includes(option.value)
115
+ value: currentCategories.includes(option.value),
116
+ categories: currentCategories
114
117
  });
115
118
  };
116
119
  const search = computed({
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <div>
3
- <v-divider />
4
3
  <div class="d-flex align-center justify-space-between my-6">
5
4
  <v-btn
6
5
  variant="text"
@@ -42,17 +41,17 @@
42
41
  </div>
43
42
  </div>
44
43
  <v-spacer />
45
- <v-btn
46
- class="ma-2"
47
- color="default"
48
- variant="outlined"
49
- rounded="0"
50
- :to="localePath(type === 'people' ? '/people' : '/activities/' + type)"
51
- >
52
- {{ $t("list.pls-x-more", [$rootStore.results[type].total]) }}
53
- </v-btn>
54
44
  </div>
55
45
  <slot />
46
+ <v-btn
47
+ class="ma-2 float-right"
48
+ color="default"
49
+ variant="text"
50
+ rounded="0"
51
+ :to="localePath(type === 'people' ? '/people' : '/activities/' + type)"
52
+ >
53
+ {{ $t("list.pls-x-more", [$rootStore.results[type].total]) }}
54
+ </v-btn>
56
55
  </div>
57
56
  </template>
58
57
 
@@ -85,10 +85,10 @@ const numberOfPages = computed(() => $stores[props.type].numberOfPages);
85
85
  const page = computed(() => +$stores[props.type].page);
86
86
  const items = computed(() => $stores[props.type].items);
87
87
  console.log("setup list");
88
- rootStore.loadRouteQuery(props.type);
89
88
  onMounted(() => {
90
89
  console.log("mounted list");
91
90
  });
91
+ rootStore.loadRouteQuery(props.type);
92
92
  try {
93
93
  await rootStore.update(props.type, locale.value);
94
94
  } catch (error) {
@@ -5,40 +5,64 @@
5
5
  variant="outlined"
6
6
  />
7
7
  <ListMoleculesResultsContainer
8
- v-for="(type, index) in appConfig.list.modules"
9
- :key="index"
8
+ v-for="type in sortedModules"
9
+ :key="type"
10
10
  :feminine="type === 'people'"
11
11
  :type
12
- :open="$rootStore.results[type].total > 0"
12
+ :open="
13
+ open[type] !== undefined
14
+ ? open[type]
15
+ : $rootStore.results[type]?.total > 0
16
+ "
13
17
  @toggle="open[$event] = !open[$event]"
14
18
  >
15
19
  <v-expand-transition class="results-container">
16
20
  <div v-show="open[type]">
17
21
  <ListAtomsResultsList :type />
18
- </div> </v-expand-transition
19
- ></ListMoleculesResultsContainer>
22
+ </div>
23
+ </v-expand-transition>
24
+ </ListMoleculesResultsContainer>
20
25
  </template>
21
26
 
22
27
  <script setup>
23
28
  import {
29
+ useNuxtApp,
30
+ useLocalePath,
24
31
  onBeforeUnmount,
25
32
  onMounted,
26
33
  useI18n,
27
34
  useAppConfig,
28
- useNuxtApp
35
+ ref,
36
+ computed
29
37
  } from "#imports";
38
+ const localePath = useLocalePath();
39
+ defineOptions({
40
+ name: "SearchResults"
41
+ });
30
42
  const { $rootStore } = useNuxtApp();
31
43
  const appConfig = useAppConfig();
32
44
  const { locale } = useI18n();
33
45
  const open = ref({});
34
- onMounted(() => {
46
+ const sortedModules = computed(() => {
47
+ return appConfig.list.modules.slice().sort((a, b) => {
48
+ const aResults = $rootStore.results[a] || { total: 0 };
49
+ const bResults = $rootStore.results[b] || { total: 0 };
50
+ return (bResults.total || 0) - (aResults.total || 0);
51
+ });
52
+ });
53
+ onMounted(async () => {
35
54
  console.log("mounted list");
55
+ try {
56
+ await $rootStore.update("all", locale.value);
57
+ appConfig.list.modules.forEach((type) => {
58
+ if ($rootStore.results[type]?.total > 0) {
59
+ open.value[type] = true;
60
+ }
61
+ });
62
+ } catch (error) {
63
+ console.log("error fetching update list: ", error);
64
+ }
36
65
  });
37
- try {
38
- await $rootStore.update("all", locale.value);
39
- } catch (error) {
40
- console.log("error fetching update list: ", error);
41
- }
42
66
  onBeforeUnmount(() => {
43
67
  });
44
68
  </script>
@@ -2,7 +2,7 @@
2
2
  <v-row
3
3
  v-ripple
4
4
  no-gutters
5
- class="cursor-pointer highlight-on-hover"
5
+ class="cursor-pointer highlight-on-hover my-2"
6
6
  @click="
7
7
  $router.push(localePath('/activities/publications/' + item.slug[locale]))
8
8
  "
@@ -23,6 +23,9 @@
23
23
  <v-skeleton-loader v-if="rootStore.loading" type="heading" />
24
24
  <template v-else>
25
25
  {{ item.name }}
26
+ <div class="text-body-2">
27
+ {{ item.summary }}
28
+ </div>
26
29
  </template>
27
30
  </v-col>
28
31
 
@@ -38,7 +41,9 @@
38
41
 
39
42
  <template v-else>
40
43
  <v-chip class="ma-2" style="background-color: white; color: black">
41
- {{ $t(eventCategory) }}
44
+ {{ $t(eventCategory) }} </v-chip
45
+ ><v-chip class="ma-2" style="background-color: white; color: black">
46
+ {{ $t(eventType) }}
42
47
  </v-chip>
43
48
  <MiscMoleculesChipContainer :items="item.tags" size="small" />
44
49
  </template>
@@ -67,9 +72,18 @@ const props = defineProps({
67
72
  });
68
73
  const eventCategory = computed(() => {
69
74
  if (props.item.category) {
70
- return "list.filters.news.category." + props.item.category;
75
+ console.log("props.item.category: ", props.item.category);
76
+ return "list.filters.publications.category." + props.item.category;
71
77
  } else {
72
- return "list.filters.news.category.others";
78
+ return "list.filters.publications.category.OTHERS";
79
+ }
80
+ });
81
+ const eventType = computed(() => {
82
+ if (props.item.type) {
83
+ console.log("props.item.type: ", props.item.type);
84
+ return "list.filters.publications.type." + props.item.type;
85
+ } else {
86
+ return "list.filters.publications.type.OTHERS";
73
87
  }
74
88
  });
75
89
  </script>
@@ -20,6 +20,8 @@
20
20
  "inscription-ouverte": "Registration Open",
21
21
  "items": {
22
22
  "all": "all | all | all",
23
+ "activities": "activity | activity | activities",
24
+ "about": "about | about | about",
23
25
  "events": "event | event | events",
24
26
  "fellow": "fellow | fellow | fellows",
25
27
  "fellowships": "fellowship | fellowship | fellowships",
@@ -62,7 +64,8 @@
62
64
  "SYMPOSIUM": "Symposium",
63
65
  "EXHIBITION": "Exhibition",
64
66
  "WEBINAR": "Webinar",
65
- "WORKSHOP": "Workshop"
67
+ "WORKSHOP": "Workshop",
68
+ "CALL": "Call to propositions"
66
69
  },
67
70
  "fellowship": {
68
71
  "cat": "Constructive Advanced Thinking",
@@ -149,7 +152,8 @@
149
152
  "REPORT": "Report",
150
153
  "SOFTWARE": "Software",
151
154
  "TOOL": "Tool",
152
- "VIDEO": "Video"
155
+ "VIDEO": "Video",
156
+ "OTHER": "Other"
153
157
  },
154
158
  "tags": {
155
159
  "label": "Tags",
@@ -228,7 +232,8 @@
228
232
  "SEMINAR": "Seminar",
229
233
  "SYMPOSIUM": "Symposium",
230
234
  "WEBINAR": "Webinar",
231
- "WORKSHOP": "Workshop"
235
+ "WORKSHOP": "Workshop",
236
+ "OTHERS": "Others"
232
237
  },
233
238
  "type": {
234
239
  "label": "Type",
@@ -242,7 +247,8 @@
242
247
  "REPORT": "Report",
243
248
  "SOFTWARE": "Software",
244
249
  "THESIS": "Thesis",
245
- "VIDEO": "Video"
250
+ "VIDEO": "Video",
251
+ "OTHERS": "Others"
246
252
  }
247
253
  }
248
254
  },
@@ -62,7 +62,8 @@
62
62
  "SYMPOSIUM": "Symposium",
63
63
  "EXHIBITION": "Exposition",
64
64
  "WEBINAR": "Webinaire",
65
- "WORKSHOP": "Atelier"
65
+ "WORKSHOP": "Atelier",
66
+ "CALL": "Appel à propositions"
66
67
  },
67
68
  "fellowship": {
68
69
  "label": "Programme d'accueil",
@@ -150,7 +151,8 @@
150
151
  "REPORT": "Rapport",
151
152
  "SOFTWARE": "Logiciel",
152
153
  "TOOL": "Outil",
153
- "VIDEO": "Vidéo"
154
+ "VIDEO": "Vidéo",
155
+ "OTHER": "Autres"
154
156
  },
155
157
  "tags": {
156
158
  "label": "Tags",
@@ -229,7 +231,8 @@
229
231
  "SEMINAR": "Séminaire",
230
232
  "SYMPOSIUM": "Symposium",
231
233
  "WEBINAR": "Webinaire",
232
- "WORKSHOP": "Atelier"
234
+ "WORKSHOP": "Atelier",
235
+ "OTHERS": "Autres"
233
236
  },
234
237
  "type": {
235
238
  "label": "Type",
@@ -243,7 +246,8 @@
243
246
  "REPORT": "Rapport",
244
247
  "SOFTWARE": "Logiciel",
245
248
  "THESIS": "Thèse",
246
- "VIDEO": "Vidéo"
249
+ "VIDEO": "Vidéo",
250
+ "OTHERS": "Autres"
247
251
  }
248
252
  }
249
253
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "AGPL-3.0-only",
3
3
  "main": "./dist/module.mjs",
4
- "version": "1.0.107",
4
+ "version": "1.0.108",
5
5
  "name": "@paris-ias/list",
6
6
  "repository": {
7
7
  "url": "git+https://github.com/IEA-Paris/list.git",
@@ -24,7 +24,7 @@
24
24
  "@nuxtjs/apollo": "^5.0.0-alpha.14",
25
25
  "@nuxtjs/i18n": "^9.5.2",
26
26
  "@nuxtjs/mdc": "0.16.1",
27
- "@paris-ias/data": "^1.8.25",
27
+ "@paris-ias/data": "^1.8.27",
28
28
  "@pinia/nuxt": "^0.5.4",
29
29
  "@types/node": "latest",
30
30
  "@urql/exchange-execute": "2.3.1",