@paris-ias/list 1.0.107 → 1.0.109

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.109",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.0",
7
7
  "unbuild": "3.5.0"
@@ -1,83 +1,39 @@
1
1
  <template>
2
2
  <div class="d-flex flex-grow-1 flex-column">
3
- <div class="d-flex align-center">
4
- <v-text-field
5
- v-model.trim="search"
6
- :placeholder="$t('list.search-type', [$t('items.' + type, 2)])"
7
- prepend-inner-icon="mdi-magnify"
8
- single-line
9
- class="transition-swing flex-grow-1"
10
- variant="outlined"
11
- hide-details
12
- clearable
13
- tile
14
- type="search"
15
- :loading="rootStore.loading"
16
- >
17
- <!-- :loading="$nuxt.loading || $store.state.loading" :class="{ 'mt-3':
18
- $store.state.scrolled }" -->
19
- <template v-if="!search" #label>
20
- <div class="searchLabel">
21
- {{
22
- type === "all"
23
- ? $t("search")
24
- : $t("list.search-type", [$t("items." + type, 2)])
25
- }}
26
- </div>
27
- </template>
28
- </v-text-field>
29
-
30
- <v-menu
31
- v-model="filterMenuOpen"
32
- :close-on-content-click="false"
33
- location="bottom end"
34
- offset="4"
35
- >
36
- <template #activator="{ props: menuProps }">
37
- <v-btn
38
- v-bind="menuProps"
39
- :rounded="0"
40
- variant="outlined"
41
- size="large"
42
- height="56"
43
- >
44
- <v-icon>mdi-filter</v-icon>
45
- <v-icon class="ml-1" size="small">
46
- {{ filterMenuOpen ? "mdi-chevron-up" : "mdi-chevron-down" }}
47
- </v-icon>
48
- </v-btn>
49
- </template>
50
-
51
- <v-card min-width="200">
52
- <v-list>
53
- <v-list-item
54
- v-for="option in filterOptions"
55
- :key="option.value"
56
- @click="toggleFilter(option)"
57
- >
58
- <template #prepend>
59
- <v-checkbox
60
- hide-details
61
- :model-value="selectedFilters.includes(option.value)"
62
- @update:model-value="toggleFilter(option)"
63
- />
64
- </template>
65
- <v-list-item-title>{{ option.label }}</v-list-item-title>
66
- </v-list-item>
67
- </v-list>
68
- </v-card>
69
- </v-menu>
70
- </div>
3
+ <v-text-field
4
+ v-model.trim="search"
5
+ :placeholder="$t('list.search-type', [$t('items.' + type, 2)])"
6
+ prepend-inner-icon="mdi-magnify"
7
+ single-line
8
+ class="transition-swing"
9
+ variant="outlined"
10
+ hide-details
11
+ clearable
12
+ tile
13
+ type="search"
14
+ :loading="rootStore.loading"
15
+ >
16
+ <!-- :loading="$nuxt.loading || $store.state.loading" :class="{ 'mt-3':
17
+ $store.state.scrolled }" -->
18
+ <template v-if="!search" #label>
19
+ <div class="searchLabel">
20
+ {{
21
+ type === "all"
22
+ ? $t("search")
23
+ : $t("list.search-type", [$t("items." + type, 2)])
24
+ }}
25
+ </div>
26
+ </template>
27
+ </v-text-field>
71
28
  </div>
72
29
  </template>
73
30
 
74
31
  <script setup>
75
32
  import { useDebounceFn } from "@vueuse/core";
76
33
  import { useRootStore } from "../../../stores/root";
77
- import { computed, useI18n, ref } from "#imports";
78
- const { locale, t } = useI18n();
34
+ import { computed, useI18n } from "#imports";
35
+ const { locale } = useI18n();
79
36
  const rootStore = useRootStore();
80
- const emit = defineEmits(["filter-change"]);
81
37
  const props = defineProps({
82
38
  type: {
83
39
  type: String,
@@ -88,29 +44,6 @@ const props = defineProps({
88
44
  default: false
89
45
  }
90
46
  });
91
- const filterMenuOpen = ref(false);
92
- const selectedFilters = ref([]);
93
- const filterOptions = [
94
- { value: "people", label: capitalize(t("items.people", 2)) },
95
- { value: "events", label: capitalize(t("items.events", 2)) },
96
- { value: "news", label: capitalize(t("items.news", 2)) },
97
- { value: "publications", label: capitalize(t("items.publications", 2)) },
98
- { value: "fellowships", label: capitalize(t("items.fellowships", 2)) },
99
- { value: "projects", label: capitalize(t("items.projects", 2)) }
100
- ];
101
- const toggleFilter = (option) => {
102
- const index = selectedFilters.value.indexOf(option.value);
103
- if (index > -1) {
104
- selectedFilters.value.splice(index, 1);
105
- } else {
106
- selectedFilters.value.push(option.value);
107
- }
108
- emit("filter-change", {
109
- name: option.value,
110
- value: selectedFilters.value.includes(option.value),
111
- allSelected: selectedFilters.value
112
- });
113
- };
114
47
  const search = computed({
115
48
  get() {
116
49
  return rootStore.search;
@@ -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>
@@ -125,7 +125,14 @@
125
125
  :key="position.role + index"
126
126
  class="text-body-2"
127
127
  >
128
- {{ position.role + " " + (position.department || "") }}
128
+ <template v-if="position.role === 'Fellow'">
129
+ <span class="text-caption text-uppercase">
130
+ {{ $t("fellow") }}
131
+ </span>
132
+ </template>
133
+ <template v-else>
134
+ {{ position.role + " " + (position.department || "") }}
135
+ </template>
129
136
  <span v-if="position.start" class="">
130
137
  <!-- TODO FIx dates display -->
131
138
  -
@@ -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>
@@ -13,13 +13,15 @@
13
13
  "see-more": "See more events"
14
14
  },
15
15
  "filters": "Filters",
16
- "from {0} to {1}": "from {0} to {1}",
16
+ "from {0} to {1}": "From {0} to {1}",
17
17
  "gallery": "Gallery",
18
18
  "hybrid-event": "Hybrid event",
19
19
  "inscription-gratuite-et-obligatoire": " Free and mandatory registration",
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
  },
@@ -13,7 +13,7 @@
13
13
  "see-more": "Voir plus d'événements"
14
14
  },
15
15
  "filters": "filtre | filtre | Filtres",
16
- "from {0} to {1}": "de {0} à {1}",
16
+ "from {0} to {1}": "Du {0} à {1}",
17
17
  "gallery": "Galerie",
18
18
  "hybrid-event": "Évènement hybride",
19
19
  "inscription-gratuite-et-obligatoire": "Enregistrement gratuit et obligatoire",
@@ -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.109",
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",