@paris-ias/list 1.1.11 → 1.1.13

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.1.11",
4
+ "version": "1.1.13",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
@@ -97,6 +97,15 @@ const props = defineProps({
97
97
  required: true,
98
98
  },
99
99
 
100
+ // Logical view selector (e.g. "fellows", "media", "tools"). Fixed per page,
101
+ // resolved server-side into additional filters. Not persisted to the URL or
102
+ // exposed in the filter UI.
103
+ modifier: {
104
+ type: String,
105
+ required: false,
106
+ default: undefined,
107
+ },
108
+
100
109
  addButton: {
101
110
  type: Boolean,
102
111
  required: false,
@@ -113,7 +122,7 @@ rootStore.loadRouteQuery(props.type)
113
122
 
114
123
  // Apollo: reactive query using variables computed from store
115
124
  const variables = computed(() => {
116
- return rootStore.buildListVariables(props.type, locale.value)
125
+ return rootStore.buildListVariables(props.type, locale.value, props.modifier)
117
126
  })
118
127
 
119
128
  // Computed properties for dynamic components
@@ -29,22 +29,35 @@
29
29
  :class="expanded ? 'ml-md-8' : 'ml-md-2'"
30
30
  >
31
31
  <v-skeleton-loader v-if="loading" type="heading" />
32
+
32
33
  <div
33
34
  v-else
34
- class="d-flex justify-space-between text-title align-center pt-md-2"
35
+ class="d-flex justify-space-between text-title align-center"
35
36
  :class="expanded ? 'text-h5 text-md-h4' : 'text-h5'"
36
37
  >
37
- <span
38
- v-html="
39
- searchQuery.length
40
- ? highlightAndTruncate(
41
- 300,
42
- item.firstname + ' ' + item.lastname,
43
- searchQuery.split(' '),
44
- )
45
- : item.firstname + ' ' + item.lastname
46
- "
47
- />
38
+ <div class="d-flex flex-column">
39
+ <span
40
+ v-html="
41
+ searchQuery.length
42
+ ? highlightAndTruncate(
43
+ 300,
44
+ item.firstname + ' ' + item.lastname,
45
+ searchQuery.split(' '),
46
+ )
47
+ : item.firstname + ' ' + item.lastname
48
+ "
49
+ />
50
+ <div
51
+ class="role-label"
52
+ v-if="
53
+ item.groups &&
54
+ (item.groups.team || item.groups.board) &&
55
+ item.latest
56
+ "
57
+ >
58
+ {{ item.latest.role }}
59
+ </div>
60
+ </div>
48
61
  <v-spacer />
49
62
  <PeopleBadges :item="item" />
50
63
  </div>
@@ -130,6 +143,7 @@ import { computed, ref, useRoute, useNuxtApp, useLocalePath } from "#imports"
130
143
  import { useDisplay } from "vuetify"
131
144
  const { name } = useRoute()
132
145
  const localePath = useLocalePath()
146
+ const { locale } = useI18n()
133
147
 
134
148
  const { mdAndUp, name: displayName } = useDisplay()
135
149
  const rootStore = useRootStore()
@@ -202,6 +216,14 @@ const fellowSlug = computed(() => props.item?.slug || props.item?.id)
202
216
  transform: scale(1.05);
203
217
  }
204
218
 
219
+ .role-label {
220
+ font-size: 0.8125rem;
221
+ line-height: 1.4;
222
+ opacity: 0.7;
223
+ padding-bottom: 6px;
224
+ text-transform: uppercase;
225
+ }
226
+
205
227
  .paragraph {
206
228
  max-width: 83ch !important;
207
229
  display: -webkit-box;
@@ -55,7 +55,7 @@ export declare const useRootStore: import("pinia").StoreDefinition<"rootStore",
55
55
  lang: string;
56
56
  writeUrl?: boolean;
57
57
  }): void;
58
- buildListVariables(type: string, lang?: string): any;
58
+ buildListVariables(type: string, lang?: string, modifier?: string): any;
59
59
  applyListResult(type: string, data: Record<string, any>, itemsPerPageOverride?: number): void;
60
60
  }>;
61
61
  export {};
@@ -206,7 +206,7 @@ export const useRootStore = defineStore("rootStore", {
206
206
  }
207
207
  if (writeUrl) this.updateRouteQuery(type);
208
208
  },
209
- buildListVariables(type, lang = "en") {
209
+ buildListVariables(type, lang = "en", modifier) {
210
210
  const { $stores } = useNuxtApp();
211
211
  const itemsPerPage = type === "all" ? 3 : $stores[type]?.itemsPerPage || 10;
212
212
  const filters = {};
@@ -226,6 +226,9 @@ export const useRootStore = defineStore("rootStore", {
226
226
  skip: +$stores[type]?.page === 1 ? 0 : (+$stores[type]?.page - 1) * itemsPerPage,
227
227
  limit: itemsPerPage,
228
228
  ...type !== "all" && localSearch?.length && { search: localSearch },
229
+ // Logical view selector resolved server-side into additional
230
+ // filters. Travels inside `options` alongside filters/sort.
231
+ ...modifier ? { modifier } : {},
229
232
  filters,
230
233
  sort: $stores[type]?.sortKey || ($stores[type]?.sort ? Object.keys($stores[type].sort).find(
231
234
  (key) => $stores[type].sort[key].default
@@ -266,6 +266,7 @@
266
266
  "BOOK_CHAPTER": "Book chapter",
267
267
  "CONFERENCE_PAPER": "Conference paper",
268
268
  "DATA": "Data",
269
+ "NEWS": "News",
269
270
  "PODCAST": "Podcast",
270
271
  "REPORT": "Report",
271
272
  "SOFTWARE": "Software",
@@ -256,6 +256,7 @@
256
256
  "BOOK_CHAPTER": "Chapitre de livre",
257
257
  "CONFERENCE_PAPER": "Actes de conférence",
258
258
  "DATA": "Données",
259
+ "NEWS": "Actualités",
259
260
  "PODCAST": "Podcast",
260
261
  "REPORT": "Rapport",
261
262
  "SOFTWARE": "Logiciel",
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.1.11",
4
+ "version": "1.1.13",
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.1.6"
11
+ "@paris-ias/trees": "^2.2.1"
12
12
  },
13
13
  "description": "Paris IAS List Module",
14
14
  "peerDependencies": {