@datagouv/components-next 0.2.0 → 1.0.1
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/README.md +1 -1
- package/assets/main.css +49 -22
- package/dist/Control-BNCDn-8E.js +148 -0
- package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-B5lBpOl8.js} +2 -2
- package/dist/Event-BOgJUhNR.js +738 -0
- package/dist/Image-BN-4XkIn.js +247 -0
- package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-Doz1Z0BS.js} +23 -23
- package/dist/Map-BdT3i2C4.js +7609 -0
- package/dist/MapContainer.client-oiieO8H-.js +105 -0
- package/dist/OSM-CamriM9b.js +71 -0
- package/dist/PdfPreview.client-CdAhkDFJ.js +14513 -0
- package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-B0v8tGJQ.js} +3 -3
- package/dist/ScaleLine-BiesrgOv.js +165 -0
- package/dist/Swagger.client-CsK65JnG.js +4 -0
- package/dist/Tile-DCuqwNOI.js +1206 -0
- package/dist/TileImage-CmZf8EdU.js +1067 -0
- package/dist/View-DcDc7N2K.js +2858 -0
- package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-CrjHf74q.js} +17 -17
- package/dist/common-C4rDcQpp.js +243 -0
- package/dist/components-next.css +1 -1
- package/dist/components-next.js +158 -117
- package/dist/components.css +1 -1
- package/dist/{MapContainer.client-DeSo8EvG.js → index-Bbu9rOHt.js} +4975 -21416
- package/dist/leaflet-src-7m1mB8LI.js +6338 -0
- package/dist/{main-Dgri3TQL.js → main-CiH8ZmBI.js} +56973 -51462
- package/dist/proj-CKwYjU38.js +1569 -0
- package/dist/tilecoord-YW3qEH_j.js +884 -0
- package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-Bi_bsV6C.js} +1 -1
- package/package.json +6 -2
- package/src/components/ActivityList/ActivityList.vue +6 -2
- package/src/components/AppLink.vue +4 -1
- package/src/components/Avatar.vue +2 -2
- package/src/components/AvatarWithName.vue +8 -4
- package/src/components/BouncingDots.vue +21 -0
- package/src/components/BrandedButton.vue +2 -0
- package/src/components/CopyButton.vue +19 -7
- package/src/components/DataserviceCard.vue +85 -120
- package/src/components/DatasetCard.vue +110 -171
- package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
- package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
- package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
- package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
- package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
- package/src/components/DatasetInformation/index.ts +5 -0
- package/src/components/DatasetQuality.vue +23 -16
- package/src/components/DatasetQualityInline.vue +13 -17
- package/src/components/DatasetQualityScore.vue +12 -15
- package/src/components/DatasetQualityTooltipContent.vue +3 -3
- package/src/components/DescriptionList.vue +1 -4
- package/src/components/DescriptionListDetails.vue +5 -0
- package/src/components/DescriptionListTerm.vue +5 -0
- package/src/components/DiscussionMessageCard.vue +63 -0
- package/src/components/ExtraAccordion.vue +4 -4
- package/src/components/Form/BadgeSelect.vue +35 -0
- package/src/components/Form/FormatSelect.vue +28 -0
- package/src/components/Form/GeozoneSelect.vue +52 -0
- package/src/components/Form/GranularitySelect.vue +29 -0
- package/src/components/Form/LicenseSelect.vue +30 -0
- package/src/components/Form/OrganizationSelect.vue +62 -0
- package/src/components/Form/OrganizationTypeSelect.vue +34 -0
- package/src/components/Form/ReuseTopicSelect.vue +29 -0
- package/src/components/Form/SchemaSelect.vue +30 -0
- package/src/components/Form/SearchableSelect.vue +334 -0
- package/src/components/Form/SelectGroup.vue +132 -0
- package/src/components/Form/TagSelect.vue +38 -0
- package/src/components/LeafletMap.vue +31 -0
- package/src/components/LicenseBadge.vue +24 -0
- package/src/components/LoadingBlock.vue +23 -2
- package/src/components/MarkdownViewer.vue +3 -1
- package/src/components/ObjectCard.vue +42 -0
- package/src/components/ObjectCardBadge.vue +22 -0
- package/src/components/ObjectCardHeader.vue +35 -0
- package/src/components/ObjectCardOwner.vue +43 -0
- package/src/components/ObjectCardShortDescription.vue +28 -0
- package/src/components/OrganizationCard.vue +35 -20
- package/src/components/OrganizationHorizontalCard.vue +87 -0
- package/src/components/OrganizationLogo.vue +1 -1
- package/src/components/OrganizationNameWithCertificate.vue +12 -6
- package/src/components/OwnerTypeIcon.vue +1 -0
- package/src/components/Pagination.vue +1 -1
- package/src/components/Placeholder.vue +5 -2
- package/src/components/PostCard.vue +62 -0
- package/src/components/ProgressBar.vue +31 -0
- package/src/components/RadioGroup.vue +32 -0
- package/src/components/RadioInput.vue +64 -0
- package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
- package/src/components/ResourceAccordion/EditButton.vue +2 -3
- package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
- package/src/components/ResourceAccordion/MapContainer.client.vue +21 -17
- package/src/components/ResourceAccordion/Metadata.vue +11 -24
- package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
- package/src/components/ResourceAccordion/Pmtiles.client.vue +2 -2
- package/src/components/ResourceAccordion/Preview.vue +2 -2
- package/src/components/ResourceAccordion/ResourceAccordion.vue +35 -28
- package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
- package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
- package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
- package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
- package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +410 -0
- package/src/components/ReuseCard.vue +8 -28
- package/src/components/ReuseHorizontalCard.vue +80 -0
- package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
- package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
- package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
- package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
- package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
- package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
- package/src/components/Search/Filter/ProducerTypeFilter.vue +49 -0
- package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
- package/src/components/Search/GlobalSearch.vue +707 -0
- package/src/components/Search/SearchInput.vue +63 -0
- package/src/components/Search/Sidemenu.vue +38 -0
- package/src/components/StatBox.vue +5 -5
- package/src/components/Tag.vue +30 -0
- package/src/components/Toggletip.vue +11 -4
- package/src/components/Tooltip.vue +2 -3
- package/src/components/TopicCard.vue +134 -0
- package/src/components/radioGroupContext.ts +9 -0
- package/src/composables/useDebouncedRef.ts +31 -0
- package/src/composables/useHasTabularData.ts +15 -0
- package/src/composables/useMetrics.ts +4 -3
- package/src/composables/useResourceCapabilities.ts +131 -0
- package/src/composables/useRouteQueryBoolean.ts +10 -0
- package/src/composables/useSelectModelSync.ts +89 -0
- package/src/composables/useStableQueryParams.ts +84 -0
- package/src/composables/useTranslation.ts +2 -1
- package/src/config.ts +4 -0
- package/src/functions/api.ts +25 -6
- package/src/functions/api.types.ts +5 -3
- package/src/functions/datasets.ts +1 -29
- package/src/functions/description.ts +33 -0
- package/src/functions/helpers.ts +11 -0
- package/src/functions/markdown.ts +60 -16
- package/src/functions/metrics.ts +33 -0
- package/src/functions/organizations.ts +5 -5
- package/src/functions/resourceCapabilities.ts +55 -0
- package/src/main.ts +96 -7
- package/src/types/dataservices.ts +14 -12
- package/src/types/datasets.ts +20 -7
- package/src/types/discussions.ts +20 -0
- package/src/types/licenses.ts +3 -3
- package/src/types/organizations.ts +13 -1
- package/src/types/owned.ts +4 -2
- package/src/types/pages.ts +70 -0
- package/src/types/posts.ts +27 -0
- package/src/types/resources.ts +16 -0
- package/src/types/reuses.ts +14 -5
- package/src/types/search.ts +407 -0
- package/src/types/users.ts +12 -3
- package/dist/PdfPreview.client-COOkEkRA.js +0 -107
- package/dist/Swagger.client-CpLgaLg6.js +0 -4
- package/dist/pdf-vue3-IkJO65RH.js +0 -273
- package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
- package/src/components/DatasetInformationPanel.vue +0 -211
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import type { PaginatedArray } from './api'
|
|
2
|
+
import type { AccessType } from './access_types'
|
|
3
|
+
import type {
|
|
4
|
+
CERTIFIED,
|
|
5
|
+
PUBLIC_SERVICE,
|
|
6
|
+
ASSOCIATION,
|
|
7
|
+
COMPANY,
|
|
8
|
+
LOCAL_AUTHORITY,
|
|
9
|
+
USER,
|
|
10
|
+
OrganizationTypes } from '../functions/organizations'
|
|
11
|
+
|
|
12
|
+
// Common types
|
|
13
|
+
|
|
14
|
+
export type LastUpdateRange = 'last_30_days' | 'last_12_months' | 'last_3_years'
|
|
15
|
+
|
|
16
|
+
export type ProducerType = Exclude<OrganizationTypes, 'other'> | typeof USER | 'not-specified'
|
|
17
|
+
|
|
18
|
+
export type OrganizationBadgeFilter = typeof CERTIFIED | typeof PUBLIC_SERVICE | typeof ASSOCIATION | typeof COMPANY | typeof LOCAL_AUTHORITY
|
|
19
|
+
|
|
20
|
+
// Base query params (common to all searches)
|
|
21
|
+
|
|
22
|
+
export type BaseSearchQueryParams<Sort extends string> = {
|
|
23
|
+
q?: string
|
|
24
|
+
sort?: Sort
|
|
25
|
+
page?: number
|
|
26
|
+
page_size?: number
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Facet types
|
|
30
|
+
|
|
31
|
+
export type FacetItem = {
|
|
32
|
+
count: number
|
|
33
|
+
name: string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Dataset Search
|
|
37
|
+
|
|
38
|
+
export type DatasetBadgeFilter = 'pivotal-data' | 'spd' | 'inspire' | 'hvd' | 'sl' | 'sr'
|
|
39
|
+
|
|
40
|
+
export type DatasetFormatFamily = 'tabular' | 'machine_readable' | 'geographical' | 'documents' | 'other'
|
|
41
|
+
|
|
42
|
+
export type DatasetAccessTypeFilter = AccessType | 'all'
|
|
43
|
+
|
|
44
|
+
export type DatasetGranularityFilter
|
|
45
|
+
= | 'other'
|
|
46
|
+
| 'country'
|
|
47
|
+
| 'country-group'
|
|
48
|
+
| 'country-subset'
|
|
49
|
+
| 'poi'
|
|
50
|
+
| 'fr:commune'
|
|
51
|
+
| 'fr:epci'
|
|
52
|
+
| 'fr:departement'
|
|
53
|
+
| 'fr:region'
|
|
54
|
+
| 'fr:canton'
|
|
55
|
+
| 'fr:collectivite'
|
|
56
|
+
| 'fr:iris'
|
|
57
|
+
| 'fr:arrondissement'
|
|
58
|
+
|
|
59
|
+
export type DatasetLicenseFilter
|
|
60
|
+
= | 'lov2'
|
|
61
|
+
| 'notspecified'
|
|
62
|
+
| 'fr-lo'
|
|
63
|
+
| 'odc-odbl'
|
|
64
|
+
| 'other-at'
|
|
65
|
+
| 'other-pd'
|
|
66
|
+
| 'cc-by'
|
|
67
|
+
| 'other-open'
|
|
68
|
+
| 'cc-by-sa'
|
|
69
|
+
| 'odc-by'
|
|
70
|
+
| 'cc-zero'
|
|
71
|
+
| 'odc-pddl'
|
|
72
|
+
|
|
73
|
+
export type DatasetSearchSort = 'created' | 'last_update' | 'reuses' | 'followers' | 'views' | '-created' | '-last_update' | '-reuses' | '-followers' | '-views'
|
|
74
|
+
|
|
75
|
+
export type DatasetSearchFilters = {
|
|
76
|
+
tag?: string | string[]
|
|
77
|
+
badge?: DatasetBadgeFilter
|
|
78
|
+
organization?: string
|
|
79
|
+
organization_badge?: OrganizationBadgeFilter
|
|
80
|
+
license?: DatasetLicenseFilter | string
|
|
81
|
+
geozone?: string
|
|
82
|
+
granularity?: DatasetGranularityFilter | DatasetGranularityFilter[]
|
|
83
|
+
format?: string | string[]
|
|
84
|
+
schema?: string | string[]
|
|
85
|
+
temporal_coverage?: string
|
|
86
|
+
featured?: boolean
|
|
87
|
+
topic?: string
|
|
88
|
+
access_type?: DatasetAccessTypeFilter
|
|
89
|
+
format_family?: DatasetFormatFamily
|
|
90
|
+
producer_type?: ProducerType
|
|
91
|
+
last_update_range?: LastUpdateRange
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type DatasetSearchQueryParams = BaseSearchQueryParams<DatasetSearchSort> & DatasetSearchFilters
|
|
95
|
+
|
|
96
|
+
export type DatasetSearchFacets = {
|
|
97
|
+
access_type: FacetItem[]
|
|
98
|
+
badge: FacetItem[]
|
|
99
|
+
format: FacetItem[]
|
|
100
|
+
format_family: FacetItem[]
|
|
101
|
+
geozone: FacetItem[]
|
|
102
|
+
granularity: FacetItem[]
|
|
103
|
+
last_update: FacetItem[]
|
|
104
|
+
license: FacetItem[]
|
|
105
|
+
organization_id_with_name: FacetItem[]
|
|
106
|
+
producer_type: FacetItem[]
|
|
107
|
+
schema: FacetItem[]
|
|
108
|
+
tag: FacetItem[]
|
|
109
|
+
topics: FacetItem[]
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Dataservice Search
|
|
113
|
+
|
|
114
|
+
export type DataserviceAccessTypeFilter = AccessType | 'all'
|
|
115
|
+
|
|
116
|
+
export type DataserviceSearchSort = 'created' | 'views' | 'followers' | '-created' | '-views' | '-followers'
|
|
117
|
+
|
|
118
|
+
export type DataserviceSearchFilters = {
|
|
119
|
+
tag?: string | string[]
|
|
120
|
+
topic?: string
|
|
121
|
+
organization?: string
|
|
122
|
+
archived?: boolean
|
|
123
|
+
featured?: boolean
|
|
124
|
+
access_type?: DataserviceAccessTypeFilter
|
|
125
|
+
producer_type?: ProducerType
|
|
126
|
+
last_update_range?: LastUpdateRange
|
|
127
|
+
is_restricted?: boolean
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export type DataserviceSearchQueryParams = BaseSearchQueryParams<DataserviceSearchSort> & DataserviceSearchFilters
|
|
131
|
+
|
|
132
|
+
export type DataserviceSearchFacets = {
|
|
133
|
+
access_type: FacetItem[]
|
|
134
|
+
badge: FacetItem[]
|
|
135
|
+
last_update: FacetItem[]
|
|
136
|
+
organization_id_with_name: FacetItem[]
|
|
137
|
+
producer_type: FacetItem[]
|
|
138
|
+
tag: FacetItem[]
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Reuse Search
|
|
142
|
+
|
|
143
|
+
export type ReuseTopicFilter
|
|
144
|
+
= | 'others'
|
|
145
|
+
| 'health'
|
|
146
|
+
| 'transport_and_mobility'
|
|
147
|
+
| 'politics_and_public_life'
|
|
148
|
+
| 'housing_and_development'
|
|
149
|
+
| 'environment_and_energy'
|
|
150
|
+
| 'culture_and_recreation'
|
|
151
|
+
| 'society_and_demography'
|
|
152
|
+
| 'economy_and_business'
|
|
153
|
+
| 'open_data_tools'
|
|
154
|
+
| 'education_and_research'
|
|
155
|
+
| 'food_and_agriculture'
|
|
156
|
+
| 'law_and_justice'
|
|
157
|
+
| 'safety_and_security'
|
|
158
|
+
| 'work_and_training'
|
|
159
|
+
|
|
160
|
+
export type ReuseTypeFilter
|
|
161
|
+
= | 'visualization'
|
|
162
|
+
| 'application'
|
|
163
|
+
| 'post'
|
|
164
|
+
| 'news_article'
|
|
165
|
+
| 'api'
|
|
166
|
+
| 'paper'
|
|
167
|
+
| 'idea'
|
|
168
|
+
| 'hardware'
|
|
169
|
+
|
|
170
|
+
export type ReuseSearchSort = 'created' | 'datasets' | 'followers' | 'views' | '-created' | '-datasets' | '-followers' | '-views'
|
|
171
|
+
|
|
172
|
+
export type ReuseSearchFilters = {
|
|
173
|
+
tag?: string | string[]
|
|
174
|
+
organization?: string
|
|
175
|
+
organization_badge?: OrganizationBadgeFilter
|
|
176
|
+
owner?: string
|
|
177
|
+
type?: ReuseTypeFilter
|
|
178
|
+
badge?: string
|
|
179
|
+
featured?: boolean
|
|
180
|
+
topic?: ReuseTopicFilter
|
|
181
|
+
archived?: boolean
|
|
182
|
+
producer_type?: ProducerType
|
|
183
|
+
last_update_range?: LastUpdateRange
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export type ReuseSearchQueryParams = BaseSearchQueryParams<ReuseSearchSort> & ReuseSearchFilters
|
|
187
|
+
|
|
188
|
+
export type ReuseSearchFacets = {
|
|
189
|
+
badge: FacetItem[]
|
|
190
|
+
last_update: FacetItem[]
|
|
191
|
+
organization_id_with_name: FacetItem[]
|
|
192
|
+
producer_type: FacetItem[]
|
|
193
|
+
tag: FacetItem[]
|
|
194
|
+
topic: FacetItem[]
|
|
195
|
+
type: FacetItem[]
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Organization Search
|
|
199
|
+
|
|
200
|
+
export type OrganizationSearchSort = 'reuses' | 'datasets' | 'followers' | 'views' | 'created' | '-reuses' | '-datasets' | '-followers' | '-views' | '-created'
|
|
201
|
+
|
|
202
|
+
export type OrganizationSearchFilters = {
|
|
203
|
+
badge?: OrganizationBadgeFilter
|
|
204
|
+
producer_type?: ProducerType
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export type OrganizationSearchQueryParams = BaseSearchQueryParams<OrganizationSearchSort> & OrganizationSearchFilters
|
|
208
|
+
|
|
209
|
+
export type OrganizationSearchFacets = {
|
|
210
|
+
producer_type: FacetItem[]
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Post Search
|
|
214
|
+
|
|
215
|
+
export type PostSearchSort = 'created' | 'last_modified' | 'published' | '-created' | '-last_modified' | '-published'
|
|
216
|
+
|
|
217
|
+
export type PostSearchFilters = {
|
|
218
|
+
tag?: string | string[]
|
|
219
|
+
last_update_range?: LastUpdateRange
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export type PostSearchQueryParams = BaseSearchQueryParams<PostSearchSort> & PostSearchFilters
|
|
223
|
+
|
|
224
|
+
export type PostSearchFacets = {
|
|
225
|
+
last_update: FacetItem[]
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Discussion Search
|
|
229
|
+
|
|
230
|
+
export type DiscussionObjectType = 'Dataset' | 'Dataservice'
|
|
231
|
+
|
|
232
|
+
export type DiscussionSearchSort = 'created' | 'closed' | '-created' | '-closed'
|
|
233
|
+
|
|
234
|
+
export type DiscussionSearchFilters = {
|
|
235
|
+
closed?: boolean
|
|
236
|
+
last_update_range?: LastUpdateRange
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export type DiscussionSearchQueryParams = BaseSearchQueryParams<DiscussionSearchSort> & DiscussionSearchFilters
|
|
240
|
+
|
|
241
|
+
export type DiscussionSearchFacets = {
|
|
242
|
+
last_update: FacetItem[]
|
|
243
|
+
object_type: FacetItem[]
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Topic Search
|
|
247
|
+
|
|
248
|
+
export type TopicSearchSort = 'name' | 'created' | 'last_modified' | '-name' | '-created' | '-last_modified'
|
|
249
|
+
|
|
250
|
+
export type TopicSearchFilters = {
|
|
251
|
+
tag?: string | string[]
|
|
252
|
+
featured?: boolean
|
|
253
|
+
last_update_range?: LastUpdateRange
|
|
254
|
+
organization?: string
|
|
255
|
+
producer_type?: ProducerType
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export type TopicSearchQueryParams = BaseSearchQueryParams<TopicSearchSort> & TopicSearchFilters
|
|
259
|
+
|
|
260
|
+
export type TopicSearchFacets = {
|
|
261
|
+
last_update: FacetItem[]
|
|
262
|
+
organization_id_with_name: FacetItem[]
|
|
263
|
+
producer_type: FacetItem[]
|
|
264
|
+
tag: FacetItem[]
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
// Search response with facets
|
|
268
|
+
|
|
269
|
+
export type SearchResponseWithFacets<T, F> = PaginatedArray<T> & {
|
|
270
|
+
facets: F
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export type DatasetSearchResponse<T> = SearchResponseWithFacets<T, DatasetSearchFacets>
|
|
274
|
+
export type DataserviceSearchResponse<T> = SearchResponseWithFacets<T, DataserviceSearchFacets>
|
|
275
|
+
export type ReuseSearchResponse<T> = SearchResponseWithFacets<T, ReuseSearchFacets>
|
|
276
|
+
export type OrganizationSearchResponse<T> = SearchResponseWithFacets<T, OrganizationSearchFacets>
|
|
277
|
+
export type PostSearchResponse<T> = SearchResponseWithFacets<T, PostSearchFacets>
|
|
278
|
+
export type DiscussionSearchResponse<T> = SearchResponseWithFacets<T, DiscussionSearchFacets>
|
|
279
|
+
export type TopicSearchResponse<T> = SearchResponseWithFacets<T, TopicSearchFacets>
|
|
280
|
+
|
|
281
|
+
// GlobalSearch configuration types
|
|
282
|
+
|
|
283
|
+
export type HiddenFilter<Filters> = {
|
|
284
|
+
[K in keyof Filters]: { key: K, value: Filters[K] }
|
|
285
|
+
}[keyof Filters]
|
|
286
|
+
|
|
287
|
+
export type SortOption<Sort extends string> = {
|
|
288
|
+
value: Sort
|
|
289
|
+
label: string
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export type DatasetSearchConfig = {
|
|
293
|
+
class: 'datasets'
|
|
294
|
+
name?: string
|
|
295
|
+
hiddenFilters?: HiddenFilter<DatasetSearchFilters>[]
|
|
296
|
+
basicFilters?: (keyof DatasetSearchFilters)[]
|
|
297
|
+
advancedFilters?: (keyof DatasetSearchFilters)[]
|
|
298
|
+
sortOptions?: SortOption<DatasetSearchSort>[]
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export type DataserviceSearchConfig = {
|
|
302
|
+
class: 'dataservices'
|
|
303
|
+
name?: string
|
|
304
|
+
hiddenFilters?: HiddenFilter<DataserviceSearchFilters>[]
|
|
305
|
+
basicFilters?: (keyof DataserviceSearchFilters)[]
|
|
306
|
+
advancedFilters?: (keyof DataserviceSearchFilters)[]
|
|
307
|
+
sortOptions?: SortOption<DataserviceSearchSort>[]
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export type ReuseSearchConfig = {
|
|
311
|
+
class: 'reuses'
|
|
312
|
+
name?: string
|
|
313
|
+
hiddenFilters?: HiddenFilter<ReuseSearchFilters>[]
|
|
314
|
+
basicFilters?: (keyof ReuseSearchFilters)[]
|
|
315
|
+
advancedFilters?: (keyof ReuseSearchFilters)[]
|
|
316
|
+
sortOptions?: SortOption<ReuseSearchSort>[]
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export type OrganizationSearchConfig = {
|
|
320
|
+
class: 'organizations'
|
|
321
|
+
name?: string
|
|
322
|
+
hiddenFilters?: HiddenFilter<OrganizationSearchFilters>[]
|
|
323
|
+
basicFilters?: (keyof OrganizationSearchFilters)[]
|
|
324
|
+
advancedFilters?: (keyof OrganizationSearchFilters)[]
|
|
325
|
+
sortOptions?: SortOption<OrganizationSearchSort>[]
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
export type SearchTypeConfig = DatasetSearchConfig | DataserviceSearchConfig | ReuseSearchConfig | OrganizationSearchConfig
|
|
329
|
+
|
|
330
|
+
export type SearchType = SearchTypeConfig['class']
|
|
331
|
+
|
|
332
|
+
export type GlobalSearchConfig = SearchTypeConfig[]
|
|
333
|
+
|
|
334
|
+
// Helper functions for default configs
|
|
335
|
+
|
|
336
|
+
export const defaultDatasetSortOptions: SortOption<DatasetSearchSort>[] = [
|
|
337
|
+
{ value: '-created', label: 'Date de création' },
|
|
338
|
+
{ value: '-last_update', label: 'Dernière mise à jour' },
|
|
339
|
+
{ value: '-followers', label: `Nombre d'abonnés` },
|
|
340
|
+
{ value: '-reuses', label: 'Nombre de réutilisations' },
|
|
341
|
+
]
|
|
342
|
+
|
|
343
|
+
export const defaultDataserviceSortOptions: SortOption<DataserviceSearchSort>[] = [
|
|
344
|
+
{ value: '-created', label: 'Date de création' },
|
|
345
|
+
]
|
|
346
|
+
|
|
347
|
+
export const defaultReuseSortOptions: SortOption<ReuseSearchSort>[] = [
|
|
348
|
+
{ value: '-created', label: 'Date de création' },
|
|
349
|
+
{ value: '-followers', label: `Nombre d'abonnés` },
|
|
350
|
+
{ value: '-datasets', label: 'Nombre de jeux de données' },
|
|
351
|
+
]
|
|
352
|
+
|
|
353
|
+
export const defaultOrganizationSortOptions: SortOption<OrganizationSearchSort>[] = [
|
|
354
|
+
{ value: '-created', label: 'Date de création' },
|
|
355
|
+
{ value: '-followers', label: `Nombre d'abonnés` },
|
|
356
|
+
{ value: '-datasets', label: 'Nombre de jeux de données' },
|
|
357
|
+
{ value: '-reuses', label: 'Nombre de réutilisations' },
|
|
358
|
+
]
|
|
359
|
+
|
|
360
|
+
export function getDefaultDatasetConfig(overrides?: Partial<Omit<DatasetSearchConfig, 'class'>>): DatasetSearchConfig {
|
|
361
|
+
return {
|
|
362
|
+
class: 'datasets',
|
|
363
|
+
basicFilters: ['format_family', 'access_type', 'last_update_range', 'producer_type', 'badge'],
|
|
364
|
+
advancedFilters: ['organization', 'organization_badge', 'tag', 'format', 'license', 'schema', 'geozone', 'granularity'],
|
|
365
|
+
sortOptions: defaultDatasetSortOptions,
|
|
366
|
+
...overrides,
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export function getDefaultDataserviceConfig(overrides?: Partial<Omit<DataserviceSearchConfig, 'class'>>): DataserviceSearchConfig {
|
|
371
|
+
return {
|
|
372
|
+
class: 'dataservices',
|
|
373
|
+
basicFilters: ['access_type', 'last_update_range', 'producer_type'],
|
|
374
|
+
advancedFilters: ['organization', 'tag'],
|
|
375
|
+
sortOptions: defaultDataserviceSortOptions,
|
|
376
|
+
...overrides,
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
export function getDefaultReuseConfig(overrides?: Partial<Omit<ReuseSearchConfig, 'class'>>): ReuseSearchConfig {
|
|
381
|
+
return {
|
|
382
|
+
class: 'reuses',
|
|
383
|
+
basicFilters: ['type', 'topic', 'last_update_range', 'producer_type'],
|
|
384
|
+
advancedFilters: ['organization', 'organization_badge', 'tag'],
|
|
385
|
+
sortOptions: defaultReuseSortOptions,
|
|
386
|
+
...overrides,
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
export function getDefaultOrganizationConfig(overrides?: Partial<Omit<OrganizationSearchConfig, 'class'>>): OrganizationSearchConfig {
|
|
391
|
+
return {
|
|
392
|
+
class: 'organizations',
|
|
393
|
+
basicFilters: ['producer_type'],
|
|
394
|
+
advancedFilters: [],
|
|
395
|
+
sortOptions: defaultOrganizationSortOptions,
|
|
396
|
+
...overrides,
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
export function getDefaultGlobalSearchConfig(): GlobalSearchConfig {
|
|
401
|
+
return [
|
|
402
|
+
getDefaultDatasetConfig(),
|
|
403
|
+
getDefaultDataserviceConfig(),
|
|
404
|
+
getDefaultReuseConfig(),
|
|
405
|
+
getDefaultOrganizationConfig(),
|
|
406
|
+
]
|
|
407
|
+
}
|
package/src/types/users.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { OrganizationReference } from './organizations'
|
|
2
2
|
|
|
3
3
|
export type UserReference = {
|
|
4
|
+
class: 'User'
|
|
4
5
|
id: string
|
|
5
6
|
first_name: string
|
|
6
7
|
last_name: string
|
|
@@ -11,13 +12,21 @@ export type UserReference = {
|
|
|
11
12
|
avatar_thumbnail: string
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
export type User =
|
|
15
|
+
export type User = {
|
|
16
|
+
id: UserReference['id']
|
|
17
|
+
first_name: UserReference['first_name']
|
|
18
|
+
last_name: UserReference['last_name']
|
|
19
|
+
slug: UserReference['slug']
|
|
20
|
+
uri: UserReference['uri']
|
|
21
|
+
page: UserReference['page']
|
|
22
|
+
avatar: UserReference['avatar']
|
|
23
|
+
avatar_thumbnail: UserReference['avatar_thumbnail']
|
|
15
24
|
apikey?: string
|
|
16
25
|
email?: string
|
|
17
26
|
about: string
|
|
18
27
|
website?: string
|
|
19
28
|
roles?: Array<string>
|
|
20
|
-
organizations: Array<
|
|
29
|
+
organizations: Array<OrganizationReference>
|
|
21
30
|
last_login_at: string | null
|
|
22
31
|
since: string | null
|
|
23
32
|
metrics: {
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, defineAsyncComponent as q, ref as n, computed as w, onMounted as O, createElementBlock as p, openBlock as s, createBlock as d, createCommentVNode as L, createVNode as a, unref as o, toDisplayString as u, withCtx as f, createElementVNode as g } from "vue";
|
|
2
|
-
import { d as S, u as $, j as N, a as h, F as m } from "./main-Dgri3TQL.js";
|
|
3
|
-
const V = { class: "text-xs" }, A = { key: 0 }, H = {
|
|
4
|
-
key: 1,
|
|
5
|
-
class: "text-gray-medium"
|
|
6
|
-
}, j = /* @__PURE__ */ B({
|
|
7
|
-
__name: "PdfPreview.client",
|
|
8
|
-
props: {
|
|
9
|
-
resource: {}
|
|
10
|
-
},
|
|
11
|
-
setup(x) {
|
|
12
|
-
const _ = q(
|
|
13
|
-
() => import("./pdf-vue3-IkJO65RH.js").then((e) => e.default)
|
|
14
|
-
), c = x, F = S(), { t } = $(), r = n(!1), i = n(!1), l = n(null), P = n(!1), v = w(() => N(c.resource)), b = w(() => {
|
|
15
|
-
const e = v.value;
|
|
16
|
-
if (!e)
|
|
17
|
-
return !1;
|
|
18
|
-
const y = F.maxPdfPreviewByteSize ?? 1e7;
|
|
19
|
-
return e <= y;
|
|
20
|
-
}), D = async () => {
|
|
21
|
-
if (!b.value) {
|
|
22
|
-
P.value = !0;
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
i.value = !0, l.value = null;
|
|
26
|
-
try {
|
|
27
|
-
const e = await fetch(c.resource.url, { method: "HEAD" });
|
|
28
|
-
if (!e.ok)
|
|
29
|
-
throw new Error(`HTTP error! status: ${e.status}`);
|
|
30
|
-
r.value = !0;
|
|
31
|
-
} catch (e) {
|
|
32
|
-
console.error("Error testing PDF URL:", e), e instanceof TypeError ? l.value = "network" : l.value = "generic", r.value = !1;
|
|
33
|
-
} finally {
|
|
34
|
-
i.value = !1;
|
|
35
|
-
}
|
|
36
|
-
}, k = (e) => {
|
|
37
|
-
console.log(`PDF loading progress: ${e}%`);
|
|
38
|
-
}, z = () => {
|
|
39
|
-
console.log("PDF download completed");
|
|
40
|
-
}, C = (e) => {
|
|
41
|
-
console.log(`PDF page changed to: ${e}`);
|
|
42
|
-
}, E = (e) => {
|
|
43
|
-
console.log("PDF initialized:", e);
|
|
44
|
-
}, T = (e) => {
|
|
45
|
-
console.error("PDF loading error:", e), e instanceof TypeError ? l.value = "network" : l.value = "generic", r.value = !1;
|
|
46
|
-
};
|
|
47
|
-
return O(() => {
|
|
48
|
-
D();
|
|
49
|
-
}), (e, y) => (s(), p("div", V, [
|
|
50
|
-
r.value ? (s(), p("div", A, [
|
|
51
|
-
a(o(_), {
|
|
52
|
-
src: c.resource.url,
|
|
53
|
-
"show-progress": !0,
|
|
54
|
-
"progress-color": "#0063cb",
|
|
55
|
-
"show-page-tooltip": !0,
|
|
56
|
-
"show-back-to-top-btn": !0,
|
|
57
|
-
"scroll-threshold": 300,
|
|
58
|
-
"pdf-width": "100%",
|
|
59
|
-
"row-gap": 12,
|
|
60
|
-
"use-system-fonts": !0,
|
|
61
|
-
"disable-range": !1,
|
|
62
|
-
"disable-stream": !1,
|
|
63
|
-
"disable-auto-fetch": !1,
|
|
64
|
-
class: "w-full",
|
|
65
|
-
onOnProgress: k,
|
|
66
|
-
onOnComplete: z,
|
|
67
|
-
onOnPageChange: C,
|
|
68
|
-
onOnPdfInit: E,
|
|
69
|
-
onOnError: T
|
|
70
|
-
}, null, 8, ["src"])
|
|
71
|
-
])) : i.value ? (s(), p("div", H, u(o(t)("Chargement de l'aperçu PDF...")), 1)) : P.value ? (s(), d(h, {
|
|
72
|
-
key: 2,
|
|
73
|
-
type: "warning",
|
|
74
|
-
class: "flex items-center space-x-2"
|
|
75
|
-
}, {
|
|
76
|
-
default: f(() => [
|
|
77
|
-
a(o(m), { class: "flex-none size-6" }),
|
|
78
|
-
g("span", null, u(v.value ? o(t)("Fichier PDF trop volumineux pour l'aperçu. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.") : o(t)("L'aperçu n'est pas disponible car la taille du fichier est inconnue. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
|
|
79
|
-
]),
|
|
80
|
-
_: 1
|
|
81
|
-
})) : l.value === "network" ? (s(), d(h, {
|
|
82
|
-
key: 3,
|
|
83
|
-
type: "warning",
|
|
84
|
-
class: "flex items-center space-x-2"
|
|
85
|
-
}, {
|
|
86
|
-
default: f(() => [
|
|
87
|
-
a(o(m), { class: "flex-none size-6" }),
|
|
88
|
-
g("span", null, u(o(t)("Ce fichier PDF ne peut pas être prévisualisé, peut-être parce qu'il est hébergé sur un autre site qui ne l'autorise pas. Pour le consulter, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
})) : l.value ? (s(), d(h, {
|
|
92
|
-
key: 4,
|
|
93
|
-
type: "warning",
|
|
94
|
-
class: "flex items-center space-x-2"
|
|
95
|
-
}, {
|
|
96
|
-
default: f(() => [
|
|
97
|
-
a(o(m), { class: "flex-none size-6" }),
|
|
98
|
-
g("span", null, u(o(t)("Erreur lors du chargement de l'aperçu PDF. Pour consulter le fichier, téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
99
|
-
]),
|
|
100
|
-
_: 1
|
|
101
|
-
})) : L("", !0)
|
|
102
|
-
]));
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
export {
|
|
106
|
-
j as default
|
|
107
|
-
};
|